@mustmove/bottom-sheet 1.0.0 → 1.0.1

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