@react-navigation/stack 6.3.8 → 6.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.
Files changed (186) hide show
  1. package/lib/commonjs/TransitionConfigs/CardStyleInterpolators.js +12 -22
  2. package/lib/commonjs/TransitionConfigs/CardStyleInterpolators.js.map +1 -1
  3. package/lib/commonjs/TransitionConfigs/HeaderStyleInterpolators.js +11 -16
  4. package/lib/commonjs/TransitionConfigs/HeaderStyleInterpolators.js.map +1 -1
  5. package/lib/commonjs/TransitionConfigs/TransitionPresets.js +10 -19
  6. package/lib/commonjs/TransitionConfigs/TransitionPresets.js.map +1 -1
  7. package/lib/commonjs/TransitionConfigs/TransitionSpecs.js +6 -8
  8. package/lib/commonjs/TransitionConfigs/TransitionSpecs.js.map +1 -1
  9. package/lib/commonjs/index.js +0 -18
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/navigators/createStackNavigator.js +9 -17
  12. package/lib/commonjs/navigators/createStackNavigator.js.map +1 -1
  13. package/lib/commonjs/types.js.map +1 -1
  14. package/lib/commonjs/utils/CardAnimationContext.js +0 -5
  15. package/lib/commonjs/utils/CardAnimationContext.js.map +1 -1
  16. package/lib/commonjs/utils/GestureHandlerRefContext.js +0 -5
  17. package/lib/commonjs/utils/GestureHandlerRefContext.js.map +1 -1
  18. package/lib/commonjs/utils/ModalPresentationContext.js +0 -4
  19. package/lib/commonjs/utils/ModalPresentationContext.js.map +1 -1
  20. package/lib/commonjs/utils/conditional.js +1 -3
  21. package/lib/commonjs/utils/conditional.js.map +1 -1
  22. package/lib/commonjs/utils/debounce.js +0 -2
  23. package/lib/commonjs/utils/debounce.js.map +1 -1
  24. package/lib/commonjs/utils/getDistanceForDirection.js +0 -5
  25. package/lib/commonjs/utils/getDistanceForDirection.js.map +1 -1
  26. package/lib/commonjs/utils/getInvertedMultiplier.js +0 -5
  27. package/lib/commonjs/utils/getInvertedMultiplier.js.map +1 -1
  28. package/lib/commonjs/utils/memoize.js +0 -6
  29. package/lib/commonjs/utils/memoize.js.map +1 -1
  30. package/lib/commonjs/utils/useCardAnimation.js +0 -8
  31. package/lib/commonjs/utils/useCardAnimation.js.map +1 -1
  32. package/lib/commonjs/utils/useGestureHandlerRef.js +0 -8
  33. package/lib/commonjs/utils/useGestureHandlerRef.js.map +1 -1
  34. package/lib/commonjs/utils/useKeyboardManager.js +14 -20
  35. package/lib/commonjs/utils/useKeyboardManager.js.map +1 -1
  36. package/lib/commonjs/views/GestureHandler.android.js +0 -2
  37. package/lib/commonjs/views/GestureHandler.android.js.map +1 -1
  38. package/lib/commonjs/views/GestureHandler.ios.js +0 -2
  39. package/lib/commonjs/views/GestureHandler.ios.js.map +1 -1
  40. package/lib/commonjs/views/GestureHandler.js +0 -6
  41. package/lib/commonjs/views/GestureHandler.js.map +1 -1
  42. package/lib/commonjs/views/GestureHandlerNative.js +0 -8
  43. package/lib/commonjs/views/GestureHandlerNative.js.map +1 -1
  44. package/lib/commonjs/views/Header/Header.js +7 -18
  45. package/lib/commonjs/views/Header/Header.js.map +1 -1
  46. package/lib/commonjs/views/Header/HeaderContainer.js +10 -23
  47. package/lib/commonjs/views/Header/HeaderContainer.js.map +1 -1
  48. package/lib/commonjs/views/Header/HeaderSegment.js +6 -20
  49. package/lib/commonjs/views/Header/HeaderSegment.js.map +1 -1
  50. package/lib/commonjs/views/ModalStatusBarManager.js +1 -11
  51. package/lib/commonjs/views/ModalStatusBarManager.js.map +1 -1
  52. package/lib/commonjs/views/Screens.js +2 -16
  53. package/lib/commonjs/views/Screens.js.map +1 -1
  54. package/lib/commonjs/views/Stack/Card.js +17 -80
  55. package/lib/commonjs/views/Stack/Card.js.map +1 -1
  56. package/lib/commonjs/views/Stack/CardContainer.js +3 -30
  57. package/lib/commonjs/views/Stack/CardContainer.js.map +1 -1
  58. package/lib/commonjs/views/Stack/CardSheet.js +2 -11
  59. package/lib/commonjs/views/Stack/CardSheet.js.map +1 -1
  60. package/lib/commonjs/views/Stack/CardStack.js +23 -78
  61. package/lib/commonjs/views/Stack/CardStack.js.map +1 -1
  62. package/lib/commonjs/views/Stack/StackView.js +33 -65
  63. package/lib/commonjs/views/Stack/StackView.js.map +1 -1
  64. package/lib/module/TransitionConfigs/CardStyleInterpolators.js +12 -10
  65. package/lib/module/TransitionConfigs/CardStyleInterpolators.js.map +1 -1
  66. package/lib/module/TransitionConfigs/HeaderStyleInterpolators.js +11 -9
  67. package/lib/module/TransitionConfigs/HeaderStyleInterpolators.js.map +1 -1
  68. package/lib/module/TransitionConfigs/TransitionPresets.js +10 -10
  69. package/lib/module/TransitionConfigs/TransitionPresets.js.map +1 -1
  70. package/lib/module/TransitionConfigs/TransitionSpecs.js +6 -7
  71. package/lib/module/TransitionConfigs/TransitionSpecs.js.map +1 -1
  72. package/lib/module/index.js +5 -4
  73. package/lib/module/index.js.map +1 -1
  74. package/lib/module/navigators/createStackNavigator.js +9 -9
  75. package/lib/module/navigators/createStackNavigator.js.map +1 -1
  76. package/lib/module/types.js.map +1 -1
  77. package/lib/module/utils/CardAnimationContext.js.map +1 -1
  78. package/lib/module/utils/GestureHandlerRefContext.js.map +1 -1
  79. package/lib/module/utils/ModalPresentationContext.js.map +1 -1
  80. package/lib/module/utils/conditional.js +1 -1
  81. package/lib/module/utils/conditional.js.map +1 -1
  82. package/lib/module/utils/debounce.js +0 -1
  83. package/lib/module/utils/debounce.js.map +1 -1
  84. package/lib/module/utils/getDistanceForDirection.js +0 -2
  85. package/lib/module/utils/getDistanceForDirection.js.map +1 -1
  86. package/lib/module/utils/getInvertedMultiplier.js +0 -3
  87. package/lib/module/utils/getInvertedMultiplier.js.map +1 -1
  88. package/lib/module/utils/memoize.js +0 -5
  89. package/lib/module/utils/memoize.js.map +1 -1
  90. package/lib/module/utils/useCardAnimation.js +0 -2
  91. package/lib/module/utils/useCardAnimation.js.map +1 -1
  92. package/lib/module/utils/useGestureHandlerRef.js +0 -2
  93. package/lib/module/utils/useGestureHandlerRef.js.map +1 -1
  94. package/lib/module/utils/useKeyboardManager.js +14 -13
  95. package/lib/module/utils/useKeyboardManager.js.map +1 -1
  96. package/lib/module/views/GestureHandler.android.js.map +1 -1
  97. package/lib/module/views/GestureHandler.ios.js.map +1 -1
  98. package/lib/module/views/GestureHandler.js +0 -2
  99. package/lib/module/views/GestureHandler.js.map +1 -1
  100. package/lib/module/views/GestureHandlerNative.js +0 -1
  101. package/lib/module/views/GestureHandlerNative.js.map +1 -1
  102. package/lib/module/views/Header/Header.js +7 -6
  103. package/lib/module/views/Header/Header.js.map +1 -1
  104. package/lib/module/views/Header/HeaderContainer.js +10 -12
  105. package/lib/module/views/Header/HeaderContainer.js.map +1 -1
  106. package/lib/module/views/Header/HeaderSegment.js +6 -10
  107. package/lib/module/views/Header/HeaderSegment.js.map +1 -1
  108. package/lib/module/views/ModalStatusBarManager.js +1 -3
  109. package/lib/module/views/ModalStatusBarManager.js.map +1 -1
  110. package/lib/module/views/Screens.js +2 -8
  111. package/lib/module/views/Screens.js.map +1 -1
  112. package/lib/module/views/Stack/Card.js +17 -58
  113. package/lib/module/views/Stack/Card.js.map +1 -1
  114. package/lib/module/views/Stack/CardContainer.js +3 -17
  115. package/lib/module/views/Stack/CardContainer.js.map +1 -1
  116. package/lib/module/views/Stack/CardSheet.js +2 -4
  117. package/lib/module/views/Stack/CardSheet.js.map +1 -1
  118. package/lib/module/views/Stack/CardStack.js +23 -60
  119. package/lib/module/views/Stack/CardStack.js.map +1 -1
  120. package/lib/module/views/Stack/StackView.js +34 -51
  121. package/lib/module/views/Stack/StackView.js.map +1 -1
  122. package/lib/typescript/src/TransitionConfigs/CardStyleInterpolators.d.ts +1 -0
  123. package/lib/typescript/src/TransitionConfigs/CardStyleInterpolators.d.ts.map +1 -0
  124. package/lib/typescript/src/TransitionConfigs/HeaderStyleInterpolators.d.ts +1 -0
  125. package/lib/typescript/src/TransitionConfigs/HeaderStyleInterpolators.d.ts.map +1 -0
  126. package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts +1 -0
  127. package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts.map +1 -0
  128. package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts +1 -0
  129. package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts.map +1 -0
  130. package/lib/typescript/src/index.d.ts +1 -0
  131. package/lib/typescript/src/index.d.ts.map +1 -0
  132. package/lib/typescript/src/navigators/createStackNavigator.d.ts +1 -0
  133. package/lib/typescript/src/navigators/createStackNavigator.d.ts.map +1 -0
  134. package/lib/typescript/src/types.d.ts +1 -0
  135. package/lib/typescript/src/types.d.ts.map +1 -0
  136. package/lib/typescript/src/utils/CardAnimationContext.d.ts +1 -0
  137. package/lib/typescript/src/utils/CardAnimationContext.d.ts.map +1 -0
  138. package/lib/typescript/src/utils/GestureHandlerRefContext.d.ts +1 -0
  139. package/lib/typescript/src/utils/GestureHandlerRefContext.d.ts.map +1 -0
  140. package/lib/typescript/src/utils/ModalPresentationContext.d.ts +1 -0
  141. package/lib/typescript/src/utils/ModalPresentationContext.d.ts.map +1 -0
  142. package/lib/typescript/src/utils/conditional.d.ts +1 -0
  143. package/lib/typescript/src/utils/conditional.d.ts.map +1 -0
  144. package/lib/typescript/src/utils/debounce.d.ts +1 -0
  145. package/lib/typescript/src/utils/debounce.d.ts.map +1 -0
  146. package/lib/typescript/src/utils/getDistanceForDirection.d.ts +1 -0
  147. package/lib/typescript/src/utils/getDistanceForDirection.d.ts.map +1 -0
  148. package/lib/typescript/src/utils/getInvertedMultiplier.d.ts +1 -0
  149. package/lib/typescript/src/utils/getInvertedMultiplier.d.ts.map +1 -0
  150. package/lib/typescript/src/utils/memoize.d.ts +1 -0
  151. package/lib/typescript/src/utils/memoize.d.ts.map +1 -0
  152. package/lib/typescript/src/utils/useCardAnimation.d.ts +1 -0
  153. package/lib/typescript/src/utils/useCardAnimation.d.ts.map +1 -0
  154. package/lib/typescript/src/utils/useGestureHandlerRef.d.ts +1 -0
  155. package/lib/typescript/src/utils/useGestureHandlerRef.d.ts.map +1 -0
  156. package/lib/typescript/src/utils/useKeyboardManager.d.ts +1 -0
  157. package/lib/typescript/src/utils/useKeyboardManager.d.ts.map +1 -0
  158. package/lib/typescript/src/views/GestureHandler.android.d.ts +1 -0
  159. package/lib/typescript/src/views/GestureHandler.android.d.ts.map +1 -0
  160. package/lib/typescript/src/views/GestureHandler.d.ts +1 -0
  161. package/lib/typescript/src/views/GestureHandler.d.ts.map +1 -0
  162. package/lib/typescript/src/views/GestureHandler.ios.d.ts +1 -0
  163. package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +1 -0
  164. package/lib/typescript/src/views/GestureHandlerNative.d.ts +1 -0
  165. package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +1 -0
  166. package/lib/typescript/src/views/Header/Header.d.ts +1 -0
  167. package/lib/typescript/src/views/Header/Header.d.ts.map +1 -0
  168. package/lib/typescript/src/views/Header/HeaderContainer.d.ts +1 -0
  169. package/lib/typescript/src/views/Header/HeaderContainer.d.ts.map +1 -0
  170. package/lib/typescript/src/views/Header/HeaderSegment.d.ts +1 -0
  171. package/lib/typescript/src/views/Header/HeaderSegment.d.ts.map +1 -0
  172. package/lib/typescript/src/views/ModalStatusBarManager.d.ts +1 -0
  173. package/lib/typescript/src/views/ModalStatusBarManager.d.ts.map +1 -0
  174. package/lib/typescript/src/views/Screens.d.ts +1 -0
  175. package/lib/typescript/src/views/Screens.d.ts.map +1 -0
  176. package/lib/typescript/src/views/Stack/Card.d.ts +1 -0
  177. package/lib/typescript/src/views/Stack/Card.d.ts.map +1 -0
  178. package/lib/typescript/src/views/Stack/CardContainer.d.ts +1 -0
  179. package/lib/typescript/src/views/Stack/CardContainer.d.ts.map +1 -0
  180. package/lib/typescript/src/views/Stack/CardSheet.d.ts +1 -0
  181. package/lib/typescript/src/views/Stack/CardSheet.d.ts.map +1 -0
  182. package/lib/typescript/src/views/Stack/CardStack.d.ts +1 -0
  183. package/lib/typescript/src/views/Stack/CardStack.d.ts.map +1 -0
  184. package/lib/typescript/src/views/Stack/StackView.d.ts +1 -0
  185. package/lib/typescript/src/views/Stack/StackView.d.ts.map +1 -0
  186. package/package.json +5 -5
@@ -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":[],"sources":["index.tsx"],"sourcesContent":["import * as CardStyleInterpolators from './TransitionConfigs/CardStyleInterpolators';\nimport * as HeaderStyleInterpolators from './TransitionConfigs/HeaderStyleInterpolators';\nimport * as TransitionPresets from './TransitionConfigs/TransitionPresets';\nimport * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';\n\n/**\n * Navigators\n */\nexport { default as createStackNavigator } from './navigators/createStackNavigator';\n\n/**\n * Views\n */\nexport { default as Header } from './views/Header/Header';\nexport { default as StackView } from './views/Stack/StackView';\n\n/**\n * Transition presets\n */\nexport {\n CardStyleInterpolators,\n HeaderStyleInterpolators,\n TransitionPresets,\n TransitionSpecs,\n};\n\n/**\n * Utilities\n */\nexport { default as CardAnimationContext } from './utils/CardAnimationContext';\nexport { default as GestureHandlerRefContext } from './utils/GestureHandlerRefContext';\nexport { default as useCardAnimation } from './utils/useCardAnimation';\nexport { default as useGestureHandlerRef } from './utils/useGestureHandlerRef';\n\n/**\n * Types\n */\nexport type {\n StackCardInterpolatedStyle,\n StackCardInterpolationProps,\n StackCardStyleInterpolator,\n StackHeaderInterpolatedStyle,\n StackHeaderInterpolationProps,\n StackHeaderProps,\n StackHeaderStyleInterpolator,\n StackNavigationEventMap,\n StackNavigationOptions,\n StackNavigationProp,\n StackScreenProps,\n TransitionPreset,\n} from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AAKA;;AAKA;;AACA;;AAeA;;AACA;;AACA;;AACA"}
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.`); // @ts-expect-error: headerMode='none' is deprecated
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.`); // @ts-expect-error: headerMode='none' is deprecated
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(); // Run the operation in the next frame so we're sure all listeners have been run
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({ ..._native.StackActions.popToTop(),
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"],"sources":["createStackNavigator.tsx"],"sourcesContent":["import {\n createNavigatorFactory,\n DefaultNavigatorOptions,\n EventArg,\n ParamListBase,\n StackActionHelpers,\n StackActions,\n StackNavigationState,\n StackRouter,\n StackRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport warnOnce from 'warn-once';\n\nimport type {\n StackHeaderMode,\n StackNavigationConfig,\n StackNavigationEventMap,\n StackNavigationOptions,\n} from '../types';\nimport StackView from '../views/Stack/StackView';\n\ntype Props = DefaultNavigatorOptions<\n ParamListBase,\n StackNavigationState<ParamListBase>,\n StackNavigationOptions,\n StackNavigationEventMap\n> &\n StackRouterOptions &\n StackNavigationConfig;\n\nfunction StackNavigator({\n id,\n initialRouteName,\n children,\n screenListeners,\n screenOptions,\n ...rest\n}: Props) {\n // @ts-expect-error: mode is deprecated\n const mode = rest.mode as 'card' | 'modal' | undefined;\n\n warnOnce(\n mode != null,\n `Stack Navigator: 'mode=\"${mode}\"' is deprecated. Use 'presentation: \"${mode}\"' in 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/stack-navigator#presentation for more details.`\n );\n\n // @ts-expect-error: headerMode='none' is deprecated\n const headerMode = rest.headerMode as StackHeaderMode | 'none' | undefined;\n\n warnOnce(\n headerMode === 'none',\n `Stack Navigator: 'headerMode=\"none\"' is deprecated. Use 'headerShown: false' in 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/stack-navigator/#headershown for more details.`\n );\n\n warnOnce(\n headerMode != null && headerMode !== 'none',\n `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.`\n );\n\n // @ts-expect-error: headerMode='none' is deprecated\n const keyboardHandlingEnabled = rest.keyboardHandlingEnabled;\n\n warnOnce(\n keyboardHandlingEnabled !== undefined,\n `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.`\n );\n\n const defaultScreenOptions: StackNavigationOptions = {\n presentation: mode,\n headerShown: headerMode ? headerMode !== 'none' : true,\n headerMode: headerMode && headerMode !== 'none' ? headerMode : undefined,\n keyboardHandlingEnabled,\n };\n\n const { state, descriptors, navigation, NavigationContent } =\n useNavigationBuilder<\n StackNavigationState<ParamListBase>,\n StackRouterOptions,\n StackActionHelpers<ParamListBase>,\n StackNavigationOptions,\n StackNavigationEventMap\n >(StackRouter, {\n id,\n initialRouteName,\n children,\n screenListeners,\n screenOptions,\n defaultScreenOptions,\n });\n\n React.useEffect(\n () =>\n // @ts-expect-error: there may not be a tab navigator in parent\n navigation.addListener?.('tabPress', (e) => {\n const isFocused = navigation.isFocused();\n\n // Run the operation in the next frame so we're sure all listeners have been run\n // This is necessary to know if preventDefault() has been called\n requestAnimationFrame(() => {\n if (\n state.index > 0 &&\n isFocused &&\n !(e as unknown as EventArg<'tabPress', true>).defaultPrevented\n ) {\n // When user taps on already focused tab and we're inside the tab,\n // reset the stack to replicate native behaviour\n navigation.dispatch({\n ...StackActions.popToTop(),\n target: state.key,\n });\n }\n });\n }),\n [navigation, state.index, state.key]\n );\n\n return (\n <NavigationContent>\n <StackView\n {...rest}\n state={state}\n descriptors={descriptors}\n navigation={navigation}\n />\n </NavigationContent>\n );\n}\n\nexport default createNavigatorFactory<\n StackNavigationState<ParamListBase>,\n StackNavigationOptions,\n StackNavigationEventMap,\n typeof StackNavigator\n>(StackNavigator);\n"],"mappings":";;;;;;;AAAA;;AAYA;;AACA;;AAQA;;;;;;;;;;AAWA,SAASA,cAAT,OAOU;EAAA,IAPc;IACtBC,EADsB;IAEtBC,gBAFsB;IAGtBC,QAHsB;IAItBC,eAJsB;IAKtBC,aALsB;IAMtB,GAAGC;EANmB,CAOd;EACR;EACA,MAAMC,IAAI,GAAGD,IAAI,CAACC,IAAlB;EAEA,IAAAC,iBAAA,EACED,IAAI,IAAI,IADV,EAEG,2BAA0BA,IAAK,yCAAwCA,IAAK,uHAF/E,EAJQ,CASR;;EACA,MAAME,UAAU,GAAGH,IAAI,CAACG,UAAxB;EAEA,IAAAD,iBAAA,EACEC,UAAU,KAAK,MADjB,EAEG,iMAFH;EAKA,IAAAD,iBAAA,EACEC,UAAU,IAAI,IAAd,IAAsBA,UAAU,KAAK,MADvC,EAEG,kMAFH,EAjBQ,CAsBR;;EACA,MAAMC,uBAAuB,GAAGJ,IAAI,CAACI,uBAArC;EAEA,IAAAF,iBAAA,EACEE,uBAAuB,KAAKC,SAD9B,EAEG,4NAFH;EAKA,MAAMC,oBAA4C,GAAG;IACnDC,YAAY,EAAEN,IADqC;IAEnDO,WAAW,EAAEL,UAAU,GAAGA,UAAU,KAAK,MAAlB,GAA2B,IAFC;IAGnDA,UAAU,EAAEA,UAAU,IAAIA,UAAU,KAAK,MAA7B,GAAsCA,UAAtC,GAAmDE,SAHZ;IAInDD;EAJmD,CAArD;EAOA,MAAM;IAAEK,KAAF;IAASC,WAAT;IAAsBC,UAAtB;IAAkCC;EAAlC,IACJ,IAAAC,4BAAA,EAMEC,mBANF,EAMe;IACbnB,EADa;IAEbC,gBAFa;IAGbC,QAHa;IAIbC,eAJa;IAKbC,aALa;IAMbO;EANa,CANf,CADF;EAgBAS,KAAK,CAACC,SAAN,CACE;IAAA;;IAAA,OACE;MADF,yBAEEL,UAAU,CAACM,WAFb,0DAEE,2BAAAN,UAAU,EAAe,UAAf,EAA4BO,CAAD,IAAO;QAC1C,MAAMC,SAAS,GAAGR,UAAU,CAACQ,SAAX,EAAlB,CAD0C,CAG1C;QACA;;QACAC,qBAAqB,CAAC,MAAM;UAC1B,IACEX,KAAK,CAACY,KAAN,GAAc,CAAd,IACAF,SADA,IAEA,CAAED,CAAD,CAA6CI,gBAHhD,EAIE;YACA;YACA;YACAX,UAAU,CAACY,QAAX,CAAoB,EAClB,GAAGC,oBAAA,CAAaC,QAAb,EADe;cAElBC,MAAM,EAAEjB,KAAK,CAACkB;YAFI,CAApB;UAID;QACF,CAboB,CAArB;MAcD,CAnBS;IAFZ;EAAA,CADF,EAuBE,CAAChB,UAAD,EAAaF,KAAK,CAACY,KAAnB,EAA0BZ,KAAK,CAACkB,GAAhC,CAvBF;EA0BA,oBACE,oBAAC,iBAAD,qBACE,oBAAC,kBAAD,eACM3B,IADN;IAEE,KAAK,EAAES,KAFT;IAGE,WAAW,EAAEC,WAHf;IAIE,UAAU,EAAEC;EAJd,GADF,CADF;AAUD;;eAEc,IAAAiB,8BAAA,EAKblC,cALa,C"}
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"],"sources":["CardAnimationContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { StackCardInterpolationProps } from '../types';\n\nexport default React.createContext<StackCardInterpolationProps | undefined>(\n undefined\n);\n"],"mappings":";;;;;;;AAAA;;;;;;4BAIeA,KAAK,CAACC,aAAN,CACbC,SADa,C"}
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"],"sources":["GestureHandlerRefContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default React.createContext<React.Ref<\n import('react-native-gesture-handler').PanGestureHandler\n> | null>(null);\n"],"mappings":";;;;;;;AAAA;;;;;;4BAEeA,KAAK,CAACC,aAAN,CAEL,IAFK,C"}
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"],"sources":["ModalPresentationContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nconst ModalPresentationContext = React.createContext(false);\n\nexport default ModalPresentationContext;\n"],"mappings":";;;;;;;AAAA;;;;;;AAEA,MAAMA,wBAAwB,gBAAGC,KAAK,CAACC,aAAN,CAAoB,KAApB,CAAjC;eAEeF,wB"}
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"],"sources":["conditional.tsx"],"sourcesContent":["import { Animated } from 'react-native';\n\nconst { add, multiply } = Animated;\n\n/**\n * Use an Animated Node based on a condition. Similar to Reanimated's `cond`.\n *\n * @param condition Animated Node representing the condition, must be 0 or 1, 1 means `true`, 0 means `false`\n * @param main Animated Node to use if the condition is `true`\n * @param fallback Animated Node to use if the condition is `false`\n */\nexport default function conditional(\n condition: Animated.AnimatedInterpolation,\n main: Animated.AnimatedInterpolation,\n fallback: Animated.AnimatedInterpolation\n) {\n // To implement this behavior, we multiply the main node with the condition.\n // So if condition is 0, result will be 0, and if condition is 1, result will be main node.\n // Then we multiple reverse of the condition (0 if condition is 1) with the fallback.\n // So if condition is 0, result will be fallback node, and if condition is 1, result will be 0,\n // This way, one of them will always be 0, and other one will be the value we need.\n // In the end we add them both together, 0 + value we need = value we need\n return add(\n multiply(condition, main),\n multiply(\n condition.interpolate({\n inputRange: [0, 1],\n outputRange: [1, 0],\n }),\n fallback\n )\n );\n}\n"],"mappings":";;;;;;;AAAA;;AAEA,MAAM;EAAEA,GAAF;EAAOC;AAAP,IAAoBC,qBAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASC,WAAT,CACbC,SADa,EAEbC,IAFa,EAGbC,QAHa,EAIb;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAON,GAAG,CACRC,QAAQ,CAACG,SAAD,EAAYC,IAAZ,CADA,EAERJ,QAAQ,CACNG,SAAS,CAACG,WAAV,CAAsB;IACpBC,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADQ;IAEpBC,WAAW,EAAE,CAAC,CAAD,EAAI,CAAJ;EAFO,CAAtB,CADM,EAKNH,QALM,CAFA,CAAV;AAUD"}
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"],"sources":["debounce.tsx"],"sourcesContent":["export default function debounce<T extends (...args: any[]) => void>(\n func: T,\n duration: number\n): T {\n let timeout: NodeJS.Timeout | number | undefined;\n\n return function (this: any, ...args) {\n if (!timeout) {\n // eslint-disable-next-line babel/no-invalid-this\n func.apply(this, args);\n\n timeout = setTimeout(() => {\n timeout = undefined;\n }, duration);\n }\n } as T;\n}\n"],"mappings":";;;;;;;AAAe,SAASA,QAAT,CACbC,IADa,EAEbC,QAFa,EAGV;EACH,IAAIC,OAAJ;EAEA,OAAO,YAA8B;IACnC,IAAI,CAACA,OAAL,EAAc;MAAA,kCADeC,IACf;QADeA,IACf;MAAA;;MACZ;MACAH,IAAI,CAACI,KAAL,CAAW,IAAX,EAAiBD,IAAjB;MAEAD,OAAO,GAAGG,UAAU,CAAC,MAAM;QACzBH,OAAO,GAAGI,SAAV;MACD,CAFmB,EAEjBL,QAFiB,CAApB;IAGD;EACF,CATD;AAUD"}
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"],"sources":["getDistanceForDirection.tsx"],"sourcesContent":["import type { GestureDirection, Layout } from '../types';\nimport getInvertedMultiplier from './getInvertedMultiplier';\n\nexport default function getDistanceForDirection(\n layout: Layout,\n gestureDirection: GestureDirection\n): number {\n const multiplier = getInvertedMultiplier(gestureDirection);\n\n switch (gestureDirection) {\n case 'vertical':\n case 'vertical-inverted':\n return layout.height * multiplier;\n case 'horizontal':\n case 'horizontal-inverted':\n return layout.width * multiplier;\n }\n}\n"],"mappings":";;;;;;;AACA;;;;AAEe,SAASA,uBAAT,CACbC,MADa,EAEbC,gBAFa,EAGL;EACR,MAAMC,UAAU,GAAG,IAAAC,8BAAA,EAAsBF,gBAAtB,CAAnB;;EAEA,QAAQA,gBAAR;IACE,KAAK,UAAL;IACA,KAAK,mBAAL;MACE,OAAOD,MAAM,CAACI,MAAP,GAAgBF,UAAvB;;IACF,KAAK,YAAL;IACA,KAAK,qBAAL;MACE,OAAOF,MAAM,CAACK,KAAP,GAAeH,UAAtB;EANJ;AAQD"}
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"],"sources":["getInvertedMultiplier.tsx"],"sourcesContent":["import { I18nManager } from 'react-native';\n\nimport type { GestureDirection } from '../types';\n\nexport default function getInvertedMultiplier(\n gestureDirection: GestureDirection\n): 1 | -1 {\n switch (gestureDirection) {\n case 'vertical':\n return 1;\n case 'vertical-inverted':\n return -1;\n case 'horizontal':\n return I18nManager.getConstants().isRTL ? -1 : 1;\n case 'horizontal-inverted':\n return I18nManager.getConstants().isRTL ? 1 : -1;\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAIe,SAASA,qBAAT,CACbC,gBADa,EAEL;EACR,QAAQA,gBAAR;IACE,KAAK,UAAL;MACE,OAAO,CAAP;;IACF,KAAK,mBAAL;MACE,OAAO,CAAC,CAAR;;IACF,KAAK,YAAL;MACE,OAAOC,wBAAA,CAAYC,YAAZ,GAA2BC,KAA3B,GAAmC,CAAC,CAApC,GAAwC,CAA/C;;IACF,KAAK,qBAAL;MACE,OAAOF,wBAAA,CAAYC,YAAZ,GAA2BC,KAA3B,GAAmC,CAAnC,GAAuC,CAAC,CAA/C;EARJ;AAUD"}
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"],"sources":["memoize.tsx"],"sourcesContent":["export default function memoize<Result, Deps extends readonly any[]>(\n callback: (...deps: Deps) => Result\n) {\n let previous: Deps | undefined;\n let result: Result | undefined;\n\n return (...dependencies: Deps): Result => {\n let hasChanged = false;\n\n if (previous) {\n if (previous.length !== dependencies.length) {\n hasChanged = true;\n } else {\n for (let i = 0; i < previous.length; i++) {\n if (previous[i] !== dependencies[i]) {\n hasChanged = true;\n break;\n }\n }\n }\n } else {\n hasChanged = true;\n }\n\n previous = dependencies;\n\n if (hasChanged || result === undefined) {\n result = callback(...dependencies);\n }\n\n return result;\n };\n}\n"],"mappings":";;;;;;;AAAe,SAASA,OAAT,CACbC,QADa,EAEb;EACA,IAAIC,QAAJ;EACA,IAAIC,MAAJ;EAEA,OAAO,YAAmC;IACxC,IAAIC,UAAU,GAAG,KAAjB;;IADwC,kCAA/BC,YAA+B;MAA/BA,YAA+B;IAAA;;IAGxC,IAAIH,QAAJ,EAAc;MACZ,IAAIA,QAAQ,CAACI,MAAT,KAAoBD,YAAY,CAACC,MAArC,EAA6C;QAC3CF,UAAU,GAAG,IAAb;MACD,CAFD,MAEO;QACL,KAAK,IAAIG,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGL,QAAQ,CAACI,MAA7B,EAAqCC,CAAC,EAAtC,EAA0C;UACxC,IAAIL,QAAQ,CAACK,CAAD,CAAR,KAAgBF,YAAY,CAACE,CAAD,CAAhC,EAAqC;YACnCH,UAAU,GAAG,IAAb;YACA;UACD;QACF;MACF;IACF,CAXD,MAWO;MACLA,UAAU,GAAG,IAAb;IACD;;IAEDF,QAAQ,GAAGG,YAAX;;IAEA,IAAID,UAAU,IAAID,MAAM,KAAKK,SAA7B,EAAwC;MACtCL,MAAM,GAAGF,QAAQ,CAAC,GAAGI,YAAJ,CAAjB;IACD;;IAED,OAAOF,MAAP;EACD,CAzBD;AA0BD"}
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"],"sources":["useCardAnimation.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport CardAnimationContext from './CardAnimationContext';\n\nexport default function useCardAnimation() {\n const animation = React.useContext(CardAnimationContext);\n\n if (animation === undefined) {\n throw new Error(\n \"Couldn't find values for card animation. Are you inside a screen in Stack?\"\n );\n }\n\n return animation;\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;AAEe,SAASA,gBAAT,GAA4B;EACzC,MAAMC,SAAS,GAAGC,KAAK,CAACC,UAAN,CAAiBC,6BAAjB,CAAlB;;EAEA,IAAIH,SAAS,KAAKI,SAAlB,EAA6B;IAC3B,MAAM,IAAIC,KAAJ,CACJ,4EADI,CAAN;EAGD;;EAED,OAAOL,SAAP;AACD"}
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"],"sources":["useGestureHandlerRef.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport StackGestureRefContext from './GestureHandlerRefContext';\n\nexport default function useGestureHandlerRef() {\n const ref = React.useContext(StackGestureRefContext);\n\n if (ref === undefined) {\n throw new Error(\n \"Couldn't find a ref for gesture handler. Are you inside a screen in Stack?\"\n );\n }\n\n return ref;\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;AAEe,SAASA,oBAAT,GAAgC;EAC7C,MAAMC,GAAG,GAAGC,KAAK,CAACC,UAAN,CAAiBC,iCAAjB,CAAZ;;EAEA,IAAIH,GAAG,KAAKI,SAAZ,EAAuB;IACrB,MAAM,IAAIC,KAAJ,CACJ,4EADI,CAAN;EAGD;;EAED,OAAOL,GAAP;AACD"}
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
- const input = _reactNative.TextInput.State.currentlyFocusedInput(); // When a page change begins, blur the currently focused input
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
- input === null || input === void 0 ? void 0 : input.blur(); // Store the id of this input so we can refocus it if change was cancelled
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; // Dismiss the keyboard only if an input was a focused before
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
- } // Cleanup the ID on successful page change
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
- clearKeyboardTimeout(); // The page didn't change, we should restore the focus of text input
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.