@tiledev/sdk-apptile-live-selling 0.12.1 → 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.
- package/README.md +116 -19
- package/dist/giveawayPrizeLines.d.ts +10 -0
- package/dist/giveawayPrizeLines.d.ts.map +1 -1
- package/dist/giveawayPrizeLines.js +11 -1
- package/dist/giveawayPrizeLines.js.map +1 -1
- package/dist/heldComments.d.ts +13 -2
- package/dist/heldComments.d.ts.map +1 -1
- package/dist/heldComments.js +16 -2
- package/dist/heldComments.js.map +1 -1
- package/dist/hiddenShows.d.ts +10 -0
- package/dist/hiddenShows.d.ts.map +1 -1
- package/dist/hiddenShows.js +11 -0
- package/dist/hiddenShows.js.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -2
- package/dist/index.js.map +1 -1
- package/dist/livePages.d.ts +79 -0
- package/dist/livePages.d.ts.map +1 -0
- package/dist/livePages.js +90 -0
- package/dist/livePages.js.map +1 -0
- package/dist/liveRoom.d.ts +21 -0
- package/dist/liveRoom.d.ts.map +1 -0
- package/dist/liveRoom.js +28 -0
- package/dist/liveRoom.js.map +1 -0
- package/dist/pageOptions.d.ts +100 -0
- package/dist/pageOptions.d.ts.map +1 -0
- package/dist/pageOptions.js +82 -0
- package/dist/pageOptions.js.map +1 -0
- package/dist/pageTypes.d.ts +127 -0
- package/dist/pageTypes.d.ts.map +1 -0
- package/dist/pageTypes.js +3 -0
- package/dist/pageTypes.js.map +1 -0
- package/dist/react/LiveSellingProvider.d.ts +23 -1
- package/dist/react/LiveSellingProvider.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.js +26 -2
- package/dist/react/LiveSellingProvider.js.map +1 -1
- package/dist/react/index.d.ts +10 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +29 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.web.d.ts +11 -32
- package/dist/react/index.web.d.ts.map +1 -1
- package/dist/react/index.web.js +46 -139
- package/dist/react/index.web.js.map +1 -1
- package/dist/react/navigation.d.ts +13 -0
- package/dist/react/navigation.d.ts.map +1 -0
- package/dist/react/navigation.js +7 -0
- package/dist/react/navigation.js.map +1 -0
- package/dist/react/platformSession.d.ts +16 -0
- package/dist/react/platformSession.d.ts.map +1 -0
- package/dist/react/platformSession.js +28 -0
- package/dist/react/platformSession.js.map +1 -0
- package/dist/react/platformSession.web.d.ts +35 -0
- package/dist/react/platformSession.web.d.ts.map +1 -0
- package/dist/react/platformSession.web.js +148 -0
- package/dist/react/platformSession.web.js.map +1 -0
- package/dist/react/replayPlayer.d.ts +74 -0
- package/dist/react/replayPlayer.d.ts.map +1 -0
- package/dist/react/replayPlayer.js +279 -0
- package/dist/react/replayPlayer.js.map +1 -0
- package/dist/react/shopifyProviders.d.ts +68 -0
- package/dist/react/shopifyProviders.d.ts.map +1 -0
- package/dist/react/shopifyProviders.js +98 -0
- package/dist/react/shopifyProviders.js.map +1 -0
- package/dist/react/showPages.d.ts +5 -1
- package/dist/react/showPages.d.ts.map +1 -1
- package/dist/react/showPages.js +14 -5
- package/dist/react/showPages.js.map +1 -1
- package/dist/react/useKeepScreenAwake.d.ts +2 -0
- package/dist/react/useKeepScreenAwake.d.ts.map +1 -0
- package/dist/react/useKeepScreenAwake.js +34 -0
- package/dist/react/useKeepScreenAwake.js.map +1 -0
- package/dist/react/useLiveAuction.d.ts +104 -0
- package/dist/react/useLiveAuction.d.ts.map +1 -0
- package/dist/react/useLiveAuction.js +244 -0
- package/dist/react/useLiveAuction.js.map +1 -0
- package/dist/react/useLiveChat.d.ts +75 -0
- package/dist/react/useLiveChat.d.ts.map +1 -0
- package/dist/react/useLiveChat.js +131 -0
- package/dist/react/useLiveChat.js.map +1 -0
- package/dist/react/useLiveGiveawaysAndPolls.d.ts +84 -0
- package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +1 -0
- package/dist/react/useLiveGiveawaysAndPolls.js +180 -0
- package/dist/react/useLiveGiveawaysAndPolls.js.map +1 -0
- package/dist/react/useLivePage.d.ts +113 -0
- package/dist/react/useLivePage.d.ts.map +1 -0
- package/dist/react/useLivePage.js +264 -0
- package/dist/react/useLivePage.js.map +1 -0
- package/dist/react/useLiveSession.d.ts +8 -0
- package/dist/react/useLiveSession.d.ts.map +1 -1
- package/dist/react/useLiveSession.js +43 -27
- package/dist/react/useLiveSession.js.map +1 -1
- package/dist/react/useLiveShop.d.ts +83 -0
- package/dist/react/useLiveShop.d.ts.map +1 -0
- package/dist/react/useLiveShop.js +165 -0
- package/dist/react/useLiveShop.js.map +1 -0
- package/dist/react/useReplayPage.d.ts +117 -0
- package/dist/react/useReplayPage.d.ts.map +1 -0
- package/dist/react/useReplayPage.js +504 -0
- package/dist/react/useReplayPage.js.map +1 -0
- package/dist/sessionTypes.d.ts +17 -9
- package/dist/sessionTypes.d.ts.map +1 -1
- package/dist/sessionTypes.js.map +1 -1
- package/dist/shopifyIdentity.d.ts +7 -4
- package/dist/shopifyIdentity.d.ts.map +1 -1
- package/dist/shopifyIdentity.js +11 -5
- package/dist/shopifyIdentity.js.map +1 -1
- package/dist/showCredit.d.ts +87 -0
- package/dist/showCredit.d.ts.map +1 -0
- package/dist/showCredit.js +120 -0
- package/dist/showCredit.js.map +1 -0
- package/dist/showNames.d.ts +24 -3
- package/dist/showNames.d.ts.map +1 -1
- package/dist/showNames.js +57 -10
- package/dist/showNames.js.map +1 -1
- package/dist/showPages.d.ts +12 -0
- package/dist/showPages.d.ts.map +1 -1
- package/dist/showPages.js +10 -0
- package/dist/showPages.js.map +1 -1
- package/dist/ui/BubbleFrame.d.ts +38 -0
- package/dist/ui/BubbleFrame.d.ts.map +1 -0
- package/dist/ui/BubbleFrame.js +181 -0
- package/dist/ui/BubbleFrame.js.map +1 -0
- package/dist/ui/LiveBubble.d.ts +37 -0
- package/dist/ui/LiveBubble.d.ts.map +1 -0
- package/dist/ui/LiveBubble.js +101 -0
- package/dist/ui/LiveBubble.js.map +1 -0
- package/dist/ui/ReplayBubble.d.ts +23 -0
- package/dist/ui/ReplayBubble.d.ts.map +1 -0
- package/dist/ui/ReplayBubble.js +65 -0
- package/dist/ui/ReplayBubble.js.map +1 -0
- package/dist/ui.d.ts +27 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +34 -0
- package/dist/ui.js.map +1 -0
- package/package.json +36 -5
- package/ui/package.json +6 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* The ✕ and expand chips' backing when the app passes none: a dark wash. amore-v2 drew its theme's
|
|
5
|
+
* `colors.scrim` (Amore's warm `rgba(28,23,20,0.45)`; K-Marie's and Sparkl's are this one), so an app
|
|
6
|
+
* passes its own to keep its look.
|
|
7
|
+
*/
|
|
8
|
+
export declare const BUBBLE_CHIP_COLOR = "rgba(0,0,0,0.45)";
|
|
9
|
+
export interface BubbleFrameProps {
|
|
10
|
+
/** The show's poster, under the video, so the bubble isn't black while the picture arrives. */
|
|
11
|
+
posterUrl: string | null;
|
|
12
|
+
/** A tap on the bubble: back to the show's screen. */
|
|
13
|
+
onOpen: () => void;
|
|
14
|
+
/** ✕: the show stops and the bubble closes. */
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
/** Screen-reader words for the tap and for ✕. */
|
|
17
|
+
openLabel: string;
|
|
18
|
+
closeLabel: string;
|
|
19
|
+
/** Behind the ✕ and the expand mark: the app's scrim colour (amore-v2's theme `colors.scrim`). Default `BUBBLE_CHIP_COLOR`. */
|
|
20
|
+
chipColor?: string;
|
|
21
|
+
/** The video. Drawn under the tap, which it must not take (it is wrapped in a view that lets touches through). */
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The floating bubble's frame. Each bubble draws its own video inside it and says what a tap and ✕
|
|
26
|
+
* do; the frame does the rest, the same for both. An app overlay beside the navigator, not a tile:
|
|
27
|
+
* mount it over the whole app (a full-screen parent), inside `SafeAreaProvider`.
|
|
28
|
+
*
|
|
29
|
+
* - **Draggable**, and on release it snaps to the nearer side, kept clear of the safe areas and the
|
|
30
|
+
* tab bar. It starts at the bottom right each time it opens: mount it only while the bubble is up.
|
|
31
|
+
* - **A tap** calls `onOpen`; **✕** calls `onClose`. An expand mark in the opposite corner says the
|
|
32
|
+
* whole bubble opens the show.
|
|
33
|
+
* - The poster sits under the video, so the bubble isn't black while it loads.
|
|
34
|
+
* - Hidden, and letting touches through, until the overlay has been measured and the bubble is in its
|
|
35
|
+
* corner.
|
|
36
|
+
*/
|
|
37
|
+
export declare function BubbleFrame({ posterUrl, onOpen, onClose, openLabel, closeLabel, chipColor, children }: BubbleFrameProps): import("react").CElement<import("react-native").ViewProps, View>;
|
|
38
|
+
//# sourceMappingURL=BubbleFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BubbleFrame.d.ts","sourceRoot":"","sources":["../../src/ui/BubbleFrame.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAiD,IAAI,EAAE,MAAM,cAAc,CAAC;AAenF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAIpD,MAAM,WAAW,gBAAgB;IAC/B,+FAA+F;IAC/F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,sDAAsD;IACtD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,+HAA+H;IAC/H,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kHAAkH;IAClH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAA6B,EAAE,QAAQ,EAAE,EAAE,gBAAgB,oEAyI3I"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUBBLE_CHIP_COLOR = void 0;
|
|
4
|
+
exports.BubbleFrame = BubbleFrame;
|
|
5
|
+
/**
|
|
6
|
+
* The floating bubble's frame (0.14.0, moved from amore-v2's `src/core/overlays/bubbleFrame.tsx`: the
|
|
7
|
+
* old app's `PipBubbleFrame`, rebuilt), shared by `ReplayBubble` and `LiveBubble`.
|
|
8
|
+
*
|
|
9
|
+
* `createElement` rather than JSX, like the rest of the package, so this stays a plain `.ts`.
|
|
10
|
+
*/
|
|
11
|
+
const vector_icons_1 = require("@expo/vector-icons");
|
|
12
|
+
const react_native_performant_image_1 = require("@tiledev/react-native-performant-image");
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const react_native_1 = require("react-native");
|
|
15
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
16
|
+
/** The bubble: 128 wide, portrait 9:16, the shape the hosts record in. */
|
|
17
|
+
const WIDTH = 128;
|
|
18
|
+
const HEIGHT = Math.round((WIDTH * 16) / 9);
|
|
19
|
+
/** From the screen's edges, the safe areas and the tab bar. */
|
|
20
|
+
const MARGIN = 12;
|
|
21
|
+
/** Room kept for the tab bar at the bottom (the safe area's inset doesn't include it). */
|
|
22
|
+
const TAB_BAR_ROOM = 56;
|
|
23
|
+
/** A finger that moves this far is dragging the bubble, not tapping it. */
|
|
24
|
+
const DRAG_START = 6;
|
|
25
|
+
/** White on the video, as the Replay and Live screens' buttons. */
|
|
26
|
+
const ON_VIDEO = '#FFFFFF';
|
|
27
|
+
/**
|
|
28
|
+
* The ✕ and expand chips' backing when the app passes none: a dark wash. amore-v2 drew its theme's
|
|
29
|
+
* `colors.scrim` (Amore's warm `rgba(28,23,20,0.45)`; K-Marie's and Sparkl's are this one), so an app
|
|
30
|
+
* passes its own to keep its look.
|
|
31
|
+
*/
|
|
32
|
+
exports.BUBBLE_CHIP_COLOR = 'rgba(0,0,0,0.45)';
|
|
33
|
+
const clamp = (value, low, high) => Math.min(Math.max(value, low), high);
|
|
34
|
+
/**
|
|
35
|
+
* The floating bubble's frame. Each bubble draws its own video inside it and says what a tap and ✕
|
|
36
|
+
* do; the frame does the rest, the same for both. An app overlay beside the navigator, not a tile:
|
|
37
|
+
* mount it over the whole app (a full-screen parent), inside `SafeAreaProvider`.
|
|
38
|
+
*
|
|
39
|
+
* - **Draggable**, and on release it snaps to the nearer side, kept clear of the safe areas and the
|
|
40
|
+
* tab bar. It starts at the bottom right each time it opens: mount it only while the bubble is up.
|
|
41
|
+
* - **A tap** calls `onOpen`; **✕** calls `onClose`. An expand mark in the opposite corner says the
|
|
42
|
+
* whole bubble opens the show.
|
|
43
|
+
* - The poster sits under the video, so the bubble isn't black while it loads.
|
|
44
|
+
* - Hidden, and letting touches through, until the overlay has been measured and the bubble is in its
|
|
45
|
+
* corner.
|
|
46
|
+
*/
|
|
47
|
+
function BubbleFrame({ posterUrl, onOpen, onClose, openLabel, closeLabel, chipColor = exports.BUBBLE_CHIP_COLOR, children }) {
|
|
48
|
+
const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
49
|
+
/**
|
|
50
|
+
* The room the bubble moves in, from the overlay's own layout rather than `Dimensions` (production
|
|
51
|
+
* found `Dimensions` stale after a system picture-in-picture window on Android). None until the first
|
|
52
|
+
* layout, and the bubble stays hidden till then.
|
|
53
|
+
*/
|
|
54
|
+
const [frame, setFrame] = (0, react_1.useState)(null);
|
|
55
|
+
const edges = (0, react_1.useMemo)(() => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
const top = insets.top + MARGIN;
|
|
58
|
+
const right = ((_a = frame === null || frame === void 0 ? void 0 : frame.width) !== null && _a !== void 0 ? _a : 0) - WIDTH - MARGIN;
|
|
59
|
+
const bottom = ((_b = frame === null || frame === void 0 ? void 0 : frame.height) !== null && _b !== void 0 ? _b : 0) - insets.bottom - TAB_BAR_ROOM - HEIGHT - MARGIN;
|
|
60
|
+
// Never inverted, so the clamps below stay sane on a window smaller than the bubble.
|
|
61
|
+
return { left: MARGIN, right: Math.max(MARGIN, right), top, bottom: Math.max(top, bottom) };
|
|
62
|
+
}, [frame === null || frame === void 0 ? void 0 : frame.width, frame === null || frame === void 0 ? void 0 : frame.height, insets.top, insets.bottom]);
|
|
63
|
+
// Where the bubble rests: held here as well as in the animated value, which can't be read back.
|
|
64
|
+
const resting = (0, react_1.useRef)({ x: edges.right, y: edges.bottom });
|
|
65
|
+
const position = (0, react_1.useRef)(new react_native_1.Animated.ValueXY(resting.current)).current;
|
|
66
|
+
// The gesture is made once; it reads the edges from here, at the moment it fires.
|
|
67
|
+
const edgesNow = (0, react_1.useRef)(edges);
|
|
68
|
+
edgesNow.current = edges;
|
|
69
|
+
/** The shopper has put it somewhere: a new layout keeps it there, pulled inside the new edges. */
|
|
70
|
+
const moved = (0, react_1.useRef)(false);
|
|
71
|
+
/**
|
|
72
|
+
* A drag is under way or has just ended. On web the mouse's release over the bubble, which followed
|
|
73
|
+
* it, is also a click on it, and opened the show at the end of every drag (seen in the preview).
|
|
74
|
+
*/
|
|
75
|
+
const dragging = (0, react_1.useRef)(false);
|
|
76
|
+
// A new layout (the first one, a rotation): the bubble goes to its corner, or stays where the shopper
|
|
77
|
+
// put it. Before paint, so it is never seen where it was.
|
|
78
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
79
|
+
const next = moved.current
|
|
80
|
+
? { x: clamp(resting.current.x, edges.left, edges.right), y: clamp(resting.current.y, edges.top, edges.bottom) }
|
|
81
|
+
: { x: edges.right, y: edges.bottom };
|
|
82
|
+
if (next.x === resting.current.x && next.y === resting.current.y)
|
|
83
|
+
return;
|
|
84
|
+
resting.current = next;
|
|
85
|
+
position.setValue(next);
|
|
86
|
+
}, [edges, position]);
|
|
87
|
+
const drag = (0, react_1.useMemo)(() => {
|
|
88
|
+
// After the click that may follow the release, which comes in the same turn.
|
|
89
|
+
const dragEnded = () => setTimeout(() => {
|
|
90
|
+
dragging.current = false;
|
|
91
|
+
}, 0);
|
|
92
|
+
return react_native_1.PanResponder.create({
|
|
93
|
+
// Only once it is clearly a drag, so a tap still reaches the bubble's button.
|
|
94
|
+
onMoveShouldSetPanResponder: (_event, gesture) => Math.abs(gesture.dx) > DRAG_START || Math.abs(gesture.dy) > DRAG_START,
|
|
95
|
+
onPanResponderGrant: () => {
|
|
96
|
+
dragging.current = true;
|
|
97
|
+
position.setOffset(resting.current);
|
|
98
|
+
position.setValue({ x: 0, y: 0 });
|
|
99
|
+
},
|
|
100
|
+
onPanResponderMove: react_native_1.Animated.event([null, { dx: position.x, dy: position.y }], { useNativeDriver: false }),
|
|
101
|
+
onPanResponderRelease: (_event, gesture) => {
|
|
102
|
+
position.flattenOffset();
|
|
103
|
+
moved.current = true;
|
|
104
|
+
const { left, right, top, bottom } = edgesNow.current;
|
|
105
|
+
const x = resting.current.x + gesture.dx;
|
|
106
|
+
const y = resting.current.y + gesture.dy;
|
|
107
|
+
// The nearer side: the bubble's middle against the middle of the room it moves in.
|
|
108
|
+
const snapped = { x: x + WIDTH / 2 < (left + right + WIDTH) / 2 ? left : right, y: clamp(y, top, bottom) };
|
|
109
|
+
resting.current = snapped;
|
|
110
|
+
react_native_1.Animated.spring(position, { toValue: snapped, useNativeDriver: false, friction: 8, tension: 70 }).start();
|
|
111
|
+
dragEnded();
|
|
112
|
+
},
|
|
113
|
+
onPanResponderTerminate: () => {
|
|
114
|
+
dragEnded();
|
|
115
|
+
position.flattenOffset();
|
|
116
|
+
react_native_1.Animated.spring(position, { toValue: resting.current, useNativeDriver: false, friction: 8, tension: 70 }).start();
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}, [position]);
|
|
120
|
+
// The picture is clipped to the rounded corners inside; the shadow is drawn outside, where a clip would cut it off.
|
|
121
|
+
const picture = (0, react_1.createElement)(react_native_1.View, { style: styles.picture }, 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)(react_native_1.Pressable, {
|
|
122
|
+
accessibilityRole: 'button',
|
|
123
|
+
accessibilityLabel: openLabel,
|
|
124
|
+
onPress: () => {
|
|
125
|
+
if (!dragging.current)
|
|
126
|
+
onOpen();
|
|
127
|
+
},
|
|
128
|
+
style: react_native_1.StyleSheet.absoluteFill,
|
|
129
|
+
},
|
|
130
|
+
// Not touchable, or the native video view keeps the tap meant for the bubble.
|
|
131
|
+
(0, react_1.createElement)(react_native_1.View, { pointerEvents: 'none', style: react_native_1.StyleSheet.absoluteFill }, children)), (0, react_1.createElement)(react_native_1.Pressable, {
|
|
132
|
+
accessibilityRole: 'button',
|
|
133
|
+
accessibilityLabel: closeLabel,
|
|
134
|
+
hitSlop: 8,
|
|
135
|
+
onPress: onClose,
|
|
136
|
+
style: ({ pressed }) => [styles.chip, styles.close, { backgroundColor: chipColor }, pressed && styles.pressed],
|
|
137
|
+
}, (0, react_1.createElement)(vector_icons_1.Ionicons, { name: 'close', size: 14, color: ON_VIDEO })),
|
|
138
|
+
// Says a tap opens it; not a button of its own, as the whole bubble is.
|
|
139
|
+
(0, react_1.createElement)(react_native_1.View, { pointerEvents: 'none', style: [styles.chip, styles.openHint, { backgroundColor: chipColor }] }, (0, react_1.createElement)(vector_icons_1.Ionicons, { name: 'expand', size: 13, color: ON_VIDEO })));
|
|
140
|
+
return (0, react_1.createElement)(react_native_1.View, {
|
|
141
|
+
pointerEvents: 'box-none',
|
|
142
|
+
style: react_native_1.StyleSheet.absoluteFill,
|
|
143
|
+
onLayout: (event) => {
|
|
144
|
+
const next = event.nativeEvent.layout;
|
|
145
|
+
setFrame((current) => ((current === null || current === void 0 ? void 0 : current.width) === next.width && (current === null || current === void 0 ? void 0 : current.height) === next.height ? current : next));
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
// Drawn from the first render, so the video view is up in the same commit as the bubble (on web the
|
|
149
|
+
// replay player seeks and plays the views it has then); hidden until the room is measured and it is
|
|
150
|
+
// in its corner.
|
|
151
|
+
(0, react_1.createElement)(react_native_1.Animated.View, {
|
|
152
|
+
...drag.panHandlers,
|
|
153
|
+
pointerEvents: frame ? 'auto' : 'none',
|
|
154
|
+
style: [styles.bubble, !frame && styles.notPlacedYet, { transform: position.getTranslateTransform() }],
|
|
155
|
+
}, picture));
|
|
156
|
+
}
|
|
157
|
+
const styles = react_native_1.StyleSheet.create({
|
|
158
|
+
bubble: {
|
|
159
|
+
position: 'absolute',
|
|
160
|
+
top: 0,
|
|
161
|
+
left: 0,
|
|
162
|
+
width: WIDTH,
|
|
163
|
+
height: HEIGHT,
|
|
164
|
+
borderRadius: 12,
|
|
165
|
+
backgroundColor: '#000000',
|
|
166
|
+
// Production's, tuned on a device: any lighter and the bubble reads as part of the screen behind it.
|
|
167
|
+
shadowColor: '#000000',
|
|
168
|
+
shadowOpacity: 0.35,
|
|
169
|
+
shadowRadius: 12,
|
|
170
|
+
shadowOffset: { width: 0, height: 4 },
|
|
171
|
+
elevation: 8,
|
|
172
|
+
},
|
|
173
|
+
picture: { ...react_native_1.StyleSheet.absoluteFillObject, borderRadius: 12, overflow: 'hidden', backgroundColor: '#000000' },
|
|
174
|
+
chip: { position: 'absolute', width: 22, height: 22, borderRadius: 11, alignItems: 'center', justifyContent: 'center' },
|
|
175
|
+
// Opposite corners, so a thumb reaching for one is nowhere near the other.
|
|
176
|
+
close: { top: 4, right: 4 },
|
|
177
|
+
openHint: { bottom: 4, right: 4 },
|
|
178
|
+
pressed: { opacity: 0.5 },
|
|
179
|
+
notPlacedYet: { opacity: 0 },
|
|
180
|
+
});
|
|
181
|
+
//# sourceMappingURL=BubbleFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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,KAAK,EAAE,CAAC,EAAE;IAC3B,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;IACjC,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;IACzB,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;CAC7B,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
export interface LiveBubbleProps {
|
|
3
|
+
/** A tap on the bubble. Default: back to the Live screen for the show (`LiveSellingProvider`'s `routes.openLive`). */
|
|
4
|
+
onOpen?: (streamId: string) => void;
|
|
5
|
+
/** Behind the ✕ and the expand mark: the app's scrim colour. Default `BUBBLE_CHIP_COLOR`. */
|
|
6
|
+
chipColor?: string;
|
|
7
|
+
/** Screen-reader words for the tap and for ✕. Default "Back to the live show", "Close the live show". */
|
|
8
|
+
openLabel?: string;
|
|
9
|
+
closeLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The live show's floating bubble. An app overlay beside the navigator, not a tile, so it outlives the
|
|
13
|
+
* Live screen that shrank the show: mount it once over the whole app, inside `LiveSessionProvider`
|
|
14
|
+
* (`ShopifyLiveSessionProvider`) and `SafeAreaProvider`. Shown while the session's picture is in the
|
|
15
|
+
* app's bubble (`pipMode` `inapp`): the Live screen's back (while the show plays or waits for the
|
|
16
|
+
* host), picture-in-picture and cart buttons put it there.
|
|
17
|
+
*
|
|
18
|
+
* - **The show's own picture**: `LiveVideoTarget`, which claims the room's video while the bubble is
|
|
19
|
+
* up, at the shopper's own sound setting, over the show's poster.
|
|
20
|
+
* - **A tap** goes back to the Live screen already open, or a new one (`routes.openLive`, or `onOpen`),
|
|
21
|
+
* which ends the bubble as it arrives. **✕** stops the show and lets the session follow whatever is
|
|
22
|
+
* on air again. The show ending closes it (the session leaves `inapp` itself).
|
|
23
|
+
* - **The screen stays on** while it shows, under its own hold (`useKeepScreenAwake`'s tag).
|
|
24
|
+
* - **One shrunk show at a time**: the Live screen stops a replay's bubble as it opens, and the Replay
|
|
25
|
+
* screen this one.
|
|
26
|
+
* - **The phone's own floating window** (`pipMode` `system`). Putting the app away with the bubble up
|
|
27
|
+
* hands the show to it (the session arms it while the bubble shows a playing show), and coming back
|
|
28
|
+
* puts it in the bubble again.
|
|
29
|
+
* - **iOS** draws that window itself. When it came from the bubble, the bubble stays drawn behind it,
|
|
30
|
+
* its video view still bound, so coming back finds the same picture with no new binding and no
|
|
31
|
+
* black frame. When it came from the Live screen, nothing is drawn here.
|
|
32
|
+
* - **Android**'s window is the app, scaled down, so the picture fills it here, over the show's
|
|
33
|
+
* poster (Freckled Poppy's), whichever surface it came from.
|
|
34
|
+
* - **On the web** the session is idle, so nothing is ever drawn.
|
|
35
|
+
*/
|
|
36
|
+
export declare function LiveBubble({ onOpen, chipColor, openLabel, closeLabel }?: LiveBubbleProps): import("react").CElement<import("react-native").ViewProps, View> | import("react").FunctionComponentElement<import("./BubbleFrame").BubbleFrameProps> | null;
|
|
37
|
+
//# sourceMappingURL=LiveBubble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveBubble.d.ts","sourceRoot":"","sources":["../../src/ui/LiveBubble.ts"],"names":[],"mappings":"AAQA,OAAO,EAAwB,IAAI,EAAE,MAAM,cAAc,CAAC;AAc1D,MAAM,WAAW,eAAe;IAC9B,sHAAsH;IACtH,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yGAAyG;IACzG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAsB,EAAE,UAAwB,EAAE,GAAE,eAAoB,gKAqDvH"}
|
|
@@ -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,SAAS,EAAE,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,KAAK,CAAC,KAAK,KAAsB,EAAE;;IACtH,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAc,GAAE,CAAC;IAC9D,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,wCAAkB,GAAE,CAAC;IAExC,mGAAmG;IACnG,uGAAuG;IACvG,oGAAoG;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AAC,KAAK,EAAE,CAAC,CACtE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9B,MAAM,QAAQ,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC;IACrC,OAAO,IAAA,qBAAa,EAClB,yBAAW,EACX;QACE,SAAS;QACT,MAAM,EAAE,GAAG,EAAE;YACX,IAAI,CAAC,QAAQ;gBAAE,OAAO;YACtB,IAAI,MAAM;gBAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;;gBACxB,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,4FAA4F;YAC5F,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,CAAC;QACD,SAAS;QACT,UAAU;QACV,SAAS;QACT,0FAA0F;QAC1F,QAAQ,EAAE,IAAA,qBAAa,EAAC,iCAAe,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;KAChF,CACF,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE,EAAE,GAAG,yBAAU,CAAC,kBAAkB,EAAE;IAC3C,iHAAiH;IACjH,YAAY,EAAE,EAAE,GAAG,yBAAU,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":";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G,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
|
package/dist/ui.d.ts.map
ADDED
|
@@ -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"}
|