@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/pipWindow.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Two questions the session asks about the system picture-in-picture window, kept pure so they are
|
|
3
|
-
* tested without a device.
|
|
4
|
-
*/
|
|
5
|
-
import type { LivePipMode } from './sessionTypes';
|
|
6
|
-
/**
|
|
7
|
-
* How long after the session disarms that a window opening is still counted as the one it armed.
|
|
8
|
-
* The same beat the session gives the OS to grant a window (`PIP_GRANT_MS`).
|
|
9
|
-
*/
|
|
10
|
-
export declare const PIP_DISARM_GRACE_MS = 1200;
|
|
11
|
-
export interface PipWindowContext {
|
|
12
|
-
/** `Platform.OS`. */
|
|
13
|
-
platform: string;
|
|
14
|
-
pipMode: LivePipMode;
|
|
15
|
-
/** A mounted `LiveVideoTarget` with `autoPip` holds the handover. */
|
|
16
|
-
handoverWanted: boolean;
|
|
17
|
-
/** What the session last told `livePip.setArmed`. */
|
|
18
|
-
armed: boolean;
|
|
19
|
-
/** When the session last went from armed to disarmed (epoch ms), or 0 if it never has. */
|
|
20
|
-
disarmedAt: number;
|
|
21
|
-
now: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Whether a system window that just opened (`onPipStart`) is this live session's.
|
|
25
|
-
*
|
|
26
|
-
* On iOS the window is fed by the session's own frame pipeline, so it is ours exactly when a surface
|
|
27
|
-
* is up for it — the in-app bubble, or a player holding the handover.
|
|
28
|
-
*
|
|
29
|
-
* On **Android** the window IS the activity, and the OS opens it by itself off the arm the session
|
|
30
|
-
* set. By the time `onPipStart` reaches JavaScript the player has often already let go of the
|
|
31
|
-
* handover (navigation or focus moved in the same instant), so the old test — bubble or handover —
|
|
32
|
-
* said "not ours", `pipMode` never became `system`, and then the window's close button did not stop
|
|
33
|
-
* playback and its expand button did not open the player (Freckled Poppy, Android 16). The arm state
|
|
34
|
-
* decides instead: armed now, or disarmed within `PIP_DISARM_GRACE_MS`. Anything else minimising into
|
|
35
|
-
* a window — a replay's own player — was never armed by this session and stays not ours.
|
|
36
|
-
*/
|
|
37
|
-
export declare function ownsSystemPipWindow(context: PipWindowContext): boolean;
|
|
38
|
-
/** Where the picture can be when no system window holds it: the in-app bubble, or a full-screen player. */
|
|
39
|
-
export type PlaceBeforeTheWindow = Exclude<LivePipMode, 'system'>;
|
|
40
|
-
/**
|
|
41
|
-
* Where the system window that just opened took the picture from, so coming back puts it there again:
|
|
42
|
-
* the in-app bubble (`'inapp'`) if it was up, otherwise a full-screen player (`'none'`).
|
|
43
|
-
*
|
|
44
|
-
* `rememberedBefore` is kept when the session already counts the window as up (`'system'`): a second
|
|
45
|
-
* start for one window must not forget where the first one came from.
|
|
46
|
-
*/
|
|
47
|
-
export declare function whereTheWindowCameFrom(pipModeAsItOpened: LivePipMode, rememberedBefore: PlaceBeforeTheWindow): PlaceBeforeTheWindow;
|
|
48
|
-
export interface ArmContext {
|
|
49
|
-
pipMode: LivePipMode;
|
|
50
|
-
/** A mounted `LiveVideoTarget` with `autoPip` holds the handover (the full-screen player). */
|
|
51
|
-
handoverWanted: boolean;
|
|
52
|
-
/** The session's status: a window is offered only for a picture that is playing. */
|
|
53
|
-
status: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Whether the OS may open its window when the app is put away.
|
|
57
|
-
*
|
|
58
|
-
* Only while there is a picture to hand over: the in-app bubble or a full-screen player holding the
|
|
59
|
-
* show, and the show `playing`. Joining, waiting for the host (camera off) and ended have no picture,
|
|
60
|
-
* and a window of them is an empty black box; the app is simply put away, and the session stops
|
|
61
|
-
* playback after `PIP_GRANT_MS` as it does whenever no window comes. Once the window is up it stays
|
|
62
|
-
* armed whatever the status does: disarming tears the window down on iOS, and a host stepping off
|
|
63
|
-
* camera for a moment is no reason to close it (the session leaves `system` itself when the show ends).
|
|
64
|
-
*/
|
|
65
|
-
export declare function shouldArmSystemWindow(context: ArmContext): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Whether the app came back to the foreground with this session's window still up.
|
|
68
|
-
*
|
|
69
|
-
* iOS only. Expanding the window raises `onPipRestore`; whether coming back by the app's own icon (or a
|
|
70
|
-
* notification) does the same is iOS's choice, not ours. When it does not, the window would float over
|
|
71
|
-
* the app with the show in it while the app's own surface stood aside, so the session takes the window
|
|
72
|
-
* down itself and gives the picture back. If the restore and the return both arrive, whichever comes
|
|
73
|
-
* second finds the window already handed back and does nothing. Never on Android: there the window IS the app, and
|
|
74
|
-
* `AppState` reads `active` for as long as the window is up (`LivePipModule.keepRenderingWhileInPip`).
|
|
75
|
-
*/
|
|
76
|
-
export declare function isWindowStillUpOnReturn(platform: string, pipMode: LivePipMode): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Whether an `onPipError` says the device has no picture-in-picture at all (L21).
|
|
79
|
-
*
|
|
80
|
-
* The native module answers every arming on such an Android device with this error, so a session that
|
|
81
|
-
* reported it at `error` level filed a crash report each time the bubble opened. It is a fact about
|
|
82
|
-
* the device, said once, and the session stops arming after it.
|
|
83
|
-
*/
|
|
84
|
-
export declare function isPipUnavailableMessage(message: unknown): boolean;
|
|
85
|
-
//# sourceMappingURL=pipWindow.d.ts.map
|
package/dist/pipWindow.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipWindow.d.ts","sourceRoot":"","sources":["../src/pipWind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ty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PIP_DISARM_GRACE_MS = void 0;
|
|
4
|
-
exports.ownsSystemPipWindow = ownsSystemPipWindow;
|
|
5
|
-
exports.whereTheWindowCameFrom = whereTheWindowCameFrom;
|
|
6
|
-
exports.shouldArmSystemWindow = shouldArmSystemWindow;
|
|
7
|
-
exports.isWindowStillUpOnReturn = isWindowStillUpOnReturn;
|
|
8
|
-
exports.isPipUnavailableMessage = isPipUnavailableMessage;
|
|
9
|
-
/**
|
|
10
|
-
* How long after the session disarms that a window opening is still counted as the one it armed.
|
|
11
|
-
* The same beat the session gives the OS to grant a window (`PIP_GRANT_MS`).
|
|
12
|
-
*/
|
|
13
|
-
exports.PIP_DISARM_GRACE_MS = 1200;
|
|
14
|
-
/**
|
|
15
|
-
* Whether a system window that just opened (`onPipStart`) is this live session's.
|
|
16
|
-
*
|
|
17
|
-
* On iOS the window is fed by the session's own frame pipeline, so it is ours exactly when a surface
|
|
18
|
-
* is up for it — the in-app bubble, or a player holding the handover.
|
|
19
|
-
*
|
|
20
|
-
* On **Android** the window IS the activity, and the OS opens it by itself off the arm the session
|
|
21
|
-
* set. By the time `onPipStart` reaches JavaScript the player has often already let go of the
|
|
22
|
-
* handover (navigation or focus moved in the same instant), so the old test — bubble or handover —
|
|
23
|
-
* said "not ours", `pipMode` never became `system`, and then the window's close button did not stop
|
|
24
|
-
* playback and its expand button did not open the player (Freckled Poppy, Android 16). The arm state
|
|
25
|
-
* decides instead: armed now, or disarmed within `PIP_DISARM_GRACE_MS`. Anything else minimising into
|
|
26
|
-
* a window — a replay's own player — was never armed by this session and stays not ours.
|
|
27
|
-
*/
|
|
28
|
-
function ownsSystemPipWindow(context) {
|
|
29
|
-
if (context.pipMode === 'inapp' || context.handoverWanted)
|
|
30
|
-
return true;
|
|
31
|
-
if (context.platform !== 'android')
|
|
32
|
-
return false;
|
|
33
|
-
if (context.armed)
|
|
34
|
-
return true;
|
|
35
|
-
return context.disarmedAt > 0 && context.now - context.disarmedAt <= exports.PIP_DISARM_GRACE_MS;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Where the system window that just opened took the picture from, so coming back puts it there again:
|
|
39
|
-
* the in-app bubble (`'inapp'`) if it was up, otherwise a full-screen player (`'none'`).
|
|
40
|
-
*
|
|
41
|
-
* `rememberedBefore` is kept when the session already counts the window as up (`'system'`): a second
|
|
42
|
-
* start for one window must not forget where the first one came from.
|
|
43
|
-
*/
|
|
44
|
-
function whereTheWindowCameFrom(pipModeAsItOpened, rememberedBefore) {
|
|
45
|
-
if (pipModeAsItOpened === 'system')
|
|
46
|
-
return rememberedBefore;
|
|
47
|
-
return pipModeAsItOpened;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Whether the OS may open its window when the app is put away.
|
|
51
|
-
*
|
|
52
|
-
* Only while there is a picture to hand over: the in-app bubble or a full-screen player holding the
|
|
53
|
-
* show, and the show `playing`. Joining, waiting for the host (camera off) and ended have no picture,
|
|
54
|
-
* and a window of them is an empty black box; the app is simply put away, and the session stops
|
|
55
|
-
* playback after `PIP_GRANT_MS` as it does whenever no window comes. Once the window is up it stays
|
|
56
|
-
* armed whatever the status does: disarming tears the window down on iOS, and a host stepping off
|
|
57
|
-
* camera for a moment is no reason to close it (the session leaves `system` itself when the show ends).
|
|
58
|
-
*/
|
|
59
|
-
function shouldArmSystemWindow(context) {
|
|
60
|
-
if (context.pipMode === 'system')
|
|
61
|
-
return true;
|
|
62
|
-
const surfaceWantsIt = context.pipMode === 'inapp' || context.handoverWanted;
|
|
63
|
-
return surfaceWantsIt && context.status === 'playing';
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Whether the app came back to the foreground with this session's window still up.
|
|
67
|
-
*
|
|
68
|
-
* iOS only. Expanding the window raises `onPipRestore`; whether coming back by the app's own icon (or a
|
|
69
|
-
* notification) does the same is iOS's choice, not ours. When it does not, the window would float over
|
|
70
|
-
* the app with the show in it while the app's own surface stood aside, so the session takes the window
|
|
71
|
-
* down itself and gives the picture back. If the restore and the return both arrive, whichever comes
|
|
72
|
-
* second finds the window already handed back and does nothing. Never on Android: there the window IS the app, and
|
|
73
|
-
* `AppState` reads `active` for as long as the window is up (`LivePipModule.keepRenderingWhileInPip`).
|
|
74
|
-
*/
|
|
75
|
-
function isWindowStillUpOnReturn(platform, pipMode) {
|
|
76
|
-
return platform === 'ios' && pipMode === 'system';
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Whether an `onPipError` says the device has no picture-in-picture at all (L21).
|
|
80
|
-
*
|
|
81
|
-
* The native module answers every arming on such an Android device with this error, so a session that
|
|
82
|
-
* reported it at `error` level filed a crash report each time the bubble opened. It is a fact about
|
|
83
|
-
* the device, said once, and the session stops arming after it.
|
|
84
|
-
*/
|
|
85
|
-
function isPipUnavailableMessage(message) {
|
|
86
|
-
return typeof message === 'string' && /not available on this device/i.test(message);
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=pipWindow.js.map
|
package/dist/pipWindow.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipWindow.js","sourceRoot":"","sources":["../src/pipWindow.ts"],"names":[],"mappings":";;;AAuCA,kDAKC;AAYD,wDAMC;AAoBD,sDAIC;AAYD,0DAEC;AASD,0DAEC;AAzGD;;;GAGG;AACU,QAAA,mBAAmB,GAAG,IAAK,CAAC;AAezC;;;;;;;;;;;;;GAaG;AACH,SAAgB,mBAAmB,CAAC,OAAyB;IAC3D,IAAI,OAAO,CAAC,OAAO,KAAK,OAAO,IAAI,OAAO,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IACvE,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACjD,IAAI,OAAO,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,OAAO,CAAC,UAAU,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,IAAI,2BAAmB,CAAC;AAC3F,CAAC;AAKD;;;;;;GAMG;AACH,SAAgB,sBAAsB,CACpC,iBAA8B,EAC9B,gBAAsC;IAEtC,IAAI,iBAAiB,KAAK,QAAQ;QAAE,OAAO,gBAAgB,CAAC;IAC5D,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAUD;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CAAC,OAAmB;IACvD,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,KAAK,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC;IAC7E,OAAO,cAAc,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC;AACxD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,uBAAuB,CAAC,QAAgB,EAAE,OAAoB;IAC5E,OAAO,QAAQ,KAAK,KAAK,IAAI,OAAO,KAAK,QAAQ,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACtF,CAAC"}
|
package/dist/react/clocks.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How long until a countdown with `timeLeftMs` to go shows a different second, plus a few
|
|
3
|
-
* milliseconds. The countdown shows `Math.ceil(timeLeftMs / 1000)`, which changes each time the time
|
|
4
|
-
* left crosses a whole second. Null once nothing is left: the countdown stays at zero.
|
|
5
|
-
*/
|
|
6
|
-
export declare function waitBeforeCountdownChanges(timeLeftMs: number): number | null;
|
|
7
|
-
/**
|
|
8
|
-
* How long until the show's clock, `elapsedMs` since the start, shows a different second, plus a few
|
|
9
|
-
* milliseconds. The clock shows `Math.floor(elapsedMs / 1000)`. Before the start (negative: the phone's
|
|
10
|
-
* clock is behind the gateway's) it shows 0 until one second past the start.
|
|
11
|
-
*/
|
|
12
|
-
export declare function waitBeforeShowClockChanges(elapsedMs: number): number;
|
|
13
|
-
/**
|
|
14
|
-
* The time left until `closesAt` (ms, ≥ 0): the auction round's countdown.
|
|
15
|
-
*
|
|
16
|
-
* Pass `session.auction.closesAt`. The component that calls this is drawn again once a second, as the
|
|
17
|
-
* second it shows (`Math.ceil(timeLeftMs / 1000)`) changes, and never after the countdown reaches zero.
|
|
18
|
-
* With no round (`null`) it is 0 and nothing runs.
|
|
19
|
-
*/
|
|
20
|
-
export declare function useAuctionCountdown(closesAt: number | null | undefined): number;
|
|
21
|
-
/**
|
|
22
|
-
* The time since `startedAt` (ms, ≥ 0): the show's clock.
|
|
23
|
-
*
|
|
24
|
-
* Pass `session.stream?.startedAtMs`. The component that calls this is drawn again once a second, as
|
|
25
|
-
* the second it shows (`Math.floor(elapsedMs / 1000)`) changes. With no start time (`null`) it is 0 and
|
|
26
|
-
* nothing runs; pass `null` too while the clock isn't shown (an ended show) to stop it.
|
|
27
|
-
*/
|
|
28
|
-
export declare function useShowClock(startedAt: number | null | undefined): number;
|
|
29
|
-
//# sourceMappingURL=clocks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clocks.d.ts","sourceRoot":"","sources":["../../src/react/clocks.ts"],"names":[],"mappings":"AA0CA;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG5E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAuB/E;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAqBzE"}
|
package/dist/react/clocks.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waitBeforeCountdownChanges = waitBeforeCountdownChanges;
|
|
4
|
-
exports.waitBeforeShowClockChanges = waitBeforeShowClockChanges;
|
|
5
|
-
exports.useAuctionCountdown = useAuctionCountdown;
|
|
6
|
-
exports.useShowClock = useShowClock;
|
|
7
|
-
/**
|
|
8
|
-
* The two clocks a live screen shows, kept inside the component that shows them.
|
|
9
|
-
*
|
|
10
|
-
* The session holds moments, never clocks: `auction.closesAt` (when the round closes) and
|
|
11
|
-
* `stream.startedAtMs` (when the show started). A session that ticked drew every component reading it
|
|
12
|
-
* on every tick, and the session is app-wide — before 0.9.0 that was every reader, five times a second
|
|
13
|
-
* during an auction round. These hooks count to a moment inside the one component that calls them, so
|
|
14
|
-
* only that component is drawn again as its clock moves.
|
|
15
|
-
*
|
|
16
|
-
* **Once a second, on the second.** Each hook wakes a few milliseconds after the second it shows
|
|
17
|
-
* changes, never on a free-running interval: a 1 s interval started at an arbitrary moment drifts
|
|
18
|
-
* against the deadline and shows one second twice and skips another (which is why the session's old
|
|
19
|
-
* auction clock ran at 200 ms). The clocks apps draw show whole seconds, so nothing they show changes
|
|
20
|
-
* between two wakes.
|
|
21
|
-
*
|
|
22
|
-
* **They read `Date.now()` as they draw.** A wake only asks for the component to be drawn again; the
|
|
23
|
-
* time left (or since the start) is worked out at the moment of drawing, so a component drawn for any
|
|
24
|
-
* other reason — a new bid, a new deadline — shows the right second too, with no stored time to go
|
|
25
|
-
* stale.
|
|
26
|
-
*
|
|
27
|
-
* They take the moment as a number rather than reading the session, so a tile can call them with its
|
|
28
|
-
* own props, and they work outside `LiveSessionProvider` and on the web. Only `react` is imported, so
|
|
29
|
-
* this file (and the pure helpers in it) loads in Node and in a test runner with no native modules.
|
|
30
|
-
*/
|
|
31
|
-
const react_1 = require("react");
|
|
32
|
-
const SECOND_MS = 1000;
|
|
33
|
-
/** How far past the edge of a second to wake, so the second shown has surely changed. */
|
|
34
|
-
const PAST_THE_EDGE_MS = 5;
|
|
35
|
-
/**
|
|
36
|
-
* The longest single wait before the show starts. A start time far in the future (bad data, or a phone
|
|
37
|
-
* clock hours out) would otherwise ask for a timer longer than a timer can hold, which fires at once.
|
|
38
|
-
*/
|
|
39
|
-
const LONGEST_WAIT_MS = 60 * SECOND_MS;
|
|
40
|
-
/** A time in milliseconds, or null for anything that isn't one. */
|
|
41
|
-
function timeOrNull(value) {
|
|
42
|
-
return typeof value === 'number' && Number.isFinite(value) ? value : null;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* How long until a countdown with `timeLeftMs` to go shows a different second, plus a few
|
|
46
|
-
* milliseconds. The countdown shows `Math.ceil(timeLeftMs / 1000)`, which changes each time the time
|
|
47
|
-
* left crosses a whole second. Null once nothing is left: the countdown stays at zero.
|
|
48
|
-
*/
|
|
49
|
-
function waitBeforeCountdownChanges(timeLeftMs) {
|
|
50
|
-
if (!(timeLeftMs > 0))
|
|
51
|
-
return null;
|
|
52
|
-
return (timeLeftMs % SECOND_MS || SECOND_MS) + PAST_THE_EDGE_MS;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* How long until the show's clock, `elapsedMs` since the start, shows a different second, plus a few
|
|
56
|
-
* milliseconds. The clock shows `Math.floor(elapsedMs / 1000)`. Before the start (negative: the phone's
|
|
57
|
-
* clock is behind the gateway's) it shows 0 until one second past the start.
|
|
58
|
-
*/
|
|
59
|
-
function waitBeforeShowClockChanges(elapsedMs) {
|
|
60
|
-
const untilNextSecond = elapsedMs < 0 ? SECOND_MS - elapsedMs : SECOND_MS - (elapsedMs % SECOND_MS);
|
|
61
|
-
return Math.min(untilNextSecond + PAST_THE_EDGE_MS, LONGEST_WAIT_MS);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* The time left until `closesAt` (ms, ≥ 0): the auction round's countdown.
|
|
65
|
-
*
|
|
66
|
-
* Pass `session.auction.closesAt`. The component that calls this is drawn again once a second, as the
|
|
67
|
-
* second it shows (`Math.ceil(timeLeftMs / 1000)`) changes, and never after the countdown reaches zero.
|
|
68
|
-
* With no round (`null`) it is 0 and nothing runs.
|
|
69
|
-
*/
|
|
70
|
-
function useAuctionCountdown(closesAt) {
|
|
71
|
-
const deadline = timeOrNull(closesAt);
|
|
72
|
-
/** Counts the wakes. The number means nothing; setting it is what draws this component again. */
|
|
73
|
-
const [, setWakes] = (0, react_1.useState)(0);
|
|
74
|
-
(0, react_1.useEffect)(() => {
|
|
75
|
-
if (deadline === null)
|
|
76
|
-
return;
|
|
77
|
-
let timer = null;
|
|
78
|
-
const waitForNextSecond = () => {
|
|
79
|
-
const wait = waitBeforeCountdownChanges(deadline - Date.now());
|
|
80
|
-
if (wait === null)
|
|
81
|
-
return;
|
|
82
|
-
timer = setTimeout(() => {
|
|
83
|
-
setWakes((wakes) => wakes + 1);
|
|
84
|
-
waitForNextSecond();
|
|
85
|
-
}, wait);
|
|
86
|
-
};
|
|
87
|
-
waitForNextSecond();
|
|
88
|
-
return () => {
|
|
89
|
-
if (timer)
|
|
90
|
-
clearTimeout(timer);
|
|
91
|
-
};
|
|
92
|
-
}, [deadline]);
|
|
93
|
-
return deadline === null ? 0 : Math.max(0, deadline - Date.now());
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* The time since `startedAt` (ms, ≥ 0): the show's clock.
|
|
97
|
-
*
|
|
98
|
-
* Pass `session.stream?.startedAtMs`. The component that calls this is drawn again once a second, as
|
|
99
|
-
* the second it shows (`Math.floor(elapsedMs / 1000)`) changes. With no start time (`null`) it is 0 and
|
|
100
|
-
* nothing runs; pass `null` too while the clock isn't shown (an ended show) to stop it.
|
|
101
|
-
*/
|
|
102
|
-
function useShowClock(startedAt) {
|
|
103
|
-
const start = timeOrNull(startedAt);
|
|
104
|
-
/** Counts the wakes. The number means nothing; setting it is what draws this component again. */
|
|
105
|
-
const [, setWakes] = (0, react_1.useState)(0);
|
|
106
|
-
(0, react_1.useEffect)(() => {
|
|
107
|
-
if (start === null)
|
|
108
|
-
return;
|
|
109
|
-
let timer = null;
|
|
110
|
-
const waitForNextSecond = () => {
|
|
111
|
-
timer = setTimeout(() => {
|
|
112
|
-
setWakes((wakes) => wakes + 1);
|
|
113
|
-
waitForNextSecond();
|
|
114
|
-
}, waitBeforeShowClockChanges(Date.now() - start));
|
|
115
|
-
};
|
|
116
|
-
waitForNextSecond();
|
|
117
|
-
return () => {
|
|
118
|
-
if (timer)
|
|
119
|
-
clearTimeout(timer);
|
|
120
|
-
};
|
|
121
|
-
}, [start]);
|
|
122
|
-
return start === null ? 0 : Math.max(0, Date.now() - start);
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=clocks.js.map
|
package/dist/react/clocks.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clocks.js","sourceRoot":"","sources":["../../src/react/clocks.ts"],"names":[],"mappings":";;AA+CA,gEAGC;AAOD,gEAGC;AASD,kDAuBC;AASD,oCAqBC;AA1HD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iCAA4C;AAE5C,MAAM,SAAS,GAAG,IAAI,CAAC;AAEvB,yFAAyF;AACzF,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B;;;GAGG;AACH,MAAM,eAAe,GAAG,EAAE,GAAG,SAAS,CAAC;AAEvC,mEAAmE;AACnE,SAAS,UAAU,CAAC,KAAgC;IAClD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,SAAgB,0BAA0B,CAAC,UAAkB;IAC3D,IAAI,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,CAAC,UAAU,GAA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, the stack above it, its own navigation for `goBack` and the app's routes.
|
|
4
|
-
*
|
|
5
|
-
* `@react-navigation/native` 7 ships ECMAScript modules only, and this package compiles to CommonJS
|
|
6
|
-
* (`module: node16`), where TypeScript refuses a static import of one. Metro (and jest-expo) turn the
|
|
7
|
-
* package into CommonJS as they bundle it, so a `require` here reaches the app's own copy, the one its
|
|
8
|
-
* `NavigationContainer` came from, which the hooks must share. The types are read as the module's.
|
|
9
|
-
*/
|
|
10
|
-
import type * as ReactNavigation from '@react-navigation/native' with { 'resolution-mode': 'import' };
|
|
11
|
-
export type { NavigationProp, ParamListBase, RouteProp, } from '@react-navigation/native' with { 'resolution-mode': 'import' };
|
|
12
|
-
export declare const useFocusEffect: typeof ReactNavigation.useFocusEffect, useIsFocused: typeof ReactNavigation.useIsFocused, useNavigation: typeof ReactNavigation.useNavigation, useNavigationState: typeof ReactNavigation.useNavigationState, useRoute: typeof ReactNavigation.useRoute;
|
|
13
|
-
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/react/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,KAAK,eAAe,MAAM,0BAA0B,CAAC,OAAO,iBAAiB,EAAE,QAAQ,EAAE,CAAC;AAEtG,YAAY,EACV,cAAc,EACd,aAAa,EACb,SAAS,GACV,MAAM,0BAA0B,CAAC,OAAO,iBAAiB,EAAE,QAAQ,EAAE,CAAC;AAKvE,eAAO,MAAQ,cAAc,yCAAE,YAAY,uCAAE,aAAa,wCAAE,kBAAkB,6CAAE,QAAQ,iCAAe,CAAC"}
|
package/dist/react/navigation.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useRoute = exports.useNavigationState = exports.useNavigation = exports.useIsFocused = exports.useFocusEffect = void 0;
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
5
|
-
const navigation = require('@react-navigation/native');
|
|
6
|
-
exports.useFocusEffect = navigation.useFocusEffect, exports.useIsFocused = navigation.useIsFocused, exports.useNavigation = navigation.useNavigation, exports.useNavigationState = navigation.useNavigationState, exports.useRoute = navigation.useRoute;
|
|
7
|
-
//# sourceMappingURL=navigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/react/navigation.ts"],"names":[],"mappings":";;;AAiBA,8DAA8D;AAC9D,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAA2B,CAAC;AAElE,sBAAc,GAAgE,UAAU,iBAAxE,oBAAY,GAAkD,UAAU,eAA1D,qBAAa,GAAmC,UAAU,gBAA3C,0BAAkB,GAAe,UAAU,qBAAvB,gBAAQ,GAAK,UAAU,UAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The session and what draws it, for the code that runs on both platforms (0.14.0): the page hooks,
|
|
3
|
-
* the Shopify session provider and the `/ui` bubbles import them from here, never from their own files.
|
|
4
|
-
*
|
|
5
|
-
* This is the device's: the real session, its show, the bid gate, the wins and the video target.
|
|
6
|
-
* Metro serves `platformSession.web.ts` in its place on the web (the idle session, a `View` for the
|
|
7
|
-
* video), as it serves `index.web.ts` for `index.ts`, so a module that reads the session from here
|
|
8
|
-
* runs on the web too, and never pulls the Zego entry into a web bundle. TypeScript reads this one;
|
|
9
|
-
* keep the two in step.
|
|
10
|
-
*/
|
|
11
|
-
export { LiveSessionProvider, useLiveSession } from './useLiveSession';
|
|
12
|
-
export { useLiveShow } from './useLiveShow';
|
|
13
|
-
export { LiveVideoTarget, NativeVideoView, isNativeVideoSupported } from './LiveVideoTarget';
|
|
14
|
-
export { useAuctionBidGate, SHEET_HANDOFF_MS } from './useAuctionBidGate';
|
|
15
|
-
export { useAuctionWins } from './useAuctionWins';
|
|
16
|
-
//# sourceMappingURL=platformSession.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformSession.d.ts","sourceRoot":"","sources":["../../src/react/platformSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAuctionWins = exports.SHEET_HANDOFF_MS = exports.useAuctionBidGate = exports.isNativeVideoSupported = exports.NativeVideoView = exports.LiveVideoTarget = exports.useLiveShow = exports.useLiveSession = exports.LiveSessionProvider = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The session and what draws it, for the code that runs on both platforms (0.14.0): the page hooks,
|
|
6
|
-
* the Shopify session provider and the `/ui` bubbles import them from here, never from their own files.
|
|
7
|
-
*
|
|
8
|
-
* This is the device's: the real session, its show, the bid gate, the wins and the video target.
|
|
9
|
-
* Metro serves `platformSession.web.ts` in its place on the web (the idle session, a `View` for the
|
|
10
|
-
* video), as it serves `index.web.ts` for `index.ts`, so a module that reads the session from here
|
|
11
|
-
* runs on the web too, and never pulls the Zego entry into a web bundle. TypeScript reads this one;
|
|
12
|
-
* keep the two in step.
|
|
13
|
-
*/
|
|
14
|
-
var useLiveSession_1 = require("./useLiveSession");
|
|
15
|
-
Object.defineProperty(exports, "LiveSessionProvider", { enumerable: true, get: function () { return useLiveSession_1.LiveSessionProvider; } });
|
|
16
|
-
Object.defineProperty(exports, "useLiveSession", { enumerable: true, get: function () { return useLiveSession_1.useLiveSession; } });
|
|
17
|
-
var useLiveShow_1 = require("./useLiveShow");
|
|
18
|
-
Object.defineProperty(exports, "useLiveShow", { enumerable: true, get: function () { return useLiveShow_1.useLiveShow; } });
|
|
19
|
-
var LiveVideoTarget_1 = require("./LiveVideoTarget");
|
|
20
|
-
Object.defineProperty(exports, "LiveVideoTarget", { enumerable: true, get: function () { return LiveVideoTarget_1.LiveVideoTarget; } });
|
|
21
|
-
Object.defineProperty(exports, "NativeVideoView", { enumerable: true, get: function () { return LiveVideoTarget_1.NativeVideoView; } });
|
|
22
|
-
Object.defineProperty(exports, "isNativeVideoSupported", { enumerable: true, get: function () { return LiveVideoTarget_1.isNativeVideoSupported; } });
|
|
23
|
-
var useAuctionBidGate_1 = require("./useAuctionBidGate");
|
|
24
|
-
Object.defineProperty(exports, "useAuctionBidGate", { enumerable: true, get: function () { return useAuctionBidGate_1.useAuctionBidGate; } });
|
|
25
|
-
Object.defineProperty(exports, "SHEET_HANDOFF_MS", { enumerable: true, get: function () { return useAuctionBidGate_1.SHEET_HANDOFF_MS; } });
|
|
26
|
-
var useAuctionWins_1 = require("./useAuctionWins");
|
|
27
|
-
Object.defineProperty(exports, "useAuctionWins", { enumerable: true, get: function () { return useAuctionWins_1.useAuctionWins; } });
|
|
28
|
-
//# sourceMappingURL=platformSession.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformSession.js","sourceRoot":"","sources":["../../src/react/platformSession.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,mDAAuE;AAA9D,qHAAA,mBAAmB,OAAA;AAAE,gHAAA,cAAc,OAAA;AAC5C,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,qDAA6F;AAApF,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AACjE,yDAA0E;AAAjE,sHAAA,iBAAiB,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAC5C,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { View } from 'react-native';
|
|
2
|
-
import type { ViewProps } from 'react-native';
|
|
3
|
-
import { type LiveShow } from '../liveShow';
|
|
4
|
-
import type { LiveSession } from '../sessionTypes';
|
|
5
|
-
import type { AuctionBidGate, UseAuctionBidGateOptions } from './useAuctionBidGate';
|
|
6
|
-
import type { UseAuctionWinsOptions, UseAuctionWinsState } from './useAuctionWins';
|
|
7
|
-
import type { LiveSessionProviderProps } from './useLiveSession';
|
|
8
|
-
import type { LiveVideoTargetProps } from './LiveVideoTarget';
|
|
9
|
-
/** A stream that is over: the one state every surface already knows how to draw. */
|
|
10
|
-
export declare const IDLE_SESSION: LiveSession;
|
|
11
|
-
export declare function LiveSessionProvider({ children }: LiveSessionProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<LiveSession | null>>;
|
|
12
|
-
/**
|
|
13
|
-
* The idle session, read without touching the context: a surface rendered outside the provider
|
|
14
|
-
* behaves the same as one inside it, because on the web there is only ever this one session.
|
|
15
|
-
*/
|
|
16
|
-
export declare function useLiveSession<TRaw = unknown>(): LiveSession<TRaw>;
|
|
17
|
-
/** `useLiveShow` over the idle session: always `ended`, with no show, whatever the id. */
|
|
18
|
-
export declare function useLiveShow(_streamingId: string | null | undefined): LiveShow;
|
|
19
|
-
export declare const isNativeVideoSupported = false;
|
|
20
|
-
/**
|
|
21
|
-
* A plain `View`, which is what the native file falls back to on a build without the Zego SDK:
|
|
22
|
-
* callers position this and draw a poster over it, so returning null would collapse the layout the
|
|
23
|
-
* poster depends on.
|
|
24
|
-
*/
|
|
25
|
-
export declare const NativeVideoView: import("react").ForwardRefExoticComponent<ViewProps & import("react").RefAttributes<unknown>>;
|
|
26
|
-
export declare function LiveVideoTarget({ style, children }: LiveVideoTargetProps): import("react").CElement<ViewProps, View>;
|
|
27
|
-
export declare const SHEET_HANDOFF_MS = 380;
|
|
28
|
-
/** Never blocks, because there is no bid to gate — `placeBid` above resolves without sending. */
|
|
29
|
-
export declare function useAuctionBidGate(_options: UseAuctionBidGateOptions): AuctionBidGate;
|
|
30
|
-
/**
|
|
31
|
-
* An empty tab rather than a failure. The wins metafield is readable from a browser, but settling one
|
|
32
|
-
* mints a cart and sends the shopper to checkout — not something a preview should be able to start.
|
|
33
|
-
*/
|
|
34
|
-
export declare function useAuctionWins<TRaw = unknown>(_options?: UseAuctionWinsOptions): UseAuctionWinsState<TRaw>;
|
|
35
|
-
//# sourceMappingURL=platformSession.web.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformSession.web.d.ts","sourceRoot":"","sources":["../../src/react/platformSession.web.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,EAAiB,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAiC9D,oFAAoF;AACpF,eAAO,MAAM,YAAY,EAAE,WA8B1B,CAAC;AAIF,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE,wBAAwB,+FAEzE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,GAAG,OAAO,KAAK,WAAW,CAAC,IAAI,CAAC,CAElE;AAKD,0FAA0F;AAC1F,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAE7E;AAID,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,eAAe,+FAE1B,CAAC;AAEH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,oBAAoB,6CAExE;AAID,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,cAAc,CAepF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,GAAG,OAAO,EAC3C,QAAQ,CAAC,EAAE,qBAAqB,GAC/B,mBAAmB,CAAC,IAAI,CAAC,CAe3B"}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SHEET_HANDOFF_MS = exports.NativeVideoView = exports.isNativeVideoSupported = exports.IDLE_SESSION = void 0;
|
|
4
|
-
exports.LiveSessionProvider = LiveSessionProvider;
|
|
5
|
-
exports.useLiveSession = useLiveSession;
|
|
6
|
-
exports.useLiveShow = useLiveShow;
|
|
7
|
-
exports.LiveVideoTarget = LiveVideoTarget;
|
|
8
|
-
exports.useAuctionBidGate = useAuctionBidGate;
|
|
9
|
-
exports.useAuctionWins = useAuctionWins;
|
|
10
|
-
/**
|
|
11
|
-
* The session and what draws it, on the **web** (0.14.0: moved here from `index.web.ts`, which
|
|
12
|
-
* re-exports them): an idle session, a show that is always `ended`, a `View` for the video, a bid gate
|
|
13
|
-
* that never blocks and no wins. Metro serves this file in place of `platformSession.ts` on the web,
|
|
14
|
-
* so the page hooks, the Shopify session provider and the `/ui` bubbles, which read the session from
|
|
15
|
-
* `./platformSession`, run here over these stand-ins and never reach the Zego module. `index.web.ts`
|
|
16
|
-
* says why each is what it is.
|
|
17
|
-
*
|
|
18
|
-
* `createElement` rather than JSX, like the rest of the package, so this stays a plain `.ts`.
|
|
19
|
-
*/
|
|
20
|
-
const react_1 = require("react");
|
|
21
|
-
const react_native_1 = require("react-native");
|
|
22
|
-
const liveShow_1 = require("../liveShow");
|
|
23
|
-
const sessionTypes_1 = require("../sessionTypes");
|
|
24
|
-
// ─── The session ─────────────────────────────────────────────────────────────
|
|
25
|
-
/** Every action, resolved and doing nothing. There is no room to send any of it to. */
|
|
26
|
-
const IDLE_ACTIONS = {
|
|
27
|
-
bindVideoView: () => undefined,
|
|
28
|
-
sendComment: async () => undefined,
|
|
29
|
-
sendReaction: async () => undefined,
|
|
30
|
-
announceAddToCart: async () => undefined,
|
|
31
|
-
voteInPoll: async () => undefined,
|
|
32
|
-
chooseViewerName: async () => null,
|
|
33
|
-
addToCart: async () => false,
|
|
34
|
-
joinAsGuest: () => Promise.reject(new Error('Co-hosting needs a device build.')),
|
|
35
|
-
leaveGuest: async () => undefined,
|
|
36
|
-
setGuestMicMuted: async () => undefined,
|
|
37
|
-
setGuestCameraOff: async () => undefined,
|
|
38
|
-
flipGuestCamera: async () => undefined,
|
|
39
|
-
bindGuestPreview: () => undefined,
|
|
40
|
-
bindGuestHostView: () => undefined,
|
|
41
|
-
setMuted: () => undefined,
|
|
42
|
-
setOutputMuted: () => undefined,
|
|
43
|
-
setPipHandover: () => undefined,
|
|
44
|
-
holdStream: () => undefined,
|
|
45
|
-
releaseStream: () => undefined,
|
|
46
|
-
enterPip: () => undefined,
|
|
47
|
-
exitPip: () => undefined,
|
|
48
|
-
placeBid: async () => ({ sent: false, reason: 'noShow' }),
|
|
49
|
-
enterGiveaway: async () => ({ entered: false, reason: 'noGiveaway' }),
|
|
50
|
-
dismissAuctionWin: () => undefined,
|
|
51
|
-
dismissGiveawayResult: () => undefined,
|
|
52
|
-
};
|
|
53
|
-
/** A stream that is over: the one state every surface already knows how to draw. */
|
|
54
|
-
exports.IDLE_SESSION = {
|
|
55
|
-
status: 'ended',
|
|
56
|
-
stream: null,
|
|
57
|
-
viewerCount: 0,
|
|
58
|
-
rawViewerCount: 0,
|
|
59
|
-
reactionStyle: 'single',
|
|
60
|
-
comments: [],
|
|
61
|
-
activeProduct: null,
|
|
62
|
-
products: [],
|
|
63
|
-
sold: [],
|
|
64
|
-
cartAnnouncements: [],
|
|
65
|
-
reactions: [],
|
|
66
|
-
poll: null,
|
|
67
|
-
muted: true,
|
|
68
|
-
videoTag: null,
|
|
69
|
-
pipMode: 'none',
|
|
70
|
-
guest: {
|
|
71
|
-
mode: false,
|
|
72
|
-
status: 'idle',
|
|
73
|
-
slot: null,
|
|
74
|
-
mutedByHost: false,
|
|
75
|
-
cameraOffByHost: false,
|
|
76
|
-
mixerLayout: null,
|
|
77
|
-
},
|
|
78
|
-
viewerName: null,
|
|
79
|
-
auction: sessionTypes_1.IDLE_AUCTION,
|
|
80
|
-
giveaway: sessionTypes_1.IDLE_GIVEAWAY,
|
|
81
|
-
pinnedComment: null,
|
|
82
|
-
error: null,
|
|
83
|
-
actions: IDLE_ACTIONS,
|
|
84
|
-
};
|
|
85
|
-
const LiveSessionContext = (0, react_1.createContext)(null);
|
|
86
|
-
function LiveSessionProvider({ children }) {
|
|
87
|
-
return (0, react_1.createElement)(LiveSessionContext.Provider, { value: exports.IDLE_SESSION }, children);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* The idle session, read without touching the context: a surface rendered outside the provider
|
|
91
|
-
* behaves the same as one inside it, because on the web there is only ever this one session.
|
|
92
|
-
*/
|
|
93
|
-
function useLiveSession() {
|
|
94
|
-
return exports.IDLE_SESSION;
|
|
95
|
-
}
|
|
96
|
-
/** The idle session's show: none, and `ended`. One object, as the session never changes here. */
|
|
97
|
-
const IDLE_SHOW = (0, liveShow_1.liveShowFor)(exports.IDLE_SESSION, null);
|
|
98
|
-
/** `useLiveShow` over the idle session: always `ended`, with no show, whatever the id. */
|
|
99
|
-
function useLiveShow(_streamingId) {
|
|
100
|
-
return IDLE_SHOW;
|
|
101
|
-
}
|
|
102
|
-
// ─── The video ───────────────────────────────────────────────────────────────
|
|
103
|
-
exports.isNativeVideoSupported = false;
|
|
104
|
-
/**
|
|
105
|
-
* A plain `View`, which is what the native file falls back to on a build without the Zego SDK:
|
|
106
|
-
* callers position this and draw a poster over it, so returning null would collapse the layout the
|
|
107
|
-
* poster depends on.
|
|
108
|
-
*/
|
|
109
|
-
exports.NativeVideoView = (0, react_1.forwardRef)(function NativeVideoView(props, _ref) {
|
|
110
|
-
return (0, react_1.createElement)(react_native_1.View, props);
|
|
111
|
-
});
|
|
112
|
-
function LiveVideoTarget({ style, children }) {
|
|
113
|
-
return (0, react_1.createElement)(react_native_1.View, { style: style !== null && style !== void 0 ? style : { flex: 1 } }, children);
|
|
114
|
-
}
|
|
115
|
-
// ─── Auctions ────────────────────────────────────────────────────────────────
|
|
116
|
-
exports.SHEET_HANDOFF_MS = 380;
|
|
117
|
-
/** Never blocks, because there is no bid to gate — `placeBid` above resolves without sending. */
|
|
118
|
-
function useAuctionBidGate(_options) {
|
|
119
|
-
return (0, react_1.useMemo)(() => ({
|
|
120
|
-
blocker: null,
|
|
121
|
-
variantId: null,
|
|
122
|
-
requestBid: () => undefined,
|
|
123
|
-
acceptTerms: () => undefined,
|
|
124
|
-
chooseVariant: () => undefined,
|
|
125
|
-
dismiss: () => undefined,
|
|
126
|
-
refreshUnpaidWins: () => undefined,
|
|
127
|
-
refusal: null,
|
|
128
|
-
bidOnItsWay: false,
|
|
129
|
-
}), []);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* An empty tab rather than a failure. The wins metafield is readable from a browser, but settling one
|
|
133
|
-
* mints a cart and sends the shopper to checkout — not something a preview should be able to start.
|
|
134
|
-
*/
|
|
135
|
-
function useAuctionWins(_options) {
|
|
136
|
-
return (0, react_1.useMemo)(() => ({
|
|
137
|
-
rows: [],
|
|
138
|
-
giveawayVariantIds: new Set(),
|
|
139
|
-
totalBids: 0,
|
|
140
|
-
streamingId: null,
|
|
141
|
-
loading: false,
|
|
142
|
-
checkingOut: false,
|
|
143
|
-
error: null,
|
|
144
|
-
refresh: () => undefined,
|
|
145
|
-
checkout: async () => null,
|
|
146
|
-
}), []);
|
|
147
|
-
}
|
|
148
|
-
//# sourceMappingURL=platformSession.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformSession.web.js","sourceRoot":"","sources":["../../src/react/platformSession.web.ts"],"names":[],"mappings":";;;AAyFA,kDAEC;AAMD,wCAEC;AAMD,kCAEC;AAeD,0CAEC;AAOD,8CAeC;AAMD,wCAiBC;AAzKD;;;;;;;;;GASG;AACH,iCAA0E;AAC1E,+CAAoC;AAIpC,0CAAyD;AACzD,kDAA8D;AAO9D,gFAAgF;AAEhF,uFAAuF;AACvF,MAAM,YAAY,GAAuB;IACvC,aAAa,EAAE,GAAG,EAAE,CAAC,SAAS;IAC9B,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IAClC,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IACnC,iBAAiB,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IACxC,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IACjC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;IAClC,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;IAC5B,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAChF,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IACjC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IACvC,iBAAiB,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IACxC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IACtC,gBAAgB,EAAE,GAAG,EAAE,CAAC,SAAS;IACjC,iBAAiB,EAAE,GAAG,EAAE,CAAC,S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