@katajere/recap 2.1.7 → 2.1.9

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 (436) hide show
  1. package/dist/App.css +8 -0
  2. package/dist/LoginScreen.css +6 -139
  3. package/dist/OtpScreen.css +5 -127
  4. package/dist/RecapApp.d.ts +4 -1
  5. package/dist/RecapApp.d.ts.map +1 -1
  6. package/dist/RecapApp.js +2 -2
  7. package/dist/RecapLoadingScreen.css +11 -0
  8. package/dist/RecapStory.d.ts +8 -4
  9. package/dist/RecapStory.d.ts.map +1 -1
  10. package/dist/RecapStory.js +5 -254
  11. package/dist/StoryProgress.d.ts +2 -2
  12. package/dist/StoryProgress.d.ts.map +1 -1
  13. package/dist/StoryProgress.js +11 -68
  14. package/dist/assets/fluctuating/notification-left.svg +30 -0
  15. package/dist/assets/fluctuating/notification-right.svg +30 -0
  16. package/dist/assets/fluctuating/notification-top.svg +30 -0
  17. package/dist/assets/fluctuating/phone-body.svg +18 -0
  18. package/dist/assets/fluctuating/phone-detail.svg +6 -0
  19. package/dist/assets/fluctuating/phone-floor.svg +5 -0
  20. package/dist/assets/fluctuating/phone-marks.svg +8 -0
  21. package/dist/assets/fluctuating/phone-pulse.svg +7 -0
  22. package/dist/assets/fluctuating/wave-mask.svg +5 -0
  23. package/dist/assets/fluctuating/wave.svg +24 -0
  24. package/dist/assets/low-data/book-left-page.svg +7 -0
  25. package/dist/assets/low-data/book-right-leaf.svg +6 -0
  26. package/dist/assets/low-data/book-right-page.svg +5 -0
  27. package/dist/assets/low-data/book-spine.svg +5 -0
  28. package/dist/assets/low-data/sign-cord-left.svg +17 -0
  29. package/dist/assets/low-data/sign-cord-right.svg +17 -0
  30. package/dist/assets/low-data/sign-edge.svg +5 -0
  31. package/dist/assets/low-data/sign-eyelet-left.svg +15 -0
  32. package/dist/assets/low-data/sign-eyelet-right.svg +15 -0
  33. package/dist/assets/low-data/sign-face-detail.svg +18 -0
  34. package/dist/assets/low-data/sign-face.svg +10 -0
  35. package/dist/assets/low-data/sign-inner-bevel.svg +11 -0
  36. package/dist/assets/low-data/sign-lettering.svg +26 -0
  37. package/dist/assets/low-data/sign-pin.svg +15 -0
  38. package/dist/assets/low-data/sign-plaque.svg +19 -0
  39. package/dist/assets/low-data/sign-rim-bottom.svg +3 -0
  40. package/dist/assets/low-data/sign-rim-top.svg +3 -0
  41. package/dist/assets/low-data/store-browser.svg +10 -0
  42. package/dist/assets/low-data/store-cursor.svg +5 -0
  43. package/dist/assets/low-data/store-ground.svg +5 -0
  44. package/dist/assets/recap-intro/close.svg +5 -0
  45. package/dist/assets/recap-intro/loading-bar-1.png +0 -0
  46. package/dist/assets/recap-intro/loading-bar-2.png +0 -0
  47. package/dist/assets/recap-intro/tunnel.svg +516 -0
  48. package/dist/assets/steady/bag/badge.svg +9 -0
  49. package/dist/assets/steady/bag/body.svg +105 -0
  50. package/dist/assets/steady/bag/front-handle-inner.svg +353 -0
  51. package/dist/assets/steady/bag/front-handle.svg +10 -0
  52. package/dist/assets/steady/bag/hand.svg +208 -0
  53. package/dist/assets/steady/bag/rear-handle-inner.svg +297 -0
  54. package/dist/assets/steady/bag/rear-handle-top.svg +3 -0
  55. package/dist/assets/steady/bag/rear-handle.svg +10 -0
  56. package/dist/assets/steady/bag/shadow.svg +7 -0
  57. package/dist/assets/steady/calendar/base.png +0 -0
  58. package/dist/assets/steady/calendar/tick.svg +6 -0
  59. package/dist/assets/steady/coin/shimmer-mask.svg +5 -0
  60. package/dist/assets/steady/coin/shimmer.svg +16 -0
  61. package/dist/assets/steady/coin.png +0 -0
  62. package/dist/assets/steady/tree.svg +790 -0
  63. package/dist/assets/top10/biggest-day/coin-left.svg +21 -0
  64. package/dist/assets/top10/biggest-day/coin-right.svg +21 -0
  65. package/dist/assets/top10/biggest-day/coin-top.svg +21 -0
  66. package/dist/assets/top10/biggest-day/floor.svg +5 -0
  67. package/dist/assets/top10/biggest-day/illustration.png +0 -0
  68. package/dist/assets/top10/biggest-day/marks.svg +8 -0
  69. package/dist/assets/top10/biggest-day/mask.svg +5 -0
  70. package/dist/assets/top10/biggest-day/phone-body.svg +18 -0
  71. package/dist/assets/top10/biggest-day/phone-detail.svg +6 -0
  72. package/dist/assets/top10/closing/imgHccStaticHaloScale.svg +5 -0
  73. package/dist/assets/top10/closing/imgHccStaticHaloScale1.svg +12 -0
  74. package/dist/assets/top10/closing/imgHccStaticP0Tumble.svg +5 -0
  75. package/dist/assets/top10/closing/imgHccStaticP10Tumble.svg +5 -0
  76. package/dist/assets/top10/closing/imgHccStaticP11Tumble.svg +5 -0
  77. package/dist/assets/top10/closing/imgHccStaticP12Tumble.svg +5 -0
  78. package/dist/assets/top10/closing/imgHccStaticP13Tumble.svg +5 -0
  79. package/dist/assets/top10/closing/imgHccStaticP14Tumble.svg +5 -0
  80. package/dist/assets/top10/closing/imgHccStaticP15Tumble.svg +5 -0
  81. package/dist/assets/top10/closing/imgHccStaticP16Tumble.svg +5 -0
  82. package/dist/assets/top10/closing/imgHccStaticP17Tumble.svg +5 -0
  83. package/dist/assets/top10/closing/imgHccStaticP18Tumble.svg +5 -0
  84. package/dist/assets/top10/closing/imgHccStaticP19Tumble.svg +5 -0
  85. package/dist/assets/top10/closing/imgHccStaticP1Tumble.svg +5 -0
  86. package/dist/assets/top10/closing/imgHccStaticP20Tumble.svg +5 -0
  87. package/dist/assets/top10/closing/imgHccStaticP21Tumble.svg +5 -0
  88. package/dist/assets/top10/closing/imgHccStaticP22Tumble.svg +5 -0
  89. package/dist/assets/top10/closing/imgHccStaticP23Tumble.svg +5 -0
  90. package/dist/assets/top10/closing/imgHccStaticP24Tumble.svg +5 -0
  91. package/dist/assets/top10/closing/imgHccStaticP25Tumble.svg +5 -0
  92. package/dist/assets/top10/closing/imgHccStaticP26Tumble.svg +5 -0
  93. package/dist/assets/top10/closing/imgHccStaticP27Tumble.svg +5 -0
  94. package/dist/assets/top10/closing/imgHccStaticP28Tumble.svg +5 -0
  95. package/dist/assets/top10/closing/imgHccStaticP29Tumble.svg +5 -0
  96. package/dist/assets/top10/closing/imgHccStaticP2Tumble.svg +5 -0
  97. package/dist/assets/top10/closing/imgHccStaticP30Tumble.svg +5 -0
  98. package/dist/assets/top10/closing/imgHccStaticP31Tumble.svg +5 -0
  99. package/dist/assets/top10/closing/imgHccStaticP32Tumble.svg +5 -0
  100. package/dist/assets/top10/closing/imgHccStaticP33Tumble.svg +5 -0
  101. package/dist/assets/top10/closing/imgHccStaticP34Tumble.svg +5 -0
  102. package/dist/assets/top10/closing/imgHccStaticP35Tumble.svg +5 -0
  103. package/dist/assets/top10/closing/imgHccStaticP36Tumble.svg +5 -0
  104. package/dist/assets/top10/closing/imgHccStaticP37Tumble.svg +5 -0
  105. package/dist/assets/top10/closing/imgHccStaticP38Tumble.svg +5 -0
  106. package/dist/assets/top10/closing/imgHccStaticP39Tumble.svg +5 -0
  107. package/dist/assets/top10/closing/imgHccStaticP3Tumble.svg +5 -0
  108. package/dist/assets/top10/closing/imgHccStaticP40Tumble.svg +5 -0
  109. package/dist/assets/top10/closing/imgHccStaticP41Tumble.svg +5 -0
  110. package/dist/assets/top10/closing/imgHccStaticP42Tumble.svg +5 -0
  111. package/dist/assets/top10/closing/imgHccStaticP43Tumble.svg +5 -0
  112. package/dist/assets/top10/closing/imgHccStaticP44Tumble.svg +5 -0
  113. package/dist/assets/top10/closing/imgHccStaticP45Tumble.svg +5 -0
  114. package/dist/assets/top10/closing/imgHccStaticP46Tumble.svg +5 -0
  115. package/dist/assets/top10/closing/imgHccStaticP47Tumble.svg +5 -0
  116. package/dist/assets/top10/closing/imgHccStaticP48Tumble.svg +5 -0
  117. package/dist/assets/top10/closing/imgHccStaticP49Tumble.svg +5 -0
  118. package/dist/assets/top10/closing/imgHccStaticP4Tumble.svg +5 -0
  119. package/dist/assets/top10/closing/imgHccStaticP50Tumble.svg +5 -0
  120. package/dist/assets/top10/closing/imgHccStaticP51Tumble.svg +5 -0
  121. package/dist/assets/top10/closing/imgHccStaticP52Tumble.svg +5 -0
  122. package/dist/assets/top10/closing/imgHccStaticP53Tumble.svg +5 -0
  123. package/dist/assets/top10/closing/imgHccStaticP54Tumble.svg +5 -0
  124. package/dist/assets/top10/closing/imgHccStaticP55Tumble.svg +5 -0
  125. package/dist/assets/top10/closing/imgHccStaticP5Tumble.svg +5 -0
  126. package/dist/assets/top10/closing/imgHccStaticP6Tumble.svg +5 -0
  127. package/dist/assets/top10/closing/imgHccStaticP7Tumble.svg +5 -0
  128. package/dist/assets/top10/closing/imgHccStaticP8Tumble.svg +5 -0
  129. package/dist/assets/top10/closing/imgHccStaticP9Tumble.svg +5 -0
  130. package/dist/assets/top10/closing/imgVector.png +0 -0
  131. package/dist/assets/top10/closing/replay.svg +7 -0
  132. package/dist/assets/top10/closing/share.svg +6 -0
  133. package/dist/assets/top10/customers/arrow.svg +6 -0
  134. package/dist/assets/top10/customers/avatar.svg +61 -0
  135. package/dist/assets/top10/customers/illustration.png +0 -0
  136. package/dist/assets/top10/favourite/emoji.svg +9 -0
  137. package/dist/assets/top10/favourite/heart.svg +8 -0
  138. package/dist/assets/top10/growth/coin.svg +10 -0
  139. package/dist/assets/top10/growth/counter-shadow.svg +12 -0
  140. package/dist/assets/top10/growth/counter.svg +8 -0
  141. package/dist/assets/top10/growth/highlight.svg +12 -0
  142. package/dist/assets/top10/growth/illustration.png +0 -0
  143. package/dist/assets/top10/milestone/illustration.png +0 -0
  144. package/dist/assets/top10/orders/giver.svg +18 -0
  145. package/dist/assets/top10/orders/illustration.png +0 -0
  146. package/dist/assets/top10/orders/mask.svg +5 -0
  147. package/dist/assets/top10/orders/parcel.svg +16 -0
  148. package/dist/assets/top10/orders/receiver.svg +20 -0
  149. package/dist/assets/top10/orders/seal.svg +8 -0
  150. package/dist/assets/top10/recognition/contact-mask.svg +6 -0
  151. package/dist/assets/top10/recognition/contact.svg +14 -0
  152. package/dist/assets/top10/recognition/mask.svg +5 -0
  153. package/dist/assets/top10/recognition/plug-left.svg +27 -0
  154. package/dist/assets/top10/recognition/plug-right.svg +23 -0
  155. package/dist/assets/top10/recognition/pulse.svg +15 -0
  156. package/dist/assets/top10/recognition/ring.svg +3 -0
  157. package/dist/assets/top10/shared/avatar.png +0 -0
  158. package/dist/assets/top10/shared/close-dark.svg +5 -0
  159. package/dist/assets/top10/shared/close-light.svg +5 -0
  160. package/dist/assets/top10/signature/glow.svg +13 -0
  161. package/dist/assets/top10/signature/horizon.svg +12 -0
  162. package/dist/assets/top10/signature/inner-glow.svg +13 -0
  163. package/dist/assets/top10/signature/mask.svg +5 -0
  164. package/dist/assets/top10/signature/rim-glow.svg +13 -0
  165. package/dist/assets/top10/signature/rim.svg +13 -0
  166. package/dist/assets/top10/signature/year-mask.svg +5 -0
  167. package/dist/assets/top10/signature/year-shadow.svg +8 -0
  168. package/dist/assets/top10/signature/year.svg +30 -0
  169. package/dist/assets/top10/surprise/illustration.png +0 -0
  170. package/dist/assets/top10/surprise/note-front.svg +275 -0
  171. package/dist/assets/zero-order/catalogue-card.svg +15 -0
  172. package/dist/assets/zero-order/catalogue-ground.svg +3 -0
  173. package/dist/assets/zero-order/catalogue-window.svg +15 -0
  174. package/dist/assets/zero-order/storefront-awning.svg +145 -0
  175. package/dist/assets/zero-order/storefront-chrome.svg +15 -0
  176. package/dist/assets/zero-order/storefront-door-frame.svg +3 -0
  177. package/dist/assets/zero-order/storefront-door-glass.svg +14 -0
  178. package/dist/assets/zero-order/storefront-door-handle-light.svg +3 -0
  179. package/dist/assets/zero-order/storefront-door-handle-shadow.svg +3 -0
  180. package/dist/assets/zero-order/storefront-door-handle.svg +3 -0
  181. package/dist/assets/zero-order/storefront-door-mask.svg +5 -0
  182. package/dist/assets/zero-order/storefront-door-pane.svg +10 -0
  183. package/dist/assets/zero-order/storefront-door-panel.svg +3 -0
  184. package/dist/assets/zero-order/storefront-door-sill.svg +3 -0
  185. package/dist/assets/zero-order/storefront-ground.svg +3 -0
  186. package/dist/assets/zero-order/storefront-shell.svg +19 -0
  187. package/dist/assets/zero-order/storefront-step.svg +8 -0
  188. package/dist/assets/zero-order/storefront-wall.svg +13 -0
  189. package/dist/assets/zero-order/storefront-window-frame.svg +3 -0
  190. package/dist/assets/zero-order/storefront-window-glass.svg +16 -0
  191. package/dist/assets/zero-order/storefront-window-ledge-edge.svg +3 -0
  192. package/dist/assets/zero-order/storefront-window-ledge-line.svg +3 -0
  193. package/dist/assets/zero-order/storefront-window-ledge.svg +3 -0
  194. package/dist/assets/zero-order/storefront-window-mask.svg +5 -0
  195. package/dist/assets/zero-order/storefront-window-pane.svg +10 -0
  196. package/dist/assets/zero-order/storefront-window-sill.svg +3 -0
  197. package/dist/categories.d.ts +15 -0
  198. package/dist/categories.d.ts.map +1 -0
  199. package/dist/categories.js +25 -0
  200. package/dist/components/RecapIntroLayout.css +225 -0
  201. package/dist/components/RecapIntroLayout.d.ts +16 -0
  202. package/dist/components/RecapIntroLayout.d.ts.map +1 -0
  203. package/dist/components/RecapIntroLayout.js +19 -0
  204. package/dist/data/mock.d.ts +12 -2
  205. package/dist/data/mock.d.ts.map +1 -1
  206. package/dist/data/mock.js +99 -59
  207. package/dist/data/recapCopy.d.ts +1 -0
  208. package/dist/data/recapCopy.d.ts.map +1 -1
  209. package/dist/data/recapCopy.js +30 -21
  210. package/dist/data/remoteAssets.d.ts +3 -0
  211. package/dist/data/remoteAssets.d.ts.map +1 -0
  212. package/dist/data/remoteAssets.js +3 -0
  213. package/dist/hooks/useBackgroundMusic.d.ts +8 -8
  214. package/dist/hooks/useBackgroundMusic.d.ts.map +1 -1
  215. package/dist/hooks/useBackgroundMusic.js +38 -43
  216. package/dist/hooks/useCountUp.d.ts +16 -0
  217. package/dist/hooks/useCountUp.d.ts.map +1 -0
  218. package/dist/hooks/useCountUp.js +15 -0
  219. package/dist/hooks/useFrameImages.d.ts +5 -0
  220. package/dist/hooks/useFrameImages.d.ts.map +1 -0
  221. package/dist/hooks/useFrameImages.js +18 -0
  222. package/dist/hooks/useSessionValidator.d.ts +14 -0
  223. package/dist/hooks/useSessionValidator.d.ts.map +1 -0
  224. package/dist/hooks/useSessionValidator.js +97 -0
  225. package/dist/hooks/useShareCardPrecapture.d.ts +17 -0
  226. package/dist/hooks/useShareCardPrecapture.d.ts.map +1 -0
  227. package/dist/hooks/useShareCardPrecapture.js +35 -0
  228. package/dist/hooks/useStatusBarColor.d.ts +6 -0
  229. package/dist/hooks/useStatusBarColor.d.ts.map +1 -0
  230. package/dist/hooks/useStatusBarColor.js +34 -0
  231. package/dist/index.css +1 -1
  232. package/dist/index.d.ts +3 -0
  233. package/dist/index.d.ts.map +1 -1
  234. package/dist/index.js +5 -0
  235. package/dist/slides/Slide10Final.d.ts.map +1 -1
  236. package/dist/slides/Slide10Final.js +2 -50
  237. package/dist/slides/Slide1Intro.css +1 -2
  238. package/dist/slides/Slide1Intro.d.ts.map +1 -1
  239. package/dist/slides/Slide1Intro.js +21 -25
  240. package/dist/slides/Slide2Days.d.ts.map +1 -1
  241. package/dist/slides/Slide2Days.js +7 -44
  242. package/dist/slides/Slide3Revenue.d.ts.map +1 -1
  243. package/dist/slides/Slide3Revenue.js +5 -22
  244. package/dist/slides/Slide4Orders.d.ts.map +1 -1
  245. package/dist/slides/Slide4Orders.js +12 -41
  246. package/dist/slides/Slide5Buyers.d.ts.map +1 -1
  247. package/dist/slides/Slide5Buyers.js +9 -43
  248. package/dist/slides/Slide6Customer.d.ts.map +1 -1
  249. package/dist/slides/Slide6Customer.js +3 -19
  250. package/dist/slides/Slide9Year.d.ts.map +1 -1
  251. package/dist/slides/Slide9Year.js +3 -21
  252. package/dist/slides/registry.d.ts +7 -0
  253. package/dist/slides/registry.d.ts.map +1 -0
  254. package/dist/slides/registry.js +84 -0
  255. package/dist/store/auth.d.ts +40 -0
  256. package/dist/store/auth.d.ts.map +1 -0
  257. package/dist/store/auth.js +40 -0
  258. package/dist/story/StoryProgressBars.d.ts +13 -0
  259. package/dist/story/StoryProgressBars.d.ts.map +1 -0
  260. package/dist/story/StoryProgressBars.js +12 -0
  261. package/dist/story/index.d.ts +12 -0
  262. package/dist/story/index.d.ts.map +1 -0
  263. package/dist/story/index.js +10 -0
  264. package/dist/story/resolveStories.d.ts +9 -0
  265. package/dist/story/resolveStories.d.ts.map +1 -0
  266. package/dist/story/resolveStories.js +23 -0
  267. package/dist/story/storyPlayerReducer.d.ts +33 -0
  268. package/dist/story/storyPlayerReducer.d.ts.map +1 -0
  269. package/dist/story/storyPlayerReducer.js +55 -0
  270. package/dist/story/types.d.ts +55 -0
  271. package/dist/story/types.d.ts.map +1 -0
  272. package/dist/story/types.js +1 -0
  273. package/dist/story/usePreloadAssets.d.ts +8 -0
  274. package/dist/story/usePreloadAssets.d.ts.map +1 -0
  275. package/dist/story/usePreloadAssets.js +21 -0
  276. package/dist/story/useStoryGestures.d.ts +23 -0
  277. package/dist/story/useStoryGestures.d.ts.map +1 -0
  278. package/dist/story/useStoryGestures.js +60 -0
  279. package/dist/story/useStoryKeyboard.d.ts +10 -0
  280. package/dist/story/useStoryKeyboard.d.ts.map +1 -0
  281. package/dist/story/useStoryKeyboard.js +43 -0
  282. package/dist/story/useStoryPlayer.d.ts +26 -0
  283. package/dist/story/useStoryPlayer.d.ts.map +1 -0
  284. package/dist/story/useStoryPlayer.js +64 -0
  285. package/dist/story/useStoryTimer.d.ts +16 -0
  286. package/dist/story/useStoryTimer.d.ts.map +1 -0
  287. package/dist/story/useStoryTimer.js +34 -0
  288. package/dist/story/useVideoCaptureBridge.d.ts +6 -0
  289. package/dist/story/useVideoCaptureBridge.d.ts.map +1 -0
  290. package/dist/story/useVideoCaptureBridge.js +22 -0
  291. package/dist/top10/RecapStory2026.d.ts +20 -0
  292. package/dist/top10/RecapStory2026.d.ts.map +1 -0
  293. package/dist/top10/RecapStory2026.js +67 -0
  294. package/dist/top10/Top10Chrome.d.ts +16 -0
  295. package/dist/top10/Top10Chrome.d.ts.map +1 -0
  296. package/dist/top10/Top10Chrome.js +15 -0
  297. package/dist/top10/Top10Slides.css +308 -0
  298. package/dist/top10/Top10Story.css +250 -0
  299. package/dist/top10/fluctuatingSlides.d.ts +5 -0
  300. package/dist/top10/fluctuatingSlides.d.ts.map +1 -0
  301. package/dist/top10/fluctuatingSlides.js +30 -0
  302. package/dist/top10/format.d.ts +17 -0
  303. package/dist/top10/format.d.ts.map +1 -0
  304. package/dist/top10/format.js +57 -0
  305. package/dist/top10/illustrations/IllustrationLayers.d.ts +51 -0
  306. package/dist/top10/illustrations/IllustrationLayers.d.ts.map +1 -0
  307. package/dist/top10/illustrations/IllustrationLayers.js +51 -0
  308. package/dist/top10/illustrations/closingAssets.d.ts +2 -0
  309. package/dist/top10/illustrations/closingAssets.d.ts.map +1 -0
  310. package/dist/top10/illustrations/closingAssets.js +119 -0
  311. package/dist/top10/illustrations/closingLayers.json +461 -0
  312. package/dist/top10/illustrations/index.d.ts +45 -0
  313. package/dist/top10/illustrations/index.d.ts.map +1 -0
  314. package/dist/top10/illustrations/index.js +646 -0
  315. package/dist/top10/lowDataSlides.d.ts +9 -0
  316. package/dist/top10/lowDataSlides.d.ts.map +1 -0
  317. package/dist/top10/lowDataSlides.js +50 -0
  318. package/dist/top10/motion.d.ts +18 -0
  319. package/dist/top10/motion.d.ts.map +1 -0
  320. package/dist/top10/motion.js +43 -0
  321. package/dist/top10/registry.d.ts +21 -0
  322. package/dist/top10/registry.d.ts.map +1 -0
  323. package/dist/top10/registry.js +313 -0
  324. package/dist/top10/slides.d.ts +87 -0
  325. package/dist/top10/slides.d.ts.map +1 -0
  326. package/dist/top10/slides.js +137 -0
  327. package/dist/top10/steadySlides.d.ts +16 -0
  328. package/dist/top10/steadySlides.d.ts.map +1 -0
  329. package/dist/top10/steadySlides.js +78 -0
  330. package/dist/top10/useCanvasScale.d.ts +18 -0
  331. package/dist/top10/useCanvasScale.d.ts.map +1 -0
  332. package/dist/top10/useCanvasScale.js +50 -0
  333. package/dist/top10/zeroOrderSlides.d.ts +9 -0
  334. package/dist/top10/zeroOrderSlides.d.ts.map +1 -0
  335. package/dist/top10/zeroOrderSlides.js +34 -0
  336. package/dist/types.d.ts +74 -14
  337. package/dist/types.d.ts.map +1 -1
  338. package/dist/types.js +1 -1
  339. package/dist/utils/Helpers.d.ts +7 -0
  340. package/dist/utils/Helpers.d.ts.map +1 -0
  341. package/dist/utils/Helpers.js +21 -0
  342. package/dist/utils/RecapApi.d.ts +3 -0
  343. package/dist/utils/RecapApi.d.ts.map +1 -0
  344. package/dist/utils/RecapApi.js +35 -0
  345. package/dist/utils/Services/AuthServices.d.ts +49 -0
  346. package/dist/utils/Services/AuthServices.d.ts.map +1 -0
  347. package/dist/utils/Services/AuthServices.js +16 -0
  348. package/dist/utils/Services/mockApi.d.ts +49 -0
  349. package/dist/utils/Services/mockApi.d.ts.map +1 -0
  350. package/dist/utils/Services/mockApi.js +60 -0
  351. package/dist/utils/analytics.d.ts +4 -0
  352. package/dist/utils/analytics.d.ts.map +1 -0
  353. package/dist/utils/analytics.js +12 -0
  354. package/dist/utils/shareRecapVideo.d.ts +6 -0
  355. package/dist/utils/shareRecapVideo.d.ts.map +1 -0
  356. package/dist/utils/shareRecapVideo.js +40 -0
  357. package/dist/utils/vendorApp.d.ts +2 -0
  358. package/dist/utils/vendorApp.d.ts.map +1 -0
  359. package/dist/utils/vendorApp.js +4 -0
  360. package/package.json +25 -10
  361. package/src/App.css +8 -0
  362. package/src/App.tsx +75 -22
  363. package/src/LoginScreen.css +6 -139
  364. package/src/LoginScreen.tsx +126 -36
  365. package/src/OtpScreen.css +5 -127
  366. package/src/OtpScreen.tsx +84 -37
  367. package/src/RecapApp.tsx +6 -3
  368. package/src/RecapLoadingScreen.css +11 -0
  369. package/src/RecapLoadingScreen.tsx +64 -0
  370. package/src/RecapStory.tsx +11 -423
  371. package/src/StoryProgress.tsx +18 -104
  372. package/src/categories.ts +30 -0
  373. package/src/components/RecapIntroLayout.css +225 -0
  374. package/src/components/RecapIntroLayout.tsx +64 -0
  375. package/src/data/mock.ts +110 -67
  376. package/src/data/recapCopy.ts +33 -21
  377. package/src/data/remoteAssets.ts +3 -0
  378. package/src/hooks/useBackgroundMusic.ts +46 -48
  379. package/src/hooks/useCountUp.ts +36 -0
  380. package/src/hooks/useFrameImages.ts +19 -0
  381. package/src/hooks/useSessionValidator.ts +115 -0
  382. package/src/hooks/useShareCardPrecapture.ts +50 -0
  383. package/src/hooks/useStatusBarColor.ts +36 -0
  384. package/src/index.css +1 -1
  385. package/src/index.ts +24 -0
  386. package/src/lib/queryClient.ts +34 -0
  387. package/src/main.tsx +44 -0
  388. package/src/queries/recap.ts +15 -0
  389. package/src/slides/Slide10Final.tsx +2 -56
  390. package/src/slides/Slide1Intro.css +1 -2
  391. package/src/slides/Slide1Intro.tsx +22 -32
  392. package/src/slides/Slide2Days.tsx +7 -55
  393. package/src/slides/Slide3Revenue.tsx +5 -29
  394. package/src/slides/Slide4Orders.tsx +12 -53
  395. package/src/slides/Slide5Buyers.tsx +9 -52
  396. package/src/slides/Slide6Customer.tsx +3 -21
  397. package/src/slides/Slide9Year.tsx +3 -26
  398. package/src/slides/registry.tsx +129 -0
  399. package/src/store/auth.tsx +72 -0
  400. package/src/story/StoryProgressBars.tsx +42 -0
  401. package/src/story/index.ts +11 -0
  402. package/src/story/resolveStories.ts +31 -0
  403. package/src/story/storyPlayerReducer.ts +80 -0
  404. package/src/story/types.ts +49 -0
  405. package/src/story/usePreloadAssets.ts +28 -0
  406. package/src/story/useStoryGestures.ts +95 -0
  407. package/src/story/useStoryKeyboard.ts +56 -0
  408. package/src/story/useStoryPlayer.ts +120 -0
  409. package/src/story/useStoryTimer.ts +55 -0
  410. package/src/story/useVideoCaptureBridge.ts +30 -0
  411. package/src/top10/RecapStory2026.tsx +136 -0
  412. package/src/top10/Top10Chrome.tsx +66 -0
  413. package/src/top10/Top10Slides.css +308 -0
  414. package/src/top10/Top10Story.css +250 -0
  415. package/src/top10/fluctuatingSlides.tsx +88 -0
  416. package/src/top10/format.ts +61 -0
  417. package/src/top10/illustrations/IllustrationLayers.tsx +150 -0
  418. package/src/top10/illustrations/closingAssets.ts +120 -0
  419. package/src/top10/illustrations/index.tsx +753 -0
  420. package/src/top10/lowDataSlides.tsx +178 -0
  421. package/src/top10/motion.ts +65 -0
  422. package/src/top10/registry.tsx +370 -0
  423. package/src/top10/slides.tsx +560 -0
  424. package/src/top10/steadySlides.tsx +199 -0
  425. package/src/top10/useCanvasScale.ts +66 -0
  426. package/src/top10/zeroOrderSlides.tsx +120 -0
  427. package/src/types.ts +95 -19
  428. package/src/utils/Helpers.tsx +25 -0
  429. package/src/utils/RecapApi.tsx +39 -0
  430. package/src/utils/Services/AuthServices.tsx +18 -0
  431. package/src/utils/Services/mockApi.ts +77 -0
  432. package/src/utils/analytics.ts +15 -0
  433. package/src/utils/shareRecapVideo.ts +44 -0
  434. package/src/utils/vendorApp.ts +5 -0
  435. package/src/vite-env.d.ts +1 -0
  436. package/src/react-app-env.d.ts +0 -26
@@ -1,433 +1,21 @@
1
- import React, { useState, useRef } from "react";
2
- import { AnimatePresence, motion } from "framer-motion";
3
- import StoryProgress from "./StoryProgress";
4
- import Header from "./components/Header";
5
- import Slide1Intro from "./slides/Slide1Intro";
6
- import Slide2Days from "./slides/Slide2Days";
7
- import Slide3Revenue from "./slides/Slide3Revenue";
8
- import Slide4Orders from "./slides/Slide4Orders";
9
- import Slide5Buyers from "./slides/Slide5Buyers";
10
- import Slide6Customer from "./slides/Slide6Customer";
11
- import Slide7Products from "./slides/Slide7Products";
12
- import Slide8Months from "./slides/Slide8Months";
13
- import Slide9Year from "./slides/Slide9Year";
14
- import Slide10Final from "./slides/Slide10Final";
15
- import { slideVariants } from "./utils";
16
- import { captureAndShareSlide, preCaptureSlide, clearScreenshotCache } from "./utils/slideScreenshot";
17
- import { slideDurations as defaultDurations } from "./data/mock";
18
- import { BUSINESS_CATEGORIES, RecapData } from "./types";
19
- import { useBackgroundMusic } from "./hooks/useBackgroundMusic";
20
- import "./RecapStory.css";
21
-
22
- // External CDN URL for background music (reduces package size)
23
- const recapMusic = "https://katajereassets.blob.core.windows.net/recap-videos/recap-music.mp3";
1
+ import React from "react";
2
+ import type { RecapData } from "./types";
3
+ import RecapStory2026 from "./top10/RecapStory2026";
4
+ import type { StoryEvent } from "./story";
24
5
 
25
6
  interface RecapStoryProps {
26
7
  recapData: RecapData;
8
+ /** Playback analytics hook (story views, completions, shares, replays). */
9
+ onStoryEvent?: (event: StoryEvent) => void;
10
+ /** Close button in the 2026 story header; hidden when omitted. */
11
+ onClose?: () => void;
27
12
  }
28
13
 
29
14
  /**
30
- * RecapStory - Story container with header, progress bars, and slide transitions
15
+ * RecapStory - 2026 story for every category (including low_data and zero_order).
31
16
  */
32
- function RecapStory({ recapData }: RecapStoryProps) {
33
- const [activeIndex, setActiveIndex] = useState<number>(0);
34
- const durations = recapData.slideDurations || defaultDurations;
35
- // Start paused when in video generation mode - orchestrator will unpause via window.__RECAP_START__
36
- const [isPaused, setIsPaused] = useState<boolean>(recapData.isVideo === true);
37
- const [isShareVisible, setIsShareVisible] = useState<boolean>(false);
38
- const holdTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
39
- const isHoldingRef = useRef<boolean>(false);
40
- const slidesContainerRef = useRef<HTMLDivElement>(null);
41
-
42
- // Expose global start function for video generation orchestrator
43
- React.useEffect(() => {
44
- if (recapData.isVideo) {
45
- // Expose function to start the story (used by Puppeteer after recording starts)
46
- (window as unknown as { __RECAP_START__?: () => void }).__RECAP_START__ = () => {
47
- setIsPaused(false);
48
- };
49
- // Also add a ready flag so orchestrator knows the component is mounted
50
- (window as unknown as { __RECAP_READY__?: boolean }).__RECAP_READY__ = true;
51
- }
52
- return () => {
53
- // Cleanup global functions
54
- if (recapData.isVideo) {
55
- delete (window as unknown as { __RECAP_START__?: () => void }).__RECAP_START__;
56
- delete (window as unknown as { __RECAP_READY__?: boolean }).__RECAP_READY__;
57
- }
58
- };
59
- }, [recapData.isVideo]);
60
-
61
- // Cleanup on unmount to prevent memory leaks
62
- React.useEffect(() => {
63
- return () => {
64
- if (holdTimerRef.current) {
65
- clearTimeout(holdTimerRef.current);
66
- }
67
- // Clear screenshot cache on unmount
68
- clearScreenshotCache();
69
- };
70
- }, []);
71
-
72
- const { isMuted, isPlaying, toggleMute, play, stop } = useBackgroundMusic({
73
- src: recapMusic,
74
- volume: 0.6,
75
- autoPlay: true,
76
- loop: false,
77
- });
78
-
79
- const isNewUser = recapData.businessCategory === BUSINESS_CATEGORIES.NEW_USER;
80
-
81
- // Define slides with their durations (new-user only sees the intro)
82
- const fullSlideSet = [
83
- { id: "intro", duration: durations.intro },
84
- { id: "days", duration: durations.days },
85
- { id: "revenue", duration: durations.revenue },
86
- { id: "orders", duration: durations.orders },
87
- { id: "buyers", duration: durations.buyers },
88
- { id: "customer", duration: durations.customer },
89
- { id: "products", duration: durations.products },
90
- { id: "months", duration: durations.months },
91
- { id: "year", duration: durations.year },
92
- { id: "final", duration: durations.final },
93
- ];
94
- const slides = isNewUser
95
- ? [{ id: "intro", duration: durations.intro }]
96
- : fullSlideSet;
97
-
98
- const currentSlide = slides[activeIndex];
99
- const isFinalSlide = currentSlide.id === "final";
100
-
101
- // Pre-capture screenshot and show share button when ready
102
- React.useEffect(() => {
103
- // Hide share button immediately on slide change
104
- setIsShareVisible(false);
105
-
106
- if (isFinalSlide || !slidesContainerRef.current) return;
107
-
108
- let isMounted = true;
109
-
110
- // Wait for animations to complete, then pre-capture
111
- const timer = setTimeout(async () => {
112
- if (!isMounted || !slidesContainerRef.current) return;
113
-
114
- try {
115
- // Pre-capture the screenshot
116
- await preCaptureSlide(slidesContainerRef.current, {
117
- slideId: currentSlide.id,
118
- businessName: recapData.businessName,
119
- year: recapData.year ?? 2025,
120
- });
121
-
122
- // Only show share button AFTER pre-capture is complete
123
- if (isMounted) {
124
- setIsShareVisible(true);
125
- }
126
- } catch (error) {
127
- console.error('[RecapStory] Pre-capture failed:', error);
128
- // Still show share button even if pre-capture fails (will fall back to download)
129
- if (isMounted) {
130
- setIsShareVisible(true);
131
- }
132
- }
133
- }, 2500); // Wait 2.5s for all animations to complete
134
-
135
- return () => {
136
- isMounted = false;
137
- clearTimeout(timer);
138
- };
139
- }, [activeIndex, currentSlide.id, recapData.businessName, recapData.year, isFinalSlide]);
140
-
141
- // Ensure music plays only on slides 1-9 and stops immediately on the final slide
142
- React.useEffect(() => {
143
- if (isFinalSlide) {
144
- stop();
145
- return;
146
- }
147
-
148
- if (!isPlaying) {
149
- play();
150
- }
151
- }, [isFinalSlide, isPlaying, play, stop]);
152
-
153
- // Stop music when reaching the final slide (safety net)
154
- React.useEffect(() => {
155
- if (isFinalSlide) {
156
- stop();
157
- }
158
- }, [isFinalSlide, stop]);
159
-
160
- const handleProgressComplete = () => {
161
- if (isFinalSlide) {
162
- return;
163
- }
164
-
165
- if (activeIndex < slides.length - 1) {
166
- setActiveIndex((prev) => prev + 1);
167
- setIsPaused(false);
168
- }
169
- };
170
-
171
- const handleReplay = () => {
172
- setActiveIndex(0);
173
- setIsPaused(false);
174
- };
175
-
176
- // Jump to specific slide when bar is clicked
177
- const handleBarClick = (index: number) => {
178
- setActiveIndex(index);
179
- setIsPaused(false);
180
- };
181
-
182
- // Handle hold to pause
183
- const handlePointerDown = (event: React.PointerEvent<HTMLDivElement>) => {
184
- // Ignore if on interactive elements
185
- const target = event.target as HTMLElement;
186
- if (target.tagName === "BUTTON" || target.closest("button")) {
187
- return;
188
- }
189
-
190
- isHoldingRef.current = false;
191
-
192
- // Start hold timer - pause after 150ms of holding
193
- holdTimerRef.current = setTimeout(() => {
194
- isHoldingRef.current = true;
195
- setIsPaused(true);
196
- }, 150);
197
- };
198
-
199
- const handlePointerUp = (event: React.PointerEvent<HTMLDivElement>) => {
200
- // Clear hold timer
201
- if (holdTimerRef.current) {
202
- clearTimeout(holdTimerRef.current);
203
- holdTimerRef.current = null;
204
- }
205
-
206
- // If was holding, just unpause and don't navigate
207
- if (isHoldingRef.current) {
208
- isHoldingRef.current = false;
209
- setIsPaused(false);
210
- return;
211
- }
212
-
213
- // Ignore clicks on interactive elements
214
- const target = event.target as HTMLElement;
215
- if (target.tagName === "BUTTON" || target.closest("button")) {
216
- return;
217
- }
218
-
219
- const container = event.currentTarget;
220
- const rect = container.getBoundingClientRect();
221
- const tapX = event.clientX - rect.left;
222
- const screenWidth = rect.width;
223
-
224
- // Left 20% of screen = previous slide
225
- if (tapX < screenWidth * 0.2) {
226
- if (activeIndex > 0) {
227
- setActiveIndex((prev) => prev - 1);
228
- setIsPaused(false);
229
- }
230
- }
231
- // Right 20% of screen = next slide
232
- else if (tapX > screenWidth * 0.8) {
233
- if (!isFinalSlide && activeIndex < slides.length - 1) {
234
- setActiveIndex((prev) => prev + 1);
235
- setIsPaused(false);
236
- }
237
- }
238
- // Middle 60% = no navigation, just tap (already handled by hold logic)
239
- };
240
-
241
- const handlePointerLeave = () => {
242
- // Clear hold timer and unpause if leaving
243
- if (holdTimerRef.current) {
244
- clearTimeout(holdTimerRef.current);
245
- holdTimerRef.current = null;
246
- }
247
- if (isHoldingRef.current) {
248
- isHoldingRef.current = false;
249
- setIsPaused(false);
250
- }
251
- };
252
-
253
- // Render current slide content
254
- const renderSlide = () => {
255
- switch (currentSlide.id) {
256
- case "intro":
257
- return (
258
- <Slide1Intro
259
- businessName={recapData.businessName}
260
- businessCategory={recapData.businessCategory}
261
- introHeadline={recapData.introHeadline}
262
- introSubtitle={recapData.introSubtitle}
263
- frameImages={recapData.productImages}
264
- />
265
- );
266
- case "days":
267
- return (
268
- <Slide2Days
269
- days={recapData.days}
270
- streak={recapData.streak}
271
- frameImages={recapData.productImages}
272
- />
273
- );
274
- case "revenue":
275
- return (
276
- <Slide3Revenue
277
- revenue={recapData.revenue}
278
- currency={recapData.currency}
279
- businessCategory={recapData.businessCategory}
280
- />
281
- );
282
- case "orders":
283
- return (
284
- <Slide4Orders
285
- orders={recapData.orders}
286
- frameImages={recapData.productImages}
287
- />
288
- );
289
- case "buyers":
290
- return (
291
- <Slide5Buyers
292
- firstTimeBuyers={recapData.firstTimeBuyers}
293
- repeatBuyers={recapData.repeatBuyers}
294
- frameImages={recapData.productImages}
295
- />
296
- );
297
- case "customer":
298
- return (
299
- <Slide6Customer
300
- websiteLink={recapData.websiteLink ?? ""}
301
- websiteVisits={recapData.websiteVisits ?? 0}
302
- mostViewedProduct={recapData.mostViewedProduct ?? ""}
303
- mostViewedProductCount={recapData.mostViewedProductCount ?? 0}
304
- />
305
- );
306
- case "products":
307
- return <Slide7Products products={recapData.topProducts} />;
308
- case "months":
309
- return <Slide8Months busiestMonth={recapData.busiestMonth} />;
310
- case "year":
311
- return (
312
- <Slide9Year
313
- businessCategory={recapData.businessCategory}
314
- year={recapData.year}
315
- frameImages={recapData.productImages}
316
- />
317
- );
318
- case "final":
319
- return (
320
- <Slide10Final
321
- videoUrl={recapData.videoUrl}
322
- downloadUrl={recapData.downloadUrl}
323
- year={recapData.year}
324
- onReplay={handleReplay}
325
- />
326
- );
327
- default:
328
- return null;
329
- }
330
- };
331
-
332
- return (
333
- <div className="recap-story">
334
- {/* Top group: Header + Progress */}
335
- <div className="recap-story__top-group">
336
- {/* Header with Huxxle logo and Recap badge */}
337
- <div className="recap-story__header-wrapper">
338
- <Header
339
- showRecapBadge={true}
340
- badgeVariant={isNewUser ? "new-user" : "default"}
341
- year={recapData.year}
342
- />
343
- </div>
344
-
345
- {/* Progress bars */}
346
- <div className="recap-story__progress-wrap">
347
- <div className="recap-story__progress">
348
- <StoryProgress
349
- total={slides.length}
350
- active={activeIndex}
351
- duration={currentSlide.duration}
352
- onComplete={handleProgressComplete}
353
- onBarClick={handleBarClick}
354
- hideBorder={isFinalSlide}
355
- isPaused={isPaused}
356
- />
357
- </div>
358
- </div>
359
- </div>
360
-
361
- {/* Slide content with transitions */}
362
- <div
363
- className="recap-story__slides"
364
- ref={slidesContainerRef}
365
- onPointerDown={handlePointerDown}
366
- onPointerUp={handlePointerUp}
367
- onPointerLeave={handlePointerLeave}
368
- onPointerCancel={handlePointerLeave}
369
- >
370
- <AnimatePresence mode="wait">
371
- <motion.div
372
- key={currentSlide.id}
373
- variants={slideVariants}
374
- initial="initial"
375
- animate="animate"
376
- exit="exit"
377
- className="recap-story__slide"
378
- >
379
- {renderSlide()}
380
- </motion.div>
381
- </AnimatePresence>
382
- </div>
383
-
384
- {/* Floating buttons - Sound and Share (only on slides 1-9, hidden for video and new users) */}
385
- {!isFinalSlide && !recapData.isVideo && (
386
- <>
387
- {/* Sound button - always visible, independent of share state */}
388
- <button
389
- className="recap-story__floating-btn recap-story__sound-btn"
390
- onClick={toggleMute}
391
- aria-label={isMuted ? "Unmute" : "Mute"}
392
- >
393
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
394
- <path d="M1.66675 8.83333V11.1667C1.66675 13 2.50008 13.8333 4.33341 13.8333H5.51675C5.82508 13.8333 6.12508 13.9417 6.36675 14.1333L8.68341 16.0167C10.3167 17.4 12.5001 16.325 12.5001 14.2333V5.76667C12.5001 3.66667 10.3167 2.6 8.68341 3.98333L6.36675 5.86667C6.12508 6.05833 5.82508 6.16667 5.51675 6.16667H4.33341C2.50008 6.16667 1.66675 7 1.66675 8.83333Z" stroke="#4F4CD8" strokeWidth="1.5"/>
395
- {!isMuted && (
396
- <>
397
- <path d="M15 6.66667C16.3834 8.30834 16.3834 11.7 15 13.3333" stroke="#4F4CD8" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
398
- <path d="M16.825 4.58334C19.3917 7.59168 19.3917 12.4167 16.825 15.4167" stroke="#4F4CD8" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
399
- </>
400
- )}
401
- </svg>
402
- </button>
403
-
404
- {/* Share button - fades in after counter animations (hidden for new users) */}
405
- {!isNewUser && (
406
- <button
407
- className={`recap-story__floating-btn recap-story__share-btn ${isShareVisible ? 'recap-story__share-btn--visible' : ''}`}
408
- onClick={() => {
409
- // Call without await - the function handles sharing internally
410
- // This preserves the user gesture chain for mobile Web Share API
411
- captureAndShareSlide(slidesContainerRef.current, {
412
- slideId: currentSlide.id,
413
- businessName: recapData.businessName,
414
- year: recapData.year ?? new Date().getFullYear(),
415
- });
416
- }}
417
- aria-label="Share"
418
- >
419
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
420
- <path d="M13.7 7.4165C16.7 7.67484 17.925 9.2165 17.925 12.5915V12.6998C17.925 16.4248 16.4333 17.9165 12.7083 17.9165H7.28332C3.55832 17.9165 2.06665 16.4248 2.06665 12.6998V12.5915C2.06665 9.2415 3.27498 7.69984 6.22498 7.42484" stroke="#4F4CD8" strokeLinecap="round" strokeLinejoin="round"/>
421
- <path d="M10 12.4999V3.0166" stroke="#4F4CD8" strokeLinecap="round" strokeLinejoin="round"/>
422
- <path d="M12.7916 4.87516L9.99998 2.0835L7.20831 4.87516" stroke="#4F4CD8" strokeLinecap="round" strokeLinejoin="round"/>
423
- </svg>
424
- <span className="recap-story__share-text">Share</span>
425
- </button>
426
- )}
427
- </>
428
- )}
429
- </div>
430
- );
17
+ function RecapStory(props: RecapStoryProps) {
18
+ return <RecapStory2026 {...props} />;
431
19
  }
432
20
 
433
21
  export default RecapStory;
@@ -1,5 +1,6 @@
1
- import React, { useEffect, useState, useRef } from "react";
2
- import "./StoryProgress.css";
1
+ import React from "react";
2
+ import StoryProgressBars from "./story/StoryProgressBars";
3
+ import { useStoryTimer } from "./story/useStoryTimer";
3
4
 
4
5
  interface StoryProgressProps {
5
6
  total: number;
@@ -12,7 +13,8 @@ interface StoryProgressProps {
12
13
  }
13
14
 
14
15
  /**
15
- * StoryProgress - Story-style progress bars at the top
16
+ * StoryProgress - Self-timed story progress bars for custom layouts.
17
+ * RecapStory drives StoryProgressBars from its player instead.
16
18
  */
17
19
  function StoryProgress({
18
20
  total,
@@ -23,109 +25,21 @@ function StoryProgress({
23
25
  hideBorder,
24
26
  isPaused,
25
27
  }: StoryProgressProps) {
26
- const [progress, setProgress] = useState(0);
27
- const progressRef = useRef(0);
28
- const startTimeRef = useRef<number>(0);
29
- const pausedProgressRef = useRef<number>(0);
30
- const animationFrameRef = useRef<number | null>(null);
31
- const onCompleteRef = useRef(onComplete);
32
-
33
- // Keep onComplete ref up to date
34
- useEffect(() => {
35
- onCompleteRef.current = onComplete;
36
- }, [onComplete]);
37
-
38
- // Reset progress when active slide changes
39
- useEffect(() => {
40
- setProgress(0);
41
- progressRef.current = 0;
42
- pausedProgressRef.current = 0;
43
- startTimeRef.current = performance.now();
44
- }, [active]);
45
-
46
- // Animation loop with pause support
47
- useEffect(() => {
48
- if (isPaused) {
49
- // Save current progress when pausing
50
- pausedProgressRef.current = progressRef.current;
51
- if (animationFrameRef.current) {
52
- cancelAnimationFrame(animationFrameRef.current);
53
- animationFrameRef.current = null;
54
- }
55
- return;
56
- }
57
-
58
- // Resume from paused progress
59
- startTimeRef.current = performance.now();
60
- const startProgress = pausedProgressRef.current;
61
- if (startProgress >= 1) {
62
- setProgress(1);
63
- onCompleteRef.current();
64
- return;
65
- }
66
- const remainingDuration = duration * (1 - startProgress) * 1000;
67
-
68
- const animate = (currentTime: number) => {
69
- const elapsed = currentTime - startTimeRef.current;
70
- const newProgress =
71
- startProgress + (elapsed / remainingDuration) * (1 - startProgress);
72
-
73
- if (newProgress >= 1) {
74
- progressRef.current = 1;
75
- setProgress(1);
76
- onCompleteRef.current();
77
- return;
78
- }
79
-
80
- progressRef.current = newProgress;
81
- setProgress(newProgress);
82
- animationFrameRef.current = requestAnimationFrame(animate);
83
- };
84
-
85
- animationFrameRef.current = requestAnimationFrame(animate);
86
-
87
- return () => {
88
- if (animationFrameRef.current) {
89
- cancelAnimationFrame(animationFrameRef.current);
90
- }
91
- };
92
- }, [isPaused, duration, active]);
28
+ const progress = useStoryTimer({
29
+ storyKey: active,
30
+ duration,
31
+ isRunning: !isPaused,
32
+ onComplete,
33
+ });
93
34
 
94
35
  return (
95
- <div
96
- className={`story-progress${
97
- hideBorder ? " story-progress--no-border" : ""
98
- }`}
99
- >
100
- {Array.from({ length: total }).map((_, index) => {
101
- const isActive = index === active;
102
- const isCompleted = index < active;
103
-
104
- return (
105
- <div
106
- key={index}
107
- className="story-progress__bar-container"
108
- onClick={() => onBarClick(index)}
109
- >
110
- <div
111
- className={`story-progress__bar ${
112
- isCompleted ? "completed" : ""
113
- }`}
114
- >
115
- {isActive && (
116
- <div
117
- className="story-progress__bar-fill"
118
- style={{
119
- transform: `scaleX(${progress})`,
120
- transformOrigin: "left",
121
- }}
122
- />
123
- )}
124
- </div>
125
- </div>
126
- );
127
- })}
128
- </div>
36
+ <StoryProgressBars
37
+ total={total}
38
+ active={active}
39
+ progress={progress}
40
+ onBarClick={onBarClick}
41
+ hideBorder={hideBorder}
42
+ />
129
43
  );
130
44
  }
131
45
 
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 2026 recap categories. Each one can change the story's colors (theme tokens),
3
+ * wording (copy), motion presets and, rarely, a slide's layout.
4
+ */
5
+ export const RECAP_CATEGORIES = {
6
+ TOP_10: 'top_10',
7
+ STEADY: 'steady',
8
+ FLUCTUATING: 'fluctuating',
9
+ LOW_DATA: 'low_data',
10
+ ZERO_ORDER: 'zero_order',
11
+ } as const;
12
+
13
+ export type RecapCategory = (typeof RECAP_CATEGORIES)[keyof typeof RECAP_CATEGORIES];
14
+
15
+ const ALL_CATEGORIES = Object.values(RECAP_CATEGORIES) as string[];
16
+
17
+ // Values the backend sent for the 2025 recap
18
+ const LEGACY_CATEGORIES: Record<string, RecapCategory> = {
19
+ thriving: RECAP_CATEGORIES.TOP_10,
20
+ not_thriving: RECAP_CATEGORIES.FLUCTUATING,
21
+ new_user: RECAP_CATEGORIES.LOW_DATA,
22
+ };
23
+
24
+ /** Maps the backend's `businessCategory` onto a 2026 category; unknown values fall back to Top 10. */
25
+ export function resolveRecapCategory(businessCategory: string | undefined): RecapCategory {
26
+ if (businessCategory && ALL_CATEGORIES.includes(businessCategory)) {
27
+ return businessCategory as RecapCategory;
28
+ }
29
+ return LEGACY_CATEGORIES[businessCategory ?? ''] ?? RECAP_CATEGORIES.TOP_10;
30
+ }