@tiledev/sdk-apptile-live-selling 0.8.1 → 0.9.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 (196) hide show
  1. package/README.md +452 -34
  2. package/dist/auctionComments.d.ts +25 -0
  3. package/dist/auctionComments.d.ts.map +1 -0
  4. package/dist/auctionComments.js +28 -0
  5. package/dist/auctionComments.js.map +1 -0
  6. package/dist/auctionRules.d.ts +76 -0
  7. package/dist/auctionRules.d.ts.map +1 -0
  8. package/dist/auctionRules.js +106 -0
  9. package/dist/auctionRules.js.map +1 -0
  10. package/dist/auctions.d.ts.map +1 -1
  11. package/dist/auctions.js +19 -10
  12. package/dist/auctions.js.map +1 -1
  13. package/dist/client.d.ts +51 -2
  14. package/dist/client.d.ts.map +1 -1
  15. package/dist/client.js +123 -23
  16. package/dist/client.js.map +1 -1
  17. package/dist/commentHistory.d.ts +66 -0
  18. package/dist/commentHistory.d.ts.map +1 -0
  19. package/dist/commentHistory.js +125 -0
  20. package/dist/commentHistory.js.map +1 -0
  21. package/dist/engine.native.d.ts.map +1 -1
  22. package/dist/engine.native.js +17 -845
  23. package/dist/engine.native.js.map +1 -1
  24. package/dist/giveawayPrize.d.ts +13 -0
  25. package/dist/giveawayPrize.d.ts.map +1 -0
  26. package/dist/giveawayPrize.js +18 -0
  27. package/dist/giveawayPrize.js.map +1 -0
  28. package/dist/giveawayPrizeLines.d.ts +67 -0
  29. package/dist/giveawayPrizeLines.d.ts.map +1 -0
  30. package/dist/giveawayPrizeLines.js +48 -0
  31. package/dist/giveawayPrizeLines.js.map +1 -0
  32. package/dist/giveawayRoster.d.ts +53 -0
  33. package/dist/giveawayRoster.d.ts.map +1 -0
  34. package/dist/giveawayRoster.js +93 -0
  35. package/dist/giveawayRoster.js.map +1 -0
  36. package/dist/heldComments.d.ts +29 -0
  37. package/dist/heldComments.d.ts.map +1 -0
  38. package/dist/heldComments.js +61 -0
  39. package/dist/heldComments.js.map +1 -0
  40. package/dist/hiddenShows.d.ts +34 -0
  41. package/dist/hiddenShows.d.ts.map +1 -0
  42. package/dist/hiddenShows.js +42 -0
  43. package/dist/hiddenShows.js.map +1 -0
  44. package/dist/index.d.ts +19 -2
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +93 -3
  47. package/dist/index.js.map +1 -1
  48. package/dist/liveHaptics.d.ts +7 -0
  49. package/dist/liveHaptics.d.ts.map +1 -0
  50. package/dist/liveHaptics.js +11 -0
  51. package/dist/liveHaptics.js.map +1 -0
  52. package/dist/liveHaptics.native.d.ts +7 -0
  53. package/dist/liveHaptics.native.d.ts.map +1 -0
  54. package/dist/liveHaptics.native.js +12 -0
  55. package/dist/liveHaptics.native.js.map +1 -0
  56. package/dist/liveShow.d.ts +58 -0
  57. package/dist/liveShow.d.ts.map +1 -0
  58. package/dist/liveShow.js +55 -0
  59. package/dist/liveShow.js.map +1 -0
  60. package/dist/phoneTaps.d.ts +25 -0
  61. package/dist/phoneTaps.d.ts.map +1 -0
  62. package/dist/phoneTaps.js +47 -0
  63. package/dist/phoneTaps.js.map +1 -0
  64. package/dist/pipWindow.d.ts +85 -0
  65. package/dist/pipWindow.d.ts.map +1 -0
  66. package/dist/pipWindow.js +88 -0
  67. package/dist/pipWindow.js.map +1 -0
  68. package/dist/polls.d.ts.map +1 -1
  69. package/dist/polls.js +3 -0
  70. package/dist/polls.js.map +1 -1
  71. package/dist/react/LiveSellingProvider.d.ts +10 -1
  72. package/dist/react/LiveSellingProvider.d.ts.map +1 -1
  73. package/dist/react/LiveSellingProvider.js +6 -2
  74. package/dist/react/LiveSellingProvider.js.map +1 -1
  75. package/dist/react/LiveVideoTarget.d.ts.map +1 -1
  76. package/dist/react/LiveVideoTarget.js +41 -3
  77. package/dist/react/LiveVideoTarget.js.map +1 -1
  78. package/dist/react/clocks.d.ts +29 -0
  79. package/dist/react/clocks.d.ts.map +1 -0
  80. package/dist/react/clocks.js +124 -0
  81. package/dist/react/clocks.js.map +1 -0
  82. package/dist/react/index.d.ts +7 -2
  83. package/dist/react/index.d.ts.map +1 -1
  84. package/dist/react/index.js +15 -1
  85. package/dist/react/index.js.map +1 -1
  86. package/dist/react/index.web.d.ts +9 -2
  87. package/dist/react/index.web.d.ts.map +1 -1
  88. package/dist/react/index.web.js +27 -4
  89. package/dist/react/index.web.js.map +1 -1
  90. package/dist/react/startSignIn.d.ts +3 -0
  91. package/dist/react/startSignIn.d.ts.map +1 -0
  92. package/dist/react/startSignIn.js +19 -0
  93. package/dist/react/startSignIn.js.map +1 -0
  94. package/dist/react/useAuctionBidGate.d.ts +54 -4
  95. package/dist/react/useAuctionBidGate.d.ts.map +1 -1
  96. package/dist/react/useAuctionBidGate.js +169 -25
  97. package/dist/react/useAuctionBidGate.js.map +1 -1
  98. package/dist/react/useAuctionWins.d.ts +9 -1
  99. package/dist/react/useAuctionWins.d.ts.map +1 -1
  100. package/dist/react/useAuctionWins.js +9 -3
  101. package/dist/react/useAuctionWins.js.map +1 -1
  102. package/dist/react/useGiveawayEntry.d.ts +59 -0
  103. package/dist/react/useGiveawayEntry.d.ts.map +1 -0
  104. package/dist/react/useGiveawayEntry.js +170 -0
  105. package/dist/react/useGiveawayEntry.js.map +1 -0
  106. package/dist/react/useGiveawayPrize.d.ts +12 -0
  107. package/dist/react/useGiveawayPrize.d.ts.map +1 -0
  108. package/dist/react/useGiveawayPrize.js +53 -0
  109. package/dist/react/useGiveawayPrize.js.map +1 -0
  110. package/dist/react/useHiddenShows.d.ts +10 -0
  111. package/dist/react/useHiddenShows.d.ts.map +1 -0
  112. package/dist/react/useHiddenShows.js +30 -0
  113. package/dist/react/useHiddenShows.js.map +1 -0
  114. package/dist/react/useLiveSession.d.ts +7 -3
  115. package/dist/react/useLiveSession.d.ts.map +1 -1
  116. package/dist/react/useLiveSession.js +522 -157
  117. package/dist/react/useLiveSession.js.map +1 -1
  118. package/dist/react/useLiveShow.d.ts +3 -0
  119. package/dist/react/useLiveShow.d.ts.map +1 -0
  120. package/dist/react/useLiveShow.js +21 -0
  121. package/dist/react/useLiveShow.js.map +1 -0
  122. package/dist/react/useLiveStreams.d.ts.map +1 -1
  123. package/dist/react/useLiveStreams.js +6 -2
  124. package/dist/react/useLiveStreams.js.map +1 -1
  125. package/dist/react/useOngoingLive.d.ts +1 -0
  126. package/dist/react/useOngoingLive.d.ts.map +1 -1
  127. package/dist/react/useOngoingLive.js +7 -1
  128. package/dist/react/useOngoingLive.js.map +1 -1
  129. package/dist/react/useReplays.d.ts +12 -0
  130. package/dist/react/useReplays.d.ts.map +1 -1
  131. package/dist/react/useReplays.js +56 -24
  132. package/dist/react/useReplays.js.map +1 -1
  133. package/dist/react/useStreamInfo.d.ts +13 -2
  134. package/dist/react/useStreamInfo.d.ts.map +1 -1
  135. package/dist/react/useStreamInfo.js +31 -5
  136. package/dist/react/useStreamInfo.js.map +1 -1
  137. package/dist/replayPages.d.ts +31 -0
  138. package/dist/replayPages.d.ts.map +1 -0
  139. package/dist/replayPages.js +34 -0
  140. package/dist/replayPages.js.map +1 -0
  141. package/dist/replays.d.ts +7 -0
  142. package/dist/replays.d.ts.map +1 -1
  143. package/dist/replays.js +52 -22
  144. package/dist/replays.js.map +1 -1
  145. package/dist/session.d.ts +39 -6
  146. package/dist/session.d.ts.map +1 -1
  147. package/dist/session.js +209 -22
  148. package/dist/session.js.map +1 -1
  149. package/dist/sessionTypes.d.ts +190 -14
  150. package/dist/sessionTypes.d.ts.map +1 -1
  151. package/dist/sessionTypes.js +2 -1
  152. package/dist/sessionTypes.js.map +1 -1
  153. package/dist/shopifyCommerce.d.ts +149 -0
  154. package/dist/shopifyCommerce.d.ts.map +1 -0
  155. package/dist/shopifyCommerce.js +123 -0
  156. package/dist/shopifyCommerce.js.map +1 -0
  157. package/dist/shopifyIdentity.d.ts +51 -0
  158. package/dist/shopifyIdentity.d.ts.map +1 -0
  159. package/dist/shopifyIdentity.js +52 -0
  160. package/dist/shopifyIdentity.js.map +1 -0
  161. package/dist/shopifyIds.d.ts +9 -0
  162. package/dist/shopifyIds.d.ts.map +1 -0
  163. package/dist/shopifyIds.js +18 -0
  164. package/dist/shopifyIds.js.map +1 -0
  165. package/dist/showLinks.d.ts +24 -0
  166. package/dist/showLinks.d.ts.map +1 -0
  167. package/dist/showLinks.js +23 -0
  168. package/dist/showLinks.js.map +1 -0
  169. package/dist/showLots.d.ts +28 -0
  170. package/dist/showLots.d.ts.map +1 -0
  171. package/dist/showLots.js +51 -0
  172. package/dist/showLots.js.map +1 -0
  173. package/dist/showNames.d.ts +45 -0
  174. package/dist/showNames.d.ts.map +1 -0
  175. package/dist/showNames.js +74 -0
  176. package/dist/showNames.js.map +1 -0
  177. package/dist/streams.d.ts +27 -1
  178. package/dist/streams.d.ts.map +1 -1
  179. package/dist/streams.js +84 -21
  180. package/dist/streams.js.map +1 -1
  181. package/dist/types.d.ts +214 -8
  182. package/dist/types.d.ts.map +1 -1
  183. package/dist/types.js +2 -1
  184. package/dist/types.js.map +1 -1
  185. package/dist/wire.d.ts +31 -0
  186. package/dist/wire.d.ts.map +1 -1
  187. package/dist/wire.js +25 -0
  188. package/dist/wire.js.map +1 -1
  189. package/dist/zego.d.ts +3 -1
  190. package/dist/zego.d.ts.map +1 -1
  191. package/dist/zego.js +1 -1
  192. package/dist/zegoEngine.d.ts +168 -0
  193. package/dist/zegoEngine.d.ts.map +1 -0
  194. package/dist/zegoEngine.js +1052 -0
  195. package/dist/zegoEngine.js.map +1 -0
  196. package/package.json +3 -2
package/dist/index.d.ts CHANGED
@@ -15,17 +15,34 @@
15
15
  * ```
16
16
  */
17
17
  export { liveSelling, liveSelling as default } from './liveSelling';
18
+ export { liveHaptics } from './liveHaptics';
19
+ export { createLiveHaptics, LIVE_HAPTICS_TICK_GAP_MS, type LiveHaptics } from './phoneTaps';
18
20
  export { engine as liveEngine } from './engine';
19
- export { LiveSellingError, toProductGid } from './client';
21
+ export { LiveSellingError, LiveSellingTimeoutError, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_OFF_AIR_GRACE_MS, toProductGid, } from './client';
22
+ export { ZegoLoginError, JOIN_ATTEMPTS, JOIN_RETRY_BASE_MS } from './zegoEngine';
20
23
  export { toLiveStream, toLiveStreams, toLiveStreamProduct, toLiveGiveaway, toGiveawayEntries, } from './streams';
21
24
  export { toLivePoll, toLivePollResults, toEmbeddedResults } from './polls';
25
+ export { imageUrl, toPinnedComment } from './wire';
26
+ export { toCommentHistory, mergeCommentHistory, COMMENT_HISTORY_WINDOW, HOST_SELF_NAME, type CommentHistoryContext, } from './commentHistory';
27
+ export { GIVEAWAY_ROSTER_RETRY_MS, GIVEAWAY_ROSTER_WAIT_MS, giveawayForLot, rosterFromRecord, winnerIdFromRecord, isYourGiveawayWin, } from './giveawayRoster';
22
28
  export { toMixerLayout } from './guest';
23
29
  export { resetCompanyFlagsCache } from './flags';
24
30
  export { MAX_VIEWER_NAME } from './viewer';
25
31
  export { LIVE_STREAM_ID_ATTRIBUTE, REPLAY_ID_ATTRIBUTE, liveCartAttributesFor, replayCartAttributesFor, addLiveLine, } from './cartAttributes';
26
32
  export { liveAttributionSourceFor, replayAttributionSourceFor, type AttributionSource, } from './attribution';
27
33
  export { toCommentSegments, hasCommentLink, classifyCommentLink, toUrlPreview, displayHost, type CommentLink, type CommentSegment, } from './commentLinks';
28
- export { sessionReducer, initialSessionState, deriveStatus, remainingMs, timeLeftMs, SOLD_CARD_MS, REACTION_MS, } from './session';
34
+ export { createShopifyLiveCommerce, liveProductFromShopify, chargedVariantId, AUCTION_CART_SOURCE_TYPE, WINNING_BID_KEY, WIN_INDEX_KEY, type ShopifyAttribute, type ShopifyBuyer, type ShopifyCartLineInput, type ShopifyImageTransform, type ShopifyLiveCommerce, type ShopifyLiveCommerceOptions, type ShopifyMoney, type ShopifyProductForLive, type ShopifyProductsAndCart, } from './shopifyCommerce';
35
+ export { createShopifyLiveIdentity, type ShopifyCustomerSession, type ShopifyLiveIdentity, } from './shopifyIdentity';
36
+ export { GIVEAWAY_PRIZE_KEYS, isGiveawayPrizeLine, prizeLinePrice, type GiveawayPrizeLineOptions, type PrizeLinePrice, } from './giveawayPrizeLines';
37
+ export { isHiddenFrom, isHiddenShow, seesHiddenShows, withoutHiddenShows } from './hiddenShows';
38
+ export { publicName, firstNameOf, viewerNameFor, sameRoomName, type NamedCustomer } from './showNames';
39
+ export { liveShowFor, canPlayInCard, type LiveShow, type LiveShowStatus, type SessionForCard, type SessionForShow, } from './liveShow';
40
+ export { featuredFirst, withLotFieldsFromRecord } from './showLots';
41
+ export { showLinkDestination } from './showLinks';
42
+ export { bidRefusal, quickBids, winChance, lotStateFor, isYourWin, BID_ON_ITS_WAY_MS, QUICK_BID_STEPS, VERY_HIGH_CHANCE_OVER, GOOD_CHANCE_OVER, type BidRound, type BidRefusalReason, type WinChance, openingBidFor } from './auctionRules';
43
+ export { classifyComment, type CommentLine } from './auctionComments';
44
+ export { isTheVariant, givenAwayVariant } from './giveawayPrize';
45
+ export { sessionReducer, initialSessionState, deriveStatus, roundClosesAt, nextExpiryAt, isNothingOnAir, withOffAirSettled, isTheEndedGiveaway, SOLD_CARD_MS, REACTION_MS, CART_CARD_MS, } from './session';
29
46
  export { capabilitiesFor, LIVE_CAPABILITIES, AUCTION_CAPABILITIES, REPLAY_CAPABILITIES, IDLE_AUCTION, IDLE_GIVEAWAY, } from './sessionTypes';
30
47
  /**
31
48
  * Picture-in-picture, from the native package.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,WAAW,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG1D,OAAO,EACL,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,i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AW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGjE,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAGvF,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,gBAAgB,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -30,18 +30,34 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
30
30
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.ONGOING_LIVE_POLL_LIVE_MS = exports.ONGOING_LIVE_POLL_IDLE_MS = exports.createOngoingLiveStore = exports.COMMENT_SOURCES = exports.isLivePipSupported = exports.livePip = exports.IDLE_GIVEAWAY = exports.IDLE_AUCTION = exports.REPLAY_CAPABILITIES = exports.AUCTION_CAPABILITIES = exports.LIVE_CAPABILITIES = exports.capabilitiesFor = exports.REACTION_MS = exports.SOLD_CARD_MS = exports.timeLeftMs = exports.remainingMs = exports.deriveStatus = exports.initialSessionState = exports.sessionReducer = exports.displayHost = exports.toUrlPreview = exports.classifyCommentLink = exports.hasCommentLink = exports.toCommentSegments = exports.replayAttributionSourceFor = exports.liveAttributionSourceFor = exports.addLiveLine = exports.replayCartAttributesFor = exports.liveCartAttributesFor = exports.REPLAY_ID_ATTRIBUTE = exports.LIVE_STREAM_ID_ATTRIBUTE = exports.MAX_VIEWER_NAME = exports.resetCompanyFlagsCache = exports.toMixerLayout = exports.toEmbeddedResults = exports.toLivePollResults = exports.toLivePoll = exports.toGiveawayEntries = exports.toLiveGiveaway = exports.toLiveStreamProduct = exports.toLiveStreams = exports.toLiveStream = exports.toProductGid = exports.LiveSellingError = exports.liveEngine = exports.default = exports.liveSelling = void 0;
33
+ exports.createShopifyLiveCommerce = exports.displayHost = exports.toUrlPreview = exports.classifyCommentLink = exports.hasCommentLink = exports.toCommentSegments = exports.replayAttributionSourceFor = exports.liveAttributionSourceFor = exports.addLiveLine = exports.replayCartAttributesFor = exports.liveCartAttributesFor = exports.REPLAY_ID_ATTRIBUTE = exports.LIVE_STREAM_ID_ATTRIBUTE = exports.MAX_VIEWER_NAME = exports.resetCompanyFlagsCache = exports.toMixerLayout = exports.isYourGiveawayWin = exports.winnerIdFromRecord = exports.rosterFromRecord = exports.giveawayForLot = exports.GIVEAWAY_ROSTER_WAIT_MS = exports.GIVEAWAY_ROSTER_RETRY_MS = exports.HOST_SELF_NAME = exports.COMMENT_HISTORY_WINDOW = exports.mergeCommentHistory = exports.toCommentHistory = exports.toPinnedComment = exports.imageUrl = exports.toEmbeddedResults = exports.toLivePollResults = exports.toLivePoll = exports.toGiveawayEntries = exports.toLiveGiveaway = exports.toLiveStreamProduct = exports.toLiveStreams = exports.toLiveStream = exports.JOIN_RETRY_BASE_MS = exports.JOIN_ATTEMPTS = exports.ZegoLoginError = exports.toProductGid = exports.DEFAULT_OFF_AIR_GRACE_MS = exports.DEFAULT_REQUEST_TIMEOUT_MS = exports.LiveSellingTimeoutError = exports.LiveSellingError = exports.liveEngine = exports.LIVE_HAPTICS_TICK_GAP_MS = exports.createLiveHaptics = exports.liveHaptics = exports.default = exports.liveSelling = void 0;
34
+ exports.REPLAY_CAPABILITIES = exports.AUCTION_CAPABILITIES = exports.LIVE_CAPABILITIES = exports.capabilitiesFor = exports.CART_CARD_MS = exports.REACTION_MS = exports.SOLD_CARD_MS = exports.isTheEndedGiveaway = exports.withOffAirSettled = exports.isNothingOnAir = exports.nextExpiryAt = exports.roundClosesAt = exports.deriveStatus = exports.initialSessionState = exports.sessionReducer = exports.givenAwayVariant = exports.isTheVariant = exports.classifyComment = exports.openingBidFor = exports.GOOD_CHANCE_OVER = exports.VERY_HIGH_CHANCE_OVER = exports.QUICK_BID_STEPS = exports.BID_ON_ITS_WAY_MS = exports.isYourWin = exports.lotStateFor = exports.winChance = exports.quickBids = exports.bidRefusal = exports.showLinkDestination = exports.withLotFieldsFromRecord = exports.featuredFirst = exports.canPlayInCard = exports.liveShowFor = exports.sameRoomName = exports.viewerNameFor = exports.firstNameOf = exports.publicName = exports.withoutHiddenShows = exports.seesHiddenShows = exports.isHiddenShow = exports.isHiddenFrom = exports.prizeLinePrice = exports.isGiveawayPrizeLine = exports.GIVEAWAY_PRIZE_KEYS = exports.createShopifyLiveIdentity = exports.WIN_INDEX_KEY = exports.WINNING_BID_KEY = exports.AUCTION_CART_SOURCE_TYPE = exports.chargedVariantId = exports.liveProductFromShopify = void 0;
35
+ exports.ONGOING_LIVE_POLL_LIVE_MS = exports.ONGOING_LIVE_POLL_IDLE_MS = exports.createOngoingLiveStore = exports.COMMENT_SOURCES = exports.isLivePipSupported = exports.livePip = exports.IDLE_GIVEAWAY = exports.IDLE_AUCTION = void 0;
34
36
  // The imperative client (default + named).
35
37
  var liveSelling_1 = require("./liveSelling");
36
38
  Object.defineProperty(exports, "liveSelling", { enumerable: true, get: function () { return liveSelling_1.liveSelling; } });
37
39
  Object.defineProperty(exports, "default", { enumerable: true, get: function () { return liveSelling_1.liveSelling; } });
40
+ // Taps on the phone at a show's big moments (0.9.1): the app passes expo-haptics as `haptics` to
41
+ // `configure`; the web build does nothing.
42
+ var liveHaptics_1 = require("./liveHaptics");
43
+ Object.defineProperty(exports, "liveHaptics", { enumerable: true, get: function () { return liveHaptics_1.liveHaptics; } });
44
+ var phoneTaps_1 = require("./phoneTaps");
45
+ Object.defineProperty(exports, "createLiveHaptics", { enumerable: true, get: function () { return phoneTaps_1.createLiveHaptics; } });
46
+ Object.defineProperty(exports, "LIVE_HAPTICS_TICK_GAP_MS", { enumerable: true, get: function () { return phoneTaps_1.LIVE_HAPTICS_TICK_GAP_MS; } });
38
47
  // The live engine, exported on its own for direct use without the client.
39
48
  var engine_1 = require("./engine");
40
49
  Object.defineProperty(exports, "liveEngine", { enumerable: true, get: function () { return engine_1.engine; } });
41
50
  // Transport primitives, for a host that wants to call an un-wrapped endpoint or match the error shape.
42
51
  var client_1 = require("./client");
43
52
  Object.defineProperty(exports, "LiveSellingError", { enumerable: true, get: function () { return client_1.LiveSellingError; } });
53
+ Object.defineProperty(exports, "LiveSellingTimeoutError", { enumerable: true, get: function () { return client_1.LiveSellingTimeoutError; } });
54
+ Object.defineProperty(exports, "DEFAULT_REQUEST_TIMEOUT_MS", { enumerable: true, get: function () { return client_1.DEFAULT_REQUEST_TIMEOUT_MS; } });
55
+ Object.defineProperty(exports, "DEFAULT_OFF_AIR_GRACE_MS", { enumerable: true, get: function () { return client_1.DEFAULT_OFF_AIR_GRACE_MS; } });
44
56
  Object.defineProperty(exports, "toProductGid", { enumerable: true, get: function () { return client_1.toProductGid; } });
57
+ var zegoEngine_1 = require("./zegoEngine");
58
+ Object.defineProperty(exports, "ZegoLoginError", { enumerable: true, get: function () { return zegoEngine_1.ZegoLoginError; } });
59
+ Object.defineProperty(exports, "JOIN_ATTEMPTS", { enumerable: true, get: function () { return zegoEngine_1.JOIN_ATTEMPTS; } });
60
+ Object.defineProperty(exports, "JOIN_RETRY_BASE_MS", { enumerable: true, get: function () { return zegoEngine_1.JOIN_RETRY_BASE_MS; } });
45
61
  // Pure mappers and helpers, usable without configuring the client — handy for replay reducers and tests.
46
62
  var streams_1 = require("./streams");
47
63
  Object.defineProperty(exports, "toLiveStream", { enumerable: true, get: function () { return streams_1.toLiveStream; } });
@@ -53,6 +69,21 @@ var polls_1 = require("./polls");
53
69
  Object.defineProperty(exports, "toLivePoll", { enumerable: true, get: function () { return polls_1.toLivePoll; } });
54
70
  Object.defineProperty(exports, "toLivePollResults", { enumerable: true, get: function () { return polls_1.toLivePollResults; } });
55
71
  Object.defineProperty(exports, "toEmbeddedResults", { enumerable: true, get: function () { return polls_1.toEmbeddedResults; } });
72
+ var wire_1 = require("./wire");
73
+ Object.defineProperty(exports, "imageUrl", { enumerable: true, get: function () { return wire_1.imageUrl; } });
74
+ Object.defineProperty(exports, "toPinnedComment", { enumerable: true, get: function () { return wire_1.toPinnedComment; } });
75
+ var commentHistory_1 = require("./commentHistory");
76
+ Object.defineProperty(exports, "toCommentHistory", { enumerable: true, get: function () { return commentHistory_1.toCommentHistory; } });
77
+ Object.defineProperty(exports, "mergeCommentHistory", { enumerable: true, get: function () { return commentHistory_1.mergeCommentHistory; } });
78
+ Object.defineProperty(exports, "COMMENT_HISTORY_WINDOW", { enumerable: true, get: function () { return commentHistory_1.COMMENT_HISTORY_WINDOW; } });
79
+ Object.defineProperty(exports, "HOST_SELF_NAME", { enumerable: true, get: function () { return commentHistory_1.HOST_SELF_NAME; } });
80
+ var giveawayRoster_1 = require("./giveawayRoster");
81
+ Object.defineProperty(exports, "GIVEAWAY_ROSTER_RETRY_MS", { enumerable: true, get: function () { return giveawayRoster_1.GIVEAWAY_ROSTER_RETRY_MS; } });
82
+ Object.defineProperty(exports, "GIVEAWAY_ROSTER_WAIT_MS", { enumerable: true, get: function () { return giveawayRoster_1.GIVEAWAY_ROSTER_WAIT_MS; } });
83
+ Object.defineProperty(exports, "giveawayForLot", { enumerable: true, get: function () { return giveawayRoster_1.giveawayForLot; } });
84
+ Object.defineProperty(exports, "rosterFromRecord", { enumerable: true, get: function () { return giveawayRoster_1.rosterFromRecord; } });
85
+ Object.defineProperty(exports, "winnerIdFromRecord", { enumerable: true, get: function () { return giveawayRoster_1.winnerIdFromRecord; } });
86
+ Object.defineProperty(exports, "isYourGiveawayWin", { enumerable: true, get: function () { return giveawayRoster_1.isYourGiveawayWin; } });
56
87
  var guest_1 = require("./guest");
57
88
  Object.defineProperty(exports, "toMixerLayout", { enumerable: true, get: function () { return guest_1.toMixerLayout; } });
58
89
  var flags_1 = require("./flags");
@@ -74,15 +105,74 @@ Object.defineProperty(exports, "hasCommentLink", { enumerable: true, get: functi
74
105
  Object.defineProperty(exports, "classifyCommentLink", { enumerable: true, get: function () { return commentLinks_1.classifyCommentLink; } });
75
106
  Object.defineProperty(exports, "toUrlPreview", { enumerable: true, get: function () { return commentLinks_1.toUrlPreview; } });
76
107
  Object.defineProperty(exports, "displayHost", { enumerable: true, get: function () { return commentLinks_1.displayHost; } });
108
+ // A store on @tiledev/sdk-shopify (0.9.0, "SDK move 4"): the commerce adapter, the identity, and the
109
+ // cart's giveaway-prize helpers. Plain functions on the app's own client and customer: nothing of
110
+ // sdk-shopify is loaded here.
111
+ var shopifyCommerce_1 = require("./shopifyCommerce");
112
+ Object.defineProperty(exports, "createShopifyLiveCommerce", { enumerable: true, get: function () { return shopifyCommerce_1.createShopifyLiveCommerce; } });
113
+ Object.defineProperty(exports, "liveProductFromShopify", { enumerable: true, get: function () { return shopifyCommerce_1.liveProductFromShopify; } });
114
+ Object.defineProperty(exports, "chargedVariantId", { enumerable: true, get: function () { return shopifyCommerce_1.chargedVariantId; } });
115
+ Object.defineProperty(exports, "AUCTION_CART_SOURCE_TYPE", { enumerable: true, get: function () { return shopifyCommerce_1.AUCTION_CART_SOURCE_TYPE; } });
116
+ Object.defineProperty(exports, "WINNING_BID_KEY", { enumerable: true, get: function () { return shopifyCommerce_1.WINNING_BID_KEY; } });
117
+ Object.defineProperty(exports, "WIN_INDEX_KEY", { enumerable: true, get: function () { return shopifyCommerce_1.WIN_INDEX_KEY; } });
118
+ var shopifyIdentity_1 = require("./shopifyIdentity");
119
+ Object.defineProperty(exports, "createShopifyLiveIdentity", { enumerable: true, get: function () { return shopifyIdentity_1.createShopifyLiveIdentity; } });
120
+ var giveawayPrizeLines_1 = require("./giveawayPrizeLines");
121
+ Object.defineProperty(exports, "GIVEAWAY_PRIZE_KEYS", { enumerable: true, get: function () { return giveawayPrizeLines_1.GIVEAWAY_PRIZE_KEYS; } });
122
+ Object.defineProperty(exports, "isGiveawayPrizeLine", { enumerable: true, get: function () { return giveawayPrizeLines_1.isGiveawayPrizeLine; } });
123
+ Object.defineProperty(exports, "prizeLinePrice", { enumerable: true, get: function () { return giveawayPrizeLines_1.prizeLinePrice; } });
124
+ // The live show helpers (0.9.0, "SDK move 5"): rules every live app kept its own copy of. Pure, so an
125
+ // app's own tests can load them from `dist` (`hiddenShows`, `showNames`, `liveShow`, `showLots`,
126
+ // `showLinks`) without the native engine.
127
+ var hiddenShows_1 = require("./hiddenShows");
128
+ Object.defineProperty(exports, "isHiddenFrom", { enumerable: true, get: function () { return hiddenShows_1.isHiddenFrom; } });
129
+ Object.defineProperty(exports, "isHiddenShow", { enumerable: true, get: function () { return hiddenShows_1.isHiddenShow; } });
130
+ Object.defineProperty(exports, "seesHiddenShows", { enumerable: true, get: function () { return hiddenShows_1.seesHiddenShows; } });
131
+ Object.defineProperty(exports, "withoutHiddenShows", { enumerable: true, get: function () { return hiddenShows_1.withoutHiddenShows; } });
132
+ var showNames_1 = require("./showNames");
133
+ Object.defineProperty(exports, "publicName", { enumerable: true, get: function () { return showNames_1.publicName; } });
134
+ Object.defineProperty(exports, "firstNameOf", { enumerable: true, get: function () { return showNames_1.firstNameOf; } });
135
+ Object.defineProperty(exports, "viewerNameFor", { enumerable: true, get: function () { return showNames_1.viewerNameFor; } });
136
+ Object.defineProperty(exports, "sameRoomName", { enumerable: true, get: function () { return showNames_1.sameRoomName; } });
137
+ var liveShow_1 = require("./liveShow");
138
+ Object.defineProperty(exports, "liveShowFor", { enumerable: true, get: function () { return liveShow_1.liveShowFor; } });
139
+ Object.defineProperty(exports, "canPlayInCard", { enumerable: true, get: function () { return liveShow_1.canPlayInCard; } });
140
+ var showLots_1 = require("./showLots");
141
+ Object.defineProperty(exports, "featuredFirst", { enumerable: true, get: function () { return showLots_1.featuredFirst; } });
142
+ Object.defineProperty(exports, "withLotFieldsFromRecord", { enumerable: true, get: function () { return showLots_1.withLotFieldsFromRecord; } });
143
+ var showLinks_1 = require("./showLinks");
144
+ Object.defineProperty(exports, "showLinkDestination", { enumerable: true, get: function () { return showLinks_1.showLinkDestination; } });
145
+ // The bid and giveaway flows' rules (0.9.0, "SDK move 8"). Pure, so an app's own tests can load them
146
+ // from `dist` (`auctionRules`, `auctionComments`, `giveawayPrize`) without the native engine.
147
+ var auctionRules_1 = require("./auctionRules");
148
+ Object.defineProperty(exports, "bidRefusal", { enumerable: true, get: function () { return auctionRules_1.bidRefusal; } });
149
+ Object.defineProperty(exports, "quickBids", { enumerable: true, get: function () { return auctionRules_1.quickBids; } });
150
+ Object.defineProperty(exports, "winChance", { enumerable: true, get: function () { return auctionRules_1.winChance; } });
151
+ Object.defineProperty(exports, "lotStateFor", { enumerable: true, get: function () { return auctionRules_1.lotStateFor; } });
152
+ Object.defineProperty(exports, "isYourWin", { enumerable: true, get: function () { return auctionRules_1.isYourWin; } });
153
+ Object.defineProperty(exports, "BID_ON_ITS_WAY_MS", { enumerable: true, get: function () { return auctionRules_1.BID_ON_ITS_WAY_MS; } });
154
+ Object.defineProperty(exports, "QUICK_BID_STEPS", { enumerable: true, get: function () { return auctionRules_1.QUICK_BID_STEPS; } });
155
+ Object.defineProperty(exports, "VERY_HIGH_CHANCE_OVER", { enumerable: true, get: function () { return auctionRules_1.VERY_HIGH_CHANCE_OVER; } });
156
+ Object.defineProperty(exports, "GOOD_CHANCE_OVER", { enumerable: true, get: function () { return auctionRules_1.GOOD_CHANCE_OVER; } });
157
+ Object.defineProperty(exports, "openingBidFor", { enumerable: true, get: function () { return auctionRules_1.openingBidFor; } });
158
+ var auctionComments_1 = require("./auctionComments");
159
+ Object.defineProperty(exports, "classifyComment", { enumerable: true, get: function () { return auctionComments_1.classifyComment; } });
160
+ var giveawayPrize_1 = require("./giveawayPrize");
161
+ Object.defineProperty(exports, "isTheVariant", { enumerable: true, get: function () { return giveawayPrize_1.isTheVariant; } });
162
+ Object.defineProperty(exports, "givenAwayVariant", { enumerable: true, get: function () { return giveawayPrize_1.givenAwayVariant; } });
77
163
  // The session state machine — pure, and usable without React for tests or a custom host.
78
164
  var session_1 = require("./session");
79
165
  Object.defineProperty(exports, "sessionReducer", { enumerable: true, get: function () { return session_1.sessionReducer; } });
80
166
  Object.defineProperty(exports, "initialSessionState", { enumerable: true, get: function () { return session_1.initialSessionState; } });
81
167
  Object.defineProperty(exports, "deriveStatus", { enumerable: true, get: function () { return session_1.deriveStatus; } });
82
- Object.defineProperty(exports, "remainingMs", { enumerable: true, get: function () { return session_1.remainingMs; } });
83
- Object.defineProperty(exports, "timeLeftMs", { enumerable: true, get: function () { return session_1.timeLeftMs; } });
168
+ Object.defineProperty(exports, "roundClosesAt", { enumerable: true, get: function () { return session_1.roundClosesAt; } });
169
+ Object.defineProperty(exports, "nextExpiryAt", { enumerable: true, get: function () { return session_1.nextExpiryAt; } });
170
+ Object.defineProperty(exports, "isNothingOnAir", { enumerable: true, get: function () { return session_1.isNothingOnAir; } });
171
+ Object.defineProperty(exports, "withOffAirSettled", { enumerable: true, get: function () { return session_1.withOffAirSettled; } });
172
+ Object.defineProperty(exports, "isTheEndedGiveaway", { enumerable: true, get: function () { return session_1.isTheEndedGiveaway; } });
84
173
  Object.defineProperty(exports, "SOLD_CARD_MS", { enumerable: true, get: function () { return session_1.SOLD_CARD_MS; } });
85
174
  Object.defineProperty(exports, "REACTION_MS", { enumerable: true, get: function () { return session_1.REACTION_MS; } });
175
+ Object.defineProperty(exports, "CART_CARD_MS", { enumerable: true, get: function () { return session_1.CART_CARD_MS; } });
86
176
  var sessionTypes_1 = require("./sessionTypes");
87
177
  Object.defineProperty(exports, "capabilitiesFor", { enumerable: true, get: function () { return sessionTypes_1.capabilitiesFor; } });
88
178
  Object.defineProperty(exports, "LIVE_CAPABILITIES", { enumerable: true, get: function () { return sessionTypes_1.LIVE_CAPABILITIES; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;AAEH,2CAA2C;AAC3C,6CAAoE;AAA3D,0GAAA,WAAW,OAAA;AAAE,sGAAA,WAAW,OAAW;AAE5C,0EAA0E;AAC1E,mCAAgD;AAAvC,oGAAA,MAAM,OAAc;AAE7B,uGAAuG;AACvG,mCAA0D;AAAjD,0GAAA,gBAAgB,OAAA;AAAE,sGAAA,YAAY,OAAA;AAEvC,yGAAyG;AACzG,qCAMmB;AALjB,uGAAA,YAAY,OAAA;AACZ,wGAAA,aAAa,OAAA;AACb,8GAAA,mBAAmB,OAAA;AACnB,yGAAA,cAAc,OAAA;AACd,4GAAA,iBAAiB,OAAA;AAEnB,iCAA2E;AAAlE,mGAAA,UAAU,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AACzD,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,iCAAiD;AAAxC,+GAAA,sBAAsB,OAAA;AAC/B,mCAA2C;AAAlC,yGAAA,eAAe,OAAA;AACxB,mDAM0B;AALxB,0HAAA,wBAAwB,OAA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;AACT,yGAAA,SAAS,OAAA;AACT,2GAAA,WAAW,OAAA;AACX,yGAAA,SAAS,OAAA;AACT,iHAAA,iBAAiB,OAAA;AACjB,+GAAA,eAAe,OAAA;AACf,qHAAA,qBAAqB,OAAA;AACrB,gHAAA,gBAAgB,OAAA;AAGA,6GAAA,aAAa,OAAA;AAC/B,qDAAsE;AAA7D,kHAAA,eAAe,OAAA;AACxB,iDAAiE;AAAxD,6GAAA,YAAY,OAAA;AAAE,iHAAA,gBAAgB,OAAA;AAEvC,yFAAyF;AACzF,qCAYmB;AAXjB,yGAAA,cAAc,OAAA;AACd,8GAAA,mBAAmB,OAAA;AACnB,uGAAA,YAAY,OAAA;AACZ,wGAAA,aAAa,OAAA;AACb,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,4GAAA,iBAAiB,OAAA;AACjB,6GAAA,kBAAkB,OAAA;AAClB,uGAAA,YAAY,OAAA;AACZ,sGAAA,WAAW,OAAA;AACX,uGAAA,YAAY,OAAA;AAEd,+CAOwB;AANtB,+GAAA,eAAe,OAAA;AACf,iHAAA,iBAAiB,OAAA;AACjB,oHAAA,oBAAoB,OAAA;AACpB,mHAAA,mBAAmB,OAAA;AACnB,4GAAA,YAAY,OAAA;AACZ,6GAAA,aAAa,OAAA;AAGf,kFAAkF;AAClF;;;;;;GAMG;AACH,4FAAuF;AAA9E,0HAAA,OAAO,OAAA;AAAE,qIAAA,kBAAkB,OAAA;AAEpC,iCAAiC;AACjC,iCAA0C;AAAjC,wGAAA,eAAe,OAAA;AAIxB;;;;;;;;;;;;GAYG;AACH,6CAOuB;AANrB,qHAAA,sBAAsB,OAAA;AACtB,wHAAA,yBAAyB,OAAA;AACzB,wHAAA,yBAAyB,OAAA;AAK3B,gDAA8B"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Taps on the phone at a show's big moments (`phoneTaps.ts`). This is the web build (and Node's): it
3
+ * does nothing. Phones get `liveHaptics.native.ts`, which taps through the module the app passes as
4
+ * `haptics` to `configure`.
5
+ */
6
+ export declare const liveHaptics: import("./phoneTaps").LiveHaptics;
7
+ //# sourceMappingURL=liveHaptics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveHaptics.d.ts","sourceRoot":"","sources":["../src/liveHaptics.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,mCAAgC,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.liveHaptics = void 0;
4
+ const phoneTaps_1 = require("./phoneTaps");
5
+ /**
6
+ * Taps on the phone at a show's big moments (`phoneTaps.ts`). This is the web build (and Node's): it
7
+ * does nothing. Phones get `liveHaptics.native.ts`, which taps through the module the app passes as
8
+ * `haptics` to `configure`.
9
+ */
10
+ exports.liveHaptics = (0, phoneTaps_1.createLiveHaptics)(() => null);
11
+ //# sourceMappingURL=liveHaptics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveHaptics.js","sourceRoot":"","sources":["../src/liveHaptics.ts"],"names":[],"mappings":";;;AAAA,2CAAgD;AAEhD;;;;GAIG;AACU,QAAA,WAAW,GAAG,IAAA,6BAAiB,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Taps on the phone at a show's big moments (`phoneTaps.ts`), through the module the app passes as
3
+ * `haptics` to `configure` (expo-haptics). Nothing until then, or without one. The web gets
4
+ * `liveHaptics.ts`, which does nothing.
5
+ */
6
+ export declare const liveHaptics: import("./phoneTaps").LiveHaptics;
7
+ //# sourceMappingURL=liveHaptics.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveHaptics.native.d.ts","sourceRoot":"","sources":["../src/liveHaptics.native.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,WAAW,mCAAyE,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.liveHaptics = void 0;
4
+ const client_1 = require("./client");
5
+ const phoneTaps_1 = require("./phoneTaps");
6
+ /**
7
+ * Taps on the phone at a show's big moments (`phoneTaps.ts`), through the module the app passes as
8
+ * `haptics` to `configure` (expo-haptics). Nothing until then, or without one. The web gets
9
+ * `liveHaptics.ts`, which does nothing.
10
+ */
11
+ exports.liveHaptics = (0, phoneTaps_1.createLiveHaptics)(() => ((0, client_1.isConfigured)() ? (0, client_1.getConfig)().haptics : null));
12
+ //# sourceMappingURL=liveHaptics.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveHaptics.native.js","sourceRoot":"","sources":["../src/liveHaptics.native.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,2CAAgD;AAEhD;;;;GAIG;AACU,QAAA,WAAW,GAAG,IAAA,6BAAiB,EAAC,GAAG,EAAE,CAAC,CAAC,IAAA,qBAAY,GAAE,CAAC,CAAC,CAAC,IAAA,kBAAS,GAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ import type { LivePipMode, LiveSessionCapabilities, LiveSessionStatus } from './sessionTypes';
2
+ import type { LiveStream } from './types';
3
+ /** Where a show stands for its screen: the session's status, with `loading` read as joining. */
4
+ export type LiveShowStatus = Exclude<LiveSessionStatus, 'loading'>;
5
+ export interface LiveShow {
6
+ /**
7
+ * The session's record once it is this show's; null before then (the session may still hold the last
8
+ * show's), and for a show hidden from this viewer (`hiddenShows`), whose record the session never holds.
9
+ */
10
+ show: LiveStream | null;
11
+ /**
12
+ * `connecting` until the session holds this show's record (or while it is loading it), then the
13
+ * session's own status. `ended` at once when the session has settled on nothing at all.
14
+ */
15
+ status: LiveShowStatus;
16
+ /** Playing, or waiting for its host (camera off): what the room's controls show for. */
17
+ onAir: boolean;
18
+ /** The controls this show calls for (`capabilitiesFor(show)`): an auction can bid. */
19
+ capabilities: LiveSessionCapabilities;
20
+ }
21
+ /** What `liveShowFor` reads of the session. */
22
+ export interface SessionForShow {
23
+ stream: LiveStream | null;
24
+ status: LiveSessionStatus;
25
+ }
26
+ /**
27
+ * The show `streamingId` names, as the session holds it. With no id (an empty one included), whatever
28
+ * show the session holds.
29
+ */
30
+ export declare function liveShowFor(session: SessionForShow, streamingId: string | null | undefined): LiveShow;
31
+ /** What `canPlayInCard` reads of the session. */
32
+ export interface SessionForCard {
33
+ stream: {
34
+ streamingId: string;
35
+ } | null;
36
+ status: LiveSessionStatus;
37
+ pipMode: LivePipMode;
38
+ }
39
+ /**
40
+ * Whether a card showing a show on air (a muted preview, on a home rail or a list of shows) may take
41
+ * the room's picture now (`LiveVideoTarget`'s `active`). All of:
42
+ *
43
+ * - the session is in that show's room, and playing;
44
+ * - no bubble or system window has the picture (`pipMode` is `'none'`);
45
+ * - the card's screen is on show (`screenOnShow`: `useIsFocused()`), so of several cards only the
46
+ * focused screen's claims, and none while another screen is over them.
47
+ *
48
+ * Only one mounted target should claim the picture at a time; this is a card's share of that rule.
49
+ * A show hidden from this viewer never plays: the session never joins its room.
50
+ */
51
+ export declare function canPlayInCard({ session, show, screenOnShow, }: {
52
+ session: SessionForCard;
53
+ show: {
54
+ streamingId: string;
55
+ } | null | undefined;
56
+ screenOnShow: boolean;
57
+ }): boolean;
58
+ //# sourceMappingURL=liveShow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveShow.d.ts","sourceRoot":"","sources":["../src/liveShow.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,gGAAgG;AAChG,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;AAEnE,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB;;;OAGG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB,wFAAwF;IACxF,KAAK,EAAE,OAAO,CAAC;IACf,sFAAsF;IACtF,YAAY,EAAE,uBAAuB,CAAC;CACvC;AAED,+CAA+C;AAC/C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAarG;AAED,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACvC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,IAAI,EACJ,YAAY,GACb,EAAE;IACD,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,YAAY,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAGV"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.liveShowFor = liveShowFor;
4
+ exports.canPlayInCard = canPlayInCard;
5
+ /**
6
+ * The show a screen is about, read off the app's one session (0.9.0).
7
+ *
8
+ * The session is app-wide and follows one show at a time. A screen opened for a named show (a push,
9
+ * a link, a tap on a card) pins it with `holdStream(streamingId)`, and for a moment after that the
10
+ * session can still hold the LAST show's record: every screen of a show has to ask "is the session's
11
+ * record mine yet?" before it draws anything from it. amore-v2 asked it in four hooks and Freckled
12
+ * Poppy in its Live screen; `liveShowFor` is that question, answered once.
13
+ *
14
+ * Pure, so it loads in plain Node for tests and in an app's own test runner. `useLiveShow` is the hook.
15
+ */
16
+ const sessionTypes_1 = require("./sessionTypes");
17
+ /**
18
+ * The show `streamingId` names, as the session holds it. With no id (an empty one included), whatever
19
+ * show the session holds.
20
+ */
21
+ function liveShowFor(session, streamingId) {
22
+ const held = session.stream;
23
+ const show = held && (!streamingId || held.streamingId === streamingId) ? held : null;
24
+ let status;
25
+ // Not this show's record yet: joining, unless there is no record at all and the session has settled on "ended".
26
+ if (!show)
27
+ status = !held && session.status === 'ended' ? 'ended' : 'connecting';
28
+ else
29
+ status = session.status === 'loading' ? 'connecting' : session.status;
30
+ return {
31
+ show,
32
+ status,
33
+ onAir: status === 'playing' || status === 'waitingForHost',
34
+ capabilities: (0, sessionTypes_1.capabilitiesFor)(show),
35
+ };
36
+ }
37
+ /**
38
+ * Whether a card showing a show on air (a muted preview, on a home rail or a list of shows) may take
39
+ * the room's picture now (`LiveVideoTarget`'s `active`). All of:
40
+ *
41
+ * - the session is in that show's room, and playing;
42
+ * - no bubble or system window has the picture (`pipMode` is `'none'`);
43
+ * - the card's screen is on show (`screenOnShow`: `useIsFocused()`), so of several cards only the
44
+ * focused screen's claims, and none while another screen is over them.
45
+ *
46
+ * Only one mounted target should claim the picture at a time; this is a card's share of that rule.
47
+ * A show hidden from this viewer never plays: the session never joins its room.
48
+ */
49
+ function canPlayInCard({ session, show, screenOnShow, }) {
50
+ var _a;
51
+ if (!show || !screenOnShow)
52
+ return false;
53
+ return ((_a = session.stream) === null || _a === void 0 ? void 0 : _a.streamingId) === show.streamingId && session.pipMode === 'none' && session.status === 'playing';
54
+ }
55
+ //# sourceMappingURL=liveShow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveShow.js","sourceRoot":"","sources":["../src/liveShow.ts"],"names":[],"mappings":";;AA6CA,kCAaC;AAqBD,sCAWC;AA1FD;;;;;;;;;;GAUG;AACH,iDAAiD;AA8BjD;;;GAGG;AACH,SAAgB,WAAW,CAAC,OAAuB,EAAE,WAAsC;IACzF,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAC5B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACtF,IAAI,MAAsB,CAAC;IAC3B,gHAAgH;IAChH,IAAI,CAAC,IAAI;QAAE,MAAM,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;;QAC5E,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC3E,OAAO;QACL,IAAI;QACJ,MAAM;QACN,KAAK,EAAE,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,gBAAgB;QAC1D,YAAY,EAAE,IAAA,8BAAe,EAAC,IAAI,CAAC;KACpC,CAAC;AACJ,CAAC;AASD;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,IAAI,EACJ,YAAY,GAKb;;IACC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,CAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,WAAW,MAAK,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC;AACxH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { LiveHapticsModule } from './types';
2
+ /** Ticks come at most this often, however fast they're asked for (20 a second). */
3
+ export declare const LIVE_HAPTICS_TICK_GAP_MS = 50;
4
+ /** Taps on the phone at a show's big moments. Each does nothing where haptics aren't available. */
5
+ export interface LiveHaptics {
6
+ /** A light click, like a picker wheel's: one name rolling past in a giveaway draw. */
7
+ tick(): void;
8
+ /** One firm knock: a moment to look up for (a bidding war starting). */
9
+ knock(): void;
10
+ /** The shopper won: the giveaway's draw landed on them, or an auction round closed on their bid. */
11
+ success(): void;
12
+ }
13
+ /**
14
+ * The taps over a haptics module (decided 2026-10-06, Head of Engineering: "Draw + auction moments",
15
+ * after Sparkl's roller on the giveaway draw). The module is read at each tap (`module()`), so a
16
+ * `configure` after the first render still counts.
17
+ *
18
+ * - **Ticks are capped** at one every `LIVE_HAPTICS_TICK_GAP_MS`: a long roster rolls past faster than
19
+ * a finger can feel, and old Amore's draw buzzed about 13 times a second on Android, one long rattle.
20
+ * - **Never in the way:** no module, nothing; a tap that fails (a build made before the module was
21
+ * added: expo-haptics rejects "not available") is dropped. A tap is never worth an error.
22
+ * - The phone's own settings still apply (iOS's System Haptics switch turns them all off).
23
+ */
24
+ export declare function createLiveHaptics(module: () => LiveHapticsModule | null | undefined, now?: () => number): LiveHaptics;
25
+ //# sourceMappingURL=phoneTaps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phoneTaps.d.ts","sourceRoot":"","sources":["../src/phoneTaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,mGAAmG;AACnG,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,IAAI,IAAI,IAAI,CAAC;IACb,wEAAwE;IACxE,KAAK,IAAI,IAAI,CAAC;IACd,oGAAoG;IACpG,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,iBAAiB,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,GAAE,MAAM,MAAiB,GAAG,WAAW,CAyB/H"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LIVE_HAPTICS_TICK_GAP_MS = void 0;
4
+ exports.createLiveHaptics = createLiveHaptics;
5
+ /** Ticks come at most this often, however fast they're asked for (20 a second). */
6
+ exports.LIVE_HAPTICS_TICK_GAP_MS = 50;
7
+ /**
8
+ * The taps over a haptics module (decided 2026-10-06, Head of Engineering: "Draw + auction moments",
9
+ * after Sparkl's roller on the giveaway draw). The module is read at each tap (`module()`), so a
10
+ * `configure` after the first render still counts.
11
+ *
12
+ * - **Ticks are capped** at one every `LIVE_HAPTICS_TICK_GAP_MS`: a long roster rolls past faster than
13
+ * a finger can feel, and old Amore's draw buzzed about 13 times a second on Android, one long rattle.
14
+ * - **Never in the way:** no module, nothing; a tap that fails (a build made before the module was
15
+ * added: expo-haptics rejects "not available") is dropped. A tap is never worth an error.
16
+ * - The phone's own settings still apply (iOS's System Haptics switch turns them all off).
17
+ */
18
+ function createLiveHaptics(module, now = Date.now) {
19
+ let lastTickAt = Number.NEGATIVE_INFINITY;
20
+ const quietly = (tap) => {
21
+ try {
22
+ const haptics = module();
23
+ if (!haptics)
24
+ return;
25
+ void tap(haptics).catch(() => undefined);
26
+ }
27
+ catch {
28
+ // A synchronous failure is dropped too.
29
+ }
30
+ };
31
+ return {
32
+ tick() {
33
+ const at = now();
34
+ if (at - lastTickAt < exports.LIVE_HAPTICS_TICK_GAP_MS)
35
+ return;
36
+ lastTickAt = at;
37
+ quietly((haptics) => haptics.selectionAsync());
38
+ },
39
+ knock() {
40
+ quietly((haptics) => haptics.impactAsync(haptics.ImpactFeedbackStyle.Heavy));
41
+ },
42
+ success() {
43
+ quietly((haptics) => haptics.notificationAsync(haptics.NotificationFeedbackType.Success));
44
+ },
45
+ };
46
+ }
47
+ //# sourceMappingURL=phoneTaps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phoneTaps.js","sourceRoot":"","sources":["../src/phoneTaps.ts"],"names":[],"mappings":";;;AA0BA,8CAyBC;AAjDD,mFAAmF;AACtE,QAAA,wBAAwB,GAAG,EAAE,CAAC;AAY3C;;;;;;;;;;GAUG;AACH,SAAgB,iBAAiB,CAAC,MAAkD,EAAE,MAAoB,IAAI,CAAC,GAAG;IAChH,IAAI,UAAU,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC1C,MAAM,OAAO,GAAG,CAAC,GAAkD,EAAE,EAAE;QACrE,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC;YACzB,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC3C,CAAC;QAAC,MAAM,CAAC;YACP,wCAAwC;QAC1C,CAAC;IACH,CAAC,CAAC;IACF,OAAO;QACL,IAAI;YACF,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC;YACjB,IAAI,EAAE,GAAG,UAAU,GAAG,gCAAwB;gBAAE,OAAO;YACvD,UAAU,GAAG,EAAE,CAAC;YAChB,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;QACjD,CAAC;QACD,KAAK;YACH,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO;YACL,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5F,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Two questions the session asks about the system picture-in-picture window, kept pure so they are
3
+ * tested without a device.
4
+ */
5
+ import type { LivePipMode } from './sessionTypes';
6
+ /**
7
+ * How long after the session disarms that a window opening is still counted as the one it armed.
8
+ * The same beat the session gives the OS to grant a window (`PIP_GRANT_MS`).
9
+ */
10
+ export declare const PIP_DISARM_GRACE_MS = 1200;
11
+ export interface PipWindowContext {
12
+ /** `Platform.OS`. */
13
+ platform: string;
14
+ pipMode: LivePipMode;
15
+ /** A mounted `LiveVideoTarget` with `autoPip` holds the handover. */
16
+ handoverWanted: boolean;
17
+ /** What the session last told `livePip.setArmed`. */
18
+ armed: boolean;
19
+ /** When the session last went from armed to disarmed (epoch ms), or 0 if it never has. */
20
+ disarmedAt: number;
21
+ now: number;
22
+ }
23
+ /**
24
+ * Whether a system window that just opened (`onPipStart`) is this live session's.
25
+ *
26
+ * On iOS the window is fed by the session's own frame pipeline, so it is ours exactly when a surface
27
+ * is up for it — the in-app bubble, or a player holding the handover.
28
+ *
29
+ * On **Android** the window IS the activity, and the OS opens it by itself off the arm the session
30
+ * set. By the time `onPipStart` reaches JavaScript the player has often already let go of the
31
+ * handover (navigation or focus moved in the same instant), so the old test — bubble or handover —
32
+ * said "not ours", `pipMode` never became `system`, and then the window's close button did not stop
33
+ * playback and its expand button did not open the player (Freckled Poppy, Android 16). The arm state
34
+ * decides instead: armed now, or disarmed within `PIP_DISARM_GRACE_MS`. Anything else minimising into
35
+ * a window — a replay's own player — was never armed by this session and stays not ours.
36
+ */
37
+ export declare function ownsSystemPipWindow(context: PipWindowContext): boolean;
38
+ /** Where the picture can be when no system window holds it: the in-app bubble, or a full-screen player. */
39
+ export type PlaceBeforeTheWindow = Exclude<LivePipMode, 'system'>;
40
+ /**
41
+ * Where the system window that just opened took the picture from, so coming back puts it there again:
42
+ * the in-app bubble (`'inapp'`) if it was up, otherwise a full-screen player (`'none'`).
43
+ *
44
+ * `rememberedBefore` is kept when the session already counts the window as up (`'system'`): a second
45
+ * start for one window must not forget where the first one came from.
46
+ */
47
+ export declare function whereTheWindowCameFrom(pipModeAsItOpened: LivePipMode, rememberedBefore: PlaceBeforeTheWindow): PlaceBeforeTheWindow;
48
+ export interface ArmContext {
49
+ pipMode: LivePipMode;
50
+ /** A mounted `LiveVideoTarget` with `autoPip` holds the handover (the full-screen player). */
51
+ handoverWanted: boolean;
52
+ /** The session's status: a window is offered only for a picture that is playing. */
53
+ status: string;
54
+ }
55
+ /**
56
+ * Whether the OS may open its window when the app is put away.
57
+ *
58
+ * Only while there is a picture to hand over: the in-app bubble or a full-screen player holding the
59
+ * show, and the show `playing`. Joining, waiting for the host (camera off) and ended have no picture,
60
+ * and a window of them is an empty black box; the app is simply put away, and the session stops
61
+ * playback after `PIP_GRANT_MS` as it does whenever no window comes. Once the window is up it stays
62
+ * armed whatever the status does: disarming tears the window down on iOS, and a host stepping off
63
+ * camera for a moment is no reason to close it (the session leaves `system` itself when the show ends).
64
+ */
65
+ export declare function shouldArmSystemWindow(context: ArmContext): boolean;
66
+ /**
67
+ * Whether the app came back to the foreground with this session's window still up.
68
+ *
69
+ * iOS only. Expanding the window raises `onPipRestore`; whether coming back by the app's own icon (or a
70
+ * notification) does the same is iOS's choice, not ours. When it does not, the window would float over
71
+ * the app with the show in it while the app's own surface stood aside, so the session takes the window
72
+ * down itself and gives the picture back. If the restore and the return both arrive, whichever comes
73
+ * second finds the window already handed back and does nothing. Never on Android: there the window IS the app, and
74
+ * `AppState` reads `active` for as long as the window is up (`LivePipModule.keepRenderingWhileInPip`).
75
+ */
76
+ export declare function isWindowStillUpOnReturn(platform: string, pipMode: LivePipMode): boolean;
77
+ /**
78
+ * Whether an `onPipError` says the device has no picture-in-picture at all (L21).
79
+ *
80
+ * The native module answers every arming on such an Android device with this error, so a session that
81
+ * reported it at `error` level filed a crash report each time the bubble opened. It is a fact about
82
+ * the device, said once, and the session stops arming after it.
83
+ */
84
+ export declare function isPipUnavailableMessage(message: unknown): boolean;
85
+ //# sourceMappingURL=pipWindow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipWindow.d.ts","sourceRoot":"","sources":["../src/pipWindow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,W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