@tiledev/sdk-apptile-live-selling 0.14.0 → 0.15.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/README.md +36 -11
- package/dist/clipsPage.d.ts +29 -0
- package/dist/clipsPage.d.ts.map +1 -0
- package/dist/clipsPage.js +49 -0
- package/dist/clipsPage.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -2
- package/dist/index.js.map +1 -1
- package/dist/linkLots.d.ts +64 -0
- package/dist/linkLots.d.ts.map +1 -0
- package/dist/linkLots.js +84 -0
- package/dist/linkLots.js.map +1 -0
- package/dist/livePages.d.ts +91 -4
- package/dist/livePages.d.ts.map +1 -1
- package/dist/livePages.js +101 -4
- package/dist/livePages.js.map +1 -1
- package/dist/pageOptions.d.ts +24 -6
- package/dist/pageOptions.d.ts.map +1 -1
- package/dist/pageOptions.js +20 -3
- package/dist/pageOptions.js.map +1 -1
- package/dist/pageTypes.d.ts +58 -0
- package/dist/pageTypes.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.d.ts +11 -3
- package/dist/react/LiveSellingProvider.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.js +26 -8
- package/dist/react/LiveSellingProvider.js.map +1 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +6 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.web.d.ts +3 -1
- package/dist/react/index.web.d.ts.map +1 -1
- package/dist/react/index.web.js +7 -1
- package/dist/react/index.web.js.map +1 -1
- package/dist/react/shopifyProviders.d.ts +4 -3
- package/dist/react/shopifyProviders.d.ts.map +1 -1
- package/dist/react/shopifyProviders.js +6 -4
- package/dist/react/shopifyProviders.js.map +1 -1
- package/dist/react/useAccountName.d.ts +8 -0
- package/dist/react/useAccountName.d.ts.map +1 -0
- package/dist/react/useAccountName.js +49 -0
- package/dist/react/useAccountName.js.map +1 -0
- package/dist/react/useClipsPage.d.ts +47 -0
- package/dist/react/useClipsPage.d.ts.map +1 -0
- package/dist/react/useClipsPage.js +130 -0
- package/dist/react/useClipsPage.js.map +1 -0
- package/dist/react/useLiveAuction.d.ts +5 -3
- package/dist/react/useLiveAuction.d.ts.map +1 -1
- package/dist/react/useLiveAuction.js +10 -5
- package/dist/react/useLiveAuction.js.map +1 -1
- package/dist/react/useLiveChat.d.ts +42 -7
- package/dist/react/useLiveChat.d.ts.map +1 -1
- package/dist/react/useLiveChat.js +90 -12
- package/dist/react/useLiveChat.js.map +1 -1
- package/dist/react/useLiveGiveawaysAndPolls.d.ts +14 -3
- package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +1 -1
- package/dist/react/useLiveGiveawaysAndPolls.js +56 -11
- package/dist/react/useLiveGiveawaysAndPolls.js.map +1 -1
- package/dist/react/useLivePage.d.ts +22 -1
- package/dist/react/useLivePage.d.ts.map +1 -1
- package/dist/react/useLivePage.js +51 -11
- package/dist/react/useLivePage.js.map +1 -1
- package/dist/react/useLiveShop.d.ts +25 -5
- package/dist/react/useLiveShop.d.ts.map +1 -1
- package/dist/react/useLiveShop.js +65 -19
- package/dist/react/useLiveShop.js.map +1 -1
- package/dist/react/useReplayPage.d.ts +20 -4
- package/dist/react/useReplayPage.d.ts.map +1 -1
- package/dist/react/useReplayPage.js +94 -33
- package/dist/react/useReplayPage.js.map +1 -1
- package/dist/showNames.d.ts +11 -0
- package/dist/showNames.d.ts.map +1 -1
- package/dist/showNames.js +23 -1
- package/dist/showNames.js.map +1 -1
- package/package.json +1 -10
|
@@ -25,6 +25,15 @@
|
|
|
25
25
|
* shrinks; the cart shrinks the show and opens the Cart over this screen (Items You Won on an auction
|
|
26
26
|
* show: `routes.openCart`). Android's back with nothing behind this screen (a link on a cold start)
|
|
27
27
|
* does what the arrow does: back to the Live tab.
|
|
28
|
+
* - **A link from the show** (`openLink`, 0.15.0; decided 2026-10-19 by amore-v2's Head of Engineering)
|
|
29
|
+
* opens inside the app, never the phone's browser: the show goes into the bubble, as for the cart, and
|
|
30
|
+
* the app's `routes.openLink` opens the page (amore-v2: the store's product or collection on its
|
|
31
|
+
* screen, any other page in its web page). Leaving the app for the phone's browser is what left the
|
|
32
|
+
* player dark on the way back (ENG-629) and the phone's window blank (ENG-580). A link that isn't https
|
|
33
|
+
* (`opensInApp`), or an app without `routes.openLink`, opens nothing, and the show stays.
|
|
34
|
+
* - **The cart's holds** (0.15.0, amore-v2's ENG-691): the header shows a timer under the cart button in
|
|
35
|
+
* the soonest hold's last minutes; this hands it when each hold ends (`header.holdEndTimes`,
|
|
36
|
+
* `holdEndTimesOf` over sdk-shopify's cart and its `cartExtensions`), and the header counts.
|
|
28
37
|
* - **One shrunk show at a time:** arriving here stops a replay's bubble (and the Replay screen stops
|
|
29
38
|
* this show's bubble).
|
|
30
39
|
* - **The screen stays on** while it shows the show playing or waiting for its host.
|
|
@@ -36,7 +45,8 @@
|
|
|
36
45
|
* `hiddenShows` names, whoever watches it.
|
|
37
46
|
* - **Hidden shows** (`hiddenShows`): for a shopper who isn't on the team the session never holds one,
|
|
38
47
|
* so it is never on air here (the link goes to the Live tab).
|
|
39
|
-
* - **Chat and reactions** are `useLiveChat`'s, shown only while the show is on air
|
|
48
|
+
* - **Chat and reactions** are `useLiveChat`'s, shown only while the show is on air; a host's or
|
|
49
|
+
* moderator's link in the chat opens through `openLink`.
|
|
40
50
|
*/
|
|
41
51
|
export declare function useLivePage(): {
|
|
42
52
|
/**
|
|
@@ -66,6 +76,7 @@ export declare function useLivePage(): {
|
|
|
66
76
|
canPip: boolean;
|
|
67
77
|
backShrinks: boolean;
|
|
68
78
|
cartCount: number;
|
|
79
|
+
holdEndTimes: number[];
|
|
69
80
|
onBack: () => void;
|
|
70
81
|
onToggleMute: () => void;
|
|
71
82
|
onPip: () => void;
|
|
@@ -81,16 +92,24 @@ export declare function useLivePage(): {
|
|
|
81
92
|
hidden: boolean;
|
|
82
93
|
onToggleHidden: () => void;
|
|
83
94
|
onPressName: ((name: string) => void) | undefined;
|
|
95
|
+
onOpenLink: ((url: string) => void) | undefined;
|
|
84
96
|
};
|
|
85
97
|
commentBox: {
|
|
86
98
|
visible: boolean;
|
|
87
99
|
askForName: boolean;
|
|
100
|
+
accountName: import("..").NameOnAccount | null;
|
|
88
101
|
waitingForName: boolean;
|
|
102
|
+
signedOut: boolean;
|
|
103
|
+
auction: boolean;
|
|
104
|
+
keyboardRequest: number;
|
|
105
|
+
onSignInToComment: () => void;
|
|
89
106
|
sending: boolean;
|
|
90
107
|
mention: import("..").LiveCommentMention | null;
|
|
91
108
|
nameMaxLength: number;
|
|
92
109
|
onSend: (text: string) => Promise<void>;
|
|
93
110
|
onSaveName: (name: string) => Promise<boolean>;
|
|
111
|
+
onSaveAccountName: (firstName: string, lastName: string) => Promise<boolean>;
|
|
112
|
+
isNameAllowed: (name: string) => boolean;
|
|
94
113
|
onTypingChange: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
95
114
|
};
|
|
96
115
|
reactionButton: {
|
|
@@ -107,6 +126,8 @@ export declare function useLivePage(): {
|
|
|
107
126
|
pinnedComment: import("../types").LivePinnedComment | null;
|
|
108
127
|
};
|
|
109
128
|
};
|
|
129
|
+
/** A link from the show (0.15.0): its page inside the app, the show in the bubble. `useLiveShop` takes it. */
|
|
130
|
+
openLink: (url: string, title?: string | null) => void;
|
|
110
131
|
};
|
|
111
132
|
/** What `useLivePage` hands the Live screen and its tiles. */
|
|
112
133
|
export type LivePage = ReturnType<typeof useLivePage>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLivePage.d.ts","sourceRoot":"","sources":["../../src/react/useLivePage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLivePage.d.ts","sourceRoot":"","sources":["../../src/react/useLivePage.ts"],"names":[],"mappings":"AA8CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,WAAW;IA2LvB;;;;;;OAMG;;IAEH,4FAA4F;;;;;;;;;;;;;;;;;;;;;;;;;IAgC5F,8GAA8G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE9G,8GAA8G;oBA7HxG,MAAM,UAAU,MAAM,GAAG,IAAI;EAgItC;AAED,8DAA8D;AAC9D,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLivePage = useLivePage;
|
|
4
4
|
/**
|
|
5
5
|
* The Live screen's page model (0.14.0, moved from amore-v2's `src/core/hooks/useLivePage.ts`:
|
|
6
|
-
* Freckled Poppy's Live, phase 1, watching and the in-app bubble
|
|
7
|
-
*
|
|
6
|
+
* Freckled Poppy's Live, phase 1, watching and the in-app bubble; 0.15.0 adds its links and the cart
|
|
7
|
+
* hold's timer, from amore-v2's `eng928/integration`). The routes are the app's (`LiveSellingProvider`'s
|
|
8
|
+
* `routes`); the route's `streamId` param is read here.
|
|
8
9
|
*/
|
|
9
10
|
const sdk_analytics_core_1 = require("@tiledev/sdk-analytics-core");
|
|
10
11
|
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
@@ -13,6 +14,7 @@ const react_native_1 = require("react-native");
|
|
|
13
14
|
const client_1 = require("../client");
|
|
14
15
|
const hiddenShows_1 = require("../hiddenShows");
|
|
15
16
|
const liveSelling_1 = require("../liveSelling");
|
|
17
|
+
const linkLots_1 = require("../linkLots");
|
|
16
18
|
const livePages_1 = require("../livePages");
|
|
17
19
|
const pageOptions_1 = require("../pageOptions");
|
|
18
20
|
const sessionTypes_1 = require("../sessionTypes");
|
|
@@ -56,6 +58,15 @@ const joinedThisRun = new Set();
|
|
|
56
58
|
* shrinks; the cart shrinks the show and opens the Cart over this screen (Items You Won on an auction
|
|
57
59
|
* show: `routes.openCart`). Android's back with nothing behind this screen (a link on a cold start)
|
|
58
60
|
* does what the arrow does: back to the Live tab.
|
|
61
|
+
* - **A link from the show** (`openLink`, 0.15.0; decided 2026-10-19 by amore-v2's Head of Engineering)
|
|
62
|
+
* opens inside the app, never the phone's browser: the show goes into the bubble, as for the cart, and
|
|
63
|
+
* the app's `routes.openLink` opens the page (amore-v2: the store's product or collection on its
|
|
64
|
+
* screen, any other page in its web page). Leaving the app for the phone's browser is what left the
|
|
65
|
+
* player dark on the way back (ENG-629) and the phone's window blank (ENG-580). A link that isn't https
|
|
66
|
+
* (`opensInApp`), or an app without `routes.openLink`, opens nothing, and the show stays.
|
|
67
|
+
* - **The cart's holds** (0.15.0, amore-v2's ENG-691): the header shows a timer under the cart button in
|
|
68
|
+
* the soonest hold's last minutes; this hands it when each hold ends (`header.holdEndTimes`,
|
|
69
|
+
* `holdEndTimesOf` over sdk-shopify's cart and its `cartExtensions`), and the header counts.
|
|
59
70
|
* - **One shrunk show at a time:** arriving here stops a replay's bubble (and the Replay screen stops
|
|
60
71
|
* this show's bubble).
|
|
61
72
|
* - **The screen stays on** while it shows the show playing or waiting for its host.
|
|
@@ -67,7 +78,8 @@ const joinedThisRun = new Set();
|
|
|
67
78
|
* `hiddenShows` names, whoever watches it.
|
|
68
79
|
* - **Hidden shows** (`hiddenShows`): for a shopper who isn't on the team the session never holds one,
|
|
69
80
|
* so it is never on air here (the link goes to the Live tab).
|
|
70
|
-
* - **Chat and reactions** are `useLiveChat`'s, shown only while the show is on air
|
|
81
|
+
* - **Chat and reactions** are `useLiveChat`'s, shown only while the show is on air; a host's or
|
|
82
|
+
* moderator's link in the chat opens through `openLink`.
|
|
71
83
|
*/
|
|
72
84
|
function useLivePage() {
|
|
73
85
|
var _a, _b, _c, _d;
|
|
@@ -75,13 +87,14 @@ function useLivePage() {
|
|
|
75
87
|
const route = (0, navigation_1.useRoute)();
|
|
76
88
|
const streamId = (_b = (_a = route.params) === null || _a === void 0 ? void 0 : _a.streamId) !== null && _b !== void 0 ? _b : '';
|
|
77
89
|
const isFocused = (0, navigation_1.useIsFocused)();
|
|
78
|
-
const { routes, track } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
90
|
+
const { routes, track, canOpenLinks } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
79
91
|
// The session changes only on the room's events, never on a clock: the header and the auction tiles keep their own.
|
|
80
92
|
const session = (0, platformSession_1.useLiveSession)();
|
|
81
93
|
const { holdStream, releaseStream, enterPip, exitPip, setMuted } = session.actions;
|
|
82
94
|
const { viewerEmail: email } = (0, LiveSellingProvider_1.useLiveSelling)();
|
|
83
95
|
const { show: sessionShow, status, onAir } = (0, platformSession_1.useLiveShow)(streamId);
|
|
84
|
-
const { itemCount } = (0, sdk_shopify_1.
|
|
96
|
+
const { cart: { cart, itemCount }, cartPage: { extensions: cartExtensions }, } = (0, sdk_shopify_1.useShopify)();
|
|
97
|
+
const holdEndTimes = (0, react_1.useMemo)(() => (0, livePages_1.holdEndTimesOf)(cart, cartExtensions), [cart, cartExtensions]);
|
|
85
98
|
const { bubbleShown: replayInBubble, stop: stopReplay } = (0, replayPlayer_1.useReplayPlayer)();
|
|
86
99
|
// ─── Which show ────────────────────────────────────────────────────────────────────────────────
|
|
87
100
|
// `sessionShow` (above) is the session's record once it is this show's. The record the link's answer
|
|
@@ -153,8 +166,34 @@ function useLivePage() {
|
|
|
153
166
|
const coveredOnlyBySheet = (0, navigation_1.useNavigationState)((state) => (0, livePages_1.isCoveredOnlyBySheet)(state, route.key, routes.sheets));
|
|
154
167
|
const onScreen = isFocused || coveredOnlyBySheet;
|
|
155
168
|
const showing = onScreen && session.pipMode === 'none';
|
|
169
|
+
// ─── Leaving for another page, the show playing on in the bubble ───────────────────────────────
|
|
170
|
+
/**
|
|
171
|
+
* The show goes into the app's own bubble (the session's `enterPip`: `pipMode` `inapp`, `LiveBubble`;
|
|
172
|
+
* never the phone's window, which only the phone opens as the app is put away) before a page opens over
|
|
173
|
+
* this screen, so it plays on there; not while it is joining or has ended. Coming back here (back, the
|
|
174
|
+
* bubble's tap, Android's back) ends the bubble as the screen focuses (above).
|
|
175
|
+
*/
|
|
176
|
+
const shrinkForAnotherPage = (0, react_1.useCallback)(() => {
|
|
177
|
+
if (!canShrink)
|
|
178
|
+
return;
|
|
179
|
+
shrunk.current = true;
|
|
180
|
+
enterPip();
|
|
181
|
+
}, [canShrink, enterPip]);
|
|
182
|
+
/** A link from the show: its page inside the app, the show in the bubble. Nothing for one that can't open. */
|
|
183
|
+
const openLink = (0, react_1.useCallback)((url, title) => {
|
|
184
|
+
if (!canOpenLinks || !(0, linkLots_1.opensInApp)(url))
|
|
185
|
+
return;
|
|
186
|
+
shrinkForAnotherPage();
|
|
187
|
+
routes.openLink(url.trim(), title, nav);
|
|
188
|
+
}, [canOpenLinks, shrinkForAnotherPage, routes, nav]);
|
|
156
189
|
// Chat and reactions: only while this show is on air. Its own hook (`useLiveChat`).
|
|
157
|
-
const chat = (0, useLiveChat_1.useLiveChat)({
|
|
190
|
+
const chat = (0, useLiveChat_1.useLiveChat)({
|
|
191
|
+
onAir,
|
|
192
|
+
canComment: capabilities.canComment,
|
|
193
|
+
canReact: capabilities.canReact,
|
|
194
|
+
openLink,
|
|
195
|
+
auction: capabilities.canBid,
|
|
196
|
+
});
|
|
158
197
|
// Every back press (`BACK_ACTIONS`) passes here as the screen goes: a show on air enters the bubble,
|
|
159
198
|
// then the screen is let go. Nothing is prevented.
|
|
160
199
|
const canShrinkNow = (0, react_1.useRef)(canShrink);
|
|
@@ -209,13 +248,10 @@ function useLivePage() {
|
|
|
209
248
|
}, [nav]));
|
|
210
249
|
const isAuction = capabilities.canBid;
|
|
211
250
|
const openCart = (0, react_1.useCallback)(() => {
|
|
212
|
-
|
|
213
|
-
shrunk.current = true;
|
|
214
|
-
enterPip();
|
|
215
|
-
}
|
|
251
|
+
shrinkForAnotherPage();
|
|
216
252
|
// A bidder's cart is what they've won: their bids never land in the shopping cart (Freckled Poppy's).
|
|
217
253
|
routes.openCart({ itemsYouWon: isAuction }, nav);
|
|
218
|
-
}, [
|
|
254
|
+
}, [shrinkForAnotherPage, isAuction, nav, routes]);
|
|
219
255
|
// One surface at a time: not while the bubble or the phone's own window has it, or another screen is over this one.
|
|
220
256
|
const videoActive = showing && !!sessionShow;
|
|
221
257
|
return {
|
|
@@ -251,6 +287,8 @@ function useLivePage() {
|
|
|
251
287
|
canPip: canShrink,
|
|
252
288
|
backShrinks: canShrink,
|
|
253
289
|
cartCount: itemCount,
|
|
290
|
+
// The hold timer under the cart button counts down to the soonest of these on its own (0.15.0).
|
|
291
|
+
holdEndTimes,
|
|
254
292
|
onBack: back,
|
|
255
293
|
onToggleMute: () => setMuted(!session.muted),
|
|
256
294
|
// Shown only while the show can shrink: a back press, which shrinks it on the way.
|
|
@@ -259,6 +297,8 @@ function useLivePage() {
|
|
|
259
297
|
},
|
|
260
298
|
/** The chat, the comment box, reactions and the pinned comment: one set of props per tile (`useLiveChat`). */
|
|
261
299
|
chat,
|
|
300
|
+
/** A link from the show (0.15.0): its page inside the app, the show in the bubble. `useLiveShop` takes it. */
|
|
301
|
+
openLink,
|
|
262
302
|
};
|
|
263
303
|
}
|
|
264
304
|
//# sourceMappingURL=useLivePage.js.map
|
|
@@ -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":";;AAgGA,kCAwOC;AAxUD;;;;;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,+CAA4C;AAC5C,mDAAuD;AACvD,6CAS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AAW,mCAAI,IAAI;YAC3C,uDAAuD;YACvD,WAAW,EAAE,KAAK,IAAI,YAAY,CAAC,eAAe,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;YAC1F,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,OAAO,EAAE,MAAM,KAAK,OAAO,IAAI,MAAM,KAAK,OAAO;YACjD,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,SAAS;YACtB,SAAS,EAAE,SAAS;YACpB,gGAAgG;YAChG,YAAY;YACZ,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;YAC5C,mFAAmF;YACnF,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,QAAQ;SACjB;QACD,8GAA8G;QAC9G,IAAI;QACJ,8GAA8G;QAC9G,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The Live screen's shopping (0.14.0, moved from amore-v2's `src/core/hooks/useLiveShop.ts`: phase 3 of
|
|
3
|
-
* its "Live player plan", shop and cart
|
|
4
|
-
* the route's `streamId` param is read here.
|
|
3
|
+
* its "Live player plan", shop and cart; 0.15.0 adds its link lots, from amore-v2's `eng928/integration`).
|
|
4
|
+
* The routes are the app's (`LiveSellingProvider`'s `routes`); the route's `streamId` param is read here.
|
|
5
5
|
*/
|
|
6
6
|
import { type Product } from '@tiledev/sdk-shopify';
|
|
7
|
-
import
|
|
7
|
+
import { type ShowLink } from '../linkLots';
|
|
8
|
+
import type { LiveCartChip, LiveFeaturedProduct, LiveShopLink, LiveSoldChip } from '../pageTypes';
|
|
9
|
+
/** What the Live screen hands the shop (0.15.0). */
|
|
10
|
+
export interface LiveShopScreen {
|
|
11
|
+
/**
|
|
12
|
+
* Opens a link the host added inside the app, the show in the bubble: `useLivePage`'s `openLink`, as
|
|
13
|
+
* amore-v2's wiring passes it (`useLiveShop({ openLink: page.openLink })`). Unset: the link opens
|
|
14
|
+
* through `routes.openLink` with the show left where it is.
|
|
15
|
+
*/
|
|
16
|
+
openLink?: (url: string, title?: string | null) => void;
|
|
17
|
+
}
|
|
8
18
|
/**
|
|
9
19
|
* The phone's share sheet with an address (a product's page): iOS takes the link as `url`, Android as
|
|
10
20
|
* text. Nothing without one; a dismissed sheet, or none (the web preview without the browser's share),
|
|
@@ -38,6 +48,14 @@ export declare function shareProduct(product: Product): Promise<void>;
|
|
|
38
48
|
* from here carries the live credit and, once it lands, is announced to the room
|
|
39
49
|
* (`announceToLiveRoom`, which the app's variant page hands `reportShowAdd`; quick add does it
|
|
40
50
|
* itself). Signed out, shopping is open, as Freckled Poppy's.
|
|
51
|
+
* - **Links the host added** (0.15.0; amore-v2, 2026-10-19: lots that are web addresses, mostly affiliate
|
|
52
|
+
* links, `showLinkOf`). The session hands them over among the products, in the host's order, with a
|
|
53
|
+
* title, a price (in the shop's currency: the session gives none), a photo and the address, and no
|
|
54
|
+
* product (`raw`). Featured, the card shows it with Open in place of Buy (`isLink`), the price, no
|
|
55
|
+
* star, on any show (never "Waiting for the next lot…"); in the Shop sheet it is a card among the
|
|
56
|
+
* products (`LiveShopLink`: no star, no Add to Cart). A tap opens it inside the app with the show in the
|
|
57
|
+
* bubble (the screen's `openLink`); share shares its address. A link that isn't https, or an app with no
|
|
58
|
+
* `routes.openLink`, is shown but opens nothing (`url` null, `canOpen` false).
|
|
41
59
|
* - **The room's chips:** "just sold" (`session.sold`) and "added to cart" (`session.cartAnnouncements`,
|
|
42
60
|
* not on an auction show, as Freckled Poppy's). A name the room sent is shown by its first word
|
|
43
61
|
* (`firstNameOf`); the session hands out no name as an email.
|
|
@@ -45,7 +63,7 @@ export declare function shareProduct(product: Product): Promise<void>;
|
|
|
45
63
|
* hidden show the shopper can't see (`hiddenShows`). The web's session is always "ended" with no
|
|
46
64
|
* show, so none of these tiles draw there.
|
|
47
65
|
*/
|
|
48
|
-
export declare function useLiveShop(): {
|
|
66
|
+
export declare function useLiveShop(screen?: LiveShopScreen): {
|
|
49
67
|
productCard: {
|
|
50
68
|
visible: boolean;
|
|
51
69
|
product: LiveFeaturedProduct | null;
|
|
@@ -59,12 +77,14 @@ export declare function useLiveShop(): {
|
|
|
59
77
|
};
|
|
60
78
|
shopButton: {
|
|
61
79
|
visible: boolean;
|
|
62
|
-
products
|
|
80
|
+
/** The products and the links the host added (`LiveShopLink`), in the host's order, the featured one first. */
|
|
81
|
+
products: (Product | ShowLink)[];
|
|
63
82
|
onScreenProductId: string | null;
|
|
64
83
|
lotNumbers: Record<string, string>;
|
|
65
84
|
favoriteIds: string[];
|
|
66
85
|
auctionProductIds: string[];
|
|
67
86
|
onPressProduct: (product: Product) => void;
|
|
87
|
+
onOpenLink: (link: Pick<LiveShopLink, "url" | "title">) => void;
|
|
68
88
|
onToggleFavorite: (product: Product) => undefined;
|
|
69
89
|
onQuickAdd: (product: Product) => void;
|
|
70
90
|
addingProductIds: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveShop.d.ts","sourceRoot":"","sources":["../../src/react/useLiveShop.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAuE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAIzH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"useLiveShop.d.ts","sourceRoot":"","sources":["../../src/react/useLiveShop.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAuE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAIzH,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAWlG,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;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhF;AAED,qIAAqI;AACrI,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
@@ -5,12 +5,13 @@ exports.shareProduct = shareProduct;
|
|
|
5
5
|
exports.useLiveShop = useLiveShop;
|
|
6
6
|
/**
|
|
7
7
|
* The Live screen's shopping (0.14.0, moved from amore-v2's `src/core/hooks/useLiveShop.ts`: phase 3 of
|
|
8
|
-
* its "Live player plan", shop and cart
|
|
9
|
-
* the route's `streamId` param is read here.
|
|
8
|
+
* its "Live player plan", shop and cart; 0.15.0 adds its link lots, from amore-v2's `eng928/integration`).
|
|
9
|
+
* The routes are the app's (`LiveSellingProvider`'s `routes`); the route's `streamId` param is read here.
|
|
10
10
|
*/
|
|
11
11
|
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
12
12
|
const react_1 = require("react");
|
|
13
13
|
const react_native_1 = require("react-native");
|
|
14
|
+
const linkLots_1 = require("../linkLots");
|
|
14
15
|
const showCredit_1 = require("../showCredit");
|
|
15
16
|
const showNames_1 = require("../showNames");
|
|
16
17
|
const showLots_1 = require("../showLots");
|
|
@@ -61,6 +62,14 @@ async function shareProduct(product) {
|
|
|
61
62
|
* from here carries the live credit and, once it lands, is announced to the room
|
|
62
63
|
* (`announceToLiveRoom`, which the app's variant page hands `reportShowAdd`; quick add does it
|
|
63
64
|
* itself). Signed out, shopping is open, as Freckled Poppy's.
|
|
65
|
+
* - **Links the host added** (0.15.0; amore-v2, 2026-10-19: lots that are web addresses, mostly affiliate
|
|
66
|
+
* links, `showLinkOf`). The session hands them over among the products, in the host's order, with a
|
|
67
|
+
* title, a price (in the shop's currency: the session gives none), a photo and the address, and no
|
|
68
|
+
* product (`raw`). Featured, the card shows it with Open in place of Buy (`isLink`), the price, no
|
|
69
|
+
* star, on any show (never "Waiting for the next lot…"); in the Shop sheet it is a card among the
|
|
70
|
+
* products (`LiveShopLink`: no star, no Add to Cart). A tap opens it inside the app with the show in the
|
|
71
|
+
* bubble (the screen's `openLink`); share shares its address. A link that isn't https, or an app with no
|
|
72
|
+
* `routes.openLink`, is shown but opens nothing (`url` null, `canOpen` false).
|
|
64
73
|
* - **The room's chips:** "just sold" (`session.sold`) and "added to cart" (`session.cartAnnouncements`,
|
|
65
74
|
* not on an auction show, as Freckled Poppy's). A name the room sent is shown by its first word
|
|
66
75
|
* (`firstNameOf`); the session hands out no name as an email.
|
|
@@ -68,11 +77,12 @@ async function shareProduct(product) {
|
|
|
68
77
|
* hidden show the shopper can't see (`hiddenShows`). The web's session is always "ended" with no
|
|
69
78
|
* show, so none of these tiles draw there.
|
|
70
79
|
*/
|
|
71
|
-
function useLiveShop() {
|
|
72
|
-
var _a, _b, _c, _d, _e;
|
|
80
|
+
function useLiveShop(screen = {}) {
|
|
81
|
+
var _a, _b, _c, _d, _e, _f;
|
|
73
82
|
const nav = (0, navigation_1.useNavigation)();
|
|
74
83
|
const streamId = (_b = (_a = (0, navigation_1.useRoute)().params) === null || _a === void 0 ? void 0 : _a.streamId) !== null && _b !== void 0 ? _b : '';
|
|
75
|
-
const { routes, track } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
84
|
+
const { routes, track, canOpenLinks } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
85
|
+
const screenOpenLink = screen.openLink;
|
|
76
86
|
// The session changes only on the room's events, never on a clock.
|
|
77
87
|
const session = (0, platformSession_1.useLiveSession)();
|
|
78
88
|
const wishlist = (0, sdk_shopify_1.useWishlist)();
|
|
@@ -80,14 +90,24 @@ function useLiveShop() {
|
|
|
80
90
|
const { show, onAir, capabilities } = (0, platformSession_1.useLiveShow)(streamId);
|
|
81
91
|
const hidden = !show;
|
|
82
92
|
const isAuction = capabilities.canBid;
|
|
83
|
-
// ─── The products
|
|
93
|
+
// ─── The products and links ────────────────────────────────────────────────────────────────────
|
|
84
94
|
const featured = show ? session.activeProduct : null;
|
|
85
95
|
const featuredProduct = (_c = featured === null || featured === void 0 ? void 0 : featured.raw) !== null && _c !== void 0 ? _c : null;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
/**
|
|
90
|
-
|
|
96
|
+
// A link the host featured: a web address, no product of the store.
|
|
97
|
+
const featuredLink = (0, react_1.useMemo)(() => (featured && !featured.raw && featured.externalUrl ? (0, linkLots_1.showLinkOf)(featured, { canOpen: canOpenLinks }) : null), [featured, canOpenLinks]);
|
|
98
|
+
const featuredId = (_e = (_d = featuredProduct === null || featuredProduct === void 0 ? void 0 : featuredProduct.id) !== null && _d !== void 0 ? _d : featuredLink === null || featuredLink === void 0 ? void 0 : featuredLink.id) !== null && _e !== void 0 ? _e : null;
|
|
99
|
+
/**
|
|
100
|
+
* The show's Shopify products and the links the host added, in the host's order, the featured one
|
|
101
|
+
* first: the shopper who taps Shop wants what the host holds up.
|
|
102
|
+
*/
|
|
103
|
+
const shopItems = (0, react_1.useMemo)(() => (0, showLots_1.featuredFirst)(session.products.flatMap((lot) => lot.raw ? [lot.raw] : lot.externalUrl ? [(0, linkLots_1.showLinkOf)(lot, { canOpen: canOpenLinks })] : []), featuredId), [session.products, featuredId, canOpenLinks]);
|
|
104
|
+
const products = (0, react_1.useMemo)(() => shopItems.filter((item) => !(0, linkLots_1.isShowLink)(item)), [shopItems]);
|
|
105
|
+
/** Each lot's number, by product id (a link's own id): the number the host reads out. */
|
|
106
|
+
const lotNumbers = (0, react_1.useMemo)(() => Object.fromEntries(session.products.flatMap((lot) => {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
const id = (_b = (_a = lot.raw) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : (lot.externalUrl ? lot.id : null);
|
|
109
|
+
return id && lot.sellId ? [[id, lot.sellId]] : [];
|
|
110
|
+
})), [session.products]);
|
|
91
111
|
const auctionProductIds = (0, react_1.useMemo)(() => products.filter(sdk_shopify_1.isAuctioned).map((product) => product.id), [products]);
|
|
92
112
|
// ─── Buying ────────────────────────────────────────────────────────────────────────────────────
|
|
93
113
|
const creditFor = (0, react_1.useCallback)((product) => { var _a; return (0, showCredit_1.liveShowCredit)(show, (_a = lotNumbers[product.id]) !== null && _a !== void 0 ? _a : null); }, [show, lotNumbers]);
|
|
@@ -96,11 +116,20 @@ function useLiveShop() {
|
|
|
96
116
|
const openLotPage = (0, react_1.useCallback)((product) => routes.openVariantPage((0, showCredit_1.auctionLotPageParams)(product), nav), [routes, nav]);
|
|
97
117
|
/** A tap on a product, on the card or in the Shop sheet: a lot's details on an auction show, else the variant page to buy it. */
|
|
98
118
|
const openProduct = isAuction ? openLotPage : openVariantPage;
|
|
119
|
+
/** A tap on a link the host added: its page inside the app, the show in the bubble. Nothing for one that can't open. */
|
|
120
|
+
const openShowLink = (0, react_1.useCallback)((link) => {
|
|
121
|
+
if (!link.url)
|
|
122
|
+
return;
|
|
123
|
+
if (screenOpenLink)
|
|
124
|
+
screenOpenLink(link.url, link.title);
|
|
125
|
+
else
|
|
126
|
+
routes.openLink(link.url, link.title, nav);
|
|
127
|
+
}, [screenOpenLink, routes, nav]);
|
|
99
128
|
// ─── The featured card ─────────────────────────────────────────────────────────────────────────
|
|
100
129
|
// The lot's opening bid, joined onto the product from the record by the session.
|
|
101
|
-
const startingBid = isAuction && featured ? ((
|
|
130
|
+
const startingBid = isAuction && featured ? ((_f = featured.baseBidPrice) !== null && _f !== void 0 ? _f : null) : null;
|
|
102
131
|
const featuredCard = (0, react_1.useMemo)(() => {
|
|
103
|
-
var _a, _b, _c, _d, _e;
|
|
132
|
+
var _a, _b, _c, _d, _e, _f;
|
|
104
133
|
return featuredProduct
|
|
105
134
|
? {
|
|
106
135
|
id: featuredProduct.id,
|
|
@@ -111,8 +140,19 @@ function useLiveShop() {
|
|
|
111
140
|
lotNumber: isAuction ? null : ((_e = featured === null || featured === void 0 ? void 0 : featured.sellId) !== null && _e !== void 0 ? _e : null),
|
|
112
141
|
startingBid: startingBid != null ? (0, sdk_shopify_1.formatMoney)({ amount: String(startingBid), currencyCode: featuredProduct.priceRange.min.currencyCode }) : null,
|
|
113
142
|
}
|
|
114
|
-
:
|
|
115
|
-
|
|
143
|
+
: featuredLink
|
|
144
|
+
? {
|
|
145
|
+
id: featuredLink.id,
|
|
146
|
+
title: featuredLink.title,
|
|
147
|
+
price: featuredLink.price,
|
|
148
|
+
imageUrl: featuredLink.imageUrl,
|
|
149
|
+
lotNumber: isAuction ? null : ((_f = featured === null || featured === void 0 ? void 0 : featured.sellId) !== null && _f !== void 0 ? _f : null),
|
|
150
|
+
startingBid: null,
|
|
151
|
+
isLink: true,
|
|
152
|
+
canOpen: !!featuredLink.url,
|
|
153
|
+
}
|
|
154
|
+
: null;
|
|
155
|
+
}, [featuredProduct, featuredLink, featured === null || featured === void 0 ? void 0 : featured.sellId, isAuction, startingBid]);
|
|
116
156
|
// ─── The room's chips ──────────────────────────────────────────────────────────────────────────
|
|
117
157
|
const soldChips = (0, react_1.useMemo)(() => session.sold.map((card) => ({ id: card.id, quantity: card.quantity, productName: card.productName, lotNumber: card.sellId })), [session.sold]);
|
|
118
158
|
const cartChips = (0, react_1.useMemo)(() => session.cartAnnouncements.map((card) => ({
|
|
@@ -126,14 +166,16 @@ function useLiveShop() {
|
|
|
126
166
|
visible: !hidden,
|
|
127
167
|
product: featuredCard,
|
|
128
168
|
// An auction has gaps between lots: the slot keeps its place rather than leave the frame empty.
|
|
129
|
-
betweenLots: isAuction && !
|
|
169
|
+
betweenLots: isAuction && !featuredCard && onAir,
|
|
130
170
|
canBuy: !isAuction,
|
|
131
|
-
// No share on an auction show (decided 2026-10-05, amore-v2's Head of Engineering).
|
|
132
|
-
canShare: !isAuction,
|
|
171
|
+
// No share on an auction show (decided 2026-10-05, amore-v2's Head of Engineering), nor for a link that opens nothing.
|
|
172
|
+
canShare: !isAuction && (!featuredLink || !!featuredLink.url),
|
|
133
173
|
favorite: !!featuredProduct && wishlist.has(featuredProduct.id),
|
|
134
174
|
onOpenProduct: () => {
|
|
135
175
|
if (featuredProduct)
|
|
136
176
|
openProduct(featuredProduct);
|
|
177
|
+
else if (featuredLink)
|
|
178
|
+
openShowLink(featuredLink);
|
|
137
179
|
},
|
|
138
180
|
onToggleFavorite: () => {
|
|
139
181
|
if (featuredProduct)
|
|
@@ -142,17 +184,21 @@ function useLiveShop() {
|
|
|
142
184
|
onShare: () => {
|
|
143
185
|
if (featuredProduct)
|
|
144
186
|
void shareProduct(featuredProduct);
|
|
187
|
+
else if (featuredLink)
|
|
188
|
+
void shareAddress(featuredLink.url);
|
|
145
189
|
},
|
|
146
190
|
},
|
|
147
191
|
shopButton: {
|
|
148
192
|
// On an auction show too: there its sheet lists the lots (`useLiveAuction`'s `shopButton.lots`).
|
|
149
193
|
visible: !hidden,
|
|
150
|
-
products,
|
|
194
|
+
/** The products and the links the host added (`LiveShopLink`), in the host's order, the featured one first. */
|
|
195
|
+
products: shopItems,
|
|
151
196
|
onScreenProductId: featuredId,
|
|
152
197
|
lotNumbers,
|
|
153
198
|
favoriteIds: wishlist.ids,
|
|
154
199
|
auctionProductIds,
|
|
155
200
|
onPressProduct: openProduct,
|
|
201
|
+
onOpenLink: openShowLink,
|
|
156
202
|
onToggleFavorite: (product) => void wishlist.toggle(product),
|
|
157
203
|
onQuickAdd: quickAdd.add,
|
|
158
204
|
addingProductIds: quickAdd.addingProductIds,
|
|
@@ -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":";;AAoCA,oCAOC;AAGD,oCAEC;AA0CD,kCA+JC;AAzPD;;;;GAIG;AACH,sDAAyH;AACzH,iCAA6C;AAC7C,+CAA+C;AAE/C,0CAAoE;AAEpE,8CAA6G;AAC7G,4CAA2C;AAC3C,0CAA4C;AAC5C,+DAA2D;AAC3D,uDAAgE;AAChE,6CAAgH;AAehH;;;;GAIG;AACI,KAAK,UAAU,YAAY,CAAC,GAA8B;IAC/D,IAAI,CAAC,GAAG;QAAE,OAAO;IACjB,IAAI,CAAC;QACH,MAAM,oBAAK,CAAC,KAAK,CAAC,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,gCAAgC;IAClC,CAAC;AACH,CAAC;AAED,qIAAqI;AAC9H,KAAK,UAAU,YAAY,CAAC,OAAgB;IACjD,MAAM,YAAY,CAAC,IAAA,6BAAe,EAAC,OAAO,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,SAAgB,WAAW,CAAC,SAAyB,EAAE;;IACrD,MAAM,GAAG,GAAG,IAAA,0BAAa,GAAiC,CAAC;IAC3D,MAAM,QAAQ,GAAG,MAAA,MAAA,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BAAgB,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,KAAK,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;YACrE,UAAU,EAAE,QAAQ,CAAC,GAAG;YACxB,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;SAC5C;QACD,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;QACjD,qFAAqF;QACrF,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;KAChE,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The Replay screen's page model (0.14.0, moved from amore-v2's `src/core/hooks/useReplayPage.ts`: old
|
|
3
|
-
* Amore's Replay, rebuilt
|
|
4
|
-
* `
|
|
3
|
+
* Amore's Replay, rebuilt; 0.15.0 adds its link lots and a tap on the video that pauses and plays, from
|
|
4
|
+
* amore-v2's `eng928/integration`). The routes are the app's (`LiveSellingProvider`'s `routes`); the
|
|
5
|
+
* route's `feedId` and `streamId` params are read here, and `feedId` is set as the shopper swipes.
|
|
5
6
|
*/
|
|
6
7
|
import { type Product } from '@tiledev/sdk-shopify';
|
|
7
|
-
import
|
|
8
|
+
import { type ShowLink } from '../linkLots';
|
|
9
|
+
import type { ReplayCommentItem, ReplayNowProduct, ReplayShopLink, ReplayShow } from '../pageTypes';
|
|
8
10
|
/**
|
|
9
11
|
* Everything the Replay screen wires, so the screen stays plain tiles. Call it from the Replay screen
|
|
10
12
|
* and from each of its tiles' wiring.
|
|
@@ -29,6 +31,10 @@ import type { ReplayCommentItem, ReplayNowProduct, ReplayShow } from '../pageTyp
|
|
|
29
31
|
* here stops a live show's bubble, as the Live screen stops this one's.
|
|
30
32
|
* - **The playhead** is read twice a second. A seek is held until the player reports arriving there,
|
|
31
33
|
* so the bar never jumps back to where it was.
|
|
34
|
+
* - **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; until then a tap showed or hid the controls): the controls' own
|
|
36
|
+
* Play and Pause, which shows the controls for their 4 s, so the skips and the bar are in reach.
|
|
37
|
+
* While the shopper has paused, the player draws the reel's play mark (`player.paused`).
|
|
32
38
|
* - **The product on screen** is the one whose time window covers the playhead
|
|
33
39
|
* (`liveSelling.replays.segments`, `productOnScreen`); before the first window, the first tagged
|
|
34
40
|
* product. Picking a product in the shop sheet goes to where the host first showed it, playing, then
|
|
@@ -37,6 +43,13 @@ import type { ReplayCommentItem, ReplayNowProduct, ReplayShow } from '../pageTyp
|
|
|
37
43
|
* page. Every add from there is credited to the recording (`replayShowCredit`): `_replay_id` on the
|
|
38
44
|
* line, `replayAddToCart` (`track`), and the cart's `_apptile_attribution` count against the show's
|
|
39
45
|
* `streamingId`, never the replay's feed id. Products are read at sdk-shopify's `CARD_IMAGE`.
|
|
46
|
+
* - **Links the host added** (0.15.0; amore-v2, 2026-10-19: lots that are web addresses, mostly
|
|
47
|
+
* affiliate links): the feed lists only products, so the show's record (`liveSelling.streams.byId`) is
|
|
48
|
+
* read with them, once per recording per visit, and gives the shop its order, the links among the
|
|
49
|
+
* products (`recordingShopItems`). A link can be the lot on screen (its time window, by its id) and is
|
|
50
|
+
* a card in the sheet (`ReplayShopLink`); a tap opens it inside the app, the show in the bubble as for
|
|
51
|
+
* the cart (`routes.openLink`), and share shares its address. An unreadable record leaves the products
|
|
52
|
+
* alone, as before, and is reported.
|
|
40
53
|
* - **The chat** is the show's comments file (`liveSelling.replays.comments`), revealed up to the
|
|
41
54
|
* playhead, the newest 60 (`replayCommentsAt`).
|
|
42
55
|
* - **A view** is counted once per recording per visit (not on the web, where the Tile preview would
|
|
@@ -55,6 +68,7 @@ export declare function useReplayPage(): {
|
|
|
55
68
|
player: import("expo-video").VideoPlayer | null;
|
|
56
69
|
videoReady: boolean;
|
|
57
70
|
buffering: boolean;
|
|
71
|
+
paused: boolean;
|
|
58
72
|
onVideoFirstFrame: () => void;
|
|
59
73
|
onTapVideo: () => void;
|
|
60
74
|
onSwipeToNext: () => void;
|
|
@@ -98,11 +112,13 @@ export declare function useReplayPage(): {
|
|
|
98
112
|
};
|
|
99
113
|
shopBar: {
|
|
100
114
|
visible: boolean;
|
|
101
|
-
products
|
|
115
|
+
/** The products and the links the host added (`ReplayShopLink`), in the record's order. */
|
|
116
|
+
products: (Product | ShowLink)[];
|
|
102
117
|
onScreenProductId: string | null;
|
|
103
118
|
favoriteIds: string[];
|
|
104
119
|
auctionProductIds: string[];
|
|
105
120
|
onPressProduct: (product: Product) => void;
|
|
121
|
+
onOpenLink: (link: Pick<ReplayShopLink, "url" | "title">) => void;
|
|
106
122
|
onToggleFavorite: (product: Product) => undefined;
|
|
107
123
|
onQuickAdd: (product: Product) => void;
|
|
108
124
|
addingProductIds: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReplayPage.d.ts","sourceRoot":"","sources":["../../src/react/useReplayPage.ts"],"names":[],"mappings":"AAAA
|
|
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;AAM9B,OAAO,EAAkD,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuCpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,aAAa;IA8YzB,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4C3C,MAAM;uBAIP,MAAM;2BAIF,MAAM;;;;;;;;;;;;;;;;;;;;QAgCzB,2FAA2F;;;;;kCA/JnF,OAAO;2BAgEV,IAAI,CAAC,cAAc,EAAE,KAAK,GAAG,OAAO,CAAC;oCAsGd,OAAO;;;;;;;;EASxC;AAED,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
|