@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,95 @@
1
+ import type { LiveGiveawayPrize } from '../pageTypes';
2
+ /**
3
+ * The Live screen's giveaways and polls, so the screen stays plain tiles. Reads the app's live session
4
+ * for the show the route names, as `useLiveShop` does.
5
+ *
6
+ * - **Only while the show is on air** (playing, or waiting for its host) and the session holds this
7
+ * show's record (`useLiveShow`; never a hidden show the shopper can't see). Once the show has ended,
8
+ * all three tiles go.
9
+ * - **The session does the work:** the giveaway and poll, from the room and from the show's record for
10
+ * a shopper who arrives late; the entry count; whether this shopper has entered
11
+ * (`giveaway.registered`); the entry itself (`actions.enterGiveaway`); the draw's roster, waited for
12
+ * and kept (`giveaway.result.entrantNamesReady`, ENG-705); one vote a poll, kept on the phone
13
+ * (`actions.voteInPoll`), the tally hidden until this phone votes; a giveaway this phone watched end
14
+ * never coming back from an out-of-date record, and a poll the record says has closed never raised;
15
+ * the entry's flow (`useGiveawayEntry`), "YOU WON!" (`giveaway.result.isYou`) and the prize's
16
+ * catalogue read (`useGiveawayPrize`). Nothing here repeats it.
17
+ * - **The giveaway** (`giveawayButton`): the pill while a giveaway is open and not drawn yet. Its sheet
18
+ * shows the prize from the catalogue (Freckled Poppy's: the host picks it from the whole store, not
19
+ * from this show's lots), its variant's photo and price, and the record's own name and variant; until
20
+ * the catalogue answers, the record's variant photo and price (`variantImageUrl`, `variantPrice`). A
21
+ * catalogue read that fails goes to `onWarning`.
22
+ * - **Entering needs sign-in** (Freckled Poppy's rule). Signed out, Enter closes the sheet and starts
23
+ * the app's sign-in (sdk-shopify's `useSignIn`; the app's Sign In page is `routes.openSignIn`); back
24
+ * here signed in, the sheet opens again if the giveaway is still open and not drawn (Freckled
25
+ * Poppy's ENG-583 fix), and the shopper taps Enter themselves. Back without signing in (the Sign In
26
+ * page closed, or the system's sheet dismissed), nothing reopens. `useGiveawayEntry` does this;
27
+ * "back here" is this screen focused with no system sheet up.
28
+ * - **The entry carries the room's name for the shopper** (`session.viewerName`: their account's
29
+ * name, never an email). While their account loads, Enter waits; if the room has none, the sheet
30
+ * asks ("Entering As:", old Amore's) and the entry goes once the session holds the name.
31
+ * - **An account with no first name is asked for one, and it goes on the account** (0.15.0; amore-v2's
32
+ * ENG-686, decided 2026-10-19 by its Head of Engineering, the comment box's way: `useAccountName`).
33
+ * "Entering As:" asks for a first and a last name (`accountName`, starting from what the account
34
+ * has); Enter puts them on the account (sdk-shopify's `updateProfile`) and then enters under that
35
+ * name (`onEnterWithAccountName`). So a shopper is asked once, by a giveaway or a comment. A name
36
+ * that didn't go on the account says so in the sheet (`nameSaveFailed`) and enters nothing. A name
37
+ * the show's team goes by (`LiveSellingProvider`'s `blockedNames`) is refused as it is typed
38
+ * (`isNameAllowed`); the session refuses it too.
39
+ * - An entry the host didn't confirm (`enterGiveaway` answers `{ entered: false }`) says so in the
40
+ * sheet, and Enter can be tried again.
41
+ * - The host's draw closes the sheet (Freckled Poppy's).
42
+ * - **The draw** (`giveawayDraw`): handed over once the roster is ready; "YOU WON!" for the shopper who
43
+ * won (`giveaway.result.isYou`: by customer id when the record names the winner, else among those who
44
+ * entered by name, the gateway naming the winner only by name). A draw already on the session when
45
+ * this screen opens happened while the shopper was elsewhere: it is let go rather than played late.
46
+ * - **Where the prize goes is the server's, by the kind of show** (corrected 2026-10-19 in k-marie-v2,
47
+ * ENG-928). On an auction show the server writes the win to the customer's `auction.winner` metafield
48
+ * only, and Items You Won shows it. On a live show (not an auction) it adds the prize line, with its
49
+ * `GIVEAWAY-…` discount code, to the cart id the shopper entered with (`cartId`, below) and writes no
50
+ * metafield: Items You Won never sees it, and if that cart has been replaced since (a new cart after
51
+ * an order, a dead cart replaced at launch) the prize is lost.
52
+ * - **The poll** (`pollButton`): the chip while a poll is open; its sheet closes when the poll ends or
53
+ * the host opens another (Freckled Poppy's). Voting needs no sign-in.
54
+ */
55
+ export declare function useLiveGiveawaysAndPolls(): {
56
+ giveawayButton: {
57
+ visible: boolean;
58
+ prize: LiveGiveawayPrize | null;
59
+ entryCount: number;
60
+ entered: boolean;
61
+ entering: boolean;
62
+ signInToEnter: boolean;
63
+ waitingForName: boolean;
64
+ askForName: boolean;
65
+ accountName: import("../pageTypes").NameOnAccount | null;
66
+ nameSaveFailed: boolean;
67
+ isNameAllowed: (name: string) => boolean;
68
+ nameMaxLength: number;
69
+ entryFailed: boolean;
70
+ sheetVisible: boolean;
71
+ onOpenSheet: () => void;
72
+ onCloseSheet: () => void;
73
+ onEnter: (typedName?: string) => void;
74
+ onEnterWithAccountName: (firstName: string, lastName: string) => undefined;
75
+ onSignInToEnter: () => void;
76
+ };
77
+ giveawayDraw: {
78
+ visible: boolean;
79
+ draw: import("./useGiveawayEntry").GiveawayDraw | null;
80
+ isWinner: boolean;
81
+ onDone: () => void;
82
+ };
83
+ pollButton: {
84
+ visible: boolean;
85
+ poll: import("../sessionTypes").LivePollView | null;
86
+ logoUrl: string | null;
87
+ sheetVisible: boolean;
88
+ onOpenSheet: () => void;
89
+ onCloseSheet: () => void;
90
+ onVote: (optionId: string) => void;
91
+ };
92
+ };
93
+ /** What `useLiveGiveawaysAndPolls` hands the Live screen's giveaway and poll tiles. */
94
+ export type LiveGiveawaysAndPolls = ReturnType<typeof useLiveGiveawaysAndPolls>;
95
+ //# sourceMappingURL=useLiveGiveawaysAndPolls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLiveGiveawaysAndPolls.d.ts","sourceRoot":"","sources":["../../src/react/useLiveGiveawaysAndPolls.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AActD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,wBAAwB;;;;;;;;;;;;8BA6FG,MAAM;;;;;;;4CAuCP,MAAM,YAAY,MAAM;;;;;;;;;;;;;;;;2BA1BnD,MAAM;;EA8CpB;AAED,uFAAuF;AACvF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLiveGiveawaysAndPolls = useLiveGiveawaysAndPolls;
4
+ /**
5
+ * The Live screen's giveaways and polls (0.14.0, moved from amore-v2's
6
+ * `src/core/hooks/useLiveGiveawaysAndPolls.ts`: phase 5 of its "Live player plan", Freckled Poppy's
7
+ * behaviour, old Amore's look; 0.15.0 adds its account names and blocked names, from amore-v2's
8
+ * `eng928/integration`). The routes are the app's (`LiveSellingProvider`'s `routes`); the route's
9
+ * `streamId` param is read here.
10
+ */
11
+ const sdk_shopify_1 = require("@tiledev/sdk-shopify");
12
+ const react_1 = require("react");
13
+ const livePages_1 = require("../livePages");
14
+ const pageOptions_1 = require("../pageOptions");
15
+ const sessionTypes_1 = require("../sessionTypes");
16
+ const showNames_1 = require("../showNames");
17
+ const viewer_1 = require("../viewer");
18
+ const LiveSellingProvider_1 = require("./LiveSellingProvider");
19
+ const platformSession_1 = require("./platformSession");
20
+ const useAccountName_1 = require("./useAccountName");
21
+ const useGiveawayEntry_1 = require("./useGiveawayEntry");
22
+ const useGiveawayPrize_1 = require("./useGiveawayPrize");
23
+ const navigation_1 = require("./navigation");
24
+ /**
25
+ * The Live screen's giveaways and polls, so the screen stays plain tiles. Reads the app's live session
26
+ * for the show the route names, as `useLiveShop` does.
27
+ *
28
+ * - **Only while the show is on air** (playing, or waiting for its host) and the session holds this
29
+ * show's record (`useLiveShow`; never a hidden show the shopper can't see). Once the show has ended,
30
+ * all three tiles go.
31
+ * - **The session does the work:** the giveaway and poll, from the room and from the show's record for
32
+ * a shopper who arrives late; the entry count; whether this shopper has entered
33
+ * (`giveaway.registered`); the entry itself (`actions.enterGiveaway`); the draw's roster, waited for
34
+ * and kept (`giveaway.result.entrantNamesReady`, ENG-705); one vote a poll, kept on the phone
35
+ * (`actions.voteInPoll`), the tally hidden until this phone votes; a giveaway this phone watched end
36
+ * never coming back from an out-of-date record, and a poll the record says has closed never raised;
37
+ * the entry's flow (`useGiveawayEntry`), "YOU WON!" (`giveaway.result.isYou`) and the prize's
38
+ * catalogue read (`useGiveawayPrize`). Nothing here repeats it.
39
+ * - **The giveaway** (`giveawayButton`): the pill while a giveaway is open and not drawn yet. Its sheet
40
+ * shows the prize from the catalogue (Freckled Poppy's: the host picks it from the whole store, not
41
+ * from this show's lots), its variant's photo and price, and the record's own name and variant; until
42
+ * the catalogue answers, the record's variant photo and price (`variantImageUrl`, `variantPrice`). A
43
+ * catalogue read that fails goes to `onWarning`.
44
+ * - **Entering needs sign-in** (Freckled Poppy's rule). Signed out, Enter closes the sheet and starts
45
+ * the app's sign-in (sdk-shopify's `useSignIn`; the app's Sign In page is `routes.openSignIn`); back
46
+ * here signed in, the sheet opens again if the giveaway is still open and not drawn (Freckled
47
+ * Poppy's ENG-583 fix), and the shopper taps Enter themselves. Back without signing in (the Sign In
48
+ * page closed, or the system's sheet dismissed), nothing reopens. `useGiveawayEntry` does this;
49
+ * "back here" is this screen focused with no system sheet up.
50
+ * - **The entry carries the room's name for the shopper** (`session.viewerName`: their account's
51
+ * name, never an email). While their account loads, Enter waits; if the room has none, the sheet
52
+ * asks ("Entering As:", old Amore's) and the entry goes once the session holds the name.
53
+ * - **An account with no first name is asked for one, and it goes on the account** (0.15.0; amore-v2's
54
+ * ENG-686, decided 2026-10-19 by its Head of Engineering, the comment box's way: `useAccountName`).
55
+ * "Entering As:" asks for a first and a last name (`accountName`, starting from what the account
56
+ * has); Enter puts them on the account (sdk-shopify's `updateProfile`) and then enters under that
57
+ * name (`onEnterWithAccountName`). So a shopper is asked once, by a giveaway or a comment. A name
58
+ * that didn't go on the account says so in the sheet (`nameSaveFailed`) and enters nothing. A name
59
+ * the show's team goes by (`LiveSellingProvider`'s `blockedNames`) is refused as it is typed
60
+ * (`isNameAllowed`); the session refuses it too.
61
+ * - An entry the host didn't confirm (`enterGiveaway` answers `{ entered: false }`) says so in the
62
+ * sheet, and Enter can be tried again.
63
+ * - The host's draw closes the sheet (Freckled Poppy's).
64
+ * - **The draw** (`giveawayDraw`): handed over once the roster is ready; "YOU WON!" for the shopper who
65
+ * won (`giveaway.result.isYou`: by customer id when the record names the winner, else among those who
66
+ * entered by name, the gateway naming the winner only by name). A draw already on the session when
67
+ * this screen opens happened while the shopper was elsewhere: it is let go rather than played late.
68
+ * - **Where the prize goes is the server's, by the kind of show** (corrected 2026-10-19 in k-marie-v2,
69
+ * ENG-928). On an auction show the server writes the win to the customer's `auction.winner` metafield
70
+ * only, and Items You Won shows it. On a live show (not an auction) it adds the prize line, with its
71
+ * `GIVEAWAY-…` discount code, to the cart id the shopper entered with (`cartId`, below) and writes no
72
+ * metafield: Items You Won never sees it, and if that cart has been replaced since (a new cart after
73
+ * an order, a dead cart replaced at launch) the prize is lost.
74
+ * - **The poll** (`pollButton`): the chip while a poll is open; its sheet closes when the poll ends or
75
+ * the host opens another (Freckled Poppy's). Voting needs no sign-in.
76
+ */
77
+ function useLiveGiveawaysAndPolls() {
78
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
79
+ const streamId = (_b = (_a = (0, navigation_1.useRoute)().params) === null || _a === void 0 ? void 0 : _a.streamId) !== null && _b !== void 0 ? _b : '';
80
+ const isFocused = (0, navigation_1.useIsFocused)();
81
+ // The session changes only on the room's events, never on a clock.
82
+ const session = (0, platformSession_1.useLiveSession)();
83
+ const { voteInPoll } = session.actions;
84
+ const { loggedIn, restoring, customer } = (0, sdk_shopify_1.useCustomer)();
85
+ const { accountLoading, nameToComplete, saveNameToAccount } = (0, useAccountName_1.useAccountName)();
86
+ const cartId = (_d = (_c = (0, sdk_shopify_1.useCart)().cart) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : null;
87
+ const nav = (0, navigation_1.useNavigation)();
88
+ const { routes, blockedNames } = (0, LiveSellingProvider_1.useLivePageOptions)();
89
+ const signIn = (0, sdk_shopify_1.useSignIn)({ onOpenSignInPage: (method) => routes.openSignIn(method, nav) });
90
+ // ─── Which show ────────────────────────────────────────────────────────────────────────────────
91
+ // The session's record once it is this show's: right after the pin it can still hold the last show's.
92
+ const { show, onAir, capabilities } = (0, platformSession_1.useLiveShow)(streamId);
93
+ const showing = onAir && !!show;
94
+ const giveaway = (_e = session.giveaway) !== null && _e !== void 0 ? _e : sessionTypes_1.IDLE_GIVEAWAY;
95
+ // ─── The giveaway: the entry's flow ────────────────────────────────────────────────────────────
96
+ const entry = (0, useGiveawayEntry_1.useGiveawayEntry)({
97
+ session,
98
+ canEnter: showing && capabilities.canEnterGiveaway,
99
+ isLoggedIn: !!loggedIn,
100
+ startSignIn: signIn.start,
101
+ // Back here: this screen focused (the Sign In page closed), and no system sign-in sheet up.
102
+ screenOnShow: isFocused && !signIn.signingIn,
103
+ // The shopper's ordinary cart, which the gateway ties the entry to (Freckled Poppy's). On a live
104
+ // show the server puts a won prize in this cart, even if the app has moved to another by the draw
105
+ // ("Where the prize goes", above).
106
+ cartId,
107
+ });
108
+ const openGiveaway = entry.open;
109
+ /** The prize from the catalogue: the description, and the given-away variant's photo and price. */
110
+ const { product: prizeProduct, variant: prizeVariant, readError: prizeReadError } = (0, useGiveawayPrize_1.useGiveawayPrize)(openGiveaway);
111
+ (0, react_1.useEffect)(() => {
112
+ var _a;
113
+ if (prizeReadError)
114
+ (0, pageOptions_1.reportLiveWarning)(prizeReadError, { at: 'live.giveawayPrize', storeProductId: (_a = openGiveaway === null || openGiveaway === void 0 ? void 0 : openGiveaway.storeProductId) !== null && _a !== void 0 ? _a : null });
115
+ // Reported once per failed read, for the prize it was for.
116
+ // eslint-disable-next-line react-hooks/exhaustive-deps
117
+ }, [prizeReadError]);
118
+ // The record's own price, should the catalogue not answer, priced in the show's currency.
119
+ const showCurrency = (_k = (_g = (_f = session.activeProduct) === null || _f === void 0 ? void 0 : _f.currencyCode) !== null && _g !== void 0 ? _g : (_j = (_h = session.products) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.currencyCode) !== null && _k !== void 0 ? _k : null;
120
+ const prize = (0, react_1.useMemo)(() => {
121
+ var _a, _b, _c, _d, _e, _f, _g, _h;
122
+ if (!openGiveaway)
123
+ return null;
124
+ const recordPrice = openGiveaway.variantPrice && showCurrency ? (0, sdk_shopify_1.formatMoney)({ amount: openGiveaway.variantPrice, currencyCode: showCurrency }) : null;
125
+ const variantPrice = (prizeVariant === null || prizeVariant === void 0 ? void 0 : prizeVariant.price) && (prizeProduct === null || prizeProduct === void 0 ? void 0 : prizeProduct.currencyCode) ? (0, sdk_shopify_1.formatMoney)({ amount: prizeVariant.price, currencyCode: prizeProduct.currencyCode }) : null;
126
+ return {
127
+ productName: openGiveaway.productName || (prizeProduct === null || prizeProduct === void 0 ? void 0 : prizeProduct.title) || '',
128
+ variantTitle: (_b = (_a = openGiveaway.variantTitle) !== null && _a !== void 0 ? _a : prizeVariant === null || prizeVariant === void 0 ? void 0 : prizeVariant.title) !== null && _b !== void 0 ? _b : null,
129
+ retailPrice: prizeVariant ? variantPrice : recordPrice,
130
+ // The catalogue's variant photo, else its product photo; until it answers, the record's variant photo.
131
+ imageUrl: (_f = (_e = (_d = (_c = prizeVariant === null || prizeVariant === void 0 ? void 0 : prizeVariant.imageUrl) !== null && _c !== void 0 ? _c : prizeProduct === null || prizeProduct === void 0 ? void 0 : prizeProduct.imageUrl) !== null && _d !== void 0 ? _d : openGiveaway.variantImageUrl) !== null && _e !== void 0 ? _e : openGiveaway.thumbnailUrl) !== null && _f !== void 0 ? _f : null,
132
+ description: ((_h = (_g = prizeProduct === null || prizeProduct === void 0 ? void 0 : prizeProduct.raw) === null || _g === void 0 ? void 0 : _g.description) === null || _h === void 0 ? void 0 : _h.trim()) || null,
133
+ };
134
+ }, [openGiveaway, prizeProduct, prizeVariant, showCurrency]);
135
+ // ─── Who the shopper is to the giveaway ────────────────────────────────────────────────────────
136
+ const signInToEnter = !loggedIn && !restoring;
137
+ // A stored sign-in still being read, or a signed-in shopper's account (and so their name) still on its
138
+ // way: Enter waits. No first name on the account: asked, and saved to it. Else the room's own ask.
139
+ const { askForName, waitingForName } = (0, livePages_1.giveawayNameAsk)({
140
+ named: !!((_l = session.viewerName) === null || _l === void 0 ? void 0 : _l.trim()),
141
+ loggedIn: !!loggedIn,
142
+ hasCustomer: !!customer,
143
+ accountLoading,
144
+ nameToComplete,
145
+ });
146
+ // "Entering As:" for the account: the name goes on the account, then the entry goes under it.
147
+ const [savingAccountName, setSavingAccountName] = (0, react_1.useState)(false);
148
+ const [accountNameNotSaved, setAccountNameNotSaved] = (0, react_1.useState)(false);
149
+ const enterUnder = entry.enter;
150
+ const enterWithAccountName = (0, react_1.useCallback)(async (firstName, lastName) => {
151
+ setSavingAccountName(true);
152
+ setAccountNameNotSaved(false);
153
+ try {
154
+ const savedName = await saveNameToAccount(firstName, lastName);
155
+ if (savedName)
156
+ enterUnder(savedName);
157
+ else
158
+ setAccountNameNotSaved(true);
159
+ }
160
+ finally {
161
+ setSavingAccountName(false);
162
+ }
163
+ }, [saveNameToAccount, enterUnder]);
164
+ // A failure belongs to the sheet it happened in.
165
+ (0, react_1.useEffect)(() => {
166
+ if (!entry.sheetOpen)
167
+ setAccountNameNotSaved(false);
168
+ }, [entry.sheetOpen]);
169
+ const isNameAllowed = (0, react_1.useCallback)((name) => !(0, showNames_1.isBlockedViewerName)(name, blockedNames), [blockedNames]);
170
+ // ─── The poll ──────────────────────────────────────────────────────────────────────────────────
171
+ const poll = showing ? ((_m = session.poll) !== null && _m !== void 0 ? _m : null) : null;
172
+ const pollId = (_p = (_o = session.poll) === null || _o === void 0 ? void 0 : _o.pollUuid) !== null && _p !== void 0 ? _p : null;
173
+ const [pollSheetOpen, setPollSheetOpen] = (0, react_1.useState)(false);
174
+ // Closed whenever the poll changes, ended or replaced by the host's next: an empty sheet, or a
175
+ // question the shopper never chose to answer, would be in front of them.
176
+ (0, react_1.useEffect)(() => {
177
+ setPollSheetOpen(false);
178
+ }, [pollId]);
179
+ const votedAlready = !!((_q = session.poll) === null || _q === void 0 ? void 0 : _q.votedOptionId);
180
+ const vote = (0, react_1.useCallback)((optionId) => {
181
+ // One vote a poll (the session keeps it on the phone and ignores another); the sheet's choices are off once voted.
182
+ if (!votedAlready)
183
+ void voteInPoll(optionId);
184
+ }, [votedAlready, voteInPoll]);
185
+ return {
186
+ giveawayButton: {
187
+ visible: !!openGiveaway,
188
+ prize,
189
+ entryCount: giveaway.entryCount,
190
+ entered: giveaway.registered,
191
+ entering: entry.entering || savingAccountName,
192
+ signInToEnter,
193
+ waitingForName,
194
+ askForName,
195
+ accountName: nameToComplete,
196
+ nameSaveFailed: accountNameNotSaved,
197
+ isNameAllowed,
198
+ nameMaxLength: viewer_1.MAX_VIEWER_NAME,
199
+ entryFailed: entry.entryFailed,
200
+ sheetVisible: entry.sheetOpen,
201
+ onOpenSheet: entry.openSheet,
202
+ onCloseSheet: entry.closeSheet,
203
+ onEnter: entry.enter,
204
+ onEnterWithAccountName: (firstName, lastName) => void enterWithAccountName(firstName, lastName),
205
+ onSignInToEnter: entry.signInToEnter,
206
+ },
207
+ giveawayDraw: {
208
+ visible: showing,
209
+ draw: entry.draw,
210
+ isWinner: entry.youWon,
211
+ onDone: entry.drawDone,
212
+ },
213
+ pollButton: {
214
+ visible: !!poll,
215
+ poll,
216
+ // The show's poster stands in for a brand mark beside the question (old Amore's).
217
+ logoUrl: (_r = show === null || show === void 0 ? void 0 : show.thumbnailUrl) !== null && _r !== void 0 ? _r : null,
218
+ sheetVisible: pollSheetOpen && !!poll,
219
+ onOpenSheet: () => setPollSheetOpen(true),
220
+ onCloseSheet: () => setPollSheetOpen(false),
221
+ onVote: vote,
222
+ },
223
+ };
224
+ }
225
+ //# sourceMappingURL=useLiveGiveawaysAndPolls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLiveGiveawaysAndPolls.js","sourceRoot":"","sources":["../../src/react/useLiveGiveawaysAndPolls.ts"],"names":[],"mappings":";;AA+EA,4DAwJC;AAvOD;;;;;;GAMG;AACH,sDAAkG;AAClG,iCAAkE;AAElE,4CAA+C;AAC/C,gDAAmD;AAEnD,kDAAgD;AAChD,4CAAmD;AACnD,sCAA4C;AAC5C,+DAA2D;AAC3D,uDAAgE;AAChE,qDAAkD;AAClD,yDAAsD;AACtD,yDAAsD;AACtD,6CAA8H;AAK9H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,SAAgB,wBAAwB;;IACtC,MAAM,QAAQ,GAAG,MAAA,MAAA,IAAA,qBAAQ,GAAa,CAAC,MAAM,0CAAE,QAAQ,mCAAI,EAAE,CAAC;IAC9D,MAAM,SAAS,GAAG,IAAA,yBAAY,GAAE,CAAC;IACjC,mEAAmE;IACnE,MAAM,OAAO,GAAG,IAAA,gCAAc,GAAW,CAAC;IAC1C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IACvC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAA,yBAAW,GAAE,CAAC;IACxD,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IAC/E,MAAM,MAAM,GAAG,MAAA,MAAA,IAAA,qBAAO,GAAE,CAAC,I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AI,IAAI;YACnC,YAAY,EAAE,aAAa,IAAI,CAAC,CAAC,IAAI;YACrC,WAAW,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC;YACzC,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAC3C,MAAM,EAAE,IAAI;SACb;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Everything the Live screen wires, so the screen stays plain tiles. Call it from the Live screen and
3
+ * from each of its tiles' wiring: every call reads the same session.
4
+ *
5
+ * - **The session is the app's** (`ShopifyLiveSessionProvider`), joined above the navigator; this
6
+ * screen binds to its picture (the player tile's `LiveVideoTarget`) and never owns the room.
7
+ * - **Pinned to the route's show** while watching (`holdStream(streamId)`, at every arrival), so a host
8
+ * restarting the broadcast can't swap the room underneath; released when the shopper closes the show
9
+ * (back on a show that has ended or is still joining, ✕ on the bubble, or leaving any other way
10
+ * without the bubble), and kept when the bubble takes the show.
11
+ * - **Which show** (`useLiveShow`): the session's record once it is this show's (just after the pin it
12
+ * can still hold the last show's), where it stands, and whether it is on air.
13
+ * - **Where the link lands** (`streams.destinationFor`, one read of the show's record on arrival): a
14
+ * show on air stays; an ended show with a recording is replaced by its Replay
15
+ * (`routes.replaceWithReplay`); anything else (a rehearsal this shopper can't see included) by the
16
+ * Live tab (`routes.backToLiveTab`). Not on the web, where nothing can play: the Tile preview stays on
17
+ * this page to show its tiles, with the record's poster and the ended words.
18
+ * - **Every arrival** reads the record again (`refreshStreamRecords`, which restarts the session's
19
+ * off-air wait, so a push tapped in the foreground can't be declared over on a stale record) and ends
20
+ * the bubble: this screen shows the picture again.
21
+ * - **Back, every kind** (the header's arrow, the iOS swipe, Android's back; decided 2026-10-05,
22
+ * amore-v2's Head of Engineering) shrinks a show that is playing or waiting for its host into the
23
+ * bubble as the screen leaves, and closes one that has ended. One path: the screen's `beforeRemove`,
24
+ * for the navigation's back actions (`BACK_ACTIONS`). Picture-in-picture is a back that always
25
+ * shrinks; the cart shrinks the show and opens the Cart over this screen (Items You Won on an auction
26
+ * show: `routes.openCart`). Android's back with nothing behind this screen (a link on a cold start)
27
+ * does what the arrow does: back to the Live tab.
28
+ * - **A link from the show** (`openLink`, 0.15.0; decided 2026-10-19 by amore-v2's Head of Engineering)
29
+ * opens inside the app, never the phone's browser: the show goes into the bubble, as for the cart, and
30
+ * the app's `routes.openLink` opens the page (amore-v2: the store's product or collection on its
31
+ * screen, any other page in its web page). Leaving the app for the phone's browser is what left the
32
+ * player dark on the way back (ENG-629) and the phone's window blank (ENG-580). A link that isn't https
33
+ * (`opensInApp`), or an app without `routes.openLink`, opens nothing, and the show stays.
34
+ * - **The cart's holds** (0.15.0, amore-v2's ENG-691): the header shows a timer under the cart button in
35
+ * the soonest hold's last minutes; this hands it when each hold ends (`header.holdEndTimes`,
36
+ * `holdEndTimesOf` over sdk-shopify's cart and its `cartExtensions`), and the header counts.
37
+ * - **One shrunk show at a time:** arriving here stops a replay's bubble (and the Replay screen stops
38
+ * this show's bubble).
39
+ * - **The screen stays on** while it shows the show playing or waiting for its host.
40
+ * - **Under a sheet** (`routes.sheets`: the variant page, opened from the shop; the Sign In page) the
41
+ * show plays on here, with the screen on and the light status bar, as Replay's does.
42
+ * - **Put away** while the show plays here (a sheet over it included), it goes on in the phone's own
43
+ * floating window (`systemWindowWhenAway`); coming back finds it here again.
44
+ * - **`liveJoin`** (`track`) once per show per app run; never for a rehearsal, a show the config's
45
+ * `hiddenShows` names, whoever watches it.
46
+ * - **Hidden shows** (`hiddenShows`): for a shopper who isn't on the team the session never holds one,
47
+ * so it is never on air here (the link goes to the Live tab).
48
+ * - **Chat and reactions** are `useLiveChat`'s, shown only while the show is on air; a host's or
49
+ * moderator's link in the chat opens through `openLink`.
50
+ */
51
+ export declare function useLivePage(): {
52
+ /**
53
+ * Android's own picture-in-picture window is up. It shrinks the whole app, and every sheet on the
54
+ * Live screen (poll, giveaway, shop, custom bid, name, reactions) is a window of its own above the
55
+ * app, so it rode the shrink and covered the video (fixed 2026-10-08; Freckled Poppy hides its
56
+ * sheets the same way). The screen then draws only the player; the sheets' open state is the
57
+ * hooks', so they come back. iOS's window shows the video alone.
58
+ */
59
+ inSystemWindow: boolean;
60
+ /** The screen is on show (or under a sheet), over the dark video: light status bar text. */
61
+ lightStatusBar: boolean;
62
+ player: {
63
+ status: import("..").LiveShowStatus;
64
+ posterUrl: string | null;
65
+ isAuction: boolean;
66
+ videoActive: boolean;
67
+ systemWindowWhenAway: boolean;
68
+ };
69
+ header: {
70
+ ended: boolean;
71
+ isAuction: boolean;
72
+ startedAt: number | null;
73
+ viewerCount: number | null;
74
+ muted: boolean;
75
+ canMute: boolean;
76
+ canPip: boolean;
77
+ backShrinks: boolean;
78
+ cartCount: number;
79
+ holdEndTimes: number[];
80
+ onBack: () => void;
81
+ onToggleMute: () => void;
82
+ onPip: () => void;
83
+ onCart: () => void;
84
+ };
85
+ /** The chat, the comment box, reactions and the pinned comment: one set of props per tile (`useLiveChat`). */
86
+ chat: {
87
+ keyboardUp: boolean;
88
+ typing: boolean;
89
+ comments: {
90
+ visible: boolean;
91
+ comments: import("../types").LiveComment[];
92
+ hidden: boolean;
93
+ onToggleHidden: () => void;
94
+ onPressName: ((name: string) => void) | undefined;
95
+ onOpenLink: ((url: string) => void) | undefined;
96
+ };
97
+ commentBox: {
98
+ visible: boolean;
99
+ askForName: boolean;
100
+ accountName: import("..").NameOnAccount | null;
101
+ waitingForName: boolean;
102
+ signedOut: boolean;
103
+ auction: boolean;
104
+ keyboardRequest: number;
105
+ onSignInToComment: () => void;
106
+ sending: boolean;
107
+ mention: import("..").LiveCommentMention | null;
108
+ nameMaxLength: number;
109
+ onSend: (text: string) => Promise<void>;
110
+ onSaveName: (name: string) => Promise<boolean>;
111
+ onSaveAccountName: (firstName: string, lastName: string) => Promise<boolean>;
112
+ isNameAllowed: (name: string) => boolean;
113
+ onTypingChange: import("react").Dispatch<import("react").SetStateAction<boolean>>;
114
+ };
115
+ reactionButton: {
116
+ visible: boolean;
117
+ onReact: (reactionUrl: string) => undefined;
118
+ };
119
+ reactions: {
120
+ visible: boolean;
121
+ reactions: import("../sessionTypes").FloatingReaction[];
122
+ reactionStyle: import("../types").ReactionStyle;
123
+ };
124
+ pinnedComment: {
125
+ visible: boolean;
126
+ pinnedComment: import("../types").LivePinnedComment | null;
127
+ };
128
+ };
129
+ /** A link from the show (0.15.0): its page inside the app, the show in the bubble. `useLiveShop` takes it. */
130
+ openLink: (url: string, title?: string | null) => void;
131
+ };
132
+ /** What `useLivePage` hands the Live screen and its tiles. */
133
+ export type LivePage = ReturnType<typeof useLivePage>;
134
+ //# sourceMappingURL=useLivePage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLivePage.d.ts","sourceRoot":"","sources":["../../src/react/useLivePage.ts"],"names":[],"mappings":"AA8CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,WAAW;IA2LvB;;;;;;OAMG;;IAEH,4FAA4F;;;;;;;;;;;;;;;;;;;;;;;;;IAgC5F,8GAA8G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE9G,8GAA8G;oBA7HxG,MAAM,UAAU,MAAM,GAAG,IAAI;EAgItC;AAED,8DAA8D;AAC9D,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}