@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"systemPictureInPicture.js","sourceRoot":"","sources":["../../src/react/systemPictureInPicture.ts"],"names":[],"mappings":";;;AAoCA,0DAsBC;AAmBD,oDA8BC;AA3GD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iCAA4C;AAE5C,iHAAiH;AACpG,QAAA,WAAW,GAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAK,EAAE,IAAK,CAAC,CAAC;AAEvE,+GAA+G;AAClG,QAAA,eAAe,GAAG,IAAK,CAAC;AAErC;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE1C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChB,OAAO;QACT,CAAC;QACD,IAAI,KAA2D,CAAC;QAChE,MAAM,UAAU,GAAG,GAAG,EAAE;YACtB,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChB,KAAK,GAAG,qBAAqB,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CA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AAE,CAAC;YAC3B,CAAC,EAAE,OAAO,CAAC,CAAC;QACd,CAAC;QACD,IAAI,EAAE,MAAM;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { NameOnAccount } from '../pageTypes';
|
|
2
|
-
export interface AccountName {
|
|
3
|
-
accountLoading: boolean;
|
|
4
|
-
nameToComplete: NameOnAccount | null;
|
|
5
|
-
saveNameToAccount: (firstName: string, lastName: string) => Promise<string | null>;
|
|
6
|
-
}
|
|
7
|
-
export declare function useAccountName(): AccountName;
|
|
8
|
-
//# sourceMappingURL=useAccountName.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountName.d.ts","sourceRoot":"","sources":["../../src/react/useAccountName.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACpF;AAED,wBAAgB,cAAc,IAAI,WAAW,CAyB5C"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAccountName = useAccountName;
|
|
4
|
-
/**
|
|
5
|
-
* `useAccountName()` — the signed-in shopper's name on their Shopify account, for the Live screen's name
|
|
6
|
-
* asks (0.15.0, moved from amore-v2's `src/core/hooks/useAccountName.ts`): the comment box's "Commenting
|
|
7
|
-
* As:" (`useLiveChat`) and the giveaway's "Entering As:" (`useLiveGiveawaysAndPolls`).
|
|
8
|
-
*
|
|
9
|
-
* amore-v2's ENG-686, decided 2026-10-19 by its Head of Engineering (old Amore's and old K-Marie's way,
|
|
10
|
-
* for giveaways too the same day): a Shopify sign-in by emailed code leaves the account's name blank, and
|
|
11
|
-
* since 0.13.0 the room names nobody by their email. Such a shopper is asked once, by whichever comes
|
|
12
|
-
* first, a comment or a giveaway entry, for a first and a last name (the last optional), which go on the
|
|
13
|
-
* account (sdk-shopify's `updateProfile`, which says "Profile updated" as Edit Profile does). The account
|
|
14
|
-
* then names them in the room, on Account and on their orders, and neither ask comes again.
|
|
15
|
-
*
|
|
16
|
-
* - **`accountLoading`:** signed in, the account not read yet (`accountLoadingOf`). Send and Enter wait.
|
|
17
|
-
* - **`nameToComplete`:** the account has been read and has no first name, or a name the show's team
|
|
18
|
-
* goes by (`LiveSellingProvider`'s `blockedNames`): what it has, for the ask to start from
|
|
19
|
-
* (`accountNameToComplete`). Null when it has a first name, while it loads, and when signed out.
|
|
20
|
-
* - **`saveNameToAccount(firstName, lastName)`:** the name as it went on the account ("Jane Doe", or
|
|
21
|
-
* "Jane"), or null when it didn't: no first name, a team name (`tidyAccountName`), or Shopify refused
|
|
22
|
-
* it or couldn't be reached.
|
|
23
|
-
*/
|
|
24
|
-
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
25
|
-
const react_1 = require("react");
|
|
26
|
-
const livePages_1 = require("../livePages");
|
|
27
|
-
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
28
|
-
function useAccountName() {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
const { loggedIn, restoring, customer, updateProfile } = (0, sdk_shopify_1.useCustomer)();
|
|
31
|
-
const { blockedNames } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
32
|
-
const account = { loggedIn: !!loggedIn, restoring: !!restoring, customer };
|
|
33
|
-
const accountLoading = (0, livePages_1.accountLoadingOf)(account);
|
|
34
|
-
const needed = (0, livePages_1.accountNameToComplete)(account, blockedNames);
|
|
35
|
-
const firstName = (_a = needed === null || needed === void 0 ? void 0 : needed.firstName) !== null && _a !== void 0 ? _a : null;
|
|
36
|
-
const lastName = (_b = needed === null || needed === void 0 ? void 0 : needed.lastName) !== null && _b !== void 0 ? _b : null;
|
|
37
|
-
// One object while the name it needs stays the same, so a tile's sheet doesn't start over each draw.
|
|
38
|
-
const nameToComplete = (0, react_1.useMemo)(() => (firstName !== null ? { firstName, lastName } : null), [firstName, lastName]);
|
|
39
|
-
const saveNameToAccount = (0, react_1.useCallback)(async (typedFirstName, typedLastName) => {
|
|
40
|
-
const name = (0, livePages_1.tidyAccountName)(typedFirstName, typedLastName, blockedNames);
|
|
41
|
-
if (!name)
|
|
42
|
-
return null;
|
|
43
|
-
if (!(await updateProfile({ firstName: name.firstName, lastName: name.lastName })))
|
|
44
|
-
return null;
|
|
45
|
-
return name.fullName;
|
|
46
|
-
}, [blockedNames, updateProfile]);
|
|
47
|
-
return { accountLoading, nameToComplete, saveNameToAccount };
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=useAccountName.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountName.js","sourceRoot":"","sources":["../../src/react/useAccountName.ts"],"names":[],"mappings":";;AAiCA,wCAyBC;AA1DD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sDAAmD;AACnD,iCAA6C;AAE7C,4CAAwF;AAExF,+DAA2D;AAQ3D,SAAgB,cAAc;;IAC5B,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAA,yBAAW,GAAE,CAAC;IACvE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,wCAAkB,GAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC3E,MAAM,cAAc,GAAG,IAAA,4BAAgB,EAAC,OAAO,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,IAAA,iCAAqB,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,mCAAI,IAAI,CAAC;IAC5C,MAAM,QAAQ,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,mCAAI,IAAI,CAAC;IAC1C,qGAAqG;IACrG,MAAM,cAAc,GAAG,IAAA,eAAO,EAC5B,GAAG,EAAE,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAC3D,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtB,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,KAAK,EAAE,cAAsB,EAAE,aAAqB,EAA0B,EAAE;QAC9E,MAAM,IAAI,GAAG,IAAA,2BAAe,EAAC,cAAc,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAChG,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC,EACD,CAAC,YAAY,EAAE,aAAa,CAAC,CAC9B,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { ClipReelItem } from '../pageTypes';
|
|
2
|
-
/**
|
|
3
|
-
* Everything the Clips page wires, so the screen stays plain tiles: the reel (`reel`, the reel tile's
|
|
4
|
-
* props) and the bar over it (`header`). Call it from the screen and from each of its tiles' wiring.
|
|
5
|
-
*
|
|
6
|
-
* - **The reel** is the live-selling gateway's video collection (`useClips`): which clips, in what
|
|
7
|
-
* order, the video each plays and its poster. The merchant curates it in the dashboard.
|
|
8
|
-
* - **Each clip's product** comes from Shopify, in one read for the whole reel (`shopify.products.byIds`,
|
|
9
|
-
* at sdk-shopify's `CARD_IMAGE`, the grids' card size, which the product store keeps as the product's
|
|
10
|
-
* card image). A clip whose product the store no longer has is left out (`clipReelItems`): there is
|
|
11
|
-
* nothing to buy from it. Products are kept across reads, so a refreshed reel only waits for products
|
|
12
|
-
* it hasn't seen.
|
|
13
|
-
* - **Loading** until the clips' first read has started (`useClips` reads only once the SDK is ready,
|
|
14
|
-
* and says `loading` only from then: until it has read once, an empty reel is still loading, not "No
|
|
15
|
-
* clips yet.") and while products it shows are on their way. A failed read of either is `error`;
|
|
16
|
-
* Retry reads both again.
|
|
17
|
-
* - **Playback:** only while the page is on screen (`paused` otherwise); one mute setting for the reel,
|
|
18
|
-
* starting muted.
|
|
19
|
-
* - **Buy** opens the variant page (`routes.openVariantPage`): the product page's tiles in a sheet over
|
|
20
|
-
* the reel. **Share** sends the product's link (`productShareUrl`). **Close** goes back to where the
|
|
21
|
-
* shopper came from; the bar's cart opens the Cart (`routes.openCart`).
|
|
22
|
-
*/
|
|
23
|
-
export declare function useClipsPage(): {
|
|
24
|
-
/** The reel has a clip to show. */
|
|
25
|
-
hasReel: boolean;
|
|
26
|
-
/** The page is on show: light status bar glyphs over the video. */
|
|
27
|
-
isFocused: boolean;
|
|
28
|
-
reel: {
|
|
29
|
-
clips: ClipReelItem[];
|
|
30
|
-
loading: boolean;
|
|
31
|
-
error: boolean;
|
|
32
|
-
paused: boolean;
|
|
33
|
-
muted: boolean;
|
|
34
|
-
onToggleMute: () => void;
|
|
35
|
-
onShare: (clip: ClipReelItem) => void;
|
|
36
|
-
onBuy: (clip: ClipReelItem) => void;
|
|
37
|
-
onRetry: () => void;
|
|
38
|
-
};
|
|
39
|
-
header: {
|
|
40
|
-
cartCount: number;
|
|
41
|
-
onClose: () => void;
|
|
42
|
-
onCart: () => void;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
/** What `useClipsPage` hands the Clips page and its tiles. */
|
|
46
|
-
export type ClipsPage = ReturnType<typeof useClipsPage>;
|
|
47
|
-
//# sourceMappingURL=useClipsPage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useClipsPage.d.ts","sourceRoot":"","sources":["../../src/react/useClipsPage.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY;IA+DxB,mCAAmC;;IAEnC,mEAAmE;;;;;;;;;wBASjD,YAAY;sBAId,YAAY;;;;;;;;EAe/B;AAED,8DAA8D;AAC9D,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useClipsPage = useClipsPage;
|
|
4
|
-
/**
|
|
5
|
-
* The Clips page's page model (0.15.0, moved from amore-v2's `src/core/hooks/useClipsPage.ts`, ported
|
|
6
|
-
* there from the earlier app's Clips tab, 2026-10-18): the reel a rail of clips opens, on the clip tapped.
|
|
7
|
-
* The routes are the app's (`LiveSellingProvider`'s `routes`); the clip to open on is the app's route
|
|
8
|
-
* param, which its screen hands the reel tile (amore-v2: `clipId`, as `firstClipId`).
|
|
9
|
-
*/
|
|
10
|
-
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
11
|
-
const react_1 = require("react");
|
|
12
|
-
const clipsPage_1 = require("../clipsPage");
|
|
13
|
-
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
14
|
-
const useClips_1 = require("./useClips");
|
|
15
|
-
const useLiveShop_1 = require("./useLiveShop");
|
|
16
|
-
const navigation_1 = require("./navigation");
|
|
17
|
-
/**
|
|
18
|
-
* Everything the Clips page wires, so the screen stays plain tiles: the reel (`reel`, the reel tile's
|
|
19
|
-
* props) and the bar over it (`header`). Call it from the screen and from each of its tiles' wiring.
|
|
20
|
-
*
|
|
21
|
-
* - **The reel** is the live-selling gateway's video collection (`useClips`): which clips, in what
|
|
22
|
-
* order, the video each plays and its poster. The merchant curates it in the dashboard.
|
|
23
|
-
* - **Each clip's product** comes from Shopify, in one read for the whole reel (`shopify.products.byIds`,
|
|
24
|
-
* at sdk-shopify's `CARD_IMAGE`, the grids' card size, which the product store keeps as the product's
|
|
25
|
-
* card image). A clip whose product the store no longer has is left out (`clipReelItems`): there is
|
|
26
|
-
* nothing to buy from it. Products are kept across reads, so a refreshed reel only waits for products
|
|
27
|
-
* it hasn't seen.
|
|
28
|
-
* - **Loading** until the clips' first read has started (`useClips` reads only once the SDK is ready,
|
|
29
|
-
* and says `loading` only from then: until it has read once, an empty reel is still loading, not "No
|
|
30
|
-
* clips yet.") and while products it shows are on their way. A failed read of either is `error`;
|
|
31
|
-
* Retry reads both again.
|
|
32
|
-
* - **Playback:** only while the page is on screen (`paused` otherwise); one mute setting for the reel,
|
|
33
|
-
* starting muted.
|
|
34
|
-
* - **Buy** opens the variant page (`routes.openVariantPage`): the product page's tiles in a sheet over
|
|
35
|
-
* the reel. **Share** sends the product's link (`productShareUrl`). **Close** goes back to where the
|
|
36
|
-
* shopper came from; the bar's cart opens the Cart (`routes.openCart`).
|
|
37
|
-
*/
|
|
38
|
-
function useClipsPage() {
|
|
39
|
-
const nav = (0, navigation_1.useNavigation)();
|
|
40
|
-
const isFocused = (0, navigation_1.useIsFocused)();
|
|
41
|
-
const { ready: liveSellingReady } = (0, LiveSellingProvider_1.useLiveSelling)();
|
|
42
|
-
const { routes } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
43
|
-
const { ready: shopifyReady } = (0, sdk_shopify_1.useShopify)();
|
|
44
|
-
const { clips, loading: loadingClips, error: clipsError, refresh: refreshClips } = (0, useClips_1.useClips)();
|
|
45
|
-
const { itemCount } = (0, sdk_shopify_1.useCart)();
|
|
46
|
-
// `useClips` starts reading only once the live-selling SDK is ready, and says `loading` only from
|
|
47
|
-
// then: until it has read once, an empty reel is still loading, not "No clips yet.".
|
|
48
|
-
const [clipsReadStarted, setClipsReadStarted] = (0, react_1.useState)(false);
|
|
49
|
-
(0, react_1.useEffect)(() => {
|
|
50
|
-
if (loadingClips)
|
|
51
|
-
setClipsReadStarted(true);
|
|
52
|
-
}, [loadingClips]);
|
|
53
|
-
// The clips' products by id: `null` for one the store no longer has. Kept across reads.
|
|
54
|
-
const [productsById, setProductsById] = (0, react_1.useState)(new Map());
|
|
55
|
-
const [productsFailed, setProductsFailed] = (0, react_1.useState)(false);
|
|
56
|
-
const [productReadCount, setProductReadCount] = (0, react_1.useState)(0);
|
|
57
|
-
const productIds = (0, react_1.useMemo)(() => [...new Set(clips.map(clipsPage_1.clipProductId).filter((id) => !!id))], [clips]);
|
|
58
|
-
const missingIds = productIds.filter((id) => !productsById.has(id));
|
|
59
|
-
const missingKey = missingIds.join(',');
|
|
60
|
-
(0, react_1.useEffect)(() => {
|
|
61
|
-
if (!shopifyReady || !missingKey)
|
|
62
|
-
return;
|
|
63
|
-
const ids = missingKey.split(',');
|
|
64
|
-
let stillMounted = true;
|
|
65
|
-
setProductsFailed(false);
|
|
66
|
-
sdk_shopify_1.shopify.products
|
|
67
|
-
.byIds(ids, { imageTransform: sdk_shopify_1.CARD_IMAGE, keepMissing: true })
|
|
68
|
-
.then((found) => {
|
|
69
|
-
if (!stillMounted)
|
|
70
|
-
return;
|
|
71
|
-
setProductsById((known) => {
|
|
72
|
-
const next = new Map(known);
|
|
73
|
-
ids.forEach((id, index) => { var _a; return next.set(id, (_a = found[index]) !== null && _a !== void 0 ? _a : null); });
|
|
74
|
-
return next;
|
|
75
|
-
});
|
|
76
|
-
})
|
|
77
|
-
.catch(() => {
|
|
78
|
-
if (stillMounted)
|
|
79
|
-
setProductsFailed(true);
|
|
80
|
-
});
|
|
81
|
-
return () => {
|
|
82
|
-
stillMounted = false;
|
|
83
|
-
};
|
|
84
|
-
}, [shopifyReady, missingKey, productReadCount]);
|
|
85
|
-
const reel = (0, react_1.useMemo)(() => (0, clipsPage_1.clipReelItems)(clips, productsById), [clips, productsById]);
|
|
86
|
-
const productOfClip = (0, react_1.useCallback)((clipId) => {
|
|
87
|
-
var _a;
|
|
88
|
-
const clip = clips.find((candidate) => candidate.id === clipId);
|
|
89
|
-
const productId = clip ? (0, clipsPage_1.clipProductId)(clip) : null;
|
|
90
|
-
return productId ? ((_a = productsById.get(productId)) !== null && _a !== void 0 ? _a : null) : null;
|
|
91
|
-
}, [clips, productsById]);
|
|
92
|
-
const [muted, setMuted] = (0, react_1.useState)(true);
|
|
93
|
-
const waitingForProducts = missingIds.length > 0 && !productsFailed;
|
|
94
|
-
const hasReel = reel.length > 0;
|
|
95
|
-
return {
|
|
96
|
-
/** The reel has a clip to show. */
|
|
97
|
-
hasReel,
|
|
98
|
-
/** The page is on show: light status bar glyphs over the video. */
|
|
99
|
-
isFocused,
|
|
100
|
-
reel: {
|
|
101
|
-
clips: reel,
|
|
102
|
-
loading: !liveSellingReady || !clipsReadStarted || loadingClips || waitingForProducts,
|
|
103
|
-
error: !!clipsError || productsFailed,
|
|
104
|
-
paused: !isFocused,
|
|
105
|
-
muted,
|
|
106
|
-
onToggleMute: () => setMuted((wasMuted) => !wasMuted),
|
|
107
|
-
onShare: (clip) => {
|
|
108
|
-
const product = productOfClip(clip.id);
|
|
109
|
-
if (product)
|
|
110
|
-
void (0, useLiveShop_1.shareAddress)((0, sdk_shopify_1.productShareUrl)(product));
|
|
111
|
-
},
|
|
112
|
-
onBuy: (clip) => {
|
|
113
|
-
const product = productOfClip(clip.id);
|
|
114
|
-
if (product)
|
|
115
|
-
routes.openVariantPage({ handle: product.handle }, nav);
|
|
116
|
-
},
|
|
117
|
-
onRetry: () => {
|
|
118
|
-
if (productsFailed)
|
|
119
|
-
setProductReadCount((count) => count + 1);
|
|
120
|
-
void refreshClips();
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
header: {
|
|
124
|
-
cartCount: itemCount,
|
|
125
|
-
onClose: () => nav.goBack(),
|
|
126
|
-
onCart: () => routes.openCart({ itemsYouWon: false }, nav),
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=useClipsPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useClipsPage.js","sourceRoot":"","sources":["../../src/react/useClipsPage.ts"],"names":[],"mappings":";;AAqCA,oCA6FC;AAlID;;;;;GAKG;AACH,sDAA+G;AAC/G,iCAAkE;AAElE,4CAA4D;AAE5D,+DAA2E;AAC3E,yCAAsC;AACtC,+CAA6C;AAC7C,6CAAoG;AAEpG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,YAAY;IAC1B,MAAM,GAAG,GAAG,IAAA,0BAAa,GAAiC,CAAC;IAC3D,MAAM,SAAS,GAAG,IAAA,yBAAY,GAAE,CAAC;IACjC,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,IAAA,oCAAc,GAAE,CAAC;IACrD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,wCAAkB,GAAE,CAAC;IACxC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAA,wBAAU,GAAE,CAAC;IAC7C,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IAC9F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,qBAAO,GAAE,CAAC;IAEhC,kGAAkG;IAClG,qFAAqF;IACrF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAChE,IAAA,iBAAS,EAAC,GAAG,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AAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBAC9D,KAAK,YAAY,EAAE,CAAC;YACtB,CAAC;SACF;QACD,MAAM,EAAE;YACN,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE;YAC3B,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,GAAG,CAAC;SAC3D;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type CommentLinkCard } from '../commentLinks';
|
|
2
|
-
import type { LiveComment } from '../types';
|
|
3
|
-
/** Cards by the URL that produced them. */
|
|
4
|
-
export type CommentLinkCards = Record<string, CommentLinkCard>;
|
|
5
|
-
export declare function useCommentLinkCards(comments: LiveComment[], storefrontHosts: string[]): CommentLinkCards;
|
|
6
|
-
//# sourceMappingURL=useCommentLinkCards.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCommentLinkCards.d.ts","sourceRoot":"","sources":["../../src/react/useCommentLinkCards.ts"],"names":[],"mappings":"AAcA,OAAO,EAA4D,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEjH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,2CAA2C;AAC3C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE/D,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,gBAAgB,CA4CxG"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCommentLinkCards = useCommentLinkCards;
|
|
4
|
-
/**
|
|
5
|
-
* The cards for the store links in a show's comments (0.12.0, moved from Sparkl's app on 2026-10-17).
|
|
6
|
-
*
|
|
7
|
-
* `useCommentLinkCards(comments, storefrontHosts)` finds every store link in the comments
|
|
8
|
-
* (`toCommentSegments`, then `classifyCommentLink` against the app's own domains), asks for each card
|
|
9
|
-
* once (`resolveCommentLinkCard`) and returns them by the link's URL, which is what a comment's link
|
|
10
|
-
* segment has to hand. A card appears when its read lands. Outside links have none: the host's
|
|
11
|
-
* `urlPreview` covers those.
|
|
12
|
-
*
|
|
13
|
-
* Which comments draw a card, and what a tap opens, stay the app's: Sparkl draws one card per host or
|
|
14
|
-
* moderator comment (the first link that has one) and opens its own Product and Collection screens.
|
|
15
|
-
*/
|
|
16
|
-
const react_1 = require("react");
|
|
17
|
-
const commentLinks_1 = require("../commentLinks");
|
|
18
|
-
const commentLinkCards_1 = require("../commentLinkCards");
|
|
19
|
-
function useCommentLinkCards(comments, storefrontHosts) {
|
|
20
|
-
var _a;
|
|
21
|
-
// The value, not just the setter: the memo below has to see it change, or a card that lands never
|
|
22
|
-
// reaches the comments.
|
|
23
|
-
const [revision, setRevision] = (0, react_1.useState)(0);
|
|
24
|
-
const hosts = storefrontHosts.join(' ');
|
|
25
|
-
const links = (0, react_1.useMemo)(() => {
|
|
26
|
-
const seen = new Map();
|
|
27
|
-
for (const comment of comments) {
|
|
28
|
-
for (const segment of (0, commentLinks_1.toCommentSegments)(comment.text)) {
|
|
29
|
-
if (segment.kind !== 'link' || seen.has(segment.url))
|
|
30
|
-
continue;
|
|
31
|
-
const link = (0, commentLinks_1.classifyCommentLink)(segment.url, storefrontHosts);
|
|
32
|
-
if (link.kind !== 'external')
|
|
33
|
-
seen.set(segment.url, link);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return [...seen.values()];
|
|
37
|
-
// The count and the last id, not the array: the session hands a fresh array on every tick, and
|
|
38
|
-
// walking every comment each time is wasted work in a busy chat.
|
|
39
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
-
}, [comments.length, (_a = comments[comments.length - 1]) === null || _a === void 0 ? void 0 : _a.id, hosts]);
|
|
41
|
-
(0, react_1.useEffect)(() => {
|
|
42
|
-
const unasked = links.filter((link) => (0, commentLinkCards_1.cachedCommentLinkCard)(link) === undefined);
|
|
43
|
-
if (!unasked.length)
|
|
44
|
-
return;
|
|
45
|
-
let alive = true;
|
|
46
|
-
void Promise.all(unasked.map((link) => (0, commentLinkCards_1.resolveCommentLinkCard)(link))).then((answers) => {
|
|
47
|
-
// Draw again only when a card landed; comments full of dead links stay still.
|
|
48
|
-
if (alive && answers.some(Boolean))
|
|
49
|
-
setRevision((n) => n + 1);
|
|
50
|
-
});
|
|
51
|
-
return () => {
|
|
52
|
-
alive = false;
|
|
53
|
-
};
|
|
54
|
-
}, [links]);
|
|
55
|
-
return (0, react_1.useMemo)(() => {
|
|
56
|
-
const found = {};
|
|
57
|
-
for (const link of links) {
|
|
58
|
-
const card = (0, commentLinkCards_1.cachedCommentLinkCard)(link);
|
|
59
|
-
if (card)
|
|
60
|
-
found[link.url] = card;
|
|
61
|
-
}
|
|
62
|
-
return found;
|
|
63
|
-
// Again when the links change and when a read lands; the remembered cards are the truth either way.
|
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
-
}, [links, revision]);
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=useCommentLinkCards.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCommentLinkCards.js","sourceRoot":"","sources":["../../src/react/useCommentLinkCards.ts"],"names":[],"mappings":";;AAqBA,kDA4CC;AAjED;;;;;;;;;;;GAWG;AACH,iCAAqD;AAErD,kDAAiH;AACjH,0DAAoF;AAMpF,SAAgB,mBAAmB,CAAC,QAAuB,EAAE,eAAyB;;IACpF,kGAAkG;IAClG,wBAAwB;IACxB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,KAAK,GA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AAA,yCAAsB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YACrF,8EAA8E;YAC9E,IAAI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;gBAAE,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACV,KAAK,GAAG,KAAK,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,MAAM,KAAK,GAAqB,EAAE,CAAC;QACnC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,IAAA,wCAAqB,EAAC,IAAI,CAAC,CAAC;YACzC,IAAI,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACnC,CAAC;QACD,OAAO,KAAK,CAAC;QACb,oGAAoG;QACpG,uDAAuD;IACzD,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ClipItem } from '../types';
|
|
2
|
-
export interface UseFeaturedClipOptions {
|
|
3
|
-
/** Read it (0.16.0). Default true; false reads nothing and gives no clip (a product page not showing one). */
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface UseFeaturedClipState {
|
|
7
|
-
/** The featured clip, or null: none featured, not read yet, or the read failed. */
|
|
8
|
-
clip: ClipItem | null;
|
|
9
|
-
/** True while this product's clip is being read for the first time. */
|
|
10
|
-
loading: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function useFeaturedClip(productId: string | null | undefined, options?: UseFeaturedClipOptions): UseFeaturedClipState;
|
|
13
|
-
/** Forgets every product's answer (tests, and a sign-out that changes what the store shows). */
|
|
14
|
-
export declare function forgetFeaturedClips(): void;
|
|
15
|
-
//# sourceMappingURL=useFeaturedClip.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFeaturedClip.d.ts","sourceRoot":"","sources":["../../src/react/useFeaturedClip.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAMzC,MAAM,WAAW,sBAAsB;IACrC,8GAA8G;IAC9G,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,mFAAmF;IACnF,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,uEAAuE;IACvE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,GAAE,sBAA2B,GAAG,oBAAoB,CAyBhI;AAED,gGAAgG;AAChG,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFeaturedClip = useFeaturedClip;
|
|
4
|
-
exports.forgetFeaturedClips = forgetFeaturedClips;
|
|
5
|
-
/**
|
|
6
|
-
* `useFeaturedClip` — the clip the merchant featured for a product (0.15.3), for a product page's
|
|
7
|
-
* gallery to lead with. `clips.featuredForProduct` read once a product per session: a product page
|
|
8
|
-
* opened again draws its clip at once.
|
|
9
|
-
*
|
|
10
|
-
* Never an error: a failed read is "no clip" (the gallery shows the product's own media), and a read
|
|
11
|
-
* that lands after the product changed is dropped.
|
|
12
|
-
*/
|
|
13
|
-
const react_1 = require("react");
|
|
14
|
-
const liveSelling_1 = require("../liveSelling");
|
|
15
|
-
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
16
|
-
/** Each product's answer this session, `null` (none featured) included. */
|
|
17
|
-
const featured = new Map();
|
|
18
|
-
function useFeaturedClip(productId, options = {}) {
|
|
19
|
-
var _a;
|
|
20
|
-
const { ready } = (0, LiveSellingProvider_1.useLiveSelling)();
|
|
21
|
-
const enabled = (_a = options.enabled) !== null && _a !== void 0 ? _a : true;
|
|
22
|
-
const known = productId ? featured.get(productId) : undefined;
|
|
23
|
-
const [state, setState] = (0, react_1.useState)({ productId: null, clip: null });
|
|
24
|
-
(0, react_1.useEffect)(() => {
|
|
25
|
-
if (!ready || !enabled || !productId || featured.has(productId))
|
|
26
|
-
return;
|
|
27
|
-
let current = true;
|
|
28
|
-
liveSelling_1.liveSelling.clips
|
|
29
|
-
.featuredForProduct(productId)
|
|
30
|
-
.catch(() => null)
|
|
31
|
-
.then((clip) => {
|
|
32
|
-
featured.set(productId, clip);
|
|
33
|
-
if (current)
|
|
34
|
-
setState({ productId, clip });
|
|
35
|
-
});
|
|
36
|
-
return () => {
|
|
37
|
-
current = false;
|
|
38
|
-
};
|
|
39
|
-
}, [ready, enabled, productId]);
|
|
40
|
-
if (!productId || !enabled)
|
|
41
|
-
return { clip: null, loading: false };
|
|
42
|
-
if (known !== undefined)
|
|
43
|
-
return { clip: known, loading: false };
|
|
44
|
-
if (state.productId === productId)
|
|
45
|
-
return { clip: state.clip, loading: false };
|
|
46
|
-
return { clip: null, loading: ready };
|
|
47
|
-
}
|
|
48
|
-
/** Forgets every product's answer (tests, and a sign-out that changes what the store shows). */
|
|
49
|
-
function forgetFeaturedClips() {
|
|
50
|
-
featured.clear();
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=useFeaturedClip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFeaturedClip.js","sourceRoot":"","sources":["../../src/react/useFeaturedClip.ts"],"names":[],"mappings":";;AA6BA,0CAyBC;AAGD,kDAEC;AA3DD;;;;;;;GAOG;AACH,iCAA4C;AAE5C,gDAA6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AI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAChE,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC/E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACxC,CAAC;AAED,gGAAgG;AAChG,SAAgB,mBAAmB;IACjC,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { GiveawayState, LiveSessionActions } from '../sessionTypes';
|
|
2
|
-
import type { LiveGiveaway } from '../types';
|
|
3
|
-
/** What `useGiveawayEntry` reads of the session. `useLiveSession()` is one. */
|
|
4
|
-
export interface SessionForGiveaway {
|
|
5
|
-
giveaway?: GiveawayState | null;
|
|
6
|
-
/** The name the room knows the shopper by (`session.viewerName`); null when it has none yet. */
|
|
7
|
-
viewerName?: string | null;
|
|
8
|
-
actions: Pick<LiveSessionActions, 'enterGiveaway' | 'chooseViewerName' | 'dismissGiveawayResult'>;
|
|
9
|
-
}
|
|
10
|
-
export interface UseGiveawayEntryOptions {
|
|
11
|
-
/** The session the screen reads: `useLiveSession()`. */
|
|
12
|
-
session: SessionForGiveaway;
|
|
13
|
-
/**
|
|
14
|
-
* This screen's show is on air and takes entries: `useLiveShow`'s `onAir` (with its record held) and
|
|
15
|
-
* `capabilities.canEnterGiveaway`. Off: no giveaway is open here.
|
|
16
|
-
*/
|
|
17
|
-
canEnter: boolean;
|
|
18
|
-
/** The shopper is signed in: the entry is written to a customer. */
|
|
19
|
-
isLoggedIn: boolean;
|
|
20
|
-
/** Starts the app's sign-in. */
|
|
21
|
-
startSignIn: () => unknown;
|
|
22
|
-
/**
|
|
23
|
-
* The screen is on show with nothing over it (navigation focus, and no sign-in sheet up). The sheet
|
|
24
|
-
* reopens after a sign-in only then; coming back on show still signed out drops the reopen. Defaults
|
|
25
|
-
* to true.
|
|
26
|
-
*/
|
|
27
|
-
screenOnShow?: boolean;
|
|
28
|
-
/** The shopper's ordinary cart, which the gateway ties the entry to. Not how the prize arrives. */
|
|
29
|
-
cartId?: string | null;
|
|
30
|
-
}
|
|
31
|
-
/** A draw ready to show: the winner, and the names to roll through to them. */
|
|
32
|
-
export interface GiveawayDraw {
|
|
33
|
-
winnerName: string;
|
|
34
|
-
entrantNames: string[];
|
|
35
|
-
}
|
|
36
|
-
export interface UseGiveawayEntryState {
|
|
37
|
-
/** The giveaway open for entries now: active, not drawn, on a show that takes entries. Else null. */
|
|
38
|
-
open: LiveGiveaway | null;
|
|
39
|
-
/** The entry sheet is open (never while no giveaway is open). */
|
|
40
|
-
sheetOpen: boolean;
|
|
41
|
-
openSheet: () => void;
|
|
42
|
-
closeSheet: () => void;
|
|
43
|
-
/** Enters the open giveaway; with a typed name, saves it first and enters once the session holds it. */
|
|
44
|
-
enter: (typedName?: string) => void;
|
|
45
|
-
/** An entry is on its way. */
|
|
46
|
-
entering: boolean;
|
|
47
|
-
/** The host didn't take the last entry, or the typed name couldn't be saved. Cleared by the next try. */
|
|
48
|
-
entryFailed: boolean;
|
|
49
|
-
/** Starts the sign-in; back here signed in, the sheet opens again. Close the sheet first. */
|
|
50
|
-
signInToEnter: () => void;
|
|
51
|
-
/** The draw to show, once its roster is ready; never one from before this screen opened. */
|
|
52
|
-
draw: GiveawayDraw | null;
|
|
53
|
-
/** This shopper won the draw (`giveaway.result.isYou`). */
|
|
54
|
-
youWon: boolean;
|
|
55
|
-
/** The draw has been shown: the session lets it go. */
|
|
56
|
-
drawDone: () => void;
|
|
57
|
-
}
|
|
58
|
-
export declare function useGiveawayEntry(options: UseGiveawayEntryOptions): UseGiveawayEntryState;
|
|
59
|
-
//# sourceMappingURL=useGiveawayEntry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGiveawayEntry.d.ts","sourceRoot":"","sources":["../../src/react/useGiveawayEntry.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,GAAG,kBAAkB,GAAG,uBAAuB,CAAC,CAAC;CACnG;AAED,MAAM,WAAW,uBAAuB;IACtC,wDAAwD;IACxD,OAAO,EAAE,kBAAkB,CAAC;IAC5B;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,gCAAgC;IAChC,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mGAAmG;IACnG,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,qGAAqG;IACrG,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,wGAAwG;IACxG,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM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