@tiledev/sdk-apptile-live-selling 0.13.0 → 0.15.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.
Files changed (131) hide show
  1. package/README.md +116 -12
  2. package/dist/clipsPage.d.ts +29 -0
  3. package/dist/clipsPage.d.ts.map +1 -0
  4. package/dist/clipsPage.js +49 -0
  5. package/dist/clipsPage.js.map +1 -0
  6. package/dist/giveawayPrizeLines.d.ts +10 -0
  7. package/dist/giveawayPrizeLines.d.ts.map +1 -1
  8. package/dist/giveawayPrizeLines.js +11 -1
  9. package/dist/giveawayPrizeLines.js.map +1 -1
  10. package/dist/hiddenShows.d.ts +10 -0
  11. package/dist/hiddenShows.d.ts.map +1 -1
  12. package/dist/hiddenShows.js +11 -0
  13. package/dist/hiddenShows.js.map +1 -1
  14. package/dist/index.d.ts +10 -3
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +53 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/linkLots.d.ts +64 -0
  19. package/dist/linkLots.d.ts.map +1 -0
  20. package/dist/linkLots.js +84 -0
  21. package/dist/linkLots.js.map +1 -0
  22. package/dist/livePages.d.ts +166 -0
  23. package/dist/livePages.d.ts.map +1 -0
  24. package/dist/livePages.js +187 -0
  25. package/dist/livePages.js.map +1 -0
  26. package/dist/liveRoom.d.ts +21 -0
  27. package/dist/liveRoom.d.ts.map +1 -0
  28. package/dist/liveRoom.js +28 -0
  29. package/dist/liveRoom.js.map +1 -0
  30. package/dist/pageOptions.d.ts +118 -0
  31. package/dist/pageOptions.d.ts.map +1 -0
  32. package/dist/pageOptions.js +99 -0
  33. package/dist/pageOptions.js.map +1 -0
  34. package/dist/pageTypes.d.ts +185 -0
  35. package/dist/pageTypes.d.ts.map +1 -0
  36. package/dist/pageTypes.js +3 -0
  37. package/dist/pageTypes.js.map +1 -0
  38. package/dist/react/LiveSellingProvider.d.ts +31 -1
  39. package/dist/react/LiveSellingProvider.d.ts.map +1 -1
  40. package/dist/react/LiveSellingProvider.js +44 -2
  41. package/dist/react/LiveSellingProvider.js.map +1 -1
  42. package/dist/react/index.d.ts +12 -0
  43. package/dist/react/index.d.ts.map +1 -1
  44. package/dist/react/index.js +34 -1
  45. package/dist/react/index.js.map +1 -1
  46. package/dist/react/index.web.d.ts +13 -32
  47. package/dist/react/index.web.d.ts.map +1 -1
  48. package/dist/react/index.web.js +52 -139
  49. package/dist/react/index.web.js.map +1 -1
  50. package/dist/react/navigation.d.ts +13 -0
  51. package/dist/react/navigation.d.ts.map +1 -0
  52. package/dist/react/navigation.js +7 -0
  53. package/dist/react/navigation.js.map +1 -0
  54. package/dist/react/platformSession.d.ts +16 -0
  55. package/dist/react/platformSession.d.ts.map +1 -0
  56. package/dist/react/platformSession.js +28 -0
  57. package/dist/react/platformSession.js.map +1 -0
  58. package/dist/react/platformSession.web.d.ts +35 -0
  59. package/dist/react/platformSession.web.d.ts.map +1 -0
  60. package/dist/react/platformSession.web.js +148 -0
  61. package/dist/react/platformSession.web.js.map +1 -0
  62. package/dist/react/replayPlayer.d.ts +74 -0
  63. package/dist/react/replayPlayer.d.ts.map +1 -0
  64. package/dist/react/replayPlayer.js +279 -0
  65. package/dist/react/replayPlayer.js.map +1 -0
  66. package/dist/react/shopifyProviders.d.ts +69 -0
  67. package/dist/react/shopifyProviders.d.ts.map +1 -0
  68. package/dist/react/shopifyProviders.js +100 -0
  69. package/dist/react/shopifyProviders.js.map +1 -0
  70. package/dist/react/useAccountName.d.ts +8 -0
  71. package/dist/react/useAccountName.d.ts.map +1 -0
  72. package/dist/react/useAccountName.js +49 -0
  73. package/dist/react/useAccountName.js.map +1 -0
  74. package/dist/react/useClipsPage.d.ts +47 -0
  75. package/dist/react/useClipsPage.d.ts.map +1 -0
  76. package/dist/react/useClipsPage.js +130 -0
  77. package/dist/react/useClipsPage.js.map +1 -0
  78. package/dist/react/useKeepScreenAwake.d.ts +2 -0
  79. package/dist/react/useKeepScreenAwake.d.ts.map +1 -0
  80. package/dist/react/useKeepScreenAwake.js +34 -0
  81. package/dist/react/useKeepScreenAwake.js.map +1 -0
  82. package/dist/react/useLiveAuction.d.ts +106 -0
  83. package/dist/react/useLiveAuction.d.ts.map +1 -0
  84. package/dist/react/useLiveAuction.js +249 -0
  85. package/dist/react/useLiveAuction.js.map +1 -0
  86. package/dist/react/useLiveChat.d.ts +110 -0
  87. package/dist/react/useLiveChat.d.ts.map +1 -0
  88. package/dist/react/useLiveChat.js +209 -0
  89. package/dist/react/useLiveChat.js.map +1 -0
  90. package/dist/react/useLiveGiveawaysAndPolls.d.ts +95 -0
  91. package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +1 -0
  92. package/dist/react/useLiveGiveawaysAndPolls.js +225 -0
  93. package/dist/react/useLiveGiveawaysAndPolls.js.map +1 -0
  94. package/dist/react/useLivePage.d.ts +134 -0
  95. package/dist/react/useLivePage.d.ts.map +1 -0
  96. package/dist/react/useLivePage.js +304 -0
  97. package/dist/react/useLivePage.js.map +1 -0
  98. package/dist/react/useLiveShop.d.ts +103 -0
  99. package/dist/react/useLiveShop.d.ts.map +1 -0
  100. package/dist/react/useLiveShop.js +211 -0
  101. package/dist/react/useLiveShop.js.map +1 -0
  102. package/dist/react/useReplayPage.d.ts +133 -0
  103. package/dist/react/useReplayPage.d.ts.map +1 -0
  104. package/dist/react/useReplayPage.js +565 -0
  105. package/dist/react/useReplayPage.js.map +1 -0
  106. package/dist/showCredit.d.ts +87 -0
  107. package/dist/showCredit.d.ts.map +1 -0
  108. package/dist/showCredit.js +120 -0
  109. package/dist/showCredit.js.map +1 -0
  110. package/dist/showNames.d.ts +11 -0
  111. package/dist/showNames.d.ts.map +1 -1
  112. package/dist/showNames.js +23 -1
  113. package/dist/showNames.js.map +1 -1
  114. package/dist/ui/BubbleFrame.d.ts +38 -0
  115. package/dist/ui/BubbleFrame.d.ts.map +1 -0
  116. package/dist/ui/BubbleFrame.js +181 -0
  117. package/dist/ui/BubbleFrame.js.map +1 -0
  118. package/dist/ui/LiveBubble.d.ts +37 -0
  119. package/dist/ui/LiveBubble.d.ts.map +1 -0
  120. package/dist/ui/LiveBubble.js +101 -0
  121. package/dist/ui/LiveBubble.js.map +1 -0
  122. package/dist/ui/ReplayBubble.d.ts +23 -0
  123. package/dist/ui/ReplayBubble.d.ts.map +1 -0
  124. package/dist/ui/ReplayBubble.js +65 -0
  125. package/dist/ui/ReplayBubble.js.map +1 -0
  126. package/dist/ui.d.ts +27 -0
  127. package/dist/ui.d.ts.map +1 -0
  128. package/dist/ui.js +34 -0
  129. package/dist/ui.js.map +1 -0
  130. package/package.json +36 -5
  131. package/ui/package.json +6 -0
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLiveAuction = useLiveAuction;
4
+ /**
5
+ * The Live screen's auction (0.14.0, moved from amore-v2's `src/core/hooks/useLiveAuction.ts`: phase 4
6
+ * of its "Live player plan", bidding). The routes and the store's name are the app's
7
+ * (`LiveSellingProvider`'s `routes` and `shopName`); the route's `streamId` param is read here.
8
+ */
9
+ const sdk_shopify_1 = require("@tiledev/sdk-shopify");
10
+ const react_1 = require("react");
11
+ const auctionRules_1 = require("../auctionRules");
12
+ const linkLots_1 = require("../linkLots");
13
+ const LiveSellingProvider_1 = require("./LiveSellingProvider");
14
+ const platformSession_1 = require("./platformSession");
15
+ const navigation_1 = require("./navigation");
16
+ /**
17
+ * Why a sent bid "didn't go through", in the bar's words (decided 2026-10-06, amore-v2's Head of
18
+ * Engineering): no moderator was known for the round (L3), or the room's send failed. The session's
19
+ * other reasons never reach a shopper here: the gate sends only for a signed-in bidder (`signedOut`)
20
+ * and only while this show's round is open (`noShow`). `noAmount` (a bid of 0, on a lot the host gave
21
+ * no starting bid, before the first bid) has no words yet.
22
+ */
23
+ const DIDNT_GO_THROUGH = new Set(['noModerator', 'sendFailed']);
24
+ /** Money in the lot's currency, for a tile that shows it as words. */
25
+ const moneyIn = (currencyCode) => (amount) => (0, sdk_shopify_1.formatMoney)({ amount: String(amount), currencyCode });
26
+ /**
27
+ * The Live screen's auction, so the screen stays plain tiles. The session never ticks: it gives when
28
+ * the round closes (`auction.closesAt`, on the phone's clock), and the bid bar and the final countdown
29
+ * count down to it themselves (`useAuctionCountdown`), so the screen is never drawn on the round's
30
+ * clock.
31
+ *
32
+ * - **The session does the auction:** the round, the leader, the clock, the hammer and whether it is the
33
+ * shopper's (`session.auction`, `lastWin.isYou`), the bid itself (`actions.placeBid`), and everything
34
+ * in front of a bid (`useAuctionBidGate`: signed in, nothing unpaid from another show, the rules
35
+ * accepted once per phone, a variant chosen once a round). Nothing here repeats them.
36
+ * - **The bid gate's sheets are the bid bar's** (decided, amore-v2's Head of Engineering): `step` tells
37
+ * the bid bar which one to show. Signing in is sdk-shopify's `useSignIn` (Shopify's sheet, or the
38
+ * app's Sign In page: `routes.openSignIn`), as bidding needs a Shopify sign-in (the win is written to
39
+ * the customer).
40
+ * - **Back to the bid after signing in** (the gate's `startSignIn`): the bid waits; once the shopper is
41
+ * a bidder, and if bidding on that lot is still open, it goes through the gate again (unpaid wins,
42
+ * read fresh first, then the rules, the variant). Dropped when bidding on the lot closes, when the
43
+ * shopper asks for another bid, or when this screen is back on show still signed out (the Sign In
44
+ * page closed). Shopify's own sign-in sheet doesn't leave the screen: closed without signing in, the
45
+ * bid waits until bidding on its lot closes. Signed in with the customer still loading, no sign-in
46
+ * opens: the bid waits for them (`signInLoading`).
47
+ * - **A bid goes out at the amount the shopper saw** (the gate's `atAmountShown`): the slide's "Bid
48
+ * $25.00", or the amount typed. The last look before it goes: the round still open with time on the
49
+ * clock, at most the host's ceiling, at least the next bid. If the room moved past it (a sheet was
50
+ * open meanwhile), it isn't sent and the bar says so (`refusal`), rather than going out at a price
51
+ * nobody showed. After a bid goes the bar takes no other for 1.2 s (`bidOnItsWay`). The session sends
52
+ * nothing when it knows no moderator for the round (L3), and a send can fail: `placeBid` says so
53
+ * (`{ sent: false }`), and the bar says the bid didn't go through in the place of the outbid line,
54
+ * and takes a bid again at once (decided 2026-10-06: "Bid didn't go through"). The bar's line goes
55
+ * with the next bid or the round.
56
+ * - **The winner is told** (`win`): everyone sees who won; the shopper sees "You" when they held the
57
+ * highest bid as the round closed and the winning bid is theirs (`lastWin.isYou`). The room sends only
58
+ * the winner's name, not who they are. No name is handed out as an email. The win itself reaches the
59
+ * cart's Items You Won from the server; that page reads it each time it opens.
60
+ * - **The lots** for the Shop button's sheet and the card (`lotStateFor`): open (the round is on it),
61
+ * closed (won: on the show's record, or seen here), else upcoming. A link the host added (0.15.0,
62
+ * `showLinkOf`) sits among them with its price and no state, and a featured link has no round on the
63
+ * card: it is opened, never bid on (`useLiveShop` opens it).
64
+ * - **The store's name** in the bidding rules is `shopName` (old Amore's took the host's, which can be
65
+ * a person's).
66
+ * - **Nothing shows** until the session holds this show's record (`useLiveShow`; never a hidden show the
67
+ * shopper can't see), or on a show that isn't an auction. The web's session is always "ended":
68
+ * nothing draws there.
69
+ */
70
+ function useLiveAuction({ openItemsYouWon }) {
71
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
72
+ const streamId = (_b = (_a = (0, navigation_1.useRoute)().params) === null || _a === void 0 ? void 0 : _a.streamId) !== null && _b !== void 0 ? _b : '';
73
+ const isFocused = (0, navigation_1.useIsFocused)();
74
+ const session = (0, platformSession_1.useLiveSession)();
75
+ const { placeBid, dismissAuctionWin } = session.actions;
76
+ const customer = (0, sdk_shopify_1.useCustomer)();
77
+ const nav = (0, navigation_1.useNavigation)();
78
+ const { routes, shopName, canOpenLinks } = (0, LiveSellingProvider_1.useLivePageOptions)();
79
+ const signIn = (0, sdk_shopify_1.useSignIn)({ onOpenSignInPage: (method) => routes.openSignIn(method, nav) });
80
+ const { auction } = session;
81
+ // ─── Which show ────────────────────────────────────────────────────────────────────────────────
82
+ // The session's record once it is this show's: right after the pin it can still hold the last show's.
83
+ const { show, onAir, capabilities } = (0, platformSession_1.useLiveShow)(streamId);
84
+ const isAuction = !!show && capabilities.canBid;
85
+ const roundOpen = isAuction && onAir && auction.biddingOpen;
86
+ // ─── Who is bidding ────────────────────────────────────────────────────────────────────────────
87
+ // The app's bidder (the identity's `bidderId`): a Shopify sign-in with the customer loaded.
88
+ const isBidder = !!customer.loggedIn && customer.sessionKind === 'shopify' && !!((_c = customer.customer) === null || _c === void 0 ? void 0 : _c.id);
89
+ // Signed in, the customer still loading (or the stored sign-in still being read): not someone to send to sign-in.
90
+ const bidderLoading = !isBidder && (!!customer.restoring || (!!customer.loggedIn && customer.sessionKind === 'shopify'));
91
+ // ─── The lot under the hammer ──────────────────────────────────────────────────────────────────
92
+ // The lot the host opened the round on, which may lead the featured product (old Amore's).
93
+ const lot = (0, react_1.useMemo)(() => {
94
+ var _a;
95
+ if (!auction.storeProductId)
96
+ return session.activeProduct;
97
+ return (_a = session.products.find((product) => product.storeProductId === auction.storeProductId)) !== null && _a !== void 0 ? _a : session.activeProduct;
98
+ }, [auction.storeProductId, session.products, session.activeProduct]);
99
+ const lotProduct = (_d = lot === null || lot === void 0 ? void 0 : lot.raw) !== null && _d !== void 0 ? _d : null;
100
+ const currencyCode = (_g = (_e = lot === null || lot === void 0 ? void 0 : lot.currencyCode) !== null && _e !== void 0 ? _e : (_f = session.products[0]) === null || _f === void 0 ? void 0 : _f.currencyCode) !== null && _g !== void 0 ? _g : 'USD';
101
+ const money = (0, react_1.useMemo)(() => moneyIn(currencyCode), [currencyCode]);
102
+ // ─── A bid that didn't go through ──────────────────────────────────────────────────────────────
103
+ /** The bar's one line about the last bid: the gate's refusal (outbid, over the ceiling), or a bid that didn't go through. */
104
+ const [barMessage, setBarMessage] = (0, react_1.useState)(null);
105
+ /** The last bid sent didn't go through: the bar takes another at once, rather than after its 1.2 s. */
106
+ const [lastBidFailed, setLastBidFailed] = (0, react_1.useState)(false);
107
+ const messagesSoFar = (0, react_1.useRef)(0);
108
+ const mounted = (0, react_1.useRef)(true);
109
+ (0, react_1.useEffect)(() => () => {
110
+ mounted.current = false;
111
+ }, []);
112
+ /** The session's bid, and what it answered: a bid that didn't go through is said on the bar. */
113
+ const placeBidAndSay = (0, react_1.useCallback)(async (options) => {
114
+ var _a;
115
+ setLastBidFailed(false);
116
+ const result = await placeBid(options);
117
+ if (mounted.current && !result.sent && DIDNT_GO_THROUGH.has(result.reason)) {
118
+ messagesSoFar.current += 1;
119
+ setBarMessage({ id: messagesSoFar.current, reason: 'notSent', amount: (_a = options === null || options === void 0 ? void 0 : options.amount) !== null && _a !== void 0 ? _a : 0 });
120
+ setLastBidFailed(true);
121
+ }
122
+ return result;
123
+ }, [placeBid]);
124
+ // ─── The bid gate ──────────────────────────────────────────────────────────────────────────────
125
+ const gate = (0, platformSession_1.useAuctionBidGate)({
126
+ streamingId: (_h = show === null || show === void 0 ? void 0 : show.streamingId) !== null && _h !== void 0 ? _h : null,
127
+ isLoggedIn: isBidder,
128
+ biddingOpen: roundOpen,
129
+ variantCount: (_j = lot === null || lot === void 0 ? void 0 : lot.variants.length) !== null && _j !== void 0 ? _j : 0,
130
+ placeBid: placeBidAndSay,
131
+ atAmountShown: true,
132
+ round: auction,
133
+ startSignIn: signIn.start,
134
+ signInLoading: bidderLoading,
135
+ screenOnShow: isFocused,
136
+ });
137
+ const { dismiss, refreshUnpaidWins, requestBid } = gate;
138
+ // The gate's refusals take the bar's line as they come.
139
+ const gateRefusal = gate.refusal;
140
+ (0, react_1.useEffect)(() => {
141
+ if (!gateRefusal)
142
+ return;
143
+ messagesSoFar.current += 1;
144
+ setBarMessage({ ...gateRefusal, id: messagesSoFar.current });
145
+ }, [gateRefusal]);
146
+ // The line goes with the next bid, and with the round (closed, or another lot's).
147
+ const bid = (0, react_1.useCallback)((amount) => {
148
+ setBarMessage(null);
149
+ requestBid(amount);
150
+ }, [requestBid]);
151
+ (0, react_1.useEffect)(() => {
152
+ setBarMessage(null);
153
+ setLastBidFailed(false);
154
+ }, [roundOpen, auction.storeProductId]);
155
+ // Unpaid wins are read again each time the screen comes back (the shopper may have just paid them).
156
+ (0, navigation_1.useFocusEffect)((0, react_1.useCallback)(() => {
157
+ refreshUnpaidWins();
158
+ }, [refreshUnpaidWins]));
159
+ // The gate signs the shopper in itself (`startSignIn`), so it never stops at "signIn".
160
+ const step = gate.blocker === 'signIn' ? null : gate.blocker;
161
+ const seeWins = (0, react_1.useCallback)(() => {
162
+ dismiss();
163
+ openItemsYouWon();
164
+ }, [dismiss, openItemsYouWon]);
165
+ // ─── The bidding war, once a round ─────────────────────────────────────────────────────────────
166
+ const [warAnnounced, setWarAnnounced] = (0, react_1.useState)(false);
167
+ (0, react_1.useEffect)(() => {
168
+ if (!auction.biddingOpen)
169
+ setWarAnnounced(false);
170
+ }, [auction.biddingOpen]);
171
+ // ─── The hammer ────────────────────────────────────────────────────────────────────────────────
172
+ const lastWin = auction.lastWin;
173
+ const winner = (0, react_1.useMemo)(() => {
174
+ var _a;
175
+ if (!lastWin || !isAuction)
176
+ return null;
177
+ return {
178
+ key: `${(_a = lastWin.storeProductId) !== null && _a !== void 0 ? _a : ''}|${lastWin.userName}|${lastWin.winningBid}`,
179
+ name: lastWin.userName,
180
+ amount: money(lastWin.winningBid),
181
+ isYou: lastWin.isYou,
182
+ };
183
+ }, [lastWin, isAuction, money]);
184
+ // ─── The lots and the featured lot's round ─────────────────────────────────────────────────────
185
+ const { biddingOpen, storeProductId: roundLotId, wonLotIds } = auction;
186
+ const stateOf = (0, react_1.useCallback)((storeProductId) => (0, auctionRules_1.lotStateFor)(storeProductId, { biddingOpen, storeProductId: roundLotId, wonLotIds }, show), [biddingOpen, roundLotId, wonLotIds, show]);
187
+ const lots = (0, react_1.useMemo)(() => {
188
+ if (!isAuction)
189
+ return null;
190
+ return session.products.flatMap((item) => {
191
+ var _a;
192
+ // A link the host added: opened, not bid on.
193
+ if (!item.raw)
194
+ return item.externalUrl ? [(0, linkLots_1.showLinkOf)(item, { canOpen: canOpenLinks })] : [];
195
+ // The lot's opening bid, joined onto the product from the record by the session.
196
+ const startingBid = (_a = item.baseBidPrice) !== null && _a !== void 0 ? _a : null;
197
+ return [{ product: item.raw, startingBid: startingBid !== null ? money(startingBid) : null, state: stateOf(item.storeProductId) }];
198
+ });
199
+ }, [isAuction, session.products, money, stateOf, canOpenLinks]);
200
+ const featured = session.activeProduct;
201
+ const auctionRound = (0, react_1.useMemo)(() => {
202
+ // A featured link is never on the block.
203
+ if (!isAuction || !featured || (!featured.raw && featured.externalUrl))
204
+ return null;
205
+ const state = stateOf(featured.storeProductId);
206
+ const onThisLot = state === 'open';
207
+ return {
208
+ state,
209
+ highestBid: onThisLot && auction.highestBid > 0 ? money(auction.highestBid) : null,
210
+ leaderName: onThisLot ? auction.leaderName || null : null,
211
+ leaderIsYou: onThisLot && auction.isLeading,
212
+ };
213
+ }, [isAuction, featured, stateOf, auction.highestBid, auction.leaderName, auction.isLeading, money]);
214
+ return {
215
+ bidBar: {
216
+ visible: roundOpen,
217
+ currencyCode,
218
+ highestBid: auction.highestBid,
219
+ nextBid: auction.nextBid,
220
+ closesAt: auction.closesAt,
221
+ extended: auction.extended,
222
+ extendedSeconds: Math.round(auction.extendedBiddingMs / 1000),
223
+ isLeading: auction.isLeading,
224
+ bidCap: auction.bidCap,
225
+ busy: gate.bidOnItsWay && !lastBidFailed,
226
+ step: roundOpen ? step : null,
227
+ // The store's name in the bidding rules (old Amore's took the host's, which can be a person's).
228
+ shopName,
229
+ lotProduct,
230
+ refusal: barMessage,
231
+ onBid: bid,
232
+ onAcceptTerms: gate.acceptTerms,
233
+ onChooseVariant: gate.chooseVariant,
234
+ onCloseStep: dismiss,
235
+ onSeeWins: seeWins,
236
+ },
237
+ finalCountdown: { visible: roundOpen, closesAt: auction.closesAt },
238
+ biddingWar: {
239
+ active: roundOpen && auction.extended && !warAnnounced,
240
+ onDone: () => setWarAnnounced(true),
241
+ },
242
+ win: { winner, onDone: dismissAuctionWin },
243
+ /** The auction part of the featured card; `useLiveShop` gives the rest. */
244
+ productCard: { auctionRound },
245
+ /** The auction part of the Shop button: its sheet lists the lots. */
246
+ shopButton: { lots },
247
+ };
248
+ }
249
+ //# sourceMappingURL=useLiveAuction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLiveAuction.js","sourceRoot":"","sources":["../../src/react/useLiveAuction.ts"],"names":[],"mappings":";;AA6FA,wCAgMC;AA7RD;;;;GAIG;AACH,sDAAyF;AACzF,iCAA0E;AAE1E,kDAA8C;AAC9C,0CAAyC;AAGzC,+DAA2D;AAC3D,uDAAmF;AACnF,6CAQsB;AAetB;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;AAErF,sEAAsE;AACtE,MAAM,OAAO,GAAG,CAAC,YAAoB,EAAE,EAAE,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,IAAA,yBAAW,EAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AAEpH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,SAAgB,cAAc,CAAC,EAAE,eAAe,EAAqB;;IACnE,MAAM,QAAQ,GAAG,MAAA,MAAA,IAAA,qBAAQ,GAAa,CAAC,MAAM,0CAAE,QAAQ,mCAAI,EAAE,CAAC;IAC9D,MAAM,SAAS,GAAG,IAAA,yBAAY,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,IAAA,gCAAc,GAAW,CAAC;IAC1C,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,GAAG,GAAG,IAAA,0BAAa,GAAiC,CAAC;IAC3D,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAA,wCAAkB,GAAE,CAAC;IAChE,MAAM,MAAM,GAAG,IAAA,uBAAS,EAAC,EAA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AAC,UAAU;YAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC7D,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,IAAI,CAAC,WAAW,IAAI,CAAC,aAAa;YACxC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;YAC7B,gGAAgG;YAChG,QAAQ;YACR,UAAU;YACV,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,GAAG;YACV,aAAa,EAAE,IAAI,CAAC,WAAW;YAC/B,eAAe,EAAE,IAAI,CAAC,aAAa;YACnC,WAAW,EAAE,OAAO;YACpB,SAAS,EAAE,OAAO;SACnB;QACD,cAAc,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;QAClE,UAAU,EAAE;YACV,MAAM,EAAE,SAAS,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,YAAY;YACtD,MAAM,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;SACpC;QACD,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE;QAC1C,2EAA2E;QAC3E,WAAW,EAAE,EAAE,YAAY,EAAE;QAC7B,qEAAqE;QACrE,UAAU,EAAE,EAAE,IAAI,EAAE;KACrB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,110 @@
1
+ import type { LiveCommentMention } from '../pageTypes';
2
+ /** What the Live screen knows about the show, which decides what the chat shows. */
3
+ export interface LiveChatShow {
4
+ /** This show is playing or waiting for its host: not joining, ended or failed. */
5
+ onAir: boolean;
6
+ /** The show takes comments (`capabilitiesFor(show).canComment`). */
7
+ canComment: boolean;
8
+ /** The show takes reactions (`capabilitiesFor(show).canReact`). */
9
+ canReact: boolean;
10
+ /**
11
+ * Opens a link from the chat inside the app, the show in the bubble (`useLivePage`'s `openLink`, 0.15.0).
12
+ * The chat hands over only the host's and moderators' links (the comments tile decides by the line's
13
+ * `source`). Unset, or an app with no `routes.openLink`: the chat's links are words.
14
+ */
15
+ openLink?: (url: string) => void;
16
+ /** An auction show (`capabilitiesFor(show).canBid`, 0.15.0): the comment box's "Sign in to comment" has a switch per kind of show. */
17
+ auction?: boolean;
18
+ }
19
+ /**
20
+ * The Live screen's chat and reactions. `useLivePage` calls it with what it knows about the show and
21
+ * hands the result to the screen (`page.chat`), one set of props per tile.
22
+ *
23
+ * - **Only while the show is on air** (playing, or waiting for its host): the chat, the comment box,
24
+ * the reaction button, the floating reactions and the pinned comment all go once it has ended, as
25
+ * Freckled Poppy's, and while it is still joining (nothing can be said into a room not yet joined).
26
+ * - **The session does the work:** the room's history in front of what arrives since
27
+ * (`session.comments`), the name a comment goes out under, holding a comment while the shopper's
28
+ * account loads, the pin (`session.pinnedComment`), the host's reaction setting
29
+ * (`session.reactionStyle`), and the shopper's own comment and reaction shown at once. Nothing here
30
+ * repeats it.
31
+ * - **Anyone can comment** (Freckled Poppy's rule, decided): a signed-out shopper the room has no name
32
+ * for is asked for one on their first comment, inside the comment box, and the session saves it on
33
+ * this phone (`chooseViewerName`) before the comment goes out. A signed-in shopper comments under their
34
+ * account's name (`ShopifyLiveSessionProvider`'s `viewerName`); while their account loads (on app
35
+ * open, or a moment after signing in), Send waits (`accountNameAsk`).
36
+ * - **A signed-in shopper with no first name on their account is asked once** (0.15.0; amore-v2's
37
+ * ENG-686, decided 2026-10-19 by its Head of Engineering: old Amore's and old K-Marie's way). A Shopify
38
+ * sign-in by emailed code leaves the name blank, and since 0.13.0 the room names nobody by their
39
+ * email. The comment box asks for a first and a last name (`commentBox.accountName`, starting from what
40
+ * the account has), saves them on the account (`onSaveAccountName`, through `useAccountName`) and only
41
+ * then sends the comment, so the account, the room and the next show all have it. A giveaway entry
42
+ * asks the same way, so whichever comes first asks, once. A name typed as a guest before signing in
43
+ * isn't used: the account's name governs. A save that didn't go through sends nothing, and the sheet
44
+ * says so. A comment box without the account's fields asks for one name, kept on this phone
45
+ * (`onSaveName`), as in 0.14.0.
46
+ * - **The show's team's names can't be used** (0.15.0; Host and Moderator unless `LiveSellingProvider`'s
47
+ * `blockedNames` says), signed in or not: the sheet says so as the name is typed (`isNameAllowed`), and
48
+ * an account named as one is asked as one with no name. The session refuses them too.
49
+ * - **"Sign in to comment"** (0.15.0; decided 2026-10-19 by amore-v2's Head of Engineering): the comment
50
+ * box's two switches, one for live shows and one for auction shows (`auction` says which applies), off
51
+ * by default. On, a signed-out shopper's tap on the box starts the app's sign-in (sdk-shopify's
52
+ * `useSignIn`; the app's Sign In page is `routes.openSignIn`) in place of the name sheet; back on this
53
+ * screen signed in, the keyboard comes up in the box (`keyboardRequest`). Back still signed out,
54
+ * nothing more happens, now or after a later sign-in elsewhere.
55
+ * - **Reactions** need no sign-in. Which ones is the button tile's; the Live screen hands the same list
56
+ * to the floating reactions.
57
+ * - **A tap on a name** in the chat puts "@name" in the comment box.
58
+ * - **A tap on a host's or moderator's link** opens it inside the app, the show in the bubble
59
+ * (`comments.onOpenLink`, 0.15.0, amore-v2's ENG-656). None without a way to open links.
60
+ * - **Hide Comments** is the shopper's, for this visit to the screen.
61
+ * - **`keyboardUp`**: the comment box's keyboard is up, so the screen lets a tap on the video put it
62
+ * away (iOS has no key for that).
63
+ */
64
+ export declare function useLiveChat({ onAir, canComment, canReact, openLink, auction }: LiveChatShow): {
65
+ keyboardUp: boolean;
66
+ /** The comment box has the keyboard: the screen lifts its bottom group for it, and for nothing else. */
67
+ typing: boolean;
68
+ comments: {
69
+ visible: boolean;
70
+ comments: import("..").LiveComment[];
71
+ hidden: boolean;
72
+ onToggleHidden: () => void;
73
+ onPressName: ((name: string) => void) | undefined;
74
+ onOpenLink: ((url: string) => void) | undefined;
75
+ };
76
+ commentBox: {
77
+ visible: boolean;
78
+ askForName: boolean;
79
+ accountName: import("../pageTypes").NameOnAccount | null;
80
+ waitingForName: boolean;
81
+ signedOut: boolean;
82
+ auction: boolean;
83
+ keyboardRequest: number;
84
+ onSignInToComment: () => void;
85
+ sending: boolean;
86
+ mention: LiveCommentMention | null;
87
+ nameMaxLength: number;
88
+ onSend: (text: string) => Promise<void>;
89
+ onSaveName: (name: string) => Promise<boolean>;
90
+ onSaveAccountName: (firstName: string, lastName: string) => Promise<boolean>;
91
+ isNameAllowed: (name: string) => boolean;
92
+ onTypingChange: import("react").Dispatch<import("react").SetStateAction<boolean>>;
93
+ };
94
+ reactionButton: {
95
+ visible: boolean;
96
+ onReact: (reactionUrl: string) => undefined;
97
+ };
98
+ reactions: {
99
+ visible: boolean;
100
+ reactions: import("..").FloatingReaction[];
101
+ reactionStyle: import("..").ReactionStyle;
102
+ };
103
+ pinnedComment: {
104
+ visible: boolean;
105
+ pinnedComment: import("..").LivePinnedComment | null;
106
+ };
107
+ };
108
+ /** What `useLiveChat` hands the Live screen: one set of props per tile. */
109
+ export type LiveChat = ReturnType<typeof useLiveChat>;
110
+ //# sourceMappingURL=useLiveChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLiveChat.d.ts","sourceRoot":"","sources":["../../src/react/useLiveChat.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQvD,oFAAoF;AACpF,MAAM,WAAW,YAAY;IAC3B,kFAAkF;IAClF,KAAK,EAAE,OAAO,CAAC;IACf,oEAAoE;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,sIAAsI;IACtI,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAe,EAAE,EAAE,YAAY;;IA8GhG,wGAAwG;;;;;;;6BA/BvE,MAAM;2BAjIxB,MAAM,KAAK,IAAI;;;;;;;;;;;;;;uBAoGjB,MAAM;2BAaqB,MAAM;uCAO5B,MAAM,YAAY,MAAM;8BATH,MAAM;;;;;+BA2BP,MAAM;;;;;;;;;;;EAkE/C;AAED,2EAA2E;AAC3E,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLiveChat = useLiveChat;
4
+ /**
5
+ * The Live screen's chat and reactions (0.14.0, moved from amore-v2's `src/core/hooks/useLiveChat.ts`:
6
+ * phase 2 of its "Live player plan", Freckled Poppy's behaviour; 0.15.0 adds its links, account names,
7
+ * blocked names and "Sign in to comment", from amore-v2's `eng928/integration`).
8
+ */
9
+ const sdk_shopify_1 = require("@tiledev/sdk-shopify");
10
+ const react_1 = require("react");
11
+ const react_native_1 = require("react-native");
12
+ const livePages_1 = require("../livePages");
13
+ const showNames_1 = require("../showNames");
14
+ const viewer_1 = require("../viewer");
15
+ const LiveSellingProvider_1 = require("./LiveSellingProvider");
16
+ const platformSession_1 = require("./platformSession");
17
+ const useAccountName_1 = require("./useAccountName");
18
+ const navigation_1 = require("./navigation");
19
+ /**
20
+ * The Live screen's chat and reactions. `useLivePage` calls it with what it knows about the show and
21
+ * hands the result to the screen (`page.chat`), one set of props per tile.
22
+ *
23
+ * - **Only while the show is on air** (playing, or waiting for its host): the chat, the comment box,
24
+ * the reaction button, the floating reactions and the pinned comment all go once it has ended, as
25
+ * Freckled Poppy's, and while it is still joining (nothing can be said into a room not yet joined).
26
+ * - **The session does the work:** the room's history in front of what arrives since
27
+ * (`session.comments`), the name a comment goes out under, holding a comment while the shopper's
28
+ * account loads, the pin (`session.pinnedComment`), the host's reaction setting
29
+ * (`session.reactionStyle`), and the shopper's own comment and reaction shown at once. Nothing here
30
+ * repeats it.
31
+ * - **Anyone can comment** (Freckled Poppy's rule, decided): a signed-out shopper the room has no name
32
+ * for is asked for one on their first comment, inside the comment box, and the session saves it on
33
+ * this phone (`chooseViewerName`) before the comment goes out. A signed-in shopper comments under their
34
+ * account's name (`ShopifyLiveSessionProvider`'s `viewerName`); while their account loads (on app
35
+ * open, or a moment after signing in), Send waits (`accountNameAsk`).
36
+ * - **A signed-in shopper with no first name on their account is asked once** (0.15.0; amore-v2's
37
+ * ENG-686, decided 2026-10-19 by its Head of Engineering: old Amore's and old K-Marie's way). A Shopify
38
+ * sign-in by emailed code leaves the name blank, and since 0.13.0 the room names nobody by their
39
+ * email. The comment box asks for a first and a last name (`commentBox.accountName`, starting from what
40
+ * the account has), saves them on the account (`onSaveAccountName`, through `useAccountName`) and only
41
+ * then sends the comment, so the account, the room and the next show all have it. A giveaway entry
42
+ * asks the same way, so whichever comes first asks, once. A name typed as a guest before signing in
43
+ * isn't used: the account's name governs. A save that didn't go through sends nothing, and the sheet
44
+ * says so. A comment box without the account's fields asks for one name, kept on this phone
45
+ * (`onSaveName`), as in 0.14.0.
46
+ * - **The show's team's names can't be used** (0.15.0; Host and Moderator unless `LiveSellingProvider`'s
47
+ * `blockedNames` says), signed in or not: the sheet says so as the name is typed (`isNameAllowed`), and
48
+ * an account named as one is asked as one with no name. The session refuses them too.
49
+ * - **"Sign in to comment"** (0.15.0; decided 2026-10-19 by amore-v2's Head of Engineering): the comment
50
+ * box's two switches, one for live shows and one for auction shows (`auction` says which applies), off
51
+ * by default. On, a signed-out shopper's tap on the box starts the app's sign-in (sdk-shopify's
52
+ * `useSignIn`; the app's Sign In page is `routes.openSignIn`) in place of the name sheet; back on this
53
+ * screen signed in, the keyboard comes up in the box (`keyboardRequest`). Back still signed out,
54
+ * nothing more happens, now or after a later sign-in elsewhere.
55
+ * - **Reactions** need no sign-in. Which ones is the button tile's; the Live screen hands the same list
56
+ * to the floating reactions.
57
+ * - **A tap on a name** in the chat puts "@name" in the comment box.
58
+ * - **A tap on a host's or moderator's link** opens it inside the app, the show in the bubble
59
+ * (`comments.onOpenLink`, 0.15.0, amore-v2's ENG-656). None without a way to open links.
60
+ * - **Hide Comments** is the shopper's, for this visit to the screen.
61
+ * - **`keyboardUp`**: the comment box's keyboard is up, so the screen lets a tap on the video put it
62
+ * away (iOS has no key for that).
63
+ */
64
+ function useLiveChat({ onAir, canComment, canReact, openLink, auction = false }) {
65
+ var _a, _b, _c, _d, _e;
66
+ // The session changes only on the room's events, never on a clock.
67
+ const session = (0, platformSession_1.useLiveSession)();
68
+ const { sendComment, sendReaction, chooseViewerName } = session.actions;
69
+ const { loggedIn, restoring } = (0, sdk_shopify_1.useCustomer)();
70
+ const { accountLoading, nameToComplete, saveNameToAccount } = (0, useAccountName_1.useAccountName)();
71
+ const { routes, blockedNames, canOpenLinks } = (0, LiveSellingProvider_1.useLivePageOptions)();
72
+ // ─── Who the shopper is in the room ──────────────────────────────────────────────────────────────
73
+ // A stored sign-in is still being read on app open: not a signed-out shopper to ask.
74
+ const signedIn = !!loggedIn || !!restoring;
75
+ const { askForName, waitingForName } = (0, livePages_1.accountNameAsk)({
76
+ named: !!((_a = session.viewerName) === null || _a === void 0 ? void 0 : _a.trim()),
77
+ loggedIn: !!loggedIn,
78
+ restoring: !!restoring,
79
+ accountLoading,
80
+ nameToComplete,
81
+ });
82
+ // ─── "Sign in to comment", and back to the box ───────────────────────────────────────────────────
83
+ const nav = (0, navigation_1.useNavigation)();
84
+ const isFocused = (0, navigation_1.useIsFocused)();
85
+ const signIn = (0, sdk_shopify_1.useSignIn)({ onOpenSignInPage: (method) => routes.openSignIn(method, nav) });
86
+ /** The shopper tapped the box to sign in: once back here signed in, the keyboard comes up in it. */
87
+ const [backToTheBox, setBackToTheBox] = (0, react_1.useState)(false);
88
+ /** A new number each time the box should take the keyboard. */
89
+ const [keyboardRequest, setKeyboardRequest] = (0, react_1.useState)(0);
90
+ const startSignIn = signIn.start;
91
+ const signInToComment = (0, react_1.useCallback)(() => {
92
+ setBackToTheBox(true);
93
+ void startSignIn();
94
+ }, [startSignIn]);
95
+ // Back here: this screen focused (the Sign In page closed), and no system sign-in sheet up.
96
+ const screenOnShow = isFocused && !signIn.signingIn;
97
+ const wasOnShow = (0, react_1.useRef)(screenOnShow);
98
+ (0, react_1.useEffect)(() => {
99
+ const cameBackOnShow = screenOnShow && !wasOnShow.current;
100
+ wasOnShow.current = screenOnShow;
101
+ if (!backToTheBox)
102
+ return;
103
+ if (loggedIn && screenOnShow) {
104
+ setBackToTheBox(false);
105
+ setKeyboardRequest((request) => request + 1);
106
+ }
107
+ // Back without signing in: the box stays as it was, now and after a later sign-in elsewhere.
108
+ else if (!loggedIn && cameBackOnShow)
109
+ setBackToTheBox(false);
110
+ }, [backToTheBox, loggedIn, screenOnShow]);
111
+ // ─── Commenting ─────────────────────────────────────────────────────────────────────────────────
112
+ const [sending, setSending] = (0, react_1.useState)(false);
113
+ const send = (0, react_1.useCallback)(async (text) => {
114
+ setSending(true);
115
+ try {
116
+ await sendComment(text);
117
+ }
118
+ finally {
119
+ setSending(false);
120
+ }
121
+ }, [sendComment]);
122
+ /** False for a name the show's team goes by: the sheet says so before Save. */
123
+ const isNameAllowed = (0, react_1.useCallback)((name) => !(0, showNames_1.isBlockedViewerName)(name, blockedNames), [blockedNames]);
124
+ /** Signed out: true once the session has saved the name on this phone, and the engine has it for the comment that follows. */
125
+ const saveName = (0, react_1.useCallback)(async (name) => !!(await chooseViewerName(name)), [chooseViewerName]);
126
+ /**
127
+ * Signed in: true once the name is on the account. Then given to the session as well, as the room reads
128
+ * the account's name only on the next draw, after the comment waiting for it has gone: this gives the
129
+ * engine the name for that comment, and keeps it on this phone.
130
+ */
131
+ const saveAccountName = (0, react_1.useCallback)(async (firstName, lastName) => {
132
+ const savedName = await saveNameToAccount(firstName, lastName);
133
+ return !!savedName && !!(await chooseViewerName(savedName));
134
+ }, [saveNameToAccount, chooseViewerName]);
135
+ const [mention, setMention] = (0, react_1.useState)(null);
136
+ const mentionsSoFar = (0, react_1.useRef)(0);
137
+ const replyTo = (0, react_1.useCallback)((name) => {
138
+ mentionsSoFar.current += 1;
139
+ setMention({ name, key: mentionsSoFar.current });
140
+ }, []);
141
+ const [commentsHidden, setCommentsHidden] = (0, react_1.useState)(false);
142
+ const toggleComments = (0, react_1.useCallback)(() => setCommentsHidden((hidden) => !hidden), []);
143
+ // ─── Reacting ───────────────────────────────────────────────────────────────────────────────────
144
+ const react = (0, react_1.useCallback)((reactionUrl) => void sendReaction(reactionUrl), [sendReaction]);
145
+ // ─── The keyboard ───────────────────────────────────────────────────────────────────────────────
146
+ const [keyboardUp, setKeyboardUp] = (0, react_1.useState)(false);
147
+ /**
148
+ * The comment box has the keyboard. The bottom group rises only then (fixed 2026-10-05: it rose for
149
+ * any keyboard, and Shopify's sign-in sheet, opened by a bid while signed out, left it stuck a
150
+ * keyboard's height up the screen when the sheet closed without the screen hearing the keyboard go).
151
+ */
152
+ const [typing, setTyping] = (0, react_1.useState)(false);
153
+ (0, react_1.useEffect)(() => {
154
+ const shown = react_native_1.Keyboard.addListener(react_native_1.Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow', () => setKeyboardUp(true));
155
+ const hidden = react_native_1.Keyboard.addListener(react_native_1.Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide', () => setKeyboardUp(false));
156
+ return () => {
157
+ shown.remove();
158
+ hidden.remove();
159
+ };
160
+ }, []);
161
+ const commentBoxShown = onAir && canComment;
162
+ return {
163
+ keyboardUp: commentBoxShown && typing && keyboardUp,
164
+ /** The comment box has the keyboard: the screen lifts its bottom group for it, and for nothing else. */
165
+ typing: commentBoxShown && typing,
166
+ comments: {
167
+ visible: onAir,
168
+ comments: (_b = session.comments) !== null && _b !== void 0 ? _b : [],
169
+ hidden: commentsHidden,
170
+ onToggleHidden: toggleComments,
171
+ // Only with a comment box to reply into.
172
+ onPressName: commentBoxShown ? replyTo : undefined,
173
+ // Only with somewhere to open it: without, every link is words.
174
+ onOpenLink: canOpenLinks ? openLink : undefined,
175
+ },
176
+ commentBox: {
177
+ visible: commentBoxShown,
178
+ askForName,
179
+ accountName: nameToComplete,
180
+ waitingForName,
181
+ signedOut: !signedIn,
182
+ auction,
183
+ keyboardRequest,
184
+ onSignInToComment: signInToComment,
185
+ sending,
186
+ mention,
187
+ nameMaxLength: viewer_1.MAX_VIEWER_NAME,
188
+ onSend: send,
189
+ onSaveName: saveName,
190
+ onSaveAccountName: saveAccountName,
191
+ isNameAllowed,
192
+ onTypingChange: setTyping,
193
+ },
194
+ reactionButton: {
195
+ visible: onAir && canReact,
196
+ onReact: react,
197
+ },
198
+ reactions: {
199
+ visible: onAir,
200
+ reactions: (_c = session.reactions) !== null && _c !== void 0 ? _c : [],
201
+ reactionStyle: (_d = session.reactionStyle) !== null && _d !== void 0 ? _d : 'single',
202
+ },
203
+ pinnedComment: {
204
+ visible: onAir,
205
+ pinnedComment: (_e = session.pinnedComment) !== null && _e !== void 0 ? _e : null,
206
+ },
207
+ };
208
+ }
209
+ //# sourceMappingURL=useLiveChat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLiveChat.js","sourceRoot":"","sources":["../../src/react/useLiveChat.ts"],"names":[],"mappings":";;AAiFA,kCA0JC;AA3OD;;;;GAIG;AACH,sDAA8D;AAC9D,iCAAiE;AACjE,+CAAkD;AAElD,4CAA8C;AAE9C,4CAAmD;AACnD,sCAA4C;AAC5C,+DAA2D;AAC3D,uDAAmD;AACnD,qDAAkD;AAClD,6CAAoG;AAoBpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,SAAgB,WAAW,CAAC,EAAE,KAAK,EAAE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