@tiledev/sdk-apptile-live-selling 0.16.0 → 0.16.1
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/attribution.d.ts +2 -16
- package/dist/attribution.d.ts.map +1 -1
- package/dist/attribution.js +4 -10
- package/dist/attribution.js.map +1 -1
- package/dist/auctions.d.ts.map +1 -1
- package/dist/auctions.js +11 -42
- package/dist/auctions.js.map +1 -1
- package/dist/cartAttributes.d.ts +0 -10
- package/dist/cartAttributes.d.ts.map +1 -1
- package/dist/cartAttributes.js +1 -20
- package/dist/cartAttributes.js.map +1 -1
- package/dist/client.d.ts +2 -51
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +23 -123
- package/dist/client.js.map +1 -1
- package/dist/clips.d.ts +1 -12
- package/dist/clips.d.ts.map +1 -1
- package/dist/clips.js +6 -114
- package/dist/clips.js.map +1 -1
- package/dist/commentLinks.d.ts +0 -29
- package/dist/commentLinks.d.ts.map +1 -1
- package/dist/commentLinks.js.map +1 -1
- package/dist/engine.native.d.ts.map +1 -1
- package/dist/engine.native.js +845 -17
- package/dist/engine.native.js.map +1 -1
- package/dist/index.d.ts +4 -48
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -240
- package/dist/index.js.map +1 -1
- package/dist/polls.d.ts.map +1 -1
- package/dist/polls.js +0 -3
- package/dist/polls.js.map +1 -1
- package/dist/react/LiveSellingProvider.d.ts +1 -54
- package/dist/react/LiveSellingProvider.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.js +3 -60
- package/dist/react/LiveSellingProvider.js.map +1 -1
- package/dist/react/LiveVideoTarget.d.ts.map +1 -1
- package/dist/react/LiveVideoTarget.js +3 -41
- package/dist/react/LiveVideoTarget.js.map +1 -1
- package/dist/react/index.d.ts +3 -30
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -79
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.web.d.ts +32 -36
- package/dist/react/index.web.d.ts.map +1 -1
- package/dist/react/index.web.js +122 -102
- package/dist/react/index.web.js.map +1 -1
- package/dist/react/useAuctionBidGate.d.ts +6 -62
- package/dist/react/useAuctionBidGate.d.ts.map +1 -1
- package/dist/react/useAuctionBidGate.js +27 -228
- package/dist/react/useAuctionBidGate.js.map +1 -1
- package/dist/react/useAuctionWins.d.ts +4 -14
- package/dist/react/useAuctionWins.d.ts.map +1 -1
- package/dist/react/useAuctionWins.js +5 -16
- package/dist/react/useAuctionWins.js.map +1 -1
- package/dist/react/useClips.d.ts +1 -7
- package/dist/react/useClips.d.ts.map +1 -1
- package/dist/react/useClips.js +7 -20
- package/dist/react/useClips.js.map +1 -1
- package/dist/react/useLiveSession.d.ts +3 -15
- package/dist/react/useLiveSession.d.ts.map +1 -1
- package/dist/react/useLiveSession.js +199 -612
- package/dist/react/useLiveSession.js.map +1 -1
- package/dist/react/useLiveStreams.d.ts.map +1 -1
- package/dist/react/useLiveStreams.js +2 -6
- package/dist/react/useLiveStreams.js.map +1 -1
- package/dist/react/useOngoingLive.d.ts +0 -1
- package/dist/react/useOngoingLive.d.ts.map +1 -1
- package/dist/react/useOngoingLive.js +1 -7
- package/dist/react/useOngoingLive.js.map +1 -1
- package/dist/react/useReplays.d.ts +0 -12
- package/dist/react/useReplays.d.ts.map +1 -1
- package/dist/react/useReplays.js +24 -56
- package/dist/react/useReplays.js.map +1 -1
- package/dist/react/useStreamInfo.d.ts +2 -13
- package/dist/react/useStreamInfo.d.ts.map +1 -1
- package/dist/react/useStreamInfo.js +8 -36
- package/dist/react/useStreamInfo.js.map +1 -1
- package/dist/replays.d.ts +0 -14
- package/dist/replays.d.ts.map +1 -1
- package/dist/replays.js +22 -68
- package/dist/replays.js.map +1 -1
- package/dist/session.d.ts +6 -39
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +22 -209
- package/dist/session.js.map +1 -1
- package/dist/sessionTypes.d.ts +18 -217
- package/dist/sessionTypes.d.ts.map +1 -1
- package/dist/sessionTypes.js +1 -2
- package/dist/sessionTypes.js.map +1 -1
- package/dist/streams.d.ts +1 -27
- package/dist/streams.d.ts.map +1 -1
- package/dist/streams.js +21 -84
- package/dist/streams.js.map +1 -1
- package/dist/types.d.ts +10 -288
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -2
- package/dist/types.js.map +1 -1
- package/dist/wire.d.ts +0 -31
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +0 -25
- package/dist/wire.js.map +1 -1
- package/dist/zego.d.ts +1 -3
- package/dist/zego.d.ts.map +1 -1
- package/dist/zego.js +1 -1
- package/package.json +1 -1
- package/dist/auctionComments.d.ts +0 -25
- package/dist/auctionComments.d.ts.map +0 -1
- package/dist/auctionComments.js +0 -28
- package/dist/auctionComments.js.map +0 -1
- package/dist/auctionRules.d.ts +0 -77
- package/dist/auctionRules.d.ts.map +0 -1
- package/dist/auctionRules.js +0 -107
- package/dist/auctionRules.js.map +0 -1
- package/dist/cartExtension.d.ts +0 -39
- package/dist/cartExtension.d.ts.map +0 -1
- package/dist/cartExtension.js +0 -51
- package/dist/cartExtension.js.map +0 -1
- package/dist/checkoutRefused.d.ts +0 -9
- package/dist/checkoutRefused.d.ts.map +0 -1
- package/dist/checkoutRefused.js +0 -16
- package/dist/checkoutRefused.js.map +0 -1
- package/dist/clipsPage.d.ts +0 -29
- package/dist/clipsPage.d.ts.map +0 -1
- package/dist/clipsPage.js +0 -49
- package/dist/clipsPage.js.map +0 -1
- package/dist/commentHistory.d.ts +0 -70
- package/dist/commentHistory.d.ts.map +0 -1
- package/dist/commentHistory.js +0 -133
- package/dist/commentHistory.js.map +0 -1
- package/dist/commentLinkCards.d.ts +0 -11
- package/dist/commentLinkCards.d.ts.map +0 -1
- package/dist/commentLinkCards.js +0 -70
- package/dist/commentLinkCards.js.map +0 -1
- package/dist/giveawayPrize.d.ts +0 -13
- package/dist/giveawayPrize.d.ts.map +0 -1
- package/dist/giveawayPrize.js +0 -18
- package/dist/giveawayPrize.js.map +0 -1
- package/dist/giveawayPrizeLines.d.ts +0 -120
- package/dist/giveawayPrizeLines.d.ts.map +0 -1
- package/dist/giveawayPrizeLines.js +0 -97
- package/dist/giveawayPrizeLines.js.map +0 -1
- package/dist/giveawayPrizes.d.ts +0 -20
- package/dist/giveawayPrizes.d.ts.map +0 -1
- package/dist/giveawayPrizes.js +0 -50
- package/dist/giveawayPrizes.js.map +0 -1
- package/dist/giveawayRoster.d.ts +0 -53
- package/dist/giveawayRoster.d.ts.map +0 -1
- package/dist/giveawayRoster.js +0 -93
- package/dist/giveawayRoster.js.map +0 -1
- package/dist/heldComments.d.ts +0 -40
- package/dist/heldComments.d.ts.map +0 -1
- package/dist/heldComments.js +0 -75
- package/dist/heldComments.js.map +0 -1
- package/dist/hiddenShows.d.ts +0 -44
- package/dist/hiddenShows.d.ts.map +0 -1
- package/dist/hiddenShows.js +0 -53
- package/dist/hiddenShows.js.map +0 -1
- package/dist/linkLots.d.ts +0 -64
- package/dist/linkLots.d.ts.map +0 -1
- package/dist/linkLots.js +0 -84
- package/dist/linkLots.js.map +0 -1
- package/dist/liveHaptics.d.ts +0 -7
- package/dist/liveHaptics.d.ts.map +0 -1
- package/dist/liveHaptics.js +0 -11
- package/dist/liveHaptics.js.map +0 -1
- package/dist/liveHaptics.native.d.ts +0 -7
- package/dist/liveHaptics.native.d.ts.map +0 -1
- package/dist/liveHaptics.native.js +0 -12
- package/dist/liveHaptics.native.js.map +0 -1
- package/dist/livePages.d.ts +0 -176
- package/dist/livePages.d.ts.map +0 -1
- package/dist/livePages.js +0 -216
- package/dist/livePages.js.map +0 -1
- package/dist/liveRoom.d.ts +0 -21
- package/dist/liveRoom.d.ts.map +0 -1
- package/dist/liveRoom.js +0 -28
- package/dist/liveRoom.js.map +0 -1
- package/dist/liveShow.d.ts +0 -65
- package/dist/liveShow.d.ts.map +0 -1
- package/dist/liveShow.js +0 -65
- package/dist/liveShow.js.map +0 -1
- package/dist/missedPolls.d.ts +0 -27
- package/dist/missedPolls.d.ts.map +0 -1
- package/dist/missedPolls.js +0 -16
- package/dist/missedPolls.js.map +0 -1
- package/dist/pageOptions.d.ts +0 -149
- package/dist/pageOptions.d.ts.map +0 -1
- package/dist/pageOptions.js +0 -123
- package/dist/pageOptions.js.map +0 -1
- package/dist/pageTypes.d.ts +0 -185
- package/dist/pageTypes.d.ts.map +0 -1
- package/dist/pageTypes.js +0 -3
- package/dist/pageTypes.js.map +0 -1
- package/dist/phoneTaps.d.ts +0 -25
- package/dist/phoneTaps.d.ts.map +0 -1
- package/dist/phoneTaps.js +0 -47
- package/dist/phoneTaps.js.map +0 -1
- package/dist/pipWindow.d.ts +0 -85
- package/dist/pipWindow.d.ts.map +0 -1
- package/dist/pipWindow.js +0 -88
- package/dist/pipWindow.js.map +0 -1
- package/dist/react/clocks.d.ts +0 -29
- package/dist/react/clocks.d.ts.map +0 -1
- package/dist/react/clocks.js +0 -124
- package/dist/react/clocks.js.map +0 -1
- package/dist/react/navigation.d.ts +0 -13
- package/dist/react/navigation.d.ts.map +0 -1
- package/dist/react/navigation.js +0 -7
- package/dist/react/navigation.js.map +0 -1
- package/dist/react/platformSession.d.ts +0 -16
- package/dist/react/platformSession.d.ts.map +0 -1
- package/dist/react/platformSession.js +0 -28
- package/dist/react/platformSession.js.map +0 -1
- package/dist/react/platformSession.web.d.ts +0 -35
- package/dist/react/platformSession.web.d.ts.map +0 -1
- package/dist/react/platformSession.web.js +0 -148
- package/dist/react/platformSession.web.js.map +0 -1
- package/dist/react/replayPlayer.d.ts +0 -83
- package/dist/react/replayPlayer.d.ts.map +0 -1
- package/dist/react/replayPlayer.js +0 -315
- package/dist/react/replayPlayer.js.map +0 -1
- package/dist/react/share.d.ts +0 -22
- package/dist/react/share.d.ts.map +0 -1
- package/dist/react/share.js +0 -45
- package/dist/react/share.js.map +0 -1
- package/dist/react/shopifyProviders.d.ts +0 -82
- package/dist/react/shopifyProviders.d.ts.map +0 -1
- package/dist/react/shopifyProviders.js +0 -113
- package/dist/react/shopifyProviders.js.map +0 -1
- package/dist/react/showPages.d.ts +0 -106
- package/dist/react/showPages.d.ts.map +0 -1
- package/dist/react/showPages.js +0 -166
- package/dist/react/showPages.js.map +0 -1
- package/dist/react/showPagesOnDevice.d.ts +0 -18
- package/dist/react/showPagesOnDevice.d.ts.map +0 -1
- package/dist/react/showPagesOnDevice.js +0 -31
- package/dist/react/showPagesOnDevice.js.map +0 -1
- package/dist/react/startSignIn.d.ts +0 -3
- package/dist/react/startSignIn.d.ts.map +0 -1
- package/dist/react/startSignIn.js +0 -19
- package/dist/react/startSignIn.js.map +0 -1
- package/dist/react/systemPictureInPicture.d.ts +0 -34
- package/dist/react/systemPictureInPicture.d.ts.map +0 -1
- package/dist/react/systemPictureInPicture.js +0 -93
- package/dist/react/systemPictureInPicture.js.map +0 -1
- package/dist/react/useAccountName.d.ts +0 -8
- package/dist/react/useAccountName.d.ts.map +0 -1
- package/dist/react/useAccountName.js +0 -49
- package/dist/react/useAccountName.js.map +0 -1
- package/dist/react/useClipsPage.d.ts +0 -47
- package/dist/react/useClipsPage.d.ts.map +0 -1
- package/dist/react/useClipsPage.js +0 -130
- package/dist/react/useClipsPage.js.map +0 -1
- package/dist/react/useCommentLinkCards.d.ts +0 -6
- package/dist/react/useCommentLinkCards.d.ts.map +0 -1
- package/dist/react/useCommentLinkCards.js +0 -67
- package/dist/react/useCommentLinkCards.js.map +0 -1
- package/dist/react/useFeaturedClip.d.ts +0 -15
- package/dist/react/useFeaturedClip.d.ts.map +0 -1
- package/dist/react/useFeaturedClip.js +0 -52
- package/dist/react/useFeaturedClip.js.map +0 -1
- package/dist/react/useGiveawayEntry.d.ts +0 -59
- package/dist/react/useGiveawayEntry.d.ts.map +0 -1
- package/dist/react/useGiveawayEntry.js +0 -170
- package/dist/react/useGiveawayEntry.js.map +0 -1
- package/dist/react/useGiveawayPrize.d.ts +0 -12
- package/dist/react/useGiveawayPrize.d.ts.map +0 -1
- package/dist/react/useGiveawayPrize.js +0 -53
- package/dist/react/useGiveawayPrize.js.map +0 -1
- package/dist/react/useGiveawayPrizes.d.ts +0 -4
- package/dist/react/useGiveawayPrizes.d.ts.map +0 -1
- package/dist/react/useGiveawayPrizes.js +0 -58
- package/dist/react/useGiveawayPrizes.js.map +0 -1
- package/dist/react/useHiddenShows.d.ts +0 -10
- package/dist/react/useHiddenShows.d.ts.map +0 -1
- package/dist/react/useHiddenShows.js +0 -30
- package/dist/react/useHiddenShows.js.map +0 -1
- package/dist/react/useKeepScreenAwake.d.ts +0 -2
- package/dist/react/useKeepScreenAwake.d.ts.map +0 -1
- package/dist/react/useKeepScreenAwake.js +0 -34
- package/dist/react/useKeepScreenAwake.js.map +0 -1
- package/dist/react/useLiveAuction.d.ts +0 -106
- package/dist/react/useLiveAuction.d.ts.map +0 -1
- package/dist/react/useLiveAuction.js +0 -255
- package/dist/react/useLiveAuction.js.map +0 -1
- package/dist/react/useLiveChat.d.ts +0 -110
- package/dist/react/useLiveChat.d.ts.map +0 -1
- package/dist/react/useLiveChat.js +0 -230
- package/dist/react/useLiveChat.js.map +0 -1
- package/dist/react/useLiveGiveawaysAndPolls.d.ts +0 -95
- package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +0 -1
- package/dist/react/useLiveGiveawaysAndPolls.js +0 -225
- package/dist/react/useLiveGiveawaysAndPolls.js.map +0 -1
- package/dist/react/useLivePage.d.ts +0 -136
- package/dist/react/useLivePage.d.ts.map +0 -1
- package/dist/react/useLivePage.js +0 -319
- package/dist/react/useLivePage.js.map +0 -1
- package/dist/react/useLiveShop.d.ts +0 -97
- package/dist/react/useLiveShop.d.ts.map +0 -1
- package/dist/react/useLiveShop.js +0 -197
- package/dist/react/useLiveShop.js.map +0 -1
- package/dist/react/useLiveShow.d.ts +0 -3
- package/dist/react/useLiveShow.d.ts.map +0 -1
- package/dist/react/useLiveShow.js +0 -21
- package/dist/react/useLiveShow.js.map +0 -1
- package/dist/react/useMySilentAuctionBids.d.ts +0 -29
- package/dist/react/useMySilentAuctionBids.d.ts.map +0 -1
- package/dist/react/useMySilentAuctionBids.js +0 -157
- package/dist/react/useMySilentAuctionBids.js.map +0 -1
- package/dist/react/useReplayPage.d.ts +0 -155
- package/dist/react/useReplayPage.d.ts.map +0 -1
- package/dist/react/useReplayPage.js +0 -580
- package/dist/react/useReplayPage.js.map +0 -1
- package/dist/react/useSilentAuctionLot.d.ts +0 -44
- package/dist/react/useSilentAuctionLot.d.ts.map +0 -1
- package/dist/react/useSilentAuctionLot.js +0 -168
- package/dist/react/useSilentAuctionLot.js.map +0 -1
- package/dist/react/useSilentAuctionLots.d.ts +0 -41
- package/dist/react/useSilentAuctionLots.d.ts.map +0 -1
- package/dist/react/useSilentAuctionLots.js +0 -64
- package/dist/react/useSilentAuctionLots.js.map +0 -1
- package/dist/react/useSilentAuctionRounds.d.ts +0 -15
- package/dist/react/useSilentAuctionRounds.d.ts.map +0 -1
- package/dist/react/useSilentAuctionRounds.js +0 -44
- package/dist/react/useSilentAuctionRounds.js.map +0 -1
- package/dist/replayPages.d.ts +0 -31
- package/dist/replayPages.d.ts.map +0 -1
- package/dist/replayPages.js +0 -34
- package/dist/replayPages.js.map +0 -1
- package/dist/shopifyCommerce.d.ts +0 -204
- package/dist/shopifyCommerce.d.ts.map +0 -1
- package/dist/shopifyCommerce.js +0 -217
- package/dist/shopifyCommerce.js.map +0 -1
- package/dist/shopifyIdentity.d.ts +0 -61
- package/dist/shopifyIdentity.d.ts.map +0 -1
- package/dist/shopifyIdentity.js +0 -61
- package/dist/shopifyIdentity.js.map +0 -1
- package/dist/shopifyIds.d.ts +0 -9
- package/dist/shopifyIds.d.ts.map +0 -1
- package/dist/shopifyIds.js +0 -18
- package/dist/shopifyIds.js.map +0 -1
- package/dist/showCredit.d.ts +0 -89
- package/dist/showCredit.d.ts.map +0 -1
- package/dist/showCredit.js +0 -120
- package/dist/showCredit.js.map +0 -1
- package/dist/showLinks.d.ts +0 -24
- package/dist/showLinks.d.ts.map +0 -1
- package/dist/showLinks.js +0 -23
- package/dist/showLinks.js.map +0 -1
- package/dist/showLots.d.ts +0 -44
- package/dist/showLots.d.ts.map +0 -1
- package/dist/showLots.js +0 -70
- package/dist/showLots.js.map +0 -1
- package/dist/showNames.d.ts +0 -77
- package/dist/showNames.d.ts.map +0 -1
- package/dist/showNames.js +0 -143
- package/dist/showNames.js.map +0 -1
- package/dist/showPages.d.ts +0 -56
- package/dist/showPages.d.ts.map +0 -1
- package/dist/showPages.js +0 -48
- package/dist/showPages.js.map +0 -1
- package/dist/silentAuctionFeed.d.ts +0 -49
- package/dist/silentAuctionFeed.d.ts.map +0 -1
- package/dist/silentAuctionFeed.js +0 -242
- package/dist/silentAuctionFeed.js.map +0 -1
- package/dist/silentAuctionRules.d.ts +0 -253
- package/dist/silentAuctionRules.d.ts.map +0 -1
- package/dist/silentAuctionRules.js +0 -489
- package/dist/silentAuctionRules.js.map +0 -1
- package/dist/silentAuctions.d.ts +0 -65
- package/dist/silentAuctions.d.ts.map +0 -1
- package/dist/silentAuctions.js +0 -272
- package/dist/silentAuctions.js.map +0 -1
- package/dist/storeData.d.ts +0 -16
- package/dist/storeData.d.ts.map +0 -1
- package/dist/storeData.js +0 -19
- package/dist/storeData.js.map +0 -1
- package/dist/ui/BubbleFrame.d.ts +0 -38
- package/dist/ui/BubbleFrame.d.ts.map +0 -1
- package/dist/ui/BubbleFrame.js +0 -181
- package/dist/ui/BubbleFrame.js.map +0 -1
- package/dist/ui/LiveBubble.d.ts +0 -43
- package/dist/ui/LiveBubble.d.ts.map +0 -1
- package/dist/ui/LiveBubble.js +0 -116
- package/dist/ui/LiveBubble.js.map +0 -1
- package/dist/ui/ReplayBubble.d.ts +0 -23
- package/dist/ui/ReplayBubble.d.ts.map +0 -1
- package/dist/ui/ReplayBubble.js +0 -71
- package/dist/ui/ReplayBubble.js.map +0 -1
- package/dist/ui.d.ts +0 -27
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js +0 -34
- package/dist/ui.js.map +0 -1
- package/dist/unreadRoomMessages.d.ts +0 -26
- package/dist/unreadRoomMessages.d.ts.map +0 -1
- package/dist/unreadRoomMessages.js +0 -62
- package/dist/unreadRoomMessages.js.map +0 -1
- package/dist/viewerRules.d.ts +0 -38
- package/dist/viewerRules.d.ts.map +0 -1
- package/dist/viewerRules.js +0 -46
- package/dist/viewerRules.js.map +0 -1
- package/dist/winsAttribution.d.ts +0 -22
- package/dist/winsAttribution.d.ts.map +0 -1
- package/dist/winsAttribution.js +0 -49
- package/dist/winsAttribution.js.map +0 -1
- package/dist/zegoEngine.d.ts +0 -173
- package/dist/zegoEngine.d.ts.map +0 -1
- package/dist/zegoEngine.js +0 -1069
- package/dist/zegoEngine.js.map +0 -1
package/dist/livePages.d.ts
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The rules behind the Live and Replay page models (0.14.0, moved from amore-v2's `useLivePage`,
|
|
3
|
-
* `useLiveChat` and `useReplayPage`): which navigation is a back press, when a sheet leaves the show
|
|
4
|
-
* playing, who the chat asks for a name, and what a recording shows at a point of its playhead.
|
|
5
|
-
*
|
|
6
|
-
* Pure, so it loads in plain Node for tests (sdk-shopify's `cartLineFacts` is a plain function). The
|
|
7
|
-
* hooks (`react/useLivePage.ts` and the rest) apply them.
|
|
8
|
-
*/
|
|
9
|
-
import { type Cart, type CartExtension } from '@tiledev/sdk-shopify';
|
|
10
|
-
import type { NameOnAccount, ReplayCommentItem } from './pageTypes';
|
|
11
|
-
import type { Replay, ReplayClip, ReplayComment, ReplaySegment } from './types';
|
|
12
|
-
/**
|
|
13
|
-
* The navigation actions that are a back press: the header's arrow and picture-in-picture button
|
|
14
|
-
* (`goBack`, or `popTo` the tabs when nothing is behind), Android's back (`GO_BACK`) and the iOS swipe
|
|
15
|
-
* (native-stack's `POP`). Leaving any of these ways shrinks a show on air into the bubble. Being
|
|
16
|
-
* replaced (a link's show has a recording) or navigated away from is not going back.
|
|
17
|
-
*/
|
|
18
|
-
export declare const BACK_ACTIONS: ReadonlySet<string>;
|
|
19
|
-
/** A navigator's state, as far as `isCoveredOnlyBySheet` reads it (React Navigation's has it). */
|
|
20
|
-
export interface StackStateForSheets {
|
|
21
|
-
index: number;
|
|
22
|
-
routes: readonly {
|
|
23
|
-
key: string;
|
|
24
|
-
name: string;
|
|
25
|
-
}[];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The screen (`screenKey`, its route key) is covered only by a page drawn as a sheet (`sheets`, the
|
|
29
|
-
* app's route names: the variant page, the Sign In page): the show plays on behind it, with the screen
|
|
30
|
-
* kept on, as if the screen were on show.
|
|
31
|
-
*/
|
|
32
|
-
export declare function isCoveredOnlyBySheet(state: StackStateForSheets | null | undefined, screenKey: string, sheets: readonly string[]): boolean;
|
|
33
|
-
/** Who the shopper is in the room, as far as the chat's name ask reads it. */
|
|
34
|
-
export interface ChatNameInput {
|
|
35
|
-
/** The room has a name for the shopper (`session.viewerName`). */
|
|
36
|
-
named: boolean;
|
|
37
|
-
/** sdk-shopify's `useCustomer().loggedIn`. */
|
|
38
|
-
loggedIn: boolean;
|
|
39
|
-
/** A stored sign-in is still being read on app open (`useCustomer().restoring`). */
|
|
40
|
-
restoring: boolean;
|
|
41
|
-
/** The signed-in shopper's account has been read (`useCustomer().customer`). */
|
|
42
|
-
hasCustomer: boolean;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* What the comment box does about the shopper's name: ask for one on the first Send (`askForName`,
|
|
46
|
-
* saved on this phone by the session's `chooseViewerName`), or wait while the account loads
|
|
47
|
-
* (`waitingForName`, Send held so nothing goes out as "Anonymous").
|
|
48
|
-
*
|
|
49
|
-
* Signed in, the account's name is the room's (`viewerNameFor`). Since sdk-apptile-live-selling 0.13.0
|
|
50
|
-
* an account with no name gives none (it was the email's part before the @), and nor does one with a
|
|
51
|
-
* name the show's team goes by: the room has no name, and the shopper is asked like a signed-out one
|
|
52
|
-
* once the account has loaded. amore-v2's chat waited for as long as a signed-in shopper had no name,
|
|
53
|
-
* which on 0.13.0 was for ever for such an account.
|
|
54
|
-
*/
|
|
55
|
-
export declare function chatNameAsk({ named, loggedIn, restoring, hasCustomer }: ChatNameInput): {
|
|
56
|
-
askForName: boolean;
|
|
57
|
-
waitingForName: boolean;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* A cart with no holds: one list, so the header isn't handed a new one on every draw. A plain array, as
|
|
61
|
-
* the header tile types it (`holdEndTimes?: number[]`); never change it.
|
|
62
|
-
*/
|
|
63
|
-
export declare const NO_HOLDS: number[];
|
|
64
|
-
/**
|
|
65
|
-
* When each of the cart's holds ends (0.15.0, amore-v2's ENG-691), for the Live header's timer under the
|
|
66
|
-
* cart button: each line's reservation as the Cart reads it (sdk-shopify's `cartLineFacts` over the
|
|
67
|
-
* provider's `cartExtensions`: Cart Hold's stamp). A giveaway prize and a service line have none, nor
|
|
68
|
-
* does a line Cart Hold never held. Every end, not only the soonest: the Live screen doesn't read the
|
|
69
|
-
* cart again when a hold runs out, so the soonest worked out here would stay on a hold that has ended;
|
|
70
|
-
* the header picks the soonest still running as it counts. `NO_HOLDS` when there are none.
|
|
71
|
-
*/
|
|
72
|
-
export declare function holdEndTimesOf(cart: Cart | null | undefined, extensions: readonly CartExtension[]): number[];
|
|
73
|
-
/** The signed-in shopper's account, as far as the name asks read it (sdk-shopify's `useCustomer()`). */
|
|
74
|
-
export interface AccountForNames {
|
|
75
|
-
loggedIn: boolean;
|
|
76
|
-
/** A stored sign-in is still being read on app open. */
|
|
77
|
-
restoring?: boolean;
|
|
78
|
-
customer: {
|
|
79
|
-
firstName?: string | null;
|
|
80
|
-
lastName?: string | null;
|
|
81
|
-
} | null | undefined;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Signed in, the account not read yet (a stored sign-in on app open, or a moment after signing in, with
|
|
85
|
-
* the session and no profile): what to ask isn't known, so Send and Enter wait.
|
|
86
|
-
*/
|
|
87
|
-
export declare function accountLoadingOf({ loggedIn, restoring, customer }: AccountForNames): boolean;
|
|
88
|
-
/**
|
|
89
|
-
* The name a signed-in shopper's account needs (0.15.0, amore-v2's ENG-686): read, and with no first
|
|
90
|
-
* name (blank, or only spaces) or with a name the show's team goes by. What it has, each part trimmed,
|
|
91
|
-
* for the ask to start from (a last name already there needn't be typed again). Null when it has a
|
|
92
|
-
* first name, while it loads, and when signed out (a guest's name stays on the phone).
|
|
93
|
-
*/
|
|
94
|
-
export declare function accountNameToComplete(account: AccountForNames, blockedNames: readonly string[]): NameOnAccount | null;
|
|
95
|
-
/**
|
|
96
|
-
* A typed name as it goes on the account: each part's spaces closed up and trimmed, and the whole name
|
|
97
|
-
* ("Jane Doe", or "Jane" with no last name). Null with no first name, or a name the show's team goes by:
|
|
98
|
-
* nothing is saved.
|
|
99
|
-
*/
|
|
100
|
-
export declare function tidyAccountName(typedFirstName: string, typedLastName: string, blockedNames: readonly string[]): {
|
|
101
|
-
firstName: string;
|
|
102
|
-
lastName: string;
|
|
103
|
-
fullName: string;
|
|
104
|
-
} | null;
|
|
105
|
-
/**
|
|
106
|
-
* What the comment box does about the shopper's name since 0.15.0 (amore-v2's ENG-686), beside
|
|
107
|
-
* `chatNameAsk`, 0.14.0's rule, which is unchanged:
|
|
108
|
-
*
|
|
109
|
-
* - **Ask** (`askForName`) a signed-in shopper whose account needs a name (`accountNameToComplete`):
|
|
110
|
-
* a first and a last name, saved to the account; and a signed-out shopper the room has no name for,
|
|
111
|
-
* saved on this phone.
|
|
112
|
-
* - **Wait** (`waitingForName`) while the account loads: Send is held, so nothing goes out as
|
|
113
|
-
* "Anonymous".
|
|
114
|
-
*/
|
|
115
|
-
export declare function accountNameAsk({ named, loggedIn, restoring, accountLoading, nameToComplete, }: {
|
|
116
|
-
/** The room has a name for the shopper (`session.viewerName`). */
|
|
117
|
-
named: boolean;
|
|
118
|
-
loggedIn: boolean;
|
|
119
|
-
restoring: boolean;
|
|
120
|
-
accountLoading: boolean;
|
|
121
|
-
nameToComplete: NameOnAccount | null;
|
|
122
|
-
}): {
|
|
123
|
-
askForName: boolean;
|
|
124
|
-
waitingForName: boolean;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* What a giveaway's "Entering As:" does about the shopper's name (entering needs a sign-in): ask a
|
|
128
|
-
* signed-in shopper whose account needs a name, or whom the room has no name for once their profile has
|
|
129
|
-
* arrived; wait while the account loads.
|
|
130
|
-
*/
|
|
131
|
-
export declare function giveawayNameAsk({ named, loggedIn, hasCustomer, accountLoading, nameToComplete, }: {
|
|
132
|
-
named: boolean;
|
|
133
|
-
loggedIn: boolean;
|
|
134
|
-
hasCustomer: boolean;
|
|
135
|
-
accountLoading: boolean;
|
|
136
|
-
nameToComplete: NameOnAccount | null;
|
|
137
|
-
}): {
|
|
138
|
-
askForName: boolean;
|
|
139
|
-
waitingForName: boolean;
|
|
140
|
-
};
|
|
141
|
-
/** A card passes the recording's feed id; a push passes its show's streaming id. Both find it. */
|
|
142
|
-
export declare function isTheShow(replay: Pick<Replay, 'id' | 'streamingId'>, id: string): boolean;
|
|
143
|
-
/**
|
|
144
|
-
* A clip's window on its recording, for Replay (0.16.0): where it starts (0 for none) and where it ends
|
|
145
|
-
* (null: the recording's end). An end at or before the start is no end.
|
|
146
|
-
*/
|
|
147
|
-
export declare function replayClipWindow(clip: Pick<ReplayClip, 'startMs' | 'endMs'>): {
|
|
148
|
-
startMs: number;
|
|
149
|
-
endMs: number | null;
|
|
150
|
-
};
|
|
151
|
-
/** The recording a clip plays on Replay (0.16.0), by its id (the clip's own when it names none); null with nothing to play. */
|
|
152
|
-
export declare function replayOfClip(clip: ReplayClip): Replay | null;
|
|
153
|
-
/** A time or length from the player, in seconds, as milliseconds; 0 when it has none yet. */
|
|
154
|
-
export declare function playerMs(seconds: number): number;
|
|
155
|
-
/**
|
|
156
|
-
* The product on screen at `atMs`: the one whose time window covers it (where windows overlap, the
|
|
157
|
-
* host went back to something, and the last one is what they were on); before the first window (a
|
|
158
|
-
* sale opens with a greeting), the first tagged product. Null with no products. Since 0.15.0 the items
|
|
159
|
-
* can be a recording's shop, links among the products (`windowKeyOf`).
|
|
160
|
-
*/
|
|
161
|
-
export declare function productOnScreen<Item extends {
|
|
162
|
-
id: string;
|
|
163
|
-
}>(segments: readonly ReplaySegment[], products: readonly Item[], atMs: number,
|
|
164
|
-
/** The key a window names an item by (0.15.0): a product's id, or a link lot's as a product GID. */
|
|
165
|
-
windowKeyOf?: (item: Item) => string): Item | null;
|
|
166
|
-
/** Where the host first showed a product, or null for one they never did (tagged, with no time window). */
|
|
167
|
-
export declare function firstShownAt(segments: readonly ReplaySegment[], productId: string): number | null;
|
|
168
|
-
/** Comments kept in the replay's chat pane: the newest of what has been said so far. */
|
|
169
|
-
export declare const REPLAY_COMMENTS_SHOWN = 60;
|
|
170
|
-
/**
|
|
171
|
-
* The recording's chat as it stood at `atMs`: what had been said by then, the newest `shown`, oldest
|
|
172
|
-
* first. The comments file writes the host's rows as "You" (true on the console that recorded them),
|
|
173
|
-
* so those read as the host's too.
|
|
174
|
-
*/
|
|
175
|
-
export declare function replayCommentsAt(comments: readonly ReplayComment[], atMs: number, shown?: number): ReplayCommentItem[];
|
|
176
|
-
//# sourceMappingURL=livePages.d.ts.map
|
package/dist/livePages.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"livePages.d.ts","sourceRoot":"","sources":["../src/livePages.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAiB,KAAK,IAAI,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIhF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAAuD,CAAC;AAErG,kGAAkG;AAClG,MAAM,WAAW,mB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_SHOWN = exports.NO_HOLDS = exports.BACK_ACTIONS = void 0;
|
|
4
|
-
exports.isCoveredOnlyBySheet = isCoveredOnlyBySheet;
|
|
5
|
-
exports.chatNameAsk = chatNameAsk;
|
|
6
|
-
exports.holdEndTimesOf = holdEndTimesOf;
|
|
7
|
-
exports.accountLoadingOf = accountLoadingOf;
|
|
8
|
-
exports.accountNameToComplete = accountNameToComplete;
|
|
9
|
-
exports.tidyAccountName = tidyAccountName;
|
|
10
|
-
exports.accountNameAsk = accountNameAsk;
|
|
11
|
-
exports.giveawayNameAsk = giveawayNameAsk;
|
|
12
|
-
exports.isTheShow = isTheShow;
|
|
13
|
-
exports.replayClipWindow = replayClipWindow;
|
|
14
|
-
exports.replayOfClip = replayOfClip;
|
|
15
|
-
exports.playerMs = playerMs;
|
|
16
|
-
exports.productOnScreen = productOnScreen;
|
|
17
|
-
exports.firstShownAt = firstShownAt;
|
|
18
|
-
exports.replayCommentsAt = replayCommentsAt;
|
|
19
|
-
/**
|
|
20
|
-
* The rules behind the Live and Replay page models (0.14.0, moved from amore-v2's `useLivePage`,
|
|
21
|
-
* `useLiveChat` and `useReplayPage`): which navigation is a back press, when a sheet leaves the show
|
|
22
|
-
* playing, who the chat asks for a name, and what a recording shows at a point of its playhead.
|
|
23
|
-
*
|
|
24
|
-
* Pure, so it loads in plain Node for tests (sdk-shopify's `cartLineFacts` is a plain function). The
|
|
25
|
-
* hooks (`react/useLivePage.ts` and the rest) apply them.
|
|
26
|
-
*/
|
|
27
|
-
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
28
|
-
const showNames_1 = require("./showNames");
|
|
29
|
-
// ─── The Live screen ──────────────────────────────────────────────────────────
|
|
30
|
-
/**
|
|
31
|
-
* The navigation actions that are a back press: the header's arrow and picture-in-picture button
|
|
32
|
-
* (`goBack`, or `popTo` the tabs when nothing is behind), Android's back (`GO_BACK`) and the iOS swipe
|
|
33
|
-
* (native-stack's `POP`). Leaving any of these ways shrinks a show on air into the bubble. Being
|
|
34
|
-
* replaced (a link's show has a recording) or navigated away from is not going back.
|
|
35
|
-
*/
|
|
36
|
-
exports.BACK_ACTIONS = new Set(['GO_BACK', 'POP', 'POP_TO', 'POP_TO_TOP']);
|
|
37
|
-
/**
|
|
38
|
-
* The screen (`screenKey`, its route key) is covered only by a page drawn as a sheet (`sheets`, the
|
|
39
|
-
* app's route names: the variant page, the Sign In page): the show plays on behind it, with the screen
|
|
40
|
-
* kept on, as if the screen were on show.
|
|
41
|
-
*/
|
|
42
|
-
function isCoveredOnlyBySheet(state, screenKey, sheets) {
|
|
43
|
-
if (!state)
|
|
44
|
-
return false;
|
|
45
|
-
const top = state.routes[state.index];
|
|
46
|
-
const below = state.routes[state.index - 1];
|
|
47
|
-
return !!top && sheets.includes(top.name) && (below === null || below === void 0 ? void 0 : below.key) === screenKey;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* What the comment box does about the shopper's name: ask for one on the first Send (`askForName`,
|
|
51
|
-
* saved on this phone by the session's `chooseViewerName`), or wait while the account loads
|
|
52
|
-
* (`waitingForName`, Send held so nothing goes out as "Anonymous").
|
|
53
|
-
*
|
|
54
|
-
* Signed in, the account's name is the room's (`viewerNameFor`). Since sdk-apptile-live-selling 0.13.0
|
|
55
|
-
* an account with no name gives none (it was the email's part before the @), and nor does one with a
|
|
56
|
-
* name the show's team goes by: the room has no name, and the shopper is asked like a signed-out one
|
|
57
|
-
* once the account has loaded. amore-v2's chat waited for as long as a signed-in shopper had no name,
|
|
58
|
-
* which on 0.13.0 was for ever for such an account.
|
|
59
|
-
*/
|
|
60
|
-
function chatNameAsk({ named, loggedIn, restoring, hasCustomer }) {
|
|
61
|
-
// On app open, or a moment after signing in (signed in, the account not read yet).
|
|
62
|
-
const accountLoading = restoring || (loggedIn && !hasCustomer);
|
|
63
|
-
return { askForName: !named && !accountLoading, waitingForName: !named && accountLoading };
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* A cart with no holds: one list, so the header isn't handed a new one on every draw. A plain array, as
|
|
67
|
-
* the header tile types it (`holdEndTimes?: number[]`); never change it.
|
|
68
|
-
*/
|
|
69
|
-
exports.NO_HOLDS = [];
|
|
70
|
-
/**
|
|
71
|
-
* When each of the cart's holds ends (0.15.0, amore-v2's ENG-691), for the Live header's timer under the
|
|
72
|
-
* cart button: each line's reservation as the Cart reads it (sdk-shopify's `cartLineFacts` over the
|
|
73
|
-
* provider's `cartExtensions`: Cart Hold's stamp). A giveaway prize and a service line have none, nor
|
|
74
|
-
* does a line Cart Hold never held. Every end, not only the soonest: the Live screen doesn't read the
|
|
75
|
-
* cart again when a hold runs out, so the soonest worked out here would stay on a hold that has ended;
|
|
76
|
-
* the header picks the soonest still running as it counts. `NO_HOLDS` when there are none.
|
|
77
|
-
*/
|
|
78
|
-
function holdEndTimesOf(cart, extensions) {
|
|
79
|
-
if (!cart)
|
|
80
|
-
return exports.NO_HOLDS;
|
|
81
|
-
const ends = cart.lines
|
|
82
|
-
.map((line) => (0, sdk_shopify_1.cartLineFacts)(line, cart, extensions).holdExpiresAt)
|
|
83
|
-
.filter((end) => end !== null && end !== undefined);
|
|
84
|
-
return ends.length > 0 ? ends : exports.NO_HOLDS;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Signed in, the account not read yet (a stored sign-in on app open, or a moment after signing in, with
|
|
88
|
-
* the session and no profile): what to ask isn't known, so Send and Enter wait.
|
|
89
|
-
*/
|
|
90
|
-
function accountLoadingOf({ loggedIn, restoring, customer }) {
|
|
91
|
-
return !!restoring || (!!loggedIn && !customer);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* The name a signed-in shopper's account needs (0.15.0, amore-v2's ENG-686): read, and with no first
|
|
95
|
-
* name (blank, or only spaces) or with a name the show's team goes by. What it has, each part trimmed,
|
|
96
|
-
* for the ask to start from (a last name already there needn't be typed again). Null when it has a
|
|
97
|
-
* first name, while it loads, and when signed out (a guest's name stays on the phone).
|
|
98
|
-
*/
|
|
99
|
-
function accountNameToComplete(account, blockedNames) {
|
|
100
|
-
var _a, _b, _c, _d, _e, _f;
|
|
101
|
-
if (!account.loggedIn || accountLoadingOf(account))
|
|
102
|
-
return null;
|
|
103
|
-
const firstName = (_c = (_b = (_a = account.customer) === null || _a === void 0 ? void 0 : _a.firstName) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '';
|
|
104
|
-
const lastName = (_f = (_e = (_d = account.customer) === null || _d === void 0 ? void 0 : _d.lastName) === null || _e === void 0 ? void 0 : _e.trim()) !== null && _f !== void 0 ? _f : '';
|
|
105
|
-
const needsAName = !firstName || (0, showNames_1.isBlockedViewerName)(`${firstName} ${lastName}`, blockedNames);
|
|
106
|
-
return needsAName ? { firstName, lastName } : null;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* A typed name as it goes on the account: each part's spaces closed up and trimmed, and the whole name
|
|
110
|
-
* ("Jane Doe", or "Jane" with no last name). Null with no first name, or a name the show's team goes by:
|
|
111
|
-
* nothing is saved.
|
|
112
|
-
*/
|
|
113
|
-
function tidyAccountName(typedFirstName, typedLastName, blockedNames) {
|
|
114
|
-
const firstName = typedFirstName.replace(/\s+/g, ' ').trim();
|
|
115
|
-
const lastName = typedLastName.replace(/\s+/g, ' ').trim();
|
|
116
|
-
const fullName = lastName ? `${firstName} ${lastName}` : firstName;
|
|
117
|
-
if (!firstName || (0, showNames_1.isBlockedViewerName)(fullName, blockedNames))
|
|
118
|
-
return null;
|
|
119
|
-
return { firstName, lastName, fullName };
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* What the comment box does about the shopper's name since 0.15.0 (amore-v2's ENG-686), beside
|
|
123
|
-
* `chatNameAsk`, 0.14.0's rule, which is unchanged:
|
|
124
|
-
*
|
|
125
|
-
* - **Ask** (`askForName`) a signed-in shopper whose account needs a name (`accountNameToComplete`):
|
|
126
|
-
* a first and a last name, saved to the account; and a signed-out shopper the room has no name for,
|
|
127
|
-
* saved on this phone.
|
|
128
|
-
* - **Wait** (`waitingForName`) while the account loads: Send is held, so nothing goes out as
|
|
129
|
-
* "Anonymous".
|
|
130
|
-
*/
|
|
131
|
-
function accountNameAsk({ named, loggedIn, restoring, accountLoading, nameToComplete, }) {
|
|
132
|
-
const signedIn = loggedIn || restoring;
|
|
133
|
-
return { askForName: !!nameToComplete || (!named && !signedIn), waitingForName: accountLoading };
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* What a giveaway's "Entering As:" does about the shopper's name (entering needs a sign-in): ask a
|
|
137
|
-
* signed-in shopper whose account needs a name, or whom the room has no name for once their profile has
|
|
138
|
-
* arrived; wait while the account loads.
|
|
139
|
-
*/
|
|
140
|
-
function giveawayNameAsk({ named, loggedIn, hasCustomer, accountLoading, nameToComplete, }) {
|
|
141
|
-
return { askForName: !!nameToComplete || (loggedIn && !named && hasCustomer), waitingForName: accountLoading };
|
|
142
|
-
}
|
|
143
|
-
// ─── The Replay screen ────────────────────────────────────────────────────────
|
|
144
|
-
/** A card passes the recording's feed id; a push passes its show's streaming id. Both find it. */
|
|
145
|
-
function isTheShow(replay, id) {
|
|
146
|
-
return replay.id === id || replay.streamingId === id;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* A clip's window on its recording, for Replay (0.16.0): where it starts (0 for none) and where it ends
|
|
150
|
-
* (null: the recording's end). An end at or before the start is no end.
|
|
151
|
-
*/
|
|
152
|
-
function replayClipWindow(clip) {
|
|
153
|
-
const startMs = typeof clip.startMs === 'number' && clip.startMs > 0 ? clip.startMs : 0;
|
|
154
|
-
const endMs = typeof clip.endMs === 'number' && clip.endMs > startMs ? clip.endMs : null;
|
|
155
|
-
return { startMs, endMs };
|
|
156
|
-
}
|
|
157
|
-
/** The recording a clip plays on Replay (0.16.0), by its id (the clip's own when it names none); null with nothing to play. */
|
|
158
|
-
function replayOfClip(clip) {
|
|
159
|
-
var _a, _b, _c;
|
|
160
|
-
const videoUrl = (_a = clip.videoUrl) === null || _a === void 0 ? void 0 : _a.trim();
|
|
161
|
-
if (!videoUrl)
|
|
162
|
-
return null;
|
|
163
|
-
return {
|
|
164
|
-
id: clip.recordingId || clip.id,
|
|
165
|
-
streamingId: (_b = clip.streamingId) !== null && _b !== void 0 ? _b : '',
|
|
166
|
-
title: clip.title,
|
|
167
|
-
videoUrl,
|
|
168
|
-
thumbnailUrl: clip.posterUrl,
|
|
169
|
-
coverUrl: null,
|
|
170
|
-
productIds: (_c = clip.productIds) !== null && _c !== void 0 ? _c : [],
|
|
171
|
-
viewCount: 0,
|
|
172
|
-
publishedAt: null,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
/** A time or length from the player, in seconds, as milliseconds; 0 when it has none yet. */
|
|
176
|
-
function playerMs(seconds) {
|
|
177
|
-
return Number.isFinite(seconds) && seconds > 0 ? seconds * 1000 : 0;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* The product on screen at `atMs`: the one whose time window covers it (where windows overlap, the
|
|
181
|
-
* host went back to something, and the last one is what they were on); before the first window (a
|
|
182
|
-
* sale opens with a greeting), the first tagged product. Null with no products. Since 0.15.0 the items
|
|
183
|
-
* can be a recording's shop, links among the products (`windowKeyOf`).
|
|
184
|
-
*/
|
|
185
|
-
function productOnScreen(segments, products, atMs,
|
|
186
|
-
/** The key a window names an item by (0.15.0): a product's id, or a link lot's as a product GID. */
|
|
187
|
-
windowKeyOf = (item) => item.id) {
|
|
188
|
-
var _a, _b;
|
|
189
|
-
const covering = segments.filter((segment) => atMs >= segment.startMs && atMs <= segment.endMs);
|
|
190
|
-
const productId = covering.length ? covering[covering.length - 1].productGid : null;
|
|
191
|
-
return (_b = (_a = (productId ? products.find((product) => windowKeyOf(product) === productId) : undefined)) !== null && _a !== void 0 ? _a : products[0]) !== null && _b !== void 0 ? _b : null;
|
|
192
|
-
}
|
|
193
|
-
/** Where the host first showed a product, or null for one they never did (tagged, with no time window). */
|
|
194
|
-
function firstShownAt(segments, productId) {
|
|
195
|
-
var _a, _b;
|
|
196
|
-
return (_b = (_a = segments.find((segment) => segment.productGid === productId)) === null || _a === void 0 ? void 0 : _a.startMs) !== null && _b !== void 0 ? _b : null;
|
|
197
|
-
}
|
|
198
|
-
/** Comments kept in the replay's chat pane: the newest of what has been said so far. */
|
|
199
|
-
exports.REPLAY_COMMENTS_SHOWN = 60;
|
|
200
|
-
/**
|
|
201
|
-
* The recording's chat as it stood at `atMs`: what had been said by then, the newest `shown`, oldest
|
|
202
|
-
* first. The comments file writes the host's rows as "You" (true on the console that recorded them),
|
|
203
|
-
* so those read as the host's too.
|
|
204
|
-
*/
|
|
205
|
-
function replayCommentsAt(comments, atMs, shown = exports.REPLAY_COMMENTS_SHOWN) {
|
|
206
|
-
let said = 0;
|
|
207
|
-
while (said < comments.length && comments[said].atMs <= atMs)
|
|
208
|
-
said += 1;
|
|
209
|
-
return comments.slice(Math.max(0, said - shown), said).map(({ comment }) => ({
|
|
210
|
-
id: comment.id,
|
|
211
|
-
author: comment.userName,
|
|
212
|
-
text: comment.text,
|
|
213
|
-
fromHost: comment.source === 'HOST' || comment.userName === 'You',
|
|
214
|
-
}));
|
|
215
|
-
}
|
|
216
|
-
//# sourceMappingURL=livePages.js.map
|
package/dist/livePages.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"livePages.js","sourceRoot":"","sources":["../src/livePages.ts"],"names":[],"mappings":";;;AAmCA,oDASC;AAyBD,kCAOC;AAgBD,wCAMC;AAgBD,4CAEC;AAQD,sDAMC;AAOD,0CAUC;AAYD,wCAgBC;AAOD,0CAcC;AAKD,8BAEC;AAMD,4CAIC;AAGD,oCAcC;AAGD,4BAEC;AAQD,0CAUC;AAGD,oCAEC;AAUD,4CAaC;AAzRD;;;;;;;GAOG;AACH,sDAAoF;AAGpF,2CAAkD;AAGlD,iFAAiF;AAEjF;;;;;GAKG;AACU,QAAA,YAAY,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,Q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C,IAAI;QAClB,QAAQ,EAAE,OAAO,CAAC,MAAM,KAAK,MAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK;KAClE,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/dist/liveRoom.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An add to tell the live show's room about once it lands: the variant page's and quick add's
|
|
3
|
-
* `announceToLiveRoom`, set only by the Live screen (`useLiveShop`). `lotNumber` is the lot's number
|
|
4
|
-
* (the session's `sellId`), or null when the gateway hasn't issued one.
|
|
5
|
-
*/
|
|
6
|
-
export interface LiveRoomAnnouncement {
|
|
7
|
-
lotNumber: string | null;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Tells the room of the live show this phone is watching that the shopper put a product in their cart:
|
|
11
|
-
* every phone in the room shows it as a cart chip ("Sold 104", or "Jane added …"), this one included,
|
|
12
|
-
* as the room sends it back. **Only after the add landed** (Freckled Poppy's rule): a refused add must
|
|
13
|
-
* not be announced, as the room reads the chip as "it is going".
|
|
14
|
-
*
|
|
15
|
-
* The engine's own call (`sendCartAnnouncement`, which the session's `actions.announceAddToCart`
|
|
16
|
-
* wraps). The phone is in one room at a time, the one the Live screen holds (`holdStream`) while the
|
|
17
|
-
* variant page is over it; with no room (the show ended meanwhile) nothing is sent. A send that fails
|
|
18
|
-
* goes to the provider's `onWarning`. Never throws.
|
|
19
|
-
*/
|
|
20
|
-
export declare function announceAddToLiveRoom(productTitle: string, { lotNumber }: LiveRoomAnnouncement): void;
|
|
21
|
-
//# sourceMappingURL=liveRoom.d.ts.map
|
package/dist/liveRoom.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"liveRoom.d.ts","sourceRoot":"","sources":["../src/liveRoom.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,oBAAoB,GAAG,IAAI,CAIrG"}
|
package/dist/liveRoom.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.announceAddToLiveRoom = announceAddToLiveRoom;
|
|
4
|
-
/**
|
|
5
|
-
* Telling the live show's room about an add (0.14.0, moved from amore-v2's `src/core/services/liveRoom.ts`).
|
|
6
|
-
*
|
|
7
|
-
* Free of React, so the variant page and quick add can announce without reading the session, which they
|
|
8
|
-
* need for nothing else. `engine` is the native one on a phone and the no-op everywhere else.
|
|
9
|
-
*/
|
|
10
|
-
const engine_1 = require("./engine");
|
|
11
|
-
const pageOptions_1 = require("./pageOptions");
|
|
12
|
-
/**
|
|
13
|
-
* Tells the room of the live show this phone is watching that the shopper put a product in their cart:
|
|
14
|
-
* every phone in the room shows it as a cart chip ("Sold 104", or "Jane added …"), this one included,
|
|
15
|
-
* as the room sends it back. **Only after the add landed** (Freckled Poppy's rule): a refused add must
|
|
16
|
-
* not be announced, as the room reads the chip as "it is going".
|
|
17
|
-
*
|
|
18
|
-
* The engine's own call (`sendCartAnnouncement`, which the session's `actions.announceAddToCart`
|
|
19
|
-
* wraps). The phone is in one room at a time, the one the Live screen holds (`holdStream`) while the
|
|
20
|
-
* variant page is over it; with no room (the show ended meanwhile) nothing is sent. A send that fails
|
|
21
|
-
* goes to the provider's `onWarning`. Never throws.
|
|
22
|
-
*/
|
|
23
|
-
function announceAddToLiveRoom(productTitle, { lotNumber }) {
|
|
24
|
-
void engine_1.engine.sendCartAnnouncement(productTitle, lotNumber).catch((error) => {
|
|
25
|
-
(0, pageOptions_1.reportLiveWarning)(error, { at: 'announceAddToLiveRoom', productTitle, lotNumber });
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=liveRoom.js.map
|
package/dist/liveRoom.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"liveRoom.js","sourceRoot":"","sources":["../src/liveRoom.ts"],"names":[],"mappings":";;AA6BA,sDAIC;AAjCD;;;;;GAKG;AACH,qCAAkC;AAClC,+CAAkD;AAWlD;;;;;;;;;;GAUG;AACH,SAAgB,qBAAqB,CAAC,YAAoB,EAAE,EAAE,SAAS,EAAwB;IAC7F,KAAK,eAAM,CAAC,oBAAoB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACjF,IAAA,+BAAiB,EAAC,KAAK,EAAE,EAAE,EAAE,EAAE,uBAAuB,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/liveShow.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { LivePipMode, LiveSessionCapabilities, LiveSessionStatus } from './sessionTypes';
|
|
2
|
-
import type { LiveStream } from './types';
|
|
3
|
-
/** Where a show stands for its screen: the session's status, with `loading` read as joining. */
|
|
4
|
-
export type LiveShowStatus = Exclude<LiveSessionStatus, 'loading'>;
|
|
5
|
-
export interface LiveShow {
|
|
6
|
-
/**
|
|
7
|
-
* The session's record once it is this show's; null before then (the session may still hold the last
|
|
8
|
-
* show's), and for a show hidden from this viewer (`hiddenShows`), whose record the session never holds.
|
|
9
|
-
*/
|
|
10
|
-
show: LiveStream | null;
|
|
11
|
-
/**
|
|
12
|
-
* `connecting` until the session holds this show's record (or while it is loading it), then the
|
|
13
|
-
* session's own status. `ended` at once when the session has settled on nothing at all.
|
|
14
|
-
*/
|
|
15
|
-
status: LiveShowStatus;
|
|
16
|
-
/** Playing, or waiting for its host (camera off): what the room's controls show for. */
|
|
17
|
-
onAir: boolean;
|
|
18
|
-
/** The controls this show calls for (`capabilitiesFor(show)`): an auction can bid. */
|
|
19
|
-
capabilities: LiveSessionCapabilities;
|
|
20
|
-
}
|
|
21
|
-
/** What `liveShowFor` reads of the session. */
|
|
22
|
-
export interface SessionForShow {
|
|
23
|
-
stream: LiveStream | null;
|
|
24
|
-
status: LiveSessionStatus;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The show `streamingId` names, as the session holds it. With no id (an empty one included), whatever
|
|
28
|
-
* show the session holds.
|
|
29
|
-
*/
|
|
30
|
-
export declare function liveShowFor(session: SessionForShow, streamingId: string | null | undefined): LiveShow;
|
|
31
|
-
/** What `canPlayInCard` reads of the session. */
|
|
32
|
-
export interface SessionForCard {
|
|
33
|
-
stream: {
|
|
34
|
-
streamingId: string;
|
|
35
|
-
} | null;
|
|
36
|
-
status: LiveSessionStatus;
|
|
37
|
-
pipMode: LivePipMode;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Whether a card showing a show on air (a muted preview, on a home rail or a list of shows) may take
|
|
41
|
-
* the room's picture now (`LiveVideoTarget`'s `active`). All of:
|
|
42
|
-
*
|
|
43
|
-
* - the session is in that show's room, and playing;
|
|
44
|
-
* - no bubble or system window has the picture (`pipMode` is `'none'`);
|
|
45
|
-
* - the card's screen is on show (`screenOnShow`: `useIsFocused()`), so of several cards only the
|
|
46
|
-
* focused screen's claims, and none while another screen is over them.
|
|
47
|
-
*
|
|
48
|
-
* Only one mounted target should claim the picture at a time; this is a card's share of that rule.
|
|
49
|
-
* A show hidden from this viewer never plays: the session never joins its room.
|
|
50
|
-
*/
|
|
51
|
-
export declare function canPlayInCard({ session, show, screenOnShow, }: {
|
|
52
|
-
session: SessionForCard;
|
|
53
|
-
show: {
|
|
54
|
-
streamingId: string;
|
|
55
|
-
} | null | undefined;
|
|
56
|
-
screenOnShow: boolean;
|
|
57
|
-
}): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* The host's camera is off, or their picture has stalled (`waitingForHost`): the room's video draws
|
|
60
|
-
* black. The floating bubble and Android's picture-in-picture window cover it with the show's poster and
|
|
61
|
-
* "Waiting for the host" while this holds (0.16.0, ENG-969: both were black). The Live screen says the
|
|
62
|
-
* same over its own player.
|
|
63
|
-
*/
|
|
64
|
-
export declare function hostIsAway(status: LiveSessionStatus): boolean;
|
|
65
|
-
//# sourceMappingURL=liveShow.d.ts.map
|
package/dist/liveShow.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"liveShow.d.ts","sourceRoot":"","sources":["../src/liveShow.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,gGAAgG;AAChG,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;AAEnE,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB;;;OAGG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB,wFAAwF;IACxF,KAAK,EAAE,OAAO,CAAC;IACf,sFAAsF;IACtF,YAAY,EAAE,uBAAuB,CAAC;CACvC;AAED,+CAA+C;AAC/C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAarG;AAED,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACvC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,IAAI,EACJ,YAAY,GACb,EAAE;IACD,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,YAAY,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAGV;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAE7D"}
|
package/dist/liveShow.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.liveShowFor = liveShowFor;
|
|
4
|
-
exports.canPlayInCard = canPlayInCard;
|
|
5
|
-
exports.hostIsAway = hostIsAway;
|
|
6
|
-
/**
|
|
7
|
-
* The show a screen is about, read off the app's one session (0.9.0).
|
|
8
|
-
*
|
|
9
|
-
* The session is app-wide and follows one show at a time. A screen opened for a named show (a push,
|
|
10
|
-
* a link, a tap on a card) pins it with `holdStream(streamingId)`, and for a moment after that the
|
|
11
|
-
* session can still hold the LAST show's record: every screen of a show has to ask "is the session's
|
|
12
|
-
* record mine yet?" before it draws anything from it. amore-v2 asked it in four hooks and Freckled
|
|
13
|
-
* Poppy in its Live screen; `liveShowFor` is that question, answered once.
|
|
14
|
-
*
|
|
15
|
-
* Pure, so it loads in plain Node for tests and in an app's own test runner. `useLiveShow` is the hook.
|
|
16
|
-
*/
|
|
17
|
-
const sessionTypes_1 = require("./sessionTypes");
|
|
18
|
-
/**
|
|
19
|
-
* The show `streamingId` names, as the session holds it. With no id (an empty one included), whatever
|
|
20
|
-
* show the session holds.
|
|
21
|
-
*/
|
|
22
|
-
function liveShowFor(session, streamingId) {
|
|
23
|
-
const held = session.stream;
|
|
24
|
-
const show = held && (!streamingId || held.streamingId === streamingId) ? held : null;
|
|
25
|
-
let status;
|
|
26
|
-
// Not this show's record yet: joining, unless there is no record at all and the session has settled on "ended".
|
|
27
|
-
if (!show)
|
|
28
|
-
status = !held && session.status === 'ended' ? 'ended' : 'connecting';
|
|
29
|
-
else
|
|
30
|
-
status = session.status === 'loading' ? 'connecting' : session.status;
|
|
31
|
-
return {
|
|
32
|
-
show,
|
|
33
|
-
status,
|
|
34
|
-
onAir: status === 'playing' || status === 'waitingForHost',
|
|
35
|
-
capabilities: (0, sessionTypes_1.capabilitiesFor)(show),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Whether a card showing a show on air (a muted preview, on a home rail or a list of shows) may take
|
|
40
|
-
* the room's picture now (`LiveVideoTarget`'s `active`). All of:
|
|
41
|
-
*
|
|
42
|
-
* - the session is in that show's room, and playing;
|
|
43
|
-
* - no bubble or system window has the picture (`pipMode` is `'none'`);
|
|
44
|
-
* - the card's screen is on show (`screenOnShow`: `useIsFocused()`), so of several cards only the
|
|
45
|
-
* focused screen's claims, and none while another screen is over them.
|
|
46
|
-
*
|
|
47
|
-
* Only one mounted target should claim the picture at a time; this is a card's share of that rule.
|
|
48
|
-
* A show hidden from this viewer never plays: the session never joins its room.
|
|
49
|
-
*/
|
|
50
|
-
function canPlayInCard({ session, show, screenOnShow, }) {
|
|
51
|
-
var _a;
|
|
52
|
-
if (!show || !screenOnShow)
|
|
53
|
-
return false;
|
|
54
|
-
return ((_a = session.stream) === null || _a === void 0 ? void 0 : _a.streamingId) === show.streamingId && session.pipMode === 'none' && session.status === 'playing';
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* The host's camera is off, or their picture has stalled (`waitingForHost`): the room's video draws
|
|
58
|
-
* black. The floating bubble and Android's picture-in-picture window cover it with the show's poster and
|
|
59
|
-
* "Waiting for the host" while this holds (0.16.0, ENG-969: both were black). The Live screen says the
|
|
60
|
-
* same over its own player.
|
|
61
|
-
*/
|
|
62
|
-
function hostIsAway(status) {
|
|
63
|
-
return status === 'waitingForHost';
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=liveShow.js.map
|
package/dist/liveShow.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"liveShow.js","sourceRoot":"","sources":["../src/liveShow.ts"],"names":[],"mappings":";;AA6CA,kCAaC;AAqBD,sCAWC;AAQD,gCAEC;AApGD;;;;;;;;;;GAUG;AACH,iDAAiD;AA8BjD;;;GAGG;AACH,SAAgB,WAAW,CAAC,OAAuB,EAAE,WAAsC;IACzF,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAC5B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACtF,IAAI,MAAsB,CAAC;IAC3B,gHAAgH;IAChH,IAAI,CAAC,IAAI;QAAE,MAAM,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;;QAC5E,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC3E,OAAO;QACL,IAAI;QACJ,MAAM;QACN,KAAK,EAAE,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,gBAAgB;QAC1D,YAAY,EAAE,IAAA,8BAAe,EAAC,IAAI,CAAC;KACpC,CAAC;AACJ,CAAC;AASD;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,IAAI,EACJ,YAAY,GAKb;;IACC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,CAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,WAAW,MAAK,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC;AACxH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,MAAyB;IAClD,OAAO,MAAM,KAAK,gBAAgB,CAAC;AACrC,CAAC"}
|
package/dist/missedPolls.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A poll the room never told this phone about (0.16.0, ENG-969, 2026-10-26).
|
|
3
|
-
*
|
|
4
|
-
* A poll opened while a shopper watched showed only after they left the show and came back: the app
|
|
5
|
-
* raised it only from a forced read of the show's record (`pollSynced`, DEL-2769), which a screen's
|
|
6
|
-
* focus starts. The room's `START_POLL` never reached the session, for a reason not yet proven (its
|
|
7
|
-
* handling in `zegoEngine.ts` hasn't changed since 0.9.2; `unreadRoomMessages.ts` reports what the room
|
|
8
|
-
* sends that this version doesn't read, to find out). Until then the session reads the record every
|
|
9
|
-
* `MISSED_POLL_READ_MS` while a show is on air with no poll up, so a poll opened meanwhile shows within
|
|
10
|
-
* that time.
|
|
11
|
-
*
|
|
12
|
-
* Pure, so it loads in plain Node for tests.
|
|
13
|
-
*/
|
|
14
|
-
import type { LiveSessionStatus } from './sessionTypes';
|
|
15
|
-
/** How often the session reads the show's record for a poll it may have missed: 20 s. */
|
|
16
|
-
export declare const MISSED_POLL_READ_MS = 20000;
|
|
17
|
-
/**
|
|
18
|
-
* Whether the session reads the record for a missed poll: a show on air (playing, or waiting for the
|
|
19
|
-
* host's camera), the room connected (a reconnect reads it anyway), and no poll showing (one showing is
|
|
20
|
-
* the room's, and fresher than any read).
|
|
21
|
-
*/
|
|
22
|
-
export declare function readsForMissedPoll(input: {
|
|
23
|
-
status: LiveSessionStatus;
|
|
24
|
-
connected: boolean;
|
|
25
|
-
pollShowing: boolean;
|
|
26
|
-
}): boolean;
|
|
27
|
-
//# sourceMappingURL=missedPolls.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"missedPolls.d.ts","sourceRoot":"","sources":["../src/missedPolls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,yFAAyF;AACzF,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAG1H"}
|