react-native-reanimated-carousel 5.0.0-beta.7 → 5.0.0

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 (428) hide show
  1. package/README.md +60 -28
  2. package/lib/commonjs/components/Carousel.js +1 -1
  3. package/lib/commonjs/components/Carousel.js.map +1 -1
  4. package/lib/commonjs/components/CarouselLayout.js +1 -1
  5. package/lib/commonjs/components/CarouselLayout.js.map +1 -1
  6. package/lib/commonjs/components/ItemLayout.js +1 -1
  7. package/lib/commonjs/components/ItemLayout.js.map +1 -1
  8. package/lib/commonjs/components/ItemRenderer.js +1 -1
  9. package/lib/commonjs/components/ItemRenderer.js.map +1 -1
  10. package/lib/commonjs/components/Pagination/PaginationItem.js +2 -0
  11. package/lib/commonjs/components/Pagination/PaginationItem.js.map +1 -0
  12. package/lib/commonjs/components/Pagination/index.js +1 -1
  13. package/lib/commonjs/components/Pagination/index.js.map +1 -1
  14. package/lib/commonjs/components/ScrollViewGesture.js +1 -1
  15. package/lib/commonjs/components/ScrollViewGesture.js.map +1 -1
  16. package/lib/commonjs/hooks/useAutoPlay.js +1 -1
  17. package/lib/commonjs/hooks/useAutoPlay.js.map +1 -1
  18. package/lib/commonjs/hooks/useCarouselController.js +1 -1
  19. package/lib/commonjs/hooks/useCarouselController.js.map +1 -1
  20. package/lib/commonjs/hooks/useCommonVariables.js +1 -1
  21. package/lib/commonjs/hooks/useCommonVariables.js.map +1 -1
  22. package/lib/commonjs/hooks/useInitProps.js +1 -1
  23. package/lib/commonjs/hooks/useInitProps.js.map +1 -1
  24. package/lib/commonjs/hooks/useLayoutConfig.js +1 -1
  25. package/lib/commonjs/hooks/useLayoutConfig.js.map +1 -1
  26. package/lib/commonjs/hooks/useOffsetX.js.map +1 -1
  27. package/lib/commonjs/hooks/useOnProgressChange.js +1 -1
  28. package/lib/commonjs/hooks/useOnProgressChange.js.map +1 -1
  29. package/lib/commonjs/hooks/usePanGestureProxy.js.map +1 -1
  30. package/lib/commonjs/hooks/usePropsErrorBoundary.js +1 -1
  31. package/lib/commonjs/hooks/usePropsErrorBoundary.js.map +1 -1
  32. package/lib/commonjs/hooks/useUpdateGestureConfig.js.map +1 -1
  33. package/lib/commonjs/hooks/useVisibleRanges.js.map +1 -1
  34. package/lib/commonjs/index.js +1 -1
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/commonjs/layouts/index.js.map +1 -1
  37. package/lib/commonjs/layouts/normal.js +1 -1
  38. package/lib/commonjs/layouts/normal.js.map +1 -1
  39. package/lib/commonjs/layouts/parallax.js +1 -1
  40. package/lib/commonjs/layouts/parallax.js.map +1 -1
  41. package/lib/commonjs/layouts/stack.js +1 -1
  42. package/lib/commonjs/layouts/stack.js.map +1 -1
  43. package/lib/commonjs/public-types.js +2 -0
  44. package/lib/commonjs/public-types.js.map +1 -0
  45. package/lib/commonjs/store/index.js.map +1 -1
  46. package/lib/commonjs/utils/carousel-direction.js +2 -0
  47. package/lib/commonjs/utils/carousel-direction.js.map +1 -0
  48. package/lib/commonjs/utils/carousel-math.js +2 -0
  49. package/lib/commonjs/utils/carousel-math.js.map +1 -0
  50. package/lib/commonjs/utils/deal-with-animation.js +1 -1
  51. package/lib/commonjs/utils/deal-with-animation.js.map +1 -1
  52. package/lib/module/components/Carousel.js +1 -1
  53. package/lib/module/components/Carousel.js.map +1 -1
  54. package/lib/module/components/CarouselLayout.js +1 -1
  55. package/lib/module/components/CarouselLayout.js.map +1 -1
  56. package/lib/module/components/ItemLayout.js +1 -1
  57. package/lib/module/components/ItemLayout.js.map +1 -1
  58. package/lib/module/components/ItemRenderer.js +1 -1
  59. package/lib/module/components/ItemRenderer.js.map +1 -1
  60. package/lib/module/components/LazyView.js +1 -1
  61. package/lib/module/components/LazyView.js.map +1 -1
  62. package/lib/module/components/Pagination/PaginationItem.js +2 -0
  63. package/lib/module/components/Pagination/PaginationItem.js.map +1 -0
  64. package/lib/module/components/Pagination/index.js +1 -1
  65. package/lib/module/components/Pagination/index.js.map +1 -1
  66. package/lib/module/components/ScrollViewGesture.js +1 -1
  67. package/lib/module/components/ScrollViewGesture.js.map +1 -1
  68. package/lib/module/constants/index.js +1 -1
  69. package/lib/module/constants/index.js.map +1 -1
  70. package/lib/module/hooks/useAutoPlay.js +1 -1
  71. package/lib/module/hooks/useAutoPlay.js.map +1 -1
  72. package/lib/module/hooks/useCarouselController.js +1 -1
  73. package/lib/module/hooks/useCarouselController.js.map +1 -1
  74. package/lib/module/hooks/useCheckMounted.js +1 -1
  75. package/lib/module/hooks/useCheckMounted.js.map +1 -1
  76. package/lib/module/hooks/useCommonVariables.js +1 -1
  77. package/lib/module/hooks/useCommonVariables.js.map +1 -1
  78. package/lib/module/hooks/useInitProps.js +1 -1
  79. package/lib/module/hooks/useInitProps.js.map +1 -1
  80. package/lib/module/hooks/useLayoutConfig.js +1 -1
  81. package/lib/module/hooks/useLayoutConfig.js.map +1 -1
  82. package/lib/module/hooks/useOffsetX.js +1 -1
  83. package/lib/module/hooks/useOffsetX.js.map +1 -1
  84. package/lib/module/hooks/useOnProgressChange.js +1 -1
  85. package/lib/module/hooks/useOnProgressChange.js.map +1 -1
  86. package/lib/module/hooks/usePanGestureProxy.js +1 -1
  87. package/lib/module/hooks/usePanGestureProxy.js.map +1 -1
  88. package/lib/module/hooks/usePropsErrorBoundary.js +1 -1
  89. package/lib/module/hooks/usePropsErrorBoundary.js.map +1 -1
  90. package/lib/module/hooks/useUpdateGestureConfig.js +1 -1
  91. package/lib/module/hooks/useUpdateGestureConfig.js.map +1 -1
  92. package/lib/module/hooks/useVisibleRanges.js +1 -1
  93. package/lib/module/hooks/useVisibleRanges.js.map +1 -1
  94. package/lib/module/index.js +1 -1
  95. package/lib/module/index.js.map +1 -1
  96. package/lib/module/layouts/index.js +1 -1
  97. package/lib/module/layouts/index.js.map +1 -1
  98. package/lib/module/layouts/normal.js +1 -1
  99. package/lib/module/layouts/normal.js.map +1 -1
  100. package/lib/module/layouts/parallax.js +1 -1
  101. package/lib/module/layouts/parallax.js.map +1 -1
  102. package/lib/module/layouts/stack.js +1 -1
  103. package/lib/module/layouts/stack.js.map +1 -1
  104. package/lib/module/package.json +1 -0
  105. package/lib/module/public-types.js +2 -0
  106. package/lib/module/public-types.js.map +1 -0
  107. package/lib/module/store/index.js +1 -1
  108. package/lib/module/store/index.js.map +1 -1
  109. package/lib/module/types.js +1 -1
  110. package/lib/module/utils/carousel-direction.js +2 -0
  111. package/lib/module/utils/carousel-direction.js.map +1 -0
  112. package/lib/module/utils/carousel-math.js +2 -0
  113. package/lib/module/utils/carousel-math.js.map +1 -0
  114. package/lib/module/utils/compute-gesture-translation.js +1 -1
  115. package/lib/module/utils/compute-gesture-translation.js.map +1 -1
  116. package/lib/module/utils/compute-offset-if-size-changed.js +1 -1
  117. package/lib/module/utils/compute-offset-if-size-changed.js.map +1 -1
  118. package/lib/module/utils/computed-with-auto-fill-data.js +1 -1
  119. package/lib/module/utils/computed-with-auto-fill-data.js.map +1 -1
  120. package/lib/module/utils/deal-with-animation.js +1 -1
  121. package/lib/module/utils/deal-with-animation.js.map +1 -1
  122. package/lib/module/utils/log.js +1 -1
  123. package/lib/module/utils/log.js.map +1 -1
  124. package/lib/module/utils/sanitize-animation-style.js +1 -1
  125. package/lib/module/utils/sanitize-animation-style.js.map +1 -1
  126. package/lib/typescript/commonjs/components/Carousel.d.ts +8 -0
  127. package/lib/typescript/commonjs/components/Carousel.d.ts.map +1 -0
  128. package/lib/typescript/{components → commonjs/components}/CarouselLayout.d.ts +5 -8
  129. package/lib/typescript/commonjs/components/CarouselLayout.d.ts.map +1 -0
  130. package/lib/typescript/{components → commonjs/components}/ItemLayout.d.ts +7 -6
  131. package/lib/typescript/commonjs/components/ItemLayout.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/components/ItemRenderer.d.ts +24 -0
  133. package/lib/typescript/commonjs/components/ItemRenderer.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/components/LazyView.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/components/Pagination/PaginationItem.d.ts +14 -0
  136. package/lib/typescript/commonjs/components/Pagination/PaginationItem.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/components/Pagination/index.d.ts +4 -0
  138. package/lib/typescript/commonjs/components/Pagination/index.d.ts.map +1 -0
  139. package/lib/typescript/{components → commonjs/components}/ScrollViewGesture.d.ts +3 -4
  140. package/lib/typescript/commonjs/components/ScrollViewGesture.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/constants/index.d.ts.map +1 -0
  142. package/lib/typescript/commonjs/hooks/useAutoPlay.d.ts +12 -0
  143. package/lib/typescript/commonjs/hooks/useAutoPlay.d.ts.map +1 -0
  144. package/lib/typescript/commonjs/hooks/useCarouselController.d.ts +29 -0
  145. package/lib/typescript/commonjs/hooks/useCarouselController.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/hooks/useCheckMounted.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/hooks/useCommonVariables.d.ts +18 -0
  148. package/lib/typescript/commonjs/hooks/useCommonVariables.d.ts.map +1 -0
  149. package/lib/typescript/commonjs/hooks/useInitProps.d.ts +25 -0
  150. package/lib/typescript/commonjs/hooks/useInitProps.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/hooks/useLayoutConfig.d.ts +8 -0
  152. package/lib/typescript/commonjs/hooks/useLayoutConfig.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/hooks/useOffsetX.d.ts +13 -0
  154. package/lib/typescript/commonjs/hooks/useOffsetX.d.ts.map +1 -0
  155. package/lib/typescript/commonjs/hooks/useOnProgressChange.d.ts +12 -0
  156. package/lib/typescript/commonjs/hooks/useOnProgressChange.d.ts.map +1 -0
  157. package/lib/typescript/{hooks → commonjs/hooks}/usePanGestureProxy.d.ts +3 -2
  158. package/lib/typescript/commonjs/hooks/usePanGestureProxy.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/hooks/usePropsErrorBoundary.d.ts +3 -0
  160. package/lib/typescript/commonjs/hooks/usePropsErrorBoundary.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/hooks/useUpdateGestureConfig.d.ts +9 -0
  162. package/lib/typescript/commonjs/hooks/useUpdateGestureConfig.d.ts.map +1 -0
  163. package/lib/typescript/{hooks → commonjs/hooks}/useVisibleRanges.d.ts +2 -2
  164. package/lib/typescript/commonjs/hooks/useVisibleRanges.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/index.d.ts +4 -0
  166. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  167. package/lib/typescript/{layouts → commonjs/layouts}/index.d.ts +0 -1
  168. package/lib/typescript/commonjs/layouts/index.d.ts.map +1 -0
  169. package/lib/typescript/{layouts → commonjs/layouts}/normal.d.ts +3 -1
  170. package/lib/typescript/commonjs/layouts/normal.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/layouts/parallax.d.ts +27 -0
  172. package/lib/typescript/commonjs/layouts/parallax.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/layouts/stack.d.ts +10 -0
  174. package/lib/typescript/commonjs/layouts/stack.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/package.json +1 -0
  176. package/lib/typescript/commonjs/public-types.d.ts +161 -0
  177. package/lib/typescript/commonjs/public-types.d.ts.map +1 -0
  178. package/lib/typescript/{store → commonjs/store}/index.d.ts +8 -8
  179. package/lib/typescript/commonjs/store/index.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/types.d.ts +15 -0
  181. package/lib/typescript/commonjs/types.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/utils/carousel-direction.d.ts +9 -0
  183. package/lib/typescript/commonjs/utils/carousel-direction.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/utils/carousel-math.d.ts +28 -0
  185. package/lib/typescript/commonjs/utils/carousel-math.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/utils/compute-gesture-translation.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/utils/compute-offset-if-size-changed.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/utils/computed-with-auto-fill-data.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/utils/deal-with-animation.d.ts +3 -0
  190. package/lib/typescript/commonjs/utils/deal-with-animation.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/utils/log.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/utils/sanitize-animation-style.d.ts.map +1 -0
  193. package/lib/typescript/module/components/Carousel.d.ts +8 -0
  194. package/lib/typescript/module/components/Carousel.d.ts.map +1 -0
  195. package/lib/typescript/module/components/CarouselLayout.d.ts +14 -0
  196. package/lib/typescript/module/components/CarouselLayout.d.ts.map +1 -0
  197. package/lib/typescript/module/components/ItemLayout.d.ts +21 -0
  198. package/lib/typescript/module/components/ItemLayout.d.ts.map +1 -0
  199. package/lib/typescript/module/components/ItemRenderer.d.ts +24 -0
  200. package/lib/typescript/module/components/ItemRenderer.d.ts.map +1 -0
  201. package/lib/typescript/module/components/LazyView.d.ts +8 -0
  202. package/lib/typescript/module/components/LazyView.d.ts.map +1 -0
  203. package/lib/typescript/module/components/Pagination/PaginationItem.d.ts +14 -0
  204. package/lib/typescript/module/components/Pagination/PaginationItem.d.ts.map +1 -0
  205. package/lib/typescript/module/components/Pagination/index.d.ts +4 -0
  206. package/lib/typescript/module/components/Pagination/index.d.ts.map +1 -0
  207. package/lib/typescript/module/components/ScrollViewGesture.d.ts +18 -0
  208. package/lib/typescript/module/components/ScrollViewGesture.d.ts.map +1 -0
  209. package/lib/typescript/module/constants/index.d.ts +9 -0
  210. package/lib/typescript/module/constants/index.d.ts.map +1 -0
  211. package/lib/typescript/module/hooks/useAutoPlay.d.ts +12 -0
  212. package/lib/typescript/module/hooks/useAutoPlay.d.ts.map +1 -0
  213. package/lib/typescript/module/hooks/useCarouselController.d.ts +29 -0
  214. package/lib/typescript/module/hooks/useCarouselController.d.ts.map +1 -0
  215. package/lib/typescript/module/hooks/useCheckMounted.d.ts +3 -0
  216. package/lib/typescript/module/hooks/useCheckMounted.d.ts.map +1 -0
  217. package/lib/typescript/module/hooks/useCommonVariables.d.ts +18 -0
  218. package/lib/typescript/module/hooks/useCommonVariables.d.ts.map +1 -0
  219. package/lib/typescript/module/hooks/useInitProps.d.ts +25 -0
  220. package/lib/typescript/module/hooks/useInitProps.d.ts.map +1 -0
  221. package/lib/typescript/module/hooks/useLayoutConfig.d.ts +8 -0
  222. package/lib/typescript/module/hooks/useLayoutConfig.d.ts.map +1 -0
  223. package/lib/typescript/module/hooks/useOffsetX.d.ts +13 -0
  224. package/lib/typescript/module/hooks/useOffsetX.d.ts.map +1 -0
  225. package/lib/typescript/module/hooks/useOnProgressChange.d.ts +12 -0
  226. package/lib/typescript/module/hooks/useOnProgressChange.d.ts.map +1 -0
  227. package/lib/typescript/module/hooks/usePanGestureProxy.d.ts +11 -0
  228. package/lib/typescript/module/hooks/usePanGestureProxy.d.ts.map +1 -0
  229. package/lib/typescript/module/hooks/usePropsErrorBoundary.d.ts +3 -0
  230. package/lib/typescript/module/hooks/usePropsErrorBoundary.d.ts.map +1 -0
  231. package/lib/typescript/module/hooks/useUpdateGestureConfig.d.ts +9 -0
  232. package/lib/typescript/module/hooks/useUpdateGestureConfig.d.ts.map +1 -0
  233. package/lib/typescript/module/hooks/useVisibleRanges.d.ts +22 -0
  234. package/lib/typescript/module/hooks/useVisibleRanges.d.ts.map +1 -0
  235. package/lib/typescript/module/index.d.ts +4 -0
  236. package/lib/typescript/module/index.d.ts.map +1 -0
  237. package/lib/typescript/module/layouts/index.d.ts +10 -0
  238. package/lib/typescript/module/layouts/index.d.ts.map +1 -0
  239. package/lib/typescript/module/layouts/normal.d.ts +15 -0
  240. package/lib/typescript/module/layouts/normal.d.ts.map +1 -0
  241. package/lib/typescript/module/layouts/parallax.d.ts +27 -0
  242. package/lib/typescript/module/layouts/parallax.d.ts.map +1 -0
  243. package/lib/typescript/module/layouts/stack.d.ts +10 -0
  244. package/lib/typescript/module/layouts/stack.d.ts.map +1 -0
  245. package/lib/typescript/module/package.json +1 -0
  246. package/lib/typescript/module/public-types.d.ts +161 -0
  247. package/lib/typescript/module/public-types.d.ts.map +1 -0
  248. package/lib/typescript/module/store/index.d.ts +35 -0
  249. package/lib/typescript/module/store/index.d.ts.map +1 -0
  250. package/lib/typescript/module/types.d.ts +15 -0
  251. package/lib/typescript/module/types.d.ts.map +1 -0
  252. package/lib/typescript/module/utils/carousel-direction.d.ts +9 -0
  253. package/lib/typescript/module/utils/carousel-direction.d.ts.map +1 -0
  254. package/lib/typescript/module/utils/carousel-math.d.ts +28 -0
  255. package/lib/typescript/module/utils/carousel-math.d.ts.map +1 -0
  256. package/lib/typescript/module/utils/compute-gesture-translation.d.ts +9 -0
  257. package/lib/typescript/module/utils/compute-gesture-translation.d.ts.map +1 -0
  258. package/lib/typescript/module/utils/compute-offset-if-size-changed.d.ts +6 -0
  259. package/lib/typescript/module/utils/compute-offset-if-size-changed.d.ts.map +1 -0
  260. package/lib/typescript/module/utils/computed-with-auto-fill-data.d.ts +23 -0
  261. package/lib/typescript/module/utils/computed-with-auto-fill-data.d.ts.map +1 -0
  262. package/lib/typescript/module/utils/deal-with-animation.d.ts +3 -0
  263. package/lib/typescript/module/utils/deal-with-animation.d.ts.map +1 -0
  264. package/lib/typescript/module/utils/log.d.ts +7 -0
  265. package/lib/typescript/module/utils/log.d.ts.map +1 -0
  266. package/lib/typescript/module/utils/sanitize-animation-style.d.ts +3 -0
  267. package/lib/typescript/module/utils/sanitize-animation-style.d.ts.map +1 -0
  268. package/package.json +34 -7
  269. package/scripts/codemods/v5.mjs +502 -0
  270. package/src/components/Carousel.tsx +5 -5
  271. package/src/components/CarouselLayout.tsx +53 -91
  272. package/src/components/ItemLayout.tsx +55 -46
  273. package/src/components/ItemRenderer.tsx +29 -18
  274. package/src/components/Pagination/PaginationItem.tsx +162 -0
  275. package/src/components/Pagination/index.tsx +105 -6
  276. package/src/components/ScrollViewGesture.tsx +92 -177
  277. package/src/hooks/useAutoPlay.ts +23 -18
  278. package/src/hooks/useCarouselController.tsx +194 -340
  279. package/src/hooks/useCommonVariables.ts +159 -71
  280. package/src/hooks/useInitProps.ts +161 -71
  281. package/src/hooks/useLayoutConfig.ts +21 -12
  282. package/src/hooks/useOffsetX.ts +3 -3
  283. package/src/hooks/useOnProgressChange.ts +23 -48
  284. package/src/hooks/usePanGestureProxy.ts +2 -2
  285. package/src/hooks/usePropsErrorBoundary.ts +32 -90
  286. package/src/hooks/useUpdateGestureConfig.ts +5 -2
  287. package/src/hooks/useVisibleRanges.tsx +2 -2
  288. package/src/index.tsx +14 -9
  289. package/src/layouts/index.tsx +0 -2
  290. package/src/layouts/normal.ts +14 -4
  291. package/src/layouts/parallax.ts +32 -59
  292. package/src/layouts/stack.ts +30 -70
  293. package/src/public-types.ts +198 -0
  294. package/src/store/index.tsx +7 -7
  295. package/src/types.ts +30 -322
  296. package/src/utils/carousel-direction.ts +39 -0
  297. package/src/utils/carousel-math.ts +156 -0
  298. package/src/utils/deal-with-animation.ts +11 -9
  299. package/lib/commonjs/components/Pagination/Basic/PaginationItem.js +0 -2
  300. package/lib/commonjs/components/Pagination/Basic/PaginationItem.js.map +0 -1
  301. package/lib/commonjs/components/Pagination/Basic/index.js +0 -2
  302. package/lib/commonjs/components/Pagination/Basic/index.js.map +0 -1
  303. package/lib/commonjs/components/Pagination/Custom/PaginationItem.js +0 -2
  304. package/lib/commonjs/components/Pagination/Custom/PaginationItem.js.map +0 -1
  305. package/lib/commonjs/components/Pagination/Custom/index.js +0 -2
  306. package/lib/commonjs/components/Pagination/Custom/index.js.map +0 -1
  307. package/lib/commonjs/utils/compute-offset-if-data-changed.js +0 -2
  308. package/lib/commonjs/utils/compute-offset-if-data-changed.js.map +0 -1
  309. package/lib/commonjs/utils/handleroffset-direction.js +0 -2
  310. package/lib/commonjs/utils/handleroffset-direction.js.map +0 -1
  311. package/lib/module/components/Pagination/Basic/PaginationItem.js +0 -2
  312. package/lib/module/components/Pagination/Basic/PaginationItem.js.map +0 -1
  313. package/lib/module/components/Pagination/Basic/index.js +0 -2
  314. package/lib/module/components/Pagination/Basic/index.js.map +0 -1
  315. package/lib/module/components/Pagination/Custom/PaginationItem.js +0 -2
  316. package/lib/module/components/Pagination/Custom/PaginationItem.js.map +0 -1
  317. package/lib/module/components/Pagination/Custom/index.js +0 -2
  318. package/lib/module/components/Pagination/Custom/index.js.map +0 -1
  319. package/lib/module/utils/compute-offset-if-data-changed.js +0 -2
  320. package/lib/module/utils/compute-offset-if-data-changed.js.map +0 -1
  321. package/lib/module/utils/handleroffset-direction.js +0 -2
  322. package/lib/module/utils/handleroffset-direction.js.map +0 -1
  323. package/lib/typescript/components/Carousel.d.ts +0 -8
  324. package/lib/typescript/components/Carousel.d.ts.map +0 -1
  325. package/lib/typescript/components/CarouselLayout.d.ts.map +0 -1
  326. package/lib/typescript/components/ItemLayout.d.ts.map +0 -1
  327. package/lib/typescript/components/ItemRenderer.d.ts +0 -23
  328. package/lib/typescript/components/ItemRenderer.d.ts.map +0 -1
  329. package/lib/typescript/components/LazyView.d.ts.map +0 -1
  330. package/lib/typescript/components/Pagination/Basic/PaginationItem.d.ts +0 -29
  331. package/lib/typescript/components/Pagination/Basic/PaginationItem.d.ts.map +0 -1
  332. package/lib/typescript/components/Pagination/Basic/index.d.ts +0 -23
  333. package/lib/typescript/components/Pagination/Basic/index.d.ts.map +0 -1
  334. package/lib/typescript/components/Pagination/Custom/PaginationItem.d.ts +0 -35
  335. package/lib/typescript/components/Pagination/Custom/PaginationItem.d.ts.map +0 -1
  336. package/lib/typescript/components/Pagination/Custom/index.d.ts +0 -26
  337. package/lib/typescript/components/Pagination/Custom/index.d.ts.map +0 -1
  338. package/lib/typescript/components/Pagination/index.d.ts +0 -5
  339. package/lib/typescript/components/Pagination/index.d.ts.map +0 -1
  340. package/lib/typescript/components/ScrollViewGesture.d.ts.map +0 -1
  341. package/lib/typescript/constants/index.d.ts.map +0 -1
  342. package/lib/typescript/hooks/useAutoPlay.d.ts +0 -12
  343. package/lib/typescript/hooks/useAutoPlay.d.ts.map +0 -1
  344. package/lib/typescript/hooks/useCarouselController.d.ts +0 -28
  345. package/lib/typescript/hooks/useCarouselController.d.ts.map +0 -1
  346. package/lib/typescript/hooks/useCheckMounted.d.ts.map +0 -1
  347. package/lib/typescript/hooks/useCommonVariables.d.ts +0 -13
  348. package/lib/typescript/hooks/useCommonVariables.d.ts.map +0 -1
  349. package/lib/typescript/hooks/useInitProps.d.ts +0 -10
  350. package/lib/typescript/hooks/useInitProps.d.ts.map +0 -1
  351. package/lib/typescript/hooks/useLayoutConfig.d.ts +0 -8
  352. package/lib/typescript/hooks/useLayoutConfig.d.ts.map +0 -1
  353. package/lib/typescript/hooks/useOffsetX.d.ts +0 -13
  354. package/lib/typescript/hooks/useOffsetX.d.ts.map +0 -1
  355. package/lib/typescript/hooks/useOnProgressChange.d.ts +0 -11
  356. package/lib/typescript/hooks/useOnProgressChange.d.ts.map +0 -1
  357. package/lib/typescript/hooks/usePanGestureProxy.d.ts.map +0 -1
  358. package/lib/typescript/hooks/usePropsErrorBoundary.d.ts +0 -5
  359. package/lib/typescript/hooks/usePropsErrorBoundary.d.ts.map +0 -1
  360. package/lib/typescript/hooks/useUpdateGestureConfig.d.ts +0 -6
  361. package/lib/typescript/hooks/useUpdateGestureConfig.d.ts.map +0 -1
  362. package/lib/typescript/hooks/useVisibleRanges.d.ts.map +0 -1
  363. package/lib/typescript/index.d.ts +0 -7
  364. package/lib/typescript/index.d.ts.map +0 -1
  365. package/lib/typescript/layouts/index.d.ts.map +0 -1
  366. package/lib/typescript/layouts/normal.d.ts.map +0 -1
  367. package/lib/typescript/layouts/parallax.d.ts +0 -47
  368. package/lib/typescript/layouts/parallax.d.ts.map +0 -1
  369. package/lib/typescript/layouts/stack.d.ts +0 -38
  370. package/lib/typescript/layouts/stack.d.ts.map +0 -1
  371. package/lib/typescript/store/index.d.ts.map +0 -1
  372. package/lib/typescript/types.d.ts +0 -302
  373. package/lib/typescript/types.d.ts.map +0 -1
  374. package/lib/typescript/utils/compute-gesture-translation.d.ts.map +0 -1
  375. package/lib/typescript/utils/compute-offset-if-data-changed.d.ts +0 -9
  376. package/lib/typescript/utils/compute-offset-if-data-changed.d.ts.map +0 -1
  377. package/lib/typescript/utils/compute-offset-if-size-changed.d.ts.map +0 -1
  378. package/lib/typescript/utils/computed-with-auto-fill-data.d.ts.map +0 -1
  379. package/lib/typescript/utils/deal-with-animation.d.ts +0 -3
  380. package/lib/typescript/utils/deal-with-animation.d.ts.map +0 -1
  381. package/lib/typescript/utils/handleroffset-direction.d.ts +0 -4
  382. package/lib/typescript/utils/handleroffset-direction.d.ts.map +0 -1
  383. package/lib/typescript/utils/log.d.ts.map +0 -1
  384. package/lib/typescript/utils/sanitize-animation-style.d.ts.map +0 -1
  385. package/src/components/Carousel.test.tsx +0 -1215
  386. package/src/components/LazyView.test.tsx +0 -61
  387. package/src/components/Pagination/Basic/PaginationItem.tsx +0 -149
  388. package/src/components/Pagination/Basic/index.tsx +0 -98
  389. package/src/components/Pagination/Custom/PaginationItem.tsx +0 -166
  390. package/src/components/Pagination/Custom/index.tsx +0 -111
  391. package/src/components/Pagination/Pagination.test.tsx +0 -178
  392. package/src/components/ScrollViewGesture.test.tsx +0 -155
  393. package/src/components/issue-899-parallax-reverse-loop.test.tsx +0 -131
  394. package/src/components/rnr-demo.test.tsx +0 -53
  395. package/src/hooks/useAutoPlay.test.ts +0 -194
  396. package/src/hooks/useCarouselController.test.tsx +0 -1158
  397. package/src/hooks/useCheckMounted.test.ts +0 -47
  398. package/src/hooks/useCommonVariables.test.tsx +0 -384
  399. package/src/hooks/useInitProps.test.tsx +0 -134
  400. package/src/hooks/useLayoutConfig.test.tsx +0 -247
  401. package/src/hooks/useOffsetX.test.ts +0 -54
  402. package/src/hooks/useOnProgressChange.test.tsx +0 -270
  403. package/src/hooks/usePanGestureProxy.test.tsx +0 -368
  404. package/src/hooks/usePropsErrorBoundary.test.tsx +0 -57
  405. package/src/hooks/useUpdateGestureConfig.test.ts +0 -89
  406. package/src/hooks/useVisibleRanges.test.tsx +0 -347
  407. package/src/layouts/parallax.test.ts +0 -239
  408. package/src/layouts/stack.test.ts +0 -252
  409. package/src/store/index.test.tsx +0 -314
  410. package/src/utils/compute-gesture-translation.test.ts +0 -70
  411. package/src/utils/compute-offset-if-data-changed.test.ts +0 -133
  412. package/src/utils/compute-offset-if-data-changed.ts +0 -44
  413. package/src/utils/compute-offset-if-size-changed.test.ts +0 -78
  414. package/src/utils/computed-with-auto-fill-data.test.ts +0 -298
  415. package/src/utils/deal-with-animation.test.ts +0 -181
  416. package/src/utils/handleroffset-direction.test.ts +0 -124
  417. package/src/utils/handleroffset-direction.ts +0 -18
  418. package/src/utils/index.test.ts +0 -90
  419. package/src/utils/log.test.ts +0 -134
  420. package/src/utils/sanitize-animation-style.test.ts +0 -40
  421. /package/lib/typescript/{components → commonjs/components}/LazyView.d.ts +0 -0
  422. /package/lib/typescript/{constants → commonjs/constants}/index.d.ts +0 -0
  423. /package/lib/typescript/{hooks → commonjs/hooks}/useCheckMounted.d.ts +0 -0
  424. /package/lib/typescript/{utils → commonjs/utils}/compute-gesture-translation.d.ts +0 -0
  425. /package/lib/typescript/{utils → commonjs/utils}/compute-offset-if-size-changed.d.ts +0 -0
  426. /package/lib/typescript/{utils → commonjs/utils}/computed-with-auto-fill-data.d.ts +0 -0
  427. /package/lib/typescript/{utils → commonjs/utils}/log.d.ts +0 -0
  428. /package/lib/typescript/{utils → commonjs/utils}/sanitize-animation-style.d.ts +0 -0
@@ -1,133 +0,0 @@
1
- import { computeOffsetIfDataChanged, omitZero } from "./compute-offset-if-data-changed";
2
-
3
- describe("computeOffsetIfDataChanged", () => {
4
- const size = 634;
5
-
6
- it("should return the correct values, if index is 0", () => {
7
- const index = 0;
8
- const result = computeOffsetIfDataChanged({
9
- direction: -1,
10
- previousLength: 4,
11
- currentLength: 6,
12
- size,
13
- handlerOffset: index * size,
14
- });
15
-
16
- expect(result).toMatchInlineSnapshot("0");
17
- });
18
-
19
- it("should return the correct values, if index is 1", () => {
20
- const index = 1;
21
- const result = computeOffsetIfDataChanged({
22
- direction: -1,
23
- previousLength: 4,
24
- currentLength: 6,
25
- size,
26
- handlerOffset: index * size,
27
- });
28
-
29
- expect(result).toMatchInlineSnapshot("634");
30
- });
31
-
32
- it("should handle positive direction", () => {
33
- const result = computeOffsetIfDataChanged({
34
- direction: 1,
35
- previousLength: 4,
36
- currentLength: 3,
37
- size: 100,
38
- handlerOffset: 300,
39
- });
40
-
41
- expect(result).toBeDefined();
42
- expect(typeof result).toBe("number");
43
- });
44
-
45
- it("should handle data reduction with positive direction where prevIndex > currentLength - 1", () => {
46
- // This test covers line 37 (isPositive = true case)
47
- const result = computeOffsetIfDataChanged({
48
- direction: -1, // negative direction makes isPositive = true
49
- previousLength: 5,
50
- currentLength: 2, // smaller than previous
51
- size: 100,
52
- handlerOffset: 400, // This should trigger prevIndex > currentLength - 1
53
- });
54
-
55
- expect(result).toBe(-100); // (currentLength - 1) * size * direction = (2-1) * 100 * (-1)
56
- });
57
-
58
- it("should handle data reduction with negative direction where prevIndex > currentLength - 1", () => {
59
- // This test covers line 38 (isPositive = false case)
60
- const result = computeOffsetIfDataChanged({
61
- direction: 1, // positive direction makes isPositive = false
62
- previousLength: 5,
63
- currentLength: 2, // smaller than previous
64
- size: 100,
65
- handlerOffset: 500, // This should trigger prevIndex > currentLength - 1
66
- });
67
-
68
- // Let me verify the actual logic and adjust the expectation
69
- expect(result).toBe(200); // Adjust based on actual computed value
70
- });
71
-
72
- it("should handle edge case with zero previous length", () => {
73
- const result = computeOffsetIfDataChanged({
74
- direction: -1,
75
- previousLength: 0,
76
- currentLength: 3,
77
- size: 100,
78
- handlerOffset: 0,
79
- });
80
-
81
- expect(result).toBeDefined();
82
- expect(typeof result).toBe("number");
83
- });
84
-
85
- it("should handle edge case with equal lengths", () => {
86
- const result = computeOffsetIfDataChanged({
87
- direction: -1,
88
- previousLength: 3,
89
- currentLength: 3,
90
- size: 100,
91
- handlerOffset: 200,
92
- });
93
-
94
- expect(result).toBe(200); // No change expected when lengths are equal
95
- });
96
-
97
- it("should handle large offset values", () => {
98
- const result = computeOffsetIfDataChanged({
99
- direction: -1,
100
- previousLength: 4,
101
- currentLength: 6,
102
- size: 1000,
103
- handlerOffset: 10000, // Large offset to test multiple rounds
104
- });
105
-
106
- expect(result).toBeDefined();
107
- expect(typeof result).toBe("number");
108
- });
109
- });
110
-
111
- describe("omitZero", () => {
112
- it("should return 0 when first parameter is 0", () => {
113
- expect(omitZero(0, 5)).toBe(0);
114
- expect(omitZero(0, -3)).toBe(0);
115
- expect(omitZero(0, 0)).toBe(0);
116
- });
117
-
118
- it("should return second parameter when first parameter is not 0", () => {
119
- expect(omitZero(1, 5)).toBe(5);
120
- expect(omitZero(-1, 10)).toBe(10);
121
- expect(omitZero(0.1, -3)).toBe(-3);
122
- });
123
-
124
- it("should handle negative first parameter", () => {
125
- expect(omitZero(-5, 7)).toBe(7);
126
- expect(omitZero(-0.1, 2)).toBe(2);
127
- });
128
-
129
- it("should handle floating point numbers", () => {
130
- expect(omitZero(0.0, 8)).toBe(0);
131
- expect(omitZero(1.5, 9)).toBe(9);
132
- });
133
- });
@@ -1,44 +0,0 @@
1
- export function omitZero(a: number, b: number) {
2
- "worklet";
3
- if (a === 0) return 0;
4
-
5
- return b;
6
- }
7
-
8
- export function computeOffsetIfDataChanged(params: {
9
- direction: number;
10
- handlerOffset: number;
11
- size: number;
12
- previousLength: number;
13
- currentLength: number;
14
- }) {
15
- "worklet";
16
- const { direction, handlerOffset: _handlerOffset, size, previousLength, currentLength } = params;
17
-
18
- let handlerOffset = _handlerOffset;
19
- let positionIndex: number;
20
- let round: number;
21
-
22
- const isPositive = direction < 0;
23
-
24
- if (isPositive) {
25
- positionIndex = Math.abs(handlerOffset) / size;
26
- round = Number.parseInt(String(omitZero(previousLength, positionIndex / previousLength)));
27
- } else {
28
- positionIndex = (Math.abs(handlerOffset) - size) / size;
29
- round = Number.parseInt(String(omitZero(previousLength, positionIndex / previousLength))) + 1;
30
- }
31
-
32
- const prevOffset = omitZero(previousLength, positionIndex % previousLength);
33
- const prevIndex = isPositive ? prevOffset : previousLength - prevOffset - 1;
34
- const changedLength = round * (currentLength - previousLength);
35
- const changedOffset = changedLength * size;
36
- if (prevIndex > currentLength - 1 && currentLength < previousLength) {
37
- if (isPositive) handlerOffset = (currentLength - 1) * size * direction;
38
- else handlerOffset = (currentLength - 1) * size * -1;
39
- } else {
40
- handlerOffset += changedOffset * direction;
41
- }
42
-
43
- return handlerOffset;
44
- }
@@ -1,78 +0,0 @@
1
- import { computeOffsetIfSizeChanged } from "./compute-offset-if-size-changed";
2
-
3
- describe("computeOffsetIfSizeChanged", () => {
4
- it("[CASE 1] should return the correct values when size does not change", () => {
5
- const prevIndex = 1;
6
- const prevSize = 500;
7
- const size = 500;
8
- const handlerOffset = prevIndex * size;
9
- const result = computeOffsetIfSizeChanged({
10
- prevSize,
11
- size,
12
- handlerOffset,
13
- });
14
-
15
- const finallyIndex = result / size;
16
- expect(finallyIndex).toEqual(prevIndex);
17
- });
18
-
19
- it("[CASE 2] should return the correct values when size changes from 500 to 400", () => {
20
- const prevIndex = 1;
21
- const prevSize = 500;
22
- const size = 400;
23
- const handlerOffset = prevIndex * prevSize;
24
- const result = computeOffsetIfSizeChanged({
25
- prevSize,
26
- size,
27
- handlerOffset,
28
- });
29
-
30
- const finallyIndex = result / size;
31
- expect(finallyIndex).toEqual(prevIndex);
32
- });
33
-
34
- it("[CASE 3] should return the correct values when size changes from 500 to 499", () => {
35
- const prevIndex = 1;
36
- const prevSize = 500;
37
- const size = 499;
38
- const handlerOffset = prevIndex * prevSize;
39
- const result = computeOffsetIfSizeChanged({
40
- prevSize,
41
- size,
42
- handlerOffset,
43
- });
44
-
45
- const finallyIndex = result / size;
46
- expect(finallyIndex).toEqual(prevIndex);
47
- });
48
-
49
- it("[CASE 4] should return the correct values when size changes from 500 to 501", () => {
50
- const prevIndex = 1;
51
- const prevSize = 500;
52
- const size = 501;
53
- const handlerOffset = prevIndex * prevSize;
54
- const result = computeOffsetIfSizeChanged({
55
- prevSize,
56
- size,
57
- handlerOffset,
58
- });
59
-
60
- const finallyIndex = result / size;
61
- expect(finallyIndex).toEqual(prevIndex);
62
- });
63
-
64
- it("[CASE 5] should return the correct values when size changes from 224 to 524", () => {
65
- const prevIndex = 1;
66
- const prevSize = 224;
67
- const size = 524;
68
- const handlerOffset = prevIndex * prevSize;
69
- const result = computeOffsetIfSizeChanged({
70
- prevSize,
71
- size,
72
- handlerOffset,
73
- });
74
-
75
- const finallyIndex = result / size;
76
- expect(finallyIndex).toEqual(prevIndex);
77
- });
78
- });
@@ -1,298 +0,0 @@
1
- import {
2
- computedFillDataWithAutoFillData,
3
- computedOffsetXValueWithAutoFillData,
4
- computedRealIndexWithAutoFillData,
5
- convertToSharedIndex,
6
- } from "./computed-with-auto-fill-data";
7
-
8
- import { DATA_LENGTH } from "../constants";
9
-
10
- const { SINGLE_ITEM, DOUBLE_ITEM } = DATA_LENGTH;
11
-
12
- describe("computed-with-auto-fill-data utilities", () => {
13
- describe("computedFillDataWithAutoFillData", () => {
14
- it("should handle single item", () => {
15
- const data = [1];
16
- const result = computedFillDataWithAutoFillData({
17
- data,
18
- loop: true,
19
- autoFillData: true,
20
- dataLength: SINGLE_ITEM,
21
- });
22
-
23
- expect(result).toEqual([1, 1, 1]);
24
- });
25
-
26
- it("should handle double items", () => {
27
- const data = [1, 2];
28
- const result = computedFillDataWithAutoFillData({
29
- data,
30
- loop: true,
31
- autoFillData: true,
32
- dataLength: DOUBLE_ITEM,
33
- });
34
-
35
- expect(result).toEqual([1, 2, 1, 2]);
36
- });
37
-
38
- it("should return original data when autoFillData is false", () => {
39
- const data = [1, 2, 3];
40
- const result = computedFillDataWithAutoFillData({
41
- data,
42
- loop: true,
43
- autoFillData: false,
44
- dataLength: 3,
45
- });
46
-
47
- expect(result).toEqual(data);
48
- });
49
-
50
- it("should return original data when loop is false", () => {
51
- const data = [1, 2, 3];
52
- const result = computedFillDataWithAutoFillData({
53
- data,
54
- loop: false,
55
- autoFillData: true,
56
- dataLength: 3,
57
- });
58
-
59
- expect(result).toEqual(data);
60
- });
61
-
62
- it("should handle empty data array", () => {
63
- const data: any[] = [];
64
- const result = computedFillDataWithAutoFillData({
65
- data,
66
- loop: true,
67
- autoFillData: true,
68
- dataLength: 0,
69
- });
70
-
71
- expect(result).toEqual([]);
72
- });
73
-
74
- it("should handle data length greater than 2", () => {
75
- const data = [1, 2, 3, 4, 5];
76
- const result = computedFillDataWithAutoFillData({
77
- data,
78
- loop: true,
79
- autoFillData: true,
80
- dataLength: 5,
81
- });
82
-
83
- expect(result).toEqual(data);
84
- });
85
-
86
- it("should handle both loop and autoFillData false", () => {
87
- const data = [1];
88
- const result = computedFillDataWithAutoFillData({
89
- data,
90
- loop: false,
91
- autoFillData: false,
92
- dataLength: SINGLE_ITEM,
93
- });
94
-
95
- expect(result).toEqual(data);
96
- });
97
- });
98
-
99
- describe("computedOffsetXValueWithAutoFillData", () => {
100
- const size = 300;
101
-
102
- it("should handle single item", () => {
103
- const result = computedOffsetXValueWithAutoFillData({
104
- value: size * 2,
105
- size,
106
- rawDataLength: SINGLE_ITEM,
107
- loop: true,
108
- autoFillData: true,
109
- });
110
-
111
- expect(result).toBe(0); // value % size
112
- });
113
-
114
- it("should handle double items", () => {
115
- const result = computedOffsetXValueWithAutoFillData({
116
- value: size * 3,
117
- size,
118
- rawDataLength: DOUBLE_ITEM,
119
- loop: true,
120
- autoFillData: true,
121
- });
122
-
123
- expect(result).toBe(size * 1); // value % (size * 2)
124
- });
125
-
126
- it("should return original value when autoFillData is false", () => {
127
- const value = size * 2;
128
- const result = computedOffsetXValueWithAutoFillData({
129
- value,
130
- size,
131
- rawDataLength: 3,
132
- loop: true,
133
- autoFillData: false,
134
- });
135
-
136
- expect(result).toBe(value);
137
- });
138
-
139
- it("should return original value when loop is false", () => {
140
- const value = size * 2;
141
- const result = computedOffsetXValueWithAutoFillData({
142
- value,
143
- size,
144
- rawDataLength: 3,
145
- loop: false,
146
- autoFillData: true,
147
- });
148
-
149
- expect(result).toBe(value);
150
- });
151
-
152
- it("should handle zero value", () => {
153
- const result = computedOffsetXValueWithAutoFillData({
154
- value: 0,
155
- size,
156
- rawDataLength: SINGLE_ITEM,
157
- loop: true,
158
- autoFillData: true,
159
- });
160
-
161
- expect(result).toBe(0);
162
- });
163
-
164
- it("should handle negative values", () => {
165
- const result = computedOffsetXValueWithAutoFillData({
166
- value: -size,
167
- size,
168
- rawDataLength: SINGLE_ITEM,
169
- loop: true,
170
- autoFillData: true,
171
- });
172
-
173
- // JavaScript's modulo can return -0 for negative numbers
174
- expect(result).toBe(-0); // -size % size = -0
175
- });
176
-
177
- it("should handle fractional values", () => {
178
- const result = computedOffsetXValueWithAutoFillData({
179
- value: size * 1.5,
180
- size,
181
- rawDataLength: DOUBLE_ITEM,
182
- loop: true,
183
- autoFillData: true,
184
- });
185
-
186
- expect(result).toBe(size * 1.5); // This should work with modulo
187
- });
188
-
189
- it("should handle both conditions false", () => {
190
- const value = size * 3;
191
- const result = computedOffsetXValueWithAutoFillData({
192
- value,
193
- size,
194
- rawDataLength: 3,
195
- loop: false,
196
- autoFillData: false,
197
- });
198
-
199
- expect(result).toBe(value);
200
- });
201
- });
202
-
203
- describe("computedRealIndexWithAutoFillData", () => {
204
- it("should handle single item", () => {
205
- const result = computedRealIndexWithAutoFillData({
206
- index: 2,
207
- dataLength: SINGLE_ITEM,
208
- loop: true,
209
- autoFillData: true,
210
- });
211
-
212
- expect(result).toBe(0); // index % 1
213
- });
214
-
215
- it("should handle double items", () => {
216
- const result = computedRealIndexWithAutoFillData({
217
- index: 3,
218
- dataLength: DOUBLE_ITEM,
219
- loop: true,
220
- autoFillData: true,
221
- });
222
-
223
- expect(result).toBe(1); // index % 2
224
- });
225
-
226
- it("should return original index when autoFillData is false", () => {
227
- const index = 2;
228
- const result = computedRealIndexWithAutoFillData({
229
- index,
230
- dataLength: 3,
231
- loop: true,
232
- autoFillData: false,
233
- });
234
-
235
- expect(result).toBe(index);
236
- });
237
-
238
- it("should return original index when loop is false", () => {
239
- const index = 2;
240
- const result = computedRealIndexWithAutoFillData({
241
- index,
242
- dataLength: 3,
243
- loop: false,
244
- autoFillData: true,
245
- });
246
-
247
- expect(result).toBe(index);
248
- });
249
- });
250
-
251
- describe("convertToSharedIndex", () => {
252
- it("should handle single item", () => {
253
- const result = convertToSharedIndex({
254
- index: 2,
255
- rawDataLength: SINGLE_ITEM,
256
- loop: true,
257
- autoFillData: true,
258
- });
259
-
260
- expect(result).toBe(0);
261
- });
262
-
263
- it("should handle double items", () => {
264
- const result = convertToSharedIndex({
265
- index: 3,
266
- rawDataLength: DOUBLE_ITEM,
267
- loop: true,
268
- autoFillData: true,
269
- });
270
-
271
- expect(result).toBe(1); // index % 2
272
- });
273
-
274
- it("should return original index when autoFillData is false", () => {
275
- const index = 2;
276
- const result = convertToSharedIndex({
277
- index,
278
- rawDataLength: 3,
279
- loop: true,
280
- autoFillData: false,
281
- });
282
-
283
- expect(result).toBe(index);
284
- });
285
-
286
- it("should return original index when loop is false", () => {
287
- const index = 2;
288
- const result = convertToSharedIndex({
289
- index,
290
- rawDataLength: 3,
291
- loop: false,
292
- autoFillData: true,
293
- });
294
-
295
- expect(result).toBe(index);
296
- });
297
- });
298
- });