@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
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = AnimatedY;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
11
 
@@ -13,7 +13,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
13
13
 
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
 
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ const ANIMATION_CONFIG = {
17
+ duration: 150,
18
+ easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.exp)
19
+ };
17
20
 
18
21
  function AnimatedY(props) {
19
22
  const {
@@ -21,24 +24,17 @@ function AnimatedY(props) {
21
24
  translateY,
22
25
  style
23
26
  } = props;
24
-
25
- const animatedY = _reactNativeReanimated.default.useSharedValue(translateY);
26
-
27
- const animatedStyle = _reactNativeReanimated.default.useAnimatedStyle(() => ({
27
+ const animatedY = (0, _reactNativeReanimated.useSharedValue)(translateY);
28
+ const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
28
29
  transform: [{
29
30
  translateY: animatedY.value
30
31
  }]
31
- }));
32
-
33
- _react.default.useEffect(() => {
32
+ }), []);
33
+ (0, _react.useEffect)(() => {
34
34
  if (translateY >= 0) {
35
- animatedY.value = _reactNativeReanimated.default.withTiming(translateY, {
36
- duration: 150,
37
- easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.exp)
38
- });
35
+ animatedY.value = (0, _reactNativeReanimated.withTiming)(translateY, ANIMATION_CONFIG);
39
36
  }
40
37
  }, [translateY]);
41
-
42
38
  return /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.View, {
43
39
  children: children,
44
40
  style: [animatedStyle, style]
@@ -1 +1 @@
1
- {"version":3,"sources":["AnimatedY.tsx"],"names":["AnimatedY","props","children","translateY","style","animatedY","Animated","useSharedValue","animatedStyle","useAnimatedStyle","transform","value","React","useEffect","withTiming","duration","easing","Easing","out","exp"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;AAGe,SAASA,SAAT,CAAmBC,KAAnB,EAA0C;AACrD,QAAM;AACFC,IAAAA,QADE;AAEFC,IAAAA,UAFE;AAGFC,IAAAA;AAHE,MAIFH,KAJJ;;AAMA,QAAMI,SAAS,GAAGC,+BAASC,cAAT,CAAwBJ,UAAxB,CAAlB;;AACA,QAAMK,aAAa,GAAGF,+BAASG,gBAAT,CAA0B,OAAO;AACnDC,IAAAA,SAAS,EAAE,CAAC;AAAEP,MAAAA,UAAU,EAAEE,SAAS,CAACM;AAAxB,KAAD;AADwC,GAAP,CAA1B,CAAtB;;AAIAC,iBAAMC,SAAN,CAAgB,MAAM;AAClB,QAAIV,UAAU,IAAI,CAAlB,EAAqB;AACjBE,MAAAA,SAAS,CAACM,KAAV,GAAkBL,+BAASQ,UAAT,CAAoBX,UAApB,EAAgC;AAC9CY,QAAAA,QAAQ,EAAE,GADoC;AAE9CC,QAAAA,MAAM,EAAEC,8BAAOC,GAAP,CAAWD,8BAAOE,GAAlB;AAFsC,OAAhC,CAAlB;AAIH;AACJ,GAPD,EAOG,CAAChB,UAAD,CAPH;;AASA,sBACI,6BAAC,8BAAD,CAAU,IAAV;AACI,IAAA,QAAQ,EAAED,QADd;AAEI,IAAA,KAAK,EAAE,CACHM,aADG,EAEHJ,KAFG;AAFX,IADJ;AASH;;AAAA","sourcesContent":["import React from 'react';\nimport Animated, { Easing } from 'react-native-reanimated';\nimport type AnimatedYProps from './AnimatedYProps';\n\nexport default function AnimatedY(props: AnimatedYProps) {\n const {\n children,\n translateY,\n style,\n } = props;\n\n const animatedY = Animated.useSharedValue(translateY);\n const animatedStyle = Animated.useAnimatedStyle(() => ({\n transform: [{ translateY: animatedY.value }],\n }));\n\n React.useEffect(() => {\n if (translateY >= 0) {\n animatedY.value = Animated.withTiming(translateY, {\n duration: 150,\n easing: Easing.out(Easing.exp),\n });\n }\n }, [translateY]);\n\n return (\n <Animated.View\n children={children}\n style={[\n animatedStyle,\n style,\n ]}\n />\n );\n};\n"]}
1
+ {"version":3,"names":["ANIMATION_CONFIG","duration","easing","Easing","out","exp","AnimatedY","props","children","translateY","style","animatedY","useSharedValue","animatedStyle","useAnimatedStyle","transform","value","useEffect","withTiming"],"sources":["AnimatedY.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport type AnimatedYProps from './AnimatedYProps';\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = {\n duration: 150,\n easing: Easing.out(Easing.exp),\n};\n\nexport default function AnimatedY(props: AnimatedYProps) {\n const {\n children,\n translateY,\n style,\n } = props;\n\n const animatedY = useSharedValue(translateY);\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: animatedY.value }],\n }), []);\n\n useEffect(() => {\n if (translateY >= 0) {\n animatedY.value = withTiming(translateY, ANIMATION_CONFIG);\n }\n }, [translateY]);\n\n return (\n <Animated.View\n children={children}\n style={[\n animatedStyle,\n style,\n ]}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AAGA,MAAMA,gBAA4C,GAAG;EACjDC,QAAQ,EAAE,GADuC;EAEjDC,MAAM,EAAEC,6BAAA,CAAOC,GAAP,CAAWD,6BAAA,CAAOE,GAAlB;AAFyC,CAArD;;AAKe,SAASC,SAAT,CAAmBC,KAAnB,EAA0C;EACrD,MAAM;IACFC,QADE;IAEFC,UAFE;IAGFC;EAHE,IAIFH,KAJJ;EAMA,MAAMI,SAAS,GAAG,IAAAC,qCAAA,EAAeH,UAAf,CAAlB;EACA,MAAMI,aAAa,GAAG,IAAAC,uCAAA,EAAiB,OAAO;IAC1CC,SAAS,EAAE,CAAC;MAAEN,UAAU,EAAEE,SAAS,CAACK;IAAxB,CAAD;EAD+B,CAAP,CAAjB,EAElB,EAFkB,CAAtB;EAIA,IAAAC,gBAAA,EAAU,MAAM;IACZ,IAAIR,UAAU,IAAI,CAAlB,EAAqB;MACjBE,SAAS,CAACK,KAAV,GAAkB,IAAAE,iCAAA,EAAWT,UAAX,EAAuBT,gBAAvB,CAAlB;IACH;EACJ,CAJD,EAIG,CAACS,UAAD,CAJH;EAMA,oBACI,6BAAC,8BAAD,CAAU,IAAV;IACI,QAAQ,EAAED,QADd;IAEI,KAAK,EAAE,CACHK,aADG,EAEHH,KAFG;EAFX,EADJ;AASH;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["AnimatedYProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ComponentProps } from '@fountain-ui/core';\n\nexport default interface AnimatedYProps extends ComponentProps<{\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The translate y value of the component.\n */\n translateY: number;\n}> {}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { default } from './AnimatedY';\nexport type { default as AnimatedYProps } from './AnimatedYProps';\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './AnimatedY';\nexport type { default as AnimatedYProps } from './AnimatedYProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -17,7 +17,7 @@ var _TransparentBackdrop = _interopRequireDefault(require("./TransparentBackdrop
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
20
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
21
 
22
22
  const NoHandle = () => null;
23
23
 
@@ -1 +1 @@
1
- {"version":3,"sources":["BottomSheetNative.tsx"],"names":["NoHandle","BottomSheet","props","backdropOpacity","children","index","onChange","snapPoints","indexRef","React","useRef","bottomSheetRef","handleChange","useCallback","newIndex","current","handleDismiss","useEffect","present","dismiss","snapToIndex","theme","shadow","modalStyle","backgroundColor","Platform","select","android","elevation","ios","web","boxShadow","backgroundStyle","palette","paper","default","isBackdropTransparent","OpacityAwareBackdrop","TransparentBackdrop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kBH;;AAAA","sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport { useTheme } from '@fountain-ui/styles';\nimport {\n BottomSheetBackdrop,\n BottomSheetBackdropProps,\n BottomSheetModal,\n BottomSheetModalProvider,\n} from '@gorhom/bottom-sheet';\nimport type BottomSheetProps from './BottomSheetProps';\nimport TransparentBackdrop from './TransparentBackdrop';\n\nconst NoHandle = () => null;\n\nexport default function BottomSheet(props: BottomSheetProps) {\n const {\n backdropOpacity = 0.5,\n children,\n index,\n onChange,\n snapPoints,\n } = props;\n\n const indexRef = React.useRef<number>(-1);\n const bottomSheetRef = React.useRef<BottomSheetModal | null>(null);\n\n const handleChange = React.useCallback((newIndex: number) => {\n indexRef.current = newIndex;\n\n if (onChange) {\n onChange(newIndex);\n }\n }, [onChange]);\n\n const handleDismiss = React.useCallback(() => {\n handleChange(-1);\n }, [handleChange]);\n\n React.useEffect(() => {\n if (index === indexRef.current) {\n return;\n }\n\n if (indexRef.current < 0 && index >= 0) {\n bottomSheetRef.current?.present();\n } else if (indexRef.current >= 0 && index < 0) {\n bottomSheetRef.current?.dismiss();\n } else {\n // @ts-ignore\n bottomSheetRef.current?.snapToIndex(index);\n }\n }, [index]);\n\n const theme = useTheme();\n const shadow = theme.shadow[12];\n const modalStyle = {\n backgroundColor: '#ffffff00',\n ...Platform.select<object>({\n android: shadow?.elevation,\n ios: shadow?.shadow,\n web: shadow?.boxShadow,\n }),\n };\n const backgroundStyle = {\n backgroundColor: theme.palette.paper.default,\n };\n\n const isBackdropTransparent = backdropOpacity <= 0;\n\n const OpacityAwareBackdrop = (props: BottomSheetBackdropProps) => (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n opacity={backdropOpacity}\n />\n );\n\n return (\n <BottomSheetModalProvider>\n <BottomSheetModal\n backdropComponent={isBackdropTransparent ? TransparentBackdrop : OpacityAwareBackdrop}\n // @ts-ignore\n backgroundStyle={backgroundStyle}\n index={index}\n handleComponent={NoHandle}\n onChange={handleChange}\n onDismiss={handleDismiss}\n ref={bottomSheetRef}\n snapPoints={snapPoints}\n style={modalStyle}\n >\n {children}\n </BottomSheetModal>\n </BottomSheetModalProvider>\n );\n};\n"]}
1
+ {"version":3,"names":["NoHandle","BottomSheet","props","backdropOpacity","children","index","onChange","snapPoints","indexRef","React","useRef","bottomSheetRef","handleChange","useCallback","newIndex","current","handleDismiss","useEffect","present","dismiss","snapToIndex","theme","useTheme","shadow","modalStyle","backgroundColor","Platform","select","android","elevation","ios","web","boxShadow","backgroundStyle","palette","paper","default","isBackdropTransparent","OpacityAwareBackdrop","TransparentBackdrop"],"sources":["BottomSheetNative.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport { useTheme } from '@fountain-ui/styles';\nimport {\n BottomSheetBackdrop,\n BottomSheetBackdropProps,\n BottomSheetModal,\n BottomSheetModalProvider,\n} from '@gorhom/bottom-sheet';\nimport type BottomSheetProps from './BottomSheetProps';\nimport TransparentBackdrop from './TransparentBackdrop';\n\nconst NoHandle = () => null;\n\nexport default function BottomSheet(props: BottomSheetProps) {\n const {\n backdropOpacity = 0.5,\n children,\n index,\n onChange,\n snapPoints,\n } = props;\n\n const indexRef = React.useRef<number>(-1);\n const bottomSheetRef = React.useRef<BottomSheetModal | null>(null);\n\n const handleChange = React.useCallback((newIndex: number) => {\n indexRef.current = newIndex;\n\n if (onChange) {\n onChange(newIndex);\n }\n }, [onChange]);\n\n const handleDismiss = React.useCallback(() => {\n handleChange(-1);\n }, [handleChange]);\n\n React.useEffect(() => {\n if (index === indexRef.current) {\n return;\n }\n\n if (indexRef.current < 0 && index >= 0) {\n bottomSheetRef.current?.present();\n } else if (indexRef.current >= 0 && index < 0) {\n bottomSheetRef.current?.dismiss();\n } else {\n // @ts-ignore\n bottomSheetRef.current?.snapToIndex(index);\n }\n }, [index]);\n\n const theme = useTheme();\n const shadow = theme.shadow[12];\n const modalStyle = {\n backgroundColor: '#ffffff00',\n ...Platform.select<object>({\n android: shadow?.elevation,\n ios: shadow?.shadow,\n web: shadow?.boxShadow,\n }),\n };\n const backgroundStyle = {\n backgroundColor: theme.palette.paper.default,\n };\n\n const isBackdropTransparent = backdropOpacity <= 0;\n\n const OpacityAwareBackdrop = (props: BottomSheetBackdropProps) => (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n opacity={backdropOpacity}\n />\n );\n\n return (\n <BottomSheetModalProvider>\n <BottomSheetModal\n backdropComponent={isBackdropTransparent ? TransparentBackdrop : OpacityAwareBackdrop}\n // @ts-ignore\n backgroundStyle={backgroundStyle}\n index={index}\n handleComponent={NoHandle}\n onChange={handleChange}\n onDismiss={handleDismiss}\n ref={bottomSheetRef}\n snapPoints={snapPoints}\n style={modalStyle}\n >\n {children}\n </BottomSheetModal>\n </BottomSheetModalProvider>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAOA;;;;;;AAEA,MAAMA,QAAQ,GAAG,MAAM,IAAvB;;AAEe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,eAAe,GAAG,GADhB;IAEFC,QAFE;IAGFC,KAHE;IAIFC,QAJE;IAKFC;EALE,IAMFL,KANJ;;EAQA,MAAMM,QAAQ,GAAGC,cAAA,CAAMC,MAAN,CAAqB,CAAC,CAAtB,CAAjB;;EACA,MAAMC,cAAc,GAAGF,cAAA,CAAMC,MAAN,CAAsC,IAAtC,CAAvB;;EAEA,MAAME,YAAY,GAAGH,cAAA,CAAMI,WAAN,CAAmBC,QAAD,IAAsB;IACzDN,QAAQ,CAACO,OAAT,GAAmBD,QAAnB;;IAEA,IAAIR,QAAJ,EAAc;MACVA,QAAQ,CAACQ,QAAD,CAAR;IACH;EACJ,CANoB,EAMlB,CAACR,QAAD,CANkB,CAArB;;EAQA,MAAMU,aAAa,GAAGP,cAAA,CAAMI,WAAN,CAAkB,MAAM;IAC1CD,YAAY,CAAC,CAAC,CAAF,CAAZ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AFpB;IAGI,iBAAiB,EAAE,CAAC,CAHxB;IAII,OAAO,EAAEC;EAJb,GADJ;;EASA,oBACI,6BAAC,qCAAD,qBACI,6BAAC,6BAAD;IACI,iBAAiB,EAAEkC,qBAAqB,GAAGE,4BAAH,GAAyBD,oBADrE,CAEI;IAFJ;IAGI,eAAe,EAAEL,eAHrB;IAII,KAAK,EAAE5B,KAJX;IAKI,eAAe,EAAEL,QALrB;IAMI,QAAQ,EAAEY,YANd;IAOI,SAAS,EAAEI,aAPf;IAQI,GAAG,EAAEL,cART;IASI,UAAU,EAAEJ,UAThB;IAUI,KAAK,EAAEiB;EAVX,GAYKpB,QAZL,CADJ,CADJ;AAkBH;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["BottomSheetProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ComponentProps } from '@fountain-ui/core';\n\nexport default interface BottomSheetProps extends ComponentProps<{\n /**\n * Opacity for BackdropComponent\n * @default 0.5\n */\n backdropOpacity?: number;\n\n /**\n * BottomSheet children, usually the included sub-components.\n */\n children?: React.ReactNode;\n\n /**\n * Snap index. You could also provide -1 to bottom sheet in closed state.\n */\n index: number;\n\n /**\n * Callback fired when the index is changed.\n * Important! Use memoized value.\n */\n onChange?: (newIndex: number) => void;\n\n /**\n * Points for the bottom sheet to snap to, points should be sorted from bottom to top.\n * Important! Use memoized value.\n */\n snapPoints: Array<number>;\n}> {}\n"],"mappings":""}
@@ -35,14 +35,10 @@ const useStyles = function () {
35
35
  };
36
36
 
37
37
  const calculateHeight = points => {
38
- var _points;
39
-
40
- return (_points = points[points.length - 1]) !== null && _points !== void 0 ? _points : 0;
38
+ return points[points.length - 1] ?? 0;
41
39
  };
42
40
 
43
41
  function BottomSheet(props) {
44
- var _snapPoints$index;
45
-
46
42
  const {
47
43
  backdropOpacity,
48
44
  children,
@@ -59,7 +55,7 @@ function BottomSheet(props) {
59
55
  };
60
56
 
61
57
  const height = calculateHeight(snapPoints);
62
- const translateY = height - ((_snapPoints$index = snapPoints[index]) !== null && _snapPoints$index !== void 0 ? _snapPoints$index : 0);
58
+ const translateY = height - (snapPoints[index] ?? 0);
63
59
  return /*#__PURE__*/_react.default.createElement(_core.Modal, {
64
60
  backdropOpacity: backdropOpacity,
65
61
  onClose: handleClose,
@@ -1 +1 @@
1
- {"version":3,"sources":["BottomSheetWeb.tsx"],"names":["useStyles","theme","root","justifyContent","zIndex","dialog","animated","alignSelf","maxWidth","width","paper","borderBottomLeftRadius","borderBottomRightRadius","flexGrow","overflow","calculateHeight","points","length","BottomSheet","props","backdropOpacity","children","index","onChange","snapPoints","styles","handleClose","height","translateY","StyleSheet","absoluteFill"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAKA,MAAMA,SAAuC,GAAG,YAA+B;AAC3E,QAAMC,KAAK,GAAG,qBAAd;AAEA,SAAO;AACHC,IAAAA,IAAI,EAAE;AACFC,MAAAA,cAAc,EAAE,UADd;AAEFC,MAAAA,MAAM,EAAEH,KAAK,CAACG,MAAN,CAAaC;AAFnB,KADH;AAKHC,IAAAA,QAAQ,EAAE;AACNC,MAAAA,SAAS,EAAE,QADL;AAENC,MAAAA,QAAQ,EAAE,GAFJ;AAGNC,MAAAA,KAAK,EAAE;AAHD,KALP;AAUHC,IAAAA,KAAK,EAAE;AACHC,MAAAA,sBAAsB,EAAE,CADrB;AAEHC,MAAAA,uBAAuB,EAAE,CAFtB;AAGHC,MAAAA,QAAQ,EAAE,CAHP;AAIHC,MAAAA,QAAQ,EAAE;AAJP;AAVJ,GAAP;AAiBH,CApBD;;AAsBA,MAAMC,eAAe,GAAIC,MAAD,IAAoD;AAAA;;AACxE,oBAAOA,MAAM,CAACA,MAAM,CAACC,MAAP,GAAgB,CAAjB,CAAb,6CAAoC,CAApC;AACH,CAFD;;AAIe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;AAAA;;AACzD,QAAM;AACFC,IAAAA,eADE;AAEFC,IAAAA,QAFE;AAGFC,IAAAA,KAHE;AAIFC,IAAAA,QAJE;AAKFC,IAAAA;AALE,MAMFL,KANJ;AAQA,QAAMM,MAAM,GAAGzB,SAAS,EAAxB;;AAEA,QAAM0B,WAAW,GAAG,MAAM;AACtB,QAAIH,QAAJ,EAAc;AACVA,MAAAA,QAAQ,CAAC,CAAC,CAAF,CAAR;AACH;AACJ,GAJD;;AAMA,QAAMI,MAAM,GAAGZ,eAAe,CAACS,UAAD,CAA9B;AACA,QAAMI,UAAU,GAAGD,MAAM,yBAAIH,UAAU,CAACF,KAAD,CAAd,iEAAyB,CAAzB,CAAzB;AAEA,sBACI,6BAAC,WAAD;AACI,IAAA,eAAe,EAAEF,eADrB;AAEI,IAAA,OAAO,EAAEM,WAFb;AAGI,IAAA,OAAO,EAAEJ,KAAK,IAAI,CAHtB;AAII,IAAA,KAAK,EAAE,eAAI,CAACO,iBAAWC,YAAZ,EAA0BL,MAAM,CAACvB,IAAjC,CAAJ;AAJX,kBAMI,6BAAC,kBAAD;AACI,IAAA,KAAK,EAAEuB,MAAM,CAACnB,QADlB;AAEI,IAAA,UAAU,EAAEsB;AAFhB,kBAII,6BAAC,WAAD;AACI,IAAA,SAAS,EAAE,EADf;AAEI,IAAA,KAAK,EAAE,CACHH,MAAM,CAACf,KADJ,EAEH;AAAEiB,MAAAA;AAAF,KAFG;AAFX,KAOKN,QAPL,CAJJ,CANJ,CADJ;AAuBH;;AAAA","sourcesContent":["import React from 'react';\nimport { Modal, Paper, StyleSheet, css, useTheme } from '@fountain-ui/core';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport AnimatedY from '../AnimatedY';\nimport type BottomSheetProps from './BottomSheetProps';\n\ntype BottomSheetStyles = NamedStylesStringUnion<'root' | 'animated' | 'paper'>;\n\nconst useStyles: UseStyles<BottomSheetStyles> = function (): BottomSheetStyles {\n const theme = useTheme();\n\n return {\n root: {\n justifyContent: 'flex-end',\n zIndex: theme.zIndex.dialog\n },\n animated: {\n alignSelf: 'center',\n maxWidth: 720,\n width: '100%',\n },\n paper: {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n flexGrow: 1,\n overflow: 'hidden',\n },\n };\n};\n\nconst calculateHeight = (points: BottomSheetProps['snapPoints']): number => {\n return points[points.length - 1] ?? 0;\n};\n\nexport default function BottomSheet(props: BottomSheetProps) {\n const {\n backdropOpacity,\n children,\n index,\n onChange,\n snapPoints,\n } = props;\n\n const styles = useStyles();\n\n const handleClose = () => {\n if (onChange) {\n onChange(-1);\n }\n };\n\n const height = calculateHeight(snapPoints);\n const translateY = height - (snapPoints[index] ?? 0);\n\n return (\n <Modal\n backdropOpacity={backdropOpacity}\n onClose={handleClose}\n visible={index >= 0}\n style={css([StyleSheet.absoluteFill, styles.root])}\n >\n <AnimatedY\n style={styles.animated}\n translateY={translateY}\n >\n <Paper\n elevation={12}\n style={[\n styles.paper,\n { height },\n ]}\n >\n {children}\n </Paper>\n </AnimatedY>\n </Modal>\n );\n};\n"]}
1
+ {"version":3,"names":["useStyles","theme","useTheme","root","justifyContent","zIndex","dialog","animated","alignSelf","maxWidth","width","paper","borderBottomLeftRadius","borderBottomRightRadius","flexGrow","overflow","calculateHeight","points","length","BottomSheet","props","backdropOpacity","children","index","onChange","snapPoints","styles","handleClose","height","translateY","css","StyleSheet","absoluteFill"],"sources":["BottomSheetWeb.tsx"],"sourcesContent":["import React from 'react';\nimport { Modal, Paper, StyleSheet, css, useTheme } from '@fountain-ui/core';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport AnimatedY from '../AnimatedY';\nimport type BottomSheetProps from './BottomSheetProps';\n\ntype BottomSheetStyles = NamedStylesStringUnion<'root' | 'animated' | 'paper'>;\n\nconst useStyles: UseStyles<BottomSheetStyles> = function (): BottomSheetStyles {\n const theme = useTheme();\n\n return {\n root: {\n justifyContent: 'flex-end',\n zIndex: theme.zIndex.dialog\n },\n animated: {\n alignSelf: 'center',\n maxWidth: 720,\n width: '100%',\n },\n paper: {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n flexGrow: 1,\n overflow: 'hidden',\n },\n };\n};\n\nconst calculateHeight = (points: BottomSheetProps['snapPoints']): number => {\n return points[points.length - 1] ?? 0;\n};\n\nexport default function BottomSheet(props: BottomSheetProps) {\n const {\n backdropOpacity,\n children,\n index,\n onChange,\n snapPoints,\n } = props;\n\n const styles = useStyles();\n\n const handleClose = () => {\n if (onChange) {\n onChange(-1);\n }\n };\n\n const height = calculateHeight(snapPoints);\n const translateY = height - (snapPoints[index] ?? 0);\n\n return (\n <Modal\n backdropOpacity={backdropOpacity}\n onClose={handleClose}\n visible={index >= 0}\n style={css([StyleSheet.absoluteFill, styles.root])}\n >\n <AnimatedY\n style={styles.animated}\n translateY={translateY}\n >\n <Paper\n elevation={12}\n style={[\n styles.paper,\n { height },\n ]}\n >\n {children}\n </Paper>\n </AnimatedY>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAKA,MAAMA,SAAuC,GAAG,YAA+B;EAC3E,MAAMC,KAAK,GAAG,IAAAC,cAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,cAAc,EAAE,UADd;MAEFC,MAAM,EAAEJ,KAAK,CAACI,MAAN,CAAaC;IAFnB,CADH;IAKHC,QAAQ,EAAE;MACNC,SAAS,EAAE,QADL;MAENC,QAAQ,EAAE,GAFJ;MAGNC,KAAK,EAAE;IAHD,CALP;IAUHC,KAAK,EAAE;MACHC,sBAAsB,EAAE,CADrB;MAEHC,uBAAuB,EAAE,CAFtB;MAGHC,QAAQ,EAAE,CAHP;MAIHC,QAAQ,EAAE;IAJP;EAVJ,CAAP;AAiBH,CApBD;;AAsBA,MAAMC,eAAe,GAAIC,MAAD,IAAoD;EACxE,OAAOA,MAAM,CAACA,MAAM,CAACC,MAAP,GAAgB,CAAjB,CAAN,IAA6B,CAApC;AACH,CAFD;;AAIe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,eADE;IAEFC,QAFE;IAGFC,KAHE;IAIFC,QAJE;IAKFC;EALE,IAMFL,KANJ;EAQA,MAAMM,MAAM,GAAG1B,SAAS,EAAxB;;EAEA,MAAM2B,WAAW,GAAG,MAAM;IACtB,IAAIH,QAAJ,EAAc;MACVA,QAAQ,CAAC,CAAC,CAAF,CAAR;IACH;EACJ,CAJD;;EAMA,MAAMI,MAAM,GAAGZ,eAAe,CAACS,UAAD,CAA9B;EACA,MAAMI,UAAU,GAAGD,MAAM,IAAIH,UAAU,CAACF,KAAD,CAAV,IAAqB,CAAzB,CAAzB;EAEA,oBACI,6BAAC,WAAD;IACI,eAAe,EAAEF,eADrB;IAEI,OAAO,EAAEM,WAFb;IAGI,OAAO,EAAEJ,KAAK,IAAI,CAHtB;IAII,KAAK,EAAE,IAAAO,SAAA,EAAI,CAACC,gBAAA,CAAWC,YAAZ,EAA0BN,MAAM,CAACvB,IAAjC,CAAJ;EAJX,gBAMI,6BAAC,kBAAD;IACI,KAAK,EAAEuB,MAAM,CAACnB,QADlB;IAEI,UAAU,EAAEsB;EAFhB,gBAII,6BAAC,WAAD;IACI,SAAS,EAAE,EADf;IAEI,KAAK,EAAE,CACHH,MAAM,CAACf,KADJ,EAEH;MAAEiB;IAAF,CAFG;EAFX,GAOKN,QAPL,CAJJ,CANJ,CADJ;AAuBH;;AAAA"}
@@ -13,7 +13,7 @@ var _styles = require("@fountain-ui/styles");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
17
 
18
18
  function TransparentBackdrop(props) {
19
19
  // The reason that it did not use the opacity prop is that the close event is ignored in Android. (opacity < 0.1)
@@ -1 +1 @@
1
- {"version":3,"sources":["TransparentBackdrop.tsx"],"names":["TransparentBackdrop","props","backdropStyle","backgroundColor","bottom","left","position","right","top"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAEe,SAASA,mBAAT,CAA6BC,KAA7B,EAA8D;AACzE;AACA,QAAMC,aAAa,GAAG,iBAAI,CACtB;AACIC,IAAAA,eAAe,EAAE,WADrB;AAEIC,IAAAA,MAAM,EAAE,CAFZ;AAGIC,IAAAA,IAAI,EAAE,CAHV;AAIIC,IAAAA,QAAQ,EAAE,UAJd;AAKIC,IAAAA,KAAK,EAAE,CALX;AAMIC,IAAAA,GAAG,EAAE;AANT,GADsB,CAAJ,CAAtB;AAWA,sBACI,6BAAC,gCAAD,eACQP,KADR;AAEI,IAAA,cAAc,EAAE,CAFpB;AAGI,IAAA,iBAAiB,EAAE,CAAC,CAHxB;AAII,IAAA,KAAK,EAAEC;AAJX,KADJ;AAQH;;AAAA","sourcesContent":["import React from 'react';\nimport { BottomSheetBackdrop, BottomSheetBackdropProps } from '@gorhom/bottom-sheet';\nimport { css } from '@fountain-ui/styles';\n\nexport default function TransparentBackdrop(props: BottomSheetBackdropProps) {\n // The reason that it did not use the opacity prop is that the close event is ignored in Android. (opacity < 0.1)\n const backdropStyle = css([\n {\n backgroundColor: '#ffffff00',\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n ]);\n\n return (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n style={backdropStyle}\n />\n );\n};"]}
1
+ {"version":3,"names":["TransparentBackdrop","props","backdropStyle","css","backgroundColor","bottom","left","position","right","top"],"sources":["TransparentBackdrop.tsx"],"sourcesContent":["import React from 'react';\nimport { BottomSheetBackdrop, BottomSheetBackdropProps } from '@gorhom/bottom-sheet';\nimport { css } from '@fountain-ui/styles';\n\nexport default function TransparentBackdrop(props: BottomSheetBackdropProps) {\n // The reason that it did not use the opacity prop is that the close event is ignored in Android. (opacity < 0.1)\n const backdropStyle = css([\n {\n backgroundColor: '#ffffff00',\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n ]);\n\n return (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n style={backdropStyle}\n />\n );\n};"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAEe,SAASA,mBAAT,CAA6BC,KAA7B,EAA8D;EACzE;EACA,MAAMC,aAAa,GAAG,IAAAC,WAAA,EAAI,CACtB;IACIC,eAAe,EAAE,WADrB;IAEIC,MAAM,EAAE,CAFZ;IAGIC,IAAI,EAAE,CAHV;IAIIC,QAAQ,EAAE,UAJd;IAKIC,KAAK,EAAE,CALX;IAMIC,GAAG,EAAE;EANT,CADsB,CAAJ,CAAtB;EAWA,oBACI,6BAAC,gCAAD,eACQR,KADR;IAEI,cAAc,EAAE,CAFpB;IAGI,iBAAiB,EAAE,CAAC,CAHxB;IAII,KAAK,EAAEC;EAJX,GADJ;AAQH;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { default } from './BottomSheetWeb';\nexport type { default as BottomSheetProps } from './BottomSheetProps';\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './BottomSheetWeb';\nexport type { default as BottomSheetProps } from './BottomSheetProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.native.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { default } from './BottomSheetNative';\n"]}
1
+ {"version":3,"names":[],"sources":["index.native.ts"],"sourcesContent":["export { default } from './BottomSheetNative';\n"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _ViewabilityTrackerView = _interopRequireDefault(require("../ViewabilityTrackerView"));
13
+
14
+ var _hooks = require("./hooks");
15
+
16
+ var _animation = require("./animation");
17
+
18
+ var _components = require("./components");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ const Carousel = /*#__PURE__*/(0, _react.forwardRef)(function Carousel(props, ref) {
27
+ const {
28
+ autoplay = false,
29
+ autoplayInterval = 3000,
30
+ createItemStyle = _animation.createDefaultItemStyle,
31
+ createScrollAnimation = _animation.createDefaultScrollAnimation,
32
+ data: originalData,
33
+ disableSmartAutoplay = false,
34
+ initialIndex = 0,
35
+ itemHeight,
36
+ itemWidth,
37
+ loop = false,
38
+ onIndexChange,
39
+ renderItem,
40
+ scrollEnabled = true,
41
+ style,
42
+ windowSize = 5
43
+ } = props;
44
+ const data = (0, _hooks.useLoopedData)(originalData, loop);
45
+ const initialTx = itemWidth * initialIndex;
46
+ const controlledTx = (0, _react.useRef)(new _reactNative.Animated.Value(initialTx)).current;
47
+ const offsetTx = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
48
+ const {
49
+ currentIndex,
50
+ getCurrentIndex,
51
+ lastIndex,
52
+ monitorElement
53
+ } = (0, _hooks.useIndexController)({
54
+ controlledTx,
55
+ initialIndex,
56
+ itemWidth,
57
+ numberOfOriginalData: originalData.length,
58
+ onIndexChange
59
+ });
60
+ const itemVisibilityStore = (0, _hooks.useItemVisibilityStore)({
61
+ currentIndex,
62
+ numberOfData: data.length,
63
+ windowSize
64
+ });
65
+ const {
66
+ finalizeAnimation,
67
+ globalInterpolation,
68
+ startAnimation
69
+ } = (0, _hooks.usePagingAnimation)({
70
+ controlledTx,
71
+ createScrollAnimation,
72
+ getCurrentIndex,
73
+ itemWidth,
74
+ lastIndex,
75
+ loop,
76
+ numberOfData: data.length,
77
+ offsetTx
78
+ });
79
+ const autoplayController = (0, _hooks.useAutoplayController)({
80
+ enabled: autoplay,
81
+ intervalMillis: autoplayInterval,
82
+ startPagingAnimation: startAnimation
83
+ });
84
+ (0, _hooks.useDimensionChangeReaction)({
85
+ controlledTx,
86
+ currentIndex,
87
+ itemWidth
88
+ });
89
+ (0, _react.useImperativeHandle)(ref, () => ({
90
+ next: () => startAnimation('next'),
91
+ prev: () => startAnimation('prev'),
92
+ getCurrentIndex
93
+ }), [startAnimation, getCurrentIndex]);
94
+ const contextValue = (0, _react.useMemo)(() => ({
95
+ createItemStyle,
96
+ data,
97
+ globalInterpolation,
98
+ itemHeight,
99
+ itemWidth,
100
+ itemVisibilityStore,
101
+ loop
102
+ }), [createItemStyle, data, globalInterpolation, itemHeight, itemWidth, itemVisibilityStore, loop]);
103
+ return /*#__PURE__*/_react.default.createElement(_components.InternalContext.Provider, {
104
+ value: contextValue
105
+ }, monitorElement, /*#__PURE__*/_react.default.createElement(_ViewabilityTrackerView.default, {
106
+ enabled: autoplay && !disableSmartAutoplay,
107
+ measurementIntervalMillis: Math.max(3000, autoplayInterval),
108
+ onViewabilityChange: _ref => {
109
+ let {
110
+ visible
111
+ } = _ref;
112
+
113
+ if (visible) {
114
+ autoplayController.resume();
115
+ } else {
116
+ autoplayController.pause();
117
+ }
118
+ }
119
+ }, /*#__PURE__*/_react.default.createElement(_components.ScrollViewGesture, {
120
+ autoplayController: autoplayController,
121
+ finalizeAnimation: finalizeAnimation,
122
+ offsetTx: offsetTx,
123
+ scrollEnabled: scrollEnabled,
124
+ startAnimation: startAnimation
125
+ }, /*#__PURE__*/_react.default.createElement(_components.RootView, {
126
+ data: data,
127
+ itemHeight: itemHeight,
128
+ originalData: originalData,
129
+ renderItem: renderItem,
130
+ style: style
131
+ }))));
132
+ });
133
+
134
+ var _default = /*#__PURE__*/(0, _react.memo)(Carousel);
135
+
136
+ exports.default = _default;
137
+ //# sourceMappingURL=Carousel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Carousel","forwardRef","props","ref","autoplay","autoplayInterval","createItemStyle","createDefaultItemStyle","createScrollAnimation","createDefaultScrollAnimation","data","originalData","disableSmartAutoplay","initialIndex","itemHeight","itemWidth","loop","onIndexChange","renderItem","scrollEnabled","style","windowSize","useLoopedData","initialTx","controlledTx","useRef","Animated","Value","current","offsetTx","currentIndex","getCurrentIndex","lastIndex","monitorElement","useIndexController","numberOfOriginalData","length","itemVisibilityStore","useItemVisibilityStore","numberOfData","finalizeAnimation","globalInterpolation","startAnimation","usePagingAnimation","autoplayController","useAutoplayController","enabled","intervalMillis","startPagingAnimation","useDimensionChangeReaction","useImperativeHandle","next","prev","contextValue","useMemo","Math","max","visible","resume","pause","memo"],"sources":["Carousel.tsx"],"sourcesContent":["import React, { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport ViewabilityTrackerView from '../ViewabilityTrackerView';\nimport type CarouselProps from './CarouselProps';\nimport type { CarouselInstance } from './types';\nimport {\n useAutoplayController,\n useDimensionChangeReaction,\n useIndexController,\n useItemVisibilityStore,\n useLoopedData,\n usePagingAnimation,\n} from './hooks';\nimport { createDefaultItemStyle, createDefaultScrollAnimation } from './animation';\nimport { InternalContext, RootView, ScrollViewGesture } from './components';\n\nconst Carousel = forwardRef<CarouselInstance, CarouselProps>(function Carousel(props, ref) {\n const {\n autoplay = false,\n autoplayInterval = 3000,\n createItemStyle = createDefaultItemStyle,\n createScrollAnimation = createDefaultScrollAnimation,\n data: originalData,\n disableSmartAutoplay = false,\n initialIndex = 0,\n itemHeight,\n itemWidth,\n loop = false,\n onIndexChange,\n renderItem,\n scrollEnabled = true,\n style,\n windowSize = 5,\n } = props;\n\n const data = useLoopedData(originalData, loop);\n\n const initialTx = itemWidth * initialIndex;\n const controlledTx = useRef(new Animated.Value(initialTx)).current;\n const offsetTx = useRef(new Animated.Value(0)).current;\n\n const {\n currentIndex,\n getCurrentIndex,\n lastIndex,\n monitorElement,\n } = useIndexController({\n controlledTx,\n initialIndex,\n itemWidth,\n numberOfOriginalData: originalData.length,\n onIndexChange,\n });\n\n const itemVisibilityStore = useItemVisibilityStore({\n currentIndex,\n numberOfData: data.length,\n windowSize,\n });\n\n const {\n finalizeAnimation,\n globalInterpolation,\n startAnimation,\n } = usePagingAnimation({\n controlledTx,\n createScrollAnimation,\n getCurrentIndex,\n itemWidth,\n lastIndex,\n loop,\n numberOfData: data.length,\n offsetTx,\n });\n\n const autoplayController = useAutoplayController({\n enabled: autoplay,\n intervalMillis: autoplayInterval,\n startPagingAnimation: startAnimation,\n });\n\n useDimensionChangeReaction({\n controlledTx,\n currentIndex,\n itemWidth,\n });\n\n useImperativeHandle(\n ref,\n () => ({\n next: () => startAnimation('next'),\n prev: () => startAnimation('prev'),\n getCurrentIndex,\n }),\n [startAnimation, getCurrentIndex],\n );\n\n const contextValue = useMemo(() => ({\n createItemStyle,\n data,\n globalInterpolation,\n itemHeight,\n itemWidth,\n itemVisibilityStore,\n loop,\n }), [\n createItemStyle,\n data,\n globalInterpolation,\n itemHeight,\n itemWidth,\n itemVisibilityStore,\n loop,\n ]);\n\n return (\n <InternalContext.Provider value={contextValue}>\n {monitorElement}\n\n <ViewabilityTrackerView\n enabled={autoplay && !disableSmartAutoplay}\n measurementIntervalMillis={Math.max(3000, autoplayInterval)}\n onViewabilityChange={({ visible }) => {\n if (visible) {\n autoplayController.resume();\n } else {\n autoplayController.pause();\n }\n }}\n >\n <ScrollViewGesture\n autoplayController={autoplayController}\n finalizeAnimation={finalizeAnimation}\n offsetTx={offsetTx}\n scrollEnabled={scrollEnabled}\n startAnimation={startAnimation}\n >\n <RootView\n data={data}\n itemHeight={itemHeight}\n originalData={originalData}\n renderItem={renderItem}\n style={style}\n />\n </ScrollViewGesture>\n </ViewabilityTrackerView>\n </InternalContext.Provider>\n );\n});\n\nexport default memo(Carousel);\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAGA;;AAQA;;AACA;;;;;;;;AAEA,MAAMA,QAAQ,gBAAG,IAAAC,iBAAA,EAA4C,SAASD,QAAT,CAAkBE,KAAlB,EAAyBC,GAAzB,EAA8B;EACvF,MAAM;IACFC,QAAQ,GAAG,KADT;IAEFC,gBAAgB,GAAG,IAFjB;IAGFC,eAAe,GAAGC,iCAHhB;IAIFC,qBAAqB,GAAGC,uCAJtB;IAKFC,IAAI,EAAEC,YALJ;IAMFC,oBAAoB,GAAG,KANrB;IAOFC,YAAY,GAAG,CAPb;IAQFC,UARE;IASFC,SATE;IAUFC,IAAI,GAAG,KAVL;IAWFC,aAXE;IAYFC,UAZE;IAaFC,aAAa,GAAG,IAbd;IAcFC,KAdE;IAeFC,UAAU,GAAG;EAfX,IAgBFnB,KAhBJ;EAkBA,MAAMQ,IAAI,GAAG,IAA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 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["CarouselProps.ts"],"sourcesContent":["import type { RefObject } from 'react';\nimport type { ComponentProps } from '@fountain-ui/core';\nimport type { CarouselInstance, CreateItemStyle, CreateScrollAnimation, RenderItem } from './types';\n\nexport default interface CarouselProps<ItemT = any> extends ComponentProps<{\n ref?: RefObject<CarouselInstance>;\n\n /**\n * If `true`, enable autoplay.\n * @default false\n */\n autoplay?: boolean;\n\n /**\n * Delay in ms until navigating to the next item.\n * @default 3000\n */\n autoplayInterval?: number;\n\n /**\n * The item style creator function.\n * @default createDefaultItemStyle\n */\n createItemStyle?: CreateItemStyle;\n\n /**\n * The scroll animation creator function.\n * @default createDefaultScrollAnimation\n */\n createScrollAnimation?: CreateScrollAnimation;\n\n /**\n * Data for render items.\n */\n data: ReadonlyArray<ItemT>;\n\n /**\n * If `true`, carousel will detect its own viewability and control autoplay automatically.\n * @default false\n */\n disableSmartAutoplay?: boolean;\n\n /**\n * Index of initial item that should be selected.\n * @default 0\n */\n initialIndex?: number;\n\n /**\n * The item width.\n */\n itemHeight: number;\n\n /**\n * The item width.\n */\n itemWidth: number;\n\n /**\n * Enable infinite loop mode.\n * @default false\n */\n loop?: boolean;\n\n /**\n * Callback fired when an index is changed.\n */\n onIndexChange?: (newIndex: number) => void;\n\n /**\n * Takes an item from data and renders it into the list.\n */\n renderItem: RenderItem<ItemT>;\n\n /**\n * Whether to enable scroll gesture.\n * @default true\n */\n scrollEnabled?: boolean;\n\n /**\n * The maximum number of items that can respond to pan gesture events.\n * Due to the nature of the `active` item, it accepts only odd number. (e.g. 1, 3, 5...)\n * 0 means all items will respond to pan gesture events.\n * @default 5\n */\n windowSize?: number;\n}> {}\n"],"mappings":""}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.itemInterpolationInputRange = void 0;
7
+ const itemInterpolationInputRange = [-1, 0, 1];
8
+ exports.itemInterpolationInputRange = itemInterpolationInputRange;
9
+ //# sourceMappingURL=animationUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["itemInterpolationInputRange"],"sources":["animationUtils.ts"],"sourcesContent":["export const itemInterpolationInputRange = [-1, 0, 1];\n"],"mappings":";;;;;;AAAO,MAAMA,2BAA2B,GAAG,CAAC,CAAC,CAAF,EAAK,CAAL,EAAQ,CAAR,CAApC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _normalItemStyleFactory = _interopRequireDefault(require("./normalItemStyleFactory"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ var _default = (0, _normalItemStyleFactory.default)();
13
+
14
+ exports.default = _default;
15
+ //# sourceMappingURL=createDefaultItemStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalItemStyleFactory"],"sources":["createDefaultItemStyle.ts"],"sourcesContent":["import normalItemStyleFactory from './normalItemStyleFactory';\n\nexport default normalItemStyleFactory();\n"],"mappings":";;;;;;;AAAA;;;;eAEe,IAAAA,+BAAA,G"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = createDefaultScrollAnimation;
7
+
8
+ var _reactNative = require("react-native");
9
+
10
+ function createDefaultScrollAnimation(animatedValue, toValue) {
11
+ return _reactNative.Animated.timing(animatedValue, {
12
+ toValue: toValue,
13
+ duration: 350,
14
+ easing: _reactNative.Easing.bezier(0.25, 1, 0.5, 1),
15
+ useNativeDriver: true
16
+ });
17
+ }
18
+
19
+ ;
20
+ //# sourceMappingURL=createDefaultScrollAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createDefaultScrollAnimation","animatedValue","toValue","Animated","timing","duration","easing","Easing","bezier","useNativeDriver"],"sources":["createDefaultScrollAnimation.ts"],"sourcesContent":["import { Animated, Easing } from 'react-native';\n\nexport default function createDefaultScrollAnimation(\n animatedValue: Animated.Value,\n toValue: number,\n): Animated.CompositeAnimation {\n return Animated.timing(animatedValue, {\n toValue: toValue,\n duration: 350,\n easing: Easing.bezier(0.25, 1, 0.5, 1),\n useNativeDriver: true,\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAEe,SAASA,4BAAT,CACXC,aADW,EAEXC,OAFW,EAGgB;EAC3B,OAAOC,qBAAA,CAASC,MAAT,CAAgBH,aAAhB,EAA+B;IAClCC,OAAO,EAAEA,OADyB;IAElCG,QAAQ,EAAE,GAFwB;IAGlCC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAAd,EAAoB,CAApB,EAAuB,GAAvB,EAA4B,CAA5B,CAH0B;IAIlCC,eAAe,EAAE;EAJiB,CAA/B,CAAP;AAMH;;AAAA"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "createDefaultItemStyle", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _createDefaultItemStyle.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "createDefaultScrollAnimation", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _createDefaultScrollAnimation.default;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "normalItemStyleFactory", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _normalItemStyleFactory.default;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "parallaxItemStyleFactory", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _parallaxItemStyleFactory.default;
28
+ }
29
+ });
30
+
31
+ var _createDefaultItemStyle = _interopRequireDefault(require("./createDefaultItemStyle"));
32
+
33
+ var _createDefaultScrollAnimation = _interopRequireDefault(require("./createDefaultScrollAnimation"));
34
+
35
+ var _normalItemStyleFactory = _interopRequireDefault(require("./normalItemStyleFactory"));
36
+
37
+ var _parallaxItemStyleFactory = _interopRequireDefault(require("./parallaxItemStyleFactory"));
38
+
39
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as createDefaultItemStyle } from './createDefaultItemStyle';\nexport { default as createDefaultScrollAnimation } from './createDefaultScrollAnimation';\nexport { default as normalItemStyleFactory } from './normalItemStyleFactory';\nexport { default as parallaxItemStyleFactory } from './parallaxItemStyleFactory';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = normalItemStyleFactory;
7
+
8
+ var _animationUtils = require("./animationUtils");
9
+
10
+ function normalItemStyleFactory() {
11
+ const createItemStyle = (itemInterpolation, itemWidth) => {
12
+ const translate = itemInterpolation.interpolate({
13
+ inputRange: _animationUtils.itemInterpolationInputRange,
14
+ outputRange: [-itemWidth, 0, itemWidth]
15
+ });
16
+ return {
17
+ transform: [{
18
+ translateX: translate
19
+ }]
20
+ };
21
+ };
22
+
23
+ return createItemStyle;
24
+ }
25
+
26
+ ;
27
+ //# sourceMappingURL=normalItemStyleFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalItemStyleFactory","createItemStyle","itemInterpolation","itemWidth","translate","interpolate","inputRange","itemInterpolationInputRange","outputRange","transform","translateX"],"sources":["normalItemStyleFactory.ts"],"sourcesContent":["import type { CreateItemStyle } from '../types';\nimport { itemInterpolationInputRange } from './animationUtils';\n\nexport default function normalItemStyleFactory() {\n const createItemStyle: CreateItemStyle = (itemInterpolation, itemWidth) => {\n const translate = itemInterpolation.interpolate({\n inputRange: itemInterpolationInputRange,\n outputRange: [\n -itemWidth,\n 0,\n itemWidth,\n ],\n });\n\n return { transform: [{ translateX: translate }] };\n };\n\n return createItemStyle;\n};\n"],"mappings":";;;;;;;AACA;;AAEe,SAASA,sBAAT,GAAkC;EAC7C,MAAMC,eAAgC,GAAG,CAACC,iBAAD,EAAoBC,SAApB,KAAkC;IACvE,MAAMC,SAAS,GAAGF,iBAAiB,CAACG,WAAlB,CAA8B;MAC5CC,UAAU,EAAEC,2CADgC;MAE5CC,WAAW,EAAE,CACT,CAACL,SADQ,EAET,CAFS,EAGTA,SAHS;IAF+B,CAA9B,CAAlB;IASA,OAAO;MAAEM,SAAS,EAAE,CAAC;QAAEC,UAAU,EAAEN;MAAd,CAAD;IAAb,CAAP;EACH,CAXD;;EAaA,OAAOH,eAAP;AACH;;AAAA"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = parallaxItemStyleFactory;
7
+
8
+ var _animationUtils = require("./animationUtils");
9
+
10
+ const defaultParallaxAnimationConfig = {
11
+ parallaxActiveItemScale: 0.9,
12
+ parallaxActiveItemOpacity: 1,
13
+ parallaxAdjacentItemScale: Math.pow(0.9, 2),
14
+ parallaxAdjacentItemOpacity: 0.5,
15
+ parallaxScrollingOffset: 50
16
+ };
17
+
18
+ function parallaxItemStyleFactory() {
19
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultParallaxAnimationConfig;
20
+ const {
21
+ parallaxActiveItemScale,
22
+ parallaxActiveItemOpacity,
23
+ parallaxAdjacentItemOpacity,
24
+ parallaxAdjacentItemScale,
25
+ parallaxScrollingOffset
26
+ } = { ...config,
27
+ ...defaultParallaxAnimationConfig
28
+ };
29
+
30
+ const createItemStyle = (itemInterpolation, itemWidth) => {
31
+ const translate = itemInterpolation.interpolate({
32
+ inputRange: _animationUtils.itemInterpolationInputRange,
33
+ outputRange: [-itemWidth + parallaxScrollingOffset, 0, itemWidth - parallaxScrollingOffset]
34
+ });
35
+ const zIndex = itemInterpolation.interpolate({
36
+ inputRange: _animationUtils.itemInterpolationInputRange,
37
+ outputRange: [0, itemWidth, 0],
38
+ extrapolate: 'clamp'
39
+ });
40
+ const scale = itemInterpolation.interpolate({
41
+ inputRange: _animationUtils.itemInterpolationInputRange,
42
+ outputRange: [parallaxAdjacentItemScale, parallaxActiveItemScale, parallaxAdjacentItemScale],
43
+ extrapolate: 'clamp'
44
+ });
45
+ const opacity = itemInterpolation.interpolate({
46
+ inputRange: _animationUtils.itemInterpolationInputRange,
47
+ outputRange: [parallaxAdjacentItemOpacity, parallaxActiveItemOpacity, parallaxAdjacentItemOpacity],
48
+ extrapolate: 'clamp'
49
+ });
50
+ return {
51
+ transform: [{
52
+ translateX: translate
53
+ }, {
54
+ scale
55
+ }],
56
+ zIndex,
57
+ opacity
58
+ };
59
+ };
60
+
61
+ return createItemStyle;
62
+ }
63
+
64
+ ;
65
+ //# sourceMappingURL=parallaxItemStyleFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["defaultParallaxAnimationConfig","parallaxActiveItemScale","parallaxActiveItemOpacity","parallaxAdjacentItemScale","Math","pow","parallaxAdjacentItemOpacity","parallaxScrollingOffset","parallaxItemStyleFactory","config","createItemStyle","itemInterpolation","itemWidth","translate","interpolate","inputRange","itemInterpolationInputRange","outputRange","zIndex","extrapolate","scale","opacity","transform","translateX"],"sources":["parallaxItemStyleFactory.ts"],"sourcesContent":["import type { CreateItemStyle } from '../types';\nimport { itemInterpolationInputRange } from './animationUtils';\n\nexport interface ParallaxAnimationConfig {\n parallaxActiveItemScale?: number;\n parallaxActiveItemOpacity?: number;\n parallaxAdjacentItemScale?: number;\n parallaxAdjacentItemOpacity?: number;\n parallaxScrollingOffset?: number;\n}\n\nconst defaultParallaxAnimationConfig: Required<Readonly<ParallaxAnimationConfig>> = {\n parallaxActiveItemScale: 0.9,\n parallaxActiveItemOpacity: 1,\n parallaxAdjacentItemScale: Math.pow(0.9, 2),\n parallaxAdjacentItemOpacity: 0.5,\n parallaxScrollingOffset: 50,\n};\n\nexport default function parallaxItemStyleFactory(config: ParallaxAnimationConfig = defaultParallaxAnimationConfig) {\n const {\n parallaxActiveItemScale,\n parallaxActiveItemOpacity,\n parallaxAdjacentItemOpacity,\n parallaxAdjacentItemScale,\n parallaxScrollingOffset,\n }: Required<ParallaxAnimationConfig> = {\n ...config,\n ...defaultParallaxAnimationConfig,\n };\n\n const createItemStyle: CreateItemStyle = (itemInterpolation, itemWidth) => {\n const translate = itemInterpolation.interpolate({\n inputRange: itemInterpolationInputRange,\n outputRange: [\n -itemWidth + parallaxScrollingOffset,\n 0,\n itemWidth - parallaxScrollingOffset,\n ],\n });\n\n const zIndex = itemInterpolation.interpolate({\n inputRange: itemInterpolationInputRange,\n outputRange: [0, itemWidth, 0],\n extrapolate: 'clamp',\n });\n\n const scale = itemInterpolation.interpolate({\n inputRange: itemInterpolationInputRange,\n outputRange: [\n parallaxAdjacentItemScale,\n parallaxActiveItemScale,\n parallaxAdjacentItemScale,\n ],\n extrapolate: 'clamp',\n });\n\n const opacity = itemInterpolation.interpolate({\n inputRange: itemInterpolationInputRange,\n outputRange: [\n parallaxAdjacentItemOpacity,\n parallaxActiveItemOpacity,\n parallaxAdjacentItemOpacity,\n ],\n extrapolate: 'clamp',\n });\n\n return {\n transform: [\n { translateX: translate },\n { scale },\n ],\n zIndex,\n opacity,\n };\n };\n\n return createItemStyle;\n};\n"],"mappings":";;;;;;;AACA;;AAUA,MAAMA,8BAA2E,GAAG;EAChFC,uBAAuB,EAAE,GADuD;EAEhFC,yBAAyB,EAAE,CAFqD;EAGhFC,yBAAyB,EAAEC,IAAI,CAACC,GAAL,CAAS,GAAT,EAAc,CAAd,CAHqD;EAIhFC,2BAA2B,EAAE,GAJmD;EAKhFC,uBAAuB,EAAE;AALuD,CAApF;;AAQe,SAASC,wBAAT,GAAoG;EAAA,IAAlEC,MAAkE,uEAAhCT,8BAAgC;EAC/G,MAAM;IACFC,uBADE;IAEFC,yBAFE;IAGFI,2BAHE;IAIFH,yBAJE;IAKFI;EALE,IAMiC,EACnC,GAAGE,MADgC;IAEnC,GAAGT;EAFgC,CANvC;;EAWA,MAAMU,eAAgC,GAAG,CAACC,iBAAD,EAAoBC,SAApB,KAAkC;IACvE,MAAMC,SAAS,GAAGF,iBAAiB,CAACG,WAAlB,CAA8B;MAC5CC,UAAU,EAAEC,2CADgC;MAE5CC,WAAW,EAAE,CACT,CAACL,SAAD,GAAaL,uBADJ,EAET,CAFS,EAGTK,SAAS,GAAGL,uBAHH;IAF+B,CAA9B,CAAlB;IASA,MAAMW,MAAM,GAAGP,iBAAiB,CAACG,WAAlB,CAA8B;MACzCC,UAAU,EAAEC,2CAD6B;MAEzCC,WAAW,EAAE,CAAC,CAAD,EAAIL,SAAJ,EAAe,CAAf,CAF4B;MAGzCO,WAAW,EAAE;IAH4B,CAA9B,CAAf;IAMA,MAAMC,KAAK,GAAGT,iBAAiB,CAACG,WAAlB,CAA8B;MACxCC,UAAU,EAAEC,2CAD4B;MAExCC,WAAW,EAAE,CACTd,yBADS,EAETF,uBAFS,EAGTE,yBAHS,CAF2B;MAOxCgB,WAAW,EAAE;IAP2B,CAA9B,CAAd;IAUA,MAAME,OAAO,GAAGV,iBAAiB,CAACG,WAAlB,CAA8B;MAC1CC,UAAU,EAAEC,2CAD8B;MAE1CC,WAAW,EAAE,CACTX,2BADS,EAETJ,yBAFS,EAGTI,2BAHS,CAF6B;MAO1Ca,WAAW,EAAE;IAP6B,CAA9B,CAAhB;IAUA,OAAO;MACHG,SAAS,EAAE,CACP;QAAEC,UAAU,EAAEV;MAAd,CADO,EAEP;QAAEO;MAAF,CAFO,CADR;MAKHF,MALG;MAMHG;IANG,CAAP;EAQH,CA5CD;;EA8CA,OAAOX,eAAP;AACH;;AAAA"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ const mockItemVisibilityStore = {
13
+ dispatch: () => void 0,
14
+ subscribe: () => () => void 0,
15
+ removeAllListeners: () => void 0
16
+ };
17
+ const initialValue = {
18
+ createItemStyle: () => ({}),
19
+ data: [],
20
+ globalInterpolation: _reactNative.Animated.add(new _reactNative.Animated.Value(0), 0),
21
+ itemHeight: 0,
22
+ itemWidth: 0,
23
+ itemVisibilityStore: mockItemVisibilityStore,
24
+ loop: false
25
+ };
26
+ const InternalContext = /*#__PURE__*/(0, _react.createContext)(initialValue);
27
+ var _default = InternalContext;
28
+ exports.default = _default;
29
+ //# sourceMappingURL=InternalContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["mockItemVisibilityStore","dispatch","subscribe","removeAllListeners","initialValue","createItemStyle","data","globalInterpolation","Animated","add","Value","itemHeight","itemWidth","itemVisibilityStore","loop","InternalContext","createContext"],"sources":["InternalContext.ts"],"sourcesContent":["import { createContext } from 'react';\nimport { Animated } from 'react-native';\nimport type { CreateItemStyle, ItemVisibilityStore } from '../types';\n\nexport interface InternalContextValue<ItemT> {\n createItemStyle: CreateItemStyle;\n data: ReadonlyArray<ItemT>;\n globalInterpolation: Animated.AnimatedInterpolation;\n itemHeight: number;\n itemWidth: number;\n itemVisibilityStore: ItemVisibilityStore;\n loop: boolean;\n}\n\nconst mockItemVisibilityStore: ItemVisibilityStore = {\n dispatch: () => void 0,\n subscribe: () => () => void 0,\n removeAllListeners: () => void 0,\n};\n\nconst initialValue: Readonly<InternalContextValue<any>> = {\n createItemStyle: () => ({}),\n data: [],\n globalInterpolation: Animated.add(new Animated.Value(0), 0),\n itemHeight: 0,\n itemWidth: 0,\n itemVisibilityStore: mockItemVisibilityStore,\n loop: false,\n};\n\nconst InternalContext = createContext<InternalContextValue<any>>(initialValue);\n\nexport default InternalContext;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAaA,MAAMA,uBAA4C,GAAG;EACjDC,QAAQ,EAAE,MAAM,KAAK,CAD4B;EAEjDC,SAAS,EAAE,MAAM,MAAM,KAAK,CAFqB;EAGjDC,kBAAkB,EAAE,MAAM,KAAK;AAHkB,CAArD;AAMA,MAAMC,YAAiD,GAAG;EACtDC,eAAe,EAAE,OAAO,EAAP,CADqC;EAEtDC,IAAI,EAAE,EAFgD;EAGtDC,mBAAmB,EAAEC,qBAAA,CAASC,GAAT,CAAa,IAAID,qBAAA,CAASE,KAAb,CAAmB,CAAnB,CAAb,EAAoC,CAApC,CAHiC;EAItDC,UAAU,EAAE,CAJ0C;EAKtDC,SAAS,EAAE,CAL2C;EAMtDC,mBAAmB,EAAEb,uBANiC;EAOtDc,IAAI,EAAE;AAPgD,CAA1D;AAUA,MAAMC,eAAe,gBAAG,IAAAC,oBAAA,EAAyCZ,YAAzC,CAAxB;eAEeW,e"}