@tiledev/sdk-apptile-live-selling 0.11.0 → 0.12.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.
Files changed (70) hide show
  1. package/README.md +68 -1
  2. package/dist/auctions.d.ts.map +1 -1
  3. package/dist/auctions.js +22 -1
  4. package/dist/auctions.js.map +1 -1
  5. package/dist/commentLinkCards.d.ts +11 -0
  6. package/dist/commentLinkCards.d.ts.map +1 -0
  7. package/dist/commentLinkCards.js +70 -0
  8. package/dist/commentLinkCards.js.map +1 -0
  9. package/dist/commentLinks.d.ts +29 -0
  10. package/dist/commentLinks.d.ts.map +1 -1
  11. package/dist/commentLinks.js.map +1 -1
  12. package/dist/index.d.ts +6 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +39 -3
  15. package/dist/index.js.map +1 -1
  16. package/dist/react/index.d.ts +5 -0
  17. package/dist/react/index.d.ts.map +1 -1
  18. package/dist/react/index.js +11 -1
  19. package/dist/react/index.js.map +1 -1
  20. package/dist/react/index.web.d.ts +5 -0
  21. package/dist/react/index.web.d.ts.map +1 -1
  22. package/dist/react/index.web.js +12 -1
  23. package/dist/react/index.web.js.map +1 -1
  24. package/dist/react/useCommentLinkCards.d.ts +6 -0
  25. package/dist/react/useCommentLinkCards.d.ts.map +1 -0
  26. package/dist/react/useCommentLinkCards.js +67 -0
  27. package/dist/react/useCommentLinkCards.js.map +1 -0
  28. package/dist/react/useMySilentAuctionBids.d.ts +29 -0
  29. package/dist/react/useMySilentAuctionBids.d.ts.map +1 -0
  30. package/dist/react/useMySilentAuctionBids.js +157 -0
  31. package/dist/react/useMySilentAuctionBids.js.map +1 -0
  32. package/dist/react/useSilentAuctionLot.d.ts +42 -0
  33. package/dist/react/useSilentAuctionLot.d.ts.map +1 -0
  34. package/dist/react/useSilentAuctionLot.js +152 -0
  35. package/dist/react/useSilentAuctionLot.js.map +1 -0
  36. package/dist/react/useSilentAuctionLots.d.ts +39 -0
  37. package/dist/react/useSilentAuctionLots.d.ts.map +1 -0
  38. package/dist/react/useSilentAuctionLots.js +63 -0
  39. package/dist/react/useSilentAuctionLots.js.map +1 -0
  40. package/dist/react/useSilentAuctionRounds.d.ts +14 -0
  41. package/dist/react/useSilentAuctionRounds.d.ts.map +1 -0
  42. package/dist/react/useSilentAuctionRounds.js +44 -0
  43. package/dist/react/useSilentAuctionRounds.js.map +1 -0
  44. package/dist/replays.d.ts +7 -0
  45. package/dist/replays.d.ts.map +1 -1
  46. package/dist/replays.js +16 -0
  47. package/dist/replays.js.map +1 -1
  48. package/dist/sessionTypes.d.ts +9 -0
  49. package/dist/sessionTypes.d.ts.map +1 -1
  50. package/dist/sessionTypes.js.map +1 -1
  51. package/dist/shopifyCommerce.d.ts +43 -1
  52. package/dist/shopifyCommerce.d.ts.map +1 -1
  53. package/dist/shopifyCommerce.js +62 -2
  54. package/dist/shopifyCommerce.js.map +1 -1
  55. package/dist/silentAuctionFeed.d.ts +47 -0
  56. package/dist/silentAuctionFeed.d.ts.map +1 -0
  57. package/dist/silentAuctionFeed.js +232 -0
  58. package/dist/silentAuctionFeed.js.map +1 -0
  59. package/dist/silentAuctionRules.d.ts +207 -0
  60. package/dist/silentAuctionRules.d.ts.map +1 -0
  61. package/dist/silentAuctionRules.js +425 -0
  62. package/dist/silentAuctionRules.js.map +1 -0
  63. package/dist/silentAuctions.d.ts +65 -0
  64. package/dist/silentAuctions.d.ts.map +1 -0
  65. package/dist/silentAuctions.js +272 -0
  66. package/dist/silentAuctions.js.map +1 -0
  67. package/dist/types.d.ts +40 -2
  68. package/dist/types.d.ts.map +1 -1
  69. package/dist/types.js.map +1 -1
  70. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../src/react/index.web.ts"],"names":[],"mappings":";;;AAwKA,kDAEC;AAMD,wCAEC;AAMD,kCAEC;AAeD,0CAEC;AAOD,8CAeC;AAMD,wCAiBC;AAKD,gDAEC;AAGD,wC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AAC;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,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,mBAAmB,CAAC,QAAuB,EAAE,eAAyB;;IACpF,kGAAkG;IAClG,wBAAwB;IACxB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAExC,MAAM,KAAK,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACzB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAuB,CAAC;QAC5C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,KAAK,MAAM,OAAO,IAAI,IAAA,gCAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACtD,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;oBAAE,SAAS;gBAC/D,MAAM,IAAI,GAAG,IAAA,kCAAmB,EAAC,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;gBAC/D,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU;oBAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1B,+FAA+F;QAC/F,iEAAiE;QACjE,uDAAuD;IACzD,CAAC,EAAE,CAAC,QAAQ,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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;AAK9D,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,CAoI5H"}
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMySilentAuctionBids = useMySilentAuctionBids;
4
+ /**
5
+ * My Bids as a page model (0.12.0, moved from Sparkl's `MySilentAuctionBids` on 2026-10-17): the lots
6
+ * this customer bid on, split into active, won and lost (`myBidsTabs`).
7
+ *
8
+ * - **The customer's bid record is the list** (`silentAuctions.bidRecord`): the service keeps no
9
+ * per-bidder index. Read each time the screen shows. A failed read isn't "signed out": the last
10
+ * record stays, and the page is `failed` only with nothing to show.
11
+ * - **90 entries to a page** (`loadMore`), read in one bulk call each; a batch that fails leaves the
12
+ * rest (`incomplete`), and only all of them failing is a failure.
13
+ * - **Products are read once** through the commerce adapter and kept, so a poll (every
14
+ * `pollIntervalMs`, 2 000: an open lot is contested) costs one bulk call. Sold-out lots stay: a won
15
+ * lot usually is.
16
+ * - **Restoring counts as loading,** so the signed-out state doesn't flash on a cold start.
17
+ */
18
+ const react_1 = require("react");
19
+ const client_1 = require("../client");
20
+ const silentAuctionRules_1 = require("../silentAuctionRules");
21
+ const silentAuctions_1 = require("../silentAuctions");
22
+ const LiveSellingProvider_1 = require("./LiveSellingProvider");
23
+ function useMySilentAuctionBids(options) {
24
+ var _a, _b, _c;
25
+ const { signedIn, restoring = false, screenOnShow, pollIntervalMs = 2000 } = options;
26
+ const { ready } = (0, LiveSellingProvider_1.useLiveSelling)();
27
+ const [record, setRecord] = (0, react_1.useState)(null);
28
+ const [recordRead, setRecordRead] = (0, react_1.useState)(false);
29
+ const [recordFailed, setRecordFailed] = (0, react_1.useState)(false);
30
+ const [pages, setPages] = (0, react_1.useState)(1);
31
+ const [items, setItems] = (0, react_1.useState)([]);
32
+ const [loading, setLoading] = (0, react_1.useState)(true);
33
+ const [refreshing, setRefreshing] = (0, react_1.useState)(false);
34
+ const [lotsFailed, setLotsFailed] = (0, react_1.useState)(false);
35
+ const [someBatchesFailed, setSomeBatchesFailed] = (0, react_1.useState)(false);
36
+ /** Products by store id, kept across polls. */
37
+ const products = (0, react_1.useRef)(new Map());
38
+ /** Every read starts a new one; an answer from an older one is dropped. */
39
+ const generation = (0, react_1.useRef)(0);
40
+ const readRecord = (0, react_1.useCallback)(async () => {
41
+ if (!signedIn) {
42
+ setRecord(null);
43
+ setRecordFailed(false);
44
+ setRecordRead(true);
45
+ return;
46
+ }
47
+ try {
48
+ setRecord(await silentAuctions_1.silentAuctions.bidRecord());
49
+ setRecordFailed(false);
50
+ }
51
+ catch (caught) {
52
+ // Not "signed out": the token may be fine and the network not. Keep what we had.
53
+ (0, client_1.getLogger)().error(caught, { at: 'useMySilentAuctionBids.record' });
54
+ setRecordFailed(true);
55
+ }
56
+ finally {
57
+ setRecordRead(true);
58
+ }
59
+ }, [signedIn]);
60
+ // Only once the provider has configured the client, as the other silent-auction hooks.
61
+ (0, react_1.useEffect)(() => {
62
+ if (ready && screenOnShow)
63
+ void readRecord();
64
+ }, [ready, screenOnShow, readRecord]);
65
+ const entries = (_a = record === null || record === void 0 ? void 0 : record.entries) !== null && _a !== void 0 ? _a : [];
66
+ const visible = (0, react_1.useMemo)(() => entries.slice(0, pages * silentAuctions_1.BID_RECORD_BATCH_SIZE), [entries, pages]);
67
+ const visibleKey = visible.join(',');
68
+ const load = (0, react_1.useCallback)(async () => {
69
+ const mine = ++generation.current;
70
+ if (visible.length === 0) {
71
+ setItems([]);
72
+ setLoading(false);
73
+ setRefreshing(false);
74
+ return;
75
+ }
76
+ try {
77
+ const { lots, failedBatches, totalBatches } = await silentAuctions_1.silentAuctions.lotsForBidEntries(visible);
78
+ if (mine !== generation.current)
79
+ return;
80
+ const missing = [...new Set(lots.map((lot) => lot.storeProductId).filter((id) => !!id && !products.current.has(id)))];
81
+ const commerce = (0, client_1.getCommerce)();
82
+ if (missing.length && commerce) {
83
+ const read = await commerce.productsByIds(missing);
84
+ if (mine !== generation.current)
85
+ return;
86
+ for (const product of read)
87
+ products.current.set(product.storeProductId, product);
88
+ }
89
+ const next = [];
90
+ for (const lot of lots) {
91
+ const product = lot.storeProductId ? products.current.get(lot.storeProductId) : undefined;
92
+ if (lot.productGid && product)
93
+ next.push({ lot, product: product });
94
+ }
95
+ setItems(next);
96
+ setLotsFailed(totalBatches > 0 && failedBatches === totalBatches);
97
+ setSomeBatchesFailed(failedBatches > 0 && failedBatches < totalBatches);
98
+ }
99
+ catch (caught) {
100
+ if (mine !== generation.current)
101
+ return;
102
+ (0, client_1.getLogger)().error(caught, { at: 'useMySilentAuctionBids.lots' });
103
+ setLotsFailed(true);
104
+ }
105
+ finally {
106
+ if (mine === generation.current) {
107
+ setLoading(false);
108
+ setRefreshing(false);
109
+ }
110
+ }
111
+ // The entries by value: `visible` is a new array each render.
112
+ // eslint-disable-next-line react-hooks/exhaustive-deps
113
+ }, [visibleKey]);
114
+ (0, react_1.useEffect)(() => {
115
+ if (!recordRead)
116
+ return;
117
+ void load();
118
+ }, [recordRead, load]);
119
+ (0, react_1.useEffect)(() => {
120
+ if (!screenOnShow || pollIntervalMs <= 0 || visible.length === 0)
121
+ return undefined;
122
+ const timer = setInterval(() => void load(), pollIntervalMs);
123
+ return () => clearInterval(timer);
124
+ }, [screenOnShow, pollIntervalMs, visible.length, load]);
125
+ const refresh = (0, react_1.useCallback)(() => {
126
+ setRefreshing(true);
127
+ void readRecord();
128
+ void load();
129
+ }, [readRecord, load]);
130
+ const hasMore = entries.length > visible.length;
131
+ const loadMore = (0, react_1.useCallback)(() => {
132
+ if (hasMore)
133
+ setPages((count) => count + 1);
134
+ }, [hasMore]);
135
+ const customerId = (_b = record === null || record === void 0 ? void 0 : record.customerId) !== null && _b !== void 0 ? _b : null;
136
+ const tabs = (0, react_1.useMemo)(() => (0, silentAuctionRules_1.myBidsTabs)(items, customerId, Date.now()), [items, customerId]);
137
+ const status = !signedIn && !restoring
138
+ ? 'signedOut'
139
+ : restoring || !recordRead || loading
140
+ ? 'loading'
141
+ : (recordFailed || lotsFailed) && items.length === 0
142
+ ? 'failed'
143
+ : items.length === 0
144
+ ? 'empty'
145
+ : 'ready';
146
+ return {
147
+ status,
148
+ ...tabs,
149
+ customerId,
150
+ incomplete: ((_c = record === null || record === void 0 ? void 0 : record.skipped) !== null && _c !== void 0 ? _c : 0) > 0 || someBatchesFailed,
151
+ refreshing,
152
+ refresh,
153
+ hasMore,
154
+ loadMore,
155
+ };
156
+ }
157
+ //# sourceMappingURL=useMySilentAuctionBids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMySilentAuctionBids.js","sourceRoot":"","sources":["../../src/react/useMySilentAuctionBids.ts"],"names":[],"mappings":";;AAqDA,wDAoIC;AAzLD;;;;;;;;;;;;;GAaG;AACH,iCAA0E;AAE1E,sCAAmD;AAGnD,8DAAmD;AACnD,sDAA0E;AAC1E,+DAAuD;AAgCvD,SAAgB,sBAAsB,CAAiB,OAAsC;;IAC3F,MAAM,EAAE,QAAQ,EAAE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AC;IAEpB,OAAO;QACL,MAAM;QACN,GAAG,IAAI;QACP,UAAU;QACV,UAAU,EAAE,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,CAAC,CAAC,GAAG,CAAC,IAAI,iBAAiB;QAC3D,UAAU;QACV,OAAO;QACP,OAAO;QACP,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { type BidCapState, type SilentAuctionLot, type SilentAuctionPhase } from '../silentAuctionRules';
2
+ export interface UseSilentAuctionLotOptions {
3
+ /** The signed-in customer's id (GID or bare), or null. A bid needs it; reading the lot doesn't. */
4
+ customerId: string | null;
5
+ /** Whether the shopper is signed in (the customer id may still be on its way). */
6
+ signedIn: boolean;
7
+ /** Sent with a bid; the service returns it as the winner's contact. */
8
+ email?: string | null;
9
+ /** The variant the shopper has chosen, which a bid is placed on. */
10
+ variantId?: string | null;
11
+ /** The screen is showing: reads only then. */
12
+ screenOnShow: boolean;
13
+ /** How often the lot is read again, ms. Default 4 000; never under 1 000. */
14
+ pollMs?: number;
15
+ }
16
+ export interface SilentAuctionLotConsole {
17
+ /** The product's lot, or null when it isn't in a round. */
18
+ lot: SilentAuctionLot | null;
19
+ /** `failed` only before any answer. */
20
+ status: 'loading' | 'ready' | 'failed';
21
+ phase: SilentAuctionPhase | null;
22
+ timeLeftMs: number;
23
+ /** What the one-tap bid offers. */
24
+ nextBid: number;
25
+ /** The bid cap, against `nextBid`. */
26
+ bidCap: BidCapState;
27
+ /** This customer holds the leading bid. */
28
+ leading: boolean;
29
+ /** For a closed lot: won, lost, or unknown while the signed-in customer's id is on its way. */
30
+ outcome: 'won' | 'lost' | 'unknown';
31
+ /** The close was pushed back by a late bid, or the service flagged a bidding war. */
32
+ extended: boolean;
33
+ /** A bid now would push the close back. */
34
+ inExtensionWindow: boolean;
35
+ /** A bid is on its way. */
36
+ bidding: boolean;
37
+ placeBid(amount?: number): Promise<void>;
38
+ rebidOnVariant(): Promise<void>;
39
+ refresh(): void;
40
+ }
41
+ export declare function useSilentAuctionLot(productId: string | null, options: UseSilentAuctionLotOptions): SilentAuctionLotConsole;
42
+ //# sourceMappingURL=useSilentAuctionLot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSilentAuctionLot.d.ts","sourceRoot":"","sources":["../../src/react/useSilentAuctionLot.ts"],"names":[],"mappings":"AAsBA,OAAO,EAQL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,0BAA0B;IACzC,mGAAmG;IACnG,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kFAAkF;IAClF,QAAQ,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,8CAA8C;IAC9C,YAAY,EAAE,OAAO,CAAC;IACtB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,2DAA2D;IAC3D,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC7B,uCAAuC;IACvC,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IACvC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,MAAM,EAAE,WAAW,CAAC;IACpB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,+FAA+F;IAC/F,OAAO,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,qFAAqF;IACrF,QAAQ,EAAE,OAAO,CAAC;IAClB,2CAA2C;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,0BAA0B,GAAG,uBAAuB,CAmH1H"}
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSilentAuctionLot = useSilentAuctionLot;
4
+ /**
5
+ * One product's silent-auction lot, for its product page's bid console (0.12.0, moved from Sparkl's
6
+ * `useAuctionConsole` on 2026-10-17).
7
+ *
8
+ * - **Reads the lot every `pollMs`** (4 000) on a one-second tick while `screenOnShow`, one read at a
9
+ * time; a failed read keeps the last lot shown (a second stale beats a console that blinks out
10
+ * mid-round) and is `failed` only before any answer.
11
+ * - **A new product starts from nothing:** another product's answer says nothing about this one.
12
+ * - **`extended`:** the close moved later inside the anti-sniping window (`wasExtended`), or the service
13
+ * flagged a bidding war.
14
+ * - **`placeBid(amount?)`:** the one-tap bid (`nextBid`) or a typed amount, to the service; then, not
15
+ * awaited, the customer's bid record (`silentAuctions.recordBid`, which My Bids reads) and the variant
16
+ * it was placed on (`rememberBidVariant`); then a fresh read. Rejects when the service refuses.
17
+ * - **`rebidOnVariant()`:** the leader picked another size: the bid again at the standing amount, never
18
+ * `nextBid`, so changing size doesn't cost more.
19
+ *
20
+ * Which bottom bar the page draws is `productPageBuyBar`; whether this customer may bid (terms, tags,
21
+ * unpaid wins) stays the app's gate. No words or formatting.
22
+ */
23
+ const react_1 = require("react");
24
+ const shopifyIds_1 = require("../shopifyIds");
25
+ const silentAuctionRules_1 = require("../silentAuctionRules");
26
+ const silentAuctions_1 = require("../silentAuctions");
27
+ const client_1 = require("../client");
28
+ const LiveSellingProvider_1 = require("./LiveSellingProvider");
29
+ function useSilentAuctionLot(productId, options) {
30
+ var _a;
31
+ const { customerId, signedIn, email = null, variantId = null, screenOnShow, pollMs = 4000 } = options;
32
+ // Reads only once the provider has configured the client: before that a read answers "not in a round"
33
+ // without asking (a product page opened from a link, on a cold start).
34
+ const { ready } = (0, LiveSellingProvider_1.useLiveSelling)();
35
+ const [lot, setLot] = (0, react_1.useState)(null);
36
+ const [status, setStatus] = (0, react_1.useState)('loading');
37
+ const [extendedSeen, setExtendedSeen] = (0, react_1.useState)(false);
38
+ const [bidding, setBidding] = (0, react_1.useState)(false);
39
+ const [now, setNow] = (0, react_1.useState)(() => Date.now());
40
+ /** When the last answer landed; the tick compares against it. */
41
+ const lastRead = (0, react_1.useRef)(0);
42
+ const reading = (0, react_1.useRef)(false);
43
+ /** The close time last shown, so an extension can be told from a first read. */
44
+ const previousEndsAt = (0, react_1.useRef)(null);
45
+ /** The product the answers are for, so one for a product the page has left is dropped. */
46
+ const forProduct = (0, react_1.useRef)(productId);
47
+ forProduct.current = productId;
48
+ const load = (0, react_1.useCallback)(async () => {
49
+ var _a;
50
+ if (!productId || reading.current)
51
+ return;
52
+ reading.current = true;
53
+ try {
54
+ const next = await silentAuctions_1.silentAuctions.lot(productId);
55
+ if (forProduct.current !== productId)
56
+ return;
57
+ const before = previousEndsAt.current;
58
+ setLot(next);
59
+ previousEndsAt.current = (_a = next === null || next === void 0 ? void 0 : next.endsAt) !== null && _a !== void 0 ? _a : null;
60
+ if (next && (0, silentAuctionRules_1.wasExtended)(before, next, Date.now()))
61
+ setExtendedSeen(true);
62
+ // An answer, so whatever it said is now known, "no round" included.
63
+ setStatus('ready');
64
+ }
65
+ catch (caught) {
66
+ (0, client_1.getLogger)().error(caught, { at: 'useSilentAuctionLot.read', productId });
67
+ if (forProduct.current === productId)
68
+ setStatus((previous) => (previousEndsAt.current === null ? 'failed' : previous));
69
+ }
70
+ finally {
71
+ reading.current = false;
72
+ lastRead.current = Date.now();
73
+ }
74
+ }, [productId]);
75
+ // A new product: back to knowing nothing, and read it.
76
+ (0, react_1.useEffect)(() => {
77
+ setLot(null);
78
+ setExtendedSeen(false);
79
+ previousEndsAt.current = null;
80
+ lastRead.current = 0;
81
+ if (!productId) {
82
+ // No product to ask about isn't a failed read.
83
+ setStatus('ready');
84
+ return;
85
+ }
86
+ setStatus('loading');
87
+ if (ready)
88
+ void load();
89
+ }, [ready, productId, load]);
90
+ // The tick: the clock moves once a second, and the lot is read again every `pollMs`.
91
+ (0, react_1.useEffect)(() => {
92
+ if (!productId || !screenOnShow)
93
+ return undefined;
94
+ const timer = setInterval(() => setNow(Date.now()), 1000);
95
+ return () => clearInterval(timer);
96
+ }, [productId, screenOnShow]);
97
+ (0, react_1.useEffect)(() => {
98
+ if (!ready || !productId || !screenOnShow)
99
+ return;
100
+ if (Date.now() - lastRead.current < Math.max(pollMs, 1000))
101
+ return;
102
+ void load();
103
+ }, [ready, now, productId, screenOnShow, pollMs, load]);
104
+ const submit = (0, react_1.useCallback)(async (amount) => {
105
+ if (!productId || !customerId || bidding)
106
+ return;
107
+ setBidding(true);
108
+ try {
109
+ await silentAuctions_1.silentAuctions.bid({ productId, customerId, amount, variantId, email });
110
+ // The record My Bids reads, and the size to reopen on. Neither holds the bid up or fails it.
111
+ void silentAuctions_1.silentAuctions.recordBid(productId, lot === null || lot === void 0 ? void 0 : lot.auctionId);
112
+ if (variantId)
113
+ void silentAuctions_1.silentAuctions.rememberBidVariant(productId, variantId);
114
+ }
115
+ finally {
116
+ setBidding(false);
117
+ lastRead.current = 0;
118
+ void load();
119
+ }
120
+ }, [productId, customerId, bidding, variantId, email, lot === null || lot === void 0 ? void 0 : lot.auctionId, load]);
121
+ const offer = lot ? (0, silentAuctionRules_1.nextBid)(lot) : 0;
122
+ const leading = !!lot && (0, silentAuctionRules_1.isLeading)(lot, customerId);
123
+ const placeBid = (0, react_1.useCallback)((amount) => submit(amount !== null && amount !== void 0 ? amount : offer), [submit, offer]);
124
+ const rebidOnVariant = (0, react_1.useCallback)(async () => {
125
+ var _a, _b;
126
+ if (!lot)
127
+ return;
128
+ await submit(((_a = lot.highestBid) !== null && _a !== void 0 ? _a : 0) > 0 ? lot.highestBid : ((_b = lot.startingPrice) !== null && _b !== void 0 ? _b : 0));
129
+ }, [lot, submit]);
130
+ const refresh = (0, react_1.useCallback)(() => {
131
+ lastRead.current = 0;
132
+ void load();
133
+ }, [load]);
134
+ const phase = lot ? (0, silentAuctionRules_1.lotPhase)(lot, now) : null;
135
+ return {
136
+ lot,
137
+ status,
138
+ phase,
139
+ timeLeftMs: lot ? (0, silentAuctionRules_1.timeLeftMs)(lot, now) : 0,
140
+ nextBid: offer,
141
+ bidCap: (0, silentAuctionRules_1.bidCapState)(offer, (_a = lot === null || lot === void 0 ? void 0 : lot.biddingCap) !== null && _a !== void 0 ? _a : null),
142
+ leading,
143
+ outcome: leading ? 'won' : signedIn && !(customerId && (0, shopifyIds_1.bareId)(customerId)) ? 'unknown' : 'lost',
144
+ extended: extendedSeen || !!(lot === null || lot === void 0 ? void 0 : lot.biddingWarAt),
145
+ inExtensionWindow: lot ? phase === 'live' && (0, silentAuctionRules_1.inExtensionWindow)(lot, now) : false,
146
+ bidding,
147
+ placeBid,
148
+ rebidOnVariant,
149
+ refresh,
150
+ };
151
+ }
152
+ //# sourceMappingURL=useSilentAuctionLot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSilentAuctionLot.js","sourceRoot":"","sources":["../../src/react/useSilentAuctionLot.ts"],"names":[],"mappings":";;AA+EA,kDAmHC;AAlMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,iCAAiE;AAEjE,8CAAuC;AACvC,8DAW+B;AAC/B,sDAAmD;AACnD,sCAAsC;AACtC,+DAAuD;AA2CvD,SAAgB,mBAAmB,CAAC,SAAwB,EAAE,OAAmC;;IAC/F,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,GAAG,IAAI,EAAE,SAAS,GAAG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uctionOrder } from '../silentAuctionRules';
3
+ export interface UseSilentAuctionLotsOptions {
4
+ /** `newest` (default), `endingSoon`, `wishlisted` or `upcoming`: see `orderLots`. */
5
+ order?: SilentAuctionOrder;
6
+ /** The screen is showing: reads and polls only then. */
7
+ screenOnShow: boolean;
8
+ /** Read the shown lots' bids again this often, ms. 0 (default) doesn't poll. */
9
+ pollIntervalMs?: number;
10
+ /** The shopper's wishlisted products (bare ids or GIDs), for `order: 'wishlisted'`. */
11
+ wishlistedProductIds?: string[];
12
+ /** Read past the first page in the background. Default true; false for a rail. */
13
+ readAhead?: boolean;
14
+ /** The order pages are read in. Default the service's. */
15
+ pageOrder?: SilentAuctionFeedOptions['pageOrder'];
16
+ /** Keep sold-out lots. Default false. */
17
+ keepSoldOut?: boolean;
18
+ }
19
+ export interface SilentAuctionLotsPage<TRaw = unknown> {
20
+ /** `loading` until the first page; `empty` when the order has nothing (and nothing is still being read). */
21
+ status: 'loading' | 'failed' | 'empty' | 'ready';
22
+ /** The lots, in `order`. */
23
+ items: SilentAuctionItem<TRaw>[];
24
+ /** For `order: 'upcoming'`: the lots by round, the soonest first. Empty otherwise. */
25
+ upcoming: {
26
+ auctionId: string;
27
+ startsAt: number | null;
28
+ items: SilentAuctionItem<TRaw>[];
29
+ }[];
30
+ /** A pull to refresh is running. */
31
+ refreshing: boolean;
32
+ /** More lots are being read in the background: a list footer, never the spinner. */
33
+ readingAhead: boolean;
34
+ hasMore: boolean;
35
+ /** Pull to refresh. */
36
+ refresh(): void;
37
+ }
38
+ export declare function useSilentAuctionLots<TRaw = unknown>(options: UseSilentAuctionLotsOptions): SilentAuctionLotsPage<TRaw>;
39
+ //# sourceMappingURL=useSilentAuctionLots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSilentAuctionLots.d.ts","sourceRoot":"","sources":["../../src/react/useSilentAuctionLots.ts"],"names":[],"mappings":"AAWA,OAAO,EAA2B,KAAK,wBAAwB,EAA+B,KAAK,iBAAiB,EAAE,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true });
3
+ exports.useSilentAuctionLots = useSilentAuctionLots;
4
+ /**
5
+ * The silent-auction lots page as a page model (0.12.0, moved from Sparkl's `CurrentSilentAuction` and
6
+ * `useAuctionProducts` on 2026-10-17). Also a home rail's (`order: 'upcoming'`, `readAhead: false`).
7
+ *
8
+ * The lots and their products come from `createSilentAuctionFeed`; this orders them (`orderLots`) and
9
+ * groups the upcoming ones by round (`upcomingGroups`). It reads while `screenOnShow`, polls every
10
+ * `pollIntervalMs` (Sparkl's grid: 2 000), and stops when the screen goes. Changing `order` between
11
+ * `upcoming` and the rest reads the other list from scratch, as Sparkl does. No words or formatting.
12
+ */
13
+ const react_1 = require("react");
14
+ const silentAuctionFeed_1 = require("../silentAuctionFeed");
15
+ const silentAuctionRules_1 = require("../silentAuctionRules");
16
+ const LiveSellingProvider_1 = require("./LiveSellingProvider");
17
+ function useSilentAuctionLots(options) {
18
+ const { order = 'newest', screenOnShow, pollIntervalMs = 0, wishlistedProductIds, readAhead = true, pageOrder, keepSoldOut = false } = options;
19
+ const { ready } = (0, LiveSellingProvider_1.useLiveSelling)();
20
+ const filter = order === 'upcoming' ? 'upcoming' : 'current';
21
+ const feed = (0, react_1.useMemo)(() => (0, silentAuctionFeed_1.createSilentAuctionFeed)({ filter, readAhead, pageOrder, keepSoldOut }), [filter, readAhead, pageOrder, keepSoldOut]);
22
+ const [state, setState] = (0, react_1.useState)(feed.getState());
23
+ (0, react_1.useEffect)(() => {
24
+ setState(feed.getState());
25
+ return feed.subscribe(() => setState(feed.getState()));
26
+ }, [feed]);
27
+ // Only once the provider has configured the client: before that a read answers "no lots" without
28
+ // asking, and on the app's first screen nothing would read again.
29
+ (0, react_1.useEffect)(() => {
30
+ if (!ready || !screenOnShow)
31
+ return undefined;
32
+ void feed.load();
33
+ const timer = pollIntervalMs > 0 ? setInterval(() => void feed.poll(), pollIntervalMs) : null;
34
+ return () => {
35
+ if (timer)
36
+ clearInterval(timer);
37
+ feed.stop();
38
+ };
39
+ }, [ready, feed, screenOnShow, pollIntervalMs]);
40
+ const wishlistKey = (wishlistedProductIds !== null && wishlistedProductIds !== void 0 ? wishlistedProductIds : []).join(',');
41
+ const items = (0, react_1.useMemo)(() => (0, silentAuctionRules_1.orderLots)(state.items, order, Date.now(), wishlistedProductIds !== null && wishlistedProductIds !== void 0 ? wishlistedProductIds : []),
42
+ // The ids by value: a fresh array each render mustn't reorder the list.
43
+ // eslint-disable-next-line react-hooks/exhaustive-deps
44
+ [state.items, order, wishlistKey]);
45
+ const upcoming = (0, react_1.useMemo)(() => (order === 'upcoming' ? (0, silentAuctionRules_1.upcomingGroups)(items) : []), [items, order]);
46
+ const status = state.status === 'idle' || state.status === 'loading'
47
+ ? 'loading'
48
+ : state.status === 'failed'
49
+ ? 'failed'
50
+ : items.length === 0 && !state.readingAhead
51
+ ? 'empty'
52
+ : 'ready';
53
+ return {
54
+ status,
55
+ items,
56
+ upcoming,
57
+ refreshing: state.refreshing,
58
+ readingAhead: state.readingAhead,
59
+ hasMore: state.hasMore,
60
+ refresh: () => void feed.load({ userInitiated: true }),
61
+ };
62
+ }
63
+ //# sourceMappingURL=useSilentAuctionLots.js.map