@fountain-ui/lab 2.0.0-beta.1 → 2.0.0-beta.12

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 (381) hide show
  1. package/build/commonjs/AnimatedY/AnimatedY.js +10 -14
  2. package/build/commonjs/AnimatedY/AnimatedY.js.map +1 -1
  3. package/build/commonjs/AnimatedY/AnimatedYProps.js.map +1 -1
  4. package/build/commonjs/AnimatedY/index.js.map +1 -1
  5. package/build/commonjs/BottomSheet/BottomSheetNative.js +1 -1
  6. package/build/commonjs/BottomSheet/BottomSheetNative.js.map +1 -1
  7. package/build/commonjs/BottomSheet/BottomSheetProps.js.map +1 -1
  8. package/build/commonjs/BottomSheet/BottomSheetWeb.js +2 -6
  9. package/build/commonjs/BottomSheet/BottomSheetWeb.js.map +1 -1
  10. package/build/commonjs/BottomSheet/TransparentBackdrop.js +1 -1
  11. package/build/commonjs/BottomSheet/TransparentBackdrop.js.map +1 -1
  12. package/build/commonjs/BottomSheet/index.js.map +1 -1
  13. package/build/commonjs/BottomSheet/index.native.js.map +1 -1
  14. package/build/commonjs/Carousel/Carousel.js +137 -0
  15. package/build/commonjs/Carousel/Carousel.js.map +1 -0
  16. package/build/commonjs/Carousel/CarouselProps.js.map +1 -1
  17. package/build/commonjs/Carousel/animation/animationUtils.js +9 -0
  18. package/build/commonjs/Carousel/animation/animationUtils.js.map +1 -0
  19. package/build/commonjs/Carousel/animation/createDefaultItemStyle.js +15 -0
  20. package/build/commonjs/Carousel/animation/createDefaultItemStyle.js.map +1 -0
  21. package/build/commonjs/Carousel/animation/createDefaultScrollAnimation.js +20 -0
  22. package/build/commonjs/Carousel/animation/createDefaultScrollAnimation.js.map +1 -0
  23. package/build/commonjs/Carousel/animation/index.js +40 -0
  24. package/build/commonjs/Carousel/animation/index.js.map +1 -0
  25. package/build/commonjs/Carousel/animation/normalItemStyleFactory.js +27 -0
  26. package/build/commonjs/Carousel/animation/normalItemStyleFactory.js.map +1 -0
  27. package/build/commonjs/Carousel/animation/parallaxItemStyleFactory.js +65 -0
  28. package/build/commonjs/Carousel/animation/parallaxItemStyleFactory.js.map +1 -0
  29. package/build/commonjs/Carousel/components/InternalContext.js +29 -0
  30. package/build/commonjs/Carousel/components/InternalContext.js.map +1 -0
  31. package/build/commonjs/Carousel/components/ItemView.js +64 -0
  32. package/build/commonjs/Carousel/components/ItemView.js.map +1 -0
  33. package/build/commonjs/Carousel/components/RootView.js +68 -0
  34. package/build/commonjs/Carousel/components/RootView.js.map +1 -0
  35. package/build/commonjs/Carousel/components/ScrollViewGesture.js +76 -0
  36. package/build/commonjs/Carousel/components/ScrollViewGesture.js.map +1 -0
  37. package/build/commonjs/Carousel/components/index.js +40 -0
  38. package/build/commonjs/Carousel/components/index.js.map +1 -0
  39. package/build/commonjs/Carousel/hooks/index.js +64 -0
  40. package/build/commonjs/Carousel/hooks/index.js.map +1 -0
  41. package/build/commonjs/Carousel/hooks/useAutoplayController.js +55 -0
  42. package/build/commonjs/Carousel/hooks/useAutoplayController.js.map +1 -0
  43. package/build/commonjs/Carousel/hooks/useDimensionChangeReaction.js +23 -0
  44. package/build/commonjs/Carousel/hooks/useDimensionChangeReaction.js.map +1 -0
  45. package/build/commonjs/Carousel/hooks/useIndexController.js +70 -0
  46. package/build/commonjs/Carousel/hooks/useIndexController.js.map +1 -0
  47. package/build/commonjs/Carousel/hooks/useItemInterpolation.js +63 -0
  48. package/build/commonjs/Carousel/hooks/useItemInterpolation.js.map +1 -0
  49. package/build/commonjs/Carousel/hooks/useItemVisibilityStore.js +95 -0
  50. package/build/commonjs/Carousel/hooks/useItemVisibilityStore.js.map +1 -0
  51. package/build/commonjs/Carousel/hooks/useLoopedData.js +33 -0
  52. package/build/commonjs/Carousel/hooks/useLoopedData.js.map +1 -0
  53. package/build/commonjs/Carousel/hooks/usePagingAnimation.js +124 -0
  54. package/build/commonjs/Carousel/hooks/usePagingAnimation.js.map +1 -0
  55. package/build/commonjs/Carousel/index.js +16 -2
  56. package/build/commonjs/Carousel/index.js.map +1 -1
  57. package/build/commonjs/Carousel/types.js +7 -0
  58. package/build/commonjs/Carousel/types.js.map +1 -0
  59. package/build/commonjs/ComicViewer/ComicViewer.js +16 -11
  60. package/build/commonjs/ComicViewer/ComicViewer.js.map +1 -1
  61. package/build/commonjs/ComicViewer/ComicViewerItemProps.js.map +1 -1
  62. package/build/commonjs/ComicViewer/ComicViewerProps.js.map +1 -1
  63. package/build/commonjs/ComicViewer/ViewerItem.js +4 -3
  64. package/build/commonjs/ComicViewer/ViewerItem.js.map +1 -1
  65. package/build/commonjs/ComicViewer/index.js.map +1 -1
  66. package/build/commonjs/DateTimePicker/DateTimePicker.js +2 -2
  67. package/build/commonjs/DateTimePicker/DateTimePicker.js.map +1 -1
  68. package/build/commonjs/DateTimePicker/DateTimePickerProps.js.map +1 -1
  69. package/build/commonjs/DateTimePicker/DateTimePickerProvider.js.map +1 -1
  70. package/build/commonjs/DateTimePicker/YearPicker.js +21 -17
  71. package/build/commonjs/DateTimePicker/YearPicker.js.map +1 -1
  72. package/build/commonjs/DateTimePicker/index.js +4 -4
  73. package/build/commonjs/DateTimePicker/index.js.map +1 -1
  74. package/build/commonjs/DateTimePicker/utils.js +2 -1
  75. package/build/commonjs/DateTimePicker/utils.js.map +1 -1
  76. package/build/commonjs/FlipCard/FlipCard.js +7 -13
  77. package/build/commonjs/FlipCard/FlipCard.js.map +1 -1
  78. package/build/commonjs/FlipCard/FlipCardProps.js.map +1 -1
  79. package/build/commonjs/FlipCard/index.js.map +1 -1
  80. package/build/commonjs/StatusBarProvider/Provider.js +1 -1
  81. package/build/commonjs/StatusBarProvider/Provider.js.map +1 -1
  82. package/build/commonjs/StatusBarProvider/StatusBarProvider.js.map +1 -1
  83. package/build/commonjs/StatusBarProvider/StatusBarProviderProps.js.map +1 -1
  84. package/build/commonjs/StatusBarProvider/index.js.map +1 -1
  85. package/build/commonjs/ViewPager/ChildrenMemoizedPage.js +86 -21
  86. package/build/commonjs/ViewPager/ChildrenMemoizedPage.js.map +1 -1
  87. package/build/commonjs/ViewPager/PageStateContext.js +22 -0
  88. package/build/commonjs/ViewPager/PageStateContext.js.map +1 -0
  89. package/build/commonjs/ViewPager/ViewPagerNative.js +61 -38
  90. package/build/commonjs/ViewPager/ViewPagerNative.js.map +1 -1
  91. package/build/commonjs/ViewPager/ViewPagerProps.js.map +1 -1
  92. package/build/commonjs/ViewPager/ViewPagerWeb.js +35 -26
  93. package/build/commonjs/ViewPager/ViewPagerWeb.js.map +1 -1
  94. package/build/commonjs/ViewPager/index.js +8 -0
  95. package/build/commonjs/ViewPager/index.js.map +1 -1
  96. package/build/commonjs/ViewPager/index.native.js +8 -0
  97. package/build/commonjs/ViewPager/index.native.js.map +1 -1
  98. package/build/commonjs/ViewPager/utils.js +5 -39
  99. package/build/commonjs/ViewPager/utils.js.map +1 -1
  100. package/build/commonjs/ViewabilityTrackerView/Viewability.js +2 -0
  101. package/build/commonjs/ViewabilityTrackerView/Viewability.js.map +1 -0
  102. package/build/commonjs/ViewabilityTrackerView/ViewabilityTrackerView.js +45 -0
  103. package/build/commonjs/ViewabilityTrackerView/ViewabilityTrackerView.js.map +1 -0
  104. package/build/commonjs/ViewabilityTrackerView/ViewabilityTrackerViewProps.js +2 -0
  105. package/build/commonjs/ViewabilityTrackerView/ViewabilityTrackerViewProps.js.map +1 -0
  106. package/build/commonjs/{Carousel/index.native.js → ViewabilityTrackerView/index.js} +3 -3
  107. package/build/commonjs/ViewabilityTrackerView/index.js.map +1 -0
  108. package/build/commonjs/ViewabilityTrackerView/measureViewability.js +42 -0
  109. package/build/commonjs/ViewabilityTrackerView/measureViewability.js.map +1 -0
  110. package/build/commonjs/ViewabilityTrackerView/useViewabilityTracker.js +88 -0
  111. package/build/commonjs/ViewabilityTrackerView/useViewabilityTracker.js.map +1 -0
  112. package/build/commonjs/hooks/index.js +16 -0
  113. package/build/commonjs/hooks/index.js.map +1 -1
  114. package/build/commonjs/hooks/useAppbarStyles.js.map +1 -1
  115. package/build/commonjs/hooks/useDeferredExecutor.js +45 -0
  116. package/build/commonjs/hooks/useDeferredExecutor.js.map +1 -0
  117. package/build/commonjs/hooks/useElevationStyle.js.map +1 -1
  118. package/build/commonjs/hooks/useHeight.js +5 -4
  119. package/build/commonjs/hooks/useHeight.js.map +1 -1
  120. package/build/commonjs/hooks/useIsMounted.js +22 -0
  121. package/build/commonjs/hooks/useIsMounted.js.map +1 -0
  122. package/build/commonjs/hooks/useUnstableCollapsibleAppBar.js +56 -57
  123. package/build/commonjs/hooks/useUnstableCollapsibleAppBar.js.map +1 -1
  124. package/build/commonjs/hooks/useUnstableToggleDisplayStyle.js +9 -11
  125. package/build/commonjs/hooks/useUnstableToggleDisplayStyle.js.map +1 -1
  126. package/build/commonjs/index.js +28 -7
  127. package/build/commonjs/index.js.map +1 -1
  128. package/build/module/AnimatedY/AnimatedY.js +11 -10
  129. package/build/module/AnimatedY/AnimatedY.js.map +1 -1
  130. package/build/module/AnimatedY/AnimatedYProps.js.map +1 -1
  131. package/build/module/AnimatedY/index.js.map +1 -1
  132. package/build/module/BottomSheet/BottomSheetNative.js +1 -1
  133. package/build/module/BottomSheet/BottomSheetNative.js.map +1 -1
  134. package/build/module/BottomSheet/BottomSheetProps.js.map +1 -1
  135. package/build/module/BottomSheet/BottomSheetWeb.js +2 -6
  136. package/build/module/BottomSheet/BottomSheetWeb.js.map +1 -1
  137. package/build/module/BottomSheet/TransparentBackdrop.js +1 -1
  138. package/build/module/BottomSheet/TransparentBackdrop.js.map +1 -1
  139. package/build/module/BottomSheet/index.js.map +1 -1
  140. package/build/module/BottomSheet/index.native.js.map +1 -1
  141. package/build/module/Carousel/Carousel.js +115 -0
  142. package/build/module/Carousel/Carousel.js.map +1 -0
  143. package/build/module/Carousel/CarouselProps.js.map +1 -1
  144. package/build/module/Carousel/animation/animationUtils.js +2 -0
  145. package/build/module/Carousel/animation/animationUtils.js.map +1 -0
  146. package/build/module/Carousel/animation/createDefaultItemStyle.js +3 -0
  147. package/build/module/Carousel/animation/createDefaultItemStyle.js.map +1 -0
  148. package/build/module/Carousel/animation/createDefaultScrollAnimation.js +11 -0
  149. package/build/module/Carousel/animation/createDefaultScrollAnimation.js.map +1 -0
  150. package/build/module/Carousel/animation/index.js +5 -0
  151. package/build/module/Carousel/animation/index.js.map +1 -0
  152. package/build/module/Carousel/animation/normalItemStyleFactory.js +18 -0
  153. package/build/module/Carousel/animation/normalItemStyleFactory.js.map +1 -0
  154. package/build/module/Carousel/animation/parallaxItemStyleFactory.js +55 -0
  155. package/build/module/Carousel/animation/parallaxItemStyleFactory.js.map +1 -0
  156. package/build/module/Carousel/components/InternalContext.js +19 -0
  157. package/build/module/Carousel/components/InternalContext.js.map +1 -0
  158. package/build/module/Carousel/components/ItemView.js +44 -0
  159. package/build/module/Carousel/components/ItemView.js.map +1 -0
  160. package/build/module/Carousel/components/RootView.js +47 -0
  161. package/build/module/Carousel/components/RootView.js.map +1 -0
  162. package/build/module/Carousel/components/ScrollViewGesture.js +62 -0
  163. package/build/module/Carousel/components/ScrollViewGesture.js.map +1 -0
  164. package/build/module/Carousel/components/index.js +5 -0
  165. package/build/module/Carousel/components/index.js.map +1 -0
  166. package/build/module/Carousel/hooks/index.js +8 -0
  167. package/build/module/Carousel/hooks/index.js.map +1 -0
  168. package/build/module/Carousel/hooks/useAutoplayController.js +45 -0
  169. package/build/module/Carousel/hooks/useAutoplayController.js.map +1 -0
  170. package/build/module/Carousel/hooks/useDimensionChangeReaction.js +14 -0
  171. package/build/module/Carousel/hooks/useDimensionChangeReaction.js.map +1 -0
  172. package/build/module/Carousel/hooks/useIndexController.js +54 -0
  173. package/build/module/Carousel/hooks/useIndexController.js.map +1 -0
  174. package/build/module/Carousel/hooks/useItemInterpolation.js +51 -0
  175. package/build/module/Carousel/hooks/useItemInterpolation.js.map +1 -0
  176. package/build/module/Carousel/hooks/useItemVisibilityStore.js +87 -0
  177. package/build/module/Carousel/hooks/useItemVisibilityStore.js.map +1 -0
  178. package/build/module/Carousel/hooks/useLoopedData.js +24 -0
  179. package/build/module/Carousel/hooks/useLoopedData.js.map +1 -0
  180. package/build/module/Carousel/hooks/usePagingAnimation.js +115 -0
  181. package/build/module/Carousel/hooks/usePagingAnimation.js.map +1 -0
  182. package/build/module/Carousel/index.js +2 -1
  183. package/build/module/Carousel/index.js.map +1 -1
  184. package/build/module/Carousel/types.js +3 -0
  185. package/build/module/Carousel/types.js.map +1 -0
  186. package/build/module/ComicViewer/ComicViewer.js +16 -11
  187. package/build/module/ComicViewer/ComicViewer.js.map +1 -1
  188. package/build/module/ComicViewer/ComicViewerItemProps.js.map +1 -1
  189. package/build/module/ComicViewer/ComicViewerProps.js.map +1 -1
  190. package/build/module/ComicViewer/ViewerItem.js +4 -3
  191. package/build/module/ComicViewer/ViewerItem.js.map +1 -1
  192. package/build/module/ComicViewer/index.js.map +1 -1
  193. package/build/module/DateTimePicker/DateTimePicker.js +2 -2
  194. package/build/module/DateTimePicker/DateTimePicker.js.map +1 -1
  195. package/build/module/DateTimePicker/DateTimePickerProps.js.map +1 -1
  196. package/build/module/DateTimePicker/DateTimePickerProvider.js.map +1 -1
  197. package/build/module/DateTimePicker/YearPicker.js +21 -17
  198. package/build/module/DateTimePicker/YearPicker.js.map +1 -1
  199. package/build/module/DateTimePicker/index.js.map +1 -1
  200. package/build/module/DateTimePicker/utils.js +2 -1
  201. package/build/module/DateTimePicker/utils.js.map +1 -1
  202. package/build/module/FlipCard/FlipCard.js +7 -7
  203. package/build/module/FlipCard/FlipCard.js.map +1 -1
  204. package/build/module/FlipCard/FlipCardProps.js.map +1 -1
  205. package/build/module/FlipCard/index.js.map +1 -1
  206. package/build/module/StatusBarProvider/Provider.js.map +1 -1
  207. package/build/module/StatusBarProvider/StatusBarProvider.js.map +1 -1
  208. package/build/module/StatusBarProvider/StatusBarProviderProps.js.map +1 -1
  209. package/build/module/StatusBarProvider/index.js.map +1 -1
  210. package/build/module/ViewPager/ChildrenMemoizedPage.js +80 -23
  211. package/build/module/ViewPager/ChildrenMemoizedPage.js.map +1 -1
  212. package/build/module/ViewPager/PageStateContext.js +10 -0
  213. package/build/module/ViewPager/PageStateContext.js.map +1 -0
  214. package/build/module/ViewPager/ViewPagerNative.js +57 -33
  215. package/build/module/ViewPager/ViewPagerNative.js.map +1 -1
  216. package/build/module/ViewPager/ViewPagerProps.js.map +1 -1
  217. package/build/module/ViewPager/ViewPagerWeb.js +29 -24
  218. package/build/module/ViewPager/ViewPagerWeb.js.map +1 -1
  219. package/build/module/ViewPager/index.js +1 -0
  220. package/build/module/ViewPager/index.js.map +1 -1
  221. package/build/module/ViewPager/index.native.js +1 -0
  222. package/build/module/ViewPager/index.native.js.map +1 -1
  223. package/build/module/ViewPager/utils.js +2 -31
  224. package/build/module/ViewPager/utils.js.map +1 -1
  225. package/build/module/ViewabilityTrackerView/Viewability.js +2 -0
  226. package/build/module/ViewabilityTrackerView/Viewability.js.map +1 -0
  227. package/build/module/ViewabilityTrackerView/ViewabilityTrackerView.js +28 -0
  228. package/build/module/ViewabilityTrackerView/ViewabilityTrackerView.js.map +1 -0
  229. package/build/module/ViewabilityTrackerView/ViewabilityTrackerViewProps.js +2 -0
  230. package/build/module/ViewabilityTrackerView/ViewabilityTrackerViewProps.js.map +1 -0
  231. package/build/module/ViewabilityTrackerView/index.js +2 -0
  232. package/build/module/ViewabilityTrackerView/index.js.map +1 -0
  233. package/build/module/ViewabilityTrackerView/measureViewability.js +34 -0
  234. package/build/module/ViewabilityTrackerView/measureViewability.js.map +1 -0
  235. package/build/module/ViewabilityTrackerView/useViewabilityTracker.js +73 -0
  236. package/build/module/ViewabilityTrackerView/useViewabilityTracker.js.map +1 -0
  237. package/build/module/hooks/index.js +2 -0
  238. package/build/module/hooks/index.js.map +1 -1
  239. package/build/module/hooks/useAppbarStyles.js.map +1 -1
  240. package/build/module/hooks/useDeferredExecutor.js +33 -0
  241. package/build/module/hooks/useDeferredExecutor.js.map +1 -0
  242. package/build/module/hooks/useElevationStyle.js.map +1 -1
  243. package/build/module/hooks/useHeight.js +4 -3
  244. package/build/module/hooks/useHeight.js.map +1 -1
  245. package/build/module/hooks/useIsMounted.js +13 -0
  246. package/build/module/hooks/useIsMounted.js.map +1 -0
  247. package/build/module/hooks/useUnstableCollapsibleAppBar.js +58 -43
  248. package/build/module/hooks/useUnstableCollapsibleAppBar.js.map +1 -1
  249. package/build/module/hooks/useUnstableToggleDisplayStyle.js +9 -7
  250. package/build/module/hooks/useUnstableToggleDisplayStyle.js.map +1 -1
  251. package/build/module/index.js +2 -0
  252. package/build/module/index.js.map +1 -1
  253. package/build/typescript/AnimatedY/AnimatedY.d.ts +0 -1
  254. package/build/typescript/BottomSheet/BottomSheetNative.d.ts +0 -1
  255. package/build/typescript/BottomSheet/BottomSheetWeb.d.ts +0 -1
  256. package/build/typescript/BottomSheet/TransparentBackdrop.d.ts +0 -1
  257. package/build/typescript/Carousel/Carousel.d.ts +5 -0
  258. package/build/typescript/Carousel/CarouselProps.d.ts +32 -48
  259. package/build/typescript/Carousel/animation/animationUtils.d.ts +1 -0
  260. package/build/typescript/Carousel/animation/createDefaultItemStyle.d.ts +2 -0
  261. package/build/typescript/Carousel/animation/createDefaultScrollAnimation.d.ts +2 -0
  262. package/build/typescript/Carousel/animation/index.d.ts +4 -0
  263. package/build/typescript/Carousel/animation/normalItemStyleFactory.d.ts +2 -0
  264. package/build/typescript/Carousel/animation/parallaxItemStyleFactory.d.ts +9 -0
  265. package/build/typescript/Carousel/components/InternalContext.d.ts +14 -0
  266. package/build/typescript/Carousel/components/ItemView.d.ts +7 -0
  267. package/build/typescript/Carousel/components/RootView.d.ts +16 -0
  268. package/build/typescript/Carousel/components/ScrollViewGesture.d.ts +12 -0
  269. package/build/typescript/Carousel/components/index.d.ts +4 -0
  270. package/build/typescript/Carousel/hooks/index.d.ts +7 -0
  271. package/build/typescript/Carousel/hooks/useAutoplayController.d.ts +7 -0
  272. package/build/typescript/Carousel/hooks/useDimensionChangeReaction.d.ts +7 -0
  273. package/build/typescript/Carousel/hooks/useIndexController.d.ts +10 -0
  274. package/build/typescript/Carousel/hooks/useItemInterpolation.d.ts +2 -0
  275. package/build/typescript/Carousel/hooks/useItemVisibilityStore.d.ts +7 -0
  276. package/build/typescript/Carousel/hooks/useLoopedData.d.ts +1 -0
  277. package/build/typescript/Carousel/hooks/usePagingAnimation.d.ts +18 -0
  278. package/build/typescript/Carousel/index.d.ts +3 -1
  279. package/build/typescript/Carousel/types.d.ts +57 -0
  280. package/build/typescript/ComicViewer/ComicViewer.d.ts +0 -1
  281. package/build/typescript/DateTimePicker/DateTimePicker.d.ts +0 -1
  282. package/build/typescript/DateTimePicker/YearPicker.d.ts +0 -1
  283. package/build/typescript/FlipCard/FlipCard.d.ts +0 -1
  284. package/build/typescript/StatusBarProvider/StatusBarProvider.d.ts +0 -1
  285. package/build/typescript/ViewPager/ChildrenMemoizedPage.d.ts +2 -1
  286. package/build/typescript/ViewPager/PageStateContext.d.ts +7 -0
  287. package/build/typescript/ViewPager/ViewPagerNative.d.ts +4 -2
  288. package/build/typescript/ViewPager/ViewPagerProps.d.ts +31 -19
  289. package/build/typescript/ViewPager/ViewPagerWeb.d.ts +4 -2
  290. package/build/typescript/ViewPager/index.d.ts +2 -1
  291. package/build/typescript/ViewPager/index.native.d.ts +1 -0
  292. package/build/typescript/ViewPager/utils.d.ts +3 -19
  293. package/build/typescript/ViewabilityTrackerView/Viewability.d.ts +3 -0
  294. package/build/typescript/ViewabilityTrackerView/ViewabilityTrackerView.d.ts +2 -0
  295. package/build/typescript/ViewabilityTrackerView/ViewabilityTrackerViewProps.d.ts +22 -0
  296. package/build/typescript/ViewabilityTrackerView/index.d.ts +2 -0
  297. package/build/typescript/ViewabilityTrackerView/measureViewability.d.ts +11 -0
  298. package/build/typescript/ViewabilityTrackerView/useViewabilityTracker.d.ts +11 -0
  299. package/build/typescript/hooks/index.d.ts +2 -0
  300. package/build/typescript/hooks/useDeferredExecutor.d.ts +11 -0
  301. package/build/typescript/hooks/useIsMounted.d.ts +4 -0
  302. package/build/typescript/hooks/useUnstableCollapsibleAppBar.d.ts +2 -3
  303. package/build/typescript/hooks/useUnstableToggleDisplayStyle.d.ts +2 -2
  304. package/build/typescript/index.d.ts +2 -0
  305. package/package.json +12 -27
  306. package/src/AnimatedY/AnimatedY.tsx +13 -10
  307. package/src/Carousel/Carousel.tsx +151 -0
  308. package/src/Carousel/CarouselProps.ts +34 -53
  309. package/src/Carousel/animation/animationUtils.ts +1 -0
  310. package/src/Carousel/animation/createDefaultItemStyle.ts +3 -0
  311. package/src/Carousel/animation/createDefaultScrollAnimation.ts +13 -0
  312. package/src/Carousel/animation/index.ts +4 -0
  313. package/src/Carousel/animation/normalItemStyleFactory.ts +19 -0
  314. package/src/Carousel/animation/parallaxItemStyleFactory.ts +79 -0
  315. package/src/Carousel/components/InternalContext.ts +33 -0
  316. package/src/Carousel/components/ItemView.tsx +56 -0
  317. package/src/Carousel/components/RootView.tsx +66 -0
  318. package/src/Carousel/components/ScrollViewGesture.tsx +80 -0
  319. package/src/Carousel/components/index.ts +4 -0
  320. package/src/Carousel/hooks/index.ts +7 -0
  321. package/src/Carousel/hooks/useAutoplayController.ts +54 -0
  322. package/src/Carousel/hooks/useDimensionChangeReaction.ts +25 -0
  323. package/src/Carousel/hooks/useIndexController.tsx +76 -0
  324. package/src/Carousel/hooks/useItemInterpolation.ts +107 -0
  325. package/src/Carousel/hooks/useItemVisibilityStore.ts +107 -0
  326. package/src/Carousel/hooks/useLoopedData.ts +26 -0
  327. package/src/Carousel/hooks/usePagingAnimation.ts +148 -0
  328. package/src/Carousel/index.ts +4 -2
  329. package/src/Carousel/types.ts +67 -0
  330. package/src/DateTimePicker/DateTimePicker.tsx +2 -2
  331. package/src/FlipCard/FlipCard.tsx +8 -8
  332. package/src/ViewPager/ChildrenMemoizedPage.tsx +97 -23
  333. package/src/ViewPager/PageStateContext.ts +15 -0
  334. package/src/ViewPager/ViewPagerNative.tsx +72 -36
  335. package/src/ViewPager/ViewPagerProps.ts +33 -19
  336. package/src/ViewPager/ViewPagerWeb.tsx +38 -29
  337. package/src/ViewPager/index.native.ts +1 -0
  338. package/src/ViewPager/index.ts +2 -1
  339. package/src/ViewPager/utils.tsx +4 -56
  340. package/src/ViewabilityTrackerView/Viewability.ts +3 -0
  341. package/src/ViewabilityTrackerView/ViewabilityTrackerView.tsx +33 -0
  342. package/src/ViewabilityTrackerView/ViewabilityTrackerViewProps.ts +25 -0
  343. package/src/ViewabilityTrackerView/index.ts +2 -0
  344. package/src/ViewabilityTrackerView/measureViewability.ts +56 -0
  345. package/src/ViewabilityTrackerView/useViewabilityTracker.ts +85 -0
  346. package/src/hooks/index.ts +2 -0
  347. package/src/hooks/useDeferredExecutor.ts +46 -0
  348. package/src/hooks/useHeight.ts +2 -2
  349. package/src/hooks/useIsMounted.ts +19 -0
  350. package/src/hooks/useUnstableCollapsibleAppBar.ts +59 -42
  351. package/src/hooks/useUnstableToggleDisplayStyle.ts +8 -6
  352. package/src/index.ts +3 -0
  353. package/build/commonjs/Carousel/CarouselNative.js +0 -72
  354. package/build/commonjs/Carousel/CarouselNative.js.map +0 -1
  355. package/build/commonjs/Carousel/CarouselWeb.js +0 -237
  356. package/build/commonjs/Carousel/CarouselWeb.js.map +0 -1
  357. package/build/commonjs/Carousel/index.native.js.map +0 -1
  358. package/build/commonjs/Carousel/utils.js +0 -19
  359. package/build/commonjs/Carousel/utils.js.map +0 -1
  360. package/build/commonjs/hooks/useWidth.js +0 -29
  361. package/build/commonjs/hooks/useWidth.js.map +0 -1
  362. package/build/module/Carousel/CarouselNative.js +0 -54
  363. package/build/module/Carousel/CarouselNative.js.map +0 -1
  364. package/build/module/Carousel/CarouselWeb.js +0 -215
  365. package/build/module/Carousel/CarouselWeb.js.map +0 -1
  366. package/build/module/Carousel/index.native.js +0 -2
  367. package/build/module/Carousel/index.native.js.map +0 -1
  368. package/build/module/Carousel/utils.js +0 -7
  369. package/build/module/Carousel/utils.js.map +0 -1
  370. package/build/module/hooks/useWidth.js +0 -15
  371. package/build/module/hooks/useWidth.js.map +0 -1
  372. package/build/typescript/Carousel/CarouselNative.d.ts +0 -3
  373. package/build/typescript/Carousel/CarouselWeb.d.ts +0 -4
  374. package/build/typescript/Carousel/index.native.d.ts +0 -1
  375. package/build/typescript/Carousel/utils.d.ts +0 -6
  376. package/build/typescript/hooks/useWidth.d.ts +0 -2
  377. package/src/Carousel/CarouselNative.tsx +0 -67
  378. package/src/Carousel/CarouselWeb.tsx +0 -222
  379. package/src/Carousel/index.native.ts +0 -1
  380. package/src/Carousel/utils.ts +0 -11
  381. package/src/hooks/useWidth.ts +0 -17
@@ -1,12 +1,11 @@
1
- import React, { useRef } from 'react';
1
+ import { useRef } from 'react';
2
2
  import { Platform } from 'react-native';
3
- import Animated from 'react-native-reanimated';
3
+ import { useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming } from 'react-native-reanimated';
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
5
  import useAppbarStyles from './useAppbarStyles';
6
6
  import useElevationStyle from './useElevationStyle';
7
7
  import useHeight from './useHeight';
8
8
  const defaultOptions = {
9
- translucent: false,
10
9
  shouldTranslateYReset: false
11
10
  };
12
11
  const ANIMATION_DURATION_MILLIS = 100;
@@ -19,9 +18,9 @@ function useLargerValueOfLastTwoValues(value) {
19
18
  return Math.max(...refLatestTwoValues.current);
20
19
  }
21
20
 
22
- export default function useUnstableCollapsibleAppBar(userOptions = defaultOptions) {
21
+ export default function useUnstableCollapsibleAppBar() {
22
+ let userOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultOptions;
23
23
  const {
24
- translucent,
25
24
  shouldTranslateYReset
26
25
  } = { ...defaultOptions,
27
26
  ...userOptions
@@ -31,42 +30,58 @@ export default function useUnstableCollapsibleAppBar(userOptions = defaultOption
31
30
  const [appBarHeight, onAppBarLayout] = useHeight();
32
31
  const appBarMaxHeight = useLargerValueOfLastTwoValues(appBarHeight);
33
32
  const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();
34
- const maxTranslateY = Animated.useDerivedValue(() => -collapsibleToolbarHeight);
35
- const translateY = Animated.useSharedValue(0);
36
- const lastTranslateY = Animated.useSharedValue(0);
37
- const lastOffsetY = Animated.useSharedValue(0);
38
- const prevOffsetY = Animated.useSharedValue(0);
39
- const overlapped = Animated.useSharedValue(false);
40
- const vectorY = Animated.useSharedValue(0);
33
+ const maxTranslateY = useDerivedValue(() => -collapsibleToolbarHeight, [collapsibleToolbarHeight]);
34
+ const translateY = useSharedValue(0);
35
+ const lastTranslateY = useSharedValue(0);
36
+ const lastOffsetY = useSharedValue(0);
37
+ const prevOffsetY = useSharedValue(0);
38
+ const overlapped = useSharedValue(false);
39
+ const vectorY = useSharedValue(0);
41
40
  const elevationStyle = useElevationStyle(4);
42
- const animatedStyle = Animated.useAnimatedStyle(() => {
43
- return Platform.OS === 'web' ? {
44
- transform: [{
45
- translateY: translateY.value
46
- }],
47
- boxShadow: overlapped.value ? elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.boxShadow : 0
48
- } : {
49
- transform: [{
50
- translateY: translateY.value
51
- }],
52
- elevation: overlapped.value ? elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.elevation : 0,
53
- shadowColor: elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.shadowColor,
54
- shadowOffset: elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.shadowOffset,
55
- shadowRadius: elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.shadowRadius,
56
- shadowOpacity: overlapped.value ? elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.shadowOpacity : 0
57
- };
58
- });
59
- const indexRef = React.useRef(0);
60
- const offsetsRef = React.useRef([]);
41
+ const animatedStyle = useAnimatedStyle(() => {
42
+ const transform = [{
43
+ translateY: translateY.value
44
+ }];
61
45
 
62
- const onScrollViewChanged = nextIndex => {
63
- var _offsetsRef$current$n;
46
+ if (Platform.OS === 'web') {
47
+ return {
48
+ transform,
49
+ boxShadow: overlapped.value ? elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.boxShadow : 0
50
+ };
51
+ }
52
+
53
+ if (Platform.OS === 'android') {
54
+ return {
55
+ transform,
56
+ elevation: overlapped.value ? elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.elevation : 0
57
+ };
58
+ }
64
59
 
60
+ if (Platform.OS === 'ios') {
61
+ return {
62
+ transform,
63
+ shadowColor: elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.shadowColor,
64
+ shadowOffset: elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.shadowOffset,
65
+ shadowRadius: elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.shadowRadius,
66
+ shadowOpacity: overlapped.value ? elevationStyle === null || elevationStyle === void 0 ? void 0 : elevationStyle.shadowOpacity : 0
67
+ };
68
+ }
69
+
70
+ return {};
71
+ }, [
72
+ /**
73
+ * FIXME: Consider add `elevationStyle` to dependencies.
74
+ */
75
+ ]);
76
+ const indexRef = useRef(0);
77
+ const offsetsRef = useRef([]);
78
+
79
+ const onScrollViewChanged = nextIndex => {
65
80
  const prevIndex = indexRef.current;
66
81
 
67
82
  if (prevIndex === nextIndex) {
68
83
  if (shouldTranslateYReset) {
69
- translateY.value = Animated.withTiming(0, {
84
+ translateY.value = withTiming(0, {
70
85
  duration: ANIMATION_DURATION_MILLIS
71
86
  });
72
87
  vectorY.value = 0;
@@ -78,21 +93,21 @@ export default function useUnstableCollapsibleAppBar(userOptions = defaultOption
78
93
  }
79
94
 
80
95
  offsetsRef.current[prevIndex] = lastOffsetY.value;
81
- const savedOffsetY = (_offsetsRef$current$n = offsetsRef.current[nextIndex]) !== null && _offsetsRef$current$n !== void 0 ? _offsetsRef$current$n : 0;
96
+ const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;
82
97
  lastOffsetY.value = savedOffsetY;
83
98
  indexRef.current = nextIndex; // Determine whether to overlap every time index is changed.
84
99
 
85
100
  overlapped.value = savedOffsetY > 0; // If next ScrollView's offset is too short, expand app bar.
86
101
 
87
102
  if (translateY.value < 0 && savedOffsetY < appBarHeight) {
88
- translateY.value = Animated.withTiming(0, {
103
+ translateY.value = withTiming(0, {
89
104
  duration: ANIMATION_DURATION_MILLIS
90
105
  });
91
106
  vectorY.value = 0;
92
107
  }
93
108
  };
94
109
 
95
- const scrollHandler = Animated.useAnimatedScrollHandler({
110
+ const scrollHandler = useAnimatedScrollHandler({
96
111
  onBeginDrag: () => {
97
112
  lastTranslateY.value = translateY.value;
98
113
  },
@@ -114,13 +129,13 @@ export default function useUnstableCollapsibleAppBar(userOptions = defaultOption
114
129
  } else {
115
130
  if (offsetY > -maxTy) {
116
131
  if (ty === 0) {
117
- translateY.value = Animated.withTiming(Math.min(Math.max(-offsetY, maxTy), 0), {
132
+ translateY.value = withTiming(Math.min(Math.max(-offsetY, maxTy), 0), {
118
133
  duration: ANIMATION_DURATION_MILLIS
119
134
  });
120
135
  }
121
136
  } else {
122
137
  if (ty === maxTy) {
123
- translateY.value = Animated.withTiming(0, {
138
+ translateY.value = withTiming(0, {
124
139
  duration: ANIMATION_DURATION_MILLIS
125
140
  });
126
141
  }
@@ -146,15 +161,15 @@ export default function useUnstableCollapsibleAppBar(userOptions = defaultOption
146
161
  const threshold = maxTy * 0.5;
147
162
  const nextTranslateY = ty > threshold || offsetY < appBarHeight ? 0 : maxTy;
148
163
  overlapped.value = offsetY + nextTranslateY > 0;
149
- translateY.value = Animated.withTiming(nextTranslateY, {
164
+ translateY.value = withTiming(nextTranslateY, {
150
165
  duration: ANIMATION_DURATION_MILLIS
151
166
  });
152
167
  }
153
- });
168
+ }, []);
154
169
  const hasCollapsible = collapsibleToolbarHeight > 0;
155
- const appBarStyle = [animatedStyle, translucent ? {
170
+ const appBarStyle = [animatedStyle, {
156
171
  paddingTop: safeAreaInsets.top
157
- } : undefined, hasCollapsible ? styles.floating : undefined];
172
+ }, hasCollapsible ? styles.floating : undefined];
158
173
  return {
159
174
  appBarStyle,
160
175
  vectorY,
@@ -1 +1 @@
1
- {"version":3,"sources":["useUnstableCollapsibleAppBar.ts"],"names":["React","useRef","Platform","Animated","useSafeAreaInsets","useAppbarStyles","useElevationStyle","useHeight","defaultOptions","translucent","shouldTranslateYReset","ANIMATION_DURATION_MILLIS","SUPPORTS_DRAG_DETECTION","OS","useLargerValueOfLastTwoValues","value","refLatestTwoValues","current","shift","push","Math","max","useUnstableCollapsibleAppBar","userOptions","styles","safeAreaInsets","appBarHeight","onAppBarLayout","appBarMaxHeight","collapsibleToolbarHeight","onCollapsibleToolbarLayout","maxTranslateY","useDerivedValue","translateY","useSharedValue","lastTranslateY","lastOffsetY","prevOffsetY","overlapped","vectorY","elevationStyle","animatedStyle","useAnimatedStyle","transform","boxShadow","elevation","shadowColor","shadowOffset","shadowRadius","shadowOpacity","indexRef","offsetsRef","onScrollViewChanged","nextIndex","prevIndex","withTiming","duration","savedOffsetY","scrollHandler","useAnimatedScrollHandler","onBeginDrag","onMomentumBegin","onScroll","event","offsetY","contentOffset","y","ty","maxTy","deltaY","dy","min","onEndDrag","onMomentumEnd","threshold","nextTranslateY","hasCollapsible","appBarStyle","paddingTop","top","undefined","floating","scrollContentInsets"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,MAAhB,QAA8B,OAA9B;AACA,SAAgBC,QAAhB,QAAwF,cAAxF;AACA,OAAOC,QAAP,MAAqB,yBAArB;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,SAAP,MAAsB,aAAtB;AAgCA,MAAMC,cAAiC,GAAG;AACtCC,EAAAA,WAAW,EAAE,KADyB;AAEtCC,EAAAA,qBAAqB,EAAE;AAFe,CAA1C;AAKA,MAAMC,yBAAyB,GAAG,GAAlC;AAEA,MAAMC,uBAAuB,GAAGV,QAAQ,CAACW,EAA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oB,cAApB,EAAoC;AACnDnB,QAAAA,QAAQ,EAAE7C;AADyC,OAApC,CAAnB;AAGH;AApEmD,GAAlC,CAAtB;AAuEA,QAAMiE,cAAc,GAAG/C,wBAAwB,GAAG,CAAlD;AAEA,QAAMgD,WAAW,GAAG,CAChBpC,aADgB,EAEhBhC,WAAW,GAAG;AAAEqE,IAAAA,UAAU,EAAErD,cAAc,CAACsD;AAA7B,GAAH,GAAwCC,SAFnC,EAGhBJ,cAAc,GAAGpD,MAAM,CAACyD,QAAV,GAAqBD,SAHnB,CAApB;AAMA,SAAO;AACHH,IAAAA,WADG;AAEHtC,IAAAA,OAFG;AAGHZ,IAAAA,cAHG;AAIHG,IAAAA,0BAJG;AAKHgC,IAAAA,QAAQ,EAAEJ,aALP;AAMHN,IAAAA,mBANG;AAOH8B,IAAAA,mBAAmB,EAAE;AAAEH,MAAAA,GAAG,EAAEH,cAAc,GAAGhD,eAAH,GAAqB;AAA1C;AAPlB,GAAP;AASH;AAAA","sourcesContent":["import React, { useRef } from 'react';\nimport { Falsy, Platform, RegisteredStyle, ScrollViewProps, ViewProps, ViewStyle } from 'react-native';\nimport Animated from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport useAppbarStyles from './useAppbarStyles';\nimport useElevationStyle from './useElevationStyle';\nimport useHeight from './useHeight';\n\ntype WebOnlyStyle = { boxShadow: any };\n\ntype ViewStyleProp = Array<ViewStyle | RegisteredStyle<ViewStyle> | WebOnlyStyle | Falsy>;\n\ntype OnScroll = ScrollViewProps['onScroll'];\n\ntype OnLayoutCallback = ViewProps['onLayout'];\n\nexport interface ContentInsets {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport interface Options {\n translucent?: boolean;\n shouldTranslateYReset?: boolean;\n}\n\nexport interface CollapsibleAppBar {\n appBarStyle: ViewStyleProp;\n vectorY: Animated.SharedValue<number>;\n onAppBarLayout: OnLayoutCallback;\n onCollapsibleToolbarLayout: OnLayoutCallback;\n onScroll: OnScroll;\n onScrollViewChanged: (index: number) => void;\n scrollContentInsets: ContentInsets;\n}\n\nconst defaultOptions: Required<Options> = {\n translucent: false,\n shouldTranslateYReset: false,\n};\n\nconst ANIMATION_DURATION_MILLIS = 100;\n\nconst SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';\n\n\nfunction useLargerValueOfLastTwoValues(value: number) {\n const refLatestTwoValues = useRef([0, 0]);\n\n refLatestTwoValues.current.shift();\n refLatestTwoValues.current.push(value);\n\n return Math.max(...refLatestTwoValues.current);\n}\n\n\nexport default function useUnstableCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {\n const {\n translucent,\n shouldTranslateYReset,\n }: Required<Options> = {\n ...defaultOptions,\n ...userOptions,\n };\n\n const styles = useAppbarStyles();\n\n const safeAreaInsets = useSafeAreaInsets();\n\n const [appBarHeight, onAppBarLayout] = useHeight();\n const appBarMaxHeight = useLargerValueOfLastTwoValues(appBarHeight);\n const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();\n\n const maxTranslateY = Animated.useDerivedValue(() => -collapsibleToolbarHeight);\n\n const translateY = Animated.useSharedValue<number>(0);\n const lastTranslateY = Animated.useSharedValue<number>(0);\n const lastOffsetY = Animated.useSharedValue<number>(0);\n const prevOffsetY = Animated.useSharedValue<number>(0);\n const overlapped = Animated.useSharedValue<boolean>(false);\n const vectorY = Animated.useSharedValue<number>(0);\n\n const elevationStyle = useElevationStyle(4);\n const animatedStyle = Animated.useAnimatedStyle(() => {\n return Platform.OS === 'web' ? ({\n transform: [{ translateY: translateY.value }],\n boxShadow: overlapped.value ? elevationStyle?.boxShadow : 0,\n }) : ({\n transform: [{ translateY: translateY.value }],\n elevation: overlapped.value ? elevationStyle?.elevation : 0,\n shadowColor: elevationStyle?.shadowColor,\n shadowOffset: elevationStyle?.shadowOffset,\n shadowRadius: elevationStyle?.shadowRadius,\n shadowOpacity: overlapped.value ? elevationStyle?.shadowOpacity : 0,\n });\n });\n\n const indexRef = React.useRef<number>(0);\n const offsetsRef = React.useRef<Array<number>>([]);\n\n const onScrollViewChanged = (nextIndex: number) => {\n const prevIndex = indexRef.current;\n if (prevIndex === nextIndex) {\n if (shouldTranslateYReset) {\n translateY.value = Animated.withTiming(0, {\n duration: ANIMATION_DURATION_MILLIS,\n });\n\n vectorY.value = 0;\n offsetsRef.current = [];\n overlapped.value = false;\n }\n\n return;\n }\n\n offsetsRef.current[prevIndex] = lastOffsetY.value;\n\n const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;\n lastOffsetY.value = savedOffsetY;\n\n indexRef.current = nextIndex;\n\n // Determine whether to overlap every time index is changed.\n overlapped.value = savedOffsetY > 0;\n\n // If next ScrollView's offset is too short, expand app bar.\n if (translateY.value < 0 && savedOffsetY < appBarHeight) {\n translateY.value = Animated.withTiming(0, {\n duration: ANIMATION_DURATION_MILLIS,\n });\n\n vectorY.value = 0;\n }\n };\n\n const scrollHandler = Animated.useAnimatedScrollHandler({\n onBeginDrag: () => {\n lastTranslateY.value = translateY.value;\n },\n onMomentumBegin: () => {\n lastTranslateY.value = translateY.value;\n },\n onScroll: (event) => {\n const offsetY = event.contentOffset.y;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n const deltaY = offsetY - prevOffsetY.value;\n vectorY.value = (vectorY.value * deltaY >= 0 && offsetY > 0) ? vectorY.value + deltaY : deltaY;\n prevOffsetY.value = offsetY;\n\n if (SUPPORTS_DRAG_DETECTION) {\n const dy = offsetY - lastOffsetY.value;\n\n translateY.value = offsetY <= 0 ? 0 : Math.min(Math.max(lastTranslateY.value - dy, maxTy), 0);\n\n overlapped.value = offsetY + translateY.value > 0;\n } else {\n if (offsetY > -maxTy) {\n if (ty === 0) {\n translateY.value = Animated.withTiming(Math.min(Math.max(-offsetY, maxTy), 0), {\n duration: ANIMATION_DURATION_MILLIS,\n });\n }\n } else {\n if (ty === maxTy) {\n translateY.value = Animated.withTiming(0, {\n duration: ANIMATION_DURATION_MILLIS,\n });\n }\n }\n\n overlapped.value = offsetY > 0;\n\n lastOffsetY.value = offsetY;\n }\n },\n onEndDrag: (event) => {\n lastOffsetY.value = event.contentOffset.y;\n },\n onMomentumEnd: (event) => {\n const offsetY = event.contentOffset.y;\n\n lastOffsetY.value = offsetY;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n // If toolbar is already positioned on edge, do nothing.\n if (ty <= maxTy || ty >= 0) {\n return;\n }\n\n const threshold = maxTy * 0.5;\n\n const nextTranslateY = (ty > threshold || offsetY < appBarHeight) ? 0 : maxTy;\n\n overlapped.value = offsetY + nextTranslateY > 0;\n\n translateY.value = Animated.withTiming(nextTranslateY, {\n duration: ANIMATION_DURATION_MILLIS,\n });\n },\n });\n\n const hasCollapsible = collapsibleToolbarHeight > 0;\n\n const appBarStyle = [\n animatedStyle,\n translucent ? { paddingTop: safeAreaInsets.top } : undefined,\n hasCollapsible ? styles.floating : undefined,\n ];\n\n return {\n appBarStyle,\n vectorY,\n onAppBarLayout,\n onCollapsibleToolbarLayout,\n onScroll: scrollHandler,\n onScrollViewChanged,\n scrollContentInsets: { top: hasCollapsible ? appBarMaxHeight : 0 },\n };\n};\n"]}
1
+ {"version":3,"names":["useRef","Platform","useAnimatedScrollHandler","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","useSafeAreaInsets","useAppbarStyles","useElevationStyle","useHeight","defaultOptions","shouldTranslateYReset","ANIMATION_DURATION_MILLIS","SUPPORTS_DRAG_DETECTION","OS","useLargerValueOfLastTwoValues","value","refLatestTwoValues","current","shift","push","Math","max","useUnstableCollapsibleAppBar","userOptions","styles","safeAreaInsets","appBarHeight","onAppBarLayout","appBarMaxHeight","collapsibleToolbarHeight","onCollapsibleToolbarLayout","maxTranslateY","translateY","lastTranslateY","lastOffsetY","prevOffsetY","overlapped","vectorY","elevationStyle","animatedStyle","transform","boxShadow","elevation","shadowColor","shadowOffset","shadowRadius","shadowOpacity","indexRef","offsetsRef","onScrollViewChanged","nextIndex","prevIndex","duration","savedOffsetY","scrollHandler","onBeginDrag","onMomentumBegin","onScroll","event","offsetY","contentOffset","y","ty","maxTy","deltaY","dy","min","onEndDrag","onMomentumEnd","threshold","nextTranslateY","hasCollapsible","appBarStyle","paddingTop","top","floating","undefined","scrollContentInsets"],"sources":["useUnstableCollapsibleAppBar.ts"],"sourcesContent":["import { useRef } from 'react';\nimport { Falsy, Platform, RegisteredStyle, ScrollViewProps, ViewProps, ViewStyle } from 'react-native';\nimport type { SharedValue } from 'react-native-reanimated';\nimport {\n useAnimatedScrollHandler,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport useAppbarStyles from './useAppbarStyles';\nimport useElevationStyle from './useElevationStyle';\nimport useHeight from './useHeight';\n\ntype WebOnlyStyle = { boxShadow: any };\n\ntype ViewStyleProp = Array<ViewStyle | RegisteredStyle<ViewStyle> | WebOnlyStyle | Falsy>;\n\ntype OnScroll = ScrollViewProps['onScroll'];\n\ntype OnLayoutCallback = ViewProps['onLayout'];\n\nexport interface ContentInsets {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport interface Options {\n shouldTranslateYReset?: boolean;\n}\n\nexport interface CollapsibleAppBar {\n appBarStyle: ViewStyleProp;\n vectorY: SharedValue<number>;\n onAppBarLayout: OnLayoutCallback;\n onCollapsibleToolbarLayout: OnLayoutCallback;\n onScroll: OnScroll;\n onScrollViewChanged: (index: number) => void;\n scrollContentInsets: ContentInsets;\n}\n\nconst defaultOptions: Required<Options> = {\n shouldTranslateYReset: false,\n};\n\nconst ANIMATION_DURATION_MILLIS = 100;\n\nconst SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';\n\nfunction useLargerValueOfLastTwoValues(value: number) {\n const refLatestTwoValues = useRef([0, 0]);\n\n refLatestTwoValues.current.shift();\n refLatestTwoValues.current.push(value);\n\n return Math.max(...refLatestTwoValues.current);\n}\n\nexport default function useUnstableCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {\n const { shouldTranslateYReset }: Required<Options> = {\n ...defaultOptions,\n ...userOptions,\n };\n\n const styles = useAppbarStyles();\n\n const safeAreaInsets = useSafeAreaInsets();\n\n const [appBarHeight, onAppBarLayout] = useHeight();\n const appBarMaxHeight = useLargerValueOfLastTwoValues(appBarHeight);\n const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();\n\n const maxTranslateY = useDerivedValue(() => -collapsibleToolbarHeight, [collapsibleToolbarHeight]);\n\n const translateY = useSharedValue<number>(0);\n const lastTranslateY = useSharedValue<number>(0);\n const lastOffsetY = useSharedValue<number>(0);\n const prevOffsetY = useSharedValue<number>(0);\n const overlapped = useSharedValue<boolean>(false);\n const vectorY = useSharedValue<number>(0);\n\n const elevationStyle = useElevationStyle(4);\n const animatedStyle = useAnimatedStyle(() => {\n const transform = [{ translateY: translateY.value }];\n\n if (Platform.OS === 'web') {\n return {\n transform,\n boxShadow: overlapped.value ? elevationStyle?.boxShadow : 0,\n };\n }\n if (Platform.OS === 'android') {\n return {\n transform,\n elevation: overlapped.value ? elevationStyle?.elevation : 0,\n };\n }\n if (Platform.OS === 'ios') {\n return {\n transform,\n shadowColor: elevationStyle?.shadowColor,\n shadowOffset: elevationStyle?.shadowOffset,\n shadowRadius: elevationStyle?.shadowRadius,\n shadowOpacity: overlapped.value ? elevationStyle?.shadowOpacity : 0,\n };\n }\n return {};\n }, [\n /**\n * FIXME: Consider add `elevationStyle` to dependencies.\n */\n ]);\n\n const indexRef = useRef<number>(0);\n const offsetsRef = useRef<Array<number>>([]);\n\n const onScrollViewChanged = (nextIndex: number) => {\n const prevIndex = indexRef.current;\n if (prevIndex === nextIndex) {\n if (shouldTranslateYReset) {\n translateY.value = withTiming(0, {\n duration: ANIMATION_DURATION_MILLIS,\n });\n\n vectorY.value = 0;\n offsetsRef.current = [];\n overlapped.value = false;\n }\n\n return;\n }\n\n offsetsRef.current[prevIndex] = lastOffsetY.value;\n\n const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;\n lastOffsetY.value = savedOffsetY;\n\n indexRef.current = nextIndex;\n\n // Determine whether to overlap every time index is changed.\n overlapped.value = savedOffsetY > 0;\n\n // If next ScrollView's offset is too short, expand app bar.\n if (translateY.value < 0 && savedOffsetY < appBarHeight) {\n translateY.value = withTiming(0, {\n duration: ANIMATION_DURATION_MILLIS,\n });\n\n vectorY.value = 0;\n }\n };\n\n const scrollHandler = useAnimatedScrollHandler({\n onBeginDrag: () => {\n lastTranslateY.value = translateY.value;\n },\n onMomentumBegin: () => {\n lastTranslateY.value = translateY.value;\n },\n onScroll: (event) => {\n const offsetY = event.contentOffset.y;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n const deltaY = offsetY - prevOffsetY.value;\n vectorY.value = (vectorY.value * deltaY >= 0 && offsetY > 0) ? vectorY.value + deltaY : deltaY;\n prevOffsetY.value = offsetY;\n\n if (SUPPORTS_DRAG_DETECTION) {\n const dy = offsetY - lastOffsetY.value;\n\n translateY.value = offsetY <= 0 ? 0 : Math.min(Math.max(lastTranslateY.value - dy, maxTy), 0);\n\n overlapped.value = offsetY + translateY.value > 0;\n } else {\n if (offsetY > -maxTy) {\n if (ty === 0) {\n translateY.value = withTiming(Math.min(Math.max(-offsetY, maxTy), 0), {\n duration: ANIMATION_DURATION_MILLIS,\n });\n }\n } else {\n if (ty === maxTy) {\n translateY.value = withTiming(0, {\n duration: ANIMATION_DURATION_MILLIS,\n });\n }\n }\n\n overlapped.value = offsetY > 0;\n\n lastOffsetY.value = offsetY;\n }\n },\n onEndDrag: (event) => {\n lastOffsetY.value = event.contentOffset.y;\n },\n onMomentumEnd: (event) => {\n const offsetY = event.contentOffset.y;\n\n lastOffsetY.value = offsetY;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n // If toolbar is already positioned on edge, do nothing.\n if (ty <= maxTy || ty >= 0) {\n return;\n }\n\n const threshold = maxTy * 0.5;\n\n const nextTranslateY = (ty > threshold || offsetY < appBarHeight) ? 0 : maxTy;\n\n overlapped.value = offsetY + nextTranslateY > 0;\n\n translateY.value = withTiming(nextTranslateY, {\n duration: ANIMATION_DURATION_MILLIS,\n });\n },\n }, []);\n\n const hasCollapsible = collapsibleToolbarHeight > 0;\n\n const appBarStyle = [\n animatedStyle,\n { paddingTop: safeAreaInsets.top },\n hasCollapsible ? styles.floating : undefined,\n ];\n\n return {\n appBarStyle,\n vectorY,\n onAppBarLayout,\n onCollapsibleToolbarLayout,\n onScroll: scrollHandler,\n onScrollViewChanged,\n scrollContentInsets: { top: hasCollapsible ? appBarMaxHeight : 0 },\n };\n};\n"],"mappings":"AAAA,SAASA,MAAT,QAAuB,OAAvB;AACA,SAAgBC,QAAhB,QAAwF,cAAxF;AAEA,SACIC,wBADJ,EAEIC,gBAFJ,EAGIC,eAHJ,EAIIC,cAJJ,EAKIC,UALJ,QAMO,yBANP;AAOA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,SAAP,MAAsB,aAAtB;AA+BA,MAAMC,cAAiC,GAAG;EACtCC,qBAAqB,EAAE;AADe,CAA1C;AAIA,MAAMC,yBAAyB,GAAG,GAAlC;AAEA,MAAMC,uBAAuB,GAAGb,QAAQ,CAACc,EAAT,KAAgB,KAAhD;;AAEA,SAASC,6BAAT,CAAuCC,KAAvC,EAAsD;EAClD,MAAMC,kBAAkB,GAAGlB,MAAM,CAAC,CAAC,CAAD,EAAI,CAAJ,CAAD,CAAjC;EAEAkB,kBAAkB,CAACC,OAAnB,CAA2BC,KAA3B;EACAF,kBAAkB,CAACC,OAAnB,CAA2BE,IAA3B,CAAgCJ,KAAhC;EAEA,OAAOK,IAAI,CAACC,GAAL,CAAS,GAAGL,kBAAkB,CAACC,OAA/B,CAAP;AACH;;AAED,eAAe,SAASK,4BAAT,GAAgG;EAAA,IAA1DC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Z,GAAoB4C,OAApB;MAEA,MAAMG,EAAE,GAAG9B,UAAU,CAACjB,KAAtB;MACA,MAAMgD,KAAK,GAAGhC,aAAa,CAAChB,KAA5B,CANsB,CAQtB;;MACA,IAAI+C,EAAE,IAAIC,KAAN,IAAeD,EAAE,IAAI,CAAzB,EAA4B;QACxB;MACH;;MAED,MAAMO,SAAS,GAAGN,KAAK,GAAG,GAA1B;MAEA,MAAMO,cAAc,GAAIR,EAAE,GAAGO,SAAL,IAAkBV,OAAO,GAAGjC,YAA7B,GAA6C,CAA7C,GAAiDqC,KAAxE;MAEA3B,UAAU,CAACrB,KAAX,GAAmB4C,OAAO,GAAGW,cAAV,GAA2B,CAA9C;MAEAtC,UAAU,CAACjB,KAAX,GAAmBX,UAAU,CAACkE,cAAD,EAAiB;QAC1ClB,QAAQ,EAAEzC;MADgC,CAAjB,CAA7B;IAGH;EApE0C,CAAD,EAqE3C,EArE2C,CAA9C;EAuEA,MAAM4D,cAAc,GAAG1C,wBAAwB,GAAG,CAAlD;EAEA,MAAM2C,WAAW,GAAG,CAChBjC,aADgB,EAEhB;IAAEkC,UAAU,EAAEhD,cAAc,CAACiD;EAA7B,CAFgB,EAGhBH,cAAc,GAAG/C,MAAM,CAACmD,QAAV,GAAqBC,SAHnB,CAApB;EAMA,OAAO;IACHJ,WADG;IAEHnC,OAFG;IAGHV,cAHG;IAIHG,0BAJG;IAKH2B,QAAQ,EAAEH,aALP;IAMHL,mBANG;IAOH4B,mBAAmB,EAAE;MAAEH,GAAG,EAAEH,cAAc,GAAG3C,eAAH,GAAqB;IAA1C;EAPlB,CAAP;AASH;AAAA"}
@@ -1,16 +1,18 @@
1
- import Animated from 'react-native-reanimated';
2
- export default function useAnimatedDisplayStyle(vectorY, threshold = 200, defaultDisplay = 'flex') {
3
- const display = Animated.useSharedValue(defaultDisplay);
4
- Animated.useAnimatedReaction(() => vectorY.value, vy => {
1
+ import { useAnimatedReaction, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
2
+ export default function useAnimatedDisplayStyle(vectorY) {
3
+ let threshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
4
+ let defaultDisplay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'flex';
5
+ const display = useSharedValue(defaultDisplay);
6
+ useAnimatedReaction(() => vectorY.value, vy => {
5
7
  if (vy >= threshold) {
6
8
  display.value = 'none';
7
9
  } else if (vy < threshold) {
8
10
  display.value = 'flex';
9
11
  }
10
- });
11
- return Animated.useAnimatedStyle(() => ({
12
+ }, [threshold]);
13
+ return useAnimatedStyle(() => ({
12
14
  display: display.value
13
- }));
15
+ }), []);
14
16
  }
15
17
  ;
16
18
  //# sourceMappingURL=useUnstableToggleDisplayStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useUnstableToggleDisplayStyle.ts"],"names":["Animated","useAnimatedDisplayStyle","vectorY","threshold","defaultDisplay","display","useSharedValue","useAnimatedReaction","value","vy","useAnimatedStyle"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,yBAArB;AAEA,eAAe,SAASC,uBAAT,CACXC,OADW,EAEXC,SAAiB,GAAG,GAFT,EAGXC,cAA+B,GAAG,MAHvB,EAIb;AACE,QAAMC,OAAO,GAAGL,QAAQ,CAACM,cAAT,CAAwBF,cAAxB,CAAhB;AAEAJ,EAAAA,QAAQ,CAACO,mBAAT,CACI,MAAML,OAAO,CAACM,KADlB,EAEKC,EAAD,IAAQ;AACJ,QAAIA,EAAE,IAAIN,SAAV,EAAqB;AACjBE,MAAAA,OAAO,CAACG,KAAR,GAAgB,MAAhB;AACH,KAFD,MAEO,IAAIC,EAAE,GAAGN,SAAT,EAAoB;AACvBE,MAAAA,OAAO,CAACG,KAAR,GAAgB,MAAhB;AACH;AACJ,GARL;AAWA,SAAOR,QAAQ,CAACU,gBAAT,CAA0B,OAAO;AACpCL,IAAAA,OAAO,EAAEA,OAAO,CAACG;AADmB,GAAP,CAA1B,CAAP;AAGH;AAAA","sourcesContent":["import Animated from 'react-native-reanimated';\n\nexport default function useAnimatedDisplayStyle(\n vectorY: Animated.SharedValue<number>,\n threshold: number = 200,\n defaultDisplay: 'flex' | 'none' = 'flex',\n) {\n const display = Animated.useSharedValue(defaultDisplay);\n\n Animated.useAnimatedReaction(\n () => vectorY.value,\n (vy) => {\n if (vy >= threshold) {\n display.value = 'none';\n } else if (vy < threshold) {\n display.value = 'flex';\n }\n },\n );\n\n return Animated.useAnimatedStyle(() => ({\n display: display.value,\n }));\n};\n"]}
1
+ {"version":3,"names":["useAnimatedReaction","useAnimatedStyle","useSharedValue","useAnimatedDisplayStyle","vectorY","threshold","defaultDisplay","display","value","vy"],"sources":["useUnstableToggleDisplayStyle.ts"],"sourcesContent":["import type { SharedValue } from 'react-native-reanimated';\nimport { useAnimatedReaction, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';\n\nexport default function useAnimatedDisplayStyle(\n vectorY: SharedValue<number>,\n threshold: number = 200,\n defaultDisplay: 'flex' | 'none' = 'flex',\n) {\n const display = useSharedValue(defaultDisplay);\n\n useAnimatedReaction(\n () => vectorY.value,\n (vy) => {\n if (vy >= threshold) {\n display.value = 'none';\n } else if (vy < threshold) {\n display.value = 'flex';\n }\n },\n [threshold],\n );\n\n return useAnimatedStyle(() => ({\n display: display.value,\n }), []);\n};\n"],"mappings":"AACA,SAASA,mBAAT,EAA8BC,gBAA9B,EAAgDC,cAAhD,QAAsE,yBAAtE;AAEA,eAAe,SAASC,uBAAT,CACXC,OADW,EAIb;EAAA,IAFEC,SAEF,uEAFsB,GAEtB;EAAA,IADEC,cACF,uEADoC,MACpC;EACE,MAAMC,OAAO,GAAGL,cAAc,CAACI,cAAD,CAA9B;EAEAN,mBAAmB,CACf,MAAMI,OAAO,CAACI,KADC,EAEdC,EAAD,IAAQ;IACJ,IAAIA,EAAE,IAAIJ,SAAV,EAAqB;MACjBE,OAAO,CAACC,KAAR,GAAgB,MAAhB;IACH,CAFD,MAEO,IAAIC,EAAE,GAAGJ,SAAT,EAAoB;MACvBE,OAAO,CAACC,KAAR,GAAgB,MAAhB;IACH;EACJ,CARc,EASf,CAACH,SAAD,CATe,CAAnB;EAYA,OAAOJ,gBAAgB,CAAC,OAAO;IAC3BM,OAAO,EAAEA,OAAO,CAACC;EADU,CAAP,CAAD,EAEnB,EAFmB,CAAvB;AAGH;AAAA"}
@@ -12,5 +12,7 @@ export { default as ComicViewer } from './ComicViewer';
12
12
  export * from './ComicViewer';
13
13
  export { default as StatusBarProvider, useStatusBarContext } from './StatusBarProvider';
14
14
  export * from './StatusBarProvider';
15
+ export { default as ViewabilityTrackerView } from './ViewabilityTrackerView';
16
+ export * from './ViewabilityTrackerView';
15
17
  export * from './hooks';
16
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["default","BottomSheet","Carousel","DateTimePicker","FlipCard","ViewPager","ComicViewer","StatusBarProvider","useStatusBarContext"],"mappings":"AAAA,SAASA,OAAO,IAAIC,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAASD,OAAO,IAAIE,QAApB,QAAoC,YAApC;AACA,cAAc,YAAd;AAEA,SAASF,OAAO,IAAIG,cAApB,QAA0C,kBAA1C;AACA,cAAc,kBAAd;AAEA,SAASH,OAAO,IAAII,QAApB,QAAoC,YAApC;AACA,cAAc,YAAd;AAEA,SAASJ,OAAO,IAAIK,SAApB,QAAqC,aAArC;AACA,cAAc,aAAd;AAEA,SAASL,OAAO,IAAIM,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAASN,OAAO,IAAIO,iBAApB,EAAuCC,mBAAvC,QAAkE,qBAAlE;AACA,cAAc,qBAAd;AAEA,cAAc,SAAd","sourcesContent":["export { default as BottomSheet } from './BottomSheet';\nexport * from './BottomSheet';\n\nexport { default as Carousel } from './Carousel';\nexport * from './Carousel';\n\nexport { default as DateTimePicker } from './DateTimePicker';\nexport * from './DateTimePicker';\n\nexport { default as FlipCard } from './FlipCard';\nexport * from './FlipCard';\n\nexport { default as ViewPager } from './ViewPager';\nexport * from './ViewPager';\n\nexport { default as ComicViewer } from './ComicViewer';\nexport * from './ComicViewer';\n\nexport { default as StatusBarProvider, useStatusBarContext } from './StatusBarProvider';\nexport * from './StatusBarProvider';\n\nexport * from './hooks';\n"]}
1
+ {"version":3,"names":["default","BottomSheet","Carousel","DateTimePicker","FlipCard","ViewPager","ComicViewer","StatusBarProvider","useStatusBarContext","ViewabilityTrackerView"],"sources":["index.ts"],"sourcesContent":["export { default as BottomSheet } from './BottomSheet';\nexport * from './BottomSheet';\n\nexport { default as Carousel } from './Carousel';\nexport * from './Carousel';\n\nexport { default as DateTimePicker } from './DateTimePicker';\nexport * from './DateTimePicker';\n\nexport { default as FlipCard } from './FlipCard';\nexport * from './FlipCard';\n\nexport { default as ViewPager } from './ViewPager';\nexport * from './ViewPager';\n\nexport { default as ComicViewer } from './ComicViewer';\nexport * from './ComicViewer';\n\nexport { default as StatusBarProvider, useStatusBarContext } from './StatusBarProvider';\nexport * from './StatusBarProvider';\n\nexport { default as ViewabilityTrackerView } from './ViewabilityTrackerView';\nexport * from './ViewabilityTrackerView';\n\nexport * from './hooks';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAASD,OAAO,IAAIE,QAApB,QAAoC,YAApC;AACA,cAAc,YAAd;AAEA,SAASF,OAAO,IAAIG,cAApB,QAA0C,kBAA1C;AACA,cAAc,kBAAd;AAEA,SAASH,OAAO,IAAII,QAApB,QAAoC,YAApC;AACA,cAAc,YAAd;AAEA,SAASJ,OAAO,IAAIK,SAApB,QAAqC,aAArC;AACA,cAAc,aAAd;AAEA,SAASL,OAAO,IAAIM,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAASN,OAAO,IAAIO,iBAApB,EAAuCC,mBAAvC,QAAkE,qBAAlE;AACA,cAAc,qBAAd;AAEA,SAASR,OAAO,IAAIS,sBAApB,QAAkD,0BAAlD;AACA,cAAc,0BAAd;AAEA,cAAc,SAAd"}
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type AnimatedYProps from './AnimatedYProps';
3
2
  export default function AnimatedY(props: AnimatedYProps): JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type BottomSheetProps from './BottomSheetProps';
3
2
  export default function BottomSheet(props: BottomSheetProps): JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type BottomSheetProps from './BottomSheetProps';
3
2
  export default function BottomSheet(props: BottomSheetProps): JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { BottomSheetBackdropProps } from '@gorhom/bottom-sheet';
3
2
  export default function TransparentBackdrop(props: BottomSheetBackdropProps): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type CarouselProps from './CarouselProps';
3
+ import type { CarouselInstance } from './types';
4
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CarouselProps<any>, "style" | "data" | "autoplay" | "autoplayInterval" | "createItemStyle" | "createScrollAnimation" | "disableSmartAutoplay" | "initialIndex" | "itemHeight" | "itemWidth" | "loop" | "onIndexChange" | "renderItem" | "scrollEnabled" | "windowSize"> & React.RefAttributes<CarouselInstance>>>;
5
+ export default _default;
@@ -1,7 +1,8 @@
1
- import React, { RefObject } from 'react';
2
- import type { ListRenderItemInfo } from 'react-native';
1
+ import type { RefObject } from 'react';
3
2
  import type { ComponentProps } from '@fountain-ui/core';
3
+ import type { CarouselInstance, CreateItemStyle, CreateScrollAnimation, RenderItem } from './types';
4
4
  export default interface CarouselProps<ItemT = any> extends ComponentProps<{
5
+ ref?: RefObject<CarouselInstance>;
5
6
  /**
6
7
  * If `true`, enable autoplay.
7
8
  * @default false
@@ -13,78 +14,61 @@ export default interface CarouselProps<ItemT = any> extends ComponentProps<{
13
14
  */
14
15
  autoplayInterval?: number;
15
16
  /**
16
- * Padding for center slide. If specified, `slidesToScroll` and `slidesToShow` set to 1.
17
+ * The item style creator function.
18
+ * @default createDefaultItemStyle
17
19
  */
18
- centerSlidePadding?: number;
20
+ createItemStyle?: CreateItemStyle;
19
21
  /**
20
- * Delay in ms until navigating to the next item.
22
+ * The scroll animation creator function.
23
+ * @default createDefaultScrollAnimation
24
+ */
25
+ createScrollAnimation?: CreateScrollAnimation;
26
+ /**
27
+ * Data for render items.
21
28
  */
22
29
  data: ReadonlyArray<ItemT>;
23
30
  /**
24
- * Value of the opacity effect applied to inactive slides.
25
- * @default 0.7
31
+ * If `true`, carousel will detect its own viewability and control autoplay automatically.
32
+ * @default false
26
33
  */
27
- inactiveSlideOpacity?: number;
34
+ disableSmartAutoplay?: boolean;
28
35
  /**
29
- * Value of the 'scale' transform applied to inactive slides.
30
- * @default 0.9
36
+ * Index of initial item that should be selected.
37
+ * @default 0
31
38
  */
32
- inactiveSlideScale?: number;
39
+ initialIndex?: number;
33
40
  /**
34
- * Web only. Value of the 'scale' transform applied to a active slide.
35
- * @default 0.990
41
+ * The item width.
36
42
  */
37
- activeSlideScale?: number;
43
+ itemHeight: number;
38
44
  /**
39
- * A number representing the index of the active slide.
45
+ * The item width.
40
46
  */
41
- index: number;
47
+ itemWidth: number;
42
48
  /**
43
49
  * Enable infinite loop mode.
44
50
  * @default false
45
51
  */
46
- infinite?: boolean;
52
+ loop?: boolean;
47
53
  /**
48
54
  * Callback fired when an index is changed.
49
55
  */
50
- onChange?: (newIndex: number) => void;
56
+ onIndexChange?: (newIndex: number) => void;
51
57
  /**
52
58
  * Takes an item from data and renders it into the list.
53
59
  */
54
- renderItem: (info: Omit<ListRenderItemInfo<ItemT>, 'separators'>) => React.ReactElement | null;
55
- /**
56
- * Web only. Number of slides to scroll at once.
57
- * @default 1
58
- */
59
- slidesToScroll?: number;
60
- /**
61
- * Web only. Number of slides to display.
62
- * @default 1
63
- */
64
- slidesToShow?: number;
60
+ renderItem: RenderItem<ItemT>;
65
61
  /**
66
- * Web only. Enable items to display at the center.
62
+ * Whether to enable scroll gesture.
67
63
  * @default true
68
64
  */
69
- centerMode?: boolean;
70
- /**
71
- * Web only. Enable arrows to display.
72
- * @default true
73
- */
74
- arrows?: boolean;
75
- /**
76
- * Web only. Style of arrows
77
- * @default true
78
- */
79
- arrowsStyle?: object;
80
- /**
81
- * Web only. Style of track
82
- * @default object
83
- */
84
- trackStyle?: object;
65
+ scrollEnabled?: boolean;
85
66
  /**
86
- * Only web. Refer slick object
67
+ * The maximum number of items that can respond to pan gesture events.
68
+ * Due to the nature of the `active` item, it accepts only odd number. (e.g. 1, 3, 5...)
69
+ * 0 means all items will respond to pan gesture events.
70
+ * @default 5
87
71
  */
88
- ref?: RefObject<any>;
72
+ windowSize?: number;
89
73
  }> {
90
74
  }
@@ -0,0 +1 @@
1
+ export declare const itemInterpolationInputRange: number[];
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../types").CreateItemStyle;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { Animated } from 'react-native';
2
+ export default function createDefaultScrollAnimation(animatedValue: Animated.Value, toValue: number): Animated.CompositeAnimation;
@@ -0,0 +1,4 @@
1
+ export { default as createDefaultItemStyle } from './createDefaultItemStyle';
2
+ export { default as createDefaultScrollAnimation } from './createDefaultScrollAnimation';
3
+ export { default as normalItemStyleFactory } from './normalItemStyleFactory';
4
+ export { default as parallaxItemStyleFactory } from './parallaxItemStyleFactory';
@@ -0,0 +1,2 @@
1
+ import type { CreateItemStyle } from '../types';
2
+ export default function normalItemStyleFactory(): CreateItemStyle;
@@ -0,0 +1,9 @@
1
+ import type { CreateItemStyle } from '../types';
2
+ export interface ParallaxAnimationConfig {
3
+ parallaxActiveItemScale?: number;
4
+ parallaxActiveItemOpacity?: number;
5
+ parallaxAdjacentItemScale?: number;
6
+ parallaxAdjacentItemOpacity?: number;
7
+ parallaxScrollingOffset?: number;
8
+ }
9
+ export default function parallaxItemStyleFactory(config?: ParallaxAnimationConfig): CreateItemStyle;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { Animated } from 'react-native';
3
+ import type { CreateItemStyle, ItemVisibilityStore } from '../types';
4
+ export interface InternalContextValue<ItemT> {
5
+ createItemStyle: CreateItemStyle;
6
+ data: ReadonlyArray<ItemT>;
7
+ globalInterpolation: Animated.AnimatedInterpolation;
8
+ itemHeight: number;
9
+ itemWidth: number;
10
+ itemVisibilityStore: ItemVisibilityStore;
11
+ loop: boolean;
12
+ }
13
+ declare const InternalContext: import("react").Context<InternalContextValue<any>>;
14
+ export default InternalContext;
@@ -0,0 +1,7 @@
1
+ import type { ReactElement } from 'react';
2
+ import { Animated } from 'react-native';
3
+ export interface ItemViewProps {
4
+ children: (interpolation: Animated.AnimatedInterpolation) => ReactElement | null;
5
+ index: number;
6
+ }
7
+ export default function ItemView(props: ItemViewProps): JSX.Element;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { ViewProps, View } from 'react-native';
3
+ import type { RenderItem } from '../types';
4
+ export declare type RootViewProps<ItemT> = ViewProps & {
5
+ data: ReadonlyArray<ItemT>;
6
+ itemHeight: number;
7
+ originalData: ReadonlyArray<ItemT>;
8
+ renderItem: RenderItem<ItemT>;
9
+ };
10
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<ViewProps & {
11
+ data: readonly any[];
12
+ itemHeight: number;
13
+ originalData: readonly any[];
14
+ renderItem: RenderItem<any>;
15
+ } & React.RefAttributes<View>>>;
16
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ import { Animated } from 'react-native';
3
+ import type { AutoplayController, StartPagingAnimation } from '../types';
4
+ export interface ScrollViewGestureProps {
5
+ autoplayController: AutoplayController;
6
+ children: ReactNode;
7
+ finalizeAnimation: () => void;
8
+ offsetTx: Animated.Value;
9
+ scrollEnabled: boolean;
10
+ startAnimation: StartPagingAnimation;
11
+ }
12
+ export default function ScrollViewGesture(props: ScrollViewGestureProps): JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { default as InternalContext } from './InternalContext';
2
+ export { default as ItemView } from './ItemView';
3
+ export { default as RootView } from './RootView';
4
+ export { default as ScrollViewGesture } from './ScrollViewGesture';
@@ -0,0 +1,7 @@
1
+ export { default as useAutoplayController } from './useAutoplayController';
2
+ export { default as useDimensionChangeReaction } from './useDimensionChangeReaction';
3
+ export { default as useIndexController } from './useIndexController';
4
+ export { default as useItemInterpolation } from './useItemInterpolation';
5
+ export { default as useLoopedData } from './useLoopedData';
6
+ export { default as usePagingAnimation } from './usePagingAnimation';
7
+ export { default as useItemVisibilityStore } from './useItemVisibilityStore';
@@ -0,0 +1,7 @@
1
+ import type { AutoplayController, StartPagingAnimation } from '../types';
2
+ export interface AutoplayConfig {
3
+ enabled: boolean;
4
+ intervalMillis: number;
5
+ startPagingAnimation: StartPagingAnimation;
6
+ }
7
+ export default function useAutoplayController(config: AutoplayConfig): AutoplayController;
@@ -0,0 +1,7 @@
1
+ import { Animated } from 'react-native';
2
+ export interface Parameters {
3
+ controlledTx: Animated.AnimatedValue;
4
+ currentIndex: number;
5
+ itemWidth: number;
6
+ }
7
+ export default function useDimensionChangeReaction(params: Parameters): void;
@@ -0,0 +1,10 @@
1
+ import { Animated } from 'react-native';
2
+ import type { IndexController } from '../types';
3
+ export interface UseIndexControllerParameters {
4
+ controlledTx: Animated.AnimatedValue;
5
+ initialIndex: number;
6
+ itemWidth: number;
7
+ numberOfOriginalData: number;
8
+ onIndexChange?: (newIndex: number) => void;
9
+ }
10
+ export default function useIndexController(params: UseIndexControllerParameters): IndexController;
@@ -0,0 +1,2 @@
1
+ import { Animated } from 'react-native';
2
+ export default function useItemInterpolation(index: number): Animated.AnimatedInterpolation;
@@ -0,0 +1,7 @@
1
+ import type { ItemVisibilityStore } from '../types';
2
+ export interface Parameters {
3
+ currentIndex: number;
4
+ numberOfData: number;
5
+ windowSize: number;
6
+ }
7
+ export default function useItemVisibilityStore(params: Parameters): ItemVisibilityStore;
@@ -0,0 +1 @@
1
+ export default function useLoopedData<ItemT>(originalData: ReadonlyArray<ItemT>, loop: boolean): ReadonlyArray<ItemT>;
@@ -0,0 +1,18 @@
1
+ import { Animated } from 'react-native';
2
+ import type { CreateScrollAnimation, GetCurrentIndex, StartPagingAnimation } from '../types';
3
+ export interface PagingAnimationConfig {
4
+ controlledTx: Animated.Value;
5
+ createScrollAnimation: CreateScrollAnimation;
6
+ getCurrentIndex: GetCurrentIndex;
7
+ itemWidth: number;
8
+ lastIndex: number;
9
+ loop: boolean;
10
+ numberOfData: number;
11
+ offsetTx: Animated.Value;
12
+ }
13
+ export interface UsePagingAnimation {
14
+ finalizeAnimation: () => void;
15
+ globalInterpolation: Animated.AnimatedInterpolation;
16
+ startAnimation: StartPagingAnimation;
17
+ }
18
+ export default function usePagingAnimation(config: PagingAnimationConfig): UsePagingAnimation;