@tiledev/sdk-apptile-live-selling 0.12.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +116 -19
  2. package/dist/giveawayPrizeLines.d.ts +10 -0
  3. package/dist/giveawayPrizeLines.d.ts.map +1 -1
  4. package/dist/giveawayPrizeLines.js +11 -1
  5. package/dist/giveawayPrizeLines.js.map +1 -1
  6. package/dist/heldComments.d.ts +13 -2
  7. package/dist/heldComments.d.ts.map +1 -1
  8. package/dist/heldComments.js +16 -2
  9. package/dist/heldComments.js.map +1 -1
  10. package/dist/hiddenShows.d.ts +10 -0
  11. package/dist/hiddenShows.d.ts.map +1 -1
  12. package/dist/hiddenShows.js +11 -0
  13. package/dist/hiddenShows.js.map +1 -1
  14. package/dist/index.d.ts +9 -4
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +35 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/livePages.d.ts +79 -0
  19. package/dist/livePages.d.ts.map +1 -0
  20. package/dist/livePages.js +90 -0
  21. package/dist/livePages.js.map +1 -0
  22. package/dist/liveRoom.d.ts +21 -0
  23. package/dist/liveRoom.d.ts.map +1 -0
  24. package/dist/liveRoom.js +28 -0
  25. package/dist/liveRoom.js.map +1 -0
  26. package/dist/pageOptions.d.ts +100 -0
  27. package/dist/pageOptions.d.ts.map +1 -0
  28. package/dist/pageOptions.js +82 -0
  29. package/dist/pageOptions.js.map +1 -0
  30. package/dist/pageTypes.d.ts +127 -0
  31. package/dist/pageTypes.d.ts.map +1 -0
  32. package/dist/pageTypes.js +3 -0
  33. package/dist/pageTypes.js.map +1 -0
  34. package/dist/react/LiveSellingProvider.d.ts +23 -1
  35. package/dist/react/LiveSellingProvider.d.ts.map +1 -1
  36. package/dist/react/LiveSellingProvider.js +26 -2
  37. package/dist/react/LiveSellingProvider.js.map +1 -1
  38. package/dist/react/index.d.ts +10 -0
  39. package/dist/react/index.d.ts.map +1 -1
  40. package/dist/react/index.js +29 -1
  41. package/dist/react/index.js.map +1 -1
  42. package/dist/react/index.web.d.ts +11 -32
  43. package/dist/react/index.web.d.ts.map +1 -1
  44. package/dist/react/index.web.js +46 -139
  45. package/dist/react/index.web.js.map +1 -1
  46. package/dist/react/navigation.d.ts +13 -0
  47. package/dist/react/navigation.d.ts.map +1 -0
  48. package/dist/react/navigation.js +7 -0
  49. package/dist/react/navigation.js.map +1 -0
  50. package/dist/react/platformSession.d.ts +16 -0
  51. package/dist/react/platformSession.d.ts.map +1 -0
  52. package/dist/react/platformSession.js +28 -0
  53. package/dist/react/platformSession.js.map +1 -0
  54. package/dist/react/platformSession.web.d.ts +35 -0
  55. package/dist/react/platformSession.web.d.ts.map +1 -0
  56. package/dist/react/platformSession.web.js +148 -0
  57. package/dist/react/platformSession.web.js.map +1 -0
  58. package/dist/react/replayPlayer.d.ts +74 -0
  59. package/dist/react/replayPlayer.d.ts.map +1 -0
  60. package/dist/react/replayPlayer.js +279 -0
  61. package/dist/react/replayPlayer.js.map +1 -0
  62. package/dist/react/shopifyProviders.d.ts +68 -0
  63. package/dist/react/shopifyProviders.d.ts.map +1 -0
  64. package/dist/react/shopifyProviders.js +98 -0
  65. package/dist/react/shopifyProviders.js.map +1 -0
  66. package/dist/react/showPages.d.ts +5 -1
  67. package/dist/react/showPages.d.ts.map +1 -1
  68. package/dist/react/showPages.js +14 -5
  69. package/dist/react/showPages.js.map +1 -1
  70. package/dist/react/useKeepScreenAwake.d.ts +2 -0
  71. package/dist/react/useKeepScreenAwake.d.ts.map +1 -0
  72. package/dist/react/useKeepScreenAwake.js +34 -0
  73. package/dist/react/useKeepScreenAwake.js.map +1 -0
  74. package/dist/react/useLiveAuction.d.ts +104 -0
  75. package/dist/react/useLiveAuction.d.ts.map +1 -0
  76. package/dist/react/useLiveAuction.js +244 -0
  77. package/dist/react/useLiveAuction.js.map +1 -0
  78. package/dist/react/useLiveChat.d.ts +75 -0
  79. package/dist/react/useLiveChat.d.ts.map +1 -0
  80. package/dist/react/useLiveChat.js +131 -0
  81. package/dist/react/useLiveChat.js.map +1 -0
  82. package/dist/react/useLiveGiveawaysAndPolls.d.ts +84 -0
  83. package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +1 -0
  84. package/dist/react/useLiveGiveawaysAndPolls.js +180 -0
  85. package/dist/react/useLiveGiveawaysAndPolls.js.map +1 -0
  86. package/dist/react/useLivePage.d.ts +113 -0
  87. package/dist/react/useLivePage.d.ts.map +1 -0
  88. package/dist/react/useLivePage.js +264 -0
  89. package/dist/react/useLivePage.js.map +1 -0
  90. package/dist/react/useLiveSession.d.ts +8 -0
  91. package/dist/react/useLiveSession.d.ts.map +1 -1
  92. package/dist/react/useLiveSession.js +43 -27
  93. package/dist/react/useLiveSession.js.map +1 -1
  94. package/dist/react/useLiveShop.d.ts +83 -0
  95. package/dist/react/useLiveShop.d.ts.map +1 -0
  96. package/dist/react/useLiveShop.js +165 -0
  97. package/dist/react/useLiveShop.js.map +1 -0
  98. package/dist/react/useReplayPage.d.ts +117 -0
  99. package/dist/react/useReplayPage.d.ts.map +1 -0
  100. package/dist/react/useReplayPage.js +504 -0
  101. package/dist/react/useReplayPage.js.map +1 -0
  102. package/dist/sessionTypes.d.ts +17 -9
  103. package/dist/sessionTypes.d.ts.map +1 -1
  104. package/dist/sessionTypes.js.map +1 -1
  105. package/dist/shopifyIdentity.d.ts +7 -4
  106. package/dist/shopifyIdentity.d.ts.map +1 -1
  107. package/dist/shopifyIdentity.js +11 -5
  108. package/dist/shopifyIdentity.js.map +1 -1
  109. package/dist/showCredit.d.ts +87 -0
  110. package/dist/showCredit.d.ts.map +1 -0
  111. package/dist/showCredit.js +120 -0
  112. package/dist/showCredit.js.map +1 -0
  113. package/dist/showNames.d.ts +24 -3
  114. package/dist/showNames.d.ts.map +1 -1
  115. package/dist/showNames.js +57 -10
  116. package/dist/showNames.js.map +1 -1
  117. package/dist/showPages.d.ts +12 -0
  118. package/dist/showPages.d.ts.map +1 -1
  119. package/dist/showPages.js +10 -0
  120. package/dist/showPages.js.map +1 -1
  121. package/dist/ui/BubbleFrame.d.ts +38 -0
  122. package/dist/ui/BubbleFrame.d.ts.map +1 -0
  123. package/dist/ui/BubbleFrame.js +181 -0
  124. package/dist/ui/BubbleFrame.js.map +1 -0
  125. package/dist/ui/LiveBubble.d.ts +37 -0
  126. package/dist/ui/LiveBubble.d.ts.map +1 -0
  127. package/dist/ui/LiveBubble.js +101 -0
  128. package/dist/ui/LiveBubble.js.map +1 -0
  129. package/dist/ui/ReplayBubble.d.ts +23 -0
  130. package/dist/ui/ReplayBubble.d.ts.map +1 -0
  131. package/dist/ui/ReplayBubble.js +65 -0
  132. package/dist/ui/ReplayBubble.js.map +1 -0
  133. package/dist/ui.d.ts +27 -0
  134. package/dist/ui.d.ts.map +1 -0
  135. package/dist/ui.js +34 -0
  136. package/dist/ui.js.map +1 -0
  137. package/package.json +36 -5
  138. package/ui/package.json +6 -0
@@ -0,0 +1,504 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useReplayPage = useReplayPage;
4
+ /**
5
+ * The Replay screen's page model (0.14.0, moved from amore-v2's `src/core/hooks/useReplayPage.ts`: old
6
+ * Amore's Replay, rebuilt). The routes are the app's (`LiveSellingProvider`'s `routes`); the route's
7
+ * `feedId` and `streamId` params are read here, and `feedId` is set as the shopper swipes.
8
+ */
9
+ const sdk_shopify_1 = require("@tiledev/sdk-shopify");
10
+ const react_1 = require("react");
11
+ const react_native_1 = require("react-native");
12
+ const liveSelling_1 = require("../liveSelling");
13
+ const livePages_1 = require("../livePages");
14
+ const pageOptions_1 = require("../pageOptions");
15
+ const showCredit_1 = require("../showCredit");
16
+ const LiveSellingProvider_1 = require("./LiveSellingProvider");
17
+ const platformSession_1 = require("./platformSession");
18
+ const replayPlayer_1 = require("./replayPlayer");
19
+ const useLiveShop_1 = require("./useLiveShop");
20
+ const useReplays_1 = require("./useReplays");
21
+ const navigation_1 = require("./navigation");
22
+ /** Recordings per read: the gateway's own page size, as the Live tab. */
23
+ const PAGE_SIZE = 20;
24
+ /** How often the playhead is read. Product windows are seconds wide, so this is plenty. */
25
+ const POSITION_CHECK_MS = 500;
26
+ /** A seek has landed once the player reports within this of it (it plays on while it seeks). */
27
+ const SEEK_LANDED_WITHIN_MS = 600;
28
+ /** Checks a seek is held for before the player is believed anyway (about 3 s): one that never lands mustn't freeze the bar. */
29
+ const SEEK_GIVE_UP_CHECKS = 6;
30
+ /** The playback controls fade this long after they last showed or were touched. */
31
+ const CONTROLS_SHOW_MS = 4000;
32
+ /**
33
+ * Everything the Replay screen wires, so the screen stays plain tiles. Call it from the Replay screen
34
+ * and from each of its tiles' wiring.
35
+ *
36
+ * - **A feed over the archive.** The route names where the shopper comes in (`feedId` from a card,
37
+ * `streamId` from a push or link); `useReplays` (playable recordings, 20 a read) is paged until that
38
+ * recording turns up. A swipe moves along the archive, and the next page is read when the shopper
39
+ * reaches the last one or two read so far. Hidden shows a shopper can't see are left out
40
+ * (`hiddenShows`), as on the Live tab: one opened by its id reads the archive to its end, then "This
41
+ * show has ended".
42
+ * - **One player** (expo-video) for the whole app, borrowed from `ReplayPlayerProvider`, which owns it
43
+ * above the navigator so it outlives this screen: a new recording replaces the source, one source per
44
+ * recording, and its poster covers the picture until the video has a frame. It plays while the screen
45
+ * is on show, or only covered by a sheet (`routes.sheets`: the variant page), or in the bubble, and
46
+ * pauses under anything else.
47
+ * - **Picture-in-picture, in the app** (decided 2026-10-05, amore-v2's Head of Engineering): the
48
+ * header's picture-in-picture button shrinks the show into a floating bubble over the app and goes
49
+ * back (Home when there's nothing to go back to: `routes.openHome`); its cart button shrinks it the
50
+ * same way and opens the Cart (`routes.openCart`). Arriving on this screen ends the bubble, and the
51
+ * screen shows the video where the bubble had it; ✕ stops the show, with no bubble. Opening another
52
+ * recording replaces the bubble's. No system picture-in-picture. One shrunk show at a time: arriving
53
+ * here stops a live show's bubble, as the Live screen stops this one's.
54
+ * - **The playhead** is read twice a second. A seek is held until the player reports arriving there,
55
+ * so the bar never jumps back to where it was.
56
+ * - **The product on screen** is the one whose time window covers the playhead
57
+ * (`liveSelling.replays.segments`, `productOnScreen`); before the first window, the first tagged
58
+ * product. Picking a product in the shop sheet goes to where the host first showed it, playing, then
59
+ * opens the variant page (`routes.openVariantPage`); a product the host never showed (tagged, no time
60
+ * window) leaves the player untouched, where it was and playing or paused, and only opens the variant
61
+ * page. Every add from there is credited to the recording (`replayShowCredit`): `_replay_id` on the
62
+ * line, `replayAddToCart` (`track`), and the cart's `_apptile_attribution` count against the show's
63
+ * `streamingId`, never the replay's feed id. Products are read at sdk-shopify's `CARD_IMAGE`.
64
+ * - **The chat** is the show's comments file (`liveSelling.replays.comments`), revealed up to the
65
+ * playhead, the newest 60 (`replayCommentsAt`).
66
+ * - **A view** is counted once per recording per visit (not on the web, where the Tile preview would
67
+ * count on the merchant's real counter); a show back from the bubble isn't a new view.
68
+ * - **A read that fails** (the products, the time windows, the chat) goes to `onWarning`; a failed
69
+ * products or windows read is tried again when the shopper comes back to the recording.
70
+ */
71
+ function useReplayPage() {
72
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
73
+ const nav = (0, navigation_1.useNavigation)();
74
+ const route = (0, navigation_1.useRoute)();
75
+ const linkedId = (_d = (_b = (_a = route.params) === null || _a === void 0 ? void 0 : _a.feedId) !== null && _b !== void 0 ? _b : (_c = route.params) === null || _c === void 0 ? void 0 : _c.streamId) !== null && _d !== void 0 ? _d : '';
76
+ const { ready } = (0, LiveSellingProvider_1.useLiveSelling)();
77
+ const { routes, track } = (0, LiveSellingProvider_1.useLivePageOptions)();
78
+ const wishlist = (0, sdk_shopify_1.useWishlist)();
79
+ // `firstReadDone`: the first read has finished; until then an empty archive is still being read.
80
+ const archive = (0, useReplays_1.useReplays)({ pageSize: PAGE_SIZE, playableOnly: true });
81
+ const { loadMore, hasMore, hasRead: firstReadDone, loading: reading, error: readFailed } = archive;
82
+ // The recordings this shopper may see: hidden shows they can't see are left out.
83
+ const shows = archive.replays;
84
+ const { itemCount } = (0, sdk_shopify_1.useCart)();
85
+ // The app's one replay player: borrowed, as it outlives this screen for the bubble.
86
+ const replayPlayer = (0, replayPlayer_1.useReplayPlayer)();
87
+ const { player, bubbleShown, muted, openRecording, holdsVideo, stop, showBubble, hideBubble, setPausedByShopper, markVideoReady, setScreenShowing, screenClosed, } = replayPlayer;
88
+ // ─── Which recording ───────────────────────────────────────────────────────────────────────────
89
+ // State, seeded from the route: a swipe moves on without a navigation, and a new link moves it again.
90
+ const [currentId, setCurrentId] = (0, react_1.useState)(linkedId);
91
+ (0, react_1.useEffect)(() => setCurrentId(linkedId), [linkedId]);
92
+ const index = currentId ? shows.findIndex((replay) => (0, livePages_1.isTheShow)(replay, currentId)) : -1;
93
+ // A recording back from the bubble shows at once: the player holds it, and a new screen reads the
94
+ // archive from the start, so it would otherwise wait for that read to find it again.
95
+ const heldRecording = replayPlayer.recording;
96
+ const show = index >= 0 ? shows[index] : heldRecording && currentId && (0, livePages_1.isTheShow)(heldRecording, currentId) ? heldRecording : null;
97
+ const previousShow = index > 0 ? shows[index - 1] : null;
98
+ const nextShow = index >= 0 ? ((_e = shows[index + 1]) !== null && _e !== void 0 ? _e : null) : null;
99
+ // Read on until the recording turns up. One read at a time: `useReplays` ignores a second.
100
+ const readSoFar = !!currentId && archive.replays.some((replay) => (0, livePages_1.isTheShow)(replay, currentId));
101
+ const searching = !!currentId && !readSoFar && hasMore && !readFailed;
102
+ (0, react_1.useEffect)(() => {
103
+ if (ready && firstReadDone && searching && !reading)
104
+ void loadMore();
105
+ }, [ready, firstReadDone, searching, reading, loadMore]);
106
+ // The next page before the shopper reaches the end, so the swipe after the last one lands.
107
+ const nearTheEnd = index >= 0 && index >= shows.length - 2;
108
+ (0, react_1.useEffect)(() => {
109
+ if (nearTheEnd && hasMore && !reading && !readFailed)
110
+ void loadMore();
111
+ }, [nearTheEnd, hasMore, reading, readFailed, loadMore]);
112
+ // Not in the archive (or a hidden show this shopper can't see), or the archive couldn't be read.
113
+ const missing = !currentId || (firstReadDone && !show && !searching && !reading);
114
+ const goTo = (0, react_1.useCallback)((target) => {
115
+ if (!target)
116
+ return;
117
+ setCurrentId(target.id);
118
+ // The route follows, so a reload or a later link starts from the show being watched.
119
+ nav.setParams({ feedId: target.id, streamId: undefined });
120
+ }, [nav]);
121
+ // ─── The player ────────────────────────────────────────────────────────────────────────────────
122
+ const isFocused = (0, navigation_1.useIsFocused)();
123
+ const coveredOnlyBySheet = (0, navigation_1.useNavigationState)((state) => (0, livePages_1.isCoveredOnlyBySheet)(state, route.key, routes.sheets));
124
+ const onScreen = isFocused || coveredOnlyBySheet;
125
+ const videoUrl = (_f = show === null || show === void 0 ? void 0 : show.videoUrl) !== null && _f !== void 0 ? _f : null;
126
+ /** The player holds this screen's recording. It may hold another (the bubble's, until this screen takes over) or none. */
127
+ const holdsThisShow = !!videoUrl && replayPlayer.videoUrl === videoUrl;
128
+ const playing = holdsThisShow && replayPlayer.playing;
129
+ const status = holdsThisShow ? replayPlayer.status : 'loading';
130
+ const videoReady = holdsThisShow && replayPlayer.videoReady;
131
+ // Back from the bubble, the player is already somewhere in the recording: start from there.
132
+ const [positionMs, setPositionMs] = (0, react_1.useState)(() => (holdsThisShow ? (0, livePages_1.playerMs)(player.currentTime) : 0));
133
+ /** While the shopper drags the bar: the product card and chat follow the finger, not the playhead. */
134
+ const [scrubMs, setScrubMs] = (0, react_1.useState)(null);
135
+ const [durationMs, setDurationMs] = (0, react_1.useState)(() => (holdsThisShow ? (0, livePages_1.playerMs)(player.duration) : 0));
136
+ /** A seek asked for and not yet reported back: the player keeps saying the old time until it lands. */
137
+ const pendingSeek = (0, react_1.useRef)(null);
138
+ const latest = (0, react_1.useRef)({ durationMs, holdsThisShow });
139
+ latest.current = { durationMs, holdsThisShow };
140
+ /** ✕ was pressed: the show has stopped, and the screen slides away on its poster. */
141
+ const [closing, setClosing] = (0, react_1.useState)(false);
142
+ // On show here, this screen's recording goes into the player, from the start, unless the player
143
+ // already holds it (back from the bubble, it plays on where it was). Not while the bubble is still
144
+ // up: arriving closes it first (below), so its view never loads another recording. Not once ✕ has
145
+ // stopped it, while the screen is still on show for its way out. The player is asked at the moment
146
+ // this runs (`holdsVideo`).
147
+ const showToOpen = (0, react_1.useRef)(show);
148
+ showToOpen.current = show;
149
+ (0, react_1.useEffect)(() => {
150
+ const target = showToOpen.current;
151
+ if (closing || !onScreen || bubbleShown || !videoUrl || !target || holdsVideo(videoUrl))
152
+ return;
153
+ setPositionMs(0);
154
+ setScrubMs(null);
155
+ setDurationMs(0);
156
+ // Held at 0 until the player stops reporting the last recording's time.
157
+ pendingSeek.current = { targetMs: 0, checks: 0 };
158
+ openRecording(target);
159
+ }, [closing, onScreen, bubbleShown, videoUrl, holdsVideo, openRecording]);
160
+ // Arriving here ends the bubble, however the shopper came (its tap, a link, back from the cart): the
161
+ // screen shows the video again. A screen ✕ couldn't take away (nothing behind it, so Home opened
162
+ // over it) plays again if the shopper comes back to it.
163
+ (0, react_1.useEffect)(() => {
164
+ if (!isFocused)
165
+ return;
166
+ hideBubble();
167
+ setClosing(false);
168
+ }, [isFocused, hideBubble]);
169
+ // One shrunk show at a time: a live show left in its bubble stops, and its pin goes with it.
170
+ const { pipMode: livePipMode, actions: liveActions } = (0, platformSession_1.useLiveSession)();
171
+ const { exitPip: closeLiveBubble, releaseStream: releaseLiveShow } = liveActions;
172
+ (0, react_1.useEffect)(() => {
173
+ if (!isFocused || livePipMode !== 'inapp')
174
+ return;
175
+ closeLiveBubble({ stopVideo: true });
176
+ releaseLiveShow();
177
+ }, [isFocused, livePipMode, closeLiveBubble, releaseLiveShow]);
178
+ // The player plays only while something shows it: this screen says when it does. Closing it stops
179
+ // the video, unless the bubble took it.
180
+ const screenKey = route.key;
181
+ const showingHere = onScreen && holdsThisShow;
182
+ (0, react_1.useEffect)(() => {
183
+ setScreenShowing(screenKey, showingHere);
184
+ }, [screenKey, showingHere, setScreenShowing]);
185
+ (0, react_1.useEffect)(() => () => screenClosed(screenKey), [screenKey, screenClosed]);
186
+ // The playhead, read rather than subscribed: product windows only need to land within half a second.
187
+ (0, react_1.useEffect)(() => {
188
+ const timer = setInterval(() => {
189
+ // Another recording's time (the player holds the bubble's, or nothing) isn't this one's.
190
+ if (!latest.current.holdsThisShow)
191
+ return;
192
+ try {
193
+ const reportedMs = (player.currentTime || 0) * 1000;
194
+ const pending = pendingSeek.current;
195
+ if (!pending)
196
+ setPositionMs(reportedMs);
197
+ else if (Math.abs(reportedMs - pending.targetMs) <= SEEK_LANDED_WITHIN_MS || pending.checks + 1 >= SEEK_GIVE_UP_CHECKS) {
198
+ pendingSeek.current = null;
199
+ setPositionMs(reportedMs);
200
+ }
201
+ else
202
+ pendingSeek.current = { targetMs: pending.targetMs, checks: pending.checks + 1 };
203
+ // A length that arrives late, or that the playlist revises.
204
+ const lengthSeconds = player.duration;
205
+ if (Number.isFinite(lengthSeconds) && lengthSeconds > 0)
206
+ setDurationMs(lengthSeconds * 1000);
207
+ }
208
+ catch {
209
+ // The player was released under the timer (the app is closing).
210
+ }
211
+ }, POSITION_CHECK_MS);
212
+ return () => clearInterval(timer);
213
+ }, [player]);
214
+ const seekTo = (0, react_1.useCallback)((targetMs) => {
215
+ if (!latest.current.holdsThisShow)
216
+ return;
217
+ const length = latest.current.durationMs;
218
+ const target = Math.max(0, length > 0 ? Math.min(targetMs, length) : targetMs);
219
+ pendingSeek.current = { targetMs: target, checks: 0 };
220
+ try {
221
+ player.currentTime = target / 1000;
222
+ }
223
+ catch {
224
+ pendingSeek.current = null;
225
+ return;
226
+ }
227
+ setPositionMs(target);
228
+ setScrubMs(null);
229
+ }, [player]);
230
+ const shownPositionMs = scrubMs !== null && scrubMs !== void 0 ? scrubMs : positionMs;
231
+ // ─── The controls: up for 4 s after they show or are touched; a tap on the video shows or hides them ───
232
+ const [controlsVisible, setControlsVisible] = (0, react_1.useState)(true);
233
+ const [controlsTouches, setControlsTouches] = (0, react_1.useState)(0);
234
+ const showControls = (0, react_1.useCallback)(() => {
235
+ setControlsVisible(true);
236
+ setControlsTouches((count) => count + 1);
237
+ }, []);
238
+ const toggleControls = (0, react_1.useCallback)(() => {
239
+ setControlsVisible((visible) => !visible);
240
+ setControlsTouches((count) => count + 1);
241
+ }, []);
242
+ (0, react_1.useEffect)(() => {
243
+ if (!controlsVisible)
244
+ return;
245
+ const timer = setTimeout(() => setControlsVisible(false), CONTROLS_SHOW_MS);
246
+ return () => clearTimeout(timer);
247
+ }, [controlsVisible, controlsTouches]);
248
+ // ─── What the show sells, and its chat ─────────────────────────────────────────────────────────
249
+ const shoppingRead = (0, react_1.useRef)(new Map());
250
+ const [shopping, setShopping] = (0, react_1.useState)({ showId: '', products: [], segments: [] });
251
+ const showId = (_g = show === null || show === void 0 ? void 0 : show.id) !== null && _g !== void 0 ? _g : null;
252
+ const productIds = show === null || show === void 0 ? void 0 : show.productIds;
253
+ (0, react_1.useEffect)(() => {
254
+ if (!showId)
255
+ return;
256
+ const kept = shoppingRead.current.get(showId);
257
+ if (kept) {
258
+ setShopping({ showId, ...kept });
259
+ return;
260
+ }
261
+ let stillThisShow = true;
262
+ let everythingRead = true;
263
+ const failed = (at) => (error) => {
264
+ everythingRead = false;
265
+ (0, pageOptions_1.reportLiveWarning)(error, { at, feedId: showId });
266
+ return [];
267
+ };
268
+ void Promise.all([
269
+ (productIds === null || productIds === void 0 ? void 0 : productIds.length) ? sdk_shopify_1.shopify.products.byIds(productIds, { imageTransform: sdk_shopify_1.CARD_IMAGE }).catch(failed('replay.products')) : Promise.resolve([]),
270
+ liveSelling_1.liveSelling.replays.segments(showId).catch(failed('replay.segments')),
271
+ ]).then(([products, segments]) => {
272
+ const read = { products, segments };
273
+ // Kept for the visit only when it all came back: a failed read is tried again when the shopper returns.
274
+ if (everythingRead)
275
+ shoppingRead.current.set(showId, read);
276
+ if (stillThisShow)
277
+ setShopping({ showId, ...read });
278
+ });
279
+ return () => {
280
+ stillThisShow = false;
281
+ };
282
+ }, [showId, productIds]);
283
+ const products = shopping.showId === showId ? shopping.products : [];
284
+ const segments = shopping.showId === showId ? shopping.segments : [];
285
+ const onScreenProduct = (0, react_1.useMemo)(() => (0, livePages_1.productOnScreen)(segments, products, shownPositionMs), [segments, products, shownPositionMs]);
286
+ const firstShownAt = (0, react_1.useCallback)((productId) => (0, livePages_1.firstShownAt)(segments, productId), [segments]);
287
+ const chatRead = (0, react_1.useRef)(new Map());
288
+ const [chat, setChat] = (0, react_1.useState)({ streamingId: '', comments: [] });
289
+ const streamingId = (_h = show === null || show === void 0 ? void 0 : show.streamingId) !== null && _h !== void 0 ? _h : null;
290
+ (0, react_1.useEffect)(() => {
291
+ if (!streamingId)
292
+ return;
293
+ const kept = chatRead.current.get(streamingId);
294
+ if (kept) {
295
+ setChat({ streamingId, comments: kept });
296
+ return;
297
+ }
298
+ let stillThisShow = true;
299
+ liveSelling_1.liveSelling.replays
300
+ .comments(streamingId)
301
+ .then((comments) => {
302
+ chatRead.current.set(streamingId, comments);
303
+ if (stillThisShow)
304
+ setChat({ streamingId, comments });
305
+ })
306
+ .catch((error) => (0, pageOptions_1.reportLiveWarning)(error, { at: 'replay.comments', streamingId }));
307
+ return () => {
308
+ stillThisShow = false;
309
+ };
310
+ }, [streamingId]);
311
+ const allComments = chat.streamingId === streamingId ? chat.comments : [];
312
+ const saidSoFar = (0, react_1.useMemo)(() => (0, livePages_1.replayCommentsAt)(allComments, shownPositionMs), [allComments, shownPositionMs]);
313
+ const [chatHidden, setChatHidden] = (0, react_1.useState)(false);
314
+ // A swipe is a new show: its own controls showing, its chat out.
315
+ (0, react_1.useEffect)(() => {
316
+ setChatHidden(false);
317
+ showControls();
318
+ }, [showId, showControls]);
319
+ // ─── A view, once per recording per visit; never from the web preview ─────────────────────────
320
+ // A recording back from the bubble was counted when it was opened: a round trip isn't a new view
321
+ // (production's new Replay screen on every return counted another, amore-v2's audit L4).
322
+ const counted = (0, react_1.useRef)(null);
323
+ if (!counted.current)
324
+ counted.current = new Set(holdsThisShow && show ? [show.id] : []);
325
+ (0, react_1.useEffect)(() => {
326
+ const seen = counted.current;
327
+ if (!showId || react_native_1.Platform.OS === 'web' || !seen || seen.has(showId))
328
+ return;
329
+ seen.add(showId);
330
+ void liveSelling_1.liveSelling.replays.incrementViews(showId);
331
+ }, [showId]);
332
+ // ─── Buying: every add from this screen is credited to the recording ──────────────────────────
333
+ const credit = (0, react_1.useMemo)(() => (0, showCredit_1.replayShowCredit)(showId, streamingId), [showId, streamingId]);
334
+ const quickAdd = (0, sdk_shopify_1.useQuickAdd)((0, showCredit_1.showQuickAddOptions)((params) => routes.openVariantPage(params, nav), { credit, track }));
335
+ const openVariantPage = (0, react_1.useCallback)((product) => {
336
+ if (!credit.lineAttributes)
337
+ return;
338
+ routes.openVariantPage({ handle: product.handle, ...credit }, nav);
339
+ }, [routes, nav, credit]);
340
+ const pickFromSheet = (0, react_1.useCallback)((product) => {
341
+ // Shown in the recording: to where the host first showed it, playing, so the pitch goes on behind
342
+ // the variant page. Never shown (no time window): the player is left exactly as it was, where it
343
+ // was and playing or paused; only the variant page opens (2026-10-05, Head of Engineering).
344
+ const startMs = firstShownAt(product.id);
345
+ if (startMs != null) {
346
+ seekTo(startMs);
347
+ setPausedByShopper(false);
348
+ }
349
+ openVariantPage(product);
350
+ }, [firstShownAt, seekTo, setPausedByShopper, openVariantPage]);
351
+ const nowProduct = (0, react_1.useMemo)(() => {
352
+ var _a, _b, _c, _d;
353
+ return onScreenProduct
354
+ ? {
355
+ id: onScreenProduct.id,
356
+ title: onScreenProduct.title,
357
+ price: (0, sdk_shopify_1.formatMoney)(onScreenProduct.priceRange.min),
358
+ imageUrl: (_d = (_b = (_a = onScreenProduct.featuredImage) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : (_c = onScreenProduct.images[0]) === null || _c === void 0 ? void 0 : _c.url) !== null && _d !== void 0 ? _d : null,
359
+ }
360
+ : null;
361
+ }, [onScreenProduct]);
362
+ const auctionProductIds = (0, react_1.useMemo)(() => products.filter(sdk_shopify_1.isAuctioned).map((product) => product.id), [products]);
363
+ const poster = (replay) => (replay ? { id: replay.id, posterUrl: replay.thumbnailUrl } : null);
364
+ const leave = (0, react_1.useCallback)(() => {
365
+ if (nav.canGoBack())
366
+ nav.goBack();
367
+ else
368
+ routes.openHome(nav);
369
+ }, [nav, routes]);
370
+ // ✕: the show stops, with no bubble.
371
+ const close = (0, react_1.useCallback)(() => {
372
+ setClosing(true);
373
+ stop();
374
+ leave();
375
+ }, [stop, leave]);
376
+ // Picture-in-picture: the show shrinks into the bubble, and the shopper goes back.
377
+ const shrinkIntoBubble = (0, react_1.useCallback)(() => {
378
+ if (holdsVideo(videoUrl))
379
+ showBubble();
380
+ leave();
381
+ }, [holdsVideo, videoUrl, showBubble, leave]);
382
+ // The cart opens under the bubble, so the show plays on over it, as production's; coming back here ends the bubble.
383
+ const openCart = (0, react_1.useCallback)(() => {
384
+ if (holdsVideo(videoUrl))
385
+ showBubble();
386
+ routes.openCart({ itemsYouWon: false }, nav);
387
+ }, [holdsVideo, videoUrl, showBubble, routes, nav]);
388
+ const playerShown = !missing;
389
+ const showing = !!show;
390
+ return {
391
+ /** The video is on screen: light status bar text over it. */
392
+ darkBehindStatusBar: playerShown && onScreen,
393
+ player: {
394
+ visible: playerShown,
395
+ show: poster(show),
396
+ previousShow: poster(previousShow),
397
+ nextShow: poster(nextShow),
398
+ // Drawn only once the player holds this recording, a new view per recording: on web a view still
399
+ // showing the last one would load the new one twice (from `replace`, then from React setting its
400
+ // `src`), and the second load aborts the first's `play()` (an unhandled `AbortError` inside
401
+ // expo-video's web player). And one view at a time: while the bubble has the video, none here.
402
+ player: holdsThisShow && !bubbleShown ? player : null,
403
+ // The poster stands in for the picture while the bubble has it (the screen sliding away, or under the cart).
404
+ videoReady: videoReady && !bubbleShown,
405
+ buffering: !closing && !!videoUrl && status !== 'error' && (status === 'loading' || !videoReady),
406
+ onVideoFirstFrame: () => {
407
+ if (holdsThisShow)
408
+ markVideoReady();
409
+ },
410
+ onTapVideo: toggleControls,
411
+ onSwipeToNext: () => goTo(nextShow),
412
+ onSwipeToPrevious: () => goTo(previousShow),
413
+ },
414
+ header: {
415
+ title: (_j = show === null || show === void 0 ? void 0 : show.title) !== null && _j !== void 0 ? _j : null,
416
+ muted,
417
+ canMute: showing,
418
+ // Something to shrink: the player holds this recording.
419
+ canPip: holdsThisShow,
420
+ cartCount: itemCount,
421
+ onClose: close,
422
+ onToggleMute: () => {
423
+ replayPlayer.setMuted(!muted);
424
+ showControls();
425
+ },
426
+ onPip: shrinkIntoBubble,
427
+ onCart: openCart,
428
+ },
429
+ controls: {
430
+ visible: showing && controlsVisible,
431
+ positionMs: shownPositionMs,
432
+ durationMs,
433
+ playing,
434
+ onScrub: (atMs) => {
435
+ setScrubMs(atMs);
436
+ showControls();
437
+ },
438
+ onSeek: (atMs) => {
439
+ seekTo(atMs);
440
+ showControls();
441
+ },
442
+ onSkip: (changeMs) => {
443
+ var _a, _b;
444
+ // From the time last asked for, so tapping +10 twice adds up while the first is still seeking.
445
+ seekTo(((_b = (_a = pendingSeek.current) === null || _a === void 0 ? void 0 : _a.targetMs) !== null && _b !== void 0 ? _b : shownPositionMs) + changeMs);
446
+ showControls();
447
+ },
448
+ onTogglePlay: () => {
449
+ showControls();
450
+ if (!holdsThisShow)
451
+ return;
452
+ if (playing) {
453
+ setPausedByShopper(true);
454
+ return;
455
+ }
456
+ setPausedByShopper(false);
457
+ // At the end of the recording, play means from the start.
458
+ if (durationMs > 0 && shownPositionMs >= durationMs - 1000)
459
+ seekTo(0);
460
+ player.play();
461
+ },
462
+ },
463
+ nowCard: {
464
+ visible: showing,
465
+ product: nowProduct,
466
+ favorite: !!onScreenProduct && wishlist.has(onScreenProduct.id),
467
+ onOpen: () => {
468
+ if (onScreenProduct)
469
+ openVariantPage(onScreenProduct);
470
+ },
471
+ onToggleFavorite: () => {
472
+ if (onScreenProduct)
473
+ void wishlist.toggle(onScreenProduct);
474
+ },
475
+ onShare: () => {
476
+ if (onScreenProduct)
477
+ void (0, useLiveShop_1.shareProduct)(onScreenProduct);
478
+ },
479
+ },
480
+ comments: {
481
+ visible: showing,
482
+ comments: saidSoFar,
483
+ hasChat: allComments.length > 0,
484
+ hidden: chatHidden,
485
+ onToggleHidden: () => setChatHidden((wasHidden) => !wasHidden),
486
+ },
487
+ shopBar: {
488
+ visible: showing,
489
+ products,
490
+ onScreenProductId: (_k = onScreenProduct === null || onScreenProduct === void 0 ? void 0 : onScreenProduct.id) !== null && _k !== void 0 ? _k : null,
491
+ favoriteIds: wishlist.ids,
492
+ auctionProductIds,
493
+ onPressProduct: pickFromSheet,
494
+ onToggleFavorite: (product) => void wishlist.toggle(product),
495
+ onQuickAdd: quickAdd.add,
496
+ addingProductIds: quickAdd.addingProductIds,
497
+ },
498
+ missing: {
499
+ visible: missing,
500
+ onAction: () => routes.openHome(nav),
501
+ },
502
+ };
503
+ }
504
+ //# sourceMappingURL=useReplayPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useReplayPage.js","sourceRoot":"","sources":["../../src/react/useReplayPage.ts"],"names":[],"mappings":";;AAkGA,sCA8bC;AAhiBD;;;;GAIG;AACH,sDAS8B;AAE9B,iCAA0E;AAC1E,+CAAwC;AAExC,gDAA6C;AAC7C,4CAA4I;AAC5I,gDAAmD;AAEnD,8CAAsE;AAEtE,+DAA2E;AAC3E,uDAAmD;AACnD,iDAAiD;AACjD,+CAA6C;AAC7C,6CAA0C;AAC1C,6CAQsB;AAEtB,yEAAyE;AACzE,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,2FAA2F;AAC3F,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,gGAAgG;AAChG,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,+HAA+H;AAC/H,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,mFAAmF;AACnF,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAU9B;;;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,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;YACrE,UAAU,EAAE,QAAQ,CAAC,GAAG;YACxB,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;SAC5C;QACD,OAAO,EAAE;YACP,OAAO,EAAE,OAAO;YAChB,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;SACrC;KACF,CAAC;AACJ,CAAC"}
@@ -343,13 +343,17 @@ export interface IdentityAdapter {
343
343
  bidderId?: () => string | null;
344
344
  /** Full customer identifier, when the giveaway endpoint wants one (Shopify: the GID). */
345
345
  customerRef?: () => string | null;
346
- /** The customer's own display name, so a signed-in bidder is never asked to invent one. */
346
+ /**
347
+ * The customer's own display name; null when their account has none. Never an email nor any part of
348
+ * it: the room shows it to everyone (`viewerNameFor`).
349
+ */
347
350
  customerName?: () => string | null;
348
351
  customerEmail?: () => string | null;
349
352
  /**
350
- * True while the app is still reading the signed-in customer on app open, so who they are (and
351
- * their name) isn't known yet. The session waits for it before entering a show's room, up to
352
- * 10 seconds (0.9.2): the name a viewer enters under is the one the host sees join.
353
+ * True while the app is still reading the signed-in customer (on app open, or just after a sign-in),
354
+ * so who they are (and their name) isn't known yet. The session waits for it before entering a
355
+ * show's room, up to 10 seconds (0.9.2): the name a viewer enters under is the one the host sees
356
+ * join. A comment sent meanwhile is held until it is known (0.13.0). Without it, nothing waits.
353
357
  */
354
358
  customerLoading?: () => boolean;
355
359
  }
@@ -417,7 +421,8 @@ export interface LiveSessionState<TRaw = unknown> {
417
421
  /**
418
422
  * What this device comments under: the identity adapter's name, or one a signed-out shopper gave.
419
423
  * **Null means nobody has said** — ask before letting the first comment out rather than publishing
420
- * "Anonymous" to a room.
424
+ * "Anonymous" to a room. Never a name the show's team goes by (`blockedNames`, 0.13.0): one of those
425
+ * counts as no name.
421
426
  */
422
427
  viewerName: string | null;
423
428
  /** Inert unless the stream is an auction. */
@@ -440,8 +445,10 @@ export interface LiveSessionActions {
440
445
  /**
441
446
  * `forceMuted` shadow-mutes this comment: the room never sees it, the sender does.
442
447
  *
443
- * For a signed-in shopper whose name has not loaded yet, the comment is held and sent the moment it
444
- * does (or after 10 s), and the promise resolves then — so it never goes out as "Anonymous" (L6).
448
+ * For a signed-in shopper whose account is still loading (`identity.customerLoading`), the comment
449
+ * is held and sent the moment it has loaded (or after 10 s), and the promise resolves then — so it
450
+ * never goes out under a name that is about to change (L6). An account with no name on it is not
451
+ * waited for (0.13.0): ask the shopper for a name before sending (`viewerName` null).
445
452
  */
446
453
  sendComment: (text: string, options?: SendCommentOptions) => Promise<void>;
447
454
  sendReaction: (reactionUrl: string) => Promise<void>;
@@ -450,8 +457,9 @@ export interface LiveSessionActions {
450
457
  voteInPoll: (optionId: string) => Promise<void>;
451
458
  /**
452
459
  * Remember the name a signed-out shopper typed. Resolves to the name as stored — trimmed,
453
- * collapsed, capped — or null if the input was empty, so the caller can send the comment that
454
- * prompted for it without normalising again.
460
+ * collapsed, capped — or null if the input was empty or is a name the show's team goes by
461
+ * (`blockedNames`, 0.13.0: check it first with `isBlockedViewerName` to say why), so the caller can
462
+ * send the comment that prompted for it without normalising again.
455
463
  */
456
464
  chooseViewerName: (raw: string) => Promise<string | null>;
457
465
  /** Add to cart through the commerce adapter and tell the room. False when the line was refused. */