@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 +1 @@
1
- {"version":3,"sources":["YearPicker.tsx"],"names":["initYear","itemHeight","useStyles","theme","list","marginTop","spacing","maxHeight","YearPicker","date","locale","maxDate","minDate","onYearPress","styles","ref","React","useRef","minYear","maxYear","Date","years","Array","fill","map","v","i","useEffect","current","scrollToItem","animated","item","getItemLayout","data","index","length","offset","toString","newDate"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;;;AAEA,MAAMA,QAAQ,GAAG,IAAjB;AACA,MAAMC,UAAU,GAAG,EAAnB;;AAYA,MAAMC,SAAsC,GAAG,YAA8B;AACzE,QAAMC,KAAK,GAAG,qBAAd;AAEA,SAAO;AACHC,IAAAA,IAAI,EAAE;AACFC,MAAAA,SAAS,EAAEF,KAAK,CAACG,OAAN,CAAc,CAAd,CADT;AAEFC,MAAAA,SAAS,EAAE;AAFT;AADH,GAAP;AAMH,CATD;;AAWA,MAAMC,UAAU,GAAG,CAAC;AAChBC,EAAAA,IADgB;AAEhBC,EAAAA,MAFgB;AAGhBC,EAAAA,OAHgB;AAIhBC,EAAAA,OAJgB;AAKhBC,EAAAA;AALgB,CAAD,KAMI;AACnB,QAAMC,MAAM,GAAGZ,SAAS,EAAxB;;AAEA,QAAMa,GAAG,GAAGC,eAAMC,MAAN,CAA8B,IAA9B,CAAZ;;AAEA,QAAMC,OAAO,GAAGN,OAAO,GAAG,sBAAQA,OAAR,CAAH,GAAsBZ,QAA7C;AACA,QAAMmB,OAAO,GAAGR,OAAO,GAAG,sBAAQA,OAAR,CAAH,GAAsB,sBAAQ,IAAIS,IAAJ,EAAR,CAA7C;AACA,QAAMC,KAAK,GAAGC,KAAK,CAACH,OAAO,GAAGD,OAAV,GAAoB,CAArB,CAAL,CAA6BK,IAA7B,CAAkCL,OAAlC,EAA2CM,GAA3C,CAA+C,CAACC,CAAD,EAAIC,CAAJ,KAAUD,CAAC,GAAGC,CAA7D,CAAd;;AAEAV,iBAAMW,SAAN,CAAgB,MAAM;AAAA;;AAClB,oBAAAZ,GAAG,CAACa,OAAJ,8DAAaC,YAAb,CAA0B;AACtBC,MAAAA,QAAQ,EAAE,KADY;AAEtBC,MAAAA,IAAI,EAAE,sBAAQtB,IAAR;AAFgB,KAA1B;AAIH,GALD,EAKG,CAACA,IAAD,CALH;;AAOA,QAAMuB,aAAa,GAAG,CAACC,IAAD,EAAyCC,KAAzC,MAA4D;AAC9EC,IAAAA,MAAM,EAAElC,UADsE;AAE9EmC,IAAAA,MAAM,EAAEnC,UAAU,GAAGiC,KAFyD;AAG9EA,IAAAA;AAH8E,GAA5D,CAAtB;;AAMA,sBACI,6BAAC,YAAD,qBACI,6BAAC,gBAAD;AACI,IAAA,QAAQ,EAAE,uBAAWzB,IAAX,EAAiBC,MAAjB,CADd;AAEI,IAAA,KAAK,EAAE,aAFX;AAGI,IAAA,OAAO,EAAE;AAHb,IADJ,eAMI,6BAAC,qBAAD;AACI,IAAA,IAAI,EAAEW,KADV;AAEI,IAAA,YAAY,EAAEU,IAAI,IAAIA,IAAI,CAACM,QAAL,EAF1B;AAGI,IAAA,UAAU,EAAE,CAAC;AAAEN,MAAAA;AAAF,KAAD,kBACR,6BAAC,YAAD;AACI,MAAA,QAAQ,EAAEA,IAAI,CAACM,QAAL,EADd;AAEI,MAAA,OAAO,EAAE,MAFb;AAGI,MAAA,OAAO,EAAE,MAAM;AACX,cAAMC,OAAO,GAAG,sBAAQ7B,IAAR,EAAcsB,IAAd,CAAhB;AACAlB,QAAAA,WAAW,CAACyB,OAAD,CAAX;AACH;AANL,MAJR;AAaI,IAAA,aAAa,EAAEN,aAbnB;AAcI,IAAA,KAAK,EAAElB,MAAM,CAACV,IAdlB;AAeI,IAAA,GAAG,EAAEW;AAfT,IANJ,CADJ;AA0BH,CAtDD;;eAwDeP,U","sourcesContent":["import React from 'react';\nimport { FlatList } from 'react-native';\nimport { getYear, setYear } from 'date-fns';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { Button, Column, Typography, useTheme } from '@fountain-ui/core';\nimport { formatDate } from './utils';\n\nconst initYear = 1901;\nconst itemHeight = 40;\n\ninterface YearPickerProps {\n date: Date;\n locale?: string,\n maxDate?: Date;\n minDate?: Date;\n onYearPress: (date: Date) => void;\n}\n\ntype YearPickerStyles = NamedStylesStringUnion<'list'>;\n\nconst useStyles: UseStyles<YearPickerStyles> = function (): YearPickerStyles {\n const theme = useTheme();\n\n return {\n list: {\n marginTop: theme.spacing(1),\n maxHeight: 270,\n },\n };\n};\n\nconst YearPicker = ({\n date,\n locale,\n maxDate,\n minDate,\n onYearPress,\n}: YearPickerProps) => {\n const styles = useStyles();\n\n const ref = React.useRef<FlatList | null>(null);\n\n const minYear = minDate ? getYear(minDate) : initYear;\n const maxYear = maxDate ? getYear(maxDate) : getYear(new Date());\n const years = Array(maxYear - minYear + 1).fill(minYear).map((v, i) => v + i);\n\n React.useEffect(() => {\n ref.current?.scrollToItem({\n animated: false,\n item: getYear(date),\n });\n }, [date]);\n\n const getItemLayout = (data: Array<number> | null | undefined, index: number) => ({\n length: itemHeight,\n offset: itemHeight * index,\n index,\n });\n\n return (\n <Column>\n <Typography\n children={formatDate(date, locale)}\n color={'textPrimary'}\n variant={'subtitle2'}\n />\n <FlatList\n data={years}\n keyExtractor={item => item.toString()}\n renderItem={({ item }) => (\n <Button\n children={item.toString()}\n variant={'text'}\n onPress={() => {\n const newDate = setYear(date, item);\n onYearPress(newDate);\n }}\n />\n )}\n getItemLayout={getItemLayout}\n style={styles.list}\n ref={ref}\n />\n </Column>\n );\n};\n\nexport default YearPicker;\n"]}
1
+ {"version":3,"names":["initYear","itemHeight","useStyles","theme","useTheme","list","marginTop","spacing","maxHeight","YearPicker","date","locale","maxDate","minDate","onYearPress","styles","ref","React","useRef","minYear","getYear","maxYear","Date","years","Array","fill","map","v","i","useEffect","current","scrollToItem","animated","item","getItemLayout","data","index","length","offset","formatDate","toString","newDate","setYear"],"sources":["YearPicker.tsx"],"sourcesContent":["import React from 'react';\nimport { FlatList } from 'react-native';\nimport { getYear, setYear } from 'date-fns';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { Button, Column, Typography, useTheme } from '@fountain-ui/core';\nimport { formatDate } from './utils';\n\nconst initYear = 1901;\nconst itemHeight = 40;\n\ninterface YearPickerProps {\n date: Date;\n locale?: string,\n maxDate?: Date;\n minDate?: Date;\n onYearPress: (date: Date) => void;\n}\n\ntype YearPickerStyles = NamedStylesStringUnion<'list'>;\n\nconst useStyles: UseStyles<YearPickerStyles> = function (): YearPickerStyles {\n const theme = useTheme();\n\n return {\n list: {\n marginTop: theme.spacing(1),\n maxHeight: 270,\n },\n };\n};\n\nconst YearPicker = ({\n date,\n locale,\n maxDate,\n minDate,\n onYearPress,\n}: YearPickerProps) => {\n const styles = useStyles();\n\n const ref = React.useRef<FlatList | null>(null);\n\n const minYear = minDate ? getYear(minDate) : initYear;\n const maxYear = maxDate ? getYear(maxDate) : getYear(new Date());\n const years = Array(maxYear - minYear + 1).fill(minYear).map((v, i) => v + i);\n\n React.useEffect(() => {\n ref.current?.scrollToItem({\n animated: false,\n item: getYear(date),\n });\n }, [date]);\n\n const getItemLayout = (data: Array<number> | null | undefined, index: number) => ({\n length: itemHeight,\n offset: itemHeight * index,\n index,\n });\n\n return (\n <Column>\n <Typography\n children={formatDate(date, locale)}\n color={'textPrimary'}\n variant={'subtitle2'}\n />\n <FlatList\n data={years}\n keyExtractor={item => item.toString()}\n renderItem={({ item }) => (\n <Button\n children={item.toString()}\n variant={'text'}\n onPress={() => {\n const newDate = setYear(date, item);\n onYearPress(newDate);\n }}\n />\n )}\n getItemLayout={getItemLayout}\n style={styles.list}\n ref={ref}\n />\n </Column>\n );\n};\n\nexport default YearPicker;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;;;AAEA,MAAMA,QAAQ,GAAG,IAAjB;AACA,MAAMC,UAAU,GAAG,EAAnB;;AAYA,MAAMC,SAAsC,GAAG,YAA8B;EACzE,MAAMC,KAAK,GAAG,IAAAC,cAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,SAAS,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd,CADT;MAEFC,SAAS,EAAE;IAFT;EADH,CAAP;AAMH,CATD;;AAWA,MAAMC,UAAU,GAAG,QAMI;EAAA,IANH;IAChBC,IADgB;IAEhBC,MAFgB;IAGhBC,OAHgB;IAIhBC,OAJgB;IAKhBC;EALgB,CAMG;EACnB,MAAMC,MAAM,GAAGb,SAAS,EAAxB;;EAEA,MAAMc,GAAG,GAAGC,cAAA,CAAMC,MAAN,CAA8B,IAA9B,CAAZ;;EAEA,MAAMC,OAAO,GAAGN,OAAO,GAAG,IAAAO,gBAAA,EAAQP,OAAR,CAAH,GAAsBb,QAA7C;EACA,MAAMqB,OAAO,GAAGT,OAAO,GAAG,IAAAQ,gBAAA,EAAQR,OAAR,CAAH,GAAsB,IAAAQ,gBAAA,EAAQ,IAAIE,IAAJ,EAAR,CAA7C;EACA,MAAMC,KAAK,GAAGC,KAAK,CAACH,OAAO,GAAGF,OAAV,GAAoB,CAArB,CAAL,CAA6BM,IAA7B,CAAkCN,OAAlC,EAA2CO,GAA3C,CAA+C,CAACC,CAAD,EAAIC,CAAJ,KAAUD,CAAC,GAAGC,CAA7D,CAAd;;EAEAX,cAAA,CAAMY,SAAN,CAAgB,MAAM;IAAA;;IAClB,gBAAAb,GAAG,CAACc,OAAJ,8DAAaC,YAAb,CAA0B;MACtBC,QAAQ,EAAE,KADY;MAEtBC,IAAI,EAAE,IAAAb,gBAAA,EAAQV,IAAR;IAFgB,CAA1B;EAIH,CALD,EAKG,CAACA,IAAD,CALH;;EAOA,MAAMwB,aAAa,GAAG,CAACC,IAAD,EAAyCC,KAAzC,MAA4D;IAC9EC,MAAM,EAAEpC,UADsE;IAE9EqC,MAAM,EAAErC,UAAU,GAAGmC,KAFyD;IAG9EA;EAH8E,CAA5D,CAAtB;;EAMA,oBACI,6BAAC,YAAD,qBACI,6BAAC,gBAAD;IACI,QAAQ,EAAE,IAAAG,iBAAA,EAAW7B,IAAX,EAAiBC,MAAjB,CADd;IAEI,KAAK,EAAE,aAFX;IAGI,OAAO,EAAE;EAHb,EADJ,eAMI,6BAAC,qBAAD;IACI,IAAI,EAAEY,KADV;IAEI,YAAY,EAAEU,IAAI,IAAIA,IAAI,CAACO,QAAL,EAF1B;IAGI,UAAU,EAAE;MAAA,IAAC;QAAEP;MAAF,CAAD;MAAA,oBACR,6BAAC,YAAD;QACI,QAAQ,EAAEA,IAAI,CAACO,QAAL,EADd;QAEI,OAAO,EAAE,MAFb;QAGI,OAAO,EAAE,MAAM;UACX,MAAMC,OAAO,GAAG,IAAAC,gBAAA,EAAQhC,IAAR,EAAcuB,IAAd,CAAhB;UACAnB,WAAW,CAAC2B,OAAD,CAAX;QACH;MANL,EADQ;IAAA,CAHhB;IAaI,aAAa,EAAEP,aAbnB;IAcI,KAAK,EAAEnB,MAAM,CAACV,IAdlB;IAeI,GAAG,EAAEW;EAfT,EANJ,CADJ;AA0BH,CAtDD;;eAwDeP,U"}
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "default", {
6
+ Object.defineProperty(exports, "DateTimePickerProvider", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _DateTimePicker.default;
9
+ return _DateTimePickerProvider.default;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "DateTimePickerProvider", {
12
+ Object.defineProperty(exports, "default", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _DateTimePickerProvider.default;
15
+ return _DateTimePicker.default;
16
16
  }
17
17
  });
18
18
 
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { default } from './DateTimePicker';\nexport { default as DateTimePickerProvider } from './DateTimePickerProvider';\nexport type { default as DateTimePickerProps } from './DateTimePickerProps';"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './DateTimePicker';\nexport { default as DateTimePickerProvider } from './DateTimePickerProvider';\nexport type { default as DateTimePickerProps } from './DateTimePickerProps';"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AACA"}
@@ -21,7 +21,8 @@ const localeMap = {
21
21
  fr: _fr.default
22
22
  };
23
23
 
24
- const formatDate = (date, locale = 'en') => {
24
+ const formatDate = function (date) {
25
+ let locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en';
25
26
  //@ts-ignore
26
27
  return (0, _dateFns.format)(date, 'MMMM uuuu', {
27
28
  locale: localeMap[locale]
@@ -1 +1 @@
1
- {"version":3,"sources":["utils.ts"],"names":["localeMap","en","enLocale","de","deLocale","fr","frLocale","formatDate","date","locale"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,SAAS,GAAG;AACdC,EAAAA,EAAE,EAAEC,aADU;AAEdC,EAAAA,EAAE,EAAEC,WAFU;AAGdC,EAAAA,EAAE,EAAEC;AAHU,CAAlB;;AAMO,MAAMC,UAAU,GAAG,CAACC,IAAD,EAAaC,MAAc,GAAG,IAA9B,KAA+C;AACrE;AACA,SAAO,qBAAOD,IAAP,EAAa,WAAb,EAA0B;AAAEC,IAAAA,MAAM,EAAET,SAAS,CAACS,MAAD;AAAnB,GAA1B,CAAP;AACH,CAHM","sourcesContent":["import { format } from 'date-fns';\nimport enLocale from 'date-fns/locale/en-US';\nimport deLocale from 'date-fns/locale/de';\nimport frLocale from 'date-fns/locale/fr';\n\nconst localeMap = {\n en: enLocale,\n de: deLocale,\n fr: frLocale,\n};\n\nexport const formatDate = (date: Date, locale: string = 'en'): string => {\n //@ts-ignore\n return format(date, 'MMMM uuuu', { locale: localeMap[locale] });\n};"]}
1
+ {"version":3,"names":["localeMap","en","enLocale","de","deLocale","fr","frLocale","formatDate","date","locale","format"],"sources":["utils.ts"],"sourcesContent":["import { format } from 'date-fns';\nimport enLocale from 'date-fns/locale/en-US';\nimport deLocale from 'date-fns/locale/de';\nimport frLocale from 'date-fns/locale/fr';\n\nconst localeMap = {\n en: enLocale,\n de: deLocale,\n fr: frLocale,\n};\n\nexport const formatDate = (date: Date, locale: string = 'en'): string => {\n //@ts-ignore\n return format(date, 'MMMM uuuu', { locale: localeMap[locale] });\n};"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,SAAS,GAAG;EACdC,EAAE,EAAEC,aADU;EAEdC,EAAE,EAAEC,WAFU;EAGdC,EAAE,EAAEC;AAHU,CAAlB;;AAMO,MAAMC,UAAU,GAAG,UAACC,IAAD,EAA+C;EAAA,IAAlCC,MAAkC,uEAAjB,IAAiB;EACrE;EACA,OAAO,IAAAC,eAAA,EAAOF,IAAP,EAAa,WAAb,EAA0B;IAAEC,MAAM,EAAET,SAAS,CAACS,MAAD;EAAnB,CAA1B,CAAP;AACH,CAHM"}
@@ -9,9 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
- var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
15
13
 
16
14
  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); }
17
15
 
@@ -40,10 +38,8 @@ function FlipCard(props) {
40
38
  reanimationKey,
41
39
  style
42
40
  } = props;
43
-
44
- const sharedAngle = _reactNativeReanimated.default.useSharedValue(0);
45
-
46
- const animatedFrontCardStyle = _reactNativeReanimated.default.useAnimatedStyle(() => {
41
+ const sharedAngle = (0, _reactNativeReanimated.useSharedValue)(0);
42
+ const animatedFrontCardStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
47
43
  return {
48
44
  zIndex: sharedAngle.value < Z_INDEX_CHANGE_ANGLE ? 2 : 1,
49
45
  transform: [{
@@ -52,9 +48,8 @@ function FlipCard(props) {
52
48
  rotateX: `${sharedAngle.value}deg`
53
49
  }]
54
50
  };
55
- });
56
-
57
- const animatedBackCardStyle = _reactNativeReanimated.default.useAnimatedStyle(() => {
51
+ }, []);
52
+ const animatedBackCardStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
58
53
  return {
59
54
  zIndex: sharedAngle.value <= Z_INDEX_CHANGE_ANGLE ? 1 : 2,
60
55
  transform: [{
@@ -63,11 +58,10 @@ function FlipCard(props) {
63
58
  rotateX: `${sharedAngle.value + 180}deg`
64
59
  }]
65
60
  };
66
- });
67
-
61
+ }, []);
68
62
  (0, _react.useEffect)(() => {
69
63
  sharedAngle.value = 0;
70
- sharedAngle.value = _reactNativeReanimated.default.withTiming(180, {
64
+ sharedAngle.value = (0, _reactNativeReanimated.withTiming)(180, {
71
65
  duration: 500
72
66
  });
73
67
  }, [reanimationKey]);
@@ -1 +1 @@
1
- {"version":3,"sources":["FlipCard.tsx"],"names":["styles","StyleSheet","create","container","height","width","animatedCard","alignItems","backfaceVisibility","justifyContent","position","PERSPECTIVE","Z_INDEX_CHANGE_ANGLE","FlipCard","props","backCard","frontCard","reanimationKey","style","sharedAngle","Animated","useSharedValue","animatedFrontCardStyle","useAnimatedStyle","zIndex","value","transform","perspective","rotateX","animatedBackCardStyle","withTiming","duration"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC7BC,EAAAA,SAAS,EAAE;AACPC,IAAAA,MAAM,EAAE,EADD;AAEPC,IAAAA,KAAK,EAAE;AAFA,GADkB;AAK7BC,EAAAA,YAAY,EAAE;AACVC,IAAAA,UAAU,EAAE,QADF;AAEVC,IAAAA,kBAAkB,EAAE,QAFV;AAGVC,IAAAA,cAAc,EAAE,QAHN;AAIVC,IAAAA,QAAQ,EAAE;AAJA;AALe,CAAlB,CAAf;;AAaA,MAAMC,WAAW,GAAG,GAApB;AACA,MAAMC,oBAAoB,GAAG,EAA7B;;AAEe,SAASC,QAAT,CAAkBC,KAAlB,EAAwC;AACnD,QAAM;AACFC,IAAAA,QADE;AAEFC,IAAAA,SAFE;AAGFC,IAAAA,cAHE;AAIFC,IAAAA;AAJE,MAKFJ,KALJ;;AAOA,QAAMK,WAAW,GAAGC,+BAASC,cAAT,CAAwB,CAAxB,CAApB;;AAEA,QAAMC,sBAAsB,GAAGF,+BAASG,gBAAT,CAA0B,MAAM;AAC3D,WAAO;AACHC,MAAAA,MAAM,EAAEL,WAAW,CAACM,KAAZ,GAAoBb,oBAApB,GAA2C,CAA3C,GAA+C,CADpD;AAEHc,MAAAA,SAAS,EAAE,CACP;AAAEC,QAAAA,WAAW,EAAEhB;AAAf,OADO,EAEP;AAAEiB,QAAAA,OAAO,EAAG,GAAET,WAAW,CAACM,KAAM;AAAhC,OAFO;AAFR,KAAP;AAOH,GAR8B,CAA/B;;AAUA,QAAMI,qBAAqB,GAAGT,+BAASG,gBAAT,CAA0B,MAAM;AAC1D,WAAO;AACHC,MAAAA,MAAM,EAAEL,WAAW,CAACM,KAAZ,IAAqBb,oBAArB,GAA4C,CAA5C,GAAgD,CADrD;AAEHc,MAAAA,SAAS,EAAE,CACP;AAAEC,QAAAA,WAAW,EAAEhB;AAAf,OADO,EAEP;AAAEiB,QAAAA,OAAO,EAAG,GAAGT,WAAW,CAACM,KAAZ,GAAoB,GAAK;AAAxC,OAFO;AAFR,KAAP;AAOH,GAR6B,CAA9B;;AAUA,wBAAU,MAAM;AACZN,IAAAA,WAAW,CAACM,KAAZ,GAAoB,CAApB;AACAN,IAAAA,WAAW,CAACM,KAAZ,GAAoBL,+BAASU,UAAT,CAAoB,GAApB,EAAyB;AAAEC,MAAAA,QAAQ,EAAE;AAAZ,KAAzB,CAApB;AACH,GAHD,EAGG,CAACd,cAAD,CAHH;AAKA,sBACI,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACjB,MAAM,CAACG,SAAR,EAAmBe,KAAnB;AAAb,kBACI,6BAAC,8BAAD,CAAU,IAAV;AAAe,IAAA,KAAK,EAAE,CAAClB,MAAM,CAACM,YAAR,EAAsBgB,sBAAtB;AAAtB,KACKN,SADL,CADJ,eAKI,6BAAC,8BAAD,CAAU,IAAV;AAAe,IAAA,KAAK,EAAE,CAAChB,MAAM,CAACM,YAAR,EAAsBuB,qBAAtB;AAAtB,KACKd,QADL,CALJ,CADJ;AAWH;;AAAA","sourcesContent":["import React, { useEffect } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport Animated from 'react-native-reanimated';\nimport type FlipCardProps from './FlipCardProps';\n\nconst styles = StyleSheet.create({\n container: {\n height: 32,\n width: 24,\n },\n animatedCard: {\n alignItems: 'center',\n backfaceVisibility: 'hidden',\n justifyContent: 'center',\n position: 'absolute',\n },\n});\n\nconst PERSPECTIVE = 100;\nconst Z_INDEX_CHANGE_ANGLE = 90;\n\nexport default function FlipCard(props: FlipCardProps) {\n const {\n backCard,\n frontCard,\n reanimationKey,\n style,\n } = props;\n\n const sharedAngle = Animated.useSharedValue(0);\n\n const animatedFrontCardStyle = Animated.useAnimatedStyle(() => {\n return {\n zIndex: sharedAngle.value < Z_INDEX_CHANGE_ANGLE ? 2 : 1,\n transform: [\n { perspective: PERSPECTIVE },\n { rotateX: `${sharedAngle.value}deg` },\n ],\n };\n });\n\n const animatedBackCardStyle = Animated.useAnimatedStyle(() => {\n return {\n zIndex: sharedAngle.value <= Z_INDEX_CHANGE_ANGLE ? 1 : 2,\n transform: [\n { perspective: PERSPECTIVE },\n { rotateX: `${(sharedAngle.value + 180)}deg` },\n ],\n };\n });\n\n useEffect(() => {\n sharedAngle.value = 0;\n sharedAngle.value = Animated.withTiming(180, { duration: 500 });\n }, [reanimationKey]);\n\n return (\n <View style={[styles.container, style]}>\n <Animated.View style={[styles.animatedCard, animatedFrontCardStyle]}>\n {frontCard}\n </Animated.View>\n\n <Animated.View style={[styles.animatedCard, animatedBackCardStyle]}>\n {backCard}\n </Animated.View>\n </View>\n );\n};"]}
1
+ {"version":3,"names":["styles","StyleSheet","create","container","height","width","animatedCard","alignItems","backfaceVisibility","justifyContent","position","PERSPECTIVE","Z_INDEX_CHANGE_ANGLE","FlipCard","props","backCard","frontCard","reanimationKey","style","sharedAngle","useSharedValue","animatedFrontCardStyle","useAnimatedStyle","zIndex","value","transform","perspective","rotateX","animatedBackCardStyle","useEffect","withTiming","duration"],"sources":["FlipCard.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport type FlipCardProps from './FlipCardProps';\n\nconst styles = StyleSheet.create({\n container: {\n height: 32,\n width: 24,\n },\n animatedCard: {\n alignItems: 'center',\n backfaceVisibility: 'hidden',\n justifyContent: 'center',\n position: 'absolute',\n },\n});\n\nconst PERSPECTIVE = 100;\nconst Z_INDEX_CHANGE_ANGLE = 90;\n\nexport default function FlipCard(props: FlipCardProps) {\n const {\n backCard,\n frontCard,\n reanimationKey,\n style,\n } = props;\n\n const sharedAngle = useSharedValue(0);\n\n const animatedFrontCardStyle = useAnimatedStyle(() => {\n return {\n zIndex: sharedAngle.value < Z_INDEX_CHANGE_ANGLE ? 2 : 1,\n transform: [\n { perspective: PERSPECTIVE },\n { rotateX: `${sharedAngle.value}deg` },\n ],\n };\n }, []);\n\n const animatedBackCardStyle = useAnimatedStyle(() => {\n return {\n zIndex: sharedAngle.value <= Z_INDEX_CHANGE_ANGLE ? 1 : 2,\n transform: [\n { perspective: PERSPECTIVE },\n { rotateX: `${(sharedAngle.value + 180)}deg` },\n ],\n };\n }, []);\n\n useEffect(() => {\n sharedAngle.value = 0;\n sharedAngle.value = withTiming(180, { duration: 500 });\n }, [reanimationKey]);\n\n return (\n <View style={[styles.container, style]}>\n <Animated.View style={[styles.animatedCard, animatedFrontCardStyle]}>\n {frontCard}\n </Animated.View>\n\n <Animated.View style={[styles.animatedCard, animatedBackCardStyle]}>\n {backCard}\n </Animated.View>\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,SAAS,EAAE;IACPC,MAAM,EAAE,EADD;IAEPC,KAAK,EAAE;EAFA,CADkB;EAK7BC,YAAY,EAAE;IACVC,UAAU,EAAE,QADF;IAEVC,kBAAkB,EAAE,QAFV;IAGVC,cAAc,EAAE,QAHN;IAIVC,QAAQ,EAAE;EAJA;AALe,CAAlB,CAAf;;AAaA,MAAMC,WAAW,GAAG,GAApB;AACA,MAAMC,oBAAoB,GAAG,EAA7B;;AAEe,SAASC,QAAT,CAAkBC,KAAlB,EAAwC;EACnD,MAAM;IACFC,QADE;IAEFC,SAFE;IAGFC,cAHE;IAIFC;EAJE,IAKFJ,KALJ;EAOA,MAAMK,WAAW,GAAG,IAAAC,qCAAA,EAAe,CAAf,CAApB;EAEA,MAAMC,sBAAsB,GAAG,IAAAC,uCAAA,EAAiB,MAAM;IAClD,OAAO;MACHC,MAAM,EAAEJ,WAAW,CAACK,KAAZ,GAAoBZ,oBAApB,GAA2C,CAA3C,GAA+C,CADpD;MAEHa,SAAS,EAAE,CACP;QAAEC,WAAW,EAAEf;MAAf,CADO,EAEP;QAAEgB,OAAO,EAAG,GAAER,WAAW,CAACK,KAAM;MAAhC,CAFO;IAFR,CAAP;EAOH,CAR8B,EAQ5B,EAR4B,CAA/B;EAUA,MAAMI,qBAAqB,GAAG,IAAAN,uCAAA,EAAiB,MAAM;IACjD,OAAO;MACHC,MAAM,EAAEJ,WAAW,CAACK,KAAZ,IAAqBZ,oBAArB,GAA4C,CAA5C,GAAgD,CADrD;MAEHa,SAAS,EAAE,CACP;QAAEC,WAAW,EAAEf;MAAf,CADO,EAEP;QAAEgB,OAAO,EAAG,GAAGR,WAAW,CAACK,KAAZ,GAAoB,GAAK;MAAxC,CAFO;IAFR,CAAP;EAOH,CAR6B,EAQ3B,EAR2B,CAA9B;EAUA,IAAAK,gBAAA,EAAU,MAAM;IACZV,WAAW,CAACK,KAAZ,GAAoB,CAApB;IACAL,WAAW,CAACK,KAAZ,GAAoB,IAAAM,iCAAA,EAAW,GAAX,EAAgB;MAAEC,QAAQ,EAAE;IAAZ,CAAhB,CAApB;EACH,CAHD,EAGG,CAACd,cAAD,CAHH;EAKA,oBACI,6BAAC,iBAAD;IAAM,KAAK,EAAE,CAACjB,MAAM,CAACG,SAAR,EAAmBe,KAAnB;EAAb,gBACI,6BAAC,8BAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAAClB,MAAM,CAACM,YAAR,EAAsBe,sBAAtB;EAAtB,GACKL,SADL,CADJ,eAKI,6BAAC,8BAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAAChB,MAAM,CAACM,YAAR,EAAsBsB,qBAAtB;EAAtB,GACKb,QADL,CALJ,CADJ;AAWH;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["FlipCardProps.ts"],"sourcesContent":["import React from 'react';\nimport { ComponentProps } from '@fountain-ui/core';\n\nexport default interface FlipCardProps extends ComponentProps<{\n /**\n * Element placed on backSide\n */\n backCard: React.ReactElement;\n\n /**\n * Element placed on frontSide\n */\n frontCard: React.ReactElement;\n\n /**\n * The key to reanimate Component, usually includes card content\n */\n reanimationKey?: string;\n}> {}"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { default } from './FlipCard';\nexport type { default as FlipCardProps } from './FlipCardProps';"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './FlipCard';\nexport type { default as FlipCardProps } from './FlipCardProps';"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.useStatusBarContext = exports.StatusBarContext = void 0;
6
+ exports.useStatusBarContext = exports.default = exports.StatusBarContext = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -1 +1 @@
1
- {"version":3,"sources":["Provider.ts"],"names":["StatusBarContext","React","createContext","useStatusBarContext","useContext","Provider"],"mappings":";;;;;;;AAAA;;;;AAUO,MAAMA,gBAAgB,gBAAGC,eAAMC,aAAN,CAAmD,IAAnD,CAAzB;;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AACrC,SAAOF,eAAMG,UAAN,CAAiBJ,gBAAjB,CAAP;AACH,CAFM;;;eAIQA,gBAAgB,CAACK,Q","sourcesContent":["import React from 'react';\nimport type { StatusBarStyle } from 'react-native';\n\nexport interface StatusBarProviderValue {\n setTranslucent: (value: boolean) => void;\n setBackgroundColor: (value: string) => void;\n setHidden: (value: boolean) => void;\n setBarStyle: (value: StatusBarStyle, animated?: boolean) => void;\n}\n\nexport const StatusBarContext = React.createContext<StatusBarProviderValue | null>(null);\n\nexport const useStatusBarContext = () => {\n return React.useContext(StatusBarContext);\n};\n\nexport default StatusBarContext.Provider;"]}
1
+ {"version":3,"names":["StatusBarContext","React","createContext","useStatusBarContext","useContext","Provider"],"sources":["Provider.ts"],"sourcesContent":["import React from 'react';\nimport type { StatusBarStyle } from 'react-native';\n\nexport interface StatusBarProviderValue {\n setTranslucent: (value: boolean) => void;\n setBackgroundColor: (value: string) => void;\n setHidden: (value: boolean) => void;\n setBarStyle: (value: StatusBarStyle, animated?: boolean) => void;\n}\n\nexport const StatusBarContext = React.createContext<StatusBarProviderValue | null>(null);\n\nexport const useStatusBarContext = () => {\n return React.useContext(StatusBarContext);\n};\n\nexport default StatusBarContext.Provider;"],"mappings":";;;;;;;AAAA;;;;AAUO,MAAMA,gBAAgB,gBAAGC,cAAA,CAAMC,aAAN,CAAmD,IAAnD,CAAzB;;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;EACrC,OAAOF,cAAA,CAAMG,UAAN,CAAiBJ,gBAAjB,CAAP;AACH,CAFM;;;eAIQA,gBAAgB,CAACK,Q"}
@@ -1 +1 @@
1
- {"version":3,"sources":["StatusBarProvider.tsx"],"names":["initialVisible","Platform","select","ios","android","StatusBarProvider","props","children","theme","defaultColor","palette","background","default","visible","setVisible","React","useState","backgroundViewColor","setBackgroundViewColor","setBackgroundColor","value","OS","RNStatusBar","setBarStyle","animated","setHidden","setTranslucent","shouldRenderBackgroundView","inset","backgroundViewStyle","backgroundColor","height","top","left","position","right","zIndex","statusBar"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;AAGA,MAAMA,cAAc,GAAGC,sBAASC,MAAT,CAAgB;AACnCC,EAAAA,GAAG,EAAE,IAD8B;AAEnCC,EAAAA,OAAO,EAAE;AAF0B,CAAhB,CAAvB;;AAKe,SAASC,iBAAT,CAA2BC,KAA3B,EAA0D;AACrE,QAAM;AAAEC,IAAAA;AAAF,MAAeD,KAArB;AAEA,QAAME,KAAK,GAAG,qBAAd;AACA,QAAMC,YAAY,GAAGD,KAAK,CAACE,OAAN,CAAcC,UAAd,CAAyBC,OAA9C;;AAEA,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBC,eAAMC,QAAN,CAAehB,cAAf,CAA9B;;AACA,QAAM,CAACiB,mBAAD,EAAsBC,sBAAtB,IAAgDH,eAAMC,QAAN,CAAeP,YAAf,CAAtD;;AAEA,QAAMU,kBAAkB,GAAIC,KAAD,IAAmB;AAC1C,QAAInB,sBAASoB,EAAT,KAAgB,SAApB,EAA+B;AAC3BC,6BAAYH,kBAAZ,CAA+BC,KAA/B;AACH;;AAED,QAAInB,sBAASoB,EAAT,KAAgB,KAApB,EAA2B;AACvBH,MAAAA,sBAAsB,CAACE,KAAD,CAAtB;AACH;AACJ,GARD;;AAUA,QAAMG,WAAW,GAAG,CAACH,KAAD,EAAwBI,QAAxB,KAA+C;AAC/DF,2BAAYC,WAAZ,CAAwBH,KAAxB,EAA+BI,QAA/B;AACH,GAFD;;AAIA,QAAMC,SAAS,GAAIL,KAAD,IAAoB;AAClC,QAAInB,sBAASoB,EAAT,KAAgB,KAApB,EAA2B;AACvBP,MAAAA,UAAU,CAAC,CAACM,KAAF,CAAV;AACH;;AAEDE,2BAAYG,SAAZ,CAAsBL,KAAtB;AACH,GAND;;AAQA,QAAMM,cAAc,GAAIN,KAAD,IAAoB;AACvC,QAAInB,sBAASoB,EAAT,KAAgB,SAApB,EAA+B;AAC3BC,6BAAYI,cAAZ,CAA2BN,KAA3B;AACH;AACJ,GAJD;;AAMA,QAAMO,0BAA0B,GAAG1B,sBAASoB,EAAT,KAAgB,KAAhB,IAAyBR,OAA5D;AAEA,QAAMe,KAAK,GAAG,oDAAd;AACA,QAAMC,mBAAmB,GAAG,iBAAI,CAC5B;AACIC,IAAAA,eAAe,EAAEb,mBADrB;AAEIc,IAAAA,MAAM,EAAEH,KAAK,CAACI,GAFlB;AAGIC,IAAAA,IAAI,EAAE,CAHV;AAIIC,IAAAA,QAAQ,EAAE,UAJd;AAKIC,IAAAA,KAAK,EAAE,CALX;AAMIH,IAAAA,GAAG,EAAE,CANT;AAOII,IAAAA,MAAM,EAAE5B,KAAK,CAAC4B,MAAN,CAAaC;AAPzB,GAD4B,CAAJ,CAA5B;AAYA,sBACI,6BAAC,iBAAD;AAAU,IAAA,KAAK,EAAE;AACblB,MAAAA,kBADa;AAEbI,MAAAA,WAFa;AAGbE,MAAAA,SAHa;AAIbC,MAAAA;AAJa;AAAjB,KAMKC,0BAA0B,gBACvB,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEE;AAAb,IADuB,GAEvB,IARR,EASKtB,QATL,CADJ;AAaH","sourcesContent":["import React from 'react';\nimport type { StatusBarStyle } from 'react-native';\nimport { Platform, StatusBar as RNStatusBar, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { useTheme } from '@fountain-ui/core';\nimport { css } from '@fountain-ui/styles';\nimport Provider from './Provider';\nimport type StatusBarProviderProps from './StatusBarProviderProps';\n\nconst initialVisible = Platform.select({\n ios: true,\n android: false,\n});\n\nexport default function StatusBarProvider(props: StatusBarProviderProps) {\n const { children } = props;\n\n const theme = useTheme();\n const defaultColor = theme.palette.background.default;\n\n const [visible, setVisible] = React.useState(initialVisible);\n const [backgroundViewColor, setBackgroundViewColor] = React.useState(defaultColor);\n\n const setBackgroundColor = (value: string) => {\n if (Platform.OS === 'android') {\n RNStatusBar.setBackgroundColor(value);\n }\n\n if (Platform.OS === 'ios') {\n setBackgroundViewColor(value);\n }\n };\n\n const setBarStyle = (value: StatusBarStyle, animated?: boolean) => {\n RNStatusBar.setBarStyle(value, animated);\n };\n\n const setHidden = (value: boolean) => {\n if (Platform.OS === 'ios') {\n setVisible(!value);\n }\n\n RNStatusBar.setHidden(value);\n };\n\n const setTranslucent = (value: boolean) => {\n if (Platform.OS === 'android') {\n RNStatusBar.setTranslucent(value);\n }\n };\n\n const shouldRenderBackgroundView = Platform.OS === 'ios' && visible;\n\n const inset = useSafeAreaInsets();\n const backgroundViewStyle = css([\n {\n backgroundColor: backgroundViewColor,\n height: inset.top,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n zIndex: theme.zIndex.statusBar,\n },\n ]);\n\n return (\n <Provider value={{\n setBackgroundColor,\n setBarStyle,\n setHidden,\n setTranslucent,\n }}>\n {shouldRenderBackgroundView ? (\n <View style={backgroundViewStyle}/>\n ) : null}\n {children}\n </Provider>\n );\n}"]}
1
+ {"version":3,"names":["initialVisible","Platform","select","ios","android","StatusBarProvider","props","children","theme","useTheme","defaultColor","palette","background","default","visible","setVisible","React","useState","backgroundViewColor","setBackgroundViewColor","setBackgroundColor","value","OS","RNStatusBar","setBarStyle","animated","setHidden","setTranslucent","shouldRenderBackgroundView","inset","useSafeAreaInsets","backgroundViewStyle","css","backgroundColor","height","top","left","position","right","zIndex","statusBar"],"sources":["StatusBarProvider.tsx"],"sourcesContent":["import React from 'react';\nimport type { StatusBarStyle } from 'react-native';\nimport { Platform, StatusBar as RNStatusBar, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { useTheme } from '@fountain-ui/core';\nimport { css } from '@fountain-ui/styles';\nimport Provider from './Provider';\nimport type StatusBarProviderProps from './StatusBarProviderProps';\n\nconst initialVisible = Platform.select({\n ios: true,\n android: false,\n});\n\nexport default function StatusBarProvider(props: StatusBarProviderProps) {\n const { children } = props;\n\n const theme = useTheme();\n const defaultColor = theme.palette.background.default;\n\n const [visible, setVisible] = React.useState(initialVisible);\n const [backgroundViewColor, setBackgroundViewColor] = React.useState(defaultColor);\n\n const setBackgroundColor = (value: string) => {\n if (Platform.OS === 'android') {\n RNStatusBar.setBackgroundColor(value);\n }\n\n if (Platform.OS === 'ios') {\n setBackgroundViewColor(value);\n }\n };\n\n const setBarStyle = (value: StatusBarStyle, animated?: boolean) => {\n RNStatusBar.setBarStyle(value, animated);\n };\n\n const setHidden = (value: boolean) => {\n if (Platform.OS === 'ios') {\n setVisible(!value);\n }\n\n RNStatusBar.setHidden(value);\n };\n\n const setTranslucent = (value: boolean) => {\n if (Platform.OS === 'android') {\n RNStatusBar.setTranslucent(value);\n }\n };\n\n const shouldRenderBackgroundView = Platform.OS === 'ios' && visible;\n\n const inset = useSafeAreaInsets();\n const backgroundViewStyle = css([\n {\n backgroundColor: backgroundViewColor,\n height: inset.top,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n zIndex: theme.zIndex.statusBar,\n },\n ]);\n\n return (\n <Provider value={{\n setBackgroundColor,\n setBarStyle,\n setHidden,\n setTranslucent,\n }}>\n {shouldRenderBackgroundView ? (\n <View style={backgroundViewStyle}/>\n ) : null}\n {children}\n </Provider>\n );\n}"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;AAGA,MAAMA,cAAc,GAAGC,qBAAA,CAASC,MAAT,CAAgB;EACnCC,GAAG,EAAE,IAD8B;EAEnCC,OAAO,EAAE;AAF0B,CAAhB,CAAvB;;AAKe,SAASC,iBAAT,CAA2BC,KAA3B,EAA0D;EACrE,MAAM;IAAEC;EAAF,IAAeD,KAArB;EAEA,MAAME,KAAK,GAAG,IAAAC,cAAA,GAAd;EACA,MAAMC,YAAY,GAAGF,KAAK,CAACG,OAAN,CAAcC,UAAd,CAAyBC,OAA9C;;EAEA,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBC,cAAA,CAAMC,QAAN,CAAejB,cAAf,CAA9B;;EACA,MAAM,CAACkB,mBAAD,EAAsBC,sBAAtB,IAAgDH,cAAA,CAAMC,QAAN,CAAeP,YAAf,CAAtD;;EAEA,MAAMU,kBAAkB,GAAIC,KAAD,IAAmB;IAC1C,IAAIpB,qBAAA,CAASqB,EAAT,KAAgB,SAApB,EAA+B;MAC3BC,sBAAA,CAAYH,kBAAZ,CAA+BC,KAA/B;IACH;;IAED,IAAIpB,qBAAA,CAASqB,EAAT,KAAgB,KAApB,EAA2B;MACvBH,sBAAsB,CAACE,KAAD,CAAtB;IACH;EACJ,CARD;;EAUA,MAAMG,WAAW,GAAG,CAACH,KAAD,EAAwBI,QAAxB,KAA+C;IAC/DF,sBAAA,CAAYC,WAAZ,CAAwBH,KAAxB,EAA+BI,QAA/B;EACH,CAFD;;EAIA,MAAMC,SAAS,GAAIL,KAAD,IAAoB;IAClC,IAAIpB,qBAAA,CAASqB,EAAT,KAAgB,KAApB,EAA2B;MACvBP,UAAU,CAAC,CAACM,KAAF,CAAV;IACH;;IAEDE,sBAAA,CAAYG,SAAZ,CAAsBL,KAAtB;EACH,CAND;;EAQA,MAAMM,cAAc,GAAIN,KAAD,IAAoB;IACvC,IAAIpB,qBAAA,CAASqB,EAAT,KAAgB,SAApB,EAA+B;MAC3BC,sBAAA,CAAYI,cAAZ,CAA2BN,KAA3B;IACH;EACJ,CAJD;;EAMA,MAAMO,0BAA0B,GAAG3B,qBAAA,CAASqB,EAAT,KAAgB,KAAhB,IAAyBR,OAA5D;EAEA,MAAMe,KAAK,GAAG,IAAAC,6CAAA,GAAd;EACA,MAAMC,mBAAmB,GAAG,IAAAC,WAAA,EAAI,CAC5B;IACIC,eAAe,EAAEf,mBADrB;IAEIgB,MAAM,EAAEL,KAAK,CAACM,GAFlB;IAGIC,IAAI,EAAE,CAHV;IAIIC,QAAQ,EAAE,UAJd;IAKIC,KAAK,EAAE,CALX;IAMIH,GAAG,EAAE,CANT;IAOII,MAAM,EAAE/B,KAAK,CAAC+B,MAAN,CAAaC;EAPzB,CAD4B,CAAJ,CAA5B;EAYA,oBACI,6BAAC,iBAAD;IAAU,KAAK,EAAE;MACbpB,kBADa;MAEbI,WAFa;MAGbE,SAHa;MAIbC;IAJa;EAAjB,GAMKC,0BAA0B,gBACvB,6BAAC,iBAAD;IAAM,KAAK,EAAEG;EAAb,EADuB,GAEvB,IARR,EASKxB,QATL,CADJ;AAaH"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["StatusBarProviderProps.ts"],"sourcesContent":["import React from 'react';\n\nexport default interface StatusBarProviderProp {\n /**\n * The screens where the statusbar will be visible.\n */\n children: React.ReactNode;\n}"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { default } from './StatusBarProvider';\nexport { useStatusBarContext } from './Provider';\nexport type { default as StatusBarProviderProps } from './StatusBarProviderProps';"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './StatusBarProvider';\nexport { useStatusBarContext } from './Provider';\nexport type { default as StatusBarProviderProps } from './StatusBarProviderProps';"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AACA"}
@@ -5,44 +5,109 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
+ var _reactNativeReanimated = require("react-native-reanimated");
13
+
14
+ var _core = require("@fountain-ui/core");
15
+
16
+ var _PageStateContext = _interopRequireDefault(require("./PageStateContext"));
17
+
12
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
19
 
14
- 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 _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); }
21
+
22
+ 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; }
23
+
24
+ const styles = _core.StyleSheet.create({
25
+ fill: {
26
+ width: '100%',
27
+ height: '100%'
28
+ },
29
+ none: {
30
+ display: 'none'
31
+ }
32
+ });
15
33
 
16
- const Page = function Page(props) {
34
+ function Page(props) {
17
35
  const {
18
- isVisible,
19
- ...otherProps
36
+ index,
37
+ children,
38
+ loading,
39
+ offscreenPageRerenderLimit,
40
+ sharedIndex
20
41
  } = props;
21
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
22
- collapsable: false
23
- }, otherProps));
24
- };
25
42
 
26
- var _default = /*#__PURE__*/_react.default.memo(Page, (prevProps, nextProps) => {
27
- if (prevProps.children === null && nextProps.children === null) {
28
- return true;
29
- } // isVisible is an important condition for determining memos on the web.
30
- // Reference ViewPagerWeb's return.
43
+ const assumeInitialPageState = () => {
44
+ const activeIndex = sharedIndex.value;
45
+ const isActive = index === activeIndex;
31
46
 
47
+ if (loading === 'eager') {
48
+ return {
49
+ isActive,
50
+ isLoaded: true
51
+ };
52
+ }
32
53
 
33
- if (prevProps.isVisible !== nextProps.isVisible) {
34
- return false;
35
- }
54
+ const isLoaded = index >= activeIndex - offscreenPageRerenderLimit && index <= activeIndex + offscreenPageRerenderLimit;
55
+ return {
56
+ isActive,
57
+ isLoaded
58
+ };
59
+ };
36
60
 
37
- if (nextProps.isVisible || nextProps.isNeighbor) {
38
- return false;
39
- }
61
+ const [pageState, setPageState] = (0, _react.useState)(assumeInitialPageState);
62
+ const content = pageState.isLoaded ? children : null;
63
+
64
+ const onActiveStateChange = isActive => {
65
+ setPageState(prevState => ({ ...prevState,
66
+ isActive,
67
+ isLoaded: isActive || prevState.isLoaded
68
+ }));
69
+ };
70
+
71
+ const onBecomeNeighbor = () => {
72
+ setPageState(prevState => ({ ...prevState,
73
+ isLoaded: true
74
+ }));
75
+ };
76
+
77
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => {
78
+ const activeIndex = sharedIndex.value;
79
+ const isActive = index === activeIndex;
80
+ const shouldRerender = index >= activeIndex - offscreenPageRerenderLimit && index <= activeIndex + offscreenPageRerenderLimit;
81
+ const becomeNeighbor = shouldRerender && !isActive;
82
+ return {
83
+ isActive,
84
+ becomeNeighbor
85
+ };
86
+ }, (nextState, prevState) => {
87
+ if (nextState.isActive !== (prevState === null || prevState === void 0 ? void 0 : prevState.isActive)) {
88
+ (0, _reactNativeReanimated.runOnJS)(onActiveStateChange)(nextState.isActive);
89
+ } else if (nextState.becomeNeighbor) {
90
+ (0, _reactNativeReanimated.runOnJS)(onBecomeNeighbor)();
91
+ }
92
+ }, [index]);
93
+ const contextValue = (0, _react.useMemo)(() => ({
94
+ isActive: pageState.isActive
95
+ }), [pageState.isActive]);
96
+ const style = _reactNative.Platform.OS === 'web' ? pageState.isActive ? _core.StyleSheet.absoluteFill : styles.none : styles.fill;
97
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
98
+ collapsable: false,
99
+ style: style
100
+ }, /*#__PURE__*/_react.default.createElement(_PageStateContext.default.Provider, {
101
+ value: contextValue
102
+ }, content));
103
+ }
40
104
 
105
+ var _default = /*#__PURE__*/(0, _react.memo)(Page, (prevProps, nextProps) => {
41
106
  if (prevProps.rerenderKey !== nextProps.rerenderKey) {
42
107
  return false;
43
108
  }
44
109
 
45
- return prevProps.children !== null && nextProps.children !== null;
110
+ return prevProps.index !== nextProps.index;
46
111
  });
47
112
 
48
113
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["ChildrenMemoizedPage.tsx"],"names":["Page","props","isVisible","otherProps","React","memo","prevProps","nextProps","children","isNeighbor","rerenderKey"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAGA,MAAMA,IAAI,GAAG,SAASA,IAAT,CAAcC,KAAd,EAAgC;AACzC,QAAM;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,MAA+BF,KAArC;AAEA,sBACI,6BAAC,iBAAD;AACI,IAAA,WAAW,EAAE;AADjB,KAEQE,UAFR,EADJ;AAMH,CATD;;4BAWeC,eAAMC,IAAN,CAAWL,IAAX,EAAiB,CAACM,SAAD,EAAYC,SAAZ,KAA0B;AACtD,MAAID,SAAS,CAACE,QAAV,KAAuB,IAAvB,IAA+BD,SAAS,CAACC,QAAV,KAAuB,IAA1D,EAAgE;AAC5D,WAAO,IAAP;AACH,GAHqD,CAKtD;AACA;;;AACA,MAAIF,SAAS,CAACJ,SAAV,KAAwBK,SAAS,CAACL,SAAtC,EAAiD;AAC7C,WAAO,KAAP;AACH;;AAED,MAAIK,SAAS,CAACL,SAAV,IAAuBK,SAAS,CAACE,UAArC,EAAiD;AAC7C,WAAO,KAAP;AACH;;AAED,MAAIH,SAAS,CAACI,WAAV,KAA0BH,SAAS,CAACG,WAAxC,EAAqD;AACjD,WAAO,KAAP;AACH;;AAED,SAAOJ,SAAS,CAACE,QAAV,KAAuB,IAAvB,IAA+BD,SAAS,CAACC,QAAV,KAAuB,IAA7D;AACH,CApBc,C","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport type { PageProps } from './ViewPagerProps';\n\nconst Page = function Page(props: PageProps) {\n const { isVisible, ...otherProps } = props;\n\n return (\n <View\n collapsable={false}\n {...otherProps}\n />\n );\n};\n\nexport default React.memo(Page, (prevProps, nextProps) => {\n if (prevProps.children === null && nextProps.children === null) {\n return true;\n }\n\n // isVisible is an important condition for determining memos on the web.\n // Reference ViewPagerWeb's return.\n if (prevProps.isVisible !== nextProps.isVisible) {\n return false;\n }\n\n if (nextProps.isVisible || nextProps.isNeighbor) {\n return false;\n }\n\n if (prevProps.rerenderKey !== nextProps.rerenderKey) {\n return false;\n }\n\n return prevProps.children !== null && nextProps.children !== null;\n});\n"]}
1
+ {"version":3,"names":["styles","StyleSheet","create","fill","width","height","none","display","Page","props","index","children","loading","offscreenPageRerenderLimit","sharedIndex","assumeInitialPageState","activeIndex","value","isActive","isLoaded","pageState","setPageState","useState","content","onActiveStateChange","prevState","onBecomeNeighbor","useAnimatedReaction","shouldRerender","becomeNeighbor","nextState","runOnJS","contextValue","useMemo","style","Platform","OS","absoluteFill","memo","prevProps","nextProps","rerenderKey"],"sources":["ChildrenMemoizedPage.tsx"],"sourcesContent":["import React, { memo, useMemo, useState } from 'react';\nimport { Platform, View } from 'react-native';\nimport { runOnJS, useAnimatedReaction } from 'react-native-reanimated';\nimport { StyleSheet } from '@fountain-ui/core';\nimport type { PageProps } from './ViewPagerProps';\nimport PageStateContext from './PageStateContext';\n\nconst styles = StyleSheet.create({\n fill: { width: '100%', height: '100%' },\n none: { display: 'none' },\n});\n\ninterface InternalPageState {\n isActive: boolean;\n isLoaded: boolean;\n}\n\nfunction Page(props: PageProps) {\n const {\n index,\n children,\n loading,\n offscreenPageRerenderLimit,\n sharedIndex,\n } = props;\n\n const assumeInitialPageState = (): InternalPageState => {\n const activeIndex = sharedIndex.value;\n\n const isActive = index === activeIndex;\n\n if (loading === 'eager') {\n return { isActive, isLoaded: true };\n }\n\n const isLoaded = index >= activeIndex - offscreenPageRerenderLimit\n && index <= activeIndex + offscreenPageRerenderLimit;\n\n return { isActive, isLoaded };\n };\n\n const [pageState, setPageState] = useState<InternalPageState>(assumeInitialPageState);\n\n const content = pageState.isLoaded ? children : null;\n\n const onActiveStateChange = (isActive: boolean) => {\n setPageState(prevState => ({\n ...prevState,\n isActive,\n isLoaded: isActive || prevState.isLoaded,\n }));\n };\n\n const onBecomeNeighbor = () => {\n setPageState(prevState => ({\n ...prevState,\n isLoaded: true,\n }));\n };\n\n useAnimatedReaction(\n () => {\n const activeIndex = sharedIndex.value;\n\n const isActive = index === activeIndex;\n\n const shouldRerender = index >= activeIndex - offscreenPageRerenderLimit\n && index <= activeIndex + offscreenPageRerenderLimit;\n\n const becomeNeighbor = shouldRerender && !isActive;\n\n return { isActive, becomeNeighbor };\n },\n (nextState, prevState) => {\n if (nextState.isActive !== prevState?.isActive) {\n runOnJS(onActiveStateChange)(nextState.isActive);\n } else if (nextState.becomeNeighbor) {\n runOnJS(onBecomeNeighbor)();\n }\n },\n [index],\n );\n\n const contextValue = useMemo(() => ({\n isActive: pageState.isActive,\n }), [pageState.isActive]);\n\n const style = Platform.OS === 'web'\n ? (pageState.isActive ? StyleSheet.absoluteFill : styles.none)\n : styles.fill;\n\n return (\n <View\n collapsable={false}\n style={style}\n >\n <PageStateContext.Provider value={contextValue}>\n {content}\n </PageStateContext.Provider>\n </View>\n );\n}\n\nexport default memo(Page, (prevProps, nextProps) => {\n if (prevProps.rerenderKey !== nextProps.rerenderKey) {\n return false;\n }\n\n return prevProps.index !== nextProps.index;\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAEA,MAAMA,MAAM,GAAGC,gBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IAAEC,KAAK,EAAE,MAAT;IAAiBC,MAAM,EAAE;EAAzB,CADuB;EAE7BC,IAAI,EAAE;IAAEC,OAAO,EAAE;EAAX;AAFuB,CAAlB,CAAf;;AAUA,SAASC,IAAT,CAAcC,KAAd,EAAgC;EAC5B,MAAM;IACFC,KADE;IAEFC,QAFE;IAGFC,OAHE;IAIFC,0BAJE;IAKFC;EALE,IAMFL,KANJ;;EAQA,MAAMM,sBAAsB,GAAG,MAAyB;IACpD,MAAMC,WAAW,GAAGF,WAAW,CAACG,KAAhC;IAEA,MAAMC,QAAQ,GAAGR,KAAK,KAAKM,WAA3B;;IAEA,IAAIJ,OAAO,KAAK,OAAhB,EAAyB;MACrB,OAAO;QAAEM,QAAF;QAAYC,QAAQ,EAAE;MAAtB,CAAP;IACH;;IAED,MAAMA,QAAQ,GAAGT,KAAK,IAAIM,WAAW,GAAGH,0BAAvB,IACVH,KAAK,IAAIM,WAAW,GAAGH,0BAD9B;IAGA,OAAO;MAAEK,QAAF;MAAYC;IAAZ,CAAP;EACH,CAbD;;EAeA,MAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4B,IAAAC,eAAA,EAA4BP,sBAA5B,CAAlC;EAEA,MAAMQ,OAAO,GAAGH,SAAS,CAACD,QAAV,GAAqBR,QAArB,GAAgC,IAAhD;;EAEA,MAAMa,mBAAmB,GAAIN,QAAD,IAAuB;IAC/CG,YAAY,CAACI,SAAS,KAAK,EACvB,GAAGA,SADoB;MAEvBP,QAFuB;MAGvBC,QAAQ,EAAED,QAAQ,IAAIO,SAAS,CAACN;IAHT,CAAL,CAAV,CAAZ;EAKH,CAND;;EAQA,MAAMO,gBAAgB,GAAG,MAAM;IAC3BL,YAAY,CAACI,SAAS,KAAK,EACvB,GAAGA,SADoB;MAEvBN,QAAQ,EAAE;IAFa,CAAL,CAAV,CAAZ;EAIH,CALD;;EAOA,IAAAQ,0CAAA,EACI,MAAM;IACF,MAAMX,WAAW,GAAGF,WAAW,CAACG,KAAhC;IAEA,MAAMC,QAAQ,GAAGR,KAAK,KAAKM,WAA3B;IAEA,MAAMY,cAAc,GAAGlB,KAAK,IAAIM,WAAW,GAAGH,0BAAvB,IAChBH,KAAK,IAAIM,WAAW,GAAGH,0BAD9B;IAGA,MAAMgB,cAAc,GAAGD,cAAc,IAAI,CAACV,QAA1C;IAEA,OAAO;MAAEA,QAAF;MAAYW;IAAZ,CAAP;EACH,CAZL,EAaI,CAACC,SAAD,EAAYL,SAAZ,KAA0B;IACtB,IAAIK,SAAS,CAACZ,QAAV,MAAuBO,SAAvB,aAAuBA,SAAvB,uBAAuBA,SAAS,CAAEP,QAAlC,CAAJ,EAAgD;MAC5C,IAAAa,8BAAA,EAAQP,mBAAR,EAA6BM,SAAS,CAACZ,QAAvC;IACH,CAFD,MAEO,IAAIY,SAAS,CAACD,cAAd,EAA8B;MACjC,IAAAE,8BAAA,EAAQL,gBAAR;IACH;EACJ,CAnBL,EAoBI,CAAChB,KAAD,CApBJ;EAuBA,MAAMsB,YAAY,GAAG,IAAAC,cAAA,EAAQ,OAAO;IAChCf,QAAQ,EAAEE,SAAS,CAACF;EADY,CAAP,CAAR,EAEjB,CAACE,SAAS,CAACF,QAAX,CAFiB,CAArB;EAIA,MAAMgB,KAAK,GAAGC,qBAAA,CAASC,EAAT,KAAgB,KAAhB,GACPhB,SAAS,CAACF,QAAV,GAAqBjB,gBAAA,CAAWoC,YAAhC,GAA+CrC,MAAM,CAACM,IAD/C,GAERN,MAAM,CAACG,IAFb;EAIA,oBACI,6BAAC,iBAAD;IACI,WAAW,EAAE,KADjB;IAEI,KAAK,EAAE+B;EAFX,gBAII,6BAAC,yBAAD,CAAkB,QAAlB;IAA2B,KAAK,EAAEF;EAAlC,GACKT,OADL,CAJJ,CADJ;AAUH;;4BAEc,IAAAe,WAAA,EAAK9B,IAAL,EAAW,CAAC+B,SAAD,EAAYC,SAAZ,KAA0B;EAChD,IAAID,SAAS,CAACE,WAAV,KAA0BD,SAAS,CAACC,WAAxC,EAAqD;IACjD,OAAO,KAAP;EACH;;EAED,OAAOF,SAAS,CAAC7B,KAAV,KAAoB8B,SAAS,CAAC9B,KAArC;AACH,CANc,C"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useViewPagerPageState = exports.default = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ const initialPageState = {
11
+ isActive: false
12
+ };
13
+ const PageStateContext = /*#__PURE__*/(0, _react.createContext)(initialPageState);
14
+
15
+ const useViewPagerPageState = () => {
16
+ return (0, _react.useContext)(PageStateContext);
17
+ };
18
+
19
+ exports.useViewPagerPageState = useViewPagerPageState;
20
+ var _default = PageStateContext;
21
+ exports.default = _default;
22
+ //# sourceMappingURL=PageStateContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["initialPageState","isActive","PageStateContext","createContext","useViewPagerPageState","useContext"],"sources":["PageStateContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\ninterface PageState {\n isActive: boolean;\n}\n\nconst initialPageState: Readonly<PageState> = { isActive: false };\n\nconst PageStateContext = createContext<PageState>(initialPageState);\n\nexport const useViewPagerPageState = () => {\n return useContext(PageStateContext);\n};\n\nexport default PageStateContext;\n"],"mappings":";;;;;;;AAAA;;AAMA,MAAMA,gBAAqC,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAA9C;AAEA,MAAMC,gBAAgB,gBAAG,IAAAC,oBAAA,EAAyBH,gBAAzB,CAAzB;;AAEO,MAAMI,qBAAqB,GAAG,MAAM;EACvC,OAAO,IAAAC,iBAAA,EAAWH,gBAAX,CAAP;AACH,CAFM;;;eAIQA,gB"}
@@ -3,70 +3,93 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = ViewPager;
6
+ exports.default = void 0;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
- var _viewpager = _interopRequireDefault(require("@react-native-community/viewpager"));
10
+ var _reactNativePagerView = _interopRequireDefault(require("react-native-pager-view"));
11
+
12
+ var _reactNativeReanimated = require("react-native-reanimated");
11
13
 
12
14
  var _utils = require("./utils");
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
- function ViewPager(props) {
18
+ 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); }
19
+
20
+ 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; }
21
+
22
+ const ViewPager = /*#__PURE__*/(0, _react.forwardRef)(function ViewPager(props, ref) {
17
23
  const {
18
24
  children,
19
- enableVisibleHint = _utils.defaultEnableVisibleHint,
20
- index,
25
+ initialPage = _utils.defaultInitialPage,
21
26
  keyboardDismissMode = 'on-drag',
22
27
  loading = _utils.defaultLoading,
28
+ offscreenPageRerenderLimit = _utils.defaultOffscreenPageRerenderLimit,
23
29
  onChange,
24
30
  pageComponent = _utils.defaultPageComponent,
25
- enableNeighborPageRerender = _utils.defaultEnableNeighborPageRerender,
26
31
  pageForceRerenderKey,
27
32
  scrollEnabled = true,
28
- style
33
+ style,
34
+ UNSTABLE_sharedIndex
29
35
  } = props;
36
+ const fallbackSharedIndex = (0, _reactNativeReanimated.useSharedValue)(initialPage);
37
+ const sharedIndex = UNSTABLE_sharedIndex ?? fallbackSharedIndex;
38
+ const pagerRef = (0, _react.useRef)(null);
39
+ const animationFrameRef = (0, _react.useRef)(NaN);
40
+ const setPage = (0, _react.useCallback)(newIndex => {
41
+ animationFrameRef.current = requestAnimationFrame(() => {
42
+ var _pagerRef$current;
30
43
 
31
- const indexRef = _react.default.useRef(index);
32
-
33
- const pagerRef = _react.default.useRef(null);
44
+ (_pagerRef$current = pagerRef.current) === null || _pagerRef$current === void 0 ? void 0 : _pagerRef$current.setPage(newIndex);
45
+ });
46
+ }, []);
47
+ (0, _react.useEffect)(() => {
48
+ return () => {
49
+ if (animationFrameRef.current) {
50
+ cancelAnimationFrame(animationFrameRef.current);
51
+ }
52
+ };
53
+ }, []);
54
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => sharedIndex.value, result => {
55
+ (0, _reactNativeReanimated.runOnJS)(setPage)(result);
56
+ }, [setPage]);
57
+ const handlePageSelected = (0, _react.useCallback)(e => {
58
+ const currentIndex = sharedIndex.value;
59
+ const nextIndex = e.nativeEvent.position;
34
60
 
35
- const renderer = (0, _utils.usePageRenderer)({
36
- enableVisibleHint,
37
- index,
38
- loading,
39
- pageComponent,
40
- pageForceRerenderKey,
41
- enableNeighborPageRerender
42
- });
61
+ if (currentIndex === nextIndex) {
62
+ return;
63
+ }
43
64
 
44
- const handlePageSelected = _react.default.useCallback(e => {
45
- indexRef.current = e.nativeEvent.position;
65
+ sharedIndex.value = nextIndex;
46
66
 
47
67
  if (onChange) {
48
- onChange(indexRef.current);
68
+ onChange(nextIndex);
49
69
  }
50
70
  }, [onChange]);
51
-
52
- _react.default.useEffect(() => {
53
- if (index !== indexRef.current) {
54
- var _pagerRef$current;
55
-
56
- (_pagerRef$current = pagerRef.current) === null || _pagerRef$current === void 0 ? void 0 : _pagerRef$current.setPage(index);
57
- }
58
- }, [index]);
59
-
60
- return /*#__PURE__*/_react.default.createElement(_viewpager.default, {
61
- initialPage: index,
71
+ (0, _react.useImperativeHandle)(ref, () => ({
72
+ setPage
73
+ }), [setPage]);
74
+ const PageComponent = pageComponent;
75
+ return /*#__PURE__*/_react.default.createElement(_reactNativePagerView.default, {
76
+ ref: pagerRef,
77
+ initialPage: initialPage,
62
78
  keyboardDismissMode: keyboardDismissMode,
63
79
  onPageSelected: handlePageSelected,
64
80
  pageMargin: 8,
65
- ref: pagerRef,
66
81
  scrollEnabled: scrollEnabled,
67
82
  style: style
68
- }, renderer(children));
69
- }
70
-
71
- ;
83
+ }, _react.Children.map(children, (child, index) => /*#__PURE__*/_react.default.createElement(PageComponent, {
84
+ key: index,
85
+ children: child,
86
+ index: index,
87
+ loading: loading,
88
+ offscreenPageRerenderLimit: offscreenPageRerenderLimit,
89
+ rerenderKey: pageForceRerenderKey,
90
+ sharedIndex: sharedIndex
91
+ })));
92
+ });
93
+ var _default = ViewPager;
94
+ exports.default = _default;
72
95
  //# sourceMappingURL=ViewPagerNative.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ViewPagerNative.tsx"],"names":["ViewPager","props","children","enableVisibleHint","defaultEnableVisibleHint","index","keyboardDismissMode","loading","defaultLoading","onChange","pageComponent","defaultPageComponent","enableNeighborPageRerender","defaultEnableNeighborPageRerender","pageForceRerenderKey","scrollEnabled","style","indexRef","React","useRef","pagerRef","renderer","handlePageSelected","useCallback","e","current","nativeEvent","position","useEffect","setPage"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAQe,SAASA,SAAT,CAAmBC,KAAnB,EAA0C;AACrD,QAAM;AACFC,IAAAA,QADE;AAEFC,IAAAA,iBAAiB,GAAGC,+BAFlB;AAGFC,IAAAA,KAHE;AAIFC,IAAAA,mBAAmB,GAAG,SAJpB;AAKFC,IAAAA,OAAO,GAAGC,qBALR;AAMFC,IAAAA,QANE;AAOFC,IAAAA,aAAa,GAAGC,2BAPd;AAQFC,IAAAA,0BAA0B,GAAGC,wCAR3B;AASFC,IAAAA,oBATE;AAUFC,IAAAA,aAAa,GAAG,IAVd;AAWFC,IAAAA;AAXE,MAYFf,KAZJ;;AAcA,QAAMgB,QAAQ,GAAGC,eAAMC,MAAN,CAAqBd,KAArB,CAAjB;;AACA,QAAMe,QAAQ,GAAGF,eAAMC,MAAN,CAAiC,IAAjC,CAAjB;;AAEA,QAAME,QAAQ,GAAG,4BAAgB;AAC7BlB,IAAAA,iBAD6B;AAE7BE,IAAAA,KAF6B;AAG7BE,IAAAA,OAH6B;AAI7BG,IAAAA,aAJ6B;AAK7BI,IAAAA,oBAL6B;AAM7BF,IAAAA;AAN6B,GAAhB,CAAjB;;AASA,QAAMU,kBAAkB,GAAGJ,eAAMK,WAAN,CAAmBC,CAAD,IAAqC;AAC9EP,IAAAA,QAAQ,CAACQ,OAAT,GAAmBD,CAAC,CAACE,WAAF,CAAcC,QAAjC;;AAEA,QAAIlB,QAAJ,EAAc;AACVA,MAAAA,QAAQ,CAACQ,QAAQ,CAACQ,OAAV,CAAR;AACH;AACJ,GAN0B,EAMxB,CAAChB,QAAD,CANwB,CAA3B;;AAQAS,iBAAMU,SAAN,CAAgB,MAAM;AAClB,QAAIvB,KAAK,KAAKY,QAAQ,CAACQ,OAAvB,EAAgC;AAAA;;AAC5B,2BAAAL,QAAQ,CAACK,OAAT,wEAAkBI,OAAlB,CAA0BxB,KAA1B;AACH;AACJ,GAJD,EAIG,CAACA,KAAD,CAJH;;AAMA,sBACI,6BAAC,kBAAD;AACI,IAAA,WAAW,EAAEA,KADjB;AAEI,IAAA,mBAAmB,EAAEC,mBAFzB;AAGI,IAAA,cAAc,EAAEgB,kBAHpB;AAII,IAAA,UAAU,EAAE,CAJhB;AAKI,IAAA,GAAG,EAAEF,QALT;AAMI,IAAA,aAAa,EAAEL,aANnB;AAOI,IAAA,KAAK,EAAEC;AAPX,KASKK,QAAQ,CAACnB,QAAD,CATb,CADJ;AAaH;;AAAA","sourcesContent":["import React from 'react';\nimport RNViewPager, { ViewPagerOnPageSelectedEvent } from '@react-native-community/viewpager';\nimport type ViewPagerProps from './ViewPagerProps';\nimport {\n defaultEnableNeighborPageRerender,\n defaultEnableVisibleHint,\n defaultLoading,\n defaultPageComponent,\n usePageRenderer,\n} from './utils';\n\nexport default function ViewPager(props: ViewPagerProps) {\n const {\n children,\n enableVisibleHint = defaultEnableVisibleHint,\n index,\n keyboardDismissMode = 'on-drag',\n loading = defaultLoading,\n onChange,\n pageComponent = defaultPageComponent,\n enableNeighborPageRerender = defaultEnableNeighborPageRerender,\n pageForceRerenderKey,\n scrollEnabled = true,\n style,\n } = props;\n\n const indexRef = React.useRef<number>(index);\n const pagerRef = React.useRef<RNViewPager | null>(null);\n\n const renderer = usePageRenderer({\n enableVisibleHint,\n index,\n loading,\n pageComponent,\n pageForceRerenderKey,\n enableNeighborPageRerender,\n });\n\n const handlePageSelected = React.useCallback((e: ViewPagerOnPageSelectedEvent) => {\n indexRef.current = e.nativeEvent.position;\n\n if (onChange) {\n onChange(indexRef.current);\n }\n }, [onChange]);\n\n React.useEffect(() => {\n if (index !== indexRef.current) {\n pagerRef.current?.setPage(index);\n }\n }, [index]);\n\n return (\n <RNViewPager\n initialPage={index}\n keyboardDismissMode={keyboardDismissMode}\n onPageSelected={handlePageSelected}\n pageMargin={8}\n ref={pagerRef}\n scrollEnabled={scrollEnabled}\n style={style}\n >\n {renderer(children)}\n </RNViewPager>\n );\n};\n"]}
1
+ {"version":3,"names":["ViewPager","forwardRef","props","ref","children","initialPage","defaultInitialPage","keyboardDismissMode","loading","defaultLoading","offscreenPageRerenderLimit","defaultOffscreenPageRerenderLimit","onChange","pageComponent","defaultPageComponent","pageForceRerenderKey","scrollEnabled","style","UNSTABLE_sharedIndex","fallbackSharedIndex","useSharedValue","sharedIndex","pagerRef","useRef","animationFrameRef","NaN","setPage","useCallback","newIndex","current","requestAnimationFrame","useEffect","cancelAnimationFrame","useAnimatedReaction","value","result","runOnJS","handlePageSelected","e","currentIndex","nextIndex","nativeEvent","position","useImperativeHandle","PageComponent","Children","map","child","index"],"sources":["ViewPagerNative.tsx"],"sourcesContent":["import React, { Children, forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';\nimport type { ViewPagerOnPageSelectedEvent } from 'react-native-pager-view';\nimport RNViewPager from 'react-native-pager-view';\nimport { runOnJS, useAnimatedReaction, useSharedValue } from 'react-native-reanimated';\nimport type ViewPagerProps from './ViewPagerProps';\nimport type { ViewPagerInstance } from './ViewPagerProps';\nimport { defaultInitialPage, defaultLoading, defaultOffscreenPageRerenderLimit, defaultPageComponent } from './utils';\n\nconst ViewPager = forwardRef<ViewPagerInstance, ViewPagerProps>(function ViewPager(props, ref) {\n const {\n children,\n initialPage = defaultInitialPage,\n keyboardDismissMode = 'on-drag',\n loading = defaultLoading,\n offscreenPageRerenderLimit = defaultOffscreenPageRerenderLimit,\n onChange,\n pageComponent = defaultPageComponent,\n pageForceRerenderKey,\n scrollEnabled = true,\n style,\n UNSTABLE_sharedIndex,\n } = props;\n\n const fallbackSharedIndex = useSharedValue<number>(initialPage);\n\n const sharedIndex = UNSTABLE_sharedIndex ?? fallbackSharedIndex;\n\n const pagerRef = useRef<RNViewPager | null>(null);\n\n const animationFrameRef = useRef<number>(NaN);\n\n const setPage = useCallback((newIndex: number) => {\n animationFrameRef.current = requestAnimationFrame(() => {\n pagerRef.current?.setPage(newIndex);\n });\n }, []);\n\n useEffect(() => {\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current);\n }\n };\n }, []);\n\n useAnimatedReaction(\n () => sharedIndex.value,\n (result) => {\n runOnJS(setPage)(result);\n },\n [setPage],\n );\n\n const handlePageSelected = useCallback((e: ViewPagerOnPageSelectedEvent) => {\n const currentIndex = sharedIndex.value;\n const nextIndex = e.nativeEvent.position;\n\n if (currentIndex === nextIndex) {\n return;\n }\n\n sharedIndex.value = nextIndex;\n\n if (onChange) {\n onChange(nextIndex);\n }\n }, [onChange]);\n\n useImperativeHandle(\n ref,\n () => ({ setPage }),\n [setPage],\n );\n\n const PageComponent = pageComponent;\n\n return (\n <RNViewPager\n ref={pagerRef}\n initialPage={initialPage}\n keyboardDismissMode={keyboardDismissMode}\n onPageSelected={handlePageSelected}\n pageMargin={8}\n scrollEnabled={scrollEnabled}\n style={style}\n >\n {Children.map(children, (child, index) => (\n <PageComponent\n key={index}\n children={child}\n index={index}\n loading={loading}\n offscreenPageRerenderLimit={offscreenPageRerenderLimit}\n rerenderKey={pageForceRerenderKey}\n sharedIndex={sharedIndex}\n />\n ))}\n </RNViewPager>\n );\n});\n\nexport default ViewPager;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAGA;;;;;;;;AAEA,MAAMA,SAAS,gBAAG,IAAAC,iBAAA,EAA8C,SAASD,SAAT,CAAmBE,KAAnB,EAA0BC,GAA1B,EAA+B;EAC3F,MAAM;IACFC,QADE;IAEFC,WAAW,GAAGC,yBAFZ;IAGFC,mBAAmB,GAAG,SAHpB;IAIFC,OAAO,GAAGC,qBAJR;IAKFC,0BAA0B,GAAGC,wCAL3B;IAMFC,QANE;IAOFC,aAAa,GAAGC,2BAPd;IAQFC,oBARE;IASFC,aAAa,GAAG,IATd;IAUFC,KAVE;IAWFC;EAXE,IAYFhB,KAZJ;EAcA,MAAMiB,mBAAmB,GAAG,IAAAC,qCAAA,EAAuBf,WAAvB,CAA5B;EAEA,MAAMgB,WAAW,GAAGH,oBAAoB,IAAIC,mBAA5C;EAEA,MAAMG,QAAQ,GAAG,IAAAC,aAAA,EAA2B,IAA3B,CAAjB;EAEA,MAAMC,iBAAiB,GAAG,IAAAD,aAAA,EAAeE,GAAf,CAA1B;EAEA,MAAMC,OAAO,GAAG,IAAAC,kBAAA,EAAaC,QAAD,IAAsB;IAC9CJ,iBAAiB,CAACK,OAAlB,GAA4BC,qBAAqB,CAAC,MAAM;MAAA;;MACpD,qBAAAR,QAAQ,CAACO,OAAT,wEAAkBH,OAAlB,CAA0BE,QAA1B;IACH,CAFgD,CAAjD;EAGH,CAJe,EAIb,EAJa,CAAhB;EAMA,IAAAG,gBAAA,EAAU,MAAM;IACZ,OAAO,MAAM;MACT,IAAIP,iBAAiB,CAACK,OAAtB,EAA+B;QAC3BG,oBAAoB,CAACR,iBAAiB,CAACK,OAAnB,CAApB;MACH;IACJ,CAJD;EAKH,CAND,EAMG,EANH;EAQA,IAAAI,0CAAA,EACI,MAAMZ,WAAW,CAACa,KADtB,EAEKC,MAAD,IAAY;IACR,IAAAC,8BAAA,EAAQV,OAAR,EAAiBS,MAAjB;EACH,CAJL,EAKI,CAACT,OAAD,CALJ;EAQA,MAAMW,kBAAkB,GAAG,IAAAV,kBAAA,EAAaW,CAAD,IAAqC;IACxE,MAAMC,YAAY,GAAGlB,WAAW,CAACa,KAAjC;IACA,MAAMM,SAAS,GAAGF,CAAC,CAACG,WAAF,CAAcC,QAAhC;;IAEA,IAAIH,YAAY,KAAKC,SAArB,EAAgC;MAC5B;IACH;;IAEDnB,WAAW,CAACa,KAAZ,GAAoBM,SAApB;;IAEA,IAAI5B,QAAJ,EAAc;MACVA,QAAQ,CAAC4B,SAAD,CAAR;IACH;EACJ,CAb0B,EAaxB,CAAC5B,QAAD,CAbwB,CAA3B;EAeA,IAAA+B,0BAAA,EACIxC,GADJ,EAEI,OAAO;IAAEuB;EAAF,CAAP,CAFJ,EAGI,CAACA,OAAD,CAHJ;EAMA,MAAMkB,aAAa,GAAG/B,aAAtB;EAEA,oBACI,6BAAC,6BAAD;IACI,GAAG,EAAES,QADT;IAEI,WAAW,EAAEjB,WAFjB;IAGI,mBAAmB,EAAEE,mBAHzB;IAII,cAAc,EAAE8B,kBAJpB;IAKI,UAAU,EAAE,CALhB;IAMI,aAAa,EAAErB,aANnB;IAOI,KAAK,EAAEC;EAPX,GASK4B,eAAA,CAASC,GAAT,CAAa1C,QAAb,EAAuB,CAAC2C,KAAD,EAAQC,KAAR,kBACpB,6BAAC,aAAD;IACI,GAAG,EAAEA,KADT;IAEI,QAAQ,EAAED,KAFd;IAGI,KAAK,EAAEC,KAHX;IAII,OAAO,EAAExC,OAJb;IAKI,0BAA0B,EAAEE,0BALhC;IAMI,WAAW,EAAEK,oBANjB;IAOI,WAAW,EAAEM;EAPjB,EADH,CATL,CADJ;AAuBH,CA3FiB,CAAlB;eA6FerB,S"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["ViewPagerProps.ts"],"sourcesContent":["import type { ComponentType, PropsWithChildren, ReactNode, Ref } from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { SharedValue } from 'react-native-reanimated';\nimport type { ComponentProps } from '@fountain-ui/core';\n\nexport type KeyboardDismissMode = 'none' | 'on-drag';\n\nexport type PageProps = PropsWithChildren<ViewProps> & {\n index: number;\n loading: ViewPagerProps['loading'];\n offscreenPageRerenderLimit: number;\n sharedIndex: SharedValue<number>;\n rerenderKey?: ViewPagerProps['pageForceRerenderKey'];\n};\n\nexport type PageComponent = ComponentType<PageProps>;\n\nexport type Loading = 'lazy' | 'eager';\n\nexport interface ViewPagerInstance {\n /**\n * Function to scroll to a specific page in the ViewPager. Invalid index is ignored.\n * @param index\n */\n setPage: (index: number) => void;\n}\n\nexport default interface ViewPagerProps extends ComponentProps<{\n ref?: Ref<ViewPagerInstance>;\n\n /**\n * Collection of ViewPager components.\n */\n children?: ReactNode;\n\n /**\n * Index of initial page that should be selected.\n * @default 0\n */\n initialPage?: number;\n\n /**\n * Whether to load the page immediately (`eager`) or on an as-needed basis (`lazy`).\n * @default 'lazy'\n */\n loading?: Loading;\n\n /**\n * Mobile only. The number of pages that should be re-rendered to either side of the current page.\n * Changing this value after the component mount has no effect.\n * @default 0\n */\n offscreenPageRerenderLimit?: number;\n\n /**\n * Callback fired when an index is changed.\n */\n onChange?: (newIndex: number) => void,\n\n /**\n * The component used to render the wrapper of the page.\n * @default 'ChildrenMemoizedPage'\n */\n pageComponent?: PageComponent,\n\n /**\n * When this value is changed, page will be rerender.\n */\n pageForceRerenderKey?: any;\n\n /**\n * Mobile only. Should pager view scroll, when scroll enabled.\n * @default true\n */\n scrollEnabled?: boolean;\n\n /**\n * Mobile only. Determines whether the keyboard gets dismissed in response to a drag.\n * @default 'on-drag'\n */\n keyboardDismissMode?: KeyboardDismissMode;\n\n /**\n * Unstable API.\n */\n UNSTABLE_sharedIndex?: SharedValue<number>;\n}> {}\n"],"mappings":""}