@mustmove/bottom-sheet 1.0.0 → 1.0.2

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