@tiledev/sdk-apptile-live-selling 0.10.0 → 0.12.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 +94 -1
- package/dist/auctions.d.ts.map +1 -1
- package/dist/auctions.js +22 -1
- package/dist/auctions.js.map +1 -1
- package/dist/commentLinkCards.d.ts +11 -0
- package/dist/commentLinkCards.d.ts.map +1 -0
- package/dist/commentLinkCards.js +70 -0
- package/dist/commentLinkCards.js.map +1 -0
- package/dist/commentLinks.d.ts +29 -0
- package/dist/commentLinks.d.ts.map +1 -1
- package/dist/commentLinks.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +7 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +21 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.web.d.ts +13 -0
- package/dist/react/index.web.d.ts.map +1 -1
- package/dist/react/index.web.js +35 -1
- package/dist/react/index.web.js.map +1 -1
- package/dist/react/showPages.d.ts +102 -0
- package/dist/react/showPages.d.ts.map +1 -0
- package/dist/react/showPages.js +155 -0
- package/dist/react/showPages.js.map +1 -0
- package/dist/react/showPagesOnDevice.d.ts +18 -0
- package/dist/react/showPagesOnDevice.d.ts.map +1 -0
- package/dist/react/showPagesOnDevice.js +31 -0
- package/dist/react/showPagesOnDevice.js.map +1 -0
- package/dist/react/useCommentLinkCards.d.ts +6 -0
- package/dist/react/useCommentLinkCards.d.ts.map +1 -0
- package/dist/react/useCommentLinkCards.js +67 -0
- package/dist/react/useCommentLinkCards.js.map +1 -0
- package/dist/react/useMySilentAuctionBids.d.ts +29 -0
- package/dist/react/useMySilentAuctionBids.d.ts.map +1 -0
- package/dist/react/useMySilentAuctionBids.js +154 -0
- package/dist/react/useMySilentAuctionBids.js.map +1 -0
- package/dist/react/useSilentAuctionLot.d.ts +42 -0
- package/dist/react/useSilentAuctionLot.d.ts.map +1 -0
- package/dist/react/useSilentAuctionLot.js +147 -0
- package/dist/react/useSilentAuctionLot.js.map +1 -0
- package/dist/react/useSilentAuctionLots.d.ts +39 -0
- package/dist/react/useSilentAuctionLots.d.ts.map +1 -0
- package/dist/react/useSilentAuctionLots.js +59 -0
- package/dist/react/useSilentAuctionLots.js.map +1 -0
- package/dist/react/useSilentAuctionRounds.d.ts +14 -0
- package/dist/react/useSilentAuctionRounds.d.ts.map +1 -0
- package/dist/react/useSilentAuctionRounds.js +40 -0
- package/dist/react/useSilentAuctionRounds.js.map +1 -0
- package/dist/replays.d.ts +7 -0
- package/dist/replays.d.ts.map +1 -1
- package/dist/replays.js +16 -0
- package/dist/replays.js.map +1 -1
- package/dist/sessionTypes.d.ts +9 -0
- package/dist/sessionTypes.d.ts.map +1 -1
- package/dist/sessionTypes.js.map +1 -1
- package/dist/shopifyCommerce.d.ts +43 -1
- package/dist/shopifyCommerce.d.ts.map +1 -1
- package/dist/shopifyCommerce.js +62 -2
- package/dist/shopifyCommerce.js.map +1 -1
- package/dist/showPages.d.ts +44 -0
- package/dist/showPages.d.ts.map +1 -0
- package/dist/showPages.js +38 -0
- package/dist/showPages.js.map +1 -0
- package/dist/silentAuctionFeed.d.ts +47 -0
- package/dist/silentAuctionFeed.d.ts.map +1 -0
- package/dist/silentAuctionFeed.js +232 -0
- package/dist/silentAuctionFeed.js.map +1 -0
- package/dist/silentAuctionRules.d.ts +206 -0
- package/dist/silentAuctionRules.d.ts.map +1 -0
- package/dist/silentAuctionRules.js +424 -0
- package/dist/silentAuctionRules.js.map +1 -0
- package/dist/silentAuctions.d.ts +65 -0
- package/dist/silentAuctions.d.ts.map +1 -0
- package/dist/silentAuctions.js +272 -0
- package/dist/silentAuctions.js.map +1 -0
- package/dist/types.d.ts +40 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import type { AuctionBidGate, UseAuctionBidGateOptions } from './useAuctionBidGa
|
|
|
6
6
|
import type { UseAuctionWinsOptions, UseAuctionWinsState } from './useAuctionWins';
|
|
7
7
|
import type { LiveSessionProviderProps } from './useLiveSession';
|
|
8
8
|
import type { LiveVideoTargetProps } from './LiveVideoTarget';
|
|
9
|
+
import { type ItemsYouWonPage, type LiveHubPage, type LiveRail, type UseItemsYouWonPageOptions, type UseLiveHubPageOptions } from './showPages';
|
|
9
10
|
export { LiveSellingProvider, useLiveSelling, type LiveSellingProviderProps, type LiveSellingContextType, } from './LiveSellingProvider';
|
|
10
11
|
export { useHiddenShows, type HiddenShowsForViewer } from './useHiddenShows';
|
|
11
12
|
export { useOngoingLive, type UseOngoingLiveState } from './useOngoingLive';
|
|
@@ -18,7 +19,13 @@ export { useStreamInfo, refreshStreamRecords, refreshStreamRecordsIfStale, type
|
|
|
18
19
|
export { useAuctionCountdown, useShowClock } from './clocks';
|
|
19
20
|
export { useGiveawayEntry, type GiveawayDraw, type UseGiveawayEntryState, type SessionForGiveaway, type UseGiveawayEntryOptions, } from './useGiveawayEntry';
|
|
20
21
|
export { useGiveawayPrize, type UseGiveawayPrizeState } from './useGiveawayPrize';
|
|
22
|
+
export { useCommentLinkCards, type CommentLinkCards } from './useCommentLinkCards';
|
|
23
|
+
export { useSilentAuctionLots, type UseSilentAuctionLotsOptions, type SilentAuctionLotsPage } from './useSilentAuctionLots';
|
|
24
|
+
export { useSilentAuctionLot, type UseSilentAuctionLotOptions, type SilentAuctionLotConsole } from './useSilentAuctionLot';
|
|
25
|
+
export { useMySilentAuctionBids, type UseMySilentAuctionBidsOptions, type MySilentAuctionBidsPage } from './useMySilentAuctionBids';
|
|
26
|
+
export { useSilentAuctionRounds, type UseSilentAuctionRoundsOptions, type SilentAuctionRounds } from './useSilentAuctionRounds';
|
|
21
27
|
export { nativeViewTag } from '../nativeViewTag';
|
|
28
|
+
export { useItemsYouWonPageFor, useLiveHubPageFor, useLiveRailFor, SHOWS_PAGE_SIZE, type ItemsYouWonPage, type LiveHubPage, type LiveRail, type SessionForShowPages, type UseItemsYouWonPageOptions, type UseLiveHubPageOptions, } from './showPages';
|
|
22
29
|
export type { AuctionBidGate, BidBlocker, BidRefusal, UseAuctionBidGateOptions } from './useAuctionBidGate';
|
|
23
30
|
export type { AuctionWinRow, UseAuctionWinsOptions, UseAuctionWinsState } from './useAuctionWins';
|
|
24
31
|
export type { LiveSessionProviderProps } from './useLiveSession';
|
|
@@ -47,4 +54,10 @@ export declare function useAuctionBidGate(_options: UseAuctionBidGateOptions): A
|
|
|
47
54
|
* mints a cart and sends the shopper to checkout — not something a preview should be able to start.
|
|
48
55
|
*/
|
|
49
56
|
export declare function useAuctionWins<TRaw = unknown>(_options?: UseAuctionWinsOptions): UseAuctionWinsState<TRaw>;
|
|
57
|
+
/** The Items You Won tab over the empty wins: signed in, it says nothing was won. */
|
|
58
|
+
export declare function useItemsYouWonPage<TRaw = unknown>(options: UseItemsYouWonPageOptions): ItemsYouWonPage<TRaw>;
|
|
59
|
+
/** The Live tab over the idle session: the recordings are real, the show on air never plays here. */
|
|
60
|
+
export declare function useLiveHubPage(options: UseLiveHubPageOptions): LiveHubPage;
|
|
61
|
+
/** A home screen's live rail over the idle session. */
|
|
62
|
+
export declare function useLiveRail(options: UseLiveHubPageOptions): LiveRail;
|
|
50
63
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/react/index.web.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,qBAAqB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BAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,CAE1E;AAED,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,QAAQ,CAEpE"}
|
package/dist/react/index.web.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SHEET_HANDOFF_MS = exports.NativeVideoView = exports.isNativeVideoSupported = exports.nativeViewTag = exports.useGiveawayPrize = exports.useGiveawayEntry = exports.useShowClock = exports.useAuctionCountdown = exports.refreshStreamRecordsIfStale = exports.refreshStreamRecords = exports.useStreamInfo = exports.useClips = exports.useReplays = exports.useAuction = exports.useLiveStreams = exports.refreshOngoingLive = exports.useOngoingLive = exports.useHiddenShows = exports.useLiveSelling = exports.LiveSellingProvider = void 0;
|
|
3
|
+
exports.SHEET_HANDOFF_MS = exports.NativeVideoView = exports.isNativeVideoSupported = exports.SHOWS_PAGE_SIZE = exports.useLiveRailFor = exports.useLiveHubPageFor = exports.useItemsYouWonPageFor = exports.nativeViewTag = exports.useSilentAuctionRounds = exports.useMySilentAuctionBids = exports.useSilentAuctionLot = exports.useSilentAuctionLots = exports.useCommentLinkCards = exports.useGiveawayPrize = exports.useGiveawayEntry = exports.useShowClock = exports.useAuctionCountdown = exports.refreshStreamRecordsIfStale = exports.refreshStreamRecords = exports.useStreamInfo = exports.useClips = exports.useReplays = exports.useAuction = exports.useLiveStreams = exports.refreshOngoingLive = exports.useOngoingLive = exports.useHiddenShows = exports.useLiveSelling = exports.LiveSellingProvider = void 0;
|
|
4
4
|
exports.LiveSessionProvider = LiveSessionProvider;
|
|
5
5
|
exports.useLiveSession = useLiveSession;
|
|
6
6
|
exports.useLiveShow = useLiveShow;
|
|
7
7
|
exports.LiveVideoTarget = LiveVideoTarget;
|
|
8
8
|
exports.useAuctionBidGate = useAuctionBidGate;
|
|
9
9
|
exports.useAuctionWins = useAuctionWins;
|
|
10
|
+
exports.useItemsYouWonPage = useItemsYouWonPage;
|
|
11
|
+
exports.useLiveHubPage = useLiveHubPage;
|
|
12
|
+
exports.useLiveRail = useLiveRail;
|
|
10
13
|
/**
|
|
11
14
|
* The React layer on the **web** — real where a browser can honestly do the work, inert where it
|
|
12
15
|
* cannot. Metro resolves this file in place of `./index` for web, and TypeScript reads the native
|
|
@@ -35,6 +38,7 @@ const react_1 = require("react");
|
|
|
35
38
|
const react_native_1 = require("react-native");
|
|
36
39
|
const liveShow_1 = require("../liveShow");
|
|
37
40
|
const sessionTypes_1 = require("../sessionTypes");
|
|
41
|
+
const showPages_1 = require("./showPages");
|
|
38
42
|
// Real on the web: the gateway is plain HTTP, and the engine it configures is the no-op build.
|
|
39
43
|
var LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
40
44
|
Object.defineProperty(exports, "LiveSellingProvider", { enumerable: true, get: function () { return LiveSellingProvider_1.LiveSellingProvider; } });
|
|
@@ -67,10 +71,27 @@ var useGiveawayEntry_1 = require("./useGiveawayEntry");
|
|
|
67
71
|
Object.defineProperty(exports, "useGiveawayEntry", { enumerable: true, get: function () { return useGiveawayEntry_1.useGiveawayEntry; } });
|
|
68
72
|
var useGiveawayPrize_1 = require("./useGiveawayPrize");
|
|
69
73
|
Object.defineProperty(exports, "useGiveawayPrize", { enumerable: true, get: function () { return useGiveawayPrize_1.useGiveawayPrize; } });
|
|
74
|
+
var useCommentLinkCards_1 = require("./useCommentLinkCards");
|
|
75
|
+
Object.defineProperty(exports, "useCommentLinkCards", { enumerable: true, get: function () { return useCommentLinkCards_1.useCommentLinkCards; } });
|
|
76
|
+
// Silent auctions are plain requests, so the same on the web.
|
|
77
|
+
var useSilentAuctionLots_1 = require("./useSilentAuctionLots");
|
|
78
|
+
Object.defineProperty(exports, "useSilentAuctionLots", { enumerable: true, get: function () { return useSilentAuctionLots_1.useSilentAuctionLots; } });
|
|
79
|
+
var useSilentAuctionLot_1 = require("./useSilentAuctionLot");
|
|
80
|
+
Object.defineProperty(exports, "useSilentAuctionLot", { enumerable: true, get: function () { return useSilentAuctionLot_1.useSilentAuctionLot; } });
|
|
81
|
+
var useMySilentAuctionBids_1 = require("./useMySilentAuctionBids");
|
|
82
|
+
Object.defineProperty(exports, "useMySilentAuctionBids", { enumerable: true, get: function () { return useMySilentAuctionBids_1.useMySilentAuctionBids; } });
|
|
83
|
+
var useSilentAuctionRounds_1 = require("./useSilentAuctionRounds");
|
|
84
|
+
Object.defineProperty(exports, "useSilentAuctionRounds", { enumerable: true, get: function () { return useSilentAuctionRounds_1.useSilentAuctionRounds; } });
|
|
70
85
|
// Already returns null off device — react-native-web *throws* from `findNodeHandle`, which this
|
|
71
86
|
// wraps, so the honest answer costs nothing here.
|
|
72
87
|
var nativeViewTag_1 = require("../nativeViewTag");
|
|
73
88
|
Object.defineProperty(exports, "nativeViewTag", { enumerable: true, get: function () { return nativeViewTag_1.nativeViewTag; } });
|
|
89
|
+
// Real on the web over the idle session and the empty wins below (0.11.0).
|
|
90
|
+
var showPages_2 = require("./showPages");
|
|
91
|
+
Object.defineProperty(exports, "useItemsYouWonPageFor", { enumerable: true, get: function () { return showPages_2.useItemsYouWonPageFor; } });
|
|
92
|
+
Object.defineProperty(exports, "useLiveHubPageFor", { enumerable: true, get: function () { return showPages_2.useLiveHubPageFor; } });
|
|
93
|
+
Object.defineProperty(exports, "useLiveRailFor", { enumerable: true, get: function () { return showPages_2.useLiveRailFor; } });
|
|
94
|
+
Object.defineProperty(exports, "SHOWS_PAGE_SIZE", { enumerable: true, get: function () { return showPages_2.SHOWS_PAGE_SIZE; } });
|
|
74
95
|
// ─── The session ─────────────────────────────────────────────────────────────
|
|
75
96
|
/** Every action, resolved and doing nothing. There is no room to send any of it to. */
|
|
76
97
|
const IDLE_ACTIONS = {
|
|
@@ -195,4 +216,17 @@ function useAuctionWins(_options) {
|
|
|
195
216
|
checkout: async () => null,
|
|
196
217
|
}), []);
|
|
197
218
|
}
|
|
219
|
+
// ─── The page models ─────────────────────────────────────────────────────────
|
|
220
|
+
/** The Items You Won tab over the empty wins: signed in, it says nothing was won. */
|
|
221
|
+
function useItemsYouWonPage(options) {
|
|
222
|
+
return (0, showPages_1.useItemsYouWonPageFor)(useAuctionWins(), options);
|
|
223
|
+
}
|
|
224
|
+
/** The Live tab over the idle session: the recordings are real, the show on air never plays here. */
|
|
225
|
+
function useLiveHubPage(options) {
|
|
226
|
+
return (0, showPages_1.useLiveHubPageFor)(IDLE_SESSION, options);
|
|
227
|
+
}
|
|
228
|
+
/** A home screen's live rail over the idle session. */
|
|
229
|
+
function useLiveRail(options) {
|
|
230
|
+
return (0, showPages_1.useLiveRailFor)(IDLE_SESSION, options);
|
|
231
|
+
}
|
|
198
232
|
//# sourceMappingURL=index.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../src/react/index.web.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../src/react/index.web.ts"],"names":[],"mappings":";;;AA8KA,kDAEC;AAMD,wCAEC;AAMD,kCAEC;AAeD,0CAEC;AAOD,8CAeC;AAMD,wCAiBC;AAKD,gDAEC;AAGD,wCAEC;AAGD,kCAEC;AA/QD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iCAA0E;AAC1E,+CAAoC;AAIpC,0CAAyD;AACzD,kDAA8D;AAM9D,2CASqB;AAErB,+FAA+F;AAC/F,6DAK+B;AAJ7B,0HAAA,mBAAmB,OAAA;AACnB,qHAAA,cAAc,OAAA;AAIhB,mDAA6E;AAApE,gHAAA,cAAc,OAAA;AACvB,mDAA4E;AAAnE,gHAAA,cAAc,OAAA;AACvB,wDAAyD;AAAhD,sHAAA,kBAAkB,OAAA;AAC3B,mDAA4E;AAAnE,gHAAA,cAAc,OAAA;AACvB,2CAAgE;AAAvD,wGAAA,UAAU,OAAA;AACnB,2CAAwF;AAA/E,wGAAA,UAAU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;AAChE,CAAC;AAED,qGAAqG;AACrG,SAAgB,cAAc,CAAC,OAA8B;IAC3D,OAAO,IAAA,6BAAiB,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,uDAAuD;AACvD,SAAgB,WAAW,CAAC,OAA8B;IACxD,OAAO,IAAA,0BAAc,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type SessionForCard } from '../liveShow';
|
|
2
|
+
import { type ShowListStatus } from '../showPages';
|
|
3
|
+
import type { LiveStream, Replay } from '../types';
|
|
4
|
+
import type { AuctionWinRow, UseAuctionWinsState } from './useAuctionWins';
|
|
5
|
+
/** Recordings per read: the gateway's own page size. */
|
|
6
|
+
export declare const SHOWS_PAGE_SIZE = 20;
|
|
7
|
+
export interface UseItemsYouWonPageOptions {
|
|
8
|
+
/** Someone is signed in (the wins are on the customer's record): sdk-shopify's `useCustomer().loggedIn`. */
|
|
9
|
+
signedIn: boolean;
|
|
10
|
+
/** A stored session is still being read on app open (`useCustomer().restoring`). */
|
|
11
|
+
restoring?: boolean;
|
|
12
|
+
/** Checkout is starting (an `initiateCheckout`): what is being paid for. */
|
|
13
|
+
onCheckoutStarted?: (wins: {
|
|
14
|
+
totalItems: number;
|
|
15
|
+
totalValue: number;
|
|
16
|
+
currency: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
/** The wins' own cart is ready: the app opens its checkout page on `checkoutUrl`. */
|
|
19
|
+
onCheckoutReady?: (checkout: {
|
|
20
|
+
checkoutUrl: string;
|
|
21
|
+
cartId?: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
/** The cart couldn't be built; `message` says so (the SDK's words). */
|
|
24
|
+
onCheckoutFailed?: (message: string) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface ItemsYouWonPage<TRaw = unknown> {
|
|
27
|
+
/**
|
|
28
|
+
* `signedOut` (and not reading a stored session), `loading` (that session, or the first read with
|
|
29
|
+
* nothing shown), `failed` (with nothing to show), `empty` (nothing won), `ready`.
|
|
30
|
+
*/
|
|
31
|
+
status: 'signedOut' | 'loading' | 'failed' | 'empty' | 'ready';
|
|
32
|
+
rows: AuctionWinRow<TRaw>[];
|
|
33
|
+
/** The sum of the bids, in the wins' currency: nothing comes off (prizes are free). */
|
|
34
|
+
total: {
|
|
35
|
+
amount: string;
|
|
36
|
+
currencyCode: string;
|
|
37
|
+
};
|
|
38
|
+
/** A read is running with wins on screen (a pull). */
|
|
39
|
+
refreshing: boolean;
|
|
40
|
+
/** Reads the wins again (a pull, the failed state's Try again). */
|
|
41
|
+
refresh: () => void;
|
|
42
|
+
/** Call each time the tab comes into view: reads the wins again when signed in. Keeps one identity. */
|
|
43
|
+
viewed: () => void;
|
|
44
|
+
/** Builds the wins' own cart (each lot at its bid, prizes free), then `onCheckoutReady`. */
|
|
45
|
+
checkout: () => void;
|
|
46
|
+
checkingOut: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** The Items You Won tab, over `useAuctionWins`' state. */
|
|
49
|
+
export declare function useItemsYouWonPageFor<TRaw = unknown>(wins: UseAuctionWinsState<TRaw>, options: UseItemsYouWonPageOptions): ItemsYouWonPage<TRaw>;
|
|
50
|
+
/** What the page models read of the app's live session. */
|
|
51
|
+
export type SessionForShowPages = SessionForCard & {
|
|
52
|
+
viewerCount: number;
|
|
53
|
+
};
|
|
54
|
+
export interface UseLiveHubPageOptions {
|
|
55
|
+
/** The tab is the screen on show (`useIsFocused()`): only then does its card play the show. */
|
|
56
|
+
screenOnShow: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface LiveHubPage {
|
|
59
|
+
/** The show on air (the app-wide `useOngoingLive`), or null. */
|
|
60
|
+
onAir: LiveStream | null;
|
|
61
|
+
/** How many are watching, once the session is in the show's room and has said; else null. */
|
|
62
|
+
viewerCount: number | null;
|
|
63
|
+
/** The card may play the show, muted (`canPlayInCard`): one picture at a time. */
|
|
64
|
+
videoActive: boolean;
|
|
65
|
+
/** The recordings this viewer can see, playable only, in the archive's order. */
|
|
66
|
+
replays: Replay[];
|
|
67
|
+
/** Where the recordings stand (`showListStatus`): never `empty` or `failed` while a show is on air. */
|
|
68
|
+
status: ShowListStatus;
|
|
69
|
+
/** The next page is on its way, with recordings on screen. */
|
|
70
|
+
loadingMore: boolean;
|
|
71
|
+
/** The next page, half a screen from the end: one ask at a time, none after the archive's end. */
|
|
72
|
+
loadMore: () => void;
|
|
73
|
+
/** A pull is running. */
|
|
74
|
+
refreshing: boolean;
|
|
75
|
+
/** Reads the show on air and the recordings' first page again. */
|
|
76
|
+
pullToRefresh: () => void;
|
|
77
|
+
/** Reads both again, without the pull's spinner (the failed state's Try again). */
|
|
78
|
+
refresh: () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Call each time the tab comes into view: reads the show on air again, and on a return visit the
|
|
81
|
+
* recordings' first page too, unless the shopper has scrolled past it (a first-page read drops the
|
|
82
|
+
* pages below, and their place). Keeps one identity.
|
|
83
|
+
*/
|
|
84
|
+
viewed: () => void;
|
|
85
|
+
}
|
|
86
|
+
/** The Live tab over a session. */
|
|
87
|
+
export declare function useLiveHubPageFor(session: SessionForShowPages, { screenOnShow }: UseLiveHubPageOptions): LiveHubPage;
|
|
88
|
+
export interface LiveRail {
|
|
89
|
+
/** The show on air, or null. */
|
|
90
|
+
onAir: LiveStream | null;
|
|
91
|
+
/** The rail's card may play the show, muted (`canPlayInCard`). */
|
|
92
|
+
videoActive: boolean;
|
|
93
|
+
/** The recent recordings, playable only. */
|
|
94
|
+
replays: Replay[];
|
|
95
|
+
/** Reads the show on air and the first page of recordings again (with the screen's own pull). */
|
|
96
|
+
refresh: () => Promise<void>;
|
|
97
|
+
/** Call each time the screen comes into view: reads the show on air again (the recordings keep their place). */
|
|
98
|
+
viewed: () => void;
|
|
99
|
+
}
|
|
100
|
+
/** A home screen's live rail over a session. */
|
|
101
|
+
export declare function useLiveRailFor(session: SessionForCard, { screenOnShow }: UseLiveHubPageOpt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AED,mCAAmC;AACnC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,YAAY,EAAE,EAAE,qBAAqB,GAAG,WAAW,CAkEpH;AAID,MAAM,WAAW,QAAQ;IACvB,gCAAgC;IAChC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,kEAAkE;IAClE,WAAW,EAAE,OAAO,CAAC;IACrB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iGAAiG;IACjG,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,gHAAgH;IAChH,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,YAAY,EAAE,EAAE,qBAAqB,GAAG,QAAQ,CAiBzG"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SHOWS_PAGE_SIZE = void 0;
|
|
4
|
+
exports.useItemsYouWonPageFor = useItemsYouWonPageFor;
|
|
5
|
+
exports.useLiveHubPageFor = useLiveHubPageFor;
|
|
6
|
+
exports.useLiveRailFor = useLiveRailFor;
|
|
7
|
+
/**
|
|
8
|
+
* Live selling's page models (0.11.0, moved from amore-v2's page hooks): the Items You Won tab, the Live
|
|
9
|
+
* tab (`LiveHub`) and a home screen's live rail. Each is the `…For` hook here, given the session or the
|
|
10
|
+
* wins it reads, so the web entry can hand it its idle stand-ins; the app calls the plain names
|
|
11
|
+
* (`useItemsYouWonPage`, `useLiveHubPage`, `useLiveRail`), which read them itself. No words, no
|
|
12
|
+
* formatting, no navigation: where the shopper goes is the app's `on…` option.
|
|
13
|
+
*/
|
|
14
|
+
const react_1 = require("react");
|
|
15
|
+
const liveShow_1 = require("../liveShow");
|
|
16
|
+
const showPages_1 = require("../showPages");
|
|
17
|
+
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
18
|
+
const useOngoingLive_1 = require("./useOngoingLive");
|
|
19
|
+
const useReplays_1 = require("./useReplays");
|
|
20
|
+
/** Recordings per read: the gateway's own page size. */
|
|
21
|
+
exports.SHOWS_PAGE_SIZE = 20;
|
|
22
|
+
const CHECKOUT_FAILED = 'Could not start checkout. Please try again.';
|
|
23
|
+
/** The Items You Won tab, over `useAuctionWins`' state. */
|
|
24
|
+
function useItemsYouWonPageFor(wins, options) {
|
|
25
|
+
const optionsRef = (0, react_1.useRef)(options);
|
|
26
|
+
optionsRef.current = options;
|
|
27
|
+
const { refresh: readWins, checkout: buildCart } = wins;
|
|
28
|
+
const total = (0, react_1.useMemo)(() => (0, showPages_1.winsTotal)(wins.rows), [wins.rows]);
|
|
29
|
+
const hasWins = wins.rows.length > 0;
|
|
30
|
+
const viewed = (0, react_1.useCallback)(() => {
|
|
31
|
+
if (optionsRef.current.signedIn)
|
|
32
|
+
readWins();
|
|
33
|
+
}, [readWins]);
|
|
34
|
+
const rowsRef = (0, react_1.useRef)(wins.rows);
|
|
35
|
+
rowsRef.current = wins.rows;
|
|
36
|
+
const checkout = (0, react_1.useCallback)(() => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
const rows = rowsRef.current;
|
|
39
|
+
const totals = (0, showPages_1.winsTotal)(rows);
|
|
40
|
+
(_b = (_a = optionsRef.current).onCheckoutStarted) === null || _b === void 0 ? void 0 : _b.call(_a, { totalItems: rows.length, totalValue: Number(totals.amount), currency: totals.currencyCode });
|
|
41
|
+
void (async () => {
|
|
42
|
+
var _a, _b, _c, _d;
|
|
43
|
+
const cart = await buildCart();
|
|
44
|
+
if (!cart) {
|
|
45
|
+
(_b = (_a = optionsRef.current).onCheckoutFailed) === null || _b === void 0 ? void 0 : _b.call(_a, CHECKOUT_FAILED);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
(_d = (_c = optionsRef.current).onCheckoutReady) === null || _d === void 0 ? void 0 : _d.call(_c, cart);
|
|
49
|
+
})();
|
|
50
|
+
}, [buildCart]);
|
|
51
|
+
const { signedIn, restoring = false } = options;
|
|
52
|
+
let status;
|
|
53
|
+
if (!signedIn && !restoring)
|
|
54
|
+
status = 'signedOut';
|
|
55
|
+
else if (restoring || (wins.loading && !hasWins))
|
|
56
|
+
status = 'loading';
|
|
57
|
+
else if (hasWins)
|
|
58
|
+
status = 'ready';
|
|
59
|
+
else
|
|
60
|
+
status = wins.error ? 'failed' : 'empty';
|
|
61
|
+
return {
|
|
62
|
+
status,
|
|
63
|
+
rows: wins.rows,
|
|
64
|
+
total,
|
|
65
|
+
refreshing: wins.loading && hasWins,
|
|
66
|
+
refresh: readWins,
|
|
67
|
+
viewed,
|
|
68
|
+
checkout,
|
|
69
|
+
checkingOut: wins.checkingOut,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** The Live tab over a session. */
|
|
73
|
+
function useLiveHubPageFor(session, { screenOnShow }) {
|
|
74
|
+
var _a;
|
|
75
|
+
const { ready } = (0, LiveSellingProvider_1.useLiveSelling)();
|
|
76
|
+
const onAirRead = (0, useOngoingLive_1.useOngoingLive)();
|
|
77
|
+
const recordings = (0, useReplays_1.useReplays)({ pageSize: exports.SHOWS_PAGE_SIZE, playableOnly: true });
|
|
78
|
+
const { refresh: refreshOnAir } = onAirRead;
|
|
79
|
+
const { refresh: refreshRecordings, loadMore: readNextPage, hasRead, hasMore, loading, error } = recordings;
|
|
80
|
+
const shownCount = recordings.replays.length;
|
|
81
|
+
const onAir = onAirRead.liveNow;
|
|
82
|
+
const sessionInTheRoom = !!onAir && ((_a = session.stream) === null || _a === void 0 ? void 0 : _a.streamingId) === onAir.streamingId;
|
|
83
|
+
const viewerCount = sessionInTheRoom && session.viewerCount > 0 ? session.viewerCount : null;
|
|
84
|
+
// One ask at a time: `useReplays` moves its offset with every answer, so two asks would skip a page.
|
|
85
|
+
// Not after a first read that failed with nothing to show: the failed state's Try again reads again.
|
|
86
|
+
const [loadingNextPage, setLoadingNextPage] = (0, react_1.useState)(false);
|
|
87
|
+
const askingForNextPage = (0, react_1.useRef)(false);
|
|
88
|
+
const loadMore = (0, react_1.useCallback)(() => {
|
|
89
|
+
if (askingForNextPage.current || !ready || !hasRead || !hasMore || loading || (!!error && shownCount === 0))
|
|
90
|
+
return;
|
|
91
|
+
askingForNextPage.current = true;
|
|
92
|
+
setLoadingNextPage(true);
|
|
93
|
+
void readNextPage().finally(() => {
|
|
94
|
+
askingForNextPage.current = false;
|
|
95
|
+
setLoadingNextPage(false);
|
|
96
|
+
});
|
|
97
|
+
}, [ready, hasRead, hasMore, loading, error, shownCount, readNextPage]);
|
|
98
|
+
// Everything read so far was hidden from this viewer and the archive goes on: read on.
|
|
99
|
+
const readingOn = (0, showPages_1.readsOnPastHidden)({ hasRead, shownCount, hasMore, failed: !!error });
|
|
100
|
+
(0, react_1.useEffect)(() => {
|
|
101
|
+
if (readingOn && !loading)
|
|
102
|
+
loadMore();
|
|
103
|
+
}, [readingOn, loading, loadMore]);
|
|
104
|
+
const refreshBoth = (0, react_1.useCallback)(() => Promise.all([refreshOnAir(), refreshRecordings()]), [refreshOnAir, refreshRecordings]);
|
|
105
|
+
const [refreshing, setRefreshing] = (0, react_1.useState)(false);
|
|
106
|
+
const pullToRefresh = (0, react_1.useCallback)(() => {
|
|
107
|
+
setRefreshing(true);
|
|
108
|
+
void refreshBoth().finally(() => setRefreshing(false));
|
|
109
|
+
}, [refreshBoth]);
|
|
110
|
+
const refresh = (0, react_1.useCallback)(() => void refreshBoth(), [refreshBoth]);
|
|
111
|
+
const latest = (0, react_1.useRef)({ ready, loading, shownCount, refreshOnAir, refreshRecordings });
|
|
112
|
+
latest.current = { ready, loading, shownCount, refreshOnAir, refreshRecordings };
|
|
113
|
+
const visitedBefore = (0, react_1.useRef)(false);
|
|
114
|
+
const viewed = (0, react_1.useCallback)(() => {
|
|
115
|
+
const firstVisit = !visitedBefore.current;
|
|
116
|
+
visitedBefore.current = true;
|
|
117
|
+
const now = latest.current;
|
|
118
|
+
if (!now.ready)
|
|
119
|
+
return; // The reads start by themselves once the SDK is ready.
|
|
120
|
+
void now.refreshOnAir();
|
|
121
|
+
// The first visit's recordings are `useReplays`' own first read.
|
|
122
|
+
if (!firstVisit && !now.loading && now.shownCount <= exports.SHOWS_PAGE_SIZE)
|
|
123
|
+
void now.refreshRecordings();
|
|
124
|
+
}, []);
|
|
125
|
+
return {
|
|
126
|
+
onAir,
|
|
127
|
+
viewerCount,
|
|
128
|
+
videoActive: (0, liveShow_1.canPlayInCard)({ session, show: onAir, screenOnShow }),
|
|
129
|
+
replays: recordings.replays,
|
|
130
|
+
status: (0, showPages_1.showListStatus)({ hasRead, loading, shownCount, hasMore, failed: !!error, onAir: !!onAir }),
|
|
131
|
+
loadingMore: loadingNextPage && shownCount > 0,
|
|
132
|
+
loadMore,
|
|
133
|
+
refreshing,
|
|
134
|
+
pullToRefresh,
|
|
135
|
+
refresh,
|
|
136
|
+
viewed,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/** A home screen's live rail over a session. */
|
|
140
|
+
function useLiveRailFor(session, { screenOnShow }) {
|
|
141
|
+
const { liveNow, refresh: refreshOnAir } = (0, useOngoingLive_1.useOngoingLive)();
|
|
142
|
+
const { replays, refresh: refreshRecordings } = (0, useReplays_1.useReplays)({ pageSize: exports.SHOWS_PAGE_SIZE, playableOnly: true });
|
|
143
|
+
const refresh = (0, react_1.useCallback)(() => Promise.all([refreshOnAir(), refreshRecordings()]).then(() => undefined), [refreshOnAir, refreshRecordings]);
|
|
144
|
+
const viewed = (0, react_1.useCallback)(() => {
|
|
145
|
+
void refreshOnAir();
|
|
146
|
+
}, [refreshOnAir]);
|
|
147
|
+
return {
|
|
148
|
+
onAir: liveNow,
|
|
149
|
+
videoActive: (0, liveShow_1.canPlayInCard)({ session, show: liveNow, screenOnShow }),
|
|
150
|
+
replays,
|
|
151
|
+
refresh,
|
|
152
|
+
viewed,
|
|
153
|
+
};
|
|
154
|
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the same three over its idle stand-ins.
|
|
4
|
+
*/
|
|
5
|
+
import { type ItemsYouWonPage, type LiveHubPage, type LiveRail, type UseItemsYouWonPageOptions, type UseLiveHubPageOptions } from './showPages';
|
|
6
|
+
/**
|
|
7
|
+
* The Items You Won tab (0.11.0): the lots and prizes the shopper won and hasn't paid for
|
|
8
|
+
* (`useAuctionWins`), its states, and its checkout on a cart of its own.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useItemsYouWonPage<TRaw = unknown>(options: UseItemsYouWonPageOptions): ItemsYouWonPage<TRaw>;
|
|
11
|
+
/**
|
|
12
|
+
* The Live tab (0.11.0): the show on air, playing muted on its card when it may, and the recordings,
|
|
13
|
+
* paged through the whole archive, refreshed on each visit and on a pull.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useLiveHubPage(options: UseLiveHubPageOptions): LiveHubPage;
|
|
16
|
+
/** A home screen's live rail (0.11.0): the show on air and the recent recordings. */
|
|
17
|
+
export declare function useLiveRail(options: UseLiveHubPageOptions): LiveRail;
|
|
18
|
+
//# sourceMappingURL=showPagesOnDevice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showPagesOnDevice.d.ts","sourceRoot":"","sources":["../../src/react/showPagesOnDevice.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;AAIrB;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,yBAAyB,GAAG,eAAe,CAAC,IAAI,CAAC,CAE5G;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,CAE1E;AAED,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,QAAQ,CAEpE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useItemsYouWonPage = useItemsYouWonPage;
|
|
4
|
+
exports.useLiveHubPage = useLiveHubPage;
|
|
5
|
+
exports.useLiveRail = useLiveRail;
|
|
6
|
+
/**
|
|
7
|
+
* The page models on a device: each reads the real wins or the app's live session. The web entry
|
|
8
|
+
* (`index.web.ts`) builds the same three over its idle stand-ins.
|
|
9
|
+
*/
|
|
10
|
+
const showPages_1 = require("./showPages");
|
|
11
|
+
const useAuctionWins_1 = require("./useAuctionWins");
|
|
12
|
+
const useLiveSession_1 = require("./useLiveSession");
|
|
13
|
+
/**
|
|
14
|
+
* The Items You Won tab (0.11.0): the lots and prizes the shopper won and hasn't paid for
|
|
15
|
+
* (`useAuctionWins`), its states, and its checkout on a cart of its own.
|
|
16
|
+
*/
|
|
17
|
+
function useItemsYouWonPage(options) {
|
|
18
|
+
return (0, showPages_1.useItemsYouWonPageFor)((0, useAuctionWins_1.useAuctionWins)(), options);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The Live tab (0.11.0): the show on air, playing muted on its card when it may, and the recordings,
|
|
22
|
+
* paged through the whole archive, refreshed on each visit and on a pull.
|
|
23
|
+
*/
|
|
24
|
+
function useLiveHubPage(options) {
|
|
25
|
+
return (0, showPages_1.useLiveHubPageFor)((0, useLiveSession_1.useLiveSession)(), options);
|
|
26
|
+
}
|
|
27
|
+
/** A home screen's live rail (0.11.0): the show on air and the recent recordings. */
|
|
28
|
+
function useLiveRail(options) {
|
|
29
|
+
return (0, showPages_1.useLiveRailFor)((0, useLiveSession_1.useLiveSession)(), options);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=showPagesOnDevice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showPagesOnDevice.js","sourceRoot":"","sources":["../../src/react/showPagesOnDevice.ts"],"names":[],"mappings":";;AAqBA,gDAEC;AAMD,wCAEC;AAGD,kCAEC;AApCD;;;GAGG;AACH,2CASqB;AACrB,qDAAkD;AAClD,qDAAkD;AAElD;;;GAGG;AACH,SAAgB,kBAAkB,CAAiB,OAAkC;IACnF,OAAO,IAAA,iCAAqB,EAAC,IAAA,+BAAc,GAAQ,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,OAA8B;IAC3D,OAAO,IAAA,6BAAiB,EAAC,IAAA,+BAAc,GAAE,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED,qFAAqF;AACrF,SAAgB,WAAW,CAAC,OAA8B;IACxD,OAAO,IAAA,0BAAc,EAAC,IAAA,+BAAc,GAAE,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type CommentLinkCard } from '../commentLinks';
|
|
2
|
+
import type { LiveComment } from '../types';
|
|
3
|
+
/** Cards by the URL that produced them. */
|
|
4
|
+
export type CommentLinkCards = Record<string, CommentLinkCard>;
|
|
5
|
+
export declare function useCommentLinkCards(comments: LiveComment[], storefrontHosts: string[]): CommentLinkCards;
|
|
6
|
+
//# sourceMappingURL=useCommentLinkCards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommentLinkCards.d.ts","sourceRoot":"","sources":["../../src/react/useCommentLinkCards.ts"],"names":[],"mappings":"AAcA,OAAO,EAA4D,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEjH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,2CAA2C;AAC3C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE/D,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,gBAAgB,CA4CxG"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCommentLinkCards = useCommentLinkCards;
|
|
4
|
+
/**
|
|
5
|
+
* The cards for the store links in a show's comments (0.12.0, moved from Sparkl's app on 2026-10-17).
|
|
6
|
+
*
|
|
7
|
+
* `useCommentLinkCards(comments, storefrontHosts)` finds every store link in the comments
|
|
8
|
+
* (`toCommentSegments`, then `classifyCommentLink` against the app's own domains), asks for each card
|
|
9
|
+
* once (`resolveCommentLinkCard`) and returns them by the link's URL, which is what a comment's link
|
|
10
|
+
* segment has to hand. A card appears when its read lands. Outside links have none: the host's
|
|
11
|
+
* `urlPreview` covers those.
|
|
12
|
+
*
|
|
13
|
+
* Which comments draw a card, and what a tap opens, stay the app's: Sparkl draws one card per host or
|
|
14
|
+
* moderator comment (the first link that has one) and opens its own Product and Collection screens.
|
|
15
|
+
*/
|
|
16
|
+
const react_1 = require("react");
|
|
17
|
+
const commentLinks_1 = require("../commentLinks");
|
|
18
|
+
const commentLinkCards_1 = require("../commentLinkCards");
|
|
19
|
+
function useCommentLinkCards(comments, storefrontHosts) {
|
|
20
|
+
var _a;
|
|
21
|
+
// The value, not just the setter: the memo below has to see it change, or a card that lands never
|
|
22
|
+
// reaches the comments.
|
|
23
|
+
const [revision, setRevision] = (0, react_1.useState)(0);
|
|
24
|
+
const hosts = storefrontHosts.join(' ');
|
|
25
|
+
const links = (0, react_1.useMemo)(() => {
|
|
26
|
+
const seen = new Map();
|
|
27
|
+
for (const comment of comments) {
|
|
28
|
+
for (const segment of (0, commentLinks_1.toCommentSegments)(comment.text)) {
|
|
29
|
+
if (segment.kind !== 'link' || seen.has(segment.url))
|
|
30
|
+
continue;
|
|
31
|
+
const link = (0, commentLinks_1.classifyCommentLink)(segment.url, storefrontHosts);
|
|
32
|
+
if (link.kind !== 'external')
|
|
33
|
+
seen.set(segment.url, link);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return [...seen.values()];
|
|
37
|
+
// The count and the last id, not the array: the session hands a fresh array on every tick, and
|
|
38
|
+
// walking every comment each time is wasted work in a busy chat.
|
|
39
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
+
}, [comments.length, (_a = comments[comments.length - 1]) === null || _a === void 0 ? void 0 : _a.id, hosts]);
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
const unasked = links.filter((link) => (0, commentLinkCards_1.cachedCommentLinkCard)(link) === undefined);
|
|
43
|
+
if (!unasked.length)
|
|
44
|
+
return;
|
|
45
|
+
let alive = true;
|
|
46
|
+
void Promise.all(unasked.map((link) => (0, commentLinkCards_1.resolveCommentLinkCard)(link))).then((answers) => {
|
|
47
|
+
// Draw again only when a card landed; comments full of dead links stay still.
|
|
48
|
+
if (alive && answers.some(Boolean))
|
|
49
|
+
setRevision((n) => n + 1);
|
|
50
|
+
});
|
|
51
|
+
return () => {
|
|
52
|
+
alive = false;
|
|
53
|
+
};
|
|
54
|
+
}, [links]);
|
|
55
|
+
return (0, react_1.useMemo)(() => {
|
|
56
|
+
const found = {};
|
|
57
|
+
for (const link of links) {
|
|
58
|
+
const card = (0, commentLinkCards_1.cachedCommentLinkCard)(link);
|
|
59
|
+
if (card)
|
|
60
|
+
found[link.url] = card;
|
|
61
|
+
}
|
|
62
|
+
return found;
|
|
63
|
+
// Again when the links change and when a read lands; the remembered cards are the truth either way.
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
+
}, [links, revision]);
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=useCommentLinkCards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommentLinkCards.js","sourceRoot":"","sources":["../../src/react/useCommentLinkCards.ts"],"names":[],"mappings":";;AAqBA,kDA4CC;AAjED;;;;;;;;;;;GAWG;AACH,iCAAqD;AAErD,kDAAiH;AACjH,0DAAoF;AAMpF,SAAgB,mBAA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AAI,CAAC,OAAO,CAAC,MAAM;YAAE,OAAO;QAC5B,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,KAAK,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,yCAAsB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YACrF,8EAA8E;YAC9E,IAAI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;gBAAE,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACV,KAAK,GAAG,KAAK,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,MAAM,KAAK,GAAqB,EAAE,CAAC;QACnC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,IAAA,wCAAqB,EAAC,IAAI,CAAC,CAAC;YACzC,IAAI,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACnC,CAAC;QACD,OAAO,KAAK,CAAC;QACb,oGAAoG;QACpG,uDAAuD;IACzD,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SilentAuctionItem } from '../silentAuctionFeed';
|
|
2
|
+
export interface UseMySilentAuctionBidsOptions {
|
|
3
|
+
signedIn: boolean;
|
|
4
|
+
/** The stored session is still being read. */
|
|
5
|
+
restoring?: boolean;
|
|
6
|
+
/** The screen is showing: reads and polls only then. */
|
|
7
|
+
screenOnShow: boolean;
|
|
8
|
+
/** Read the lots again this often, ms. Default 2 000; 0 doesn't poll. */
|
|
9
|
+
pollIntervalMs?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface MySilentAuctionBidsPage<TRaw = unknown> {
|
|
12
|
+
status: 'signedOut' | 'loading' | 'failed' | 'empty' | 'ready';
|
|
13
|
+
/** Still open, the soonest to close first. */
|
|
14
|
+
active: SilentAuctionItem<TRaw>[];
|
|
15
|
+
/** Closed with this customer leading, the latest first. */
|
|
16
|
+
won: SilentAuctionItem<TRaw>[];
|
|
17
|
+
/** Closed otherwise, the latest first. */
|
|
18
|
+
lost: SilentAuctionItem<TRaw>[];
|
|
19
|
+
/** The customer the leading badge and the won/lost split compare against. */
|
|
20
|
+
customerId: string | null;
|
|
21
|
+
/** Some bids couldn't be looked up, so the list is knowingly short. */
|
|
22
|
+
incomplete: boolean;
|
|
23
|
+
refreshing: boolean;
|
|
24
|
+
refresh(): void;
|
|
25
|
+
hasMore: boolean;
|
|
26
|
+
loadMore(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function useMySilentAuctionBids<TRaw = unknown>(options: UseMySilentAuctionBidsOptions): MySilentAuctionBidsPage<TRaw>;
|
|
29
|
+
//# sourceMappingURL=useMySilentAuctionBids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMySilentAuctionBids.d.ts","sourceRoot":"","sources":["../../src/react/useMySilentAuctionBids.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAI9D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wDAAwD;IACxD,YAAY,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB,CAAC,IAAI,GAAG,OAAO;IACrD,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IAC/D,8CAA8C;IAC9C,MAAM,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,2DAA2D;IAC3D,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC/B,0CAA0C;IAC1C,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;IAChC,6EAA6E;IAC7E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,uEAAuE;IACvE,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,IAAI,IAAI,CAAC;CAClB;AAID,wBAAgB,sBAAsB,CAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,6BAA6B,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAkI5H"}
|