@tiledev/sdk-apptile-live-selling 0.15.3 → 0.16.0-beta.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.
- package/README.md +44 -5
- package/dist/checkoutRefused.d.ts +9 -0
- package/dist/checkoutRefused.d.ts.map +1 -0
- package/dist/checkoutRefused.js +16 -0
- package/dist/checkoutRefused.js.map +1 -0
- package/dist/clips.d.ts +4 -2
- package/dist/clips.d.ts.map +1 -1
- package/dist/clips.js +76 -15
- package/dist/clips.js.map +1 -1
- package/dist/giveawayPrizes.d.ts +20 -0
- package/dist/giveawayPrizes.d.ts.map +1 -0
- package/dist/giveawayPrizes.js +50 -0
- package/dist/giveawayPrizes.js.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/dist/livePages.d.ts +11 -1
- package/dist/livePages.d.ts.map +1 -1
- package/dist/livePages.js +29 -0
- package/dist/livePages.js.map +1 -1
- package/dist/pageOptions.d.ts +16 -0
- package/dist/pageOptions.d.ts.map +1 -1
- package/dist/pageOptions.js +4 -1
- package/dist/pageOptions.js.map +1 -1
- package/dist/pageTypes.d.ts +1 -1
- package/dist/pageTypes.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.d.ts +8 -2
- package/dist/react/LiveSellingProvider.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.js +10 -2
- package/dist/react/LiveSellingProvider.js.map +1 -1
- package/dist/react/index.d.ts +7 -6
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +7 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.web.d.ts +6 -5
- package/dist/react/index.web.d.ts.map +1 -1
- package/dist/react/index.web.js +6 -2
- package/dist/react/index.web.js.map +1 -1
- package/dist/react/replayPlayer.d.ts +2 -0
- package/dist/react/replayPlayer.d.ts.map +1 -1
- package/dist/react/replayPlayer.js +11 -1
- package/dist/react/replayPlayer.js.map +1 -1
- package/dist/react/share.d.ts +22 -0
- package/dist/react/share.d.ts.map +1 -0
- package/dist/react/share.js +45 -0
- package/dist/react/share.js.map +1 -0
- package/dist/react/shopifyProviders.d.ts +10 -5
- package/dist/react/shopifyProviders.d.ts.map +1 -1
- package/dist/react/shopifyProviders.js +14 -4
- package/dist/react/shopifyProviders.js.map +1 -1
- package/dist/react/showPages.d.ts.map +1 -1
- package/dist/react/showPages.js +4 -2
- package/dist/react/showPages.js.map +1 -1
- package/dist/react/useAuctionBidGate.d.ts +8 -2
- package/dist/react/useAuctionBidGate.d.ts.map +1 -1
- package/dist/react/useAuctionBidGate.js +59 -2
- package/dist/react/useAuctionBidGate.js.map +1 -1
- package/dist/react/useAuctionWins.d.ts +5 -3
- package/dist/react/useAuctionWins.d.ts.map +1 -1
- package/dist/react/useAuctionWins.js +7 -2
- package/dist/react/useAuctionWins.js.map +1 -1
- package/dist/react/useClips.d.ts +7 -1
- package/dist/react/useClips.d.ts.map +1 -1
- package/dist/react/useClips.js +20 -7
- package/dist/react/useClips.js.map +1 -1
- package/dist/react/useFeaturedClip.d.ts +5 -1
- package/dist/react/useFeaturedClip.d.ts.map +1 -1
- package/dist/react/useFeaturedClip.js +6 -4
- package/dist/react/useFeaturedClip.js.map +1 -1
- package/dist/react/useGiveawayPrizes.d.ts +4 -0
- package/dist/react/useGiveawayPrizes.d.ts.map +1 -0
- package/dist/react/useGiveawayPrizes.js +58 -0
- package/dist/react/useGiveawayPrizes.js.map +1 -0
- package/dist/react/useLiveAuction.d.ts.map +1 -1
- package/dist/react/useLiveAuction.js +9 -5
- package/dist/react/useLiveAuction.js.map +1 -1
- package/dist/react/useLiveChat.d.ts +6 -1
- package/dist/react/useLiveChat.d.ts.map +1 -1
- package/dist/react/useLiveChat.js +31 -9
- package/dist/react/useLiveChat.js.map +1 -1
- package/dist/react/useLivePage.d.ts +12 -6
- package/dist/react/useLivePage.d.ts.map +1 -1
- package/dist/react/useLivePage.js +33 -18
- package/dist/react/useLivePage.js.map +1 -1
- package/dist/react/useLiveShop.d.ts +1 -8
- package/dist/react/useLiveShop.d.ts.map +1 -1
- package/dist/react/useLiveShop.js +8 -24
- package/dist/react/useLiveShop.js.map +1 -1
- package/dist/react/useReplayPage.d.ts +22 -3
- package/dist/react/useReplayPage.d.ts.map +1 -1
- package/dist/react/useReplayPage.js +102 -97
- package/dist/react/useReplayPage.js.map +1 -1
- package/dist/react/useSilentAuctionLot.d.ts +2 -0
- package/dist/react/useSilentAuctionLot.d.ts.map +1 -1
- package/dist/react/useSilentAuctionLot.js +17 -1
- package/dist/react/useSilentAuctionLot.js.map +1 -1
- package/dist/react/useSilentAuctionLots.d.ts +2 -0
- package/dist/react/useSilentAuctionLots.d.ts.map +1 -1
- package/dist/react/useSilentAuctionLots.js +1 -0
- package/dist/react/useSilentAuctionLots.js.map +1 -1
- package/dist/react/useSilentAuctionRounds.d.ts +2 -1
- package/dist/react/useSilentAuctionRounds.d.ts.map +1 -1
- package/dist/react/useSilentAuctionRounds.js +1 -1
- package/dist/react/useSilentAuctionRounds.js.map +1 -1
- package/dist/shopifyCommerce.d.ts +18 -5
- package/dist/shopifyCommerce.d.ts.map +1 -1
- package/dist/shopifyCommerce.js +42 -11
- package/dist/shopifyCommerce.js.map +1 -1
- package/dist/silentAuctionFeed.d.ts +2 -0
- package/dist/silentAuctionFeed.d.ts.map +1 -1
- package/dist/silentAuctionFeed.js +12 -2
- package/dist/silentAuctionFeed.js.map +1 -1
- package/dist/silentAuctionRules.d.ts +29 -0
- package/dist/silentAuctionRules.d.ts.map +1 -1
- package/dist/silentAuctionRules.js +53 -0
- package/dist/silentAuctionRules.js.map +1 -1
- package/dist/storeData.d.ts +45 -0
- package/dist/storeData.d.ts.map +1 -0
- package/dist/storeData.js +35 -0
- package/dist/storeData.js.map +1 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/viewerRules.d.ts +39 -0
- package/dist/viewerRules.d.ts.map +1 -0
- package/dist/viewerRules.js +46 -0
- package/dist/viewerRules.js.map +1 -0
- package/dist/zegoEngine.d.ts.map +1 -1
- package/dist/zegoEngine.js +14 -7
- package/dist/zegoEngine.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RESTRICTIONS_REFRESH_MS = void 0;
|
|
3
4
|
exports.useLivePage = useLivePage;
|
|
4
5
|
/**
|
|
5
6
|
* The Live screen's page model (0.14.0, moved from amore-v2's `src/core/hooks/useLivePage.ts`:
|
|
@@ -31,6 +32,8 @@ const navigation_1 = require("./navigation");
|
|
|
31
32
|
* L5: production reported on every viewer-count tick).
|
|
32
33
|
*/
|
|
33
34
|
const joinedThisRun = new Set();
|
|
35
|
+
/** How often the Live screen reads the store's restrictions again while on show. */
|
|
36
|
+
exports.RESTRICTIONS_REFRESH_MS = 60000;
|
|
34
37
|
/**
|
|
35
38
|
* Everything the Live screen wires, so the screen stays plain tiles. Call it from the Live screen and
|
|
36
39
|
* from each of its tiles' wiring: every call reads the same session.
|
|
@@ -53,11 +56,11 @@ const joinedThisRun = new Set();
|
|
|
53
56
|
* the bubble: this screen shows the picture again.
|
|
54
57
|
* - **Back, every kind** (the header's arrow, the iOS swipe, Android's back; decided 2026-10-05,
|
|
55
58
|
* amore-v2's Head of Engineering) shrinks a show that is playing or waiting for its host into the
|
|
56
|
-
* bubble as the screen leaves, and closes one that has ended
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
59
|
+
* bubble as the screen leaves, and closes one that has ended: the screen's `beforeRemove`, for the
|
|
60
|
+
* navigation's back actions (`BACK_ACTIONS`). **Where back goes: Home, for every app** (decided
|
|
61
|
+
* 2026-10-22; `routes.openHome`): the arrow, ✕ and Android's back, the show shrinking first. The iOS
|
|
62
|
+
* swipe back is turned off on this screen (`gestureEnabled: false`), so no path goes to the screen behind. Picture-in-picture is a back that always shrinks; the cart shrinks the
|
|
63
|
+
* show and opens the Cart over this screen (Items You Won on an auction show: `routes.openCart`).
|
|
61
64
|
* - **A link from the show** (`openLink`, 0.15.0; decided 2026-10-19 by amore-v2's Head of Engineering)
|
|
62
65
|
* opens inside the app, never the phone's browser: the show goes into the bubble, as for the cart, and
|
|
63
66
|
* the app's `routes.openLink` opens the page (amore-v2: the store's product or collection on its
|
|
@@ -87,7 +90,7 @@ function useLivePage() {
|
|
|
87
90
|
const route = (0, navigation_1.useRoute)();
|
|
88
91
|
const streamId = (_b = (_a = route.params) === null || _a === void 0 ? void 0 : _a.streamId) !== null && _b !== void 0 ? _b : '';
|
|
89
92
|
const isFocused = (0, navigation_1.useIsFocused)();
|
|
90
|
-
const { routes, track, canOpenLinks } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
93
|
+
const { routes, track, canOpenLinks, viewerRestrictions } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
91
94
|
// The session changes only on the room's events, never on a clock: the header and the auction tiles keep their own.
|
|
92
95
|
const session = (0, platformSession_1.useLiveSession)();
|
|
93
96
|
const { holdStream, releaseStream, enterPip, exitPip, setMuted } = session.actions;
|
|
@@ -201,12 +204,24 @@ function useLivePage() {
|
|
|
201
204
|
(0, react_1.useEffect)(() => nav.addListener('beforeRemove', (event) => {
|
|
202
205
|
if (!livePages_1.BACK_ACTIONS.has(event.data.action.type))
|
|
203
206
|
return;
|
|
204
|
-
if (leavingForGood.current || !canShrinkNow.current || pipModeNow.current !== 'none')
|
|
207
|
+
if (leavingForGood.current || shrunk.current || !canShrinkNow.current || pipModeNow.current !== 'none')
|
|
205
208
|
return;
|
|
206
209
|
shrunk.current = true;
|
|
207
210
|
enterPip();
|
|
208
211
|
}), [nav, enterPip]);
|
|
209
212
|
(0, useKeepScreenAwake_1.useKeepScreenAwake)(showing && onAir, 'live');
|
|
213
|
+
// ─── The store's restrictions, kept current while the show is on screen (0.16.0) ───────────────
|
|
214
|
+
// Read again as the screen comes on show and every `RESTRICTIONS_REFRESH_MS` while it stays: a customer
|
|
215
|
+
// blocked from the admin mid-show stops at once (33.2.0's SPR-87), not at their next app start.
|
|
216
|
+
const restrictionsNow = (0, react_1.useRef)(viewerRestrictions);
|
|
217
|
+
restrictionsNow.current = viewerRestrictions;
|
|
218
|
+
(0, react_1.useEffect)(() => {
|
|
219
|
+
if (!isFocused)
|
|
220
|
+
return;
|
|
221
|
+
restrictionsNow.current.refresh();
|
|
222
|
+
const timer = setInterval(() => restrictionsNow.current.refresh(), exports.RESTRICTIONS_REFRESH_MS);
|
|
223
|
+
return () => clearInterval(timer);
|
|
224
|
+
}, [isFocused]);
|
|
210
225
|
// ─── liveJoin, once per show per app run ───────────────────────────────────────────────────────
|
|
211
226
|
const viewerCount = session.viewerCount;
|
|
212
227
|
(0, react_1.useEffect)(() => {
|
|
@@ -218,13 +233,12 @@ function useLivePage() {
|
|
|
218
233
|
track(sdk_analytics_core_1.DefaultEvents.LIVE_JOIN, (0, sdk_analytics_core_1.liveJoinParams)(sessionShow.streamingId, viewerCount));
|
|
219
234
|
}, [isFocused, sessionShow, viewerCount, track]);
|
|
220
235
|
// ─── The header's buttons ──────────────────────────────────────────────────────────────────────
|
|
221
|
-
/** Back:
|
|
236
|
+
/** Back: Home, for every app (decided 2026-10-22), a show on air shrinking into the bubble first. */
|
|
222
237
|
const goBack = (0, react_1.useCallback)(() => {
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}, [nav, routes]);
|
|
238
|
+
if (!leavingForGood.current && !shrunk.current)
|
|
239
|
+
shrinkForAnotherPage();
|
|
240
|
+
routes.openHome(nav);
|
|
241
|
+
}, [nav, routes, shrinkForAnotherPage]);
|
|
228
242
|
const close = (0, react_1.useCallback)(() => {
|
|
229
243
|
leavingForGood.current = true;
|
|
230
244
|
// Stopped outright: without `stopVideo` the room plays on with no surface.
|
|
@@ -233,19 +247,20 @@ function useLivePage() {
|
|
|
233
247
|
goBack();
|
|
234
248
|
}, [exitPip, releaseStream, goBack]);
|
|
235
249
|
const back = canShrink ? goBack : close;
|
|
236
|
-
// Android's back
|
|
237
|
-
// what the arrow does instead. With a screen behind, the navigator goes back, through `beforeRemove`.
|
|
250
|
+
// Android's back does what the arrow does: Home, the show shrinking first.
|
|
238
251
|
const backNow = (0, react_1.useRef)(back);
|
|
239
252
|
backNow.current = back;
|
|
240
253
|
(0, navigation_1.useFocusEffect)((0, react_1.useCallback)(() => {
|
|
241
254
|
const subscription = react_native_1.BackHandler.addEventListener('hardwareBackPress', () => {
|
|
242
|
-
if (nav.canGoBack())
|
|
243
|
-
return false;
|
|
244
255
|
backNow.current();
|
|
245
256
|
return true;
|
|
246
257
|
});
|
|
247
258
|
return () => subscription.remove();
|
|
248
|
-
}, [
|
|
259
|
+
}, []));
|
|
260
|
+
// The iOS swipe back would go to the screen behind: off here, so every back goes Home.
|
|
261
|
+
(0, react_1.useEffect)(() => {
|
|
262
|
+
nav.setOptions({ gestureEnabled: false });
|
|
263
|
+
}, [nav]);
|
|
249
264
|
const isAuction = capabilities.canBid;
|
|
250
265
|
const openCart = (0, react_1.useCallback)(() => {
|
|
251
266
|
shrinkForAnotherPage();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLivePage.js","sourceRoot":"","sources":["../../src/react/useLivePage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLivePage.js","sourceRoot":"","sources":["../../src/react/useLivePage.ts"],"names":[],"mappings":";;;AAmGA,kCAsPC;AAzVD;;;;;GAKG;AACH,oEAA4E;AAC5E,sDAAkD;AAClD,iCAA0E;AAC1E,+CAAqD;AAErD,sCAA4C;AAC5C,gDAA8C;AAC9C,gDAA6C;AAC7C,0CAAyC;AACzC,4CAAkF;AAClF,gDAAmD;AACnD,kDAAkD;AAElD,+DAA2E;AAC3E,uDAAgE;AAChE,iDAAiD;AACjD,6DAA0D;AAC1D,+CAA4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,MAAM,EAAE,QAAQ;SACjB;QACD,8GAA8G;QAC9G,IAAI;QACJ,8GAA8G;QAC9G,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { type Product } from '@tiledev/sdk-shopify';
|
|
7
7
|
import { type ShowLink } from '../linkLots';
|
|
8
8
|
import type { LiveCartChip, LiveFeaturedProduct, LiveShopLink, LiveSoldChip } from '../pageTypes';
|
|
9
|
+
export { shareAddress, shareProduct, SHARE_AGAIN_AFTER_MS } from './share';
|
|
9
10
|
/** What the Live screen hands the shop (0.15.0). */
|
|
10
11
|
export interface LiveShopScreen {
|
|
11
12
|
/**
|
|
@@ -15,14 +16,6 @@ export interface LiveShopScreen {
|
|
|
15
16
|
*/
|
|
16
17
|
openLink?: (url: string, title?: string | null) => void;
|
|
17
18
|
}
|
|
18
|
-
/**
|
|
19
|
-
* The phone's share sheet with an address (a product's page): iOS takes the link as `url`, Android as
|
|
20
|
-
* text. Nothing without one; a dismissed sheet, or none (the web preview without the browser's share),
|
|
21
|
-
* is nothing to report.
|
|
22
|
-
*/
|
|
23
|
-
export declare function shareAddress(url: string | null | undefined): Promise<void>;
|
|
24
|
-
/** The phone's share sheet with a product's link (the Live card's and Replay's share): its page on the store (`productShareUrl`). */
|
|
25
|
-
export declare function shareProduct(product: Product): Promise<void>;
|
|
26
19
|
/**
|
|
27
20
|
* The Live screen's shopping, so the screen stays plain tiles. Reads the app's live session, as
|
|
28
21
|
* `useLivePage` does, for the show the route names.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveShop.d.ts","sourceRoot":"","sources":["../../src/react/useLiveShop.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"useLiveShop.d.ts","sourceRoot":"","sources":["../../src/react/useLiveShop.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAsD,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGxG,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAOlG,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAO3E,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACzD;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAE,cAAmB;;;;;;;;;;;;;;QA+IjD,+GAA+G;;;;;;kCAxFvG,OAAO;2BAQV,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,OAAO,CAAC;oCAwFZ,OAAO;;;;;;;;;;;;EAQxC;AAED,6DAA6D;AAC7D,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shareAddress =
|
|
4
|
-
exports.shareProduct = shareProduct;
|
|
3
|
+
exports.SHARE_AGAIN_AFTER_MS = exports.shareProduct = exports.shareAddress = void 0;
|
|
5
4
|
exports.useLiveShop = useLiveShop;
|
|
6
5
|
/**
|
|
7
6
|
* The Live screen's shopping (0.14.0, moved from amore-v2's `src/core/hooks/useLiveShop.ts`: phase 3 of
|
|
@@ -10,33 +9,18 @@ exports.useLiveShop = useLiveShop;
|
|
|
10
9
|
*/
|
|
11
10
|
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
12
11
|
const react_1 = require("react");
|
|
13
|
-
const react_native_1 = require("react-native");
|
|
14
12
|
const linkLots_1 = require("../linkLots");
|
|
15
13
|
const showCredit_1 = require("../showCredit");
|
|
16
14
|
const showNames_1 = require("../showNames");
|
|
17
15
|
const showLots_1 = require("../showLots");
|
|
18
16
|
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
17
|
+
const share_1 = require("./share");
|
|
18
|
+
var share_2 = require("./share");
|
|
19
|
+
Object.defineProperty(exports, "shareAddress", { enumerable: true, get: function () { return share_2.shareAddress; } });
|
|
20
|
+
Object.defineProperty(exports, "shareProduct", { enumerable: true, get: function () { return share_2.shareProduct; } });
|
|
21
|
+
Object.defineProperty(exports, "SHARE_AGAIN_AFTER_MS", { enumerable: true, get: function () { return share_2.SHARE_AGAIN_AFTER_MS; } });
|
|
19
22
|
const platformSession_1 = require("./platformSession");
|
|
20
23
|
const navigation_1 = require("./navigation");
|
|
21
|
-
/**
|
|
22
|
-
* The phone's share sheet with an address (a product's page): iOS takes the link as `url`, Android as
|
|
23
|
-
* text. Nothing without one; a dismissed sheet, or none (the web preview without the browser's share),
|
|
24
|
-
* is nothing to report.
|
|
25
|
-
*/
|
|
26
|
-
async function shareAddress(url) {
|
|
27
|
-
if (!url)
|
|
28
|
-
return;
|
|
29
|
-
try {
|
|
30
|
-
await react_native_1.Share.share(react_native_1.Platform.OS === 'ios' ? { url } : { message: url });
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
// Dismissed, or no share sheet.
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/** The phone's share sheet with a product's link (the Live card's and Replay's share): its page on the store (`productShareUrl`). */
|
|
37
|
-
async function shareProduct(product) {
|
|
38
|
-
await shareAddress((0, sdk_shopify_1.productShareUrl)(product));
|
|
39
|
-
}
|
|
40
24
|
/**
|
|
41
25
|
* The Live screen's shopping, so the screen stays plain tiles. Reads the app's live session, as
|
|
42
26
|
* `useLivePage` does, for the show the route names.
|
|
@@ -183,9 +167,9 @@ function useLiveShop(screen = {}) {
|
|
|
183
167
|
},
|
|
184
168
|
onShare: () => {
|
|
185
169
|
if (featuredProduct)
|
|
186
|
-
void shareProduct(featuredProduct);
|
|
170
|
+
void (0, share_1.shareProduct)(featuredProduct);
|
|
187
171
|
else if (featuredLink)
|
|
188
|
-
void shareAddress(featuredLink.url);
|
|
172
|
+
void (0, share_1.shareAddress)(featuredLink.url);
|
|
189
173
|
},
|
|
190
174
|
},
|
|
191
175
|
shopButton: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveShop.js","sourceRoot":"","sources":["../../src/react/useLiveShop.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLiveShop.js","sourceRoot":"","sources":["../../src/react/useLiveShop.ts"],"names":[],"mappings":";;;AA0EA,kCA+JC;AAzOD;;;;GAIG;AACH,sDAAwG;AACxG,iCAA6C;AAE7C,0CAAoE;AAEpE,8CAA6G;AAC7G,4CAA2C;AAC3C,0CAA4C;AAC5C,+DAA2D;AAC3D,mCAAqD;AAErD,iCAA2E;AAAlE,qGAAA,YAAY,OAAA;AAAE,qGAAA,YAAY,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AACzD,uDAAgE;AAChE,6CAAgH;AAgBhH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,SAAgB,WAAW,CAAC,SAAyB,EAAE;;IACrD,MAAM,GAAG,GAAG,IAAA,0BAAa,GAAiC,CAAC;IAC3D,MAAM,QAAQ,GAAG,MAAA,MAAA,IAAA,qBAAQ,GAAa,CAAC,MAAM,0CAAE,QAAQ,mCAAI,EAAE,CAAC;IAC9D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAA,wCAAkB,GAAE,CAAC;IAC7D,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC;IACvC,mEAAmE;IACnE,MAAM,OAAO,GAAG,IAAA,gCAAc,GAAW,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAA,yBA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OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;KAChE,CAAC;AACJ,CAAC"}
|
|
@@ -17,6 +17,12 @@ import type { ReplayCommentItem, ReplayNowProduct, ReplayShopLink, ReplayShow }
|
|
|
17
17
|
* reaches the last one or two read so far. Hidden shows a shopper can't see are left out
|
|
18
18
|
* (`hiddenShows`), as on the Live tab: one opened by its id reads the archive to its end, then "This
|
|
19
19
|
* show has ended".
|
|
20
|
+
* - **A clip** (0.16.0: the route's `clip`, e.g. a product page's `useProductClip`) plays on its own: its
|
|
21
|
+
* recording isn't looked for in the archive (nor hidden as a rehearsal: whoever was shown the clip
|
|
22
|
+
* plays it), there is nothing to swipe to, and only its window plays. The bar is the clip's, from 0 to
|
|
23
|
+
* its length; the recording stops at the clip's end (`finished`), and Play there starts the clip again.
|
|
24
|
+
* The products are the clip's own (`productIds`), with no time windows, so the first is on screen and
|
|
25
|
+
* a pick from the sheet only opens its variant page; the chat is the recording's, at the recording's time.
|
|
20
26
|
* - **One player** (expo-video) for the whole app, borrowed from `ReplayPlayerProvider`, which owns it
|
|
21
27
|
* above the navigator so it outlives this screen: a new recording replaces the source, one source per
|
|
22
28
|
* recording, and its poster covers the picture until the video has a frame. It plays while the screen
|
|
@@ -24,7 +30,8 @@ import type { ReplayCommentItem, ReplayNowProduct, ReplayShopLink, ReplayShow }
|
|
|
24
30
|
* pauses under anything else.
|
|
25
31
|
* - **Picture-in-picture, in the app** (decided 2026-10-05, amore-v2's Head of Engineering): the
|
|
26
32
|
* header's picture-in-picture button shrinks the show into a floating bubble over the app and goes
|
|
27
|
-
*
|
|
33
|
+
* Home; ✕ and Android's back stop it and go Home (every app, decided 2026-10-22: `routes.openHome`; the
|
|
34
|
+
* iOS swipe back is off on this screen); its cart button shrinks it the
|
|
28
35
|
* same way and opens the Cart (`routes.openCart`). Arriving on this screen ends the bubble, and the
|
|
29
36
|
* screen shows the video where the bubble had it; ✕ stops the show, with no bubble. Opening another
|
|
30
37
|
* recording replaces the bubble's. No system picture-in-picture. One shrunk show at a time: arriving
|
|
@@ -32,7 +39,8 @@ import type { ReplayCommentItem, ReplayNowProduct, ReplayShopLink, ReplayShow }
|
|
|
32
39
|
* - **The playhead** is read twice a second. A seek is held until the player reports arriving there,
|
|
33
40
|
* so the bar never jumps back to where it was.
|
|
34
41
|
* - **A tap on the video pauses or plays** (0.15.0; decided 2026-10-20 by amore-v2's Head of
|
|
35
|
-
* Engineering, as the clips reel's
|
|
42
|
+
* Engineering, as the clips reel's), or with `tapVideo: 'showControls'` (0.16.0) brings the controls
|
|
43
|
+
* back for `controlsShowMs`, kept up while paused: the controls' own
|
|
36
44
|
* Play and Pause, which shows the controls for their 4 s, so the skips and the bar are in reach.
|
|
37
45
|
* While the shopper has paused, the player draws the reel's play mark (`player.paused`).
|
|
38
46
|
* - **The product on screen** is the one whose time window covers the playhead
|
|
@@ -57,7 +65,17 @@ import type { ReplayCommentItem, ReplayNowProduct, ReplayShopLink, ReplayShow }
|
|
|
57
65
|
* - **A read that fails** (the products, the time windows, the chat) goes to `onWarning`; a failed
|
|
58
66
|
* products or windows read is tried again when the shopper comes back to the recording.
|
|
59
67
|
*/
|
|
60
|
-
export
|
|
68
|
+
export interface UseReplayPageOptions {
|
|
69
|
+
/**
|
|
70
|
+
* What a tap on the video does (0.16.0): `playPause` (the default, 0.15.0's, as the clips reel), or
|
|
71
|
+
* `showControls`: the controls come back for `controlsShowMs`, and stay up while the video is paused, so
|
|
72
|
+
* a paused recording always shows its play button.
|
|
73
|
+
*/
|
|
74
|
+
tapVideo?: 'playPause' | 'showControls';
|
|
75
|
+
/** How long the controls stay after they show or are touched, ms, 1000–15000 (default 4000). 0.16.0. */
|
|
76
|
+
controlsShowMs?: number;
|
|
77
|
+
}
|
|
78
|
+
export declare function useReplayPage({ tapVideo, controlsShowMs }?: UseReplayPageOptions): {
|
|
61
79
|
/** The video is on screen: light status bar text over it. */
|
|
62
80
|
darkBehindStatusBar: boolean;
|
|
63
81
|
player: {
|
|
@@ -69,6 +87,7 @@ export declare function useReplayPage(): {
|
|
|
69
87
|
videoReady: boolean;
|
|
70
88
|
buffering: boolean;
|
|
71
89
|
paused: boolean;
|
|
90
|
+
finished: boolean;
|
|
72
91
|
onVideoFirstFrame: () => void;
|
|
73
92
|
startsPictureInPictureAutomatically: boolean;
|
|
74
93
|
onPictureInPictureStart: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReplayPage.d.ts","sourceRoot":"","sources":["../../src/react/useReplayPage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAQL,KAAK,OAAO,EACb,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"useReplayPage.d.ts","sourceRoot":"","sources":["../../src/react/useReplayPage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAQL,KAAK,OAAO,EACb,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAAkD,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAa5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuCpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,WAAW,GAAG,cAAc,CAAC;IACxC,wGAAwG;IACxG,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAsB,EAAE,cAAc,EAAE,GAAE,oBAAyB;IAsc/F,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqD3C,MAAM;uBAIP,MAAM;2BAIF,MAAM;;;;;;;;;;;;;;;;;;;;QAgCzB,2FAA2F;;;;;kCArLnF,OAAO;2BA6EV,IAAI,CAAC,cAAc,EAAE,KAAK,GAAG,OAAO,CAAC;oCA+Gd,OAAO;;;;;;;;EASxC;AAED,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
|