@tiledev/sdk-apptile-live-selling 0.13.0 → 0.14.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 (111) hide show
  1. package/README.md +94 -12
  2. package/dist/giveawayPrizeLines.d.ts +10 -0
  3. package/dist/giveawayPrizeLines.d.ts.map +1 -1
  4. package/dist/giveawayPrizeLines.js +11 -1
  5. package/dist/giveawayPrizeLines.js.map +1 -1
  6. package/dist/hiddenShows.d.ts +10 -0
  7. package/dist/hiddenShows.d.ts.map +1 -1
  8. package/dist/hiddenShows.js +11 -0
  9. package/dist/hiddenShows.js.map +1 -1
  10. package/dist/index.d.ts +7 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +32 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/livePages.d.ts +79 -0
  15. package/dist/livePages.d.ts.map +1 -0
  16. package/dist/livePages.js +90 -0
  17. package/dist/livePages.js.map +1 -0
  18. package/dist/liveRoom.d.ts +21 -0
  19. package/dist/liveRoom.d.ts.map +1 -0
  20. package/dist/liveRoom.js +28 -0
  21. package/dist/liveRoom.js.map +1 -0
  22. package/dist/pageOptions.d.ts +100 -0
  23. package/dist/pageOptions.d.ts.map +1 -0
  24. package/dist/pageOptions.js +82 -0
  25. package/dist/pageOptions.js.map +1 -0
  26. package/dist/pageTypes.d.ts +127 -0
  27. package/dist/pageTypes.d.ts.map +1 -0
  28. package/dist/pageTypes.js +3 -0
  29. package/dist/pageTypes.js.map +1 -0
  30. package/dist/react/LiveSellingProvider.d.ts +23 -1
  31. package/dist/react/LiveSellingProvider.d.ts.map +1 -1
  32. package/dist/react/LiveSellingProvider.js +26 -2
  33. package/dist/react/LiveSellingProvider.js.map +1 -1
  34. package/dist/react/index.d.ts +10 -0
  35. package/dist/react/index.d.ts.map +1 -1
  36. package/dist/react/index.js +29 -1
  37. package/dist/react/index.js.map +1 -1
  38. package/dist/react/index.web.d.ts +11 -32
  39. package/dist/react/index.web.d.ts.map +1 -1
  40. package/dist/react/index.web.js +46 -139
  41. package/dist/react/index.web.js.map +1 -1
  42. package/dist/react/navigation.d.ts +13 -0
  43. package/dist/react/navigation.d.ts.map +1 -0
  44. package/dist/react/navigation.js +7 -0
  45. package/dist/react/navigation.js.map +1 -0
  46. package/dist/react/platformSession.d.ts +16 -0
  47. package/dist/react/platformSession.d.ts.map +1 -0
  48. package/dist/react/platformSession.js +28 -0
  49. package/dist/react/platformSession.js.map +1 -0
  50. package/dist/react/platformSession.web.d.ts +35 -0
  51. package/dist/react/platformSession.web.d.ts.map +1 -0
  52. package/dist/react/platformSession.web.js +148 -0
  53. package/dist/react/platformSession.web.js.map +1 -0
  54. package/dist/react/replayPlayer.d.ts +74 -0
  55. package/dist/react/replayPlayer.d.ts.map +1 -0
  56. package/dist/react/replayPlayer.js +279 -0
  57. package/dist/react/replayPlayer.js.map +1 -0
  58. package/dist/react/shopifyProviders.d.ts +68 -0
  59. package/dist/react/shopifyProviders.d.ts.map +1 -0
  60. package/dist/react/shopifyProviders.js +98 -0
  61. package/dist/react/shopifyProviders.js.map +1 -0
  62. package/dist/react/useKeepScreenAwake.d.ts +2 -0
  63. package/dist/react/useKeepScreenAwake.d.ts.map +1 -0
  64. package/dist/react/useKeepScreenAwake.js +34 -0
  65. package/dist/react/useKeepScreenAwake.js.map +1 -0
  66. package/dist/react/useLiveAuction.d.ts +104 -0
  67. package/dist/react/useLiveAuction.d.ts.map +1 -0
  68. package/dist/react/useLiveAuction.js +244 -0
  69. package/dist/react/useLiveAuction.js.map +1 -0
  70. package/dist/react/useLiveChat.d.ts +75 -0
  71. package/dist/react/useLiveChat.d.ts.map +1 -0
  72. package/dist/react/useLiveChat.js +131 -0
  73. package/dist/react/useLiveChat.js.map +1 -0
  74. package/dist/react/useLiveGiveawaysAndPolls.d.ts +84 -0
  75. package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +1 -0
  76. package/dist/react/useLiveGiveawaysAndPolls.js +180 -0
  77. package/dist/react/useLiveGiveawaysAndPolls.js.map +1 -0
  78. package/dist/react/useLivePage.d.ts +113 -0
  79. package/dist/react/useLivePage.d.ts.map +1 -0
  80. package/dist/react/useLivePage.js +264 -0
  81. package/dist/react/useLivePage.js.map +1 -0
  82. package/dist/react/useLiveShop.d.ts +83 -0
  83. package/dist/react/useLiveShop.d.ts.map +1 -0
  84. package/dist/react/useLiveShop.js +165 -0
  85. package/dist/react/useLiveShop.js.map +1 -0
  86. package/dist/react/useReplayPage.d.ts +117 -0
  87. package/dist/react/useReplayPage.d.ts.map +1 -0
  88. package/dist/react/useReplayPage.js +504 -0
  89. package/dist/react/useReplayPage.js.map +1 -0
  90. package/dist/showCredit.d.ts +87 -0
  91. package/dist/showCredit.d.ts.map +1 -0
  92. package/dist/showCredit.js +120 -0
  93. package/dist/showCredit.js.map +1 -0
  94. package/dist/ui/BubbleFrame.d.ts +38 -0
  95. package/dist/ui/BubbleFrame.d.ts.map +1 -0
  96. package/dist/ui/BubbleFrame.js +181 -0
  97. package/dist/ui/BubbleFrame.js.map +1 -0
  98. package/dist/ui/LiveBubble.d.ts +37 -0
  99. package/dist/ui/LiveBubble.d.ts.map +1 -0
  100. package/dist/ui/LiveBubble.js +101 -0
  101. package/dist/ui/LiveBubble.js.map +1 -0
  102. package/dist/ui/ReplayBubble.d.ts +23 -0
  103. package/dist/ui/ReplayBubble.d.ts.map +1 -0
  104. package/dist/ui/ReplayBubble.js +65 -0
  105. package/dist/ui/ReplayBubble.js.map +1 -0
  106. package/dist/ui.d.ts +27 -0
  107. package/dist/ui.d.ts.map +1 -0
  108. package/dist/ui.js +34 -0
  109. package/dist/ui.js.map +1 -0
  110. package/package.json +36 -5
  111. package/ui/package.json +6 -0
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiveBubble = LiveBubble;
4
+ /**
5
+ * The live show's floating bubble (0.14.0, moved from amore-v2's `src/core/overlays/liveBubble.tsx`:
6
+ * Freckled Poppy's `LivePipBubble`, in the frame the replay's bubble uses).
7
+ *
8
+ * `createElement` rather than JSX, like the rest of the package, so this stays a plain `.ts`.
9
+ */
10
+ const react_native_performant_image_1 = require("@tiledev/react-native-performant-image");
11
+ const react_1 = require("react");
12
+ const react_native_1 = require("react-native");
13
+ const LiveSellingProvider_1 = require("../react/LiveSellingProvider");
14
+ const platformSession_1 = require("../react/platformSession");
15
+ const useKeepScreenAwake_1 = require("../react/useKeepScreenAwake");
16
+ const BubbleFrame_1 = require("./BubbleFrame");
17
+ /** Screen-reader words, Freckled Poppy's. */
18
+ const WORDS = {
19
+ open: 'Back to the live show',
20
+ close: 'Close the live show',
21
+ };
22
+ /**
23
+ * The live show's floating bubble. An app overlay beside the navigator, not a tile, so it outlives the
24
+ * Live screen that shrank the show: mount it once over the whole app, inside `LiveSessionProvider`
25
+ * (`ShopifyLiveSessionProvider`) and `SafeAreaProvider`. Shown while the session's picture is in the
26
+ * app's bubble (`pipMode` `inapp`): the Live screen's back (while the show plays or waits for the
27
+ * host), picture-in-picture and cart buttons put it there.
28
+ *
29
+ * - **The show's own picture**: `LiveVideoTarget`, which claims the room's video while the bubble is
30
+ * up, at the shopper's own sound setting, over the show's poster.
31
+ * - **A tap** goes back to the Live screen already open, or a new one (`routes.openLive`, or `onOpen`),
32
+ * which ends the bubble as it arrives. **✕** stops the show and lets the session follow whatever is
33
+ * on air again. The show ending closes it (the session leaves `inapp` itself).
34
+ * - **The screen stays on** while it shows, under its own hold (`useKeepScreenAwake`'s tag).
35
+ * - **One shrunk show at a time**: the Live screen stops a replay's bubble as it opens, and the Replay
36
+ * screen this one.
37
+ * - **The phone's own floating window** (`pipMode` `system`). Putting the app away with the bubble up
38
+ * hands the show to it (the session arms it while the bubble shows a playing show), and coming back
39
+ * puts it in the bubble again.
40
+ * - **iOS** draws that window itself. When it came from the bubble, the bubble stays drawn behind it,
41
+ * its video view still bound, so coming back finds the same picture with no new binding and no
42
+ * black frame. When it came from the Live screen, nothing is drawn here.
43
+ * - **Android**'s window is the app, scaled down, so the picture fills it here, over the show's
44
+ * poster (Freckled Poppy's), whichever surface it came from.
45
+ * - **On the web** the session is idle, so nothing is ever drawn.
46
+ */
47
+ function LiveBubble({ onOpen, chipColor, openLabel = WORDS.open, closeLabel = WORDS.close } = {}) {
48
+ var _a;
49
+ const { pipMode, status, stream, actions } = (0, platformSession_1.useLiveSession)();
50
+ const { routes } = (0, LiveSellingProvider_1.useLivePageOptions)();
51
+ // Where the picture was before the phone's window took it: the bubble (`inapp`) or the Live screen
52
+ // (`none`). Kept from the last render outside the window, and updated during the render rather than in
53
+ // an effect: an effect would leave the window's first render with the wrong answer, and on iOS that
54
+ // render would take the bubble's video view down.
55
+ const [lastPlaceOutsideTheWindow, setLastPlaceOutsideTheWindow] = (0, react_1.useState)(pipMode);
56
+ if (pipMode !== 'system' && pipMode !== lastPlaceOutsideTheWindow)
57
+ setLastPlaceOutsideTheWindow(pipMode);
58
+ const windowCameFromTheBubble = pipMode === 'system' && lastPlaceOutsideTheWindow === 'inapp';
59
+ // Android's window is the app itself: the picture fills it.
60
+ const fillsAndroidWindow = pipMode === 'system' && react_native_1.Platform.OS === 'android';
61
+ // The session leaves `inapp` itself when the show ends; `status` covers the moment in between.
62
+ const showIsUp = status !== 'ended' && status !== 'error';
63
+ const bubbleShown = showIsUp && !fillsAndroidWindow && (pipMode === 'inapp' || windowCameFromTheBubble);
64
+ (0, useKeepScreenAwake_1.useKeepScreenAwake)(bubbleShown || fillsAndroidWindow, 'live-bubble');
65
+ const posterUrl = (_a = stream === null || stream === void 0 ? void 0 : stream.thumbnailUrl) !== null && _a !== void 0 ? _a : null;
66
+ if (fillsAndroidWindow) {
67
+ return (0, react_1.createElement)(react_native_1.View, { pointerEvents: 'none', style: styles.systemWindow },
68
+ // Under the picture, as in the bubble: a moment without frames shows the show, not black.
69
+ posterUrl ? (0, react_1.createElement)(react_native_performant_image_1.Image, { source: { uri: posterUrl }, style: react_native_1.StyleSheet.absoluteFill, resizeMode: 'cover', transition: 0 }) : null, (0, react_1.createElement)(platformSession_1.LiveVideoTarget, { active: true, style: styles.video }));
70
+ }
71
+ if (!bubbleShown)
72
+ return null;
73
+ const streamId = stream === null || stream === void 0 ? void 0 : stream.streamingId;
74
+ return (0, react_1.createElement)(BubbleFrame_1.BubbleFrame, {
75
+ posterUrl,
76
+ onOpen: () => {
77
+ if (!streamId)
78
+ return;
79
+ if (onOpen)
80
+ onOpen(streamId);
81
+ else
82
+ routes.openLive(streamId);
83
+ },
84
+ onClose: () => {
85
+ // Stopped outright, not handed back: without `stopVideo` the room plays on with no surface.
86
+ actions.exitPip({ stopVideo: true });
87
+ actions.releaseStream();
88
+ },
89
+ openLabel,
90
+ closeLabel,
91
+ chipColor,
92
+ // No `muted`: the shopper is still watching, so the bubble plays their own sound setting.
93
+ children: (0, react_1.createElement)(platformSession_1.LiveVideoTarget, { active: true, style: styles.video }),
94
+ });
95
+ }
96
+ const styles = react_native_1.StyleSheet.create({
97
+ video: { ...react_native_1.StyleSheet.absoluteFillObject },
98
+ /** Fills the app, which is the picture-in-picture window on Android. Black around a picture that doesn't fit. */
99
+ systemWindow: { ...react_native_1.StyleSheet.absoluteFillObject, backgroundColor: '#000000', zIndex: 200 },
100
+ });
101
+ //# sourceMappingURL=LiveBubble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveBubble.js","sourceRoot":"","sources":["../../src/ui/LiveBubble.ts"],"names":[],"mappings":";;AAyDA,gCAqDC;AA9GD;;;;;GAKG;AACH,0FAA+D;AAC/D,iCAAgD;AAChD,+CAA0D;AAE1D,sEAAkE;AAClE,8DAA2E;AAC3E,oEAAiE;AAEjE,+CAA4C;AAE5C,6CAA6C;AAC7C,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,qBAAqB;CAC7B,CAAC;AAYF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,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U,CAAC,kBAAkB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE;CAC5F,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface ReplayBubbleProps {
2
+ /** A tap on the bubble. Default: back to the recording's Replay screen (`LiveSellingProvider`'s `routes.openReplay`). */
3
+ onOpen?: (feedId: string) => void;
4
+ /** Behind the ✕ and the expand mark: the app's scrim colour. Default `BUBBLE_CHIP_COLOR`. */
5
+ chipColor?: string;
6
+ /** Screen-reader words for the tap and for ✕. Default "Back to the replay", "Close the replay". */
7
+ openLabel?: string;
8
+ closeLabel?: string;
9
+ }
10
+ /**
11
+ * The replay's floating bubble. An app overlay beside the navigator, not a tile: it belongs to no
12
+ * screen and stays over every one. Mount it once over the whole app, inside `ReplayPlayerProvider` and
13
+ * `SafeAreaProvider`. Shown while the recording is in the bubble (`useReplayPlayer().bubbleShown`): the
14
+ * Replay screen's picture-in-picture or cart button put it there. It plays the same player at the same
15
+ * moment, with the same sound setting.
16
+ *
17
+ * The frame (drag and snap, the poster, ✕ and the expand mark) is `BubbleFrame`, shared with the live
18
+ * show's bubble (`LiveBubble`). Here: **a tap** goes back to the recording's Replay screen
19
+ * (`routes.openReplay`, or `onOpen`: the one already in the stack, never a second over the first),
20
+ * which closes the bubble as it arrives; **✕** stops the video and closes the bubble.
21
+ */
22
+ export declare function ReplayBubble({ onOpen, chipColor, openLabel, closeLabel }?: ReplayBubbleProps): import("react").FunctionComponentElement<import("./BubbleFrame").BubbleFrameProps> | null;
23
+ //# sourceMappingURL=ReplayBubble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReplayBubble.d.ts","sourceRoot":"","sources":["../../src/ui/ReplayBubble.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,iBAAiB;IAChC,yHAAyH;IACzH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mGAAmG;IACnG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAsB,EAAE,UAAwB,EAAE,GAAE,iBAAsB,6FA4B3H"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplayBubble = ReplayBubble;
4
+ /**
5
+ * The replay's floating bubble (0.14.0, moved from amore-v2's `src/core/overlays/replayBubble.tsx`: the
6
+ * old app's `ReplayPipBubble`, rebuilt; decided 2026-10-05, amore-v2's Head of Engineering).
7
+ *
8
+ * `createElement` rather than JSX, like the rest of the package, so this stays a plain `.ts`.
9
+ */
10
+ const expo_video_1 = require("expo-video");
11
+ const react_1 = require("react");
12
+ const react_native_1 = require("react-native");
13
+ const LiveSellingProvider_1 = require("../react/LiveSellingProvider");
14
+ const replayPlayer_1 = require("../react/replayPlayer");
15
+ const BubbleFrame_1 = require("./BubbleFrame");
16
+ /** Screen-reader words, the old app's. */
17
+ const WORDS = {
18
+ open: 'Back to the replay',
19
+ close: 'Close the replay',
20
+ };
21
+ /**
22
+ * The replay's floating bubble. An app overlay beside the navigator, not a tile: it belongs to no
23
+ * screen and stays over every one. Mount it once over the whole app, inside `ReplayPlayerProvider` and
24
+ * `SafeAreaProvider`. Shown while the recording is in the bubble (`useReplayPlayer().bubbleShown`): the
25
+ * Replay screen's picture-in-picture or cart button put it there. It plays the same player at the same
26
+ * moment, with the same sound setting.
27
+ *
28
+ * The frame (drag and snap, the poster, ✕ and the expand mark) is `BubbleFrame`, shared with the live
29
+ * show's bubble (`LiveBubble`). Here: **a tap** goes back to the recording's Replay screen
30
+ * (`routes.openReplay`, or `onOpen`: the one already in the stack, never a second over the first),
31
+ * which closes the bubble as it arrives; **✕** stops the video and closes the bubble.
32
+ */
33
+ function ReplayBubble({ onOpen, chipColor, openLabel = WORDS.open, closeLabel = WORDS.close } = {}) {
34
+ const { recording, bubbleShown, player, stop, markVideoReady } = (0, replayPlayer_1.useReplayPlayer)();
35
+ const { routes } = (0, LiveSellingProvider_1.useLivePageOptions)();
36
+ if (!bubbleShown || !recording)
37
+ return null;
38
+ const recordingId = recording.id;
39
+ return (0, react_1.createElement)(BubbleFrame_1.BubbleFrame, {
40
+ posterUrl: recording.thumbnailUrl,
41
+ onOpen: () => {
42
+ if (onOpen)
43
+ onOpen(recordingId);
44
+ else
45
+ routes.openReplay(recordingId);
46
+ },
47
+ onClose: stop,
48
+ openLabel,
49
+ closeLabel,
50
+ chipColor,
51
+ children: (0, react_1.createElement)(expo_video_1.VideoView, {
52
+ player,
53
+ // A width and height, not just the edges: on web the video is an element that otherwise keeps its own size.
54
+ style: styles.video,
55
+ contentFit: 'cover',
56
+ nativeControls: false,
57
+ allowsPictureInPicture: false,
58
+ onFirstFrameRender: markVideoReady,
59
+ }),
60
+ });
61
+ }
62
+ const styles = react_native_1.StyleSheet.create({
63
+ video: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' },
64
+ });
65
+ //# sourceMappingURL=ReplayBubble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReplayBubble.js","sourceRoot":"","sources":["../../src/ui/ReplayBubble.ts"],"names":[],"mappings":";;AA0CA,oCA4BC;AAtED;;;;;GAKG;AACH,2CAAuC;AACvC,iCAAsC;AACtC,+CAA0C;AAE1C,sEAAkE;AAClE,wDAAwD;AACxD,+CAA4C;AAE5C,0CAA0C;AAC1C,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,kBAAkB;CAC1B,CAAC;AAYF;;;;;;;;;;;GAWG;AACH,SAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,KAAK,CAAC,KAAK,KAAwB,EAAE;IAC1H,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,IAAA,8BAAe,GAAE,CAAC;IACnF,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,wCAAkB,GAAE,CAAC;IACxC,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5C,MAAM,WAAW,GAAG,SAAS,CAAC,EAAE,CAAC;IACjC,OAAO,IAAA,qBAAa,EAClB,yBAAW,EACX;QACE,SAAS,EAAE,SAAS,CAAC,YAAY;QACjC,MAAM,EAAE,GAAG,EAAE;YACX,IAAI,MAAM;gBAAE,MAAM,CAAC,WAAW,CAAC,CAAC;;gBAC3B,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,EAAE,IAAI;QACb,SAAS;QACT,UAAU;QACV,SAAS;QACT,QAAQ,EAAE,IAAA,qBAAa,EAAC,sBAAS,EAAE;YACjC,MAAM;YACN,4GAA4G;YAC5G,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,UAAU,EAAE,OAAO;YACnB,cAAc,EAAE,KAAK;YACrB,sBAAsB,EAAE,KAAK;YAC7B,kBAAkB,EAAE,cAAc;SACnC,CAAC;KACH,CACF,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;CAChF,CAAC,CAAC"}
package/dist/ui.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `@tiledev/sdk-apptile-live-selling/ui` (0.14.0): the components this package draws, beside the
3
+ * headless root. Today the floating bubbles, moved from amore-v2's `src/core/overlays`: the live show's
4
+ * (`LiveBubble`), the replay's (`ReplayBubble`) and the frame they share (`BubbleFrame`).
5
+ *
6
+ * An entry of its own so the root loads none of what only these draw (`@expo/vector-icons`,
7
+ * `react-native-safe-area-context`, `@tiledev/react-native-performant-image`, optional peers): an app
8
+ * that doesn't draw a bubble needs none of them. Reachable without the `exports` map too (the package's
9
+ * `ui/` folder), for a resolver that ignores it.
10
+ *
11
+ * ```tsx
12
+ * import { LiveBubble, ReplayBubble } from '@tiledev/sdk-apptile-live-selling/ui';
13
+ *
14
+ * <ReplayPlayerProvider>
15
+ * <AppNavigator />
16
+ * <ReplayBubble chipColor={scrim} />
17
+ * <LiveBubble chipColor={scrim} />
18
+ * </ReplayPlayerProvider>
19
+ * ```
20
+ *
21
+ * A tap goes where `LiveSellingProvider`'s `routes` say (`openLive`, `openReplay`) unless the bubble
22
+ * is given its own `onOpen`.
23
+ */
24
+ export { BubbleFrame, BUBBLE_CHIP_COLOR, type BubbleFrameProps } from './ui/BubbleFrame';
25
+ export { LiveBubble, type LiveBubbleProps } from './ui/LiveBubble';
26
+ export { ReplayBubble, type ReplayBubbleProps } from './ui/ReplayBubble';
27
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/ui.js ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplayBubble = exports.LiveBubble = exports.BUBBLE_CHIP_COLOR = exports.BubbleFrame = void 0;
4
+ /**
5
+ * `@tiledev/sdk-apptile-live-selling/ui` (0.14.0): the components this package draws, beside the
6
+ * headless root. Today the floating bubbles, moved from amore-v2's `src/core/overlays`: the live show's
7
+ * (`LiveBubble`), the replay's (`ReplayBubble`) and the frame they share (`BubbleFrame`).
8
+ *
9
+ * An entry of its own so the root loads none of what only these draw (`@expo/vector-icons`,
10
+ * `react-native-safe-area-context`, `@tiledev/react-native-performant-image`, optional peers): an app
11
+ * that doesn't draw a bubble needs none of them. Reachable without the `exports` map too (the package's
12
+ * `ui/` folder), for a resolver that ignores it.
13
+ *
14
+ * ```tsx
15
+ * import { LiveBubble, ReplayBubble } from '@tiledev/sdk-apptile-live-selling/ui';
16
+ *
17
+ * <ReplayPlayerProvider>
18
+ * <AppNavigator />
19
+ * <ReplayBubble chipColor={scrim} />
20
+ * <LiveBubble chipColor={scrim} />
21
+ * </ReplayPlayerProvider>
22
+ * ```
23
+ *
24
+ * A tap goes where `LiveSellingProvider`'s `routes` say (`openLive`, `openReplay`) unless the bubble
25
+ * is given its own `onOpen`.
26
+ */
27
+ var BubbleFrame_1 = require("./ui/BubbleFrame");
28
+ Object.defineProperty(exports, "BubbleFrame", { enumerable: true, get: function () { return BubbleFrame_1.BubbleFrame; } });
29
+ Object.defineProperty(exports, "BUBBLE_CHIP_COLOR", { enumerable: true, get: function () { return BubbleFrame_1.BUBBLE_CHIP_COLOR; } });
30
+ var LiveBubble_1 = require("./ui/LiveBubble");
31
+ Object.defineProperty(exports, "LiveBubble", { enumerable: true, get: function () { return LiveBubble_1.LiveBubble; } });
32
+ var ReplayBubble_1 = require("./ui/ReplayBubble");
33
+ Object.defineProperty(exports, "ReplayBubble", { enumerable: true, get: function () { return ReplayBubble_1.ReplayBubble; } });
34
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,gDAAyF;AAAhF,0GAAA,WAAW,OAAA;AAAE,gHAAA,iBAAiB,OAAA;AACvC,8CAAmE;AAA1D,wGAAA,UAAU,OAAA;AACnB,kDAAyE;AAAhE,4GAAA,YAAY,OAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledev/sdk-apptile-live-selling",
3
- "version": "0.13.0",
4
- "description": "Live selling, auctions and giveaways for React Native — the Apptile live-selling gateway as a typed singleton, a Zego room engine behind a platform boundary, an assembled session state machine, and system picture-in-picture with its own config plugin. Commerce comes from an adapter.",
3
+ "version": "0.14.0",
4
+ "description": "Live selling, auctions and giveaways for React Native — the Apptile live-selling gateway as a typed singleton, a Zego room engine behind a platform boundary, an assembled session state machine, system picture-in-picture with its own config plugin, and the Live and Replay page models with their floating bubbles (`/ui`). Commerce comes from an adapter.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
7
7
  "sideEffects": false,
@@ -17,6 +17,10 @@
17
17
  "types": "./dist/types.d.ts",
18
18
  "default": "./dist/types.js"
19
19
  },
20
+ "./ui": {
21
+ "types": "./dist/ui.d.ts",
22
+ "default": "./dist/ui.js"
23
+ },
20
24
  "./package.json": "./package.json",
21
25
  "./*": {
22
26
  "types": "./dist/*.d.ts",
@@ -27,6 +31,7 @@
27
31
  "dist",
28
32
  "types",
29
33
  "session",
34
+ "ui",
30
35
  "README.md"
31
36
  ],
32
37
  "scripts": {
@@ -53,22 +58,48 @@
53
58
  "access": "public"
54
59
  },
55
60
  "peerDependencies": {
56
- "@tiledev/sdk-shopify": ">=0.10.0 <1",
61
+ "@expo/vector-icons": ">=15.0.0",
62
+ "@react-native-async-storage/async-storage": ">=2.0.0 <3",
63
+ "@react-navigation/native": ">=7.0.0 <8",
64
+ "@tiledev/react-native-performant-image": ">=0.3.0 <1",
65
+ "@tiledev/sdk-analytics-core": ">=0.3.2 <1",
66
+ "@tiledev/sdk-shopify": ">=0.21.0 <1",
67
+ "expo-keep-awake": ">=15.0.0",
68
+ "expo-video": ">=3.0.0",
57
69
  "react": ">=17",
58
70
  "react-native": ">=0.71",
71
+ "react-native-safe-area-context": ">=5.0.0",
59
72
  "zego-express-engine-reactnative": ">=3.0.0"
60
73
  },
61
74
  "peerDependenciesMeta": {
75
+ "@expo/vector-icons": {
76
+ "optional": true
77
+ },
78
+ "@tiledev/react-native-performant-image": {
79
+ "optional": true
80
+ },
81
+ "react-native-safe-area-context": {
82
+ "optional": true
83
+ },
62
84
  "zego-express-engine-reactnative": {
63
85
  "optional": true
64
86
  }
65
87
  },
66
88
  "devDependencies": {
67
- "typescript": "^5.0.0",
68
- "react": "^18.2.0",
89
+ "@expo/vector-icons": "^15.1.1",
90
+ "@react-native-async-storage/async-storage": "^2.2.0",
91
+ "@react-navigation/native": "^7.5.1",
92
+ "@tiledev/react-native-performant-image": "^0.3.0",
93
+ "@tiledev/sdk-analytics-core": "^0.3.3",
94
+ "@tiledev/sdk-shopify": "^0.21.0",
69
95
  "@types/react": "^18.2.0",
70
96
  "expo": "^54.0.0",
97
+ "expo-keep-awake": "~15.0.8",
98
+ "expo-video": "~3.0.16",
99
+ "react": "^18.2.0",
71
100
  "react-native": "^0.76.0",
101
+ "react-native-safe-area-context": "~5.6.0",
102
+ "typescript": "^5.0.0",
72
103
  "zego-express-engine-reactnative": "^3.22.0"
73
104
  },
74
105
  "dependencies": {
@@ -0,0 +1,6 @@
1
+ {
2
+ "main": "../dist/ui.js",
3
+ "module": "../dist/ui.js",
4
+ "types": "../dist/ui.d.ts",
5
+ "sideEffects": false
6
+ }