@mustmove/bottom-sheet 1.0.0 → 1.0.2

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 (678) hide show
  1. package/lib/commonjs/components/bottomSheet/BottomSheet.js +1317 -0
  2. package/lib/commonjs/components/bottomSheet/BottomSheet.js.map +1 -0
  3. package/lib/commonjs/components/bottomSheet/BottomSheetBody.js +43 -0
  4. package/lib/commonjs/components/bottomSheet/BottomSheetBody.js.map +1 -0
  5. package/lib/commonjs/components/bottomSheet/BottomSheetContent.js +196 -0
  6. package/lib/commonjs/components/bottomSheet/BottomSheetContent.js.map +1 -0
  7. package/lib/commonjs/components/bottomSheet/constants.js +34 -0
  8. package/lib/commonjs/components/bottomSheet/constants.js.map +1 -0
  9. package/lib/commonjs/components/bottomSheet/index.js +14 -0
  10. package/lib/commonjs/components/bottomSheet/index.js.map +1 -0
  11. package/lib/commonjs/components/bottomSheet/styles.js +17 -0
  12. package/lib/commonjs/components/bottomSheet/styles.js.map +1 -0
  13. package/lib/commonjs/components/bottomSheetBackdrop/BottomSheetBackdrop.js +115 -0
  14. package/lib/commonjs/components/bottomSheetBackdrop/BottomSheetBackdrop.js.map +1 -0
  15. package/lib/commonjs/components/bottomSheetBackdrop/constants.js +16 -0
  16. package/lib/commonjs/components/bottomSheetBackdrop/constants.js.map +1 -0
  17. package/lib/commonjs/components/bottomSheetBackdrop/index.js +13 -0
  18. package/lib/commonjs/components/bottomSheetBackdrop/index.js.map +1 -0
  19. package/lib/commonjs/components/bottomSheetBackdrop/styles.js +14 -0
  20. package/lib/commonjs/components/bottomSheetBackdrop/styles.js.map +1 -0
  21. package/lib/commonjs/components/bottomSheetBackground/BottomSheetBackground.js +24 -0
  22. package/lib/commonjs/components/bottomSheetBackground/BottomSheetBackground.js.map +1 -0
  23. package/lib/commonjs/components/bottomSheetBackground/BottomSheetBackgroundContainer.js +33 -0
  24. package/lib/commonjs/components/bottomSheetBackground/BottomSheetBackgroundContainer.js.map +1 -0
  25. package/lib/commonjs/components/bottomSheetBackground/index.js +13 -0
  26. package/lib/commonjs/components/bottomSheetBackground/index.js.map +1 -0
  27. package/lib/commonjs/components/bottomSheetBackground/styles.js +15 -0
  28. package/lib/commonjs/components/bottomSheetBackground/styles.js.map +1 -0
  29. package/lib/commonjs/components/bottomSheetDraggableView/BottomSheetDraggableView.js +94 -0
  30. package/lib/commonjs/components/bottomSheetDraggableView/BottomSheetDraggableView.js.map +1 -0
  31. package/lib/commonjs/components/bottomSheetDraggableView/index.js +14 -0
  32. package/lib/commonjs/components/bottomSheetDraggableView/index.js.map +1 -0
  33. package/lib/commonjs/components/bottomSheetFooter/BottomSheetFooter.js +111 -0
  34. package/lib/commonjs/components/bottomSheetFooter/BottomSheetFooter.js.map +1 -0
  35. package/lib/commonjs/components/bottomSheetFooter/BottomSheetFooterContainer.js +54 -0
  36. package/lib/commonjs/components/bottomSheetFooter/BottomSheetFooterContainer.js.map +1 -0
  37. package/lib/commonjs/components/bottomSheetFooter/index.js +20 -0
  38. package/lib/commonjs/components/bottomSheetFooter/index.js.map +1 -0
  39. package/lib/commonjs/components/bottomSheetFooter/styles.js +18 -0
  40. package/lib/commonjs/components/bottomSheetFooter/styles.js.map +1 -0
  41. package/lib/commonjs/components/bottomSheetGestureHandlersProvider/BottomSheetGestureHandlersProvider.js +53 -0
  42. package/lib/commonjs/components/bottomSheetGestureHandlersProvider/BottomSheetGestureHandlersProvider.js.map +1 -0
  43. package/lib/commonjs/components/bottomSheetGestureHandlersProvider/index.js +14 -0
  44. package/lib/commonjs/components/bottomSheetGestureHandlersProvider/index.js.map +1 -0
  45. package/lib/commonjs/components/bottomSheetHandle/BottomSheetHandle.js +43 -0
  46. package/lib/commonjs/components/bottomSheetHandle/BottomSheetHandle.js.map +1 -0
  47. package/lib/commonjs/components/bottomSheetHandle/BottomSheetHandleContainer.js +153 -0
  48. package/lib/commonjs/components/bottomSheetHandle/BottomSheetHandleContainer.js.map +1 -0
  49. package/lib/commonjs/components/bottomSheetHandle/constants.js +11 -0
  50. package/lib/commonjs/components/bottomSheetHandle/constants.js.map +1 -0
  51. package/lib/commonjs/components/bottomSheetHandle/index.js +21 -0
  52. package/lib/commonjs/components/bottomSheetHandle/index.js.map +1 -0
  53. package/lib/commonjs/components/bottomSheetHandle/styles.js +27 -0
  54. package/lib/commonjs/components/bottomSheetHandle/styles.js.map +1 -0
  55. package/lib/commonjs/components/bottomSheetHostingContainer/BottomSheetHostingContainer.js +110 -0
  56. package/lib/commonjs/components/bottomSheetHostingContainer/BottomSheetHostingContainer.js.map +1 -0
  57. package/lib/commonjs/components/bottomSheetHostingContainer/index.js +13 -0
  58. package/lib/commonjs/components/bottomSheetHostingContainer/index.js.map +1 -0
  59. package/lib/commonjs/components/bottomSheetHostingContainer/styles.js +14 -0
  60. package/lib/commonjs/components/bottomSheetHostingContainer/styles.js.map +1 -0
  61. package/lib/commonjs/components/bottomSheetHostingContainer/styles.web.js +17 -0
  62. package/lib/commonjs/components/bottomSheetHostingContainer/styles.web.js.map +1 -0
  63. package/lib/commonjs/components/bottomSheetModal/BottomSheetModal.js +387 -0
  64. package/lib/commonjs/components/bottomSheetModal/BottomSheetModal.js.map +1 -0
  65. package/lib/commonjs/components/bottomSheetModal/constants.js +9 -0
  66. package/lib/commonjs/components/bottomSheetModal/constants.js.map +1 -0
  67. package/lib/commonjs/components/bottomSheetModal/index.js +14 -0
  68. package/lib/commonjs/components/bottomSheetModal/index.js.map +1 -0
  69. package/lib/commonjs/components/bottomSheetModalProvider/BottomSheetModalProvider.js +172 -0
  70. package/lib/commonjs/components/bottomSheetModalProvider/BottomSheetModalProvider.js.map +1 -0
  71. package/lib/commonjs/components/bottomSheetModalProvider/index.js +14 -0
  72. package/lib/commonjs/components/bottomSheetModalProvider/index.js.map +1 -0
  73. package/lib/commonjs/components/bottomSheetRefreshControl/BottomSheetRefreshControl.android.js +64 -0
  74. package/lib/commonjs/components/bottomSheetRefreshControl/BottomSheetRefreshControl.android.js.map +1 -0
  75. package/lib/commonjs/components/bottomSheetRefreshControl/BottomSheetRefreshControl.js +9 -0
  76. package/lib/commonjs/components/bottomSheetRefreshControl/BottomSheetRefreshControl.js.map +1 -0
  77. package/lib/commonjs/components/bottomSheetRefreshControl/index.js +10 -0
  78. package/lib/commonjs/components/bottomSheetRefreshControl/index.js.map +1 -0
  79. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetDraggableScrollable.js +23 -0
  80. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetDraggableScrollable.js.map +1 -0
  81. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetFlashList.js +66 -0
  82. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetFlashList.js.map +1 -0
  83. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetFlashList.web.js +9 -0
  84. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetFlashList.web.js.map +1 -0
  85. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetFlatList.js +18 -0
  86. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetFlatList.js.map +1 -0
  87. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetScrollView.js +18 -0
  88. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetScrollView.js.map +1 -0
  89. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetSectionList.js +18 -0
  90. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetSectionList.js.map +1 -0
  91. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetVirtualizedList.js +18 -0
  92. package/lib/commonjs/components/bottomSheetScrollable/BottomSheetVirtualizedList.js.map +1 -0
  93. package/lib/commonjs/components/bottomSheetScrollable/ScrollableContainer.android.js +40 -0
  94. package/lib/commonjs/components/bottomSheetScrollable/ScrollableContainer.android.js.map +1 -0
  95. package/lib/commonjs/components/bottomSheetScrollable/ScrollableContainer.js +24 -0
  96. package/lib/commonjs/components/bottomSheetScrollable/ScrollableContainer.js.map +1 -0
  97. package/lib/commonjs/components/bottomSheetScrollable/ScrollableContainer.web.js +84 -0
  98. package/lib/commonjs/components/bottomSheetScrollable/ScrollableContainer.web.js.map +1 -0
  99. package/lib/commonjs/components/bottomSheetScrollable/createBottomSheetScrollableComponent.js +117 -0
  100. package/lib/commonjs/components/bottomSheetScrollable/createBottomSheetScrollableComponent.js.map +1 -0
  101. package/lib/commonjs/components/bottomSheetScrollable/index.js +49 -0
  102. package/lib/commonjs/components/bottomSheetScrollable/index.js.map +1 -0
  103. package/lib/commonjs/components/bottomSheetScrollable/styles.js +14 -0
  104. package/lib/commonjs/components/bottomSheetScrollable/styles.js.map +1 -0
  105. package/lib/commonjs/components/bottomSheetScrollable/useBottomSheetContentSizeSetter.js +39 -0
  106. package/lib/commonjs/components/bottomSheetScrollable/useBottomSheetContentSizeSetter.js.map +1 -0
  107. package/lib/commonjs/components/bottomSheetTextInput/BottomSheetTextInput.js +106 -0
  108. package/lib/commonjs/components/bottomSheetTextInput/BottomSheetTextInput.js.map +1 -0
  109. package/lib/commonjs/components/bottomSheetTextInput/index.js +14 -0
  110. package/lib/commonjs/components/bottomSheetTextInput/index.js.map +1 -0
  111. package/lib/commonjs/components/bottomSheetTextInput/types.js +6 -0
  112. package/lib/commonjs/components/bottomSheetTextInput/types.js.map +1 -0
  113. package/lib/commonjs/components/bottomSheetView/BottomSheetView.js +91 -0
  114. package/lib/commonjs/components/bottomSheetView/BottomSheetView.js.map +1 -0
  115. package/lib/commonjs/components/bottomSheetView/index.js +14 -0
  116. package/lib/commonjs/components/bottomSheetView/index.js.map +1 -0
  117. package/lib/commonjs/components/bottomSheetView/styles.js +16 -0
  118. package/lib/commonjs/components/bottomSheetView/styles.js.map +1 -0
  119. package/lib/commonjs/components/touchables/Touchables.ios.js +25 -0
  120. package/lib/commonjs/components/touchables/Touchables.ios.js.map +1 -0
  121. package/lib/commonjs/components/touchables/Touchables.js +25 -0
  122. package/lib/commonjs/components/touchables/Touchables.js.map +1 -0
  123. package/lib/commonjs/components/touchables/index.js +13 -0
  124. package/lib/commonjs/components/touchables/index.js.map +1 -0
  125. package/lib/commonjs/constants.js +138 -0
  126. package/lib/commonjs/constants.js.map +1 -0
  127. package/lib/commonjs/contexts/external.js +10 -0
  128. package/lib/commonjs/contexts/external.js.map +1 -0
  129. package/lib/commonjs/contexts/gesture.js +10 -0
  130. package/lib/commonjs/contexts/gesture.js.map +1 -0
  131. package/lib/commonjs/contexts/index.js +65 -0
  132. package/lib/commonjs/contexts/index.js.map +1 -0
  133. package/lib/commonjs/contexts/internal.js +10 -0
  134. package/lib/commonjs/contexts/internal.js.map +1 -0
  135. package/lib/commonjs/contexts/modal/external.js +10 -0
  136. package/lib/commonjs/contexts/modal/external.js.map +1 -0
  137. package/lib/commonjs/contexts/modal/internal.js +10 -0
  138. package/lib/commonjs/contexts/modal/internal.js.map +1 -0
  139. package/lib/commonjs/hooks/index.js +132 -0
  140. package/lib/commonjs/hooks/index.js.map +1 -0
  141. package/lib/commonjs/hooks/useAnimatedDetents.js +95 -0
  142. package/lib/commonjs/hooks/useAnimatedDetents.js.map +1 -0
  143. package/lib/commonjs/hooks/useAnimatedKeyboard.js +125 -0
  144. package/lib/commonjs/hooks/useAnimatedKeyboard.js.map +1 -0
  145. package/lib/commonjs/hooks/useAnimatedLayout.js +90 -0
  146. package/lib/commonjs/hooks/useAnimatedLayout.js.map +1 -0
  147. package/lib/commonjs/hooks/useBottomSheet.js +17 -0
  148. package/lib/commonjs/hooks/useBottomSheet.js.map +1 -0
  149. package/lib/commonjs/hooks/useBottomSheetContentContainerStyle.js +77 -0
  150. package/lib/commonjs/hooks/useBottomSheetContentContainerStyle.js.map +1 -0
  151. package/lib/commonjs/hooks/useBottomSheetGestureHandlers.js +17 -0
  152. package/lib/commonjs/hooks/useBottomSheetGestureHandlers.js.map +1 -0
  153. package/lib/commonjs/hooks/useBottomSheetInternal.js +16 -0
  154. package/lib/commonjs/hooks/useBottomSheetInternal.js.map +1 -0
  155. package/lib/commonjs/hooks/useBottomSheetModal.js +17 -0
  156. package/lib/commonjs/hooks/useBottomSheetModal.js.map +1 -0
  157. package/lib/commonjs/hooks/useBottomSheetModalInternal.js +16 -0
  158. package/lib/commonjs/hooks/useBottomSheetModalInternal.js.map +1 -0
  159. package/lib/commonjs/hooks/useBottomSheetScrollableCreator.js +58 -0
  160. package/lib/commonjs/hooks/useBottomSheetScrollableCreator.js.map +1 -0
  161. package/lib/commonjs/hooks/useBottomSheetSpringConfigs.js +15 -0
  162. package/lib/commonjs/hooks/useBottomSheetSpringConfigs.js.map +1 -0
  163. package/lib/commonjs/hooks/useBottomSheetTimingConfigs.js +32 -0
  164. package/lib/commonjs/hooks/useBottomSheetTimingConfigs.js.map +1 -0
  165. package/lib/commonjs/hooks/useBoundingClientRect.js +66 -0
  166. package/lib/commonjs/hooks/useBoundingClientRect.js.map +1 -0
  167. package/lib/commonjs/hooks/useGestureEventsHandlersDefault.js +299 -0
  168. package/lib/commonjs/hooks/useGestureEventsHandlersDefault.js.map +1 -0
  169. package/lib/commonjs/hooks/useGestureEventsHandlersDefault.web.js +295 -0
  170. package/lib/commonjs/hooks/useGestureEventsHandlersDefault.web.js.map +1 -0
  171. package/lib/commonjs/hooks/useGestureHandler.js +56 -0
  172. package/lib/commonjs/hooks/useGestureHandler.js.map +1 -0
  173. package/lib/commonjs/hooks/usePropsValidator.js +54 -0
  174. package/lib/commonjs/hooks/usePropsValidator.js.map +1 -0
  175. package/lib/commonjs/hooks/useReactiveSharedValue.js +48 -0
  176. package/lib/commonjs/hooks/useReactiveSharedValue.js.map +1 -0
  177. package/lib/commonjs/hooks/useScrollEventsHandlersDefault.js +132 -0
  178. package/lib/commonjs/hooks/useScrollEventsHandlersDefault.js.map +1 -0
  179. package/lib/commonjs/hooks/useScrollHandler.js +62 -0
  180. package/lib/commonjs/hooks/useScrollHandler.js.map +1 -0
  181. package/lib/commonjs/hooks/useScrollHandler.web.js +130 -0
  182. package/lib/commonjs/hooks/useScrollHandler.web.js.map +1 -0
  183. package/lib/commonjs/hooks/useScrollable.js +103 -0
  184. package/lib/commonjs/hooks/useScrollable.js.map +1 -0
  185. package/lib/commonjs/hooks/useScrollableSetter.js +47 -0
  186. package/lib/commonjs/hooks/useScrollableSetter.js.map +1 -0
  187. package/lib/commonjs/hooks/useStableCallback.js +25 -0
  188. package/lib/commonjs/hooks/useStableCallback.js.map +1 -0
  189. package/lib/commonjs/index.js +282 -0
  190. package/lib/commonjs/index.js.map +1 -0
  191. package/lib/commonjs/package.json +1 -0
  192. package/lib/commonjs/utilities/animate.js +41 -0
  193. package/lib/commonjs/utilities/animate.js.map +1 -0
  194. package/lib/commonjs/utilities/clamp.js +13 -0
  195. package/lib/commonjs/utilities/clamp.js.map +1 -0
  196. package/lib/commonjs/utilities/easingExp.js +19 -0
  197. package/lib/commonjs/utilities/easingExp.js.map +1 -0
  198. package/lib/commonjs/utilities/findNodeHandle.js +13 -0
  199. package/lib/commonjs/utilities/findNodeHandle.js.map +1 -0
  200. package/lib/commonjs/utilities/findNodeHandle.web.js +32 -0
  201. package/lib/commonjs/utilities/findNodeHandle.web.js.map +1 -0
  202. package/lib/commonjs/utilities/getKeyboardAnimationConfigs.js +44 -0
  203. package/lib/commonjs/utilities/getKeyboardAnimationConfigs.js.map +1 -0
  204. package/lib/commonjs/utilities/getRefNativeTag.web.js +11 -0
  205. package/lib/commonjs/utilities/getRefNativeTag.web.js.map +1 -0
  206. package/lib/commonjs/utilities/id.js +13 -0
  207. package/lib/commonjs/utilities/id.js.map +1 -0
  208. package/lib/commonjs/utilities/index.js +61 -0
  209. package/lib/commonjs/utilities/index.js.map +1 -0
  210. package/lib/commonjs/utilities/isFabricInstalled.js +16 -0
  211. package/lib/commonjs/utilities/isFabricInstalled.js.map +1 -0
  212. package/lib/commonjs/utilities/logger.js +44 -0
  213. package/lib/commonjs/utilities/logger.js.map +1 -0
  214. package/lib/commonjs/utilities/noop.js +13 -0
  215. package/lib/commonjs/utilities/noop.js.map +1 -0
  216. package/lib/commonjs/utilities/normalizeSnapPoint.js +22 -0
  217. package/lib/commonjs/utilities/normalizeSnapPoint.js.map +1 -0
  218. package/lib/commonjs/utilities/snapPoint.js +16 -0
  219. package/lib/commonjs/utilities/snapPoint.js.map +1 -0
  220. package/lib/commonjs/utilities/validateSnapPoint.js +15 -0
  221. package/lib/commonjs/utilities/validateSnapPoint.js.map +1 -0
  222. package/lib/module/components/bottomSheet/BottomSheet.js +1310 -0
  223. package/lib/module/components/bottomSheet/BottomSheet.js.map +1 -0
  224. package/lib/module/components/bottomSheet/BottomSheetBody.js +38 -0
  225. package/lib/module/components/bottomSheet/BottomSheetBody.js.map +1 -0
  226. package/lib/module/components/bottomSheet/BottomSheetContent.js +190 -0
  227. package/lib/module/components/bottomSheet/BottomSheetContent.js.map +1 -0
  228. package/lib/module/components/bottomSheet/constants.js +38 -0
  229. package/lib/module/components/bottomSheet/constants.js.map +1 -0
  230. package/lib/module/components/bottomSheet/index.js +4 -0
  231. package/lib/module/components/bottomSheet/index.js.map +1 -0
  232. package/lib/module/components/bottomSheet/styles.js +13 -0
  233. package/lib/module/components/bottomSheet/styles.js.map +1 -0
  234. package/lib/module/components/bottomSheetBackdrop/BottomSheetBackdrop.js +110 -0
  235. package/lib/module/components/bottomSheetBackdrop/BottomSheetBackdrop.js.map +1 -0
  236. package/lib/module/components/bottomSheetBackdrop/constants.js +13 -0
  237. package/lib/module/components/bottomSheetBackdrop/constants.js.map +1 -0
  238. package/lib/module/components/bottomSheetBackdrop/index.js +4 -0
  239. package/lib/module/components/bottomSheetBackdrop/index.js.map +1 -0
  240. package/lib/module/components/bottomSheetBackdrop/styles.js +10 -0
  241. package/lib/module/components/bottomSheetBackdrop/styles.js.map +1 -0
  242. package/lib/module/components/bottomSheetBackground/BottomSheetBackground.js +19 -0
  243. package/lib/module/components/bottomSheetBackground/BottomSheetBackground.js.map +1 -0
  244. package/lib/module/components/bottomSheetBackground/BottomSheetBackgroundContainer.js +28 -0
  245. package/lib/module/components/bottomSheetBackground/BottomSheetBackgroundContainer.js.map +1 -0
  246. package/lib/module/components/bottomSheetBackground/index.js +4 -0
  247. package/lib/module/components/bottomSheetBackground/index.js.map +1 -0
  248. package/lib/module/components/bottomSheetBackground/styles.js +11 -0
  249. package/lib/module/components/bottomSheetBackground/styles.js.map +1 -0
  250. package/lib/module/components/bottomSheetDraggableView/BottomSheetDraggableView.js +88 -0
  251. package/lib/module/components/bottomSheetDraggableView/BottomSheetDraggableView.js.map +1 -0
  252. package/lib/module/components/bottomSheetDraggableView/index.js +4 -0
  253. package/lib/module/components/bottomSheetDraggableView/index.js.map +1 -0
  254. package/lib/module/components/bottomSheetFooter/BottomSheetFooter.js +106 -0
  255. package/lib/module/components/bottomSheetFooter/BottomSheetFooter.js.map +1 -0
  256. package/lib/module/components/bottomSheetFooter/BottomSheetFooterContainer.js +49 -0
  257. package/lib/module/components/bottomSheetFooter/BottomSheetFooterContainer.js.map +1 -0
  258. package/lib/module/components/bottomSheetFooter/index.js +5 -0
  259. package/lib/module/components/bottomSheetFooter/index.js.map +1 -0
  260. package/lib/module/components/bottomSheetFooter/styles.js +14 -0
  261. package/lib/module/components/bottomSheetFooter/styles.js.map +1 -0
  262. package/lib/module/components/bottomSheetGestureHandlersProvider/BottomSheetGestureHandlersProvider.js +48 -0
  263. package/lib/module/components/bottomSheetGestureHandlersProvider/BottomSheetGestureHandlersProvider.js.map +1 -0
  264. package/lib/module/components/bottomSheetGestureHandlersProvider/index.js +4 -0
  265. package/lib/module/components/bottomSheetGestureHandlersProvider/index.js.map +1 -0
  266. package/lib/module/components/bottomSheetHandle/BottomSheetHandle.js +38 -0
  267. package/lib/module/components/bottomSheetHandle/BottomSheetHandle.js.map +1 -0
  268. package/lib/module/components/bottomSheetHandle/BottomSheetHandleContainer.js +147 -0
  269. package/lib/module/components/bottomSheetHandle/BottomSheetHandleContainer.js.map +1 -0
  270. package/lib/module/components/bottomSheetHandle/constants.js +8 -0
  271. package/lib/module/components/bottomSheetHandle/constants.js.map +1 -0
  272. package/lib/module/components/bottomSheetHandle/index.js +5 -0
  273. package/lib/module/components/bottomSheetHandle/index.js.map +1 -0
  274. package/lib/module/components/bottomSheetHandle/styles.js +23 -0
  275. package/lib/module/components/bottomSheetHandle/styles.js.map +1 -0
  276. package/lib/module/components/bottomSheetHostingContainer/BottomSheetHostingContainer.js +105 -0
  277. package/lib/module/components/bottomSheetHostingContainer/BottomSheetHostingContainer.js.map +1 -0
  278. package/lib/module/components/bottomSheetHostingContainer/index.js +4 -0
  279. package/lib/module/components/bottomSheetHostingContainer/index.js.map +1 -0
  280. package/lib/module/components/bottomSheetHostingContainer/styles.js +10 -0
  281. package/lib/module/components/bottomSheetHostingContainer/styles.js.map +1 -0
  282. package/lib/module/components/bottomSheetHostingContainer/styles.web.js +13 -0
  283. package/lib/module/components/bottomSheetHostingContainer/styles.web.js.map +1 -0
  284. package/lib/module/components/bottomSheetModal/BottomSheetModal.js +381 -0
  285. package/lib/module/components/bottomSheetModal/BottomSheetModal.js.map +1 -0
  286. package/lib/module/components/bottomSheetModal/constants.js +6 -0
  287. package/lib/module/components/bottomSheetModal/constants.js.map +1 -0
  288. package/lib/module/components/bottomSheetModal/index.js +4 -0
  289. package/lib/module/components/bottomSheetModal/index.js.map +1 -0
  290. package/lib/module/components/bottomSheetModalProvider/BottomSheetModalProvider.js +167 -0
  291. package/lib/module/components/bottomSheetModalProvider/BottomSheetModalProvider.js.map +1 -0
  292. package/lib/module/components/bottomSheetModalProvider/index.js +4 -0
  293. package/lib/module/components/bottomSheetModalProvider/index.js.map +1 -0
  294. package/lib/module/components/bottomSheetRefreshControl/BottomSheetRefreshControl.android.js +59 -0
  295. package/lib/module/components/bottomSheetRefreshControl/BottomSheetRefreshControl.android.js.map +1 -0
  296. package/lib/module/components/bottomSheetRefreshControl/BottomSheetRefreshControl.js +4 -0
  297. package/lib/module/components/bottomSheetRefreshControl/BottomSheetRefreshControl.js.map +1 -0
  298. package/lib/module/components/bottomSheetRefreshControl/index.js +5 -0
  299. package/lib/module/components/bottomSheetRefreshControl/index.js.map +1 -0
  300. package/lib/module/components/bottomSheetScrollable/BottomSheetDraggableScrollable.js +18 -0
  301. package/lib/module/components/bottomSheetScrollable/BottomSheetDraggableScrollable.js.map +1 -0
  302. package/lib/module/components/bottomSheetScrollable/BottomSheetFlashList.js +60 -0
  303. package/lib/module/components/bottomSheetScrollable/BottomSheetFlashList.js.map +1 -0
  304. package/lib/module/components/bottomSheetScrollable/BottomSheetFlashList.web.js +4 -0
  305. package/lib/module/components/bottomSheetScrollable/BottomSheetFlashList.web.js.map +1 -0
  306. package/lib/module/components/bottomSheetScrollable/BottomSheetFlatList.js +13 -0
  307. package/lib/module/components/bottomSheetScrollable/BottomSheetFlatList.js.map +1 -0
  308. package/lib/module/components/bottomSheetScrollable/BottomSheetScrollView.js +13 -0
  309. package/lib/module/components/bottomSheetScrollable/BottomSheetScrollView.js.map +1 -0
  310. package/lib/module/components/bottomSheetScrollable/BottomSheetSectionList.js +13 -0
  311. package/lib/module/components/bottomSheetScrollable/BottomSheetSectionList.js.map +1 -0
  312. package/lib/module/components/bottomSheetScrollable/BottomSheetVirtualizedList.js +13 -0
  313. package/lib/module/components/bottomSheetScrollable/BottomSheetVirtualizedList.js.map +1 -0
  314. package/lib/module/components/bottomSheetScrollable/ScrollableContainer.android.js +34 -0
  315. package/lib/module/components/bottomSheetScrollable/ScrollableContainer.android.js.map +1 -0
  316. package/lib/module/components/bottomSheetScrollable/ScrollableContainer.js +19 -0
  317. package/lib/module/components/bottomSheetScrollable/ScrollableContainer.js.map +1 -0
  318. package/lib/module/components/bottomSheetScrollable/ScrollableContainer.web.js +78 -0
  319. package/lib/module/components/bottomSheetScrollable/ScrollableContainer.web.js.map +1 -0
  320. package/lib/module/components/bottomSheetScrollable/createBottomSheetScrollableComponent.js +112 -0
  321. package/lib/module/components/bottomSheetScrollable/createBottomSheetScrollableComponent.js.map +1 -0
  322. package/lib/module/components/bottomSheetScrollable/index.js +9 -0
  323. package/lib/module/components/bottomSheetScrollable/index.js.map +1 -0
  324. package/lib/module/components/bottomSheetScrollable/styles.js +10 -0
  325. package/lib/module/components/bottomSheetScrollable/styles.js.map +1 -0
  326. package/lib/module/components/bottomSheetScrollable/useBottomSheetContentSizeSetter.js +36 -0
  327. package/lib/module/components/bottomSheetScrollable/useBottomSheetContentSizeSetter.js.map +1 -0
  328. package/lib/module/components/bottomSheetTextInput/BottomSheetTextInput.js +101 -0
  329. package/lib/module/components/bottomSheetTextInput/BottomSheetTextInput.js.map +1 -0
  330. package/lib/module/components/bottomSheetTextInput/index.js +4 -0
  331. package/lib/module/components/bottomSheetTextInput/index.js.map +1 -0
  332. package/lib/module/components/bottomSheetTextInput/types.js +4 -0
  333. package/lib/module/components/bottomSheetTextInput/types.js.map +1 -0
  334. package/lib/module/components/bottomSheetView/BottomSheetView.js +86 -0
  335. package/lib/module/components/bottomSheetView/BottomSheetView.js.map +1 -0
  336. package/lib/module/components/bottomSheetView/index.js +4 -0
  337. package/lib/module/components/bottomSheetView/index.js.map +1 -0
  338. package/lib/module/components/bottomSheetView/styles.js +12 -0
  339. package/lib/module/components/bottomSheetView/styles.js.map +1 -0
  340. package/lib/module/components/touchables/Touchables.ios.js +4 -0
  341. package/lib/module/components/touchables/Touchables.ios.js.map +1 -0
  342. package/lib/module/components/touchables/Touchables.js +4 -0
  343. package/lib/module/components/touchables/Touchables.js.map +1 -0
  344. package/lib/module/components/touchables/index.js +11 -0
  345. package/lib/module/components/touchables/index.js.map +1 -0
  346. package/lib/module/constants.js +131 -0
  347. package/lib/module/constants.js.map +1 -0
  348. package/lib/module/contexts/external.js +6 -0
  349. package/lib/module/contexts/external.js.map +1 -0
  350. package/lib/module/contexts/gesture.js +6 -0
  351. package/lib/module/contexts/gesture.js.map +1 -0
  352. package/lib/module/contexts/index.js +8 -0
  353. package/lib/module/contexts/index.js.map +1 -0
  354. package/lib/module/contexts/internal.js +6 -0
  355. package/lib/module/contexts/internal.js.map +1 -0
  356. package/lib/module/contexts/modal/external.js +6 -0
  357. package/lib/module/contexts/modal/external.js.map +1 -0
  358. package/lib/module/contexts/modal/internal.js +6 -0
  359. package/lib/module/contexts/modal/internal.js.map +1 -0
  360. package/lib/module/hooks/index.js +29 -0
  361. package/lib/module/hooks/index.js.map +1 -0
  362. package/lib/module/hooks/useAnimatedDetents.js +91 -0
  363. package/lib/module/hooks/useAnimatedDetents.js.map +1 -0
  364. package/lib/module/hooks/useAnimatedKeyboard.js +120 -0
  365. package/lib/module/hooks/useAnimatedKeyboard.js.map +1 -0
  366. package/lib/module/hooks/useAnimatedLayout.js +86 -0
  367. package/lib/module/hooks/useAnimatedLayout.js.map +1 -0
  368. package/lib/module/hooks/useBottomSheet.js +12 -0
  369. package/lib/module/hooks/useBottomSheet.js.map +1 -0
  370. package/lib/module/hooks/useBottomSheetContentContainerStyle.js +73 -0
  371. package/lib/module/hooks/useBottomSheetContentContainerStyle.js.map +1 -0
  372. package/lib/module/hooks/useBottomSheetGestureHandlers.js +12 -0
  373. package/lib/module/hooks/useBottomSheetGestureHandlers.js.map +1 -0
  374. package/lib/module/hooks/useBottomSheetInternal.js +12 -0
  375. package/lib/module/hooks/useBottomSheetInternal.js.map +1 -0
  376. package/lib/module/hooks/useBottomSheetModal.js +12 -0
  377. package/lib/module/hooks/useBottomSheetModal.js.map +1 -0
  378. package/lib/module/hooks/useBottomSheetModalInternal.js +12 -0
  379. package/lib/module/hooks/useBottomSheetModalInternal.js.map +1 -0
  380. package/lib/module/hooks/useBottomSheetScrollableCreator.js +54 -0
  381. package/lib/module/hooks/useBottomSheetScrollableCreator.js.map +1 -0
  382. package/lib/module/hooks/useBottomSheetSpringConfigs.js +10 -0
  383. package/lib/module/hooks/useBottomSheetSpringConfigs.js.map +1 -0
  384. package/lib/module/hooks/useBottomSheetTimingConfigs.js +28 -0
  385. package/lib/module/hooks/useBottomSheetTimingConfigs.js.map +1 -0
  386. package/lib/module/hooks/useBoundingClientRect.js +62 -0
  387. package/lib/module/hooks/useBoundingClientRect.js.map +1 -0
  388. package/lib/module/hooks/useGestureEventsHandlersDefault.js +294 -0
  389. package/lib/module/hooks/useGestureEventsHandlersDefault.js.map +1 -0
  390. package/lib/module/hooks/useGestureEventsHandlersDefault.web.js +290 -0
  391. package/lib/module/hooks/useGestureEventsHandlersDefault.web.js.map +1 -0
  392. package/lib/module/hooks/useGestureHandler.js +51 -0
  393. package/lib/module/hooks/useGestureHandler.js.map +1 -0
  394. package/lib/module/hooks/usePropsValidator.js +49 -0
  395. package/lib/module/hooks/usePropsValidator.js.map +1 -0
  396. package/lib/module/hooks/useReactiveSharedValue.js +43 -0
  397. package/lib/module/hooks/useReactiveSharedValue.js.map +1 -0
  398. package/lib/module/hooks/useScrollEventsHandlersDefault.js +127 -0
  399. package/lib/module/hooks/useScrollEventsHandlersDefault.js.map +1 -0
  400. package/lib/module/hooks/useScrollHandler.js +57 -0
  401. package/lib/module/hooks/useScrollHandler.js.map +1 -0
  402. package/lib/module/hooks/useScrollHandler.web.js +125 -0
  403. package/lib/module/hooks/useScrollHandler.web.js.map +1 -0
  404. package/lib/module/hooks/useScrollable.js +98 -0
  405. package/lib/module/hooks/useScrollable.js.map +1 -0
  406. package/lib/module/hooks/useScrollableSetter.js +42 -0
  407. package/lib/module/hooks/useScrollableSetter.js.map +1 -0
  408. package/lib/module/hooks/useStableCallback.js +21 -0
  409. package/lib/module/hooks/useStableCallback.js.map +1 -0
  410. package/lib/module/index.js +53 -0
  411. package/lib/module/index.js.map +1 -0
  412. package/lib/module/package.json +1 -0
  413. package/lib/module/utilities/animate.js +36 -0
  414. package/lib/module/utilities/animate.js.map +1 -0
  415. package/lib/module/utilities/clamp.js +8 -0
  416. package/lib/module/utilities/clamp.js.map +1 -0
  417. package/lib/module/utilities/easingExp.js +14 -0
  418. package/lib/module/utilities/easingExp.js.map +1 -0
  419. package/lib/module/utilities/findNodeHandle.js +4 -0
  420. package/lib/module/utilities/findNodeHandle.js.map +1 -0
  421. package/lib/module/utilities/findNodeHandle.web.js +28 -0
  422. package/lib/module/utilities/findNodeHandle.web.js.map +1 -0
  423. package/lib/module/utilities/getKeyboardAnimationConfigs.js +39 -0
  424. package/lib/module/utilities/getKeyboardAnimationConfigs.js.map +1 -0
  425. package/lib/module/utilities/getRefNativeTag.web.js +7 -0
  426. package/lib/module/utilities/getRefNativeTag.web.js.map +1 -0
  427. package/lib/module/utilities/id.js +8 -0
  428. package/lib/module/utilities/id.js.map +1 -0
  429. package/lib/module/utilities/index.js +10 -0
  430. package/lib/module/utilities/index.js.map +1 -0
  431. package/lib/module/utilities/isFabricInstalled.js +12 -0
  432. package/lib/module/utilities/isFabricInstalled.js.map +1 -0
  433. package/lib/module/utilities/logger.js +39 -0
  434. package/lib/module/utilities/logger.js.map +1 -0
  435. package/lib/module/utilities/noop.js +8 -0
  436. package/lib/module/utilities/noop.js.map +1 -0
  437. package/lib/module/utilities/normalizeSnapPoint.js +17 -0
  438. package/lib/module/utilities/normalizeSnapPoint.js.map +1 -0
  439. package/lib/module/utilities/snapPoint.js +11 -0
  440. package/lib/module/utilities/snapPoint.js.map +1 -0
  441. package/lib/module/utilities/validateSnapPoint.js +9 -0
  442. package/lib/module/utilities/validateSnapPoint.js.map +1 -0
  443. package/lib/typescript/components/bottomSheet/BottomSheet.d.ts +7 -0
  444. package/lib/typescript/components/bottomSheet/BottomSheet.d.ts.map +1 -0
  445. package/lib/typescript/components/bottomSheet/BottomSheetBody.d.ts +10 -0
  446. package/lib/typescript/components/bottomSheet/BottomSheetBody.d.ts.map +1 -0
  447. package/lib/typescript/components/bottomSheet/BottomSheetContent.d.ts +12 -0
  448. package/lib/typescript/components/bottomSheet/BottomSheetContent.d.ts.map +1 -0
  449. package/lib/typescript/components/bottomSheet/constants.d.ts +21 -0
  450. package/lib/typescript/components/bottomSheet/constants.d.ts.map +1 -0
  451. package/lib/typescript/components/bottomSheet/index.d.ts +3 -0
  452. package/lib/typescript/components/bottomSheet/index.d.ts.map +1 -0
  453. package/lib/typescript/components/bottomSheet/styles.d.ts +10 -0
  454. package/lib/typescript/components/bottomSheet/styles.d.ts.map +1 -0
  455. package/lib/typescript/components/bottomSheet/types.d.ts +358 -0
  456. package/lib/typescript/components/bottomSheetBackdrop/BottomSheetBackdrop.d.ts +4 -0
  457. package/lib/typescript/components/bottomSheetBackdrop/BottomSheetBackdrop.d.ts.map +1 -0
  458. package/lib/typescript/components/bottomSheetBackdrop/constants.d.ts +11 -0
  459. package/lib/typescript/components/bottomSheetBackdrop/constants.d.ts.map +1 -0
  460. package/lib/typescript/components/bottomSheetBackdrop/index.d.ts +3 -0
  461. package/lib/typescript/components/bottomSheetBackdrop/index.d.ts.map +1 -0
  462. package/lib/typescript/components/bottomSheetBackdrop/styles.d.ts +11 -0
  463. package/lib/typescript/components/bottomSheetBackdrop/styles.d.ts.map +1 -0
  464. package/lib/typescript/components/bottomSheetBackdrop/types.d.ts +58 -0
  465. package/lib/typescript/components/bottomSheetBackground/BottomSheetBackground.d.ts +4 -0
  466. package/lib/typescript/components/bottomSheetBackground/BottomSheetBackground.d.ts.map +1 -0
  467. package/lib/typescript/components/bottomSheetBackground/BottomSheetBackgroundContainer.d.ts +4 -0
  468. package/lib/typescript/components/bottomSheetBackground/BottomSheetBackgroundContainer.d.ts.map +1 -0
  469. package/lib/typescript/components/bottomSheetBackground/index.d.ts +3 -0
  470. package/lib/typescript/components/bottomSheetBackground/index.d.ts.map +1 -0
  471. package/lib/typescript/components/bottomSheetBackground/styles.d.ts +9 -0
  472. package/lib/typescript/components/bottomSheetBackground/styles.d.ts.map +1 -0
  473. package/lib/typescript/components/bottomSheetBackground/types.d.ts +12 -0
  474. package/lib/typescript/components/bottomSheetDraggableView/BottomSheetDraggableView.d.ts +5 -0
  475. package/lib/typescript/components/bottomSheetDraggableView/BottomSheetDraggableView.d.ts.map +1 -0
  476. package/lib/typescript/components/bottomSheetDraggableView/index.d.ts +2 -0
  477. package/lib/typescript/components/bottomSheetDraggableView/index.d.ts.map +1 -0
  478. package/lib/typescript/components/bottomSheetDraggableView/types.d.ts +9 -0
  479. package/lib/typescript/components/bottomSheetFooter/BottomSheetFooter.d.ts +6 -0
  480. package/lib/typescript/components/bottomSheetFooter/BottomSheetFooter.d.ts.map +1 -0
  481. package/lib/typescript/components/bottomSheetFooter/BottomSheetFooterContainer.d.ts +4 -0
  482. package/lib/typescript/components/bottomSheetFooter/BottomSheetFooterContainer.d.ts.map +1 -0
  483. package/lib/typescript/components/bottomSheetFooter/index.d.ts +4 -0
  484. package/lib/typescript/components/bottomSheetFooter/index.d.ts.map +1 -0
  485. package/lib/typescript/components/bottomSheetFooter/styles.d.ts +11 -0
  486. package/lib/typescript/components/bottomSheetFooter/styles.d.ts.map +1 -0
  487. package/lib/typescript/components/bottomSheetFooter/types.d.ts +41 -0
  488. package/lib/typescript/components/bottomSheetGestureHandlersProvider/BottomSheetGestureHandlersProvider.d.ts +5 -0
  489. package/lib/typescript/components/bottomSheetGestureHandlersProvider/BottomSheetGestureHandlersProvider.d.ts.map +1 -0
  490. package/lib/typescript/components/bottomSheetGestureHandlersProvider/index.d.ts +2 -0
  491. package/lib/typescript/components/bottomSheetGestureHandlersProvider/index.d.ts.map +1 -0
  492. package/lib/typescript/components/bottomSheetGestureHandlersProvider/types.d.ts +8 -0
  493. package/lib/typescript/components/bottomSheetHandle/BottomSheetHandle.d.ts +6 -0
  494. package/lib/typescript/components/bottomSheetHandle/BottomSheetHandle.d.ts.map +1 -0
  495. package/lib/typescript/components/bottomSheetHandle/BottomSheetHandleContainer.d.ts +6 -0
  496. package/lib/typescript/components/bottomSheetHandle/BottomSheetHandleContainer.d.ts.map +1 -0
  497. package/lib/typescript/components/bottomSheetHandle/constants.d.ts +6 -0
  498. package/lib/typescript/components/bottomSheetHandle/constants.d.ts.map +1 -0
  499. package/lib/typescript/components/bottomSheetHandle/index.d.ts +4 -0
  500. package/lib/typescript/components/bottomSheetHandle/index.d.ts.map +1 -0
  501. package/lib/typescript/components/bottomSheetHandle/styles.d.ts +17 -0
  502. package/lib/typescript/components/bottomSheetHandle/styles.d.ts.map +1 -0
  503. package/lib/typescript/components/bottomSheetHandle/types.d.ts +52 -0
  504. package/lib/typescript/components/bottomSheetHostingContainer/BottomSheetHostingContainer.d.ts +6 -0
  505. package/lib/typescript/components/bottomSheetHostingContainer/BottomSheetHostingContainer.d.ts.map +1 -0
  506. package/lib/typescript/components/bottomSheetHostingContainer/index.d.ts +3 -0
  507. package/lib/typescript/components/bottomSheetHostingContainer/index.d.ts.map +1 -0
  508. package/lib/typescript/components/bottomSheetHostingContainer/styles.d.ts +11 -0
  509. package/lib/typescript/components/bottomSheetHostingContainer/styles.d.ts.map +1 -0
  510. package/lib/typescript/components/bottomSheetHostingContainer/styles.web.d.ts +10 -0
  511. package/lib/typescript/components/bottomSheetHostingContainer/styles.web.d.ts.map +1 -0
  512. package/lib/typescript/components/bottomSheetHostingContainer/types.d.ts +17 -0
  513. package/lib/typescript/components/bottomSheetModal/BottomSheetModal.d.ts +10 -0
  514. package/lib/typescript/components/bottomSheetModal/BottomSheetModal.d.ts.map +1 -0
  515. package/lib/typescript/components/bottomSheetModal/constants.d.ts +4 -0
  516. package/lib/typescript/components/bottomSheetModal/constants.d.ts.map +1 -0
  517. package/lib/typescript/components/bottomSheetModal/index.d.ts +3 -0
  518. package/lib/typescript/components/bottomSheetModal/index.d.ts.map +1 -0
  519. package/lib/typescript/components/bottomSheetModal/types.d.ts +67 -0
  520. package/lib/typescript/components/bottomSheetModalProvider/BottomSheetModalProvider.d.ts +5 -0
  521. package/lib/typescript/components/bottomSheetModalProvider/BottomSheetModalProvider.d.ts.map +1 -0
  522. package/lib/typescript/components/bottomSheetModalProvider/index.d.ts +2 -0
  523. package/lib/typescript/components/bottomSheetModalProvider/index.d.ts.map +1 -0
  524. package/lib/typescript/components/bottomSheetModalProvider/types.d.ts +12 -0
  525. package/lib/typescript/components/bottomSheetRefreshControl/BottomSheetRefreshControl.android.d.ts +10 -0
  526. package/lib/typescript/components/bottomSheetRefreshControl/BottomSheetRefreshControl.android.d.ts.map +1 -0
  527. package/lib/typescript/components/bottomSheetRefreshControl/BottomSheetRefreshControl.d.ts +3 -0
  528. package/lib/typescript/components/bottomSheetRefreshControl/BottomSheetRefreshControl.d.ts.map +1 -0
  529. package/lib/typescript/components/bottomSheetRefreshControl/index.d.ts +9 -0
  530. package/lib/typescript/components/bottomSheetRefreshControl/index.d.ts.map +1 -0
  531. package/lib/typescript/components/bottomSheetScrollable/BottomSheetDraggableScrollable.d.ts +9 -0
  532. package/lib/typescript/components/bottomSheetScrollable/BottomSheetDraggableScrollable.d.ts.map +1 -0
  533. package/lib/typescript/components/bottomSheetScrollable/BottomSheetFlashList.d.ts +11 -0
  534. package/lib/typescript/components/bottomSheetScrollable/BottomSheetFlashList.d.ts.map +1 -0
  535. package/lib/typescript/components/bottomSheetScrollable/BottomSheetFlashList.web.d.ts +3 -0
  536. package/lib/typescript/components/bottomSheetScrollable/BottomSheetFlashList.web.d.ts.map +1 -0
  537. package/lib/typescript/components/bottomSheetScrollable/BottomSheetFlatList.d.ts +5 -0
  538. package/lib/typescript/components/bottomSheetScrollable/BottomSheetFlatList.d.ts.map +1 -0
  539. package/lib/typescript/components/bottomSheetScrollable/BottomSheetScrollView.d.ts +5 -0
  540. package/lib/typescript/components/bottomSheetScrollable/BottomSheetScrollView.d.ts.map +1 -0
  541. package/lib/typescript/components/bottomSheetScrollable/BottomSheetSectionList.d.ts +6 -0
  542. package/lib/typescript/components/bottomSheetScrollable/BottomSheetSectionList.d.ts.map +1 -0
  543. package/lib/typescript/components/bottomSheetScrollable/BottomSheetVirtualizedList.d.ts +5 -0
  544. package/lib/typescript/components/bottomSheetScrollable/BottomSheetVirtualizedList.d.ts.map +1 -0
  545. package/lib/typescript/components/bottomSheetScrollable/ScrollableContainer.android.d.ts +13 -0
  546. package/lib/typescript/components/bottomSheetScrollable/ScrollableContainer.android.d.ts.map +1 -0
  547. package/lib/typescript/components/bottomSheetScrollable/ScrollableContainer.d.ts +9 -0
  548. package/lib/typescript/components/bottomSheetScrollable/ScrollableContainer.d.ts.map +1 -0
  549. package/lib/typescript/components/bottomSheetScrollable/ScrollableContainer.web.d.ts +14 -0
  550. package/lib/typescript/components/bottomSheetScrollable/ScrollableContainer.web.d.ts.map +1 -0
  551. package/lib/typescript/components/bottomSheetScrollable/createBottomSheetScrollableComponent.d.ts +4 -0
  552. package/lib/typescript/components/bottomSheetScrollable/createBottomSheetScrollableComponent.d.ts.map +1 -0
  553. package/lib/typescript/components/bottomSheetScrollable/index.d.ts +8 -0
  554. package/lib/typescript/components/bottomSheetScrollable/index.d.ts.map +1 -0
  555. package/lib/typescript/components/bottomSheetScrollable/styles.d.ts +7 -0
  556. package/lib/typescript/components/bottomSheetScrollable/styles.d.ts.map +1 -0
  557. package/lib/typescript/components/bottomSheetScrollable/types.d.ts +280 -0
  558. package/lib/typescript/components/bottomSheetScrollable/useBottomSheetContentSizeSetter.d.ts +8 -0
  559. package/lib/typescript/components/bottomSheetScrollable/useBottomSheetContentSizeSetter.d.ts.map +1 -0
  560. package/lib/typescript/components/bottomSheetTextInput/BottomSheetTextInput.d.ts +6 -0
  561. package/lib/typescript/components/bottomSheetTextInput/BottomSheetTextInput.d.ts.map +1 -0
  562. package/lib/typescript/components/bottomSheetTextInput/index.d.ts +3 -0
  563. package/lib/typescript/components/bottomSheetTextInput/index.d.ts.map +1 -0
  564. package/lib/typescript/components/bottomSheetTextInput/types.d.ts +4 -0
  565. package/lib/typescript/components/bottomSheetTextInput/types.d.ts.map +1 -0
  566. package/lib/typescript/components/bottomSheetView/BottomSheetView.d.ts +6 -0
  567. package/lib/typescript/components/bottomSheetView/BottomSheetView.d.ts.map +1 -0
  568. package/lib/typescript/components/bottomSheetView/index.d.ts +2 -0
  569. package/lib/typescript/components/bottomSheetView/index.d.ts.map +1 -0
  570. package/lib/typescript/components/bottomSheetView/styles.d.ts +9 -0
  571. package/lib/typescript/components/bottomSheetView/styles.d.ts.map +1 -0
  572. package/lib/typescript/components/bottomSheetView/types.d.ts +24 -0
  573. package/lib/typescript/components/touchables/Touchables.d.ts +2 -0
  574. package/lib/typescript/components/touchables/Touchables.d.ts.map +1 -0
  575. package/lib/typescript/components/touchables/Touchables.ios.d.ts +2 -0
  576. package/lib/typescript/components/touchables/Touchables.ios.d.ts.map +1 -0
  577. package/lib/typescript/components/touchables/index.d.ts +8 -0
  578. package/lib/typescript/components/touchables/index.d.ts.map +1 -0
  579. package/lib/typescript/constants.d.ts +96 -0
  580. package/lib/typescript/constants.d.ts.map +1 -0
  581. package/lib/typescript/contexts/external.d.ts +4 -0
  582. package/lib/typescript/contexts/external.d.ts.map +1 -0
  583. package/lib/typescript/contexts/gesture.d.ts +9 -0
  584. package/lib/typescript/contexts/gesture.d.ts.map +1 -0
  585. package/lib/typescript/contexts/index.d.ts +7 -0
  586. package/lib/typescript/contexts/index.d.ts.map +1 -0
  587. package/lib/typescript/contexts/internal.d.ts +29 -0
  588. package/lib/typescript/contexts/internal.d.ts.map +1 -0
  589. package/lib/typescript/contexts/modal/external.d.ts +7 -0
  590. package/lib/typescript/contexts/modal/external.d.ts.map +1 -0
  591. package/lib/typescript/contexts/modal/internal.d.ts +14 -0
  592. package/lib/typescript/contexts/modal/internal.d.ts.map +1 -0
  593. package/lib/typescript/hooks/index.d.ts +19 -0
  594. package/lib/typescript/hooks/index.d.ts.map +1 -0
  595. package/lib/typescript/hooks/useAnimatedDetents.d.ts +20 -0
  596. package/lib/typescript/hooks/useAnimatedDetents.d.ts.map +1 -0
  597. package/lib/typescript/hooks/useAnimatedKeyboard.d.ts +6 -0
  598. package/lib/typescript/hooks/useAnimatedKeyboard.d.ts.map +1 -0
  599. package/lib/typescript/hooks/useAnimatedLayout.d.ts +26 -0
  600. package/lib/typescript/hooks/useAnimatedLayout.d.ts.map +1 -0
  601. package/lib/typescript/hooks/useBottomSheet.d.ts +2 -0
  602. package/lib/typescript/hooks/useBottomSheet.d.ts.map +1 -0
  603. package/lib/typescript/hooks/useBottomSheetContentContainerStyle.d.ts +3 -0
  604. package/lib/typescript/hooks/useBottomSheetContentContainerStyle.d.ts.map +1 -0
  605. package/lib/typescript/hooks/useBottomSheetGestureHandlers.d.ts +2 -0
  606. package/lib/typescript/hooks/useBottomSheetGestureHandlers.d.ts.map +1 -0
  607. package/lib/typescript/hooks/useBottomSheetInternal.d.ts +4 -0
  608. package/lib/typescript/hooks/useBottomSheetInternal.d.ts.map +1 -0
  609. package/lib/typescript/hooks/useBottomSheetModal.d.ts +2 -0
  610. package/lib/typescript/hooks/useBottomSheetModal.d.ts.map +1 -0
  611. package/lib/typescript/hooks/useBottomSheetModalInternal.d.ts +4 -0
  612. package/lib/typescript/hooks/useBottomSheetModalInternal.d.ts.map +1 -0
  613. package/lib/typescript/hooks/useBottomSheetScrollableCreator.d.ts +29 -0
  614. package/lib/typescript/hooks/useBottomSheetScrollableCreator.d.ts.map +1 -0
  615. package/lib/typescript/hooks/useBottomSheetSpringConfigs.d.ts +7 -0
  616. package/lib/typescript/hooks/useBottomSheetSpringConfigs.d.ts.map +1 -0
  617. package/lib/typescript/hooks/useBottomSheetTimingConfigs.d.ts +21 -0
  618. package/lib/typescript/hooks/useBottomSheetTimingConfigs.d.ts.map +1 -0
  619. package/lib/typescript/hooks/useBoundingClientRect.d.ts +42 -0
  620. package/lib/typescript/hooks/useBoundingClientRect.d.ts.map +1 -0
  621. package/lib/typescript/hooks/useGestureEventsHandlersDefault.d.ts +3 -0
  622. package/lib/typescript/hooks/useGestureEventsHandlersDefault.d.ts.map +1 -0
  623. package/lib/typescript/hooks/useGestureEventsHandlersDefault.web.d.ts +8 -0
  624. package/lib/typescript/hooks/useGestureEventsHandlersDefault.web.d.ts.map +1 -0
  625. package/lib/typescript/hooks/useGestureHandler.d.ts +3 -0
  626. package/lib/typescript/hooks/useGestureHandler.d.ts.map +1 -0
  627. package/lib/typescript/hooks/usePropsValidator.d.ts +7 -0
  628. package/lib/typescript/hooks/usePropsValidator.d.ts.map +1 -0
  629. package/lib/typescript/hooks/useReactiveSharedValue.d.ts +4 -0
  630. package/lib/typescript/hooks/useReactiveSharedValue.d.ts.map +1 -0
  631. package/lib/typescript/hooks/useScrollEventsHandlersDefault.d.ts +7 -0
  632. package/lib/typescript/hooks/useScrollEventsHandlersDefault.d.ts.map +1 -0
  633. package/lib/typescript/hooks/useScrollHandler.d.ts +7 -0
  634. package/lib/typescript/hooks/useScrollHandler.d.ts.map +1 -0
  635. package/lib/typescript/hooks/useScrollHandler.web.d.ts +11 -0
  636. package/lib/typescript/hooks/useScrollHandler.web.d.ts.map +1 -0
  637. package/lib/typescript/hooks/useScrollable.d.ts +11 -0
  638. package/lib/typescript/hooks/useScrollable.d.ts.map +1 -0
  639. package/lib/typescript/hooks/useScrollableSetter.d.ts +6 -0
  640. package/lib/typescript/hooks/useScrollableSetter.d.ts.map +1 -0
  641. package/lib/typescript/hooks/useStableCallback.d.ts +7 -0
  642. package/lib/typescript/hooks/useStableCallback.d.ts.map +1 -0
  643. package/lib/typescript/index.d.ts +35 -0
  644. package/lib/typescript/index.d.ts.map +1 -0
  645. package/lib/typescript/types.d.ts +336 -0
  646. package/lib/typescript/utilities/animate.d.ts +11 -0
  647. package/lib/typescript/utilities/animate.d.ts.map +1 -0
  648. package/lib/typescript/utilities/clamp.d.ts +2 -0
  649. package/lib/typescript/utilities/clamp.d.ts.map +1 -0
  650. package/lib/typescript/utilities/easingExp.d.ts +8 -0
  651. package/lib/typescript/utilities/easingExp.d.ts.map +1 -0
  652. package/lib/typescript/utilities/findNodeHandle.d.ts +2 -0
  653. package/lib/typescript/utilities/findNodeHandle.d.ts.map +1 -0
  654. package/lib/typescript/utilities/findNodeHandle.web.d.ts +3 -0
  655. package/lib/typescript/utilities/findNodeHandle.web.d.ts.map +1 -0
  656. package/lib/typescript/utilities/getKeyboardAnimationConfigs.d.ts +21 -0
  657. package/lib/typescript/utilities/getKeyboardAnimationConfigs.d.ts.map +1 -0
  658. package/lib/typescript/utilities/getRefNativeTag.web.d.ts +3 -0
  659. package/lib/typescript/utilities/getRefNativeTag.web.d.ts.map +1 -0
  660. package/lib/typescript/utilities/id.d.ts +2 -0
  661. package/lib/typescript/utilities/id.d.ts.map +1 -0
  662. package/lib/typescript/utilities/index.d.ts +8 -0
  663. package/lib/typescript/utilities/index.d.ts.map +1 -0
  664. package/lib/typescript/utilities/isFabricInstalled.d.ts +7 -0
  665. package/lib/typescript/utilities/isFabricInstalled.d.ts.map +1 -0
  666. package/lib/typescript/utilities/logger.d.ts +11 -0
  667. package/lib/typescript/utilities/logger.d.ts.map +1 -0
  668. package/lib/typescript/utilities/noop.d.ts +4 -0
  669. package/lib/typescript/utilities/noop.d.ts.map +1 -0
  670. package/lib/typescript/utilities/normalizeSnapPoint.d.ts +5 -0
  671. package/lib/typescript/utilities/normalizeSnapPoint.d.ts.map +1 -0
  672. package/lib/typescript/utilities/snapPoint.d.ts +2 -0
  673. package/lib/typescript/utilities/snapPoint.d.ts.map +1 -0
  674. package/lib/typescript/utilities/validateSnapPoint.d.ts +2 -0
  675. package/lib/typescript/utilities/validateSnapPoint.d.ts.map +1 -0
  676. package/package.json +1 -5
  677. package/src/components/bottomSheet/BottomSheet.tsx +22 -5
  678. package/src/components/bottomSheet/BottomSheetContent.tsx +0 -1
@@ -0,0 +1,1310 @@
1
+ "use strict";
2
+
3
+ import invariant from 'invariant';
4
+ import React, { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo } from 'react';
5
+ import { Platform, StyleSheet } from 'react-native';
6
+ import { State } from 'react-native-gesture-handler';
7
+ import Animated, { cancelAnimation, Extrapolation, interpolate, ReduceMotion, runOnJS, runOnUI, useAnimatedReaction, useDerivedValue, useReducedMotion, useSharedValue } from 'react-native-reanimated';
8
+ import { ANIMATION_SOURCE, ANIMATION_STATUS, INITIAL_LAYOUT_VALUE, KEYBOARD_BEHAVIOR, KEYBOARD_BLUR_BEHAVIOR, KEYBOARD_INPUT_MODE, KEYBOARD_STATUS, SHEET_STATE, SNAP_POINT_TYPE } from '../../constants';
9
+ import { BottomSheetInternalProvider, BottomSheetProvider } from '../../contexts';
10
+ import { useAnimatedDetents, useAnimatedKeyboard, useAnimatedLayout, usePropsValidator, useReactiveSharedValue, useScrollable, useStableCallback } from '../../hooks';
11
+ import { animate, getKeyboardAnimationConfigs, normalizeSnapPoint, print } from '../../utilities';
12
+ import { BottomSheetBackgroundContainer } from '../bottomSheetBackground';
13
+ // import BottomSheetDebugView from '../bottomSheetDebugView';
14
+ import { BottomSheetFooterContainer } from '../bottomSheetFooter';
15
+ import BottomSheetGestureHandlersProvider from '../bottomSheetGestureHandlersProvider';
16
+ import { BottomSheetHandle, BottomSheetHandleContainer } from '../bottomSheetHandle';
17
+ import { BottomSheetHostingContainer } from '../bottomSheetHostingContainer';
18
+ import { BottomSheetBody } from './BottomSheetBody';
19
+ import { BottomSheetContent } from './BottomSheetContent';
20
+ import { DEFAULT_ACCESSIBILITY_LABEL, DEFAULT_ACCESSIBILITY_ROLE, DEFAULT_ACCESSIBLE, DEFAULT_ANIMATE_ON_MOUNT, DEFAULT_DYNAMIC_SIZING, DEFAULT_ENABLE_BLUR_KEYBOARD_ON_GESTURE, DEFAULT_ENABLE_CONTENT_PANNING_GESTURE, DEFAULT_ENABLE_OVER_DRAG, DEFAULT_ENABLE_PAN_DOWN_TO_CLOSE, DEFAULT_KEYBOARD_BEHAVIOR, DEFAULT_KEYBOARD_BLUR_BEHAVIOR, DEFAULT_KEYBOARD_INDEX, DEFAULT_KEYBOARD_INPUT_MODE, DEFAULT_OVER_DRAG_RESISTANCE_FACTOR, INITIAL_POSITION, INITIAL_VALUE } from './constants';
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ Animated.addWhitelistedUIProps({
23
+ decelerationRate: true
24
+ });
25
+ const BottomSheetComponent = /*#__PURE__*/forwardRef(function BottomSheet(props, ref) {
26
+ //#region extract props
27
+ const {
28
+ // animations configurations
29
+ animationConfigs: _providedAnimationConfigs,
30
+ // configurations
31
+ index: _providedIndex = 0,
32
+ snapPoints: _providedSnapPoints,
33
+ animateOnMount = DEFAULT_ANIMATE_ON_MOUNT,
34
+ enableContentPanningGesture = DEFAULT_ENABLE_CONTENT_PANNING_GESTURE,
35
+ enableHandlePanningGesture,
36
+ enableOverDrag = DEFAULT_ENABLE_OVER_DRAG,
37
+ enablePanDownToClose = DEFAULT_ENABLE_PAN_DOWN_TO_CLOSE,
38
+ enableDynamicSizing = DEFAULT_DYNAMIC_SIZING,
39
+ overDragResistanceFactor = DEFAULT_OVER_DRAG_RESISTANCE_FACTOR,
40
+ overrideReduceMotion: _providedOverrideReduceMotion,
41
+ // styles
42
+ style,
43
+ containerStyle: _providedContainerStyle,
44
+ backgroundStyle: _providedBackgroundStyle,
45
+ handleStyle: _providedHandleStyle,
46
+ handleIndicatorStyle: _providedHandleIndicatorStyle,
47
+ // hooks
48
+ gestureEventsHandlersHook,
49
+ // keyboard
50
+ keyboardBehavior = DEFAULT_KEYBOARD_BEHAVIOR,
51
+ keyboardBlurBehavior = DEFAULT_KEYBOARD_BLUR_BEHAVIOR,
52
+ android_keyboardInputMode = DEFAULT_KEYBOARD_INPUT_MODE,
53
+ enableBlurKeyboardOnGesture = DEFAULT_ENABLE_BLUR_KEYBOARD_ON_GESTURE,
54
+ // layout
55
+ containerLayoutState,
56
+ topInset = 0,
57
+ bottomInset = 0,
58
+ maxDynamicContentSize,
59
+ containerHeight,
60
+ containerOffset,
61
+ // animated callback shared values
62
+ animatedPosition: _providedAnimatedPosition,
63
+ animatedIndex: _providedAnimatedIndex,
64
+ // gestures
65
+ simultaneousHandlers: _providedSimultaneousHandlers,
66
+ waitFor: _providedWaitFor,
67
+ activeOffsetX: _providedActiveOffsetX,
68
+ activeOffsetY: _providedActiveOffsetY,
69
+ failOffsetX: _providedFailOffsetX,
70
+ failOffsetY: _providedFailOffsetY,
71
+ // callbacks
72
+ onChange: _providedOnChange,
73
+ onClose: _providedOnClose,
74
+ onAnimate: _providedOnAnimate,
75
+ // private
76
+ $modal = false,
77
+ detached = false,
78
+ // components
79
+ handleComponent = BottomSheetHandle,
80
+ backdropComponent: BackdropComponent,
81
+ backgroundComponent,
82
+ footerComponent,
83
+ children,
84
+ // accessibility
85
+ accessible: _providedAccessible = DEFAULT_ACCESSIBLE,
86
+ accessibilityLabel: _providedAccessibilityLabel = DEFAULT_ACCESSIBILITY_LABEL,
87
+ accessibilityRole: _providedAccessibilityRole = DEFAULT_ACCESSIBILITY_ROLE
88
+ } = props;
89
+ //#endregion
90
+
91
+ //#region validate props
92
+ if (__DEV__) {
93
+ // biome-ignore lint/correctness/useHookAtTopLevel: used in development only.
94
+ usePropsValidator({
95
+ index: _providedIndex,
96
+ snapPoints: _providedSnapPoints,
97
+ enableDynamicSizing,
98
+ topInset,
99
+ bottomInset,
100
+ containerHeight,
101
+ containerOffset
102
+ });
103
+ }
104
+ //#endregion
105
+
106
+ //#region layout variables
107
+ const animatedLayoutState = useAnimatedLayout(containerLayoutState, topInset, bottomInset, $modal, handleComponent === null);
108
+ const animatedDetentsState = useAnimatedDetents(_providedSnapPoints, animatedLayoutState, enableDynamicSizing, maxDynamicContentSize, detached, $modal, bottomInset);
109
+ const animatedSheetHeight = useDerivedValue(() => {
110
+ const {
111
+ containerHeight
112
+ } = animatedLayoutState.get();
113
+ const {
114
+ highestDetentPosition
115
+ } = animatedDetentsState.get();
116
+ if (highestDetentPosition === undefined) {
117
+ return INITIAL_LAYOUT_VALUE;
118
+ }
119
+ return containerHeight - highestDetentPosition;
120
+ }, [animatedLayoutState, animatedDetentsState]);
121
+ const animatedCurrentIndex = useReactiveSharedValue(animateOnMount ? -1 : _providedIndex);
122
+ const animatedPosition = useSharedValue(INITIAL_POSITION);
123
+
124
+ // conditional
125
+ const isAnimatedOnMount = useSharedValue(!animateOnMount || _providedIndex === -1);
126
+ const isLayoutCalculated = useDerivedValue(() => {
127
+ let isContainerHeightCalculated = false;
128
+ const {
129
+ containerHeight,
130
+ handleHeight
131
+ } = animatedLayoutState.get();
132
+ //container height was provided.
133
+ if (containerHeight !== null || containerHeight !== undefined) {
134
+ isContainerHeightCalculated = true;
135
+ }
136
+ // container height did set.
137
+ if (containerHeight !== INITIAL_LAYOUT_VALUE) {
138
+ isContainerHeightCalculated = true;
139
+ }
140
+ let isHandleHeightCalculated = false;
141
+ // handle component is null.
142
+ if (handleComponent === null) {
143
+ isHandleHeightCalculated = true;
144
+ }
145
+ // handle height did set.
146
+ if (handleHeight !== INITIAL_LAYOUT_VALUE) {
147
+ isHandleHeightCalculated = true;
148
+ }
149
+ let isSnapPointsNormalized = false;
150
+ const {
151
+ detents
152
+ } = animatedDetentsState.get();
153
+ // the first snap point did normalized
154
+ if (detents) {
155
+ isSnapPointsNormalized = true;
156
+ }
157
+ return isContainerHeightCalculated && isHandleHeightCalculated && isSnapPointsNormalized;
158
+ }, [animatedLayoutState, animatedDetentsState, handleComponent]);
159
+ const isInTemporaryPosition = useSharedValue(false);
160
+ const animatedContainerHeightDidChange = useSharedValue(false);
161
+
162
+ // gesture
163
+ const animatedContentGestureState = useSharedValue(State.UNDETERMINED);
164
+ const animatedHandleGestureState = useSharedValue(State.UNDETERMINED);
165
+ //#endregion
166
+
167
+ //#region hooks variables
168
+ // keyboard
169
+ const {
170
+ state: animatedKeyboardState,
171
+ textInputNodesRef
172
+ } = useAnimatedKeyboard();
173
+ const userReduceMotionSetting = useReducedMotion();
174
+ const reduceMotion = useMemo(() => {
175
+ return !_providedOverrideReduceMotion || _providedOverrideReduceMotion === ReduceMotion.System ? userReduceMotionSetting : _providedOverrideReduceMotion === ReduceMotion.Always;
176
+ }, [userReduceMotionSetting, _providedOverrideReduceMotion]);
177
+ //#endregion
178
+
179
+ //#region state/dynamic variables
180
+ // states
181
+ const animatedAnimationState = useSharedValue({
182
+ status: ANIMATION_STATUS.UNDETERMINED,
183
+ source: ANIMATION_SOURCE.MOUNT
184
+ });
185
+ const animatedSheetState = useDerivedValue(() => {
186
+ const {
187
+ detents,
188
+ closedDetentPosition
189
+ } = animatedDetentsState.get();
190
+ if (!detents || detents.length === 0 || closedDetentPosition === undefined) {
191
+ return SHEET_STATE.CLOSED;
192
+ }
193
+
194
+ // closed position = position >= container height
195
+ if (animatedPosition.value >= closedDetentPosition) {
196
+ return SHEET_STATE.CLOSED;
197
+ }
198
+ const {
199
+ containerHeight
200
+ } = animatedLayoutState.get();
201
+ // extended position = container height - sheet height
202
+ const extendedPosition = containerHeight - animatedSheetHeight.value;
203
+ if (animatedPosition.value === extendedPosition) {
204
+ return SHEET_STATE.EXTENDED;
205
+ }
206
+
207
+ // extended position with keyboard =
208
+ // container height - (sheet height + keyboard height in root container)
209
+ const keyboardHeightInContainer = animatedKeyboardState.get().heightWithinContainer;
210
+ const extendedPositionWithKeyboard = Math.max(0, containerHeight - (animatedSheetHeight.value + keyboardHeightInContainer));
211
+
212
+ // detect if keyboard is open and the sheet is in temporary position
213
+ if (keyboardBehavior === KEYBOARD_BEHAVIOR.interactive && isInTemporaryPosition.value && animatedPosition.value === extendedPositionWithKeyboard) {
214
+ return SHEET_STATE.EXTENDED;
215
+ }
216
+
217
+ // fill parent = 0
218
+ if (animatedPosition.value === 0) {
219
+ return SHEET_STATE.FILL_PARENT;
220
+ }
221
+
222
+ // detect if position is below extended point
223
+ if (animatedPosition.value < extendedPosition) {
224
+ return SHEET_STATE.OVER_EXTENDED;
225
+ }
226
+ return SHEET_STATE.OPENED;
227
+ }, [animatedLayoutState, animatedDetentsState, animatedKeyboardState, animatedPosition, animatedSheetHeight, isInTemporaryPosition, keyboardBehavior]);
228
+ const {
229
+ state: animatedScrollableState,
230
+ status: animatedScrollableStatus,
231
+ setScrollableRef,
232
+ removeScrollableRef
233
+ } = useScrollable(enableContentPanningGesture, animatedSheetState, animatedKeyboardState, animatedAnimationState);
234
+ // dynamic
235
+ const animatedIndex = useDerivedValue(() => {
236
+ const {
237
+ detents
238
+ } = animatedDetentsState.get();
239
+ if (!detents || detents.length === 0) {
240
+ return -1;
241
+ }
242
+ const adjustedSnapPoints = detents.slice().reverse();
243
+ const adjustedSnapPointsIndexes = detents.slice().map((_, index) => index).reverse();
244
+ const {
245
+ containerHeight
246
+ } = animatedLayoutState.get();
247
+ /**
248
+ * we add the close state index `-1`
249
+ */
250
+ adjustedSnapPoints.push(containerHeight);
251
+ adjustedSnapPointsIndexes.push(-1);
252
+ const currentIndex = isLayoutCalculated.value ? interpolate(animatedPosition.value, adjustedSnapPoints, adjustedSnapPointsIndexes, Extrapolation.CLAMP) : -1;
253
+ const {
254
+ status: animationStatus,
255
+ source: animationSource,
256
+ nextIndex,
257
+ nextPosition
258
+ } = animatedAnimationState.get();
259
+ /**
260
+ * if the sheet is currently running an animation by the keyboard opening,
261
+ * then we clamp the index on android with resize keyboard mode.
262
+ */
263
+ if (android_keyboardInputMode === KEYBOARD_INPUT_MODE.adjustResize && animationStatus === ANIMATION_STATUS.RUNNING && animationSource === ANIMATION_SOURCE.KEYBOARD && isInTemporaryPosition.value) {
264
+ return Math.max(animatedCurrentIndex.value, currentIndex);
265
+ }
266
+
267
+ /**
268
+ * if the sheet is currently running an animation by snap point change - usually caused
269
+ * by dynamic content height -, then we return the next position index.
270
+ */
271
+ if (animationStatus === ANIMATION_STATUS.RUNNING && animationSource === ANIMATION_SOURCE.SNAP_POINT_CHANGE && nextIndex !== undefined && nextPosition !== undefined) {
272
+ return nextIndex;
273
+ }
274
+ return currentIndex;
275
+ }, [android_keyboardInputMode, animatedAnimationState, animatedLayoutState, animatedCurrentIndex, animatedPosition, animatedDetentsState, isInTemporaryPosition, isLayoutCalculated]);
276
+ //#endregion
277
+
278
+ //#region private methods
279
+ const handleOnChange = useCallback(function handleOnChange(index, position) {
280
+ if (__DEV__) {
281
+ print({
282
+ component: 'BottomSheet',
283
+ method: 'handleOnChange',
284
+ category: 'callback',
285
+ params: {
286
+ index,
287
+ position
288
+ }
289
+ });
290
+ }
291
+ if (!_providedOnChange) {
292
+ return;
293
+ }
294
+ const {
295
+ dynamicDetentIndex
296
+ } = animatedDetentsState.get();
297
+ _providedOnChange(index, position, index === dynamicDetentIndex ? SNAP_POINT_TYPE.DYNAMIC : SNAP_POINT_TYPE.PROVIDED);
298
+ }, [_providedOnChange, animatedDetentsState]);
299
+ const handleOnAnimate = useCallback(function handleOnAnimate(targetIndex, targetPosition) {
300
+ if (__DEV__) {
301
+ print({
302
+ component: 'BottomSheet',
303
+ method: 'handleOnAnimate',
304
+ category: 'callback',
305
+ params: {
306
+ toIndex: targetIndex,
307
+ toPosition: targetPosition,
308
+ fromIndex: animatedCurrentIndex.value,
309
+ fromPosition: animatedPosition.value
310
+ }
311
+ });
312
+ }
313
+ if (targetIndex === animatedCurrentIndex.get()) {
314
+ return;
315
+ }
316
+ if (!_providedOnAnimate) {
317
+ return;
318
+ }
319
+ _providedOnAnimate(animatedCurrentIndex.value, targetIndex, animatedPosition.value, targetPosition);
320
+ }, [_providedOnAnimate, animatedCurrentIndex, animatedPosition]);
321
+ const handleOnClose = useCallback(function handleOnClose() {
322
+ if (__DEV__) {
323
+ print({
324
+ component: 'BottomSheet',
325
+ method: 'handleOnClose',
326
+ category: 'callback'
327
+ });
328
+ }
329
+ if (!_providedOnClose) {
330
+ return;
331
+ }
332
+ _providedOnClose();
333
+ }, [_providedOnClose]);
334
+ //#endregion
335
+
336
+ //#region animation
337
+ const stopAnimation = useCallback(() => {
338
+ 'worklet';
339
+
340
+ cancelAnimation(animatedPosition);
341
+ animatedAnimationState.set({
342
+ status: ANIMATION_STATUS.STOPPED,
343
+ source: ANIMATION_SOURCE.NONE
344
+ });
345
+ }, [animatedPosition, animatedAnimationState]);
346
+ const animateToPositionCompleted = useCallback(function animateToPositionCompleted(isFinished) {
347
+ 'worklet';
348
+
349
+ if (!isFinished) {
350
+ return;
351
+ }
352
+ const {
353
+ nextIndex,
354
+ nextPosition
355
+ } = animatedAnimationState.get();
356
+ if (__DEV__) {
357
+ runOnJS(print)({
358
+ component: 'BottomSheet',
359
+ method: 'animateToPositionCompleted',
360
+ params: {
361
+ currentIndex: animatedCurrentIndex.value,
362
+ nextIndex,
363
+ nextPosition
364
+ }
365
+ });
366
+ }
367
+ if (nextIndex === undefined || nextPosition === undefined) {
368
+ return;
369
+ }
370
+
371
+ // callbacks
372
+ if (nextIndex !== animatedCurrentIndex.get()) {
373
+ runOnJS(handleOnChange)(nextIndex, nextPosition);
374
+ }
375
+ if (nextIndex === -1) {
376
+ runOnJS(handleOnClose)();
377
+ }
378
+ animatedCurrentIndex.set(nextIndex);
379
+
380
+ // reset values
381
+ animatedContainerHeightDidChange.set(false);
382
+ isAnimatedOnMount.set(true);
383
+ animatedAnimationState.set({
384
+ status: ANIMATION_STATUS.STOPPED,
385
+ source: ANIMATION_SOURCE.NONE,
386
+ nextIndex: undefined,
387
+ nextPosition: undefined,
388
+ isForcedClosing: undefined
389
+ });
390
+ }, [handleOnChange, handleOnClose, animatedCurrentIndex, animatedAnimationState, animatedContainerHeightDidChange, isAnimatedOnMount]);
391
+ const animateToPosition = useCallback(function animateToPosition(position, source, velocity = 0, configs) {
392
+ 'worklet';
393
+
394
+ if (__DEV__) {
395
+ runOnJS(print)({
396
+ component: 'BottomSheet',
397
+ method: 'animateToPosition',
398
+ params: {
399
+ currentPosition: animatedPosition.value,
400
+ nextPosition: position,
401
+ source
402
+ }
403
+ });
404
+ }
405
+ if (position === undefined) {
406
+ return;
407
+ }
408
+ if (position === animatedPosition.get()) {
409
+ return;
410
+ }
411
+
412
+ // early exit if there is a running animation to
413
+ // the same position
414
+ const {
415
+ status: animationStatus,
416
+ nextPosition
417
+ } = animatedAnimationState.get();
418
+ if (animationStatus === ANIMATION_STATUS.RUNNING && position === nextPosition) {
419
+ return;
420
+ }
421
+
422
+ // stop animation if it is running
423
+ if (animationStatus === ANIMATION_STATUS.RUNNING) {
424
+ stopAnimation();
425
+ }
426
+
427
+ /**
428
+ * offset the position if keyboard is shown and behavior not extend.
429
+ */
430
+ let offset = 0;
431
+ const {
432
+ status,
433
+ heightWithinContainer
434
+ } = animatedKeyboardState.get();
435
+ const sheetState = animatedSheetState.get();
436
+ if (status === KEYBOARD_STATUS.SHOWN && keyboardBehavior !== KEYBOARD_BEHAVIOR.extend && ([ANIMATION_SOURCE.KEYBOARD, ANIMATION_SOURCE.SNAP_POINT_CHANGE].includes(source) || sheetState === SHEET_STATE.OVER_EXTENDED)) {
437
+ offset = heightWithinContainer;
438
+ }
439
+ const {
440
+ detents,
441
+ closedDetentPosition,
442
+ highestDetentPosition
443
+ } = animatedDetentsState.get();
444
+ let index = detents?.indexOf(position + offset) ?? -1;
445
+
446
+ /**
447
+ * because keyboard position is not part of the detents array,
448
+ * we will need to manually set the index to the highest detent index.
449
+ */
450
+ if (index === -1 && status === KEYBOARD_STATUS.SHOWN && position !== closedDetentPosition) {
451
+ index = highestDetentPosition ?? DEFAULT_KEYBOARD_INDEX;
452
+ }
453
+
454
+ /**
455
+ * set the animation state
456
+ */
457
+ animatedAnimationState.set(state => {
458
+ 'worklet';
459
+
460
+ return {
461
+ ...state,
462
+ status: ANIMATION_STATUS.RUNNING,
463
+ source,
464
+ nextIndex: index,
465
+ nextPosition: position
466
+ };
467
+ });
468
+
469
+ /**
470
+ * fire `onAnimate` callback
471
+ */
472
+ runOnJS(handleOnAnimate)(index, position);
473
+
474
+ /**
475
+ * start animation
476
+ */
477
+ animatedPosition.value = animate({
478
+ point: position,
479
+ configs: configs || _providedAnimationConfigs,
480
+ velocity,
481
+ overrideReduceMotion: _providedOverrideReduceMotion,
482
+ onComplete: animateToPositionCompleted
483
+ });
484
+ }, [handleOnAnimate, stopAnimation, animateToPositionCompleted, keyboardBehavior, _providedAnimationConfigs, _providedOverrideReduceMotion, animatedDetentsState, animatedAnimationState, animatedKeyboardState, animatedPosition, animatedSheetState]);
485
+ /**
486
+ * Set to position without animation.
487
+ *
488
+ * @param targetPosition position to be set.
489
+ */
490
+ const setToPosition = useCallback(function setToPosition(targetPosition) {
491
+ 'worklet';
492
+
493
+ if (targetPosition === undefined || targetPosition !== targetPosition) {
494
+ return;
495
+ }
496
+ if (targetPosition === animatedPosition.get() && !animatedContainerHeightDidChange.value) {
497
+ return;
498
+ }
499
+ const {
500
+ status: animationStatus,
501
+ nextPosition
502
+ } = animatedAnimationState.get();
503
+
504
+ // early exit if there is a running animation to
505
+ // the same position
506
+ if (animationStatus === ANIMATION_STATUS.RUNNING && targetPosition === nextPosition) {
507
+ return;
508
+ }
509
+ if (__DEV__) {
510
+ runOnJS(print)({
511
+ component: 'BottomSheet',
512
+ method: 'setToPosition',
513
+ params: {
514
+ currentPosition: animatedPosition.value,
515
+ targetPosition
516
+ }
517
+ });
518
+ }
519
+
520
+ /**
521
+ * store next position
522
+ */
523
+ const {
524
+ detents
525
+ } = animatedDetentsState.get();
526
+ const index = detents?.indexOf(targetPosition) ?? -1;
527
+ animatedAnimationState.set(state => {
528
+ 'worklet';
529
+
530
+ return {
531
+ ...state,
532
+ nextPosition: targetPosition,
533
+ nextIndex: index
534
+ };
535
+ });
536
+ stopAnimation();
537
+
538
+ // set values
539
+ animatedPosition.value = targetPosition;
540
+ animatedContainerHeightDidChange.value = false;
541
+ }, [stopAnimation, animatedPosition, animatedContainerHeightDidChange, animatedAnimationState, animatedDetentsState]);
542
+ //#endregion
543
+
544
+ //#region private methods
545
+ /**
546
+ * Calculate and evaluate the current position based on multiple
547
+ * local states.
548
+ */
549
+ const getEvaluatedPosition = useCallback(function getEvaluatedPosition(source) {
550
+ 'worklet';
551
+
552
+ const currentIndex = animatedCurrentIndex.value;
553
+ const {
554
+ detents,
555
+ highestDetentPosition,
556
+ closedDetentPosition
557
+ } = animatedDetentsState.get();
558
+ const keyboardStatus = animatedKeyboardState.get().status;
559
+ if (detents === undefined || highestDetentPosition === undefined || closedDetentPosition === undefined) {
560
+ return;
561
+ }
562
+
563
+ /**
564
+ * if the keyboard is hidden and blur behavior is restore (or on Android
565
+ * with adjustPan where the sheet is in a temporary position),
566
+ * then we return the previous snap point.
567
+ */
568
+ if (source === ANIMATION_SOURCE.KEYBOARD && keyboardStatus === KEYBOARD_STATUS.HIDDEN && animatedContentGestureState.value !== State.ACTIVE && animatedHandleGestureState.value !== State.ACTIVE && (keyboardBlurBehavior === KEYBOARD_BLUR_BEHAVIOR.restore || Platform.OS === 'android' && android_keyboardInputMode !== KEYBOARD_INPUT_MODE.adjustResize && isInTemporaryPosition.value)) {
569
+ isInTemporaryPosition.value = false;
570
+ const nextPosition = detents[currentIndex];
571
+ return nextPosition;
572
+ }
573
+
574
+ /**
575
+ * if the keyboard appearance behavior is extend and keyboard is shown,
576
+ * then we return the heights snap point.
577
+ */
578
+ if (keyboardBehavior === KEYBOARD_BEHAVIOR.extend && keyboardStatus === KEYBOARD_STATUS.SHOWN) {
579
+ return highestDetentPosition;
580
+ }
581
+
582
+ /**
583
+ * if the keyboard appearance behavior is fill parent and keyboard is shown,
584
+ * then we return 0 ( full screen ).
585
+ */
586
+ if (keyboardBehavior === KEYBOARD_BEHAVIOR.fillParent && keyboardStatus === KEYBOARD_STATUS.SHOWN) {
587
+ isInTemporaryPosition.value = true;
588
+ return 0;
589
+ }
590
+
591
+ /**
592
+ * if the keyboard appearance behavior is interactive and keyboard is shown,
593
+ * then we return the heights points minus the keyboard in container height.
594
+ */
595
+ if (keyboardBehavior === KEYBOARD_BEHAVIOR.interactive && keyboardStatus === KEYBOARD_STATUS.SHOWN &&
596
+ // ensure that this logic does not run on android
597
+ // with resize input mode
598
+ !(Platform.OS === 'android' && android_keyboardInputMode === 'adjustResize')) {
599
+ isInTemporaryPosition.value = true;
600
+ const keyboardHeightInContainer = animatedKeyboardState.get().heightWithinContainer;
601
+ return Math.max(0, highestDetentPosition - keyboardHeightInContainer);
602
+ }
603
+
604
+ /**
605
+ * if the bottom sheet is in temporary position, then we return
606
+ * the current position.
607
+ */
608
+ if (isInTemporaryPosition.value) {
609
+ return animatedPosition.value;
610
+ }
611
+
612
+ /**
613
+ * if the bottom sheet did not animate on mount,
614
+ * then we return the provided index or the closed position.
615
+ */
616
+ if (!isAnimatedOnMount.value) {
617
+ return _providedIndex === -1 ? closedDetentPosition : detents[_providedIndex];
618
+ }
619
+ const {
620
+ status,
621
+ nextIndex,
622
+ nextPosition
623
+ } = animatedAnimationState.get();
624
+
625
+ /**
626
+ * if the evaluated position is for a snap change source while the sheet is currently running
627
+ * an animation and the next position is different than the detent at next index,
628
+ * then we return the detent at next index.
629
+ *
630
+ * https://github.com/gorhom/react-native-bottom-sheet/issues/2431
631
+ */
632
+ if (source === ANIMATION_SOURCE.SNAP_POINT_CHANGE && status === ANIMATION_STATUS.RUNNING && nextIndex !== undefined && nextPosition !== undefined && detents[nextIndex] !== nextPosition) {
633
+ return detents[nextIndex];
634
+ }
635
+
636
+ /**
637
+ * return the current index position.
638
+ */
639
+ return detents[currentIndex];
640
+ }, [animatedContentGestureState, animatedCurrentIndex, animatedHandleGestureState, animatedAnimationState, animatedKeyboardState, animatedPosition, animatedDetentsState, isInTemporaryPosition, isAnimatedOnMount, keyboardBehavior, keyboardBlurBehavior, _providedIndex, android_keyboardInputMode]);
641
+
642
+ /**
643
+ * Evaluate the bottom sheet position based based on a event source and other local states.
644
+ */
645
+ const evaluatePosition = useCallback(function evaluatePosition(source, animationConfigs) {
646
+ 'worklet';
647
+
648
+ const {
649
+ status: animationStatus,
650
+ nextIndex,
651
+ isForcedClosing
652
+ } = animatedAnimationState.get();
653
+ const {
654
+ detents,
655
+ closedDetentPosition
656
+ } = animatedDetentsState.get();
657
+ if (detents === undefined || detents.length === 0 || closedDetentPosition === undefined) {
658
+ return;
659
+ }
660
+
661
+ /**
662
+ * if a force closing is running and source not from user, then we early exit
663
+ */
664
+ if (isForcedClosing && source !== ANIMATION_SOURCE.USER) {
665
+ return;
666
+ }
667
+ /**
668
+ * when evaluating the position while layout is not calculated, then we early exit till it is.
669
+ */
670
+ if (!isLayoutCalculated.value) {
671
+ return;
672
+ }
673
+ const proposedPosition = getEvaluatedPosition(source);
674
+ if (proposedPosition === undefined) {
675
+ return;
676
+ }
677
+
678
+ /**
679
+ * when evaluating the position while the mount animation not been handled,
680
+ * then we evaluate on mount use cases.
681
+ */
682
+ if (!isAnimatedOnMount.value) {
683
+ /**
684
+ * if animate on mount is set to true, then we animate to the propose position,
685
+ * else, we set the position with out animation.
686
+ */
687
+ if (animateOnMount) {
688
+ animateToPosition(proposedPosition, ANIMATION_SOURCE.MOUNT, undefined, animationConfigs);
689
+ } else {
690
+ setToPosition(proposedPosition);
691
+ isAnimatedOnMount.value = true;
692
+ }
693
+ return;
694
+ }
695
+
696
+ /**
697
+ * when evaluating the position while the bottom sheet is animating.
698
+ */
699
+ if (animationStatus === ANIMATION_STATUS.RUNNING) {
700
+ const nextPositionIndex = nextIndex ?? INITIAL_VALUE;
701
+ /**
702
+ * when evaluating the position while the bottom sheet is
703
+ * closing, then we force closing the bottom sheet with no animation.
704
+ */
705
+ if (nextPositionIndex === -1 && !isInTemporaryPosition.value) {
706
+ setToPosition(closedDetentPosition);
707
+ return;
708
+ }
709
+
710
+ /**
711
+ * when evaluating the position while it's animating to
712
+ * a position other than the current position, then we
713
+ * restart the animation.
714
+ */
715
+ if (nextPositionIndex !== animatedCurrentIndex.value) {
716
+ animateToPosition(detents[nextPositionIndex], source, undefined, animationConfigs);
717
+ return;
718
+ }
719
+ }
720
+
721
+ /**
722
+ * when evaluating the position while the bottom sheet is in closed
723
+ * position and not animating, we re-set the position to closed position.
724
+ */
725
+ if (animationStatus !== ANIMATION_STATUS.RUNNING && animatedCurrentIndex.value === -1) {
726
+ /**
727
+ * early exit if reduce motion is enabled and index is out of sync with position.
728
+ */
729
+ if (reduceMotion && detents[animatedIndex.value] !== animatedPosition.value) {
730
+ return;
731
+ }
732
+ setToPosition(closedDetentPosition);
733
+ return;
734
+ }
735
+
736
+ /**
737
+ * when evaluating the position after the container resize, then we
738
+ * force the bottom sheet to the proposed position with no
739
+ * animation.
740
+ */
741
+ if (animatedContainerHeightDidChange.value) {
742
+ setToPosition(proposedPosition);
743
+ return;
744
+ }
745
+
746
+ /**
747
+ * we fall back to the proposed position.
748
+ */
749
+ animateToPosition(proposedPosition, source, undefined, animationConfigs);
750
+ }, [getEvaluatedPosition, animateToPosition, setToPosition, reduceMotion, animateOnMount, animatedAnimationState, animatedContainerHeightDidChange, animatedCurrentIndex, animatedIndex, animatedPosition, animatedDetentsState, isAnimatedOnMount, isInTemporaryPosition, isLayoutCalculated]);
751
+ //#endregion
752
+
753
+ //#region public methods
754
+ const handleSnapToIndex = useStableCallback(function handleSnapToIndex(index, animationConfigs) {
755
+ const {
756
+ detents
757
+ } = animatedDetentsState.get();
758
+ const isLayoutReady = isLayoutCalculated.get();
759
+ if (detents === undefined || detents.length === 0) {
760
+ return;
761
+ }
762
+
763
+ // early exit if layout is not ready yet.
764
+ if (!isLayoutReady) {
765
+ return;
766
+ }
767
+ invariant(index >= -1 && index <= detents.length - 1, `'index' was provided but out of the provided snap points range! expected value to be between -1, ${detents.length - 1}`);
768
+ if (__DEV__) {
769
+ print({
770
+ component: 'BottomSheet',
771
+ method: 'handleSnapToIndex',
772
+ params: {
773
+ index
774
+ }
775
+ });
776
+ }
777
+ const targetPosition = detents[index];
778
+
779
+ /**
780
+ * exit method if :
781
+ * - layout is not calculated.
782
+ * - already animating to next position.
783
+ * - sheet is forced closing.
784
+ */
785
+ const {
786
+ nextPosition,
787
+ nextIndex,
788
+ isForcedClosing
789
+ } = animatedAnimationState.get();
790
+ if (!isLayoutCalculated.value || index === nextIndex || targetPosition === nextPosition || isForcedClosing) {
791
+ return;
792
+ }
793
+
794
+ /**
795
+ * reset temporary position boolean.
796
+ */
797
+ isInTemporaryPosition.value = false;
798
+ runOnUI(animateToPosition)(targetPosition, ANIMATION_SOURCE.USER, 0, animationConfigs);
799
+ });
800
+ const handleSnapToPosition = useCallback(function handleSnapToPosition(position, animationConfigs) {
801
+ 'worklet';
802
+
803
+ if (__DEV__) {
804
+ print({
805
+ component: 'BottomSheet',
806
+ method: 'handleSnapToPosition',
807
+ params: {
808
+ position
809
+ }
810
+ });
811
+ }
812
+ const {
813
+ containerHeight
814
+ } = animatedLayoutState.get();
815
+ /**
816
+ * normalized provided position.
817
+ */
818
+ const targetPosition = normalizeSnapPoint(position, containerHeight);
819
+
820
+ /**
821
+ * exit method if :
822
+ * - layout is not calculated.
823
+ * - already animating to next position.
824
+ * - sheet is forced closing.
825
+ */
826
+ const {
827
+ nextPosition,
828
+ isForcedClosing
829
+ } = animatedAnimationState.get();
830
+ if (!isLayoutCalculated || targetPosition === nextPosition || isForcedClosing) {
831
+ return;
832
+ }
833
+
834
+ /**
835
+ * mark the new position as temporary.
836
+ */
837
+ isInTemporaryPosition.value = true;
838
+ runOnUI(animateToPosition)(targetPosition, ANIMATION_SOURCE.USER, 0, animationConfigs);
839
+ }, [animateToPosition, isInTemporaryPosition, isLayoutCalculated, animatedLayoutState, animatedAnimationState]);
840
+ const handleClose = useCallback(function handleClose(animationConfigs) {
841
+ if (__DEV__) {
842
+ print({
843
+ component: 'BottomSheet',
844
+ method: 'handleClose'
845
+ });
846
+ }
847
+ const closedDetentPosition = animatedDetentsState.get().closedDetentPosition;
848
+ if (closedDetentPosition === undefined) {
849
+ return;
850
+ }
851
+ const targetPosition = closedDetentPosition;
852
+
853
+ /**
854
+ * exit method if :
855
+ * - layout is not calculated.
856
+ * - already animating to next position.
857
+ * - sheet is forced closing.
858
+ */
859
+ const {
860
+ nextPosition,
861
+ isForcedClosing
862
+ } = animatedAnimationState.get();
863
+ if (!isLayoutCalculated.value || targetPosition === nextPosition || isForcedClosing) {
864
+ return;
865
+ }
866
+
867
+ /**
868
+ * reset temporary position variable.
869
+ */
870
+ isInTemporaryPosition.value = false;
871
+ runOnUI(animateToPosition)(targetPosition, ANIMATION_SOURCE.USER, 0, animationConfigs);
872
+ }, [animateToPosition, isLayoutCalculated, isInTemporaryPosition, animatedDetentsState, animatedAnimationState]);
873
+ const handleForceClose = useCallback(function handleForceClose(animationConfigs) {
874
+ if (__DEV__) {
875
+ print({
876
+ component: 'BottomSheet',
877
+ method: 'handleForceClose'
878
+ });
879
+ }
880
+ const closedDetentPosition = animatedDetentsState.get().closedDetentPosition;
881
+ if (closedDetentPosition === undefined) {
882
+ return;
883
+ }
884
+ const targetPosition = closedDetentPosition;
885
+
886
+ /**
887
+ * exit method if :
888
+ * - already animating to next position.
889
+ * - sheet is forced closing.
890
+ */
891
+ const {
892
+ nextPosition,
893
+ isForcedClosing
894
+ } = animatedAnimationState.get();
895
+ if (targetPosition === nextPosition || isForcedClosing) {
896
+ return;
897
+ }
898
+
899
+ /**
900
+ * reset temporary position variable.
901
+ */
902
+ isInTemporaryPosition.value = false;
903
+
904
+ /**
905
+ * set force closing variable.
906
+ */
907
+ animatedAnimationState.set(state => {
908
+ 'worklet';
909
+
910
+ return {
911
+ ...state,
912
+ isForcedClosing: true
913
+ };
914
+ });
915
+ runOnUI(animateToPosition)(targetPosition, ANIMATION_SOURCE.USER, 0, animationConfigs);
916
+ }, [animateToPosition, isInTemporaryPosition, animatedDetentsState, animatedAnimationState]);
917
+ const handleExpand = useCallback(function handleExpand(animationConfigs) {
918
+ if (__DEV__) {
919
+ print({
920
+ component: 'BottomSheet',
921
+ method: 'handleExpand'
922
+ });
923
+ }
924
+ const {
925
+ detents
926
+ } = animatedDetentsState.get();
927
+ if (detents === undefined || detents.length === 0) {
928
+ return;
929
+ }
930
+ const targetIndex = detents.length - 1;
931
+ const targetPosition = detents[targetIndex];
932
+
933
+ /**
934
+ * exit method if :
935
+ * - layout is not calculated.
936
+ * - already animating to next position.
937
+ * - sheet is forced closing.
938
+ */
939
+ const {
940
+ nextPosition,
941
+ nextIndex,
942
+ isForcedClosing
943
+ } = animatedAnimationState.get();
944
+ if (!isLayoutCalculated.value || targetIndex === nextIndex || targetPosition === nextPosition || isForcedClosing) {
945
+ return;
946
+ }
947
+
948
+ /**
949
+ * reset temporary position boolean.
950
+ */
951
+ isInTemporaryPosition.value = false;
952
+ runOnUI(animateToPosition)(targetPosition, ANIMATION_SOURCE.USER, 0, animationConfigs);
953
+ }, [animateToPosition, isInTemporaryPosition, isLayoutCalculated, animatedDetentsState, animatedAnimationState]);
954
+ const handleCollapse = useCallback(function handleCollapse(animationConfigs) {
955
+ if (__DEV__) {
956
+ print({
957
+ component: 'BottomSheet',
958
+ method: 'handleCollapse'
959
+ });
960
+ }
961
+ const {
962
+ detents
963
+ } = animatedDetentsState.get();
964
+ if (detents === undefined || detents.length === 0) {
965
+ return;
966
+ }
967
+ const targetPosition = detents[0];
968
+
969
+ /**
970
+ * exit method if :
971
+ * - layout is not calculated.
972
+ * - already animating to next position.
973
+ * - sheet is forced closing.
974
+ */
975
+ const {
976
+ nextPosition,
977
+ nextIndex,
978
+ isForcedClosing
979
+ } = animatedAnimationState.get();
980
+ if (!isLayoutCalculated || nextIndex === 0 || targetPosition === nextPosition || isForcedClosing) {
981
+ return;
982
+ }
983
+
984
+ /**
985
+ * reset temporary position boolean.
986
+ */
987
+ isInTemporaryPosition.value = false;
988
+ runOnUI(animateToPosition)(targetPosition, ANIMATION_SOURCE.USER, 0, animationConfigs);
989
+ }, [animateToPosition, isLayoutCalculated, isInTemporaryPosition, animatedDetentsState, animatedAnimationState]);
990
+ useImperativeHandle(ref, () => ({
991
+ snapToIndex: handleSnapToIndex,
992
+ snapToPosition: handleSnapToPosition,
993
+ expand: handleExpand,
994
+ collapse: handleCollapse,
995
+ close: handleClose,
996
+ forceClose: handleForceClose
997
+ }));
998
+ //#endregion
999
+
1000
+ //#region contexts variables
1001
+ const internalContextVariables = useMemo(() => ({
1002
+ textInputNodesRef,
1003
+ enableContentPanningGesture,
1004
+ enableDynamicSizing,
1005
+ overDragResistanceFactor,
1006
+ enableOverDrag,
1007
+ enablePanDownToClose,
1008
+ animatedAnimationState,
1009
+ animatedSheetState,
1010
+ animatedScrollableState,
1011
+ animatedScrollableStatus,
1012
+ animatedContentGestureState,
1013
+ animatedHandleGestureState,
1014
+ animatedKeyboardState,
1015
+ animatedLayoutState,
1016
+ animatedIndex,
1017
+ animatedPosition,
1018
+ animatedSheetHeight,
1019
+ animatedDetentsState,
1020
+ isInTemporaryPosition,
1021
+ simultaneousHandlers: _providedSimultaneousHandlers,
1022
+ waitFor: _providedWaitFor,
1023
+ activeOffsetX: _providedActiveOffsetX,
1024
+ activeOffsetY: _providedActiveOffsetY,
1025
+ failOffsetX: _providedFailOffsetX,
1026
+ failOffsetY: _providedFailOffsetY,
1027
+ enableBlurKeyboardOnGesture,
1028
+ animateToPosition,
1029
+ stopAnimation,
1030
+ setScrollableRef,
1031
+ removeScrollableRef
1032
+ }), [textInputNodesRef, animatedIndex, animatedPosition, animatedSheetHeight, animatedLayoutState, animatedContentGestureState, animatedHandleGestureState, animatedAnimationState, animatedKeyboardState, animatedSheetState, animatedScrollableState, animatedScrollableStatus, animatedDetentsState, isInTemporaryPosition, enableContentPanningGesture, overDragResistanceFactor, enableOverDrag, enablePanDownToClose, enableDynamicSizing, enableBlurKeyboardOnGesture, _providedSimultaneousHandlers, _providedWaitFor, _providedActiveOffsetX, _providedActiveOffsetY, _providedFailOffsetX, _providedFailOffsetY, setScrollableRef, removeScrollableRef, animateToPosition, stopAnimation]);
1033
+ const externalContextVariables = useMemo(() => ({
1034
+ animatedIndex,
1035
+ animatedPosition,
1036
+ snapToIndex: handleSnapToIndex,
1037
+ snapToPosition: handleSnapToPosition,
1038
+ expand: handleExpand,
1039
+ collapse: handleCollapse,
1040
+ close: handleClose,
1041
+ forceClose: handleForceClose
1042
+ }), [animatedIndex, animatedPosition, handleSnapToIndex, handleSnapToPosition, handleExpand, handleCollapse, handleClose, handleForceClose]);
1043
+ //#endregion
1044
+
1045
+ //#region effects
1046
+ useAnimatedReaction(() => animatedLayoutState.get().containerHeight, (result, previous) => {
1047
+ if (result === INITIAL_LAYOUT_VALUE) {
1048
+ return;
1049
+ }
1050
+ animatedContainerHeightDidChange.value = result !== previous;
1051
+ const {
1052
+ closedDetentPosition
1053
+ } = animatedDetentsState.get();
1054
+ if (closedDetentPosition === undefined) {
1055
+ return;
1056
+ }
1057
+
1058
+ /**
1059
+ * When user close the bottom sheet while the keyboard open on Android with
1060
+ * software keyboard layout mode set to resize, the close position would be
1061
+ * set to the container height - the keyboard height, and when the keyboard
1062
+ * closes, the container height and here we restart the animation again.
1063
+ *
1064
+ * [read more](https://github.com/gorhom/react-native-bottom-sheet/issues/2163)
1065
+ */
1066
+ const {
1067
+ status: animationStatus,
1068
+ source: animationSource,
1069
+ nextIndex
1070
+ } = animatedAnimationState.get();
1071
+ if (animationStatus === ANIMATION_STATUS.RUNNING && animationSource === ANIMATION_SOURCE.GESTURE && nextIndex === -1) {
1072
+ animateToPosition(closedDetentPosition, ANIMATION_SOURCE.GESTURE);
1073
+ }
1074
+
1075
+ /**
1076
+ * On Android with adjustResize, when the container grows back after
1077
+ * keyboard dismiss, force evaluate position to avoid race condition
1078
+ * between keyboardDidHide and container resize events.
1079
+ */
1080
+ if (Platform.OS === 'android' && android_keyboardInputMode === KEYBOARD_INPUT_MODE.adjustResize && previous !== null && previous !== INITIAL_LAYOUT_VALUE && result > previous) {
1081
+ evaluatePosition(ANIMATION_SOURCE.CONTAINER_RESIZE);
1082
+ }
1083
+ }, [animatedContainerHeightDidChange, animatedAnimationState, animatedDetentsState, android_keyboardInputMode, evaluatePosition]);
1084
+
1085
+ /**
1086
+ * Reaction to the `snapPoints` change, to insure that the sheet position reflect
1087
+ * to the current point correctly.
1088
+ *
1089
+ * @alias OnSnapPointsChange
1090
+ */
1091
+ useAnimatedReaction(() => animatedDetentsState.get().detents, (result, previous) => {
1092
+ /**
1093
+ * if values did not change, and did handle on mount animation
1094
+ * then we early exit the method.
1095
+ */
1096
+ if (JSON.stringify(result) === JSON.stringify(previous) && isAnimatedOnMount.value) {
1097
+ return;
1098
+ }
1099
+
1100
+ /**
1101
+ * if layout is not calculated yet, then we exit the method.
1102
+ */
1103
+ if (!isLayoutCalculated.value) {
1104
+ return;
1105
+ }
1106
+ if (__DEV__) {
1107
+ runOnJS(print)({
1108
+ component: 'BottomSheet',
1109
+ method: 'useAnimatedReaction::OnSnapPointChange',
1110
+ category: 'effect',
1111
+ params: {
1112
+ result
1113
+ }
1114
+ });
1115
+ }
1116
+ evaluatePosition(ANIMATION_SOURCE.SNAP_POINT_CHANGE);
1117
+ }, [isLayoutCalculated, isAnimatedOnMount, animatedDetentsState]);
1118
+
1119
+ /**
1120
+ * Reaction to the keyboard state change.
1121
+ *
1122
+ * @alias OnKeyboardStateChange
1123
+ */
1124
+ useAnimatedReaction(() => animatedKeyboardState.get().status + animatedKeyboardState.get().height, (result, _previousResult) => {
1125
+ /**
1126
+ * if keyboard state is equal to the previous state, then exit the method
1127
+ */
1128
+ if (result === _previousResult) {
1129
+ return;
1130
+ }
1131
+ const {
1132
+ status,
1133
+ height,
1134
+ easing,
1135
+ duration,
1136
+ target
1137
+ } = animatedKeyboardState.get();
1138
+
1139
+ /**
1140
+ * if state is undetermined, then we early exit.
1141
+ */
1142
+ if (status === KEYBOARD_STATUS.UNDETERMINED) {
1143
+ return;
1144
+ }
1145
+ const {
1146
+ status: animationStatus,
1147
+ source: animationSource
1148
+ } = animatedAnimationState.get();
1149
+ /**
1150
+ * if keyboard is hidden by customer gesture, then we early exit.
1151
+ */
1152
+ if (status === KEYBOARD_STATUS.HIDDEN && animationStatus === ANIMATION_STATUS.RUNNING && animationSource === ANIMATION_SOURCE.GESTURE) {
1153
+ return;
1154
+ }
1155
+
1156
+ /**
1157
+ * Calculate the keyboard height in the container.
1158
+ */
1159
+ const containerOffset = animatedLayoutState.get().containerOffset;
1160
+ let heightWithinContainer = height === 0 ? 0 : $modal ? Math.abs(height - Math.abs(bottomInset - containerOffset.bottom)) : Math.abs(height - containerOffset.bottom);
1161
+ if (__DEV__) {
1162
+ runOnJS(print)({
1163
+ component: 'BottomSheet',
1164
+ method: 'useAnimatedReaction::OnKeyboardStateChange',
1165
+ category: 'effect',
1166
+ params: {
1167
+ status,
1168
+ height,
1169
+ heightWithinContainer,
1170
+ containerOffset
1171
+ }
1172
+ });
1173
+ }
1174
+
1175
+ /**
1176
+ * if platform is android and the input mode is resize, then exit the method
1177
+ */
1178
+ if (Platform.OS === 'android' && android_keyboardInputMode === KEYBOARD_INPUT_MODE.adjustResize) {
1179
+ heightWithinContainer = 0;
1180
+ if (keyboardBehavior === KEYBOARD_BEHAVIOR.interactive) {
1181
+ animatedKeyboardState.set({
1182
+ target,
1183
+ status,
1184
+ height,
1185
+ easing,
1186
+ duration,
1187
+ heightWithinContainer
1188
+ });
1189
+ return;
1190
+ }
1191
+ }
1192
+ animatedKeyboardState.set(state => ({
1193
+ ...state,
1194
+ heightWithinContainer
1195
+ }));
1196
+
1197
+ /**
1198
+ * if user is interacting with sheet, then exit the method
1199
+ */
1200
+ const hasActiveGesture = animatedContentGestureState.value === State.ACTIVE || animatedContentGestureState.value === State.BEGAN || animatedHandleGestureState.value === State.ACTIVE || animatedHandleGestureState.value === State.BEGAN;
1201
+ if (hasActiveGesture) {
1202
+ return;
1203
+ }
1204
+
1205
+ /**
1206
+ * if new keyboard state is hidden and blur behavior is none, then exit the method.
1207
+ *
1208
+ * Exception: On Android with adjustPan mode, there is no container resize
1209
+ * event when the keyboard is dismissed (e.g. via back button). If the sheet
1210
+ * is in a temporary position, we must evaluate the position to restore it.
1211
+ */
1212
+ if (status === KEYBOARD_STATUS.HIDDEN && keyboardBlurBehavior === KEYBOARD_BLUR_BEHAVIOR.none) {
1213
+ if (!(Platform.OS === 'android' && android_keyboardInputMode !== KEYBOARD_INPUT_MODE.adjustResize && isInTemporaryPosition.value)) {
1214
+ return;
1215
+ }
1216
+ }
1217
+ const animationConfigs = getKeyboardAnimationConfigs(easing, duration);
1218
+ evaluatePosition(ANIMATION_SOURCE.KEYBOARD, animationConfigs);
1219
+ }, [$modal, bottomInset, keyboardBehavior, keyboardBlurBehavior, android_keyboardInputMode, animatedKeyboardState, animatedLayoutState, getEvaluatedPosition, isInTemporaryPosition]);
1220
+
1221
+ /**
1222
+ * sets provided animated position
1223
+ */
1224
+ useAnimatedReaction(() => animatedPosition.value, _animatedPosition => {
1225
+ if (_providedAnimatedPosition) {
1226
+ _providedAnimatedPosition.value = _animatedPosition + topInset;
1227
+ }
1228
+ }, [_providedAnimatedPosition, topInset]);
1229
+
1230
+ /**
1231
+ * sets provided animated index
1232
+ */
1233
+ useAnimatedReaction(() => animatedIndex.value, _animatedIndex => {
1234
+ if (_providedAnimatedIndex) {
1235
+ _providedAnimatedIndex.value = _animatedIndex;
1236
+ }
1237
+ }, [_providedAnimatedIndex]);
1238
+
1239
+ /**
1240
+ * React to `index` prop to snap the sheet to the new position.
1241
+ *
1242
+ * @alias onIndexChange
1243
+ */
1244
+ useEffect(() => {
1245
+ // early exit, if animate on mount is set and it did not animate yet.
1246
+ if (animateOnMount && !isAnimatedOnMount.value) {
1247
+ return;
1248
+ }
1249
+ handleSnapToIndex(_providedIndex);
1250
+ }, [animateOnMount, _providedIndex, isAnimatedOnMount, handleSnapToIndex]);
1251
+ //#endregion
1252
+
1253
+ // render
1254
+ return /*#__PURE__*/_jsx(BottomSheetProvider, {
1255
+ value: externalContextVariables,
1256
+ children: /*#__PURE__*/_jsx(BottomSheetInternalProvider, {
1257
+ value: internalContextVariables,
1258
+ children: /*#__PURE__*/_jsxs(BottomSheetGestureHandlersProvider, {
1259
+ gestureEventsHandlersHook: gestureEventsHandlersHook,
1260
+ children: [BackdropComponent ? /*#__PURE__*/_jsx(BackdropComponent, {
1261
+ animatedIndex: animatedIndex,
1262
+ animatedPosition: animatedPosition,
1263
+ style: StyleSheet.absoluteFillObject
1264
+ }) : null, /*#__PURE__*/_jsx(BottomSheetHostingContainer, {
1265
+ shouldCalculateHeight: !$modal,
1266
+ layoutState: animatedLayoutState,
1267
+ containerLayoutState: containerLayoutState,
1268
+ topInset: topInset,
1269
+ bottomInset: bottomInset,
1270
+ detached: detached,
1271
+ style: _providedContainerStyle,
1272
+ children: /*#__PURE__*/_jsxs(BottomSheetBody, {
1273
+ style: style,
1274
+ children: [backgroundComponent === null ? null : /*#__PURE__*/_jsx(BottomSheetBackgroundContainer, {
1275
+ animatedIndex: animatedIndex,
1276
+ animatedPosition: animatedPosition,
1277
+ backgroundComponent: backgroundComponent,
1278
+ backgroundStyle: _providedBackgroundStyle
1279
+ }, "BottomSheetBackgroundContainer"), /*#__PURE__*/_jsxs(BottomSheetContent, {
1280
+ pointerEvents: "box-none",
1281
+ accessible: _providedAccessible ?? undefined,
1282
+ accessibilityRole: _providedAccessibilityRole ?? undefined,
1283
+ accessibilityLabel: _providedAccessibilityLabel ?? undefined,
1284
+ keyboardBehavior: keyboardBehavior,
1285
+ detached: detached,
1286
+ children: [children, footerComponent ? /*#__PURE__*/_jsx(BottomSheetFooterContainer, {
1287
+ footerComponent: footerComponent
1288
+ }) : null]
1289
+ }), handleComponent !== null ? /*#__PURE__*/_jsx(BottomSheetHandleContainer, {
1290
+ animatedIndex: animatedIndex,
1291
+ animatedPosition: animatedPosition,
1292
+ enableHandlePanningGesture: enableHandlePanningGesture,
1293
+ enableOverDrag: enableOverDrag,
1294
+ enablePanDownToClose: enablePanDownToClose,
1295
+ overDragResistanceFactor: overDragResistanceFactor,
1296
+ keyboardBehavior: keyboardBehavior,
1297
+ handleComponent: handleComponent,
1298
+ handleStyle: _providedHandleStyle,
1299
+ handleIndicatorStyle: _providedHandleIndicatorStyle
1300
+ }, "BottomSheetHandleContainer") : null]
1301
+ })
1302
+ }, "BottomSheetContainer")]
1303
+ })
1304
+ })
1305
+ });
1306
+ });
1307
+ const BottomSheet = /*#__PURE__*/memo(BottomSheetComponent);
1308
+ BottomSheet.displayName = 'BottomSheet';
1309
+ export default BottomSheet;
1310
+ //# sourceMappingURL=BottomSheet.js.map