@react-navigation/stack 7.0.0-rc.2 → 7.0.0-rc.21

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 (278) hide show
  1. package/lib/commonjs/TransitionConfigs/CardStyleInterpolators.js +1 -1
  2. package/lib/commonjs/TransitionConfigs/HeaderStyleInterpolators.js +2 -1
  3. package/lib/commonjs/TransitionConfigs/HeaderStyleInterpolators.js.map +1 -1
  4. package/lib/commonjs/TransitionConfigs/TransitionPresets.js +3 -3
  5. package/lib/commonjs/index.js +11 -11
  6. package/lib/commonjs/navigators/createStackNavigator.js +12 -9
  7. package/lib/commonjs/navigators/createStackNavigator.js.map +1 -1
  8. package/lib/commonjs/package.json +1 -0
  9. package/lib/commonjs/utils/getDistanceForDirection.js +1 -1
  10. package/lib/commonjs/utils/useCardAnimation.js +1 -1
  11. package/lib/commonjs/utils/useGestureHandlerRef.js +1 -1
  12. package/lib/commonjs/views/GestureHandler.android.js +1 -1
  13. package/lib/commonjs/views/GestureHandler.ios.js +1 -1
  14. package/lib/commonjs/views/GestureHandler.js +4 -1
  15. package/lib/commonjs/views/GestureHandler.js.map +1 -1
  16. package/lib/commonjs/views/GestureHandlerNative.js +9 -7
  17. package/lib/commonjs/views/GestureHandlerNative.js.map +1 -1
  18. package/lib/commonjs/views/Header/Header.js +7 -6
  19. package/lib/commonjs/views/Header/Header.js.map +1 -1
  20. package/lib/commonjs/views/Header/HeaderContainer.js +94 -88
  21. package/lib/commonjs/views/Header/HeaderContainer.js.map +1 -1
  22. package/lib/commonjs/views/Header/HeaderSegment.js +16 -12
  23. package/lib/commonjs/views/Header/HeaderSegment.js.map +1 -1
  24. package/lib/commonjs/views/Screens.js +15 -9
  25. package/lib/commonjs/views/Screens.js.map +1 -1
  26. package/lib/commonjs/views/Stack/Card.js +410 -370
  27. package/lib/commonjs/views/Stack/Card.js.map +1 -1
  28. package/lib/commonjs/views/Stack/CardContainer.js +33 -25
  29. package/lib/commonjs/views/Stack/CardContainer.js.map +1 -1
  30. package/lib/commonjs/views/Stack/CardSheet.js +17 -13
  31. package/lib/commonjs/views/Stack/CardSheet.js.map +1 -1
  32. package/lib/commonjs/views/Stack/CardStack.js +355 -330
  33. package/lib/commonjs/views/Stack/CardStack.js.map +1 -1
  34. package/lib/commonjs/views/Stack/StackView.js +323 -287
  35. package/lib/commonjs/views/Stack/StackView.js.map +1 -1
  36. package/lib/module/TransitionConfigs/CardStyleInterpolators.js +3 -1
  37. package/lib/module/TransitionConfigs/CardStyleInterpolators.js.map +1 -1
  38. package/lib/module/TransitionConfigs/HeaderStyleInterpolators.js +4 -1
  39. package/lib/module/TransitionConfigs/HeaderStyleInterpolators.js.map +1 -1
  40. package/lib/module/TransitionConfigs/TransitionPresets.js +5 -3
  41. package/lib/module/TransitionConfigs/TransitionPresets.js.map +1 -1
  42. package/lib/module/TransitionConfigs/TransitionSpecs.js +2 -0
  43. package/lib/module/TransitionConfigs/TransitionSpecs.js.map +1 -1
  44. package/lib/module/index.js +13 -11
  45. package/lib/module/index.js.map +1 -1
  46. package/lib/module/navigators/createStackNavigator.js +14 -9
  47. package/lib/module/navigators/createStackNavigator.js.map +1 -1
  48. package/lib/module/package.json +1 -0
  49. package/lib/module/types.js +2 -0
  50. package/lib/module/utils/CardAnimationContext.js +2 -0
  51. package/lib/module/utils/CardAnimationContext.js.map +1 -1
  52. package/lib/module/utils/GestureHandlerRefContext.js +2 -0
  53. package/lib/module/utils/GestureHandlerRefContext.js.map +1 -1
  54. package/lib/module/utils/ModalPresentationContext.js +2 -0
  55. package/lib/module/utils/ModalPresentationContext.js.map +1 -1
  56. package/lib/module/utils/conditional.js +2 -0
  57. package/lib/module/utils/conditional.js.map +1 -1
  58. package/lib/module/utils/findLastIndex.js +2 -0
  59. package/lib/module/utils/findLastIndex.js.map +1 -1
  60. package/lib/module/utils/getDistanceForDirection.js +3 -1
  61. package/lib/module/utils/getDistanceForDirection.js.map +1 -1
  62. package/lib/module/utils/getInvertedMultiplier.js +2 -0
  63. package/lib/module/utils/getInvertedMultiplier.js.map +1 -1
  64. package/lib/module/utils/getModalRoutesKeys.js +2 -0
  65. package/lib/module/utils/getModalRoutesKeys.js.map +1 -1
  66. package/lib/module/utils/memoize.js +2 -0
  67. package/lib/module/utils/memoize.js.map +1 -1
  68. package/lib/module/utils/throttle.js +2 -0
  69. package/lib/module/utils/throttle.js.map +1 -1
  70. package/lib/module/utils/useCardAnimation.js +3 -1
  71. package/lib/module/utils/useCardAnimation.js.map +1 -1
  72. package/lib/module/utils/useGestureHandlerRef.js +3 -1
  73. package/lib/module/utils/useGestureHandlerRef.js.map +1 -1
  74. package/lib/module/utils/useKeyboardManager.js +2 -0
  75. package/lib/module/utils/useKeyboardManager.js.map +1 -1
  76. package/lib/module/views/GestureHandler.android.js +3 -1
  77. package/lib/module/views/GestureHandler.android.js.map +1 -1
  78. package/lib/module/views/GestureHandler.ios.js +3 -1
  79. package/lib/module/views/GestureHandler.ios.js.map +1 -1
  80. package/lib/module/views/GestureHandler.js +6 -1
  81. package/lib/module/views/GestureHandler.js.map +1 -1
  82. package/lib/module/views/GestureHandlerNative.js +11 -7
  83. package/lib/module/views/GestureHandlerNative.js.map +1 -1
  84. package/lib/module/views/Header/Header.js +9 -6
  85. package/lib/module/views/Header/Header.js.map +1 -1
  86. package/lib/module/views/Header/HeaderContainer.js +96 -88
  87. package/lib/module/views/Header/HeaderContainer.js.map +1 -1
  88. package/lib/module/views/Header/HeaderSegment.js +18 -12
  89. package/lib/module/views/Header/HeaderSegment.js.map +1 -1
  90. package/lib/module/views/Screens.js +17 -9
  91. package/lib/module/views/Screens.js.map +1 -1
  92. package/lib/module/views/Stack/Card.js +412 -369
  93. package/lib/module/views/Stack/Card.js.map +1 -1
  94. package/lib/module/views/Stack/CardContainer.js +35 -25
  95. package/lib/module/views/Stack/CardContainer.js.map +1 -1
  96. package/lib/module/views/Stack/CardSheet.js +19 -13
  97. package/lib/module/views/Stack/CardSheet.js.map +1 -1
  98. package/lib/module/views/Stack/CardStack.js +357 -329
  99. package/lib/module/views/Stack/CardStack.js.map +1 -1
  100. package/lib/module/views/Stack/StackView.js +325 -286
  101. package/lib/module/views/Stack/StackView.js.map +1 -1
  102. package/lib/typescript/commonjs/package.json +1 -0
  103. package/lib/typescript/commonjs/src/TransitionConfigs/CardStyleInterpolators.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/src/TransitionConfigs/HeaderStyleInterpolators.d.ts.map +1 -0
  105. package/lib/typescript/commonjs/src/TransitionConfigs/TransitionPresets.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/src/TransitionConfigs/TransitionSpecs.d.ts.map +1 -0
  107. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  108. package/lib/typescript/{src → commonjs/src}/navigators/createStackNavigator.d.ts +3 -4
  109. package/lib/typescript/commonjs/src/navigators/createStackNavigator.d.ts.map +1 -0
  110. package/lib/typescript/{src → commonjs/src}/types.d.ts +17 -9
  111. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  112. package/lib/typescript/commonjs/src/utils/CardAnimationContext.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/src/utils/GestureHandlerRefContext.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/src/utils/ModalPresentationContext.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/src/utils/conditional.d.ts.map +1 -0
  116. package/lib/typescript/commonjs/src/utils/findLastIndex.d.ts.map +1 -0
  117. package/lib/typescript/commonjs/src/utils/getDistanceForDirection.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/src/utils/getInvertedMultiplier.d.ts.map +1 -0
  119. package/lib/typescript/commonjs/src/utils/getModalRoutesKeys.d.ts.map +1 -0
  120. package/lib/typescript/commonjs/src/utils/memoize.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/src/utils/throttle.d.ts.map +1 -0
  122. package/lib/typescript/commonjs/src/utils/useCardAnimation.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/src/utils/useGestureHandlerRef.d.ts.map +1 -0
  124. package/lib/typescript/commonjs/src/utils/useKeyboardManager.d.ts.map +1 -0
  125. package/lib/typescript/commonjs/src/views/GestureHandler.android.d.ts.map +1 -0
  126. package/lib/typescript/commonjs/src/views/GestureHandler.d.ts.map +1 -0
  127. package/lib/typescript/commonjs/src/views/GestureHandler.ios.d.ts.map +1 -0
  128. package/lib/typescript/{src → commonjs/src}/views/GestureHandlerNative.d.ts +1 -2
  129. package/lib/typescript/commonjs/src/views/GestureHandlerNative.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/src/views/Header/Header.d.ts.map +1 -0
  131. package/lib/typescript/{src → commonjs/src}/views/Header/HeaderContainer.d.ts +1 -2
  132. package/lib/typescript/commonjs/src/views/Header/HeaderContainer.d.ts.map +1 -0
  133. package/lib/typescript/{src → commonjs/src}/views/Header/HeaderSegment.d.ts +1 -2
  134. package/lib/typescript/commonjs/src/views/Header/HeaderSegment.d.ts.map +1 -0
  135. package/lib/typescript/{src → commonjs/src}/views/Screens.d.ts +2 -2
  136. package/lib/typescript/commonjs/src/views/Screens.d.ts.map +1 -0
  137. package/lib/typescript/{src → commonjs/src}/views/Stack/Card.d.ts +2 -2
  138. package/lib/typescript/commonjs/src/views/Stack/Card.d.ts.map +1 -0
  139. package/lib/typescript/{src → commonjs/src}/views/Stack/CardContainer.d.ts +1 -1
  140. package/lib/typescript/commonjs/src/views/Stack/CardContainer.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/src/views/Stack/CardSheet.d.ts.map +1 -0
  142. package/lib/typescript/{src → commonjs/src}/views/Stack/CardStack.d.ts +1 -1
  143. package/lib/typescript/commonjs/src/views/Stack/CardStack.d.ts.map +1 -0
  144. package/lib/typescript/{src → commonjs/src}/views/Stack/StackView.d.ts +1 -1
  145. package/lib/typescript/commonjs/src/views/Stack/StackView.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -0
  147. package/lib/typescript/module/package.json +1 -0
  148. package/lib/typescript/module/src/TransitionConfigs/CardStyleInterpolators.d.ts +43 -0
  149. package/lib/typescript/module/src/TransitionConfigs/CardStyleInterpolators.d.ts.map +1 -0
  150. package/lib/typescript/module/src/TransitionConfigs/HeaderStyleInterpolators.d.ts +23 -0
  151. package/lib/typescript/module/src/TransitionConfigs/HeaderStyleInterpolators.d.ts.map +1 -0
  152. package/lib/typescript/module/src/TransitionConfigs/TransitionPresets.d.ts +50 -0
  153. package/lib/typescript/module/src/TransitionConfigs/TransitionPresets.d.ts.map +1 -0
  154. package/lib/typescript/module/src/TransitionConfigs/TransitionSpecs.d.ts +46 -0
  155. package/lib/typescript/module/src/TransitionConfigs/TransitionSpecs.d.ts.map +1 -0
  156. package/lib/typescript/module/src/index.d.ts +29 -0
  157. package/lib/typescript/module/src/index.d.ts.map +1 -0
  158. package/lib/typescript/module/src/navigators/createStackNavigator.d.ts +17 -0
  159. package/lib/typescript/module/src/navigators/createStackNavigator.d.ts.map +1 -0
  160. package/lib/typescript/module/src/types.d.ts +544 -0
  161. package/lib/typescript/module/src/types.d.ts.map +1 -0
  162. package/lib/typescript/module/src/utils/CardAnimationContext.d.ts +4 -0
  163. package/lib/typescript/module/src/utils/CardAnimationContext.d.ts.map +1 -0
  164. package/lib/typescript/module/src/utils/GestureHandlerRefContext.d.ts +3 -0
  165. package/lib/typescript/module/src/utils/GestureHandlerRefContext.d.ts.map +1 -0
  166. package/lib/typescript/module/src/utils/ModalPresentationContext.d.ts +3 -0
  167. package/lib/typescript/module/src/utils/ModalPresentationContext.d.ts.map +1 -0
  168. package/lib/typescript/module/src/utils/conditional.d.ts +10 -0
  169. package/lib/typescript/module/src/utils/conditional.d.ts.map +1 -0
  170. package/lib/typescript/module/src/utils/findLastIndex.d.ts +2 -0
  171. package/lib/typescript/module/src/utils/findLastIndex.d.ts.map +1 -0
  172. package/lib/typescript/module/src/utils/getDistanceForDirection.d.ts +3 -0
  173. package/lib/typescript/module/src/utils/getDistanceForDirection.d.ts.map +1 -0
  174. package/lib/typescript/module/src/utils/getInvertedMultiplier.d.ts +3 -0
  175. package/lib/typescript/module/src/utils/getInvertedMultiplier.d.ts.map +1 -0
  176. package/lib/typescript/module/src/utils/getModalRoutesKeys.d.ts +4 -0
  177. package/lib/typescript/module/src/utils/getModalRoutesKeys.d.ts.map +1 -0
  178. package/lib/typescript/module/src/utils/memoize.d.ts +2 -0
  179. package/lib/typescript/module/src/utils/memoize.d.ts.map +1 -0
  180. package/lib/typescript/module/src/utils/throttle.d.ts +2 -0
  181. package/lib/typescript/module/src/utils/throttle.d.ts.map +1 -0
  182. package/lib/typescript/module/src/utils/useCardAnimation.d.ts +2 -0
  183. package/lib/typescript/module/src/utils/useCardAnimation.d.ts.map +1 -0
  184. package/lib/typescript/module/src/utils/useGestureHandlerRef.d.ts +3 -0
  185. package/lib/typescript/module/src/utils/useGestureHandlerRef.d.ts.map +1 -0
  186. package/lib/typescript/module/src/utils/useKeyboardManager.d.ts +6 -0
  187. package/lib/typescript/module/src/utils/useKeyboardManager.d.ts.map +1 -0
  188. package/lib/typescript/module/src/views/GestureHandler.android.d.ts +2 -0
  189. package/lib/typescript/module/src/views/GestureHandler.android.d.ts.map +1 -0
  190. package/lib/typescript/module/src/views/GestureHandler.d.ts +15 -0
  191. package/lib/typescript/module/src/views/GestureHandler.d.ts.map +1 -0
  192. package/lib/typescript/module/src/views/GestureHandler.ios.d.ts +2 -0
  193. package/lib/typescript/module/src/views/GestureHandler.ios.d.ts.map +1 -0
  194. package/lib/typescript/module/src/views/GestureHandlerNative.d.ts +5 -0
  195. package/lib/typescript/module/src/views/GestureHandlerNative.d.ts.map +1 -0
  196. package/lib/typescript/module/src/views/Header/Header.d.ts +4 -0
  197. package/lib/typescript/module/src/views/Header/Header.d.ts.map +1 -0
  198. package/lib/typescript/module/src/views/Header/HeaderContainer.d.ts +19 -0
  199. package/lib/typescript/module/src/views/Header/HeaderContainer.d.ts.map +1 -0
  200. package/lib/typescript/module/src/views/Header/HeaderSegment.d.ts +14 -0
  201. package/lib/typescript/module/src/views/Header/HeaderSegment.d.ts.map +1 -0
  202. package/lib/typescript/module/src/views/Screens.d.ts +14 -0
  203. package/lib/typescript/module/src/views/Screens.d.ts.map +1 -0
  204. package/lib/typescript/module/src/views/Stack/Card.d.ts +77 -0
  205. package/lib/typescript/module/src/views/Stack/Card.d.ts.map +1 -0
  206. package/lib/typescript/module/src/views/Stack/CardContainer.d.ts +60 -0
  207. package/lib/typescript/module/src/views/Stack/CardContainer.d.ts.map +1 -0
  208. package/lib/typescript/module/src/views/Stack/CardSheet.d.ts +14 -0
  209. package/lib/typescript/module/src/views/Stack/CardSheet.d.ts.map +1 -0
  210. package/lib/typescript/module/src/views/Stack/CardStack.d.ts +66 -0
  211. package/lib/typescript/module/src/views/Stack/CardStack.d.ts.map +1 -0
  212. package/lib/typescript/module/src/views/Stack/StackView.d.ts +51 -0
  213. package/lib/typescript/module/src/views/Stack/StackView.d.ts.map +1 -0
  214. package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -0
  215. package/package.json +39 -16
  216. package/src/TransitionConfigs/HeaderStyleInterpolators.tsx +4 -1
  217. package/src/navigators/createStackNavigator.tsx +4 -6
  218. package/src/types.tsx +17 -8
  219. package/src/views/Header/HeaderSegment.tsx +4 -4
  220. package/src/views/Stack/CardContainer.tsx +5 -1
  221. package/src/views/Stack/CardSheet.tsx +19 -13
  222. package/src/views/Stack/CardStack.tsx +0 -3
  223. package/lib/typescript/src/TransitionConfigs/CardStyleInterpolators.d.ts.map +0 -1
  224. package/lib/typescript/src/TransitionConfigs/HeaderStyleInterpolators.d.ts.map +0 -1
  225. package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts.map +0 -1
  226. package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts.map +0 -1
  227. package/lib/typescript/src/index.d.ts.map +0 -1
  228. package/lib/typescript/src/navigators/createStackNavigator.d.ts.map +0 -1
  229. package/lib/typescript/src/types.d.ts.map +0 -1
  230. package/lib/typescript/src/utils/CardAnimationContext.d.ts.map +0 -1
  231. package/lib/typescript/src/utils/GestureHandlerRefContext.d.ts.map +0 -1
  232. package/lib/typescript/src/utils/ModalPresentationContext.d.ts.map +0 -1
  233. package/lib/typescript/src/utils/conditional.d.ts.map +0 -1
  234. package/lib/typescript/src/utils/findLastIndex.d.ts.map +0 -1
  235. package/lib/typescript/src/utils/getDistanceForDirection.d.ts.map +0 -1
  236. package/lib/typescript/src/utils/getInvertedMultiplier.d.ts.map +0 -1
  237. package/lib/typescript/src/utils/getModalRoutesKeys.d.ts.map +0 -1
  238. package/lib/typescript/src/utils/memoize.d.ts.map +0 -1
  239. package/lib/typescript/src/utils/throttle.d.ts.map +0 -1
  240. package/lib/typescript/src/utils/useCardAnimation.d.ts.map +0 -1
  241. package/lib/typescript/src/utils/useGestureHandlerRef.d.ts.map +0 -1
  242. package/lib/typescript/src/utils/useKeyboardManager.d.ts.map +0 -1
  243. package/lib/typescript/src/views/GestureHandler.android.d.ts.map +0 -1
  244. package/lib/typescript/src/views/GestureHandler.d.ts.map +0 -1
  245. package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +0 -1
  246. package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +0 -1
  247. package/lib/typescript/src/views/Header/Header.d.ts.map +0 -1
  248. package/lib/typescript/src/views/Header/HeaderContainer.d.ts.map +0 -1
  249. package/lib/typescript/src/views/Header/HeaderSegment.d.ts.map +0 -1
  250. package/lib/typescript/src/views/Screens.d.ts.map +0 -1
  251. package/lib/typescript/src/views/Stack/Card.d.ts.map +0 -1
  252. package/lib/typescript/src/views/Stack/CardContainer.d.ts.map +0 -1
  253. package/lib/typescript/src/views/Stack/CardSheet.d.ts.map +0 -1
  254. package/lib/typescript/src/views/Stack/CardStack.d.ts.map +0 -1
  255. package/lib/typescript/src/views/Stack/StackView.d.ts.map +0 -1
  256. /package/lib/typescript/{src → commonjs/src}/TransitionConfigs/CardStyleInterpolators.d.ts +0 -0
  257. /package/lib/typescript/{src → commonjs/src}/TransitionConfigs/HeaderStyleInterpolators.d.ts +0 -0
  258. /package/lib/typescript/{src → commonjs/src}/TransitionConfigs/TransitionPresets.d.ts +0 -0
  259. /package/lib/typescript/{src → commonjs/src}/TransitionConfigs/TransitionSpecs.d.ts +0 -0
  260. /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
  261. /package/lib/typescript/{src → commonjs/src}/utils/CardAnimationContext.d.ts +0 -0
  262. /package/lib/typescript/{src → commonjs/src}/utils/GestureHandlerRefContext.d.ts +0 -0
  263. /package/lib/typescript/{src → commonjs/src}/utils/ModalPresentationContext.d.ts +0 -0
  264. /package/lib/typescript/{src → commonjs/src}/utils/conditional.d.ts +0 -0
  265. /package/lib/typescript/{src → commonjs/src}/utils/findLastIndex.d.ts +0 -0
  266. /package/lib/typescript/{src → commonjs/src}/utils/getDistanceForDirection.d.ts +0 -0
  267. /package/lib/typescript/{src → commonjs/src}/utils/getInvertedMultiplier.d.ts +0 -0
  268. /package/lib/typescript/{src → commonjs/src}/utils/getModalRoutesKeys.d.ts +0 -0
  269. /package/lib/typescript/{src → commonjs/src}/utils/memoize.d.ts +0 -0
  270. /package/lib/typescript/{src → commonjs/src}/utils/throttle.d.ts +0 -0
  271. /package/lib/typescript/{src → commonjs/src}/utils/useCardAnimation.d.ts +0 -0
  272. /package/lib/typescript/{src → commonjs/src}/utils/useGestureHandlerRef.d.ts +0 -0
  273. /package/lib/typescript/{src → commonjs/src}/utils/useKeyboardManager.d.ts +0 -0
  274. /package/lib/typescript/{src → commonjs/src}/views/GestureHandler.android.d.ts +0 -0
  275. /package/lib/typescript/{src → commonjs/src}/views/GestureHandler.d.ts +0 -0
  276. /package/lib/typescript/{src → commonjs/src}/views/GestureHandler.ios.d.ts +0 -0
  277. /package/lib/typescript/{src → commonjs/src}/views/Header/Header.d.ts +0 -0
  278. /package/lib/typescript/{src → commonjs/src}/views/Stack/CardSheet.d.ts +0 -0
@@ -1,13 +1,28 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
1
+ "use strict";
2
+
3
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
4
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
8
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
10
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
11
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
12
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2
16
  import Color from 'color';
3
17
  import * as React from 'react';
4
18
  import { Animated, InteractionManager, Platform, StyleSheet, View } from 'react-native';
5
- import { CardAnimationContext } from '../../utils/CardAnimationContext';
6
- import { getDistanceForDirection } from '../../utils/getDistanceForDirection';
7
- import { getInvertedMultiplier } from '../../utils/getInvertedMultiplier';
8
- import { memoize } from '../../utils/memoize';
19
+ import { CardAnimationContext } from "../../utils/CardAnimationContext.js";
20
+ import { getDistanceForDirection } from "../../utils/getDistanceForDirection.js";
21
+ import { getInvertedMultiplier } from "../../utils/getInvertedMultiplier.js";
22
+ import { memoize } from "../../utils/memoize.js";
9
23
  import { GestureState, PanGestureHandler } from '../GestureHandler';
10
- import { CardSheet } from './CardSheet';
24
+ import { CardSheet } from "./CardSheet.js";
25
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
26
  const GESTURE_VELOCITY_IMPACT = 0.3;
12
27
  const TRUE = 1;
13
28
  const FALSE = 0;
@@ -25,395 +40,423 @@ const hasOpacityStyle = style => {
25
40
  }
26
41
  return false;
27
42
  };
28
- export class Card extends React.Component {
29
- static defaultProps = {
30
- shadowEnabled: false,
31
- gestureEnabled: true,
32
- gestureVelocityImpact: GESTURE_VELOCITY_IMPACT,
33
- overlay: ({
34
- style
35
- }) => style ? /*#__PURE__*/React.createElement(Animated.View, {
36
- pointerEvents: "none",
37
- style: [styles.overlay, style]
38
- }) : null
39
- };
40
- componentDidMount() {
41
- if (!this.props.preloaded) {
42
- this.animate({
43
- closing: this.props.closing
44
- });
45
- }
46
- this.isCurrentlyMounted = true;
47
- }
48
- componentDidUpdate(prevProps) {
49
- const {
50
- direction,
51
- layout,
52
- gestureDirection,
53
- closing
54
- } = this.props;
55
- const {
56
- width,
57
- height
58
- } = layout;
59
- if (width !== prevProps.layout.width) {
60
- this.layout.width.setValue(width);
61
- }
62
- if (height !== prevProps.layout.height) {
63
- this.layout.height.setValue(height);
64
- }
65
- if (gestureDirection !== prevProps.gestureDirection) {
66
- this.inverted.setValue(getInvertedMultiplier(gestureDirection, direction === 'rtl'));
67
- }
68
- const toValue = this.getAnimateToValue(this.props);
69
- if (this.getAnimateToValue(prevProps) !== toValue || this.lastToValue !== toValue) {
70
- // We need to trigger the animation when route was closed
71
- // The route might have been closed by a `POP` action or by a gesture
72
- // When route was closed due to a gesture, the animation would've happened already
73
- // It's still important to trigger the animation so that `onClose` is called
74
- // If `onClose` is not called, cleanup step won't be performed for gestures
75
- this.animate({
76
- closing
77
- });
78
- }
79
- }
80
- componentWillUnmount() {
81
- this.props.gesture?.stopAnimation();
82
- this.isCurrentlyMounted = false;
83
- this.handleEndInteraction();
84
- }
85
- isCurrentlyMounted = false;
86
- isClosing = new Animated.Value(FALSE);
87
- inverted = new Animated.Value(getInvertedMultiplier(this.props.gestureDirection, this.props.direction === 'rtl'));
88
- layout = {
89
- width: new Animated.Value(this.props.layout.width),
90
- height: new Animated.Value(this.props.layout.height)
91
- };
92
- isSwiping = new Animated.Value(FALSE);
93
- animate = ({
94
- closing,
95
- velocity
96
- }) => {
97
- const {
98
- transitionSpec,
99
- onOpen,
100
- onClose,
101
- onTransition,
102
- gesture
103
- } = this.props;
104
- const toValue = this.getAnimateToValue({
105
- ...this.props,
106
- closing
43
+ export let Card = /*#__PURE__*/function (_React$Component) {
44
+ function Card(...args) {
45
+ var _this;
46
+ _classCallCheck(this, Card);
47
+ _this = _callSuper(this, Card, [...args]);
48
+ _defineProperty(_this, "isCurrentlyMounted", false);
49
+ _defineProperty(_this, "isClosing", new Animated.Value(FALSE));
50
+ _defineProperty(_this, "inverted", new Animated.Value(getInvertedMultiplier(_this.props.gestureDirection, _this.props.direction === 'rtl')));
51
+ _defineProperty(_this, "layout", {
52
+ width: new Animated.Value(_this.props.layout.width),
53
+ height: new Animated.Value(_this.props.layout.height)
107
54
  });
108
- this.lastToValue = toValue;
109
- this.isClosing.setValue(closing ? TRUE : FALSE);
110
- const spec = closing ? transitionSpec.close : transitionSpec.open;
111
- const animation = spec.animation === 'spring' ? Animated.spring : Animated.timing;
112
- this.setPointerEventsEnabled(!closing);
113
- this.handleStartInteraction();
114
- clearTimeout(this.pendingGestureCallback);
115
- onTransition?.({
55
+ _defineProperty(_this, "isSwiping", new Animated.Value(FALSE));
56
+ _defineProperty(_this, "interactionHandle", void 0);
57
+ _defineProperty(_this, "pendingGestureCallback", void 0);
58
+ _defineProperty(_this, "lastToValue", void 0);
59
+ _defineProperty(_this, "animate", ({
116
60
  closing,
117
- gesture: velocity !== undefined
118
- });
119
- animation(gesture, {
120
- ...spec.config,
121
- velocity,
122
- toValue,
123
- useNativeDriver,
124
- isInteraction: false
125
- }).start(({
126
- finished
61
+ velocity
127
62
  }) => {
128
- this.handleEndInteraction();
129
- clearTimeout(this.pendingGestureCallback);
130
- if (finished) {
131
- if (closing) {
132
- onClose();
133
- } else {
134
- onOpen();
135
- }
136
- if (this.isCurrentlyMounted) {
137
- // Make sure to re-open screen if it wasn't removed
138
- this.forceUpdate();
63
+ const {
64
+ transitionSpec,
65
+ onOpen,
66
+ onClose,
67
+ onTransition,
68
+ gesture
69
+ } = _this.props;
70
+ const toValue = _this.getAnimateToValue({
71
+ ..._this.props,
72
+ closing
73
+ });
74
+ _this.lastToValue = toValue;
75
+ _this.isClosing.setValue(closing ? TRUE : FALSE);
76
+ const spec = closing ? transitionSpec.close : transitionSpec.open;
77
+ const animation = spec.animation === 'spring' ? Animated.spring : Animated.timing;
78
+ _this.setPointerEventsEnabled(!closing);
79
+ _this.handleStartInteraction();
80
+ clearTimeout(_this.pendingGestureCallback);
81
+ onTransition?.({
82
+ closing,
83
+ gesture: velocity !== undefined
84
+ });
85
+ animation(gesture, {
86
+ ...spec.config,
87
+ velocity,
88
+ toValue,
89
+ useNativeDriver,
90
+ isInteraction: false
91
+ }).start(({
92
+ finished
93
+ }) => {
94
+ _this.handleEndInteraction();
95
+ clearTimeout(_this.pendingGestureCallback);
96
+ if (finished) {
97
+ if (closing) {
98
+ onClose();
99
+ } else {
100
+ onOpen();
101
+ }
102
+ if (_this.isCurrentlyMounted) {
103
+ // Make sure to re-open screen if it wasn't removed
104
+ _this.forceUpdate();
105
+ }
139
106
  }
140
- }
107
+ });
141
108
  });
142
- };
143
- getAnimateToValue = ({
144
- closing,
145
- layout,
146
- gestureDirection,
147
- direction,
148
- preloaded
149
- }) => {
150
- if (!closing && !preloaded) {
151
- return 0;
152
- }
153
- return getDistanceForDirection(layout, gestureDirection, direction === 'rtl');
154
- };
155
- setPointerEventsEnabled = enabled => {
156
- const pointerEvents = enabled ? 'box-none' : 'none';
157
- this.ref.current?.setPointerEvents(pointerEvents);
158
- };
159
- handleStartInteraction = () => {
160
- if (this.interactionHandle === undefined) {
161
- this.interactionHandle = InteractionManager.createInteractionHandle();
162
- }
163
- };
164
- handleEndInteraction = () => {
165
- if (this.interactionHandle !== undefined) {
166
- InteractionManager.clearInteractionHandle(this.interactionHandle);
167
- this.interactionHandle = undefined;
168
- }
169
- };
170
- handleGestureStateChange = ({
171
- nativeEvent
172
- }) => {
173
- const {
174
- direction,
109
+ _defineProperty(_this, "getAnimateToValue", ({
110
+ closing,
175
111
  layout,
176
- onClose,
177
- onGestureBegin,
178
- onGestureCanceled,
179
- onGestureEnd,
180
112
  gestureDirection,
181
- gestureVelocityImpact
182
- } = this.props;
183
- switch (nativeEvent.state) {
184
- case GestureState.ACTIVE:
185
- this.isSwiping.setValue(TRUE);
186
- this.handleStartInteraction();
187
- onGestureBegin?.();
188
- break;
189
- case GestureState.CANCELLED:
190
- case GestureState.FAILED:
191
- {
192
- this.isSwiping.setValue(FALSE);
193
- this.handleEndInteraction();
194
- const velocity = gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? nativeEvent.velocityY : nativeEvent.velocityX;
195
- this.animate({
196
- closing: this.props.closing,
197
- velocity
198
- });
199
- onGestureCanceled?.();
113
+ direction,
114
+ preloaded
115
+ }) => {
116
+ if (!closing && !preloaded) {
117
+ return 0;
118
+ }
119
+ return getDistanceForDirection(layout, gestureDirection, direction === 'rtl');
120
+ });
121
+ _defineProperty(_this, "setPointerEventsEnabled", enabled => {
122
+ const pointerEvents = enabled ? 'box-none' : 'none';
123
+ _this.ref.current?.setPointerEvents(pointerEvents);
124
+ });
125
+ _defineProperty(_this, "handleStartInteraction", () => {
126
+ if (_this.interactionHandle === undefined) {
127
+ _this.interactionHandle = InteractionManager.createInteractionHandle();
128
+ }
129
+ });
130
+ _defineProperty(_this, "handleEndInteraction", () => {
131
+ if (_this.interactionHandle !== undefined) {
132
+ InteractionManager.clearInteractionHandle(_this.interactionHandle);
133
+ _this.interactionHandle = undefined;
134
+ }
135
+ });
136
+ _defineProperty(_this, "handleGestureStateChange", ({
137
+ nativeEvent
138
+ }) => {
139
+ const {
140
+ direction,
141
+ layout,
142
+ onClose,
143
+ onGestureBegin,
144
+ onGestureCanceled,
145
+ onGestureEnd,
146
+ gestureDirection,
147
+ gestureVelocityImpact
148
+ } = _this.props;
149
+ switch (nativeEvent.state) {
150
+ case GestureState.ACTIVE:
151
+ _this.isSwiping.setValue(TRUE);
152
+ _this.handleStartInteraction();
153
+ onGestureBegin?.();
200
154
  break;
201
- }
202
- case GestureState.END:
203
- {
204
- this.isSwiping.setValue(FALSE);
205
- let distance;
206
- let translation;
207
- let velocity;
208
- if (gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted') {
209
- distance = layout.height;
210
- translation = nativeEvent.translationY;
211
- velocity = nativeEvent.velocityY;
212
- } else {
213
- distance = layout.width;
214
- translation = nativeEvent.translationX;
215
- velocity = nativeEvent.velocityX;
155
+ case GestureState.CANCELLED:
156
+ case GestureState.FAILED:
157
+ {
158
+ _this.isSwiping.setValue(FALSE);
159
+ _this.handleEndInteraction();
160
+ const velocity = gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? nativeEvent.velocityY : nativeEvent.velocityX;
161
+ _this.animate({
162
+ closing: _this.props.closing,
163
+ velocity
164
+ });
165
+ onGestureCanceled?.();
166
+ break;
216
167
  }
217
- const closing = (translation + velocity * gestureVelocityImpact) * getInvertedMultiplier(gestureDirection, direction === 'rtl') > distance / 2 ? velocity !== 0 || translation !== 0 : this.props.closing;
218
- this.animate({
219
- closing,
220
- velocity
221
- });
222
- if (closing) {
223
- // We call onClose with a delay to make sure that the animation has already started
224
- // This will make sure that the state update caused by this doesn't affect start of animation
225
- this.pendingGestureCallback = setTimeout(() => {
226
- onClose();
168
+ case GestureState.END:
169
+ {
170
+ _this.isSwiping.setValue(FALSE);
171
+ let distance;
172
+ let translation;
173
+ let velocity;
174
+ if (gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted') {
175
+ distance = layout.height;
176
+ translation = nativeEvent.translationY;
177
+ velocity = nativeEvent.velocityY;
178
+ } else {
179
+ distance = layout.width;
180
+ translation = nativeEvent.translationX;
181
+ velocity = nativeEvent.velocityX;
182
+ }
183
+ const closing = (translation + velocity * gestureVelocityImpact) * getInvertedMultiplier(gestureDirection, direction === 'rtl') > distance / 2 ? velocity !== 0 || translation !== 0 : _this.props.closing;
184
+ _this.animate({
185
+ closing,
186
+ velocity
187
+ });
188
+ if (closing) {
189
+ // We call onClose with a delay to make sure that the animation has already started
190
+ // This will make sure that the state update caused by this doesn't affect start of animation
191
+ _this.pendingGestureCallback = setTimeout(() => {
192
+ onClose();
227
193
 
228
- // Trigger an update after we dispatch the action to remove the screen
229
- // This will make sure that we check if the screen didn't get removed so we can cancel the animation
230
- this.forceUpdate();
231
- }, 32);
194
+ // Trigger an update after we dispatch the action to remove the screen
195
+ // This will make sure that we check if the screen didn't get removed so we can cancel the animation
196
+ _this.forceUpdate();
197
+ }, 32);
198
+ }
199
+ onGestureEnd?.();
200
+ break;
232
201
  }
233
- onGestureEnd?.();
234
- break;
235
- }
202
+ }
203
+ });
204
+ // Memoize this to avoid extra work on re-render
205
+ _defineProperty(_this, "getInterpolatedStyle", memoize((styleInterpolator, animation) => styleInterpolator(animation)));
206
+ // Keep track of the animation context when deps changes.
207
+ _defineProperty(_this, "getCardAnimation", memoize((interpolationIndex, current, next, layout, insetTop, insetRight, insetBottom, insetLeft) => ({
208
+ index: interpolationIndex,
209
+ current: {
210
+ progress: current
211
+ },
212
+ next: next && {
213
+ progress: next
214
+ },
215
+ closing: _this.isClosing,
216
+ swiping: _this.isSwiping,
217
+ inverted: _this.inverted,
218
+ layouts: {
219
+ screen: layout
220
+ },
221
+ insets: {
222
+ top: insetTop,
223
+ right: insetRight,
224
+ bottom: insetBottom,
225
+ left: insetLeft
226
+ }
227
+ })));
228
+ _defineProperty(_this, "ref", /*#__PURE__*/React.createRef());
229
+ return _this;
230
+ }
231
+ _inherits(Card, _React$Component);
232
+ return _createClass(Card, [{
233
+ key: "componentDidMount",
234
+ value: function componentDidMount() {
235
+ if (!this.props.preloaded) {
236
+ this.animate({
237
+ closing: this.props.closing
238
+ });
239
+ }
240
+ this.isCurrentlyMounted = true;
236
241
  }
237
- };
238
-
239
- // Memoize this to avoid extra work on re-render
240
- getInterpolatedStyle = memoize((styleInterpolator, animation) => styleInterpolator(animation));
241
-
242
- // Keep track of the animation context when deps changes.
243
- getCardAnimation = memoize((interpolationIndex, current, next, layout, insetTop, insetRight, insetBottom, insetLeft) => ({
244
- index: interpolationIndex,
245
- current: {
246
- progress: current
247
- },
248
- next: next && {
249
- progress: next
250
- },
251
- closing: this.isClosing,
252
- swiping: this.isSwiping,
253
- inverted: this.inverted,
254
- layouts: {
255
- screen: layout
256
- },
257
- insets: {
258
- top: insetTop,
259
- right: insetRight,
260
- bottom: insetBottom,
261
- left: insetLeft
242
+ }, {
243
+ key: "componentDidUpdate",
244
+ value: function componentDidUpdate(prevProps) {
245
+ const {
246
+ direction,
247
+ layout,
248
+ gestureDirection,
249
+ closing
250
+ } = this.props;
251
+ const {
252
+ width,
253
+ height
254
+ } = layout;
255
+ if (width !== prevProps.layout.width) {
256
+ this.layout.width.setValue(width);
257
+ }
258
+ if (height !== prevProps.layout.height) {
259
+ this.layout.height.setValue(height);
260
+ }
261
+ if (gestureDirection !== prevProps.gestureDirection) {
262
+ this.inverted.setValue(getInvertedMultiplier(gestureDirection, direction === 'rtl'));
263
+ }
264
+ const toValue = this.getAnimateToValue(this.props);
265
+ if (this.getAnimateToValue(prevProps) !== toValue || this.lastToValue !== toValue) {
266
+ // We need to trigger the animation when route was closed
267
+ // The route might have been closed by a `POP` action or by a gesture
268
+ // When route was closed due to a gesture, the animation would've happened already
269
+ // It's still important to trigger the animation so that `onClose` is called
270
+ // If `onClose` is not called, cleanup step won't be performed for gestures
271
+ this.animate({
272
+ closing
273
+ });
274
+ }
262
275
  }
263
- }));
264
- gestureActivationCriteria() {
265
- const {
266
- direction,
267
- layout,
268
- gestureDirection,
269
- gestureResponseDistance
270
- } = this.props;
271
- const enableTrackpadTwoFingerGesture = true;
272
- const distance = gestureResponseDistance !== undefined ? gestureResponseDistance : gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? GESTURE_RESPONSE_DISTANCE_VERTICAL : GESTURE_RESPONSE_DISTANCE_HORIZONTAL;
273
- if (gestureDirection === 'vertical') {
274
- return {
275
- maxDeltaX: 15,
276
- minOffsetY: 5,
277
- hitSlop: {
278
- bottom: -layout.height + distance
279
- },
280
- enableTrackpadTwoFingerGesture
281
- };
282
- } else if (gestureDirection === 'vertical-inverted') {
283
- return {
284
- maxDeltaX: 15,
285
- minOffsetY: -5,
286
- hitSlop: {
287
- top: -layout.height + distance
288
- },
289
- enableTrackpadTwoFingerGesture
290
- };
291
- } else {
292
- const hitSlop = -layout.width + distance;
293
- const invertedMultiplier = getInvertedMultiplier(gestureDirection, direction === 'rtl');
294
- if (invertedMultiplier === 1) {
276
+ }, {
277
+ key: "componentWillUnmount",
278
+ value: function componentWillUnmount() {
279
+ this.props.gesture?.stopAnimation();
280
+ this.isCurrentlyMounted = false;
281
+ this.handleEndInteraction();
282
+ }
283
+ }, {
284
+ key: "gestureActivationCriteria",
285
+ value: function gestureActivationCriteria() {
286
+ const {
287
+ direction,
288
+ layout,
289
+ gestureDirection,
290
+ gestureResponseDistance
291
+ } = this.props;
292
+ const enableTrackpadTwoFingerGesture = true;
293
+ const distance = gestureResponseDistance !== undefined ? gestureResponseDistance : gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? GESTURE_RESPONSE_DISTANCE_VERTICAL : GESTURE_RESPONSE_DISTANCE_HORIZONTAL;
294
+ if (gestureDirection === 'vertical') {
295
295
  return {
296
- minOffsetX: 5,
297
- maxDeltaY: 20,
296
+ maxDeltaX: 15,
297
+ minOffsetY: 5,
298
298
  hitSlop: {
299
- right: hitSlop
299
+ bottom: -layout.height + distance
300
300
  },
301
301
  enableTrackpadTwoFingerGesture
302
302
  };
303
- } else {
303
+ } else if (gestureDirection === 'vertical-inverted') {
304
304
  return {
305
- minOffsetX: -5,
306
- maxDeltaY: 20,
305
+ maxDeltaX: 15,
306
+ minOffsetY: -5,
307
307
  hitSlop: {
308
- left: hitSlop
308
+ top: -layout.height + distance
309
309
  },
310
310
  enableTrackpadTwoFingerGesture
311
311
  };
312
+ } else {
313
+ const hitSlop = -layout.width + distance;
314
+ const invertedMultiplier = getInvertedMultiplier(gestureDirection, direction === 'rtl');
315
+ if (invertedMultiplier === 1) {
316
+ return {
317
+ minOffsetX: 5,
318
+ maxDeltaY: 20,
319
+ hitSlop: {
320
+ right: hitSlop
321
+ },
322
+ enableTrackpadTwoFingerGesture
323
+ };
324
+ } else {
325
+ return {
326
+ minOffsetX: -5,
327
+ maxDeltaY: 20,
328
+ hitSlop: {
329
+ left: hitSlop
330
+ },
331
+ enableTrackpadTwoFingerGesture
332
+ };
333
+ }
312
334
  }
313
335
  }
314
- }
315
- ref = /*#__PURE__*/React.createRef();
316
- render() {
317
- const {
318
- styleInterpolator,
319
- interpolationIndex,
320
- current,
321
- gesture,
322
- next,
323
- layout,
324
- insets,
325
- overlay,
326
- overlayEnabled,
327
- shadowEnabled,
328
- gestureEnabled,
329
- gestureDirection,
330
- pageOverflowEnabled,
331
- children,
332
- containerStyle: customContainerStyle,
333
- contentStyle,
334
- /* eslint-disable @typescript-eslint/no-unused-vars */
335
- closing,
336
- direction,
337
- gestureResponseDistance,
338
- gestureVelocityImpact,
339
- onClose,
340
- onGestureBegin,
341
- onGestureCanceled,
342
- onGestureEnd,
343
- onOpen,
344
- onTransition,
345
- transitionSpec,
346
- /* eslint-enable @typescript-eslint/no-unused-vars */
347
- ...rest
348
- } = this.props;
349
- const interpolationProps = this.getCardAnimation(interpolationIndex, current, next, layout, insets.top, insets.right, insets.bottom, insets.left);
350
- const interpolatedStyle = this.getInterpolatedStyle(styleInterpolator, interpolationProps);
351
- const {
352
- containerStyle,
353
- cardStyle,
354
- overlayStyle,
355
- shadowStyle
356
- } = interpolatedStyle;
357
- const handleGestureEvent = gestureEnabled ? Animated.event([{
358
- nativeEvent: gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? {
359
- translationY: gesture
360
- } : {
361
- translationX: gesture
362
- }
363
- }], {
364
- useNativeDriver
365
- }) : undefined;
366
- const {
367
- backgroundColor
368
- } = StyleSheet.flatten(contentStyle || {});
369
- const isTransparent = typeof backgroundColor === 'string' ? Color(backgroundColor).alpha() === 0 : false;
370
- return /*#__PURE__*/React.createElement(CardAnimationContext.Provider, {
371
- value: interpolationProps
372
- }, /*#__PURE__*/React.createElement(Animated.View, {
373
- style: {
374
- // This is a dummy style that doesn't actually change anything visually.
375
- // Animated needs the animated value to be used somewhere, otherwise things don't update properly.
376
- // If we disable animations and hide header, it could end up making the value unused.
377
- // So we have this dummy style that will always be used regardless of what else changed.
378
- opacity: current
379
- }
380
- // Make sure that this view isn't removed. If this view is removed, our style with animated value won't apply
381
- ,
382
- collapsable: false
383
- }), /*#__PURE__*/React.createElement(View, _extends({
384
- pointerEvents: "box-none"
385
- // Make sure this view is not removed on the new architecture, as it causes focus loss during navigation on Android.
386
- // This can happen when the view flattening results in different trees - due to `overflow` style changing in a parent.
387
- ,
388
- collapsable: false
389
- }, rest), overlayEnabled ? /*#__PURE__*/React.createElement(View, {
390
- pointerEvents: "box-none",
391
- style: StyleSheet.absoluteFill
392
- }, overlay({
393
- style: overlayStyle
394
- })) : null, /*#__PURE__*/React.createElement(Animated.View, {
395
- style: [styles.container, containerStyle, customContainerStyle],
396
- pointerEvents: "box-none"
397
- }, /*#__PURE__*/React.createElement(PanGestureHandler, _extends({
398
- enabled: layout.width !== 0 && gestureEnabled,
399
- onGestureEvent: handleGestureEvent,
400
- onHandlerStateChange: this.handleGestureStateChange
401
- }, this.gestureActivationCriteria()), /*#__PURE__*/React.createElement(Animated.View, {
402
- needsOffscreenAlphaCompositing: hasOpacityStyle(cardStyle),
403
- style: [styles.container, cardStyle]
404
- }, shadowEnabled && shadowStyle && !isTransparent ? /*#__PURE__*/React.createElement(Animated.View, {
405
- style: [styles.shadow, gestureDirection === 'horizontal' ? [styles.shadowHorizontal, styles.shadowStart] : gestureDirection === 'horizontal-inverted' ? [styles.shadowHorizontal, styles.shadowEnd] : gestureDirection === 'vertical' ? [styles.shadowVertical, styles.shadowTop] : [styles.shadowVertical, styles.shadowBottom], {
336
+ }, {
337
+ key: "render",
338
+ value: function render() {
339
+ const {
340
+ styleInterpolator,
341
+ interpolationIndex,
342
+ current,
343
+ gesture,
344
+ next,
345
+ layout,
346
+ insets,
347
+ overlay,
348
+ overlayEnabled,
349
+ shadowEnabled,
350
+ gestureEnabled,
351
+ gestureDirection,
352
+ pageOverflowEnabled,
353
+ children,
354
+ containerStyle: customContainerStyle,
355
+ contentStyle,
356
+ /* eslint-disable @typescript-eslint/no-unused-vars */
357
+ closing,
358
+ direction,
359
+ gestureResponseDistance,
360
+ gestureVelocityImpact,
361
+ onClose,
362
+ onGestureBegin,
363
+ onGestureCanceled,
364
+ onGestureEnd,
365
+ onOpen,
366
+ onTransition,
367
+ transitionSpec,
368
+ /* eslint-enable @typescript-eslint/no-unused-vars */
369
+ ...rest
370
+ } = this.props;
371
+ const interpolationProps = this.getCardAnimation(interpolationIndex, current, next, layout, insets.top, insets.right, insets.bottom, insets.left);
372
+ const interpolatedStyle = this.getInterpolatedStyle(styleInterpolator, interpolationProps);
373
+ const {
374
+ containerStyle,
375
+ cardStyle,
376
+ overlayStyle,
377
+ shadowStyle
378
+ } = interpolatedStyle;
379
+ const handleGestureEvent = gestureEnabled ? Animated.event([{
380
+ nativeEvent: gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? {
381
+ translationY: gesture
382
+ } : {
383
+ translationX: gesture
384
+ }
385
+ }], {
386
+ useNativeDriver
387
+ }) : undefined;
388
+ const {
406
389
  backgroundColor
407
- }, shadowStyle],
408
- pointerEvents: "none"
409
- }) : null, /*#__PURE__*/React.createElement(CardSheet, {
410
- ref: this.ref,
411
- enabled: pageOverflowEnabled,
412
- layout: layout,
413
- style: contentStyle
414
- }, children))))));
415
- }
416
- }
390
+ } = StyleSheet.flatten(contentStyle || {});
391
+ const isTransparent = typeof backgroundColor === 'string' ? Color(backgroundColor).alpha() === 0 : false;
392
+ return /*#__PURE__*/_jsxs(CardAnimationContext.Provider, {
393
+ value: interpolationProps,
394
+ children: [/*#__PURE__*/_jsx(Animated.View, {
395
+ style: {
396
+ // This is a dummy style that doesn't actually change anything visually.
397
+ // Animated needs the animated value to be used somewhere, otherwise things don't update properly.
398
+ // If we disable animations and hide header, it could end up making the value unused.
399
+ // So we have this dummy style that will always be used regardless of what else changed.
400
+ opacity: current
401
+ }
402
+ // Make sure that this view isn't removed. If this view is removed, our style with animated value won't apply
403
+ ,
404
+ collapsable: false
405
+ }), /*#__PURE__*/_jsxs(View, {
406
+ pointerEvents: "box-none"
407
+ // Make sure this view is not removed on the new architecture, as it causes focus loss during navigation on Android.
408
+ // This can happen when the view flattening results in different trees - due to `overflow` style changing in a parent.
409
+ ,
410
+ collapsable: false,
411
+ ...rest,
412
+ children: [overlayEnabled ? /*#__PURE__*/_jsx(View, {
413
+ pointerEvents: "box-none",
414
+ style: StyleSheet.absoluteFill,
415
+ children: overlay({
416
+ style: overlayStyle
417
+ })
418
+ }) : null, /*#__PURE__*/_jsx(Animated.View, {
419
+ style: [styles.container, containerStyle, customContainerStyle],
420
+ pointerEvents: "box-none",
421
+ children: /*#__PURE__*/_jsx(PanGestureHandler, {
422
+ enabled: layout.width !== 0 && gestureEnabled,
423
+ onGestureEvent: handleGestureEvent,
424
+ onHandlerStateChange: this.handleGestureStateChange,
425
+ ...this.gestureActivationCriteria(),
426
+ children: /*#__PURE__*/_jsxs(Animated.View, {
427
+ needsOffscreenAlphaCompositing: hasOpacityStyle(cardStyle),
428
+ style: [styles.container, cardStyle],
429
+ children: [shadowEnabled && shadowStyle && !isTransparent ? /*#__PURE__*/_jsx(Animated.View, {
430
+ style: [styles.shadow, gestureDirection === 'horizontal' ? [styles.shadowHorizontal, styles.shadowStart] : gestureDirection === 'horizontal-inverted' ? [styles.shadowHorizontal, styles.shadowEnd] : gestureDirection === 'vertical' ? [styles.shadowVertical, styles.shadowTop] : [styles.shadowVertical, styles.shadowBottom], {
431
+ backgroundColor
432
+ }, shadowStyle],
433
+ pointerEvents: "none"
434
+ }) : null, /*#__PURE__*/_jsx(CardSheet, {
435
+ ref: this.ref,
436
+ enabled: pageOverflowEnabled,
437
+ layout: layout,
438
+ style: contentStyle,
439
+ children: children
440
+ })]
441
+ })
442
+ })
443
+ })]
444
+ })]
445
+ });
446
+ }
447
+ }]);
448
+ }(React.Component);
449
+ _defineProperty(Card, "defaultProps", {
450
+ shadowEnabled: false,
451
+ gestureEnabled: true,
452
+ gestureVelocityImpact: GESTURE_VELOCITY_IMPACT,
453
+ overlay: ({
454
+ style
455
+ }) => style ? /*#__PURE__*/_jsx(Animated.View, {
456
+ pointerEvents: "none",
457
+ style: [styles.overlay, style]
458
+ }) : null
459
+ });
417
460
  const styles = StyleSheet.create({
418
461
  container: {
419
462
  flex: 1