@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.
- package/dist/App.css +8 -0
- package/dist/LoginScreen.css +6 -139
- package/dist/OtpScreen.css +5 -127
- package/dist/RecapApp.d.ts +4 -1
- package/dist/RecapApp.d.ts.map +1 -1
- package/dist/RecapApp.js +2 -2
- package/dist/RecapLoadingScreen.css +11 -0
- package/dist/RecapStory.d.ts +8 -4
- package/dist/RecapStory.d.ts.map +1 -1
- package/dist/RecapStory.js +5 -254
- package/dist/StoryProgress.d.ts +2 -2
- package/dist/StoryProgress.d.ts.map +1 -1
- package/dist/StoryProgress.js +11 -68
- package/dist/assets/fluctuating/notification-left.svg +30 -0
- package/dist/assets/fluctuating/notification-right.svg +30 -0
- package/dist/assets/fluctuating/notification-top.svg +30 -0
- package/dist/assets/fluctuating/phone-body.svg +18 -0
- package/dist/assets/fluctuating/phone-detail.svg +6 -0
- package/dist/assets/fluctuating/phone-floor.svg +5 -0
- package/dist/assets/fluctuating/phone-marks.svg +8 -0
- package/dist/assets/fluctuating/phone-pulse.svg +7 -0
- package/dist/assets/fluctuating/wave-mask.svg +5 -0
- package/dist/assets/fluctuating/wave.svg +24 -0
- package/dist/assets/low-data/book-left-page.svg +7 -0
- package/dist/assets/low-data/book-right-leaf.svg +6 -0
- package/dist/assets/low-data/book-right-page.svg +5 -0
- package/dist/assets/low-data/book-spine.svg +5 -0
- package/dist/assets/low-data/sign-cord-left.svg +17 -0
- package/dist/assets/low-data/sign-cord-right.svg +17 -0
- package/dist/assets/low-data/sign-edge.svg +5 -0
- package/dist/assets/low-data/sign-eyelet-left.svg +15 -0
- package/dist/assets/low-data/sign-eyelet-right.svg +15 -0
- package/dist/assets/low-data/sign-face-detail.svg +18 -0
- package/dist/assets/low-data/sign-face.svg +10 -0
- package/dist/assets/low-data/sign-inner-bevel.svg +11 -0
- package/dist/assets/low-data/sign-lettering.svg +26 -0
- package/dist/assets/low-data/sign-pin.svg +15 -0
- package/dist/assets/low-data/sign-plaque.svg +19 -0
- package/dist/assets/low-data/sign-rim-bottom.svg +3 -0
- package/dist/assets/low-data/sign-rim-top.svg +3 -0
- package/dist/assets/low-data/store-browser.svg +10 -0
- package/dist/assets/low-data/store-cursor.svg +5 -0
- package/dist/assets/low-data/store-ground.svg +5 -0
- package/dist/assets/recap-intro/close.svg +5 -0
- package/dist/assets/recap-intro/loading-bar-1.png +0 -0
- package/dist/assets/recap-intro/loading-bar-2.png +0 -0
- package/dist/assets/recap-intro/tunnel.svg +516 -0
- package/dist/assets/steady/bag/badge.svg +9 -0
- package/dist/assets/steady/bag/body.svg +105 -0
- package/dist/assets/steady/bag/front-handle-inner.svg +353 -0
- package/dist/assets/steady/bag/front-handle.svg +10 -0
- package/dist/assets/steady/bag/hand.svg +208 -0
- package/dist/assets/steady/bag/rear-handle-inner.svg +297 -0
- package/dist/assets/steady/bag/rear-handle-top.svg +3 -0
- package/dist/assets/steady/bag/rear-handle.svg +10 -0
- package/dist/assets/steady/bag/shadow.svg +7 -0
- package/dist/assets/steady/calendar/base.png +0 -0
- package/dist/assets/steady/calendar/tick.svg +6 -0
- package/dist/assets/steady/coin/shimmer-mask.svg +5 -0
- package/dist/assets/steady/coin/shimmer.svg +16 -0
- package/dist/assets/steady/coin.png +0 -0
- package/dist/assets/steady/tree.svg +790 -0
- package/dist/assets/top10/biggest-day/coin-left.svg +21 -0
- package/dist/assets/top10/biggest-day/coin-right.svg +21 -0
- package/dist/assets/top10/biggest-day/coin-top.svg +21 -0
- package/dist/assets/top10/biggest-day/floor.svg +5 -0
- package/dist/assets/top10/biggest-day/illustration.png +0 -0
- package/dist/assets/top10/biggest-day/marks.svg +8 -0
- package/dist/assets/top10/biggest-day/mask.svg +5 -0
- package/dist/assets/top10/biggest-day/phone-body.svg +18 -0
- package/dist/assets/top10/biggest-day/phone-detail.svg +6 -0
- package/dist/assets/top10/closing/imgHccStaticHaloScale.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticHaloScale1.svg +12 -0
- package/dist/assets/top10/closing/imgHccStaticP0Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP10Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP11Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP12Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP13Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP14Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP15Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP16Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP17Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP18Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP19Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP1Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP20Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP21Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP22Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP23Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP24Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP25Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP26Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP27Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP28Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP29Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP2Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP30Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP31Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP32Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP33Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP34Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP35Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP36Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP37Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP38Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP39Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP3Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP40Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP41Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP42Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP43Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP44Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP45Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP46Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP47Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP48Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP49Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP4Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP50Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP51Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP52Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP53Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP54Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP55Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP5Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP6Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP7Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP8Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgHccStaticP9Tumble.svg +5 -0
- package/dist/assets/top10/closing/imgVector.png +0 -0
- package/dist/assets/top10/closing/replay.svg +7 -0
- package/dist/assets/top10/closing/share.svg +6 -0
- package/dist/assets/top10/customers/arrow.svg +6 -0
- package/dist/assets/top10/customers/avatar.svg +61 -0
- package/dist/assets/top10/customers/illustration.png +0 -0
- package/dist/assets/top10/favourite/emoji.svg +9 -0
- package/dist/assets/top10/favourite/heart.svg +8 -0
- package/dist/assets/top10/growth/coin.svg +10 -0
- package/dist/assets/top10/growth/counter-shadow.svg +12 -0
- package/dist/assets/top10/growth/counter.svg +8 -0
- package/dist/assets/top10/growth/highlight.svg +12 -0
- package/dist/assets/top10/growth/illustration.png +0 -0
- package/dist/assets/top10/milestone/illustration.png +0 -0
- package/dist/assets/top10/orders/giver.svg +18 -0
- package/dist/assets/top10/orders/illustration.png +0 -0
- package/dist/assets/top10/orders/mask.svg +5 -0
- package/dist/assets/top10/orders/parcel.svg +16 -0
- package/dist/assets/top10/orders/receiver.svg +20 -0
- package/dist/assets/top10/orders/seal.svg +8 -0
- package/dist/assets/top10/recognition/contact-mask.svg +6 -0
- package/dist/assets/top10/recognition/contact.svg +14 -0
- package/dist/assets/top10/recognition/mask.svg +5 -0
- package/dist/assets/top10/recognition/plug-left.svg +27 -0
- package/dist/assets/top10/recognition/plug-right.svg +23 -0
- package/dist/assets/top10/recognition/pulse.svg +15 -0
- package/dist/assets/top10/recognition/ring.svg +3 -0
- package/dist/assets/top10/shared/avatar.png +0 -0
- package/dist/assets/top10/shared/close-dark.svg +5 -0
- package/dist/assets/top10/shared/close-light.svg +5 -0
- package/dist/assets/top10/signature/glow.svg +13 -0
- package/dist/assets/top10/signature/horizon.svg +12 -0
- package/dist/assets/top10/signature/inner-glow.svg +13 -0
- package/dist/assets/top10/signature/mask.svg +5 -0
- package/dist/assets/top10/signature/rim-glow.svg +13 -0
- package/dist/assets/top10/signature/rim.svg +13 -0
- package/dist/assets/top10/signature/year-mask.svg +5 -0
- package/dist/assets/top10/signature/year-shadow.svg +8 -0
- package/dist/assets/top10/signature/year.svg +30 -0
- package/dist/assets/top10/surprise/illustration.png +0 -0
- package/dist/assets/top10/surprise/note-front.svg +275 -0
- package/dist/assets/zero-order/catalogue-card.svg +15 -0
- package/dist/assets/zero-order/catalogue-ground.svg +3 -0
- package/dist/assets/zero-order/catalogue-window.svg +15 -0
- package/dist/assets/zero-order/storefront-awning.svg +145 -0
- package/dist/assets/zero-order/storefront-chrome.svg +15 -0
- package/dist/assets/zero-order/storefront-door-frame.svg +3 -0
- package/dist/assets/zero-order/storefront-door-glass.svg +14 -0
- package/dist/assets/zero-order/storefront-door-handle-light.svg +3 -0
- package/dist/assets/zero-order/storefront-door-handle-shadow.svg +3 -0
- package/dist/assets/zero-order/storefront-door-handle.svg +3 -0
- package/dist/assets/zero-order/storefront-door-mask.svg +5 -0
- package/dist/assets/zero-order/storefront-door-pane.svg +10 -0
- package/dist/assets/zero-order/storefront-door-panel.svg +3 -0
- package/dist/assets/zero-order/storefront-door-sill.svg +3 -0
- package/dist/assets/zero-order/storefront-ground.svg +3 -0
- package/dist/assets/zero-order/storefront-shell.svg +19 -0
- package/dist/assets/zero-order/storefront-step.svg +8 -0
- package/dist/assets/zero-order/storefront-wall.svg +13 -0
- package/dist/assets/zero-order/storefront-window-frame.svg +3 -0
- package/dist/assets/zero-order/storefront-window-glass.svg +16 -0
- package/dist/assets/zero-order/storefront-window-ledge-edge.svg +3 -0
- package/dist/assets/zero-order/storefront-window-ledge-line.svg +3 -0
- package/dist/assets/zero-order/storefront-window-ledge.svg +3 -0
- package/dist/assets/zero-order/storefront-window-mask.svg +5 -0
- package/dist/assets/zero-order/storefront-window-pane.svg +10 -0
- package/dist/assets/zero-order/storefront-window-sill.svg +3 -0
- package/dist/categories.d.ts +15 -0
- package/dist/categories.d.ts.map +1 -0
- package/dist/categories.js +25 -0
- package/dist/components/RecapIntroLayout.css +225 -0
- package/dist/components/RecapIntroLayout.d.ts +16 -0
- package/dist/components/RecapIntroLayout.d.ts.map +1 -0
- package/dist/components/RecapIntroLayout.js +19 -0
- package/dist/data/mock.d.ts +12 -2
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/mock.js +99 -59
- package/dist/data/recapCopy.d.ts +1 -0
- package/dist/data/recapCopy.d.ts.map +1 -1
- package/dist/data/recapCopy.js +30 -21
- package/dist/data/remoteAssets.d.ts +3 -0
- package/dist/data/remoteAssets.d.ts.map +1 -0
- package/dist/data/remoteAssets.js +3 -0
- package/dist/hooks/useBackgroundMusic.d.ts +8 -8
- package/dist/hooks/useBackgroundMusic.d.ts.map +1 -1
- package/dist/hooks/useBackgroundMusic.js +38 -43
- package/dist/hooks/useCountUp.d.ts +16 -0
- package/dist/hooks/useCountUp.d.ts.map +1 -0
- package/dist/hooks/useCountUp.js +15 -0
- package/dist/hooks/useFrameImages.d.ts +5 -0
- package/dist/hooks/useFrameImages.d.ts.map +1 -0
- package/dist/hooks/useFrameImages.js +18 -0
- package/dist/hooks/useSessionValidator.d.ts +14 -0
- package/dist/hooks/useSessionValidator.d.ts.map +1 -0
- package/dist/hooks/useSessionValidator.js +97 -0
- package/dist/hooks/useShareCardPrecapture.d.ts +17 -0
- package/dist/hooks/useShareCardPrecapture.d.ts.map +1 -0
- package/dist/hooks/useShareCardPrecapture.js +35 -0
- package/dist/hooks/useStatusBarColor.d.ts +6 -0
- package/dist/hooks/useStatusBarColor.d.ts.map +1 -0
- package/dist/hooks/useStatusBarColor.js +34 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/slides/Slide10Final.d.ts.map +1 -1
- package/dist/slides/Slide10Final.js +2 -50
- package/dist/slides/Slide1Intro.css +1 -2
- package/dist/slides/Slide1Intro.d.ts.map +1 -1
- package/dist/slides/Slide1Intro.js +21 -25
- package/dist/slides/Slide2Days.d.ts.map +1 -1
- package/dist/slides/Slide2Days.js +7 -44
- package/dist/slides/Slide3Revenue.d.ts.map +1 -1
- package/dist/slides/Slide3Revenue.js +5 -22
- package/dist/slides/Slide4Orders.d.ts.map +1 -1
- package/dist/slides/Slide4Orders.js +12 -41
- package/dist/slides/Slide5Buyers.d.ts.map +1 -1
- package/dist/slides/Slide5Buyers.js +9 -43
- package/dist/slides/Slide6Customer.d.ts.map +1 -1
- package/dist/slides/Slide6Customer.js +3 -19
- package/dist/slides/Slide9Year.d.ts.map +1 -1
- package/dist/slides/Slide9Year.js +3 -21
- package/dist/slides/registry.d.ts +7 -0
- package/dist/slides/registry.d.ts.map +1 -0
- package/dist/slides/registry.js +84 -0
- package/dist/store/auth.d.ts +40 -0
- package/dist/store/auth.d.ts.map +1 -0
- package/dist/store/auth.js +40 -0
- package/dist/story/StoryProgressBars.d.ts +13 -0
- package/dist/story/StoryProgressBars.d.ts.map +1 -0
- package/dist/story/StoryProgressBars.js +12 -0
- package/dist/story/index.d.ts +12 -0
- package/dist/story/index.d.ts.map +1 -0
- package/dist/story/index.js +10 -0
- package/dist/story/resolveStories.d.ts +9 -0
- package/dist/story/resolveStories.d.ts.map +1 -0
- package/dist/story/resolveStories.js +23 -0
- package/dist/story/storyPlayerReducer.d.ts +33 -0
- package/dist/story/storyPlayerReducer.d.ts.map +1 -0
- package/dist/story/storyPlayerReducer.js +55 -0
- package/dist/story/types.d.ts +55 -0
- package/dist/story/types.d.ts.map +1 -0
- package/dist/story/types.js +1 -0
- package/dist/story/usePreloadAssets.d.ts +8 -0
- package/dist/story/usePreloadAssets.d.ts.map +1 -0
- package/dist/story/usePreloadAssets.js +21 -0
- package/dist/story/useStoryGestures.d.ts +23 -0
- package/dist/story/useStoryGestures.d.ts.map +1 -0
- package/dist/story/useStoryGestures.js +60 -0
- package/dist/story/useStoryKeyboard.d.ts +10 -0
- package/dist/story/useStoryKeyboard.d.ts.map +1 -0
- package/dist/story/useStoryKeyboard.js +43 -0
- package/dist/story/useStoryPlayer.d.ts +26 -0
- package/dist/story/useStoryPlayer.d.ts.map +1 -0
- package/dist/story/useStoryPlayer.js +64 -0
- package/dist/story/useStoryTimer.d.ts +16 -0
- package/dist/story/useStoryTimer.d.ts.map +1 -0
- package/dist/story/useStoryTimer.js +34 -0
- package/dist/story/useVideoCaptureBridge.d.ts +6 -0
- package/dist/story/useVideoCaptureBridge.d.ts.map +1 -0
- package/dist/story/useVideoCaptureBridge.js +22 -0
- package/dist/top10/RecapStory2026.d.ts +20 -0
- package/dist/top10/RecapStory2026.d.ts.map +1 -0
- package/dist/top10/RecapStory2026.js +67 -0
- package/dist/top10/Top10Chrome.d.ts +16 -0
- package/dist/top10/Top10Chrome.d.ts.map +1 -0
- package/dist/top10/Top10Chrome.js +15 -0
- package/dist/top10/Top10Slides.css +308 -0
- package/dist/top10/Top10Story.css +250 -0
- package/dist/top10/fluctuatingSlides.d.ts +5 -0
- package/dist/top10/fluctuatingSlides.d.ts.map +1 -0
- package/dist/top10/fluctuatingSlides.js +30 -0
- package/dist/top10/format.d.ts +17 -0
- package/dist/top10/format.d.ts.map +1 -0
- package/dist/top10/format.js +57 -0
- package/dist/top10/illustrations/IllustrationLayers.d.ts +51 -0
- package/dist/top10/illustrations/IllustrationLayers.d.ts.map +1 -0
- package/dist/top10/illustrations/IllustrationLayers.js +51 -0
- package/dist/top10/illustrations/closingAssets.d.ts +2 -0
- package/dist/top10/illustrations/closingAssets.d.ts.map +1 -0
- package/dist/top10/illustrations/closingAssets.js +119 -0
- package/dist/top10/illustrations/closingLayers.json +461 -0
- package/dist/top10/illustrations/index.d.ts +45 -0
- package/dist/top10/illustrations/index.d.ts.map +1 -0
- package/dist/top10/illustrations/index.js +646 -0
- package/dist/top10/lowDataSlides.d.ts +9 -0
- package/dist/top10/lowDataSlides.d.ts.map +1 -0
- package/dist/top10/lowDataSlides.js +50 -0
- package/dist/top10/motion.d.ts +18 -0
- package/dist/top10/motion.d.ts.map +1 -0
- package/dist/top10/motion.js +43 -0
- package/dist/top10/registry.d.ts +21 -0
- package/dist/top10/registry.d.ts.map +1 -0
- package/dist/top10/registry.js +313 -0
- package/dist/top10/slides.d.ts +87 -0
- package/dist/top10/slides.d.ts.map +1 -0
- package/dist/top10/slides.js +137 -0
- package/dist/top10/steadySlides.d.ts +16 -0
- package/dist/top10/steadySlides.d.ts.map +1 -0
- package/dist/top10/steadySlides.js +78 -0
- package/dist/top10/useCanvasScale.d.ts +18 -0
- package/dist/top10/useCanvasScale.d.ts.map +1 -0
- package/dist/top10/useCanvasScale.js +50 -0
- package/dist/top10/zeroOrderSlides.d.ts +9 -0
- package/dist/top10/zeroOrderSlides.d.ts.map +1 -0
- package/dist/top10/zeroOrderSlides.js +34 -0
- package/dist/types.d.ts +74 -14
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/utils/Helpers.d.ts +7 -0
- package/dist/utils/Helpers.d.ts.map +1 -0
- package/dist/utils/Helpers.js +21 -0
- package/dist/utils/RecapApi.d.ts +3 -0
- package/dist/utils/RecapApi.d.ts.map +1 -0
- package/dist/utils/RecapApi.js +35 -0
- package/dist/utils/Services/AuthServices.d.ts +49 -0
- package/dist/utils/Services/AuthServices.d.ts.map +1 -0
- package/dist/utils/Services/AuthServices.js +16 -0
- package/dist/utils/Services/mockApi.d.ts +49 -0
- package/dist/utils/Services/mockApi.d.ts.map +1 -0
- package/dist/utils/Services/mockApi.js +60 -0
- package/dist/utils/analytics.d.ts +4 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +12 -0
- package/dist/utils/shareRecapVideo.d.ts +6 -0
- package/dist/utils/shareRecapVideo.d.ts.map +1 -0
- package/dist/utils/shareRecapVideo.js +40 -0
- package/dist/utils/vendorApp.d.ts +2 -0
- package/dist/utils/vendorApp.d.ts.map +1 -0
- package/dist/utils/vendorApp.js +4 -0
- package/package.json +25 -10
- package/src/App.css +8 -0
- package/src/App.tsx +75 -22
- package/src/LoginScreen.css +6 -139
- package/src/LoginScreen.tsx +126 -36
- package/src/OtpScreen.css +5 -127
- package/src/OtpScreen.tsx +84 -37
- package/src/RecapApp.tsx +6 -3
- package/src/RecapLoadingScreen.css +11 -0
- package/src/RecapLoadingScreen.tsx +64 -0
- package/src/RecapStory.tsx +11 -423
- package/src/StoryProgress.tsx +18 -104
- package/src/categories.ts +30 -0
- package/src/components/RecapIntroLayout.css +225 -0
- package/src/components/RecapIntroLayout.tsx +64 -0
- package/src/data/mock.ts +110 -67
- package/src/data/recapCopy.ts +33 -21
- package/src/data/remoteAssets.ts +3 -0
- package/src/hooks/useBackgroundMusic.ts +46 -48
- package/src/hooks/useCountUp.ts +36 -0
- package/src/hooks/useFrameImages.ts +19 -0
- package/src/hooks/useSessionValidator.ts +115 -0
- package/src/hooks/useShareCardPrecapture.ts +50 -0
- package/src/hooks/useStatusBarColor.ts +36 -0
- package/src/index.css +1 -1
- package/src/index.ts +24 -0
- package/src/lib/queryClient.ts +34 -0
- package/src/main.tsx +44 -0
- package/src/queries/recap.ts +15 -0
- package/src/slides/Slide10Final.tsx +2 -56
- package/src/slides/Slide1Intro.css +1 -2
- package/src/slides/Slide1Intro.tsx +22 -32
- package/src/slides/Slide2Days.tsx +7 -55
- package/src/slides/Slide3Revenue.tsx +5 -29
- package/src/slides/Slide4Orders.tsx +12 -53
- package/src/slides/Slide5Buyers.tsx +9 -52
- package/src/slides/Slide6Customer.tsx +3 -21
- package/src/slides/Slide9Year.tsx +3 -26
- package/src/slides/registry.tsx +129 -0
- package/src/store/auth.tsx +72 -0
- package/src/story/StoryProgressBars.tsx +42 -0
- package/src/story/index.ts +11 -0
- package/src/story/resolveStories.ts +31 -0
- package/src/story/storyPlayerReducer.ts +80 -0
- package/src/story/types.ts +49 -0
- package/src/story/usePreloadAssets.ts +28 -0
- package/src/story/useStoryGestures.ts +95 -0
- package/src/story/useStoryKeyboard.ts +56 -0
- package/src/story/useStoryPlayer.ts +120 -0
- package/src/story/useStoryTimer.ts +55 -0
- package/src/story/useVideoCaptureBridge.ts +30 -0
- package/src/top10/RecapStory2026.tsx +136 -0
- package/src/top10/Top10Chrome.tsx +66 -0
- package/src/top10/Top10Slides.css +308 -0
- package/src/top10/Top10Story.css +250 -0
- package/src/top10/fluctuatingSlides.tsx +88 -0
- package/src/top10/format.ts +61 -0
- package/src/top10/illustrations/IllustrationLayers.tsx +150 -0
- package/src/top10/illustrations/closingAssets.ts +120 -0
- package/src/top10/illustrations/index.tsx +753 -0
- package/src/top10/lowDataSlides.tsx +178 -0
- package/src/top10/motion.ts +65 -0
- package/src/top10/registry.tsx +370 -0
- package/src/top10/slides.tsx +560 -0
- package/src/top10/steadySlides.tsx +199 -0
- package/src/top10/useCanvasScale.ts +66 -0
- package/src/top10/zeroOrderSlides.tsx +120 -0
- package/src/types.ts +95 -19
- package/src/utils/Helpers.tsx +25 -0
- package/src/utils/RecapApi.tsx +39 -0
- package/src/utils/Services/AuthServices.tsx +18 -0
- package/src/utils/Services/mockApi.ts +77 -0
- package/src/utils/analytics.ts +15 -0
- package/src/utils/shareRecapVideo.ts +44 -0
- package/src/utils/vendorApp.ts +5 -0
- package/src/vite-env.d.ts +1 -0
- package/src/react-app-env.d.ts +0 -26
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const DEFAULT_STORY_DURATION = 8;
|
|
2
|
+
/**
|
|
3
|
+
* Turns story definitions into the concrete playlist for a given context:
|
|
4
|
+
* drops excluded cards and settles each card's duration and asset list.
|
|
5
|
+
* `durationOverrides` (seconds, keyed by story id) wins over a definition's own duration.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveStories(definitions, context, durationOverrides = {}) {
|
|
8
|
+
return definitions
|
|
9
|
+
.filter((definition) => definition.include?.(context) ?? true)
|
|
10
|
+
.map((definition) => {
|
|
11
|
+
const override = durationOverrides[definition.id];
|
|
12
|
+
return {
|
|
13
|
+
id: definition.id,
|
|
14
|
+
duration: typeof override === 'number' && override > 0
|
|
15
|
+
? override
|
|
16
|
+
: definition.duration ?? DEFAULT_STORY_DURATION,
|
|
17
|
+
assets: (definition.assets?.(context) ?? []).filter(Boolean),
|
|
18
|
+
outro: definition.outro === true,
|
|
19
|
+
theme: definition.theme,
|
|
20
|
+
render: definition.render,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PauseReason } from './types';
|
|
2
|
+
export interface StoryPlayerState {
|
|
3
|
+
index: number;
|
|
4
|
+
count: number;
|
|
5
|
+
pauseReasons: PauseReason[];
|
|
6
|
+
/** The last card's timer has run out; playback stays on it until navigation. */
|
|
7
|
+
ended: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type StoryPlayerAction = {
|
|
10
|
+
type: 'next';
|
|
11
|
+
} | {
|
|
12
|
+
type: 'prev';
|
|
13
|
+
} | {
|
|
14
|
+
type: 'goTo';
|
|
15
|
+
index: number;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'timerComplete';
|
|
18
|
+
} | {
|
|
19
|
+
type: 'restart';
|
|
20
|
+
} | {
|
|
21
|
+
type: 'pause';
|
|
22
|
+
reason: PauseReason;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'resume';
|
|
25
|
+
reason: PauseReason;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'setCount';
|
|
28
|
+
count: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function createInitialPlayerState(count: number, initialPauseReasons?: PauseReason[]): StoryPlayerState;
|
|
31
|
+
export declare function storyPlayerReducer(state: StoryPlayerState, action: StoryPlayerAction): StoryPlayerState;
|
|
32
|
+
export declare function isPlayerRunning(state: StoryPlayerState): boolean;
|
|
33
|
+
//# sourceMappingURL=storyPlayerReducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storyPlayerReducer.d.ts","sourceRoot":"","sources":["../../src/story/storyPlayerReducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,gFAAgF;IAChF,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAKxC,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,mBAAmB,GAAE,WAAW,EAAO,GACtC,gBAAgB,CAElB;AAYD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,iBAAiB,GACxB,gBAAgB,CAgClB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAEhE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Pauses that end when the viewer navigates; environmental ones (hidden tab, orchestrator) persist. */
|
|
2
|
+
const INTERACTION_PAUSES = ['hold', 'user'];
|
|
3
|
+
export function createInitialPlayerState(count, initialPauseReasons = []) {
|
|
4
|
+
return { index: 0, count, pauseReasons: initialPauseReasons, ended: false };
|
|
5
|
+
}
|
|
6
|
+
function navigate(state, index) {
|
|
7
|
+
if (index < 0 || index >= state.count || index === state.index)
|
|
8
|
+
return state;
|
|
9
|
+
return {
|
|
10
|
+
...state,
|
|
11
|
+
index,
|
|
12
|
+
ended: false,
|
|
13
|
+
pauseReasons: state.pauseReasons.filter((r) => !INTERACTION_PAUSES.includes(r)),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function storyPlayerReducer(state, action) {
|
|
17
|
+
switch (action.type) {
|
|
18
|
+
case 'next':
|
|
19
|
+
return navigate(state, state.index + 1);
|
|
20
|
+
case 'prev':
|
|
21
|
+
return navigate(state, state.index - 1);
|
|
22
|
+
case 'goTo':
|
|
23
|
+
return navigate(state, action.index);
|
|
24
|
+
case 'timerComplete':
|
|
25
|
+
if (state.index < state.count - 1)
|
|
26
|
+
return navigate(state, state.index + 1);
|
|
27
|
+
return state.ended ? state : { ...state, ended: true };
|
|
28
|
+
case 'restart':
|
|
29
|
+
return {
|
|
30
|
+
...state,
|
|
31
|
+
index: 0,
|
|
32
|
+
ended: false,
|
|
33
|
+
pauseReasons: state.pauseReasons.filter((r) => !INTERACTION_PAUSES.includes(r)),
|
|
34
|
+
};
|
|
35
|
+
case 'pause':
|
|
36
|
+
if (state.pauseReasons.includes(action.reason))
|
|
37
|
+
return state;
|
|
38
|
+
return { ...state, pauseReasons: [...state.pauseReasons, action.reason] };
|
|
39
|
+
case 'resume':
|
|
40
|
+
if (!state.pauseReasons.includes(action.reason))
|
|
41
|
+
return state;
|
|
42
|
+
return { ...state, pauseReasons: state.pauseReasons.filter((r) => r !== action.reason) };
|
|
43
|
+
case 'setCount': {
|
|
44
|
+
if (action.count === state.count)
|
|
45
|
+
return state;
|
|
46
|
+
const lastIndex = Math.max(action.count - 1, 0);
|
|
47
|
+
return { ...state, count: action.count, index: Math.min(state.index, lastIndex) };
|
|
48
|
+
}
|
|
49
|
+
default:
|
|
50
|
+
return state;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export function isPlayerRunning(state) {
|
|
54
|
+
return !state.ended && state.pauseReasons.length === 0;
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Why playback is currently halted. Playback only runs when no reasons are active,
|
|
4
|
+
* so independent sources (a held finger, a hidden tab, an external orchestrator)
|
|
5
|
+
* can pause and resume without stepping on each other.
|
|
6
|
+
*/
|
|
7
|
+
export type PauseReason = 'hold' | 'hidden' | 'external' | 'user';
|
|
8
|
+
export interface StoryControls {
|
|
9
|
+
next: () => void;
|
|
10
|
+
prev: () => void;
|
|
11
|
+
goTo: (index: number) => void;
|
|
12
|
+
restart: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Declarative description of a single story card.
|
|
16
|
+
* `TContext` is whatever data the cards are rendered from (e.g. RecapData).
|
|
17
|
+
*/
|
|
18
|
+
export interface StoryDefinition<TContext> {
|
|
19
|
+
id: string;
|
|
20
|
+
render: (context: TContext, controls: StoryControls) => ReactNode;
|
|
21
|
+
/** Seconds the card stays on screen before auto-advancing. */
|
|
22
|
+
duration?: number;
|
|
23
|
+
/** Omit the card for contexts where it doesn't apply. */
|
|
24
|
+
include?: (context: TContext) => boolean;
|
|
25
|
+
/** Image URLs the card needs; preloaded before the card is reached. */
|
|
26
|
+
assets?: (context: TContext) => string[];
|
|
27
|
+
/** Closing card: no floating controls, no background music, borderless progress. */
|
|
28
|
+
outro?: boolean;
|
|
29
|
+
/** Visual theme key for the card and the chrome drawn over it. */
|
|
30
|
+
theme?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ResolvedStory<TContext> {
|
|
33
|
+
id: string;
|
|
34
|
+
duration: number;
|
|
35
|
+
assets: string[];
|
|
36
|
+
outro: boolean;
|
|
37
|
+
theme?: string;
|
|
38
|
+
render: StoryDefinition<TContext>['render'];
|
|
39
|
+
}
|
|
40
|
+
export type StoryEvent = {
|
|
41
|
+
type: 'story_view';
|
|
42
|
+
storyId: string;
|
|
43
|
+
index: number;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'story_complete';
|
|
46
|
+
storyId: string;
|
|
47
|
+
index: number;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'share';
|
|
50
|
+
storyId: string;
|
|
51
|
+
index: number;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'replay';
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/story/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAElE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,QAAQ;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,KAAK,SAAS,CAAC;IAClE,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC;IACzC,uEAAuE;IACvE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,MAAM,EAAE,CAAC;IACzC,oFAAoF;IACpF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa,CAAC,QAAQ;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ResolvedStory } from './types';
|
|
2
|
+
export declare function preloadImage(url: string): void;
|
|
3
|
+
/**
|
|
4
|
+
* Warms the browser cache for the active story and the next `lookahead` stories,
|
|
5
|
+
* so images are already decoded by the time each card animates in.
|
|
6
|
+
*/
|
|
7
|
+
export declare function usePreloadAssets<TContext>(stories: ResolvedStory<TContext>[], activeIndex: number, lookahead?: number): void;
|
|
8
|
+
//# sourceMappingURL=usePreloadAssets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePreloadAssets.d.ts","sourceRoot":"","sources":["../../src/story/usePreloadAssets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAM9C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EACvC,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,EAClC,WAAW,EAAE,MAAM,EACnB,SAAS,SAAI,QAOd"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
const requested = new Set();
|
|
3
|
+
export function preloadImage(url) {
|
|
4
|
+
if (!url || requested.has(url) || typeof Image === 'undefined')
|
|
5
|
+
return;
|
|
6
|
+
requested.add(url);
|
|
7
|
+
const image = new Image();
|
|
8
|
+
image.decoding = 'async';
|
|
9
|
+
image.src = url;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Warms the browser cache for the active story and the next `lookahead` stories,
|
|
13
|
+
* so images are already decoded by the time each card animates in.
|
|
14
|
+
*/
|
|
15
|
+
export function usePreloadAssets(stories, activeIndex, lookahead = 1) {
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
stories
|
|
18
|
+
.slice(activeIndex, activeIndex + 1 + lookahead)
|
|
19
|
+
.forEach((story) => story.assets.forEach(preloadImage));
|
|
20
|
+
}, [stories, activeIndex, lookahead]);
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PointerEvent } from 'react';
|
|
2
|
+
interface UseStoryGesturesOptions {
|
|
3
|
+
onPrev: () => void;
|
|
4
|
+
onNext: () => void;
|
|
5
|
+
onHoldStart: () => void;
|
|
6
|
+
onHoldEnd: () => void;
|
|
7
|
+
/** Milliseconds a press must last before it counts as a hold. */
|
|
8
|
+
holdDelay?: number;
|
|
9
|
+
/** Fraction of the width on each side that acts as a prev/next tap zone. */
|
|
10
|
+
edgeZone?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Story tap/hold handling: tap the left edge for previous, the right edge for next,
|
|
14
|
+
* press and hold anywhere to pause. Presses that start on buttons are ignored.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useStoryGestures({ onPrev, onNext, onHoldStart, onHoldEnd, holdDelay, edgeZone, }: UseStoryGesturesOptions): {
|
|
17
|
+
onPointerDown: (event: PointerEvent<HTMLElement>) => void;
|
|
18
|
+
onPointerUp: (event: PointerEvent<HTMLElement>) => void;
|
|
19
|
+
onPointerLeave: () => void;
|
|
20
|
+
onPointerCancel: () => void;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=useStoryGestures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStoryGestures.d.ts","sourceRoot":"","sources":["../../src/story/useStoryGestures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,UAAU,uBAAuB;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAOD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,MAAM,EACN,WAAW,EACX,SAAS,EACT,SAAe,EACf,QAAc,GACf,EAAE,uBAAuB;2BAcd,YAAY,CAAC,WAAW,CAAC;yBAazB,YAAY,CAAC,WAAW,CAAC;;;EAqCpC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
function isInteractiveTarget(target) {
|
|
3
|
+
const element = target;
|
|
4
|
+
return !!element && (element.tagName === 'BUTTON' || !!element.closest('button'));
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Story tap/hold handling: tap the left edge for previous, the right edge for next,
|
|
8
|
+
* press and hold anywhere to pause. Presses that start on buttons are ignored.
|
|
9
|
+
*/
|
|
10
|
+
export function useStoryGestures({ onPrev, onNext, onHoldStart, onHoldEnd, holdDelay = 150, edgeZone = 0.2, }) {
|
|
11
|
+
const holdTimerRef = useRef(null);
|
|
12
|
+
const isHoldingRef = useRef(false);
|
|
13
|
+
const clearHoldTimer = () => {
|
|
14
|
+
if (holdTimerRef.current) {
|
|
15
|
+
clearTimeout(holdTimerRef.current);
|
|
16
|
+
holdTimerRef.current = null;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
useEffect(() => clearHoldTimer, []);
|
|
20
|
+
const onPointerDown = useCallback((event) => {
|
|
21
|
+
if (isInteractiveTarget(event.target))
|
|
22
|
+
return;
|
|
23
|
+
isHoldingRef.current = false;
|
|
24
|
+
holdTimerRef.current = setTimeout(() => {
|
|
25
|
+
isHoldingRef.current = true;
|
|
26
|
+
onHoldStart();
|
|
27
|
+
}, holdDelay);
|
|
28
|
+
}, [holdDelay, onHoldStart]);
|
|
29
|
+
const onPointerUp = useCallback((event) => {
|
|
30
|
+
clearHoldTimer();
|
|
31
|
+
if (isHoldingRef.current) {
|
|
32
|
+
isHoldingRef.current = false;
|
|
33
|
+
onHoldEnd();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (isInteractiveTarget(event.target))
|
|
37
|
+
return;
|
|
38
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
39
|
+
const tapX = event.clientX - rect.left;
|
|
40
|
+
if (tapX < rect.width * edgeZone) {
|
|
41
|
+
onPrev();
|
|
42
|
+
}
|
|
43
|
+
else if (tapX > rect.width * (1 - edgeZone)) {
|
|
44
|
+
onNext();
|
|
45
|
+
}
|
|
46
|
+
}, [edgeZone, onHoldEnd, onNext, onPrev]);
|
|
47
|
+
const onPointerLeave = useCallback(() => {
|
|
48
|
+
clearHoldTimer();
|
|
49
|
+
if (isHoldingRef.current) {
|
|
50
|
+
isHoldingRef.current = false;
|
|
51
|
+
onHoldEnd();
|
|
52
|
+
}
|
|
53
|
+
}, [onHoldEnd]);
|
|
54
|
+
return {
|
|
55
|
+
onPointerDown,
|
|
56
|
+
onPointerUp,
|
|
57
|
+
onPointerLeave,
|
|
58
|
+
onPointerCancel: onPointerLeave,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface UseStoryKeyboardOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
onPrev: () => void;
|
|
4
|
+
onNext: () => void;
|
|
5
|
+
onTogglePause: () => void;
|
|
6
|
+
}
|
|
7
|
+
/** Desktop navigation: ← / → to move between stories, Space to pause/resume. */
|
|
8
|
+
export declare function useStoryKeyboard({ enabled, onPrev, onNext, onTogglePause, }: UseStoryKeyboardOptions): void;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=useStoryKeyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStoryKeyboard.d.ts","sourceRoot":"","sources":["../../src/story/useStoryKeyboard.ts"],"names":[],"mappings":"AAEA,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAaD,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,EAC/B,OAAc,EACd,MAAM,EACN,MAAM,EACN,aAAa,GACd,EAAE,uBAAuB,QA6BzB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
function isEditableTarget(target) {
|
|
3
|
+
const element = target;
|
|
4
|
+
if (!element)
|
|
5
|
+
return false;
|
|
6
|
+
return element.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(element.tagName);
|
|
7
|
+
}
|
|
8
|
+
function isButtonTarget(target) {
|
|
9
|
+
const element = target;
|
|
10
|
+
return !!element && (element.tagName === 'BUTTON' || !!element.closest('button'));
|
|
11
|
+
}
|
|
12
|
+
/** Desktop navigation: ← / → to move between stories, Space to pause/resume. */
|
|
13
|
+
export function useStoryKeyboard({ enabled = true, onPrev, onNext, onTogglePause, }) {
|
|
14
|
+
const handlersRef = useRef({ onPrev, onNext, onTogglePause });
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
handlersRef.current = { onPrev, onNext, onTogglePause };
|
|
17
|
+
}, [onPrev, onNext, onTogglePause]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!enabled)
|
|
20
|
+
return;
|
|
21
|
+
const handleKeyDown = (event) => {
|
|
22
|
+
if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey)
|
|
23
|
+
return;
|
|
24
|
+
if (isEditableTarget(event.target))
|
|
25
|
+
return;
|
|
26
|
+
const handlers = handlersRef.current;
|
|
27
|
+
if (event.key === 'ArrowLeft') {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
handlers.onPrev();
|
|
30
|
+
}
|
|
31
|
+
else if (event.key === 'ArrowRight') {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
handlers.onNext();
|
|
34
|
+
}
|
|
35
|
+
else if (event.key === ' ' && !isButtonTarget(event.target)) {
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
handlers.onTogglePause();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
41
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
42
|
+
}, [enabled]);
|
|
43
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MotionValue } from 'framer-motion';
|
|
2
|
+
import type { PauseReason, ResolvedStory, StoryControls, StoryEvent } from './types';
|
|
3
|
+
interface UseStoryPlayerOptions<TContext> {
|
|
4
|
+
stories: ResolvedStory<TContext>[];
|
|
5
|
+
/** Hold playback until `resume('external')` is called (e.g. by a recording orchestrator). */
|
|
6
|
+
startPaused?: boolean;
|
|
7
|
+
autoAdvance?: boolean;
|
|
8
|
+
/** Pause while the page is in a background tab. */
|
|
9
|
+
pauseWhenHidden?: boolean;
|
|
10
|
+
onEvent?: (event: StoryEvent) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface StoryPlayer<TContext> {
|
|
13
|
+
story: ResolvedStory<TContext>;
|
|
14
|
+
index: number;
|
|
15
|
+
count: number;
|
|
16
|
+
isRunning: boolean;
|
|
17
|
+
isEnded: boolean;
|
|
18
|
+
isPausedBy: (reason: PauseReason) => boolean;
|
|
19
|
+
progress: MotionValue<number>;
|
|
20
|
+
controls: StoryControls;
|
|
21
|
+
pause: (reason: PauseReason) => void;
|
|
22
|
+
resume: (reason: PauseReason) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function useStoryPlayer<TContext>({ stories, startPaused, autoAdvance, pauseWhenHidden, onEvent, }: UseStoryPlayerOptions<TContext>): StoryPlayer<TContext>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=useStoryPlayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStoryPlayer.d.ts","sourceRoot":"","sources":["../../src/story/useStoryPlayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOjD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErF,UAAU,qBAAqB,CAAC,QAAQ;IACtC,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,6FAA6F;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,WAAW,CAAC,QAAQ;IACnC,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;IAC7C,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACrC,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,EACvC,OAAO,EACP,WAAmB,EACnB,WAAkB,EAClB,eAAsB,EACtB,OAAO,GACR,EAAE,qBAAqB,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAgFzD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useReducer, useRef } from 'react';
|
|
2
|
+
import { createInitialPlayerState, isPlayerRunning, storyPlayerReducer, } from './storyPlayerReducer';
|
|
3
|
+
import { useStoryTimer } from './useStoryTimer';
|
|
4
|
+
export function useStoryPlayer({ stories, startPaused = false, autoAdvance = true, pauseWhenHidden = true, onEvent, }) {
|
|
5
|
+
const [state, dispatch] = useReducer(storyPlayerReducer, undefined, () => createInitialPlayerState(stories.length, startPaused ? ['external'] : []));
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
dispatch({ type: 'setCount', count: stories.length });
|
|
8
|
+
}, [stories.length]);
|
|
9
|
+
const onEventRef = useRef(onEvent);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
onEventRef.current = onEvent;
|
|
12
|
+
}, [onEvent]);
|
|
13
|
+
const index = Math.min(state.index, Math.max(stories.length - 1, 0));
|
|
14
|
+
const story = stories[index];
|
|
15
|
+
const isRunning = isPlayerRunning(state);
|
|
16
|
+
const pause = useCallback((reason) => dispatch({ type: 'pause', reason }), []);
|
|
17
|
+
const resume = useCallback((reason) => dispatch({ type: 'resume', reason }), []);
|
|
18
|
+
const controls = useMemo(() => ({
|
|
19
|
+
next: () => dispatch({ type: 'next' }),
|
|
20
|
+
prev: () => dispatch({ type: 'prev' }),
|
|
21
|
+
goTo: (target) => dispatch({ type: 'goTo', index: target }),
|
|
22
|
+
restart: () => {
|
|
23
|
+
dispatch({ type: 'restart' });
|
|
24
|
+
onEventRef.current?.({ type: 'replay' });
|
|
25
|
+
},
|
|
26
|
+
}), []);
|
|
27
|
+
const handleTimerComplete = useCallback(() => {
|
|
28
|
+
onEventRef.current?.({ type: 'story_complete', storyId: story.id, index });
|
|
29
|
+
if (autoAdvance)
|
|
30
|
+
dispatch({ type: 'timerComplete' });
|
|
31
|
+
}, [autoAdvance, story.id, index]);
|
|
32
|
+
const progress = useStoryTimer({
|
|
33
|
+
storyKey: index,
|
|
34
|
+
duration: story.duration,
|
|
35
|
+
isRunning,
|
|
36
|
+
onComplete: handleTimerComplete,
|
|
37
|
+
});
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
onEventRef.current?.({ type: 'story_view', storyId: story.id, index });
|
|
40
|
+
}, [story.id, index]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!pauseWhenHidden || typeof document === 'undefined')
|
|
43
|
+
return;
|
|
44
|
+
const sync = () => {
|
|
45
|
+
dispatch({ type: document.hidden ? 'pause' : 'resume', reason: 'hidden' });
|
|
46
|
+
};
|
|
47
|
+
sync();
|
|
48
|
+
document.addEventListener('visibilitychange', sync);
|
|
49
|
+
return () => document.removeEventListener('visibilitychange', sync);
|
|
50
|
+
}, [pauseWhenHidden]);
|
|
51
|
+
const isPausedBy = useCallback((reason) => state.pauseReasons.includes(reason), [state.pauseReasons]);
|
|
52
|
+
return {
|
|
53
|
+
story,
|
|
54
|
+
index,
|
|
55
|
+
count: stories.length,
|
|
56
|
+
isRunning,
|
|
57
|
+
isEnded: state.ended,
|
|
58
|
+
isPausedBy,
|
|
59
|
+
progress,
|
|
60
|
+
controls,
|
|
61
|
+
pause,
|
|
62
|
+
resume,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type MotionValue } from 'framer-motion';
|
|
2
|
+
interface UseStoryTimerOptions {
|
|
3
|
+
/** Changing the key restarts the timer from zero. */
|
|
4
|
+
storyKey: string | number;
|
|
5
|
+
/** Seconds. */
|
|
6
|
+
duration: number;
|
|
7
|
+
isRunning: boolean;
|
|
8
|
+
onComplete: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Drives a 0→1 progress value for the active story. Progress lives in a MotionValue,
|
|
12
|
+
* so the progress bar updates on the compositor without re-rendering React every frame.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useStoryTimer({ storyKey, duration, isRunning, onComplete, }: UseStoryTimerOptions): MotionValue<number>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=useStoryTimer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStoryTimer.d.ts","sourceRoot":"","sources":["../../src/story/useStoryTimer.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1E,UAAU,oBAAoB;IAC5B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,eAAe;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,GACX,EAAE,oBAAoB,GAAG,WAAW,CAAC,MAAM,CAAC,CAiC5C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { animate, useMotionValue } from 'framer-motion';
|
|
3
|
+
/**
|
|
4
|
+
* Drives a 0→1 progress value for the active story. Progress lives in a MotionValue,
|
|
5
|
+
* so the progress bar updates on the compositor without re-rendering React every frame.
|
|
6
|
+
*/
|
|
7
|
+
export function useStoryTimer({ storyKey, duration, isRunning, onComplete, }) {
|
|
8
|
+
const progress = useMotionValue(0);
|
|
9
|
+
const onCompleteRef = useRef(onComplete);
|
|
10
|
+
const keyRef = useRef(storyKey);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
onCompleteRef.current = onComplete;
|
|
13
|
+
}, [onComplete]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (keyRef.current !== storyKey) {
|
|
16
|
+
keyRef.current = storyKey;
|
|
17
|
+
progress.jump(0);
|
|
18
|
+
}
|
|
19
|
+
if (!isRunning)
|
|
20
|
+
return;
|
|
21
|
+
const start = progress.get();
|
|
22
|
+
if (start >= 1) {
|
|
23
|
+
onCompleteRef.current();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const controls = animate(progress, 1, {
|
|
27
|
+
duration: Math.max(duration, 0) * (1 - start),
|
|
28
|
+
ease: 'linear',
|
|
29
|
+
onComplete: () => onCompleteRef.current(),
|
|
30
|
+
});
|
|
31
|
+
return () => controls.stop();
|
|
32
|
+
}, [storyKey, duration, isRunning, progress]);
|
|
33
|
+
return progress;
|
|
34
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handshake with the headless video recorder: sets `window.__RECAP_READY__` once mounted
|
|
3
|
+
* and exposes `window.__RECAP_START__` for the recorder to begin playback after recording starts.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useVideoCaptureBridge(enabled: boolean, onStart: () => void): void;
|
|
6
|
+
//# sourceMappingURL=useVideoCaptureBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVideoCaptureBridge.d.ts","sourceRoot":"","sources":["../../src/story/useVideoCaptureBridge.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,QAkB1E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Handshake with the headless video recorder: sets `window.__RECAP_READY__` once mounted
|
|
4
|
+
* and exposes `window.__RECAP_START__` for the recorder to begin playback after recording starts.
|
|
5
|
+
*/
|
|
6
|
+
export function useVideoCaptureBridge(enabled, onStart) {
|
|
7
|
+
const onStartRef = useRef(onStart);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
onStartRef.current = onStart;
|
|
10
|
+
}, [onStart]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!enabled || typeof window === 'undefined')
|
|
13
|
+
return;
|
|
14
|
+
const captureWindow = window;
|
|
15
|
+
captureWindow.__RECAP_START__ = () => onStartRef.current();
|
|
16
|
+
captureWindow.__RECAP_READY__ = true;
|
|
17
|
+
return () => {
|
|
18
|
+
delete captureWindow.__RECAP_START__;
|
|
19
|
+
delete captureWindow.__RECAP_READY__;
|
|
20
|
+
};
|
|
21
|
+
}, [enabled]);
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import '@fontsource/aileron/400.css';
|
|
2
|
+
import '@fontsource/aileron/600.css';
|
|
3
|
+
import '@fontsource/aileron/700.css';
|
|
4
|
+
import '@fontsource/aileron/700-italic.css';
|
|
5
|
+
import '@fontsource/aileron/800.css';
|
|
6
|
+
import type { RecapData } from '../types';
|
|
7
|
+
import { type StoryEvent } from '../story';
|
|
8
|
+
import './Top10Story.css';
|
|
9
|
+
export interface RecapStory2026Props {
|
|
10
|
+
recapData: RecapData;
|
|
11
|
+
onStoryEvent?: (event: StoryEvent) => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* RecapStory2026 - The 2026 story: slides render on a fixed 375×770 design canvas
|
|
16
|
+
* scaled to the screen, so Figma positions carry over directly.
|
|
17
|
+
*/
|
|
18
|
+
declare function RecapStory2026({ recapData, onStoryEvent, onClose }: RecapStory2026Props): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default RecapStory2026;
|
|
20
|
+
//# sourceMappingURL=RecapStory2026.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecapStory2026.d.ts","sourceRoot":"","sources":["../../src/top10/RecapStory2026.tsx"],"names":[],"mappings":"AAEA,OAAO,6BAA6B,CAAC;AACrC,OAAO,6BAA6B,CAAC;AACrC,OAAO,6BAA6B,CAAC;AACrC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AAMlB,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,mBAAmB,2CAmGhF;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { AnimatePresence, MotionConfig, motion } from 'framer-motion';
|
|
4
|
+
import '@fontsource/aileron/400.css';
|
|
5
|
+
import '@fontsource/aileron/600.css';
|
|
6
|
+
import '@fontsource/aileron/700.css';
|
|
7
|
+
import '@fontsource/aileron/700-italic.css';
|
|
8
|
+
import '@fontsource/aileron/800.css';
|
|
9
|
+
import { slideCrossfade } from './motion';
|
|
10
|
+
import { usePreloadAssets, useStoryGestures, useStoryKeyboard, useStoryPlayer, useVideoCaptureBridge, } from '../story';
|
|
11
|
+
import { resolveRecapCategory } from '../categories';
|
|
12
|
+
import { buildStories, LIGHT_THEMES, THEME_STATUS_BAR_COLORS } from './registry';
|
|
13
|
+
import { useStatusBarColor } from '../hooks/useStatusBarColor';
|
|
14
|
+
import { CANVAS_HEIGHT, CanvasSqueezeContext, useCanvasScale } from './useCanvasScale';
|
|
15
|
+
import Top10Chrome from './Top10Chrome';
|
|
16
|
+
import './Top10Story.css';
|
|
17
|
+
/**
|
|
18
|
+
* RecapStory2026 - The 2026 story: slides render on a fixed 375×770 design canvas
|
|
19
|
+
* scaled to the screen, so Figma positions carry over directly.
|
|
20
|
+
*/
|
|
21
|
+
function RecapStory2026({ recapData, onStoryEvent, onClose }) {
|
|
22
|
+
const isVideo = recapData.isVideo === true;
|
|
23
|
+
const recorderControls = isVideo && recapData.manualVideoPlayback === true;
|
|
24
|
+
const year = recapData.year ?? 2026;
|
|
25
|
+
const stageRef = useRef(null);
|
|
26
|
+
const { scale, squeeze } = useCanvasScale(stageRef, isVideo);
|
|
27
|
+
const stories = useMemo(() => buildStories(recapData), [recapData]);
|
|
28
|
+
const player = useStoryPlayer({
|
|
29
|
+
stories,
|
|
30
|
+
startPaused: isVideo,
|
|
31
|
+
autoAdvance: !recorderControls,
|
|
32
|
+
pauseWhenHidden: !isVideo,
|
|
33
|
+
onEvent: onStoryEvent,
|
|
34
|
+
});
|
|
35
|
+
const { story, index, controls, pause, resume } = player;
|
|
36
|
+
const theme = story.theme ?? 'dark';
|
|
37
|
+
useStatusBarColor(THEME_STATUS_BAR_COLORS[theme] ?? THEME_STATUS_BAR_COLORS.dark);
|
|
38
|
+
useVideoCaptureBridge(isVideo, () => resume('external'));
|
|
39
|
+
usePreloadAssets(stories, index);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!recorderControls)
|
|
42
|
+
return;
|
|
43
|
+
const captureWindow = window;
|
|
44
|
+
captureWindow.__RECAP_VIDEO_PLAN__ = stories.map(({ id, duration }) => ({ id, duration }));
|
|
45
|
+
captureWindow.__RECAP_SHOW_SLIDE__ = controls.goTo;
|
|
46
|
+
return () => {
|
|
47
|
+
delete captureWindow.__RECAP_VIDEO_PLAN__;
|
|
48
|
+
delete captureWindow.__RECAP_SHOW_SLIDE__;
|
|
49
|
+
};
|
|
50
|
+
}, [recorderControls, stories, controls.goTo]);
|
|
51
|
+
const holdStart = useCallback(() => pause('hold'), [pause]);
|
|
52
|
+
const holdEnd = useCallback(() => resume('hold'), [resume]);
|
|
53
|
+
const gestures = useStoryGestures({
|
|
54
|
+
onPrev: controls.prev,
|
|
55
|
+
onNext: controls.next,
|
|
56
|
+
onHoldStart: holdStart,
|
|
57
|
+
onHoldEnd: holdEnd,
|
|
58
|
+
});
|
|
59
|
+
useStoryKeyboard({
|
|
60
|
+
enabled: !isVideo,
|
|
61
|
+
onPrev: controls.prev,
|
|
62
|
+
onNext: controls.next,
|
|
63
|
+
onTogglePause: () => (player.isPausedBy('user') ? resume('user') : pause('user')),
|
|
64
|
+
});
|
|
65
|
+
return (_jsx("div", { ref: stageRef, className: "s26-stage", "data-s26-theme": theme, "data-recap-slide-index": index, "data-recap-category": resolveRecapCategory(recapData.businessCategory), children: _jsxs("div", { className: "s26-canvas", style: { height: CANVAS_HEIGHT - squeeze, transform: `translateX(-50%) scale(${scale})` }, children: [_jsx(CanvasSqueezeContext.Provider, { value: squeeze, children: _jsx("div", { className: "s26-touch", ...gestures, children: _jsx(MotionConfig, { reducedMotion: "user", children: _jsx(AnimatePresence, { children: _jsx(motion.div, { className: "s26-slide", "data-s26-theme": theme, variants: slideCrossfade, initial: isVideo && (index === 0 || story.outro) ? false : "initial", animate: "animate", exit: isVideo && stories[index + 1]?.outro ? { opacity: 0, transition: { duration: 0 } } : "exit", children: story.render(recapData, controls) }, story.id) }) }) }) }), _jsx(Top10Chrome, { businessName: recapData.businessName, businessLogo: recapData.businessLogo, year: year, total: player.count, active: index, progress: player.progress, onBarClick: controls.goTo, onClose: onClose, darkIcons: LIGHT_THEMES.includes(theme) })] }) }));
|
|
66
|
+
}
|
|
67
|
+
export default RecapStory2026;
|