@react-navigation/stack 7.0.0-rc.17 → 7.0.0-rc.19

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