@tiledev/sdk-apptile-live-selling 0.1.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 +322 -0
- package/android/build.gradle +33 -0
- package/android/src/main/AndroidManifest.xml +7 -0
- package/android/src/main/java/expo/modules/livepip/LivePipModule.kt +310 -0
- package/app.plugin.js +3 -0
- package/dist/auctions.d.ts +3 -0
- package/dist/auctions.d.ts.map +1 -0
- package/dist/auctions.js +152 -0
- package/dist/auctions.js.map +1 -0
- package/dist/client.d.ts +63 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +154 -0
- package/dist/client.js.map +1 -0
- package/dist/clips.d.ts +3 -0
- package/dist/clips.d.ts.map +1 -0
- package/dist/clips.js +53 -0
- package/dist/clips.js.map +1 -0
- package/dist/commentLinks.d.ts +46 -0
- package/dist/commentLinks.d.ts.map +1 -0
- package/dist/commentLinks.js +120 -0
- package/dist/commentLinks.js.map +1 -0
- package/dist/engine.d.ts +13 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +40 -0
- package/dist/engine.js.map +1 -0
- package/dist/engine.native.d.ts +3 -0
- package/dist/engine.native.d.ts.map +1 -0
- package/dist/engine.native.js +815 -0
- package/dist/engine.native.js.map +1 -0
- package/dist/flags.d.ts +5 -0
- package/dist/flags.d.ts.map +1 -0
- package/dist/flags.js +61 -0
- package/dist/flags.js.map +1 -0
- package/dist/guest.d.ts +5 -0
- package/dist/guest.d.ts.map +1 -0
- package/dist/guest.js +89 -0
- package/dist/guest.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +80 -0
- package/dist/index.js.map +1 -0
- package/dist/liveSelling.d.ts +3 -0
- package/dist/liveSelling.d.ts.map +1 -0
- package/dist/liveSelling.js +44 -0
- package/dist/liveSelling.js.map +1 -0
- package/dist/nativeViewTag.d.ts +15 -0
- package/dist/nativeViewTag.d.ts.map +1 -0
- package/dist/nativeViewTag.js +23 -0
- package/dist/nativeViewTag.js.map +1 -0
- package/dist/pip.d.ts +14 -0
- package/dist/pip.d.ts.map +1 -0
- package/dist/pip.js +15 -0
- package/dist/pip.js.map +1 -0
- package/dist/pip.native.d.ts +11 -0
- package/dist/pip.native.d.ts.map +1 -0
- package/dist/pip.native.js +47 -0
- package/dist/pip.native.js.map +1 -0
- package/dist/polls.d.ts +11 -0
- package/dist/polls.d.ts.map +1 -0
- package/dist/polls.js +135 -0
- package/dist/polls.js.map +1 -0
- package/dist/react/LiveSellingProvider.d.ts +16 -0
- package/dist/react/LiveSellingProvider.d.ts.map +1 -0
- package/dist/react/LiveSellingProvider.js +49 -0
- package/dist/react/LiveSellingProvider.js.map +1 -0
- package/dist/react/LiveVideoTarget.d.ts +22 -0
- package/dist/react/LiveVideoTarget.d.ts.map +1 -0
- package/dist/react/LiveVideoTarget.js +73 -0
- package/dist/react/LiveVideoTarget.js.map +1 -0
- package/dist/react/index.d.ts +19 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +43 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/useAuction.d.ts +28 -0
- package/dist/react/useAuction.d.ts.map +1 -0
- package/dist/react/useAuction.js +66 -0
- package/dist/react/useAuction.js.map +1 -0
- package/dist/react/useAuctionBidGate.d.ts +48 -0
- package/dist/react/useAuctionBidGate.d.ts.map +1 -0
- package/dist/react/useAuctionBidGate.js +144 -0
- package/dist/react/useAuctionBidGate.js.map +1 -0
- package/dist/react/useAuctionWins.d.ts +51 -0
- package/dist/react/useAuctionWins.d.ts.map +1 -0
- package/dist/react/useAuctionWins.js +268 -0
- package/dist/react/useAuctionWins.js.map +1 -0
- package/dist/react/useClips.d.ts +9 -0
- package/dist/react/useClips.d.ts.map +1 -0
- package/dist/react/useClips.js +37 -0
- package/dist/react/useClips.js.map +1 -0
- package/dist/react/useLiveSession.d.ts +34 -0
- package/dist/react/useLiveSession.d.ts.map +1 -0
- package/dist/react/useLiveSession.js +876 -0
- package/dist/react/useLiveSession.js.map +1 -0
- package/dist/react/useLiveStreams.d.ts +9 -0
- package/dist/react/useLiveStreams.d.ts.map +1 -0
- package/dist/react/useLiveStreams.js +35 -0
- package/dist/react/useLiveStreams.js.map +1 -0
- package/dist/react/useOngoingLive.d.ts +13 -0
- package/dist/react/useOngoingLive.d.ts.map +1 -0
- package/dist/react/useOngoingLive.js +45 -0
- package/dist/react/useOngoingLive.js.map +1 -0
- package/dist/react/useReplays.d.ts +15 -0
- package/dist/react/useReplays.d.ts.map +1 -0
- package/dist/react/useReplays.js +66 -0
- package/dist/react/useReplays.js.map +1 -0
- package/dist/react/useStreamInfo.d.ts +21 -0
- package/dist/react/useStreamInfo.d.ts.map +1 -0
- package/dist/react/useStreamInfo.js +125 -0
- package/dist/react/useStreamInfo.js.map +1 -0
- package/dist/replays.d.ts +3 -0
- package/dist/replays.d.ts.map +1 -0
- package/dist/replays.js +114 -0
- package/dist/replays.js.map +1 -0
- package/dist/session.d.ts +23 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +464 -0
- package/dist/session.js.map +1 -0
- package/dist/sessionTypes.d.ts +462 -0
- package/dist/sessionTypes.d.ts.map +1 -0
- package/dist/sessionTypes.js +55 -0
- package/dist/sessionTypes.js.map +1 -0
- package/dist/streams.d.ts +67 -0
- package/dist/streams.d.ts.map +1 -0
- package/dist/streams.js +170 -0
- package/dist/streams.js.map +1 -0
- package/dist/types.d.ts +591 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/dist/viewer.d.ts +5 -0
- package/dist/viewer.d.ts.map +1 -0
- package/dist/viewer.js +66 -0
- package/dist/viewer.js.map +1 -0
- package/dist/wire.d.ts +155 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +73 -0
- package/dist/wire.js.map +1 -0
- package/dist/zego.d.ts +83 -0
- package/dist/zego.d.ts.map +1 -0
- package/dist/zego.js +13 -0
- package/dist/zego.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/LivePip.podspec +20 -0
- package/ios/LivePipController.swift +327 -0
- package/ios/LivePipModule.swift +35 -0
- package/package.json +91 -0
- package/plugin/build/index.d.ts +29 -0
- package/plugin/build/index.js +101 -0
- package/react/package.json +6 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SHEET_HANDOFF_MS = void 0;
|
|
4
|
+
exports.useAuctionBidGate = useAuctionBidGate;
|
|
5
|
+
/**
|
|
6
|
+
* `useAuctionBidGate` — everything that has to be true before a bid can be placed.
|
|
7
|
+
*
|
|
8
|
+
* A bid is a binding commitment to buy, so it is the one action here with real conditions in front of
|
|
9
|
+
* it. They are gathered in one hook because the *order* is the whole point, and that order is
|
|
10
|
+
* invisible when it is spread across four call sites.
|
|
11
|
+
*
|
|
12
|
+
* In order:
|
|
13
|
+
*
|
|
14
|
+
* 1. **Signed in.** The host attributes a win to a customer and turns it into a cart, so an anonymous
|
|
15
|
+
* bid has nowhere to land.
|
|
16
|
+
* 2. **Nothing outstanding.** A customer who won a lot on an earlier stream and never checked out is
|
|
17
|
+
* asked to settle that first — the host settles a viewer's whole tab at once.
|
|
18
|
+
* 3. **Rules accepted.** Once per install, before the first bid ever.
|
|
19
|
+
* 4. **A variant chosen.** On a lot with more than one variant, a bid has to say which — the winner is
|
|
20
|
+
* charged for a specific one. Asked once per round, not once per bid: a bidder raising three times
|
|
21
|
+
* in the last ten seconds must not be asked their size three times.
|
|
22
|
+
*
|
|
23
|
+
* The requested bid is held while the blocker is resolved and then placed, so clearing the last panel
|
|
24
|
+
* completes the bid the viewer originally asked for rather than making them start again.
|
|
25
|
+
*
|
|
26
|
+
* The hook owns the *decisions*, never the UI: it reports which blocker is current and the host app
|
|
27
|
+
* renders whatever it likes for each.
|
|
28
|
+
*/
|
|
29
|
+
const react_1 = require("react");
|
|
30
|
+
const client_1 = require("../client");
|
|
31
|
+
const liveSelling_1 = require("../liveSelling");
|
|
32
|
+
/**
|
|
33
|
+
* How long to leave between one panel closing and the next opening.
|
|
34
|
+
*
|
|
35
|
+
* Not cosmetic, if the host renders these as React Native `Modal`s: presenting one while another is
|
|
36
|
+
* still dismissing throws `Attempt to present … which is already presenting` on iOS — a native
|
|
37
|
+
* exception, so the app disappears rather than showing an error. The gate chains panels by design
|
|
38
|
+
* (rules, then the variant), so this is the one place that has to be careful about it.
|
|
39
|
+
*
|
|
40
|
+
* Long enough to outlast a slide-out, short enough not to read as a pause.
|
|
41
|
+
*/
|
|
42
|
+
exports.SHEET_HANDOFF_MS = 380;
|
|
43
|
+
function useAuctionBidGate({ streamingId, isLoggedIn, biddingOpen, variantCount, placeBid, }) {
|
|
44
|
+
const [blocker, setBlocker] = (0, react_1.useState)(null);
|
|
45
|
+
const [variantId, setVariantId] = (0, react_1.useState)(null);
|
|
46
|
+
const [termsAccepted, setTermsAccepted] = (0, react_1.useState)(null);
|
|
47
|
+
const [unpaidStreamIds, setUnpaidStreamIds] = (0, react_1.useState)([]);
|
|
48
|
+
/** The bid being held behind a blocker. Undefined means "the round's minimum". */
|
|
49
|
+
const pendingRef = (0, react_1.useRef)(undefined);
|
|
50
|
+
/** Pending handoff, so unmounting mid-chain does not set state on a dead hook. */
|
|
51
|
+
const handoffRef = (0, react_1.useRef)(null);
|
|
52
|
+
(0, react_1.useEffect)(() => () => {
|
|
53
|
+
if (handoffRef.current)
|
|
54
|
+
clearTimeout(handoffRef.current);
|
|
55
|
+
}, []);
|
|
56
|
+
/**
|
|
57
|
+
* Shows a panel, waiting out the previous one if there is one up.
|
|
58
|
+
*
|
|
59
|
+
* Reads the current blocker through the setter rather than a dependency, so this stays stable and
|
|
60
|
+
* the callbacks below do not change identity every time a panel opens.
|
|
61
|
+
*/
|
|
62
|
+
const show = (0, react_1.useCallback)((next) => {
|
|
63
|
+
if (handoffRef.current) {
|
|
64
|
+
clearTimeout(handoffRef.current);
|
|
65
|
+
handoffRef.current = null;
|
|
66
|
+
}
|
|
67
|
+
setBlocker((current) => {
|
|
68
|
+
if (current === null || next === null)
|
|
69
|
+
return next;
|
|
70
|
+
handoffRef.current = setTimeout(() => {
|
|
71
|
+
handoffRef.current = null;
|
|
72
|
+
setBlocker(next);
|
|
73
|
+
}, exports.SHEET_HANDOFF_MS);
|
|
74
|
+
return null;
|
|
75
|
+
});
|
|
76
|
+
}, []);
|
|
77
|
+
(0, react_1.useEffect)(() => {
|
|
78
|
+
let alive = true;
|
|
79
|
+
void liveSelling_1.liveSelling.auctions.hasAcceptedTerms().then((accepted) => {
|
|
80
|
+
if (alive)
|
|
81
|
+
setTermsAccepted(accepted);
|
|
82
|
+
});
|
|
83
|
+
return () => {
|
|
84
|
+
alive = false;
|
|
85
|
+
};
|
|
86
|
+
}, []);
|
|
87
|
+
// Read on demand rather than per bid: it is a customer metafield, it only changes when they check
|
|
88
|
+
// out, and a round is no place for a network round trip.
|
|
89
|
+
const refreshUnpaidWins = (0, react_1.useCallback)(() => {
|
|
90
|
+
if (!isLoggedIn) {
|
|
91
|
+
setUnpaidStreamIds([]);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
void liveSelling_1.liveSelling.auctions.unpaidStreamIds().then(setUnpaidStreamIds);
|
|
95
|
+
}, [isLoggedIn]);
|
|
96
|
+
(0, react_1.useEffect)(refreshUnpaidWins, [refreshUnpaidWins]);
|
|
97
|
+
// A variant choice belongs to one lot. Carrying it into the next round would bid on a size the
|
|
98
|
+
// viewer chose for something else.
|
|
99
|
+
(0, react_1.useEffect)(() => {
|
|
100
|
+
if (!biddingOpen)
|
|
101
|
+
setVariantId(null);
|
|
102
|
+
}, [biddingOpen]);
|
|
103
|
+
const send = (0, react_1.useCallback)((amount, variant) => {
|
|
104
|
+
pendingRef.current = undefined;
|
|
105
|
+
show(null);
|
|
106
|
+
void placeBid({ amount, variantId: variant }).catch((caught) => (0, client_1.getLogger)().error(caught, { at: 'auctionGate.placeBid' }));
|
|
107
|
+
}, [placeBid, show]);
|
|
108
|
+
const requestBid = (0, react_1.useCallback)((amount) => {
|
|
109
|
+
pendingRef.current = amount;
|
|
110
|
+
if (!isLoggedIn)
|
|
111
|
+
return show('signIn');
|
|
112
|
+
if (liveSelling_1.liveSelling.auctions.isBiddingBlocked(unpaidStreamIds, streamingId)) {
|
|
113
|
+
return show('unpaidWins');
|
|
114
|
+
}
|
|
115
|
+
// Null means the check has not finished. Treated as un-accepted, which shows the panel a moment
|
|
116
|
+
// early at worst — the opposite mistake would let a first bid through unseen.
|
|
117
|
+
if (!termsAccepted)
|
|
118
|
+
return show('terms');
|
|
119
|
+
if (variantCount > 1 && !variantId)
|
|
120
|
+
return show('variant');
|
|
121
|
+
send(amount, variantId);
|
|
122
|
+
}, [isLoggedIn, unpaidStreamIds, streamingId, termsAccepted, variantCount, variantId, send, show]);
|
|
123
|
+
const acceptTerms = (0, react_1.useCallback)(() => {
|
|
124
|
+
setTermsAccepted(true);
|
|
125
|
+
void liveSelling_1.liveSelling.auctions
|
|
126
|
+
.acceptTerms()
|
|
127
|
+
.catch((caught) => (0, client_1.getLogger)().error(caught, { at: 'auctionGate.acceptTerms' }));
|
|
128
|
+
// Straight on to the next condition rather than out: the viewer asked to bid, and accepting the
|
|
129
|
+
// rules was a step in that, not the end of it. `show` waits for this panel to go first.
|
|
130
|
+
if (variantCount > 1 && !variantId)
|
|
131
|
+
return show('variant');
|
|
132
|
+
send(pendingRef.current, variantId);
|
|
133
|
+
}, [variantCount, variantId, send, show]);
|
|
134
|
+
const chooseVariant = (0, react_1.useCallback)((chosen) => {
|
|
135
|
+
setVariantId(chosen);
|
|
136
|
+
send(pendingRef.current, chosen);
|
|
137
|
+
}, [send]);
|
|
138
|
+
const dismiss = (0, react_1.useCallback)(() => {
|
|
139
|
+
pendingRef.current = undefined;
|
|
140
|
+
show(null);
|
|
141
|
+
}, [show]);
|
|
142
|
+
return { blocker, variantId, requestBid, acceptTerms, chooseVariant, dismiss, refreshUnpaidWins };
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=useAuctionBidGate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuctionBidGate.js","sourceRoot":"","sources":["../../src/react/useAuctionBidGate.ts"],"names":[],"mappings":";;;AA4EA,8CA+HC;AA3MD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iCAAiE;AAEjE,sCAAsC;AACtC,gDAA6C;AAE7C;;;;;;;;;GASG;AACU,QAAA,gBAAgB,GAAG,GAAG,CAAC;AAqCpC,SAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,GACiB;IACzB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAa,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAiB,IAAI,CAAC,CAAC;IACzE,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAW,EAAE,CAAC,CAAC;IAErE,kFAAkF;IAClF,MAAM,UAAU,GAAG,IAAA,cAAM,EAAqB,SAAS,CAAC,CAAC;IAEzD,kFAAkF;IAClF,MAAM,UAAU,GAAG,IAAA,cAAM,EAAuC,IAAI,CAAC,CAAC;IACtE,IAAA,iBAAS,EACP,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,IAAI,UAAU,CAAC,OAAO;YAAE,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC,EACD,EAAE,CACH,CAAC;IAEF;;;;;OAKG;IACH,MAAM,IAAI,GAAG,IAAA,mBAAW,EAAC,CAAC,IAAgB,EAAE,EAAE;QAC5C,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;Y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Product, LiveProductVariant } from '../sessionTypes';
|
|
3
|
+
/** One winning lot, resolved. */
|
|
4
|
+
export interface AuctionWinRow<TRaw = unknown> {
|
|
5
|
+
/**
|
|
6
|
+
* List key. The win's position in the ledger, because nothing else is unique: the same customer can
|
|
7
|
+
* win the same variant twice on two lots, at the same price.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
product: LiveProduct<TRaw>;
|
|
11
|
+
variant: LiveProductVariant;
|
|
12
|
+
/** What the customer owes for this lot. 0 for a giveaway. */
|
|
13
|
+
winningBid: number;
|
|
14
|
+
isGiveaway: boolean;
|
|
15
|
+
/** Zeroes a giveaway's line at checkout. */
|
|
16
|
+
discountCode: string | null;
|
|
17
|
+
imageUrl: string | null;
|
|
18
|
+
/** The ledger entry with its variant resolved — what `createAuctionCheckout` is given. */
|
|
19
|
+
item: AuctionWinItem;
|
|
20
|
+
}
|
|
21
|
+
export interface UseAuctionWinsState<TRaw = unknown> {
|
|
22
|
+
rows: AuctionWinRow<TRaw>[];
|
|
23
|
+
/** Sum of the bids. Giveaways contribute nothing. */
|
|
24
|
+
totalBids: number;
|
|
25
|
+
/** The stream the tab settles against — `auction_id` on the cart. */
|
|
26
|
+
streamingId: string | null;
|
|
27
|
+
loading: boolean;
|
|
28
|
+
/** Minting the cart. Hold the button while it is true so a double tap cannot mint two. */
|
|
29
|
+
checkingOut: boolean;
|
|
30
|
+
error: string | null;
|
|
31
|
+
refresh: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Builds the auction cart and returns it, or null when there is nothing to settle or the build
|
|
34
|
+
* failed (the reason lands on `error`). Returns the cart id as well as the URL, so store credit can
|
|
35
|
+
* be applied to a cart that did not exist until now.
|
|
36
|
+
*/
|
|
37
|
+
checkout: () => Promise<{
|
|
38
|
+
checkoutUrl: string;
|
|
39
|
+
cartId?: string;
|
|
40
|
+
} | null>;
|
|
41
|
+
}
|
|
42
|
+
export interface UseAuctionWinsOptions {
|
|
43
|
+
/**
|
|
44
|
+
* Whether to read at all. Defaults to "is anyone identified" — wins live on a customer metafield, so
|
|
45
|
+
* signed out there is nothing to read and a request would only fail. Pass the app's own reactive
|
|
46
|
+
* signed-in value to re-read the moment somebody signs in.
|
|
47
|
+
*/
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare function useAuctionWins<TRaw = unknown>(options?: UseAuctionWinsOptions): UseAuctionWinsState<TRaw>;
|
|
51
|
+
//# sourceMappingURL=useAuctionWins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuctionWins.d.ts","sourceRoot":"","sources":["../../src/react/useAuctionWins.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEvE,iCAAiC;AACjC,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,OAAO;IAC3C;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0FAA0F;IAC1F,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB,CAAC,IAAI,GAAG,OAAO;IACjD,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;IAC5B,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,0FAA0F;IAC1F,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;CAC1E;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAyHD,wBAAgB,cAAc,CAAC,IAAI,GAAG,OAAO,EAC3C,OAAO,GAAE,qBAA0B,GAClC,mBAAmB,CAAC,IAAI,CAAC,CAkI3B"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAuctionWins = useAuctionWins;
|
|
4
|
+
/**
|
|
5
|
+
* `useAuctionWins` — the lots this customer won and has not paid for, resolved against the catalogue.
|
|
6
|
+
*
|
|
7
|
+
* The metafield is a ledger of bare ids and amounts; a wins list needs titles, images, variant labels
|
|
8
|
+
* and prices. This is the join: `auctions.wins()` for the ledger, then one `productsByIds` through the
|
|
9
|
+
* commerce adapter for everything it names. Rows come back ready to render, and `checkout()` mints the
|
|
10
|
+
* disposable cart that settles the tab.
|
|
11
|
+
*
|
|
12
|
+
* **Resolving the variant is the point of this hook, not a detail of it.** What the host writes is not
|
|
13
|
+
* what a cart can be built from:
|
|
14
|
+
*
|
|
15
|
+
* - a lot with one variant is recorded with **no variant at all**, and the win still has to be
|
|
16
|
+
* payable — it resolves to the product's only variant
|
|
17
|
+
* - the host writes the variant id **bare** on one path and as a **full GID** on another, so a
|
|
18
|
+
* matcher that assumes either form silently fails on half the wins
|
|
19
|
+
* - a lot whose product has since been deleted from the store can be resolved by nothing, and is
|
|
20
|
+
* dropped rather than carried into a cart that would fail to build
|
|
21
|
+
*
|
|
22
|
+
* A caller that skips this and hands the raw ledger to `createAuctionCheckout` is passing ids the
|
|
23
|
+
* platform may reject outright — which is a checkout button that cannot work, on the one screen a
|
|
24
|
+
* blocked bidder is sent to in order to become unblocked.
|
|
25
|
+
*
|
|
26
|
+
* Not focus-aware, because the SDK has no navigator: the metafield changes host-side mid-stream and
|
|
27
|
+
* again on payment, so the screen that shows this should call `refresh()` when it regains focus — the
|
|
28
|
+
* same division as `refreshStreamRecordsIfStale`.
|
|
29
|
+
*/
|
|
30
|
+
const react_1 = require("react");
|
|
31
|
+
const client_1 = require("../client");
|
|
32
|
+
const liveSelling_1 = require("../liveSelling");
|
|
33
|
+
const LOAD_FAILED = 'Could not load your auction wins';
|
|
34
|
+
const CHECKOUT_FAILED = 'Could not start checkout. Please try again.';
|
|
35
|
+
/**
|
|
36
|
+
* How close together two reads have to be before the second is served by the first.
|
|
37
|
+
*
|
|
38
|
+
* A ledger read is two network round trips (the metafield, then the catalogue), and `refresh()` is wired
|
|
39
|
+
* to navigation focus by design — so the caller decides how often this runs, and callers get that wrong
|
|
40
|
+
* in a way that is invisible from here. `useCart().refresh` from `@apptile/sdk-shopify` is a
|
|
41
|
+
* `useCallback` keyed on the cart object and it *replaces the cart* when it resolves, so a focus effect
|
|
42
|
+
* listing it as a dependency re-runs on its own result, forever. Sharing that effect put this hook in
|
|
43
|
+
* the loop: every read superseded the one before it, so the list never settled and the tab spun for as
|
|
44
|
+
* long as you looked at it.
|
|
45
|
+
*
|
|
46
|
+
* Coalescing here rather than only fixing the call site, because the same mistake is one line away in
|
|
47
|
+
* any screen, and the symptom (a permanent spinner) does not look like a dependency-array bug.
|
|
48
|
+
*/
|
|
49
|
+
const MIN_RELOAD_GAP_MS = 2000;
|
|
50
|
+
/** Bare numeric tail of an id, whichever form it arrives in. */
|
|
51
|
+
function bareId(id) {
|
|
52
|
+
var _a;
|
|
53
|
+
return (_a = id.split('/').pop()) !== null && _a !== void 0 ? _a : id;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Mismatches already reported, so an unchanged ledger is reported once and not once per read.
|
|
57
|
+
*
|
|
58
|
+
* The wins are re-read on every arrival at the tab, and a bad record stays bad — so without this the
|
|
59
|
+
* same merchant typo is announced again every time the shopper looks at their wins, and again on every
|
|
60
|
+
* return from checkout. A repeated report is not more information; it is the same information louder,
|
|
61
|
+
* and it buries whatever is next to it. Keyed by the pair so a *different* bad record still speaks up.
|
|
62
|
+
*
|
|
63
|
+
* Module scope, deliberately: the report is about the record, not about a component, and the hook
|
|
64
|
+
* remounts every time the tab does.
|
|
65
|
+
*/
|
|
66
|
+
const reportedMismatches = new Set();
|
|
67
|
+
/**
|
|
68
|
+
* Whether a fresh read says the same thing as what is already on screen.
|
|
69
|
+
*
|
|
70
|
+
* A read builds new row objects every time, so writing them unconditionally re-renders the list — and
|
|
71
|
+
* any caller whose refresh is driven by a re-render then has a loop with a new array on each turn. The
|
|
72
|
+
* ledger is small and its identity is exactly these four fields, so comparing them is cheaper than the
|
|
73
|
+
* render it avoids.
|
|
74
|
+
*/
|
|
75
|
+
function sameRows(a, b) {
|
|
76
|
+
if (a.length !== b.length)
|
|
77
|
+
return false;
|
|
78
|
+
return a.every((row, index) => {
|
|
79
|
+
const other = b[index];
|
|
80
|
+
return (row.product.id === other.product.id &&
|
|
81
|
+
row.variant.id === other.variant.id &&
|
|
82
|
+
row.winningBid === other.winningBid &&
|
|
83
|
+
row.isGiveaway === other.isGiveaway);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The variant to charge for.
|
|
88
|
+
*
|
|
89
|
+
* Falls back to the product's first rather than dropping the win: a single-variant lot is recorded with
|
|
90
|
+
* no variant, and a paid-for lot must never vanish from the tab over a field the host had no reason to
|
|
91
|
+
* write.
|
|
92
|
+
*
|
|
93
|
+
* **A variant that is recorded but does not belong to this product is a different thing, and it is
|
|
94
|
+
* logged.** It happens — a win read from this store paired a jacket's product id with a variant id
|
|
95
|
+
* belonging to a pair of shoes, because the host's "variant the bidder opted into" can be left over
|
|
96
|
+
* from an earlier lot. The product is the better anchor of the two (it is the lot the host opened, and
|
|
97
|
+
* the bid was recorded against it), so the fallback still stands rather than dropping a binding win.
|
|
98
|
+
* But it means the customer may be billed for a size they did not choose, and the visible symptom lands
|
|
99
|
+
* on support long before anyone looks at a metafield — so it must not pass silently.
|
|
100
|
+
*/
|
|
101
|
+
function resolveVariant(product, item) {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
/**
|
|
104
|
+
* The fallback prefers a variant that can actually be sold, where the recorded one does not.
|
|
105
|
+
*
|
|
106
|
+
* `variants[0]` alone is not good enough, and the same jacket proves it: its first variant is sold out
|
|
107
|
+
* and only one of its six is in stock, so a cart built on the first one comes back with the line at
|
|
108
|
+
* **quantity 0** — an unpayable checkout, which for a blocked bidder is the same dead end as no
|
|
109
|
+
* checkout at all. A guess that has to be made should at least be made in favour of the win being
|
|
110
|
+
* settleable.
|
|
111
|
+
*
|
|
112
|
+
* Only the *fallback* does this. A recorded variant is honoured even when it is out of stock: that is
|
|
113
|
+
* the thing the customer won, and quietly billing them for another size would be worse than a
|
|
114
|
+
* checkout they have to ask about.
|
|
115
|
+
*/
|
|
116
|
+
const fallback = () => { var _a, _b; return (_b = (_a = product.variants.find((variant) => variant.available)) !== null && _a !== void 0 ? _a : product.variants[0]) !== null && _b !== void 0 ? _b : null; };
|
|
117
|
+
if (item.variantId) {
|
|
118
|
+
const wanted = bareId(String(item.variantId));
|
|
119
|
+
const match = product.variants.find((variant) => bareId(variant.id) === wanted);
|
|
120
|
+
if (match)
|
|
121
|
+
return match;
|
|
122
|
+
/**
|
|
123
|
+
* A warning, not an error, and once per bad record.
|
|
124
|
+
*
|
|
125
|
+
* Nothing failed here: the win is resolved, listed and payable. What happened is that the host's
|
|
126
|
+
* record is wrong and the app chose the product over the variant — which a developer should know,
|
|
127
|
+
* and which is not a fault of the screen the shopper is looking at.
|
|
128
|
+
*/
|
|
129
|
+
const key = `${item.productGid}:${item.variantId}`;
|
|
130
|
+
if (!reportedMismatches.has(key)) {
|
|
131
|
+
reportedMismatches.add(key);
|
|
132
|
+
(0, client_1.logWarning)(new Error('Auction win variant does not belong to its product'), {
|
|
133
|
+
at: 'useAuctionWins.resolveVariant',
|
|
134
|
+
productGid: item.productGid,
|
|
135
|
+
variantId: item.variantId,
|
|
136
|
+
fellBackTo: (_b = (_a = fallback()) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return fallback();
|
|
141
|
+
}
|
|
142
|
+
function useAuctionWins(options = {}) {
|
|
143
|
+
var _a, _b, _c;
|
|
144
|
+
const commerce = (0, client_1.getCommerce)();
|
|
145
|
+
const identified = !!((_b = (_a = (0, client_1.getIdentity)()) === null || _a === void 0 ? void 0 : _a.bidderId) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
146
|
+
const enabled = (_c = options.enabled) !== null && _c !== void 0 ? _c : identified;
|
|
147
|
+
const [rows, setRows] = (0, react_1.useState)([]);
|
|
148
|
+
const [streamingId, setStreamingId] = (0, react_1.useState)(null);
|
|
149
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
150
|
+
const [checkingOut, setCheckingOut] = (0, react_1.useState)(false);
|
|
151
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
152
|
+
/** Guards state writes after unmount, and drops a slow read that a newer one has overtaken. */
|
|
153
|
+
const readIdRef = (0, react_1.useRef)(0);
|
|
154
|
+
/** The read in flight, and when the last one finished — see `MIN_RELOAD_GAP_MS`. */
|
|
155
|
+
const inFlightRef = (0, react_1.useRef)(null);
|
|
156
|
+
const lastReadAtRef = (0, react_1.useRef)(0);
|
|
157
|
+
const read = (0, react_1.useCallback)(async () => {
|
|
158
|
+
const readId = ++readIdRef.current;
|
|
159
|
+
const settle = (next, stream) => {
|
|
160
|
+
if (readIdRef.current !== readId)
|
|
161
|
+
return;
|
|
162
|
+
setRows((current) => (sameRows(current, next) ? current : next));
|
|
163
|
+
setStreamingId(stream);
|
|
164
|
+
};
|
|
165
|
+
if (!enabled || !commerce) {
|
|
166
|
+
settle([], null);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
setLoading(true);
|
|
170
|
+
setError(null);
|
|
171
|
+
try {
|
|
172
|
+
const wins = await liveSelling_1.liveSelling.auctions.wins();
|
|
173
|
+
if (!wins) {
|
|
174
|
+
settle([], null);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
// One request for the whole ledger — a customer can win the same product on two lots.
|
|
178
|
+
const products = await commerce.productsByIds([
|
|
179
|
+
...new Set(wins.items.map((item) => bareId(item.productGid))),
|
|
180
|
+
]);
|
|
181
|
+
const resolved = [];
|
|
182
|
+
wins.items.forEach((item, index) => {
|
|
183
|
+
const wanted = bareId(item.productGid);
|
|
184
|
+
const product = products.find((candidate) => candidate.storeProductId === wanted);
|
|
185
|
+
// A lot deleted from the store: nothing to render, and nothing a cart could charge for.
|
|
186
|
+
if (!product)
|
|
187
|
+
return;
|
|
188
|
+
const variant = resolveVariant(product, item);
|
|
189
|
+
if (!variant)
|
|
190
|
+
return;
|
|
191
|
+
resolved.push({
|
|
192
|
+
id: `win-${index}`,
|
|
193
|
+
product: product,
|
|
194
|
+
variant,
|
|
195
|
+
winningBid: item.winningBid,
|
|
196
|
+
isGiveaway: item.isGiveaway,
|
|
197
|
+
discountCode: item.discountCode,
|
|
198
|
+
imageUrl: product.imageUrl,
|
|
199
|
+
// The resolved variant id, so the cart is built from something that exists.
|
|
200
|
+
item: { ...item, variantId: variant.id },
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
settle(resolved, wins.streamingId);
|
|
204
|
+
}
|
|
205
|
+
catch (caught) {
|
|
206
|
+
(0, client_1.getLogger)().error(caught, { at: 'useAuctionWins.load' });
|
|
207
|
+
if (readIdRef.current === readId)
|
|
208
|
+
setError(LOAD_FAILED);
|
|
209
|
+
}
|
|
210
|
+
finally {
|
|
211
|
+
if (readIdRef.current === readId)
|
|
212
|
+
setLoading(false);
|
|
213
|
+
}
|
|
214
|
+
}, [commerce, enabled]);
|
|
215
|
+
/**
|
|
216
|
+
* One read at a time, and not twice inside `MIN_RELOAD_GAP_MS`.
|
|
217
|
+
*
|
|
218
|
+
* Both halves matter. Without coalescing, concurrent reads mean every one but the last is discarded by
|
|
219
|
+
* the `readId` guard — including its `setLoading(false)` — so a caller that refreshes faster than the
|
|
220
|
+
* network answers leaves the tab loading forever. Without the floor, a caller in a render loop still
|
|
221
|
+
* issues a read per iteration.
|
|
222
|
+
*/
|
|
223
|
+
const load = (0, react_1.useCallback)(() => {
|
|
224
|
+
if (inFlightRef.current)
|
|
225
|
+
return inFlightRef.current;
|
|
226
|
+
if (Date.now() - lastReadAtRef.current < MIN_RELOAD_GAP_MS)
|
|
227
|
+
return Promise.resolve();
|
|
228
|
+
const pending = read().finally(() => {
|
|
229
|
+
lastReadAtRef.current = Date.now();
|
|
230
|
+
inFlightRef.current = null;
|
|
231
|
+
});
|
|
232
|
+
inFlightRef.current = pending;
|
|
233
|
+
return pending;
|
|
234
|
+
}, [read]);
|
|
235
|
+
(0, react_1.useEffect)(() => {
|
|
236
|
+
void load();
|
|
237
|
+
}, [load]);
|
|
238
|
+
/**
|
|
239
|
+
* The floor applies here too, and 2s is chosen so that it can.
|
|
240
|
+
*
|
|
241
|
+
* Every real reason to refresh is far slower than the floor: the customer walked to Shopify's checkout
|
|
242
|
+
* and back, or opened the tab having been elsewhere in the app. Nothing legitimate asks twice in two
|
|
243
|
+
* seconds — but a dependency-array mistake asks continuously, and that is the case this has to survive.
|
|
244
|
+
*/
|
|
245
|
+
const refresh = (0, react_1.useCallback)(() => {
|
|
246
|
+
void load();
|
|
247
|
+
}, [load]);
|
|
248
|
+
const checkout = (0, react_1.useCallback)(async () => {
|
|
249
|
+
if (!rows.length || !streamingId || !(commerce === null || commerce === void 0 ? void 0 : commerce.createAuctionCheckout))
|
|
250
|
+
return null;
|
|
251
|
+
setCheckingOut(true);
|
|
252
|
+
setError(null);
|
|
253
|
+
try {
|
|
254
|
+
return await commerce.createAuctionCheckout(rows.map((row) => row.item), streamingId);
|
|
255
|
+
}
|
|
256
|
+
catch (caught) {
|
|
257
|
+
(0, client_1.getLogger)().error(caught, { at: 'useAuctionWins.checkout' });
|
|
258
|
+
setError(CHECKOUT_FAILED);
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
finally {
|
|
262
|
+
setCheckingOut(false);
|
|
263
|
+
}
|
|
264
|
+
}, [rows, streamingId, commerce]);
|
|
265
|
+
const totalBids = rows.reduce((sum, row) => sum + (row.isGiveaway ? 0 : row.winningBid), 0);
|
|
266
|
+
return { rows, totalBids, streamingId, loading, checkingOut, error, refresh, checkout };
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=useAuctionWins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuctionWins.js","sourceRoot":"","sources":["../../src/react/useAuctionWins.ts"],"names":[],"mappings":";;AAuMA,wCAoIC;AA3UD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iCAAiE;AAEjE,sCAA4E;AAC5E,gDAA6C;AAmD7C,MAAM,WAAW,GAAG,kCAAkC,CAAC;AACvD,MAAM,eAAe,GAAG,6CAA6C,CAAC;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,iBAAiB,GAAG,IAAK,CAAC;AAEhC,gEAAgE;AAChE,SAAS,MAAM,CAAC,EAAU;;IACxB,OAAO,MAAA,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,mCAAI,EAAE,CAAC;AACnC,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE7C;;;;;;;GAOG;AACH,SAAS,QAAQ,CAAC,CAA2B,EAAE,CAA2B;IACxE,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,C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,CACzC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAC3B,WAAW,CACZ,CAAC;QACJ,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,IAAA,kBAAS,GAAE,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,yBAAyB,EAAE,CAAC,CAAC;YAC7D,QAAQ,CAAC,eAAe,CAAC,CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,cAAc,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAElC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5F,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ClipItem } from '../types';
|
|
2
|
+
export interface UseClipsState {
|
|
3
|
+
clips: ClipItem[];
|
|
4
|
+
loading: boolean;
|
|
5
|
+
error: string | null;
|
|
6
|
+
refresh: () => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function useClips(): UseClipsState;
|
|
9
|
+
//# sourceMappingURL=useClips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClips.d.ts","sourceRoot":"","sources":["../../src/react/useClips.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,wBAAgB,QAAQ,IAAI,aAAa,CAwBxC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useClips = useClips;
|
|
4
|
+
/**
|
|
5
|
+
* `useClips` — the curated clip reel, in the collection's order.
|
|
6
|
+
*
|
|
7
|
+
* Empty (never an error) when no `videoCollectionId` is configured.
|
|
8
|
+
*/
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const liveSelling_1 = require("../liveSelling");
|
|
11
|
+
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
12
|
+
function useClips() {
|
|
13
|
+
const { ready } = (0, LiveSellingProvider_1.useLiveSelling)();
|
|
14
|
+
const [clips, setClips] = (0, react_1.useState)([]);
|
|
15
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
16
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
17
|
+
const refresh = (0, react_1.useCallback)(async () => {
|
|
18
|
+
setLoading(true);
|
|
19
|
+
try {
|
|
20
|
+
const next = await liveSelling_1.liveSelling.clips.list();
|
|
21
|
+
setClips(next);
|
|
22
|
+
setError(null);
|
|
23
|
+
}
|
|
24
|
+
catch (caught) {
|
|
25
|
+
setError(caught instanceof Error ? caught.message : String(caught));
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
setLoading(false);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
(0, react_1.useEffect)(() => {
|
|
32
|
+
if (ready)
|
|
33
|
+
void refresh();
|
|
34
|
+
}, [ready, refresh]);
|
|
35
|
+
return { clips, loading, error, refresh };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AAE,OAAO,CAAC,CAAC,CAAC;IAErB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { LiveSession } from '../sessionTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Reads the shared live session.
|
|
5
|
+
*
|
|
6
|
+
* `TRaw` is your catalogue's own product type — whatever the commerce adapter put on `LiveProduct.raw`.
|
|
7
|
+
* Pass it and `session.products[n].raw` comes back typed, with no cast at the call site:
|
|
8
|
+
* `useLiveSession<ShopifyProduct>()`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useLiveSession<TRaw = unknown>(): LiveSession<TRaw>;
|
|
11
|
+
export interface LiveSessionProviderProps {
|
|
12
|
+
/**
|
|
13
|
+
* Watch this stream instead of whichever one is on air. For a deep link into a specific show; omit
|
|
14
|
+
* for the ordinary case.
|
|
15
|
+
*/
|
|
16
|
+
streamingId?: string;
|
|
17
|
+
/** Shown next to this viewer's own comments and sent with them. Overrides the identity adapter. */
|
|
18
|
+
viewerName?: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Called when the user taps the system PIP window to come back. Navigate to your live screen — the
|
|
21
|
+
* window *is* that screen as far as they are concerned. The SDK cannot do this itself: it lives
|
|
22
|
+
* above the navigator and has no route context.
|
|
23
|
+
*/
|
|
24
|
+
onPipRestore?: (streamingId: string | undefined) => void;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Holds one live session for the whole app. Nothing is joined while no stream is live, so the engine
|
|
29
|
+
* stays idle on an ordinary session.
|
|
30
|
+
*
|
|
31
|
+
* Goes *inside* `LiveSellingProvider`, which is what configures the client.
|
|
32
|
+
*/
|
|
33
|
+
export declare function LiveSessionProvider({ children, ...props }: LiveSessionProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<LiveSession | null>>;
|
|
34
|
+
//# sourceMappingURL=useLiveSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLiveSession.d.ts","sourceRoot":"","sources":["../../src/react/useLiveSession.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAMV,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AAsBzB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,GAAG,OAAO,KAAK,WAAW,CAAC,IAAI,CAAC,CAIlE;AAED,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACzD,QAAQ,EAAE,SAAS,CAAC;CACrB;AA60BD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,+FAGnF"}
|