@streamplace/components 0.7.13 → 0.7.15
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/package.json +13 -16
- package/src/components/mobile-player/fullscreen.native.tsx +15 -20
- package/src/components/mobile-player/fullscreen.tsx +10 -2
- package/src/components/mobile-player/player.tsx +7 -1
- package/src/components/mobile-player/props.tsx +2 -0
- package/src/components/mobile-player/video.native.tsx +28 -11
- package/src/components/mobile-player/video.tsx +14 -3
- package/src/hooks/useLivestreamInfo.ts +6 -2
- package/src/lib/browser.ts +27 -0
- package/src/livestream-store/stream-key.tsx +1 -28
- package/src/streamplace-store/stream.tsx +51 -13
- package/dist/assets/emoji-data.json +0 -19371
- package/dist/components/chat/chat-box.js +0 -314
- package/dist/components/chat/chat-message.js +0 -87
- package/dist/components/chat/chat.js +0 -149
- package/dist/components/chat/emoji-suggestions.js +0 -35
- package/dist/components/chat/mention-suggestions.js +0 -42
- package/dist/components/chat/mod-view.js +0 -94
- package/dist/components/chat/system-message.js +0 -19
- package/dist/components/dashboard/chat-panel.js +0 -38
- package/dist/components/dashboard/header.js +0 -80
- package/dist/components/dashboard/index.js +0 -14
- package/dist/components/dashboard/information-widget.js +0 -234
- package/dist/components/dashboard/mod-actions.js +0 -71
- package/dist/components/dashboard/problems.js +0 -74
- package/dist/components/icons/bluesky-icon.js +0 -9
- package/dist/components/keep-awake.js +0 -7
- package/dist/components/keep-awake.native.js +0 -16
- package/dist/components/mobile-player/fullscreen.js +0 -74
- package/dist/components/mobile-player/fullscreen.native.js +0 -155
- package/dist/components/mobile-player/player.js +0 -94
- package/dist/components/mobile-player/props.js +0 -2
- package/dist/components/mobile-player/shared.js +0 -54
- package/dist/components/mobile-player/ui/countdown.js +0 -83
- package/dist/components/mobile-player/ui/index.js +0 -11
- package/dist/components/mobile-player/ui/input.js +0 -42
- package/dist/components/mobile-player/ui/metrics.js +0 -44
- package/dist/components/mobile-player/ui/report-modal.js +0 -90
- package/dist/components/mobile-player/ui/streamer-context-menu.js +0 -7
- package/dist/components/mobile-player/ui/streamer-loading-overlay.js +0 -104
- package/dist/components/mobile-player/ui/viewer-context-menu.js +0 -51
- package/dist/components/mobile-player/ui/viewer-loading-overlay.js +0 -49
- package/dist/components/mobile-player/ui/viewers.js +0 -23
- package/dist/components/mobile-player/use-webrtc.js +0 -243
- package/dist/components/mobile-player/video-retry.js +0 -29
- package/dist/components/mobile-player/video.js +0 -460
- package/dist/components/mobile-player/video.native.js +0 -276
- package/dist/components/mobile-player/webrtc-diagnostics.js +0 -110
- package/dist/components/mobile-player/webrtc-primitives.js +0 -27
- package/dist/components/mobile-player/webrtc-primitives.native.js +0 -8
- package/dist/components/share/sharesheet.js +0 -91
- package/dist/components/ui/button.js +0 -223
- package/dist/components/ui/dialog.js +0 -206
- package/dist/components/ui/dropdown.js +0 -172
- package/dist/components/ui/icons.js +0 -25
- package/dist/components/ui/index.js +0 -34
- package/dist/components/ui/info-box.js +0 -31
- package/dist/components/ui/info-row.js +0 -23
- package/dist/components/ui/input.js +0 -205
- package/dist/components/ui/loader.js +0 -10
- package/dist/components/ui/primitives/button.js +0 -125
- package/dist/components/ui/primitives/input.js +0 -206
- package/dist/components/ui/primitives/modal.js +0 -206
- package/dist/components/ui/primitives/text.js +0 -292
- package/dist/components/ui/resizeable.js +0 -121
- package/dist/components/ui/slider.js +0 -5
- package/dist/components/ui/text.js +0 -177
- package/dist/components/ui/textarea.js +0 -19
- package/dist/components/ui/toast.js +0 -175
- package/dist/components/ui/view.js +0 -252
- package/dist/hooks/index.js +0 -14
- package/dist/hooks/useAvatars.js +0 -35
- package/dist/hooks/useCameraToggle.js +0 -12
- package/dist/hooks/useKeyboard.js +0 -36
- package/dist/hooks/useKeyboardSlide.js +0 -14
- package/dist/hooks/useLivestreamInfo.js +0 -65
- package/dist/hooks/useOuterAndInnerDimensions.js +0 -30
- package/dist/hooks/usePlayerDimensions.js +0 -22
- package/dist/hooks/usePointerDevice.js +0 -71
- package/dist/hooks/useSegmentDimensions.js +0 -17
- package/dist/hooks/useSegmentTiming.js +0 -65
- package/dist/index.js +0 -34
- package/dist/lib/facet.js +0 -92
- package/dist/lib/system-messages.js +0 -101
- package/dist/lib/theme/atoms.js +0 -646
- package/dist/lib/theme/atoms.types.js +0 -6
- package/dist/lib/theme/index.js +0 -35
- package/dist/lib/theme/theme.js +0 -256
- package/dist/lib/theme/tokens.js +0 -659
- package/dist/lib/utils.js +0 -105
- package/dist/livestream-provider/index.js +0 -30
- package/dist/livestream-provider/websocket.js +0 -45
- package/dist/livestream-store/chat.js +0 -286
- package/dist/livestream-store/context.js +0 -5
- package/dist/livestream-store/index.js +0 -7
- package/dist/livestream-store/livestream-state.js +0 -2
- package/dist/livestream-store/livestream-store.js +0 -58
- package/dist/livestream-store/problems.js +0 -76
- package/dist/livestream-store/stream-key.js +0 -119
- package/dist/livestream-store/websocket-consumer.js +0 -94
- package/dist/player-store/context.js +0 -5
- package/dist/player-store/index.js +0 -9
- package/dist/player-store/player-provider.js +0 -57
- package/dist/player-store/player-state.js +0 -25
- package/dist/player-store/player-store.js +0 -199
- package/dist/player-store/single-player-provider.js +0 -121
- package/dist/streamplace-provider/context.js +0 -5
- package/dist/streamplace-provider/index.js +0 -20
- package/dist/streamplace-provider/poller.js +0 -49
- package/dist/streamplace-provider/xrpc.js +0 -0
- package/dist/streamplace-store/block.js +0 -65
- package/dist/streamplace-store/index.js +0 -6
- package/dist/streamplace-store/stream.js +0 -218
- package/dist/streamplace-store/streamplace-store.js +0 -47
- package/dist/streamplace-store/user.js +0 -52
- package/dist/streamplace-store/xrpc.js +0 -15
- package/dist/ui/index.js +0 -79
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/56540125 +0 -0
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/67b1eb60 +0 -0
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/7c275f90 +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModalPrimitive = exports.ModalClose = exports.ModalFooter = exports.ModalBody = exports.ModalHeader = exports.ModalContent = exports.ModalOverlay = exports.ModalRoot = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
-
const react_native_1 = require("react-native");
|
|
8
|
-
const { width: screenWidth, height: screenHeight } = react_native_1.Dimensions.get("window");
|
|
9
|
-
// Modal root primitive - handles the native Modal component
|
|
10
|
-
exports.ModalRoot = (0, react_1.forwardRef)(({ open = false, onOpenChange, children, onRequestClose, animationType = "fade", presentationStyle = react_native_1.Platform.OS === "ios" ? "pageSheet" : "fullScreen", transparent = true, statusBarTranslucent = react_native_1.Platform.OS === "android", ...props }, ref) => {
|
|
11
|
-
const handleRequestClose = react_1.default.useCallback((e) => {
|
|
12
|
-
if (onOpenChange) {
|
|
13
|
-
onOpenChange(false);
|
|
14
|
-
}
|
|
15
|
-
if (onRequestClose) {
|
|
16
|
-
onRequestClose(e);
|
|
17
|
-
}
|
|
18
|
-
}, [onOpenChange, onRequestClose]);
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: open, onRequestClose: handleRequestClose, animationType: animationType, presentationStyle: presentationStyle, transparent: transparent, statusBarTranslucent: statusBarTranslucent, ...props, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: primitiveStyles.container, children: children }) }));
|
|
20
|
-
});
|
|
21
|
-
exports.ModalRoot.displayName = "ModalRoot";
|
|
22
|
-
exports.ModalOverlay = (0, react_1.forwardRef)(({ dismissible = true, onDismiss, onPress, style, children, activeOpacity = 1, ...props }, ref) => {
|
|
23
|
-
const handlePress = react_1.default.useCallback((event) => {
|
|
24
|
-
if (dismissible && onDismiss) {
|
|
25
|
-
onDismiss();
|
|
26
|
-
}
|
|
27
|
-
if (onPress) {
|
|
28
|
-
onPress(event);
|
|
29
|
-
}
|
|
30
|
-
}, [dismissible, onDismiss, onPress]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { ref: ref, style: [primitiveStyles.overlay, style], activeOpacity: activeOpacity, onPress: handlePress, ...props, children: children }));
|
|
32
|
-
});
|
|
33
|
-
exports.ModalOverlay.displayName = "ModalOverlay";
|
|
34
|
-
exports.ModalContent = (0, react_1.forwardRef)(({ children, position = "center", size = "md", style, onStartShouldSetResponder, ...props }, ref) => {
|
|
35
|
-
// Prevent touches from propagating to overlay
|
|
36
|
-
const handleStartShouldSetResponder = react_1.default.useCallback(() => {
|
|
37
|
-
return true;
|
|
38
|
-
}, []);
|
|
39
|
-
const positionStyle = react_1.default.useMemo(() => {
|
|
40
|
-
switch (position) {
|
|
41
|
-
case "top":
|
|
42
|
-
return primitiveStyles.contentTop;
|
|
43
|
-
case "bottom":
|
|
44
|
-
return primitiveStyles.contentBottom;
|
|
45
|
-
case "left":
|
|
46
|
-
return primitiveStyles.contentLeft;
|
|
47
|
-
case "right":
|
|
48
|
-
return primitiveStyles.contentRight;
|
|
49
|
-
case "center":
|
|
50
|
-
default:
|
|
51
|
-
return primitiveStyles.contentCenter;
|
|
52
|
-
}
|
|
53
|
-
}, [position]);
|
|
54
|
-
const sizeStyle = react_1.default.useMemo(() => {
|
|
55
|
-
switch (size) {
|
|
56
|
-
case "sm":
|
|
57
|
-
return primitiveStyles.sizeSm;
|
|
58
|
-
case "lg":
|
|
59
|
-
return primitiveStyles.sizeLg;
|
|
60
|
-
case "xl":
|
|
61
|
-
return primitiveStyles.sizeXl;
|
|
62
|
-
case "full":
|
|
63
|
-
return primitiveStyles.sizeFull;
|
|
64
|
-
case "md":
|
|
65
|
-
default:
|
|
66
|
-
return primitiveStyles.sizeMd;
|
|
67
|
-
}
|
|
68
|
-
}, [size]);
|
|
69
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [primitiveStyles.content, positionStyle, sizeStyle, style], onStartShouldSetResponder: onStartShouldSetResponder || handleStartShouldSetResponder, ...props, children: children }));
|
|
70
|
-
});
|
|
71
|
-
exports.ModalContent.displayName = "ModalContent";
|
|
72
|
-
exports.ModalHeader = (0, react_1.forwardRef)(({ children, withBorder = false, style, ...props }, ref) => {
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [
|
|
74
|
-
primitiveStyles.header,
|
|
75
|
-
withBorder && primitiveStyles.headerBorder,
|
|
76
|
-
style,
|
|
77
|
-
], ...props, children: children }));
|
|
78
|
-
});
|
|
79
|
-
exports.ModalHeader.displayName = "ModalHeader";
|
|
80
|
-
exports.ModalBody = (0, react_1.forwardRef)(({ children, scrollable = true, style, ...props }, ref) => {
|
|
81
|
-
if (!scrollable) {
|
|
82
|
-
return (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [primitiveStyles.body, style], children: children });
|
|
83
|
-
}
|
|
84
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { ref: ref, style: [primitiveStyles.body, style], showsVerticalScrollIndicator: false, keyboardShouldPersistTaps: "handled", ...props, children: children }));
|
|
85
|
-
});
|
|
86
|
-
exports.ModalBody.displayName = "ModalBody";
|
|
87
|
-
exports.ModalFooter = (0, react_1.forwardRef)(({ children, withBorder = false, direction = "row", justify = "flex-end", style, ...props }, ref) => {
|
|
88
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [
|
|
89
|
-
primitiveStyles.footer,
|
|
90
|
-
withBorder && primitiveStyles.footerBorder,
|
|
91
|
-
{
|
|
92
|
-
flexDirection: direction,
|
|
93
|
-
justifyContent: justify,
|
|
94
|
-
},
|
|
95
|
-
style,
|
|
96
|
-
], ...props, children: children }));
|
|
97
|
-
});
|
|
98
|
-
exports.ModalFooter.displayName = "ModalFooter";
|
|
99
|
-
exports.ModalClose = (0, react_1.forwardRef)(({ children, onClose, onPress, ...props }, ref) => {
|
|
100
|
-
const handlePress = react_1.default.useCallback((event) => {
|
|
101
|
-
if (onClose) {
|
|
102
|
-
onClose();
|
|
103
|
-
}
|
|
104
|
-
if (onPress) {
|
|
105
|
-
onPress(event);
|
|
106
|
-
}
|
|
107
|
-
}, [onClose, onPress]);
|
|
108
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { ref: ref, onPress: handlePress, ...props, children: children }));
|
|
109
|
-
});
|
|
110
|
-
exports.ModalClose.displayName = "ModalClose";
|
|
111
|
-
// Primitive styles (minimal, unstyled)
|
|
112
|
-
const primitiveStyles = react_native_1.StyleSheet.create({
|
|
113
|
-
container: {
|
|
114
|
-
flex: 1,
|
|
115
|
-
},
|
|
116
|
-
overlay: {
|
|
117
|
-
flex: 1,
|
|
118
|
-
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
119
|
-
justifyContent: "center",
|
|
120
|
-
alignItems: "center",
|
|
121
|
-
padding: 16,
|
|
122
|
-
},
|
|
123
|
-
content: {
|
|
124
|
-
borderRadius: 8,
|
|
125
|
-
overflow: "hidden",
|
|
126
|
-
},
|
|
127
|
-
contentCenter: {
|
|
128
|
-
alignSelf: "center",
|
|
129
|
-
},
|
|
130
|
-
contentTop: {
|
|
131
|
-
alignSelf: "center",
|
|
132
|
-
marginTop: 0,
|
|
133
|
-
},
|
|
134
|
-
contentBottom: {
|
|
135
|
-
alignSelf: "center",
|
|
136
|
-
marginTop: "auto",
|
|
137
|
-
},
|
|
138
|
-
contentLeft: {
|
|
139
|
-
alignSelf: "flex-start",
|
|
140
|
-
marginRight: "auto",
|
|
141
|
-
},
|
|
142
|
-
contentRight: {
|
|
143
|
-
alignSelf: "flex-end",
|
|
144
|
-
marginLeft: "auto",
|
|
145
|
-
},
|
|
146
|
-
sizeSm: {
|
|
147
|
-
maxWidth: screenWidth * 0.4,
|
|
148
|
-
maxHeight: screenHeight * 0.6,
|
|
149
|
-
},
|
|
150
|
-
sizeMd: {
|
|
151
|
-
maxWidth: screenWidth * 0.6,
|
|
152
|
-
maxHeight: screenHeight * 0.8,
|
|
153
|
-
},
|
|
154
|
-
sizeLg: {
|
|
155
|
-
maxWidth: screenWidth * 0.8,
|
|
156
|
-
maxHeight: screenHeight * 0.9,
|
|
157
|
-
},
|
|
158
|
-
sizeXl: {
|
|
159
|
-
maxWidth: screenWidth * 0.95,
|
|
160
|
-
maxHeight: screenHeight * 0.95,
|
|
161
|
-
},
|
|
162
|
-
sizeFull: {
|
|
163
|
-
width: screenWidth,
|
|
164
|
-
height: screenHeight,
|
|
165
|
-
maxWidth: screenWidth,
|
|
166
|
-
maxHeight: screenHeight,
|
|
167
|
-
borderRadius: 0,
|
|
168
|
-
},
|
|
169
|
-
header: {
|
|
170
|
-
paddingHorizontal: 16,
|
|
171
|
-
paddingVertical: 12,
|
|
172
|
-
flexDirection: "row",
|
|
173
|
-
alignItems: "center",
|
|
174
|
-
justifyContent: "space-between",
|
|
175
|
-
},
|
|
176
|
-
headerBorder: {
|
|
177
|
-
borderBottomWidth: 1,
|
|
178
|
-
borderBottomColor: "#e5e7eb",
|
|
179
|
-
},
|
|
180
|
-
body: {
|
|
181
|
-
flex: 1,
|
|
182
|
-
paddingHorizontal: 16,
|
|
183
|
-
paddingVertical: 12,
|
|
184
|
-
},
|
|
185
|
-
footer: {
|
|
186
|
-
paddingHorizontal: 16,
|
|
187
|
-
paddingVertical: 12,
|
|
188
|
-
flexDirection: "row",
|
|
189
|
-
alignItems: "center",
|
|
190
|
-
gap: 8,
|
|
191
|
-
},
|
|
192
|
-
footerBorder: {
|
|
193
|
-
borderTopWidth: 1,
|
|
194
|
-
borderTopColor: "#e5e7eb",
|
|
195
|
-
},
|
|
196
|
-
});
|
|
197
|
-
// Export primitive collection
|
|
198
|
-
exports.ModalPrimitive = {
|
|
199
|
-
Root: exports.ModalRoot,
|
|
200
|
-
Overlay: exports.ModalOverlay,
|
|
201
|
-
Content: exports.ModalContent,
|
|
202
|
-
Header: exports.ModalHeader,
|
|
203
|
-
Body: exports.ModalBody,
|
|
204
|
-
Footer: exports.ModalFooter,
|
|
205
|
-
Close: exports.ModalClose,
|
|
206
|
-
};
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TextPrimitive = exports.TextBlock = exports.TextSpan = exports.TextRoot = exports.TextContext = void 0;
|
|
4
|
-
exports.objectFromObjects = objectFromObjects;
|
|
5
|
-
exports.useTextContext = useTextContext;
|
|
6
|
-
exports.createTextStyle = createTextStyle;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const react_native_1 = require("react-native");
|
|
10
|
-
const theme_1 = require("../../../lib/theme/theme");
|
|
11
|
-
const tokens_1 = require("../../../lib/theme/tokens");
|
|
12
|
-
exports.TextContext = (0, react_1.createContext)(null);
|
|
13
|
-
function objectFromObjects(arr) {
|
|
14
|
-
return Object.assign({}, ...arr);
|
|
15
|
-
}
|
|
16
|
-
// Size mapping
|
|
17
|
-
const sizeMap = {
|
|
18
|
-
xs: 12,
|
|
19
|
-
sm: 14,
|
|
20
|
-
base: 16,
|
|
21
|
-
lg: 18,
|
|
22
|
-
xl: 20,
|
|
23
|
-
"2xl": 24,
|
|
24
|
-
"3xl": 30,
|
|
25
|
-
"4xl": 36,
|
|
26
|
-
};
|
|
27
|
-
// Weight mapping
|
|
28
|
-
const weightMap = {
|
|
29
|
-
thin: "100",
|
|
30
|
-
light: "300",
|
|
31
|
-
normal: "400",
|
|
32
|
-
medium: "500",
|
|
33
|
-
semibold: "600",
|
|
34
|
-
bold: "700",
|
|
35
|
-
extrabold: "800",
|
|
36
|
-
black: "900",
|
|
37
|
-
};
|
|
38
|
-
// Line height mapping
|
|
39
|
-
const leadingMap = {
|
|
40
|
-
none: 1,
|
|
41
|
-
tight: 1.2,
|
|
42
|
-
snug: 1.3,
|
|
43
|
-
normal: 1.5,
|
|
44
|
-
relaxed: 1.7,
|
|
45
|
-
loose: 2,
|
|
46
|
-
};
|
|
47
|
-
// Letter spacing mapping
|
|
48
|
-
const trackingMap = {
|
|
49
|
-
tighter: -0.8,
|
|
50
|
-
tight: -0.4,
|
|
51
|
-
normal: 0,
|
|
52
|
-
wide: 0.4,
|
|
53
|
-
wider: 0.8,
|
|
54
|
-
widest: 1.6,
|
|
55
|
-
};
|
|
56
|
-
// Variant definitions (platform-aware)
|
|
57
|
-
const getVariantStyles = () => {
|
|
58
|
-
// get platform-specific typography
|
|
59
|
-
// iOS, Android, Web (Universal)
|
|
60
|
-
const typographicPlatform = (react_native_1.Platform.OS === "ios"
|
|
61
|
-
? "ios"
|
|
62
|
-
: react_native_1.Platform.OS === "android"
|
|
63
|
-
? "android"
|
|
64
|
-
: "universal");
|
|
65
|
-
const platformTypography = tokens_1.typography[typographicPlatform];
|
|
66
|
-
if (!platformTypography) {
|
|
67
|
-
throw new Error("Platform typography not defined");
|
|
68
|
-
}
|
|
69
|
-
// Define mapping based on platform
|
|
70
|
-
if (typographicPlatform === "ios") {
|
|
71
|
-
return {
|
|
72
|
-
h1: platformTypography.largeTitle,
|
|
73
|
-
h2: platformTypography.title1,
|
|
74
|
-
h3: platformTypography.title2,
|
|
75
|
-
h4: platformTypography.title3,
|
|
76
|
-
h5: platformTypography.headline,
|
|
77
|
-
h6: platformTypography.headline,
|
|
78
|
-
subtitle1: platformTypography.subhead,
|
|
79
|
-
subtitle2: platformTypography.footnote,
|
|
80
|
-
body1: platformTypography.body,
|
|
81
|
-
body2: platformTypography.callout,
|
|
82
|
-
caption: platformTypography.caption1,
|
|
83
|
-
overline: platformTypography.caption2,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
else if (typographicPlatform === "android") {
|
|
87
|
-
return {
|
|
88
|
-
h1: platformTypography.headline1,
|
|
89
|
-
h2: platformTypography.headline2,
|
|
90
|
-
h3: platformTypography.headline3,
|
|
91
|
-
h4: platformTypography.headline4,
|
|
92
|
-
h5: platformTypography.headline5,
|
|
93
|
-
h6: platformTypography.headline6,
|
|
94
|
-
subtitle1: platformTypography.subtitle1,
|
|
95
|
-
subtitle2: platformTypography.subtitle2,
|
|
96
|
-
body1: platformTypography.body1,
|
|
97
|
-
body2: platformTypography.body2,
|
|
98
|
-
caption: platformTypography.caption,
|
|
99
|
-
overline: platformTypography.overline,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
// universal
|
|
104
|
-
// Map variants to universal sizes
|
|
105
|
-
return {
|
|
106
|
-
h1: platformTypography["4xl"],
|
|
107
|
-
h2: platformTypography["3xl"],
|
|
108
|
-
h3: platformTypography["2xl"],
|
|
109
|
-
h4: platformTypography["xl"],
|
|
110
|
-
h5: platformTypography["lg"],
|
|
111
|
-
h6: platformTypography["base"],
|
|
112
|
-
subtitle1: platformTypography.base,
|
|
113
|
-
subtitle2: platformTypography.sm,
|
|
114
|
-
body1: platformTypography.base,
|
|
115
|
-
body2: platformTypography.sm,
|
|
116
|
-
caption: platformTypography.xs,
|
|
117
|
-
overline: platformTypography.xs,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
// Text root primitive
|
|
122
|
-
exports.TextRoot = (0, react_1.forwardRef)(({ variant, size, weight, color, align, leading, tracking, transform, decoration, italic = false, opacity, style, inherit = true, reset = false, children, ...props }, ref) => {
|
|
123
|
-
const { theme } = (0, theme_1.useTheme)();
|
|
124
|
-
const parentContext = (0, react_1.useContext)(exports.TextContext);
|
|
125
|
-
// Get variant styles
|
|
126
|
-
const variantStyles = getVariantStyles();
|
|
127
|
-
// Calculate inherited values
|
|
128
|
-
const inheritedContext = inherit && !reset && parentContext ? parentContext : {};
|
|
129
|
-
// Calculate final styles
|
|
130
|
-
const finalStyles = {
|
|
131
|
-
// Start with inherited values
|
|
132
|
-
fontSize: inheritedContext.fontSize,
|
|
133
|
-
fontWeight: inheritedContext.fontWeight,
|
|
134
|
-
//color: inheritedContext.color,
|
|
135
|
-
fontFamily: inheritedContext.fontFamily,
|
|
136
|
-
lineHeight: inheritedContext.lineHeight,
|
|
137
|
-
textAlign: inheritedContext.textAlign,
|
|
138
|
-
letterSpacing: inheritedContext.letterSpacing,
|
|
139
|
-
textTransform: inheritedContext.textTransform,
|
|
140
|
-
textDecorationLine: inheritedContext.textDecorationLine,
|
|
141
|
-
fontStyle: inheritedContext.fontStyle,
|
|
142
|
-
opacity: inheritedContext.opacity,
|
|
143
|
-
// Apply variant styles (these may override inherited)
|
|
144
|
-
...(variant && variantStyles[variant]),
|
|
145
|
-
// Apply explicit prop styles (these should override inherited and variant)
|
|
146
|
-
// Apply size
|
|
147
|
-
...(size && {
|
|
148
|
-
fontSize: typeof size === "number" ? size : sizeMap[size],
|
|
149
|
-
}),
|
|
150
|
-
// Apply weight
|
|
151
|
-
...(weight && {
|
|
152
|
-
fontWeight: weightMap[weight],
|
|
153
|
-
}),
|
|
154
|
-
// Apply color
|
|
155
|
-
...(color
|
|
156
|
-
? {
|
|
157
|
-
color: color === "default"
|
|
158
|
-
? theme.colors.text
|
|
159
|
-
: color === "muted"
|
|
160
|
-
? theme.colors.textMuted
|
|
161
|
-
: color === "primary"
|
|
162
|
-
? theme.colors.primary
|
|
163
|
-
: color === "secondary"
|
|
164
|
-
? theme.colors.secondary
|
|
165
|
-
: color === "destructive"
|
|
166
|
-
? theme.colors.destructive
|
|
167
|
-
: color === "success"
|
|
168
|
-
? theme.colors.success
|
|
169
|
-
: color === "warning"
|
|
170
|
-
? theme.colors.warning
|
|
171
|
-
: color || inheritedContext.color, // Custom color string
|
|
172
|
-
}
|
|
173
|
-
: { color: inheritedContext.color || theme.colors.text }),
|
|
174
|
-
// Apply alignment
|
|
175
|
-
...(align && {
|
|
176
|
-
textAlign: align,
|
|
177
|
-
}),
|
|
178
|
-
// Apply line height
|
|
179
|
-
...(leading && {
|
|
180
|
-
lineHeight: typeof leading === "number" ? leading : leadingMap[leading],
|
|
181
|
-
}),
|
|
182
|
-
// Apply letter spacing
|
|
183
|
-
...(tracking && {
|
|
184
|
-
letterSpacing: typeof tracking === "number" ? tracking : trackingMap[tracking],
|
|
185
|
-
}),
|
|
186
|
-
// Apply text transform
|
|
187
|
-
...(transform &&
|
|
188
|
-
transform !== "none" && {
|
|
189
|
-
textTransform: transform,
|
|
190
|
-
}),
|
|
191
|
-
// Apply text decoration
|
|
192
|
-
...(decoration &&
|
|
193
|
-
decoration !== "none" && {
|
|
194
|
-
textDecorationLine: decoration,
|
|
195
|
-
}),
|
|
196
|
-
// Apply italic
|
|
197
|
-
...(italic && {
|
|
198
|
-
fontStyle: "italic",
|
|
199
|
-
}),
|
|
200
|
-
// Apply opacity
|
|
201
|
-
...(opacity !== undefined && {
|
|
202
|
-
opacity,
|
|
203
|
-
}),
|
|
204
|
-
};
|
|
205
|
-
finalStyles.color = finalStyles.color;
|
|
206
|
-
// Create context value for children
|
|
207
|
-
const contextValue = {
|
|
208
|
-
fontSize: typeof finalStyles.fontSize === "number"
|
|
209
|
-
? finalStyles.fontSize
|
|
210
|
-
: undefined,
|
|
211
|
-
fontWeight: finalStyles.fontWeight,
|
|
212
|
-
color: finalStyles.color || undefined,
|
|
213
|
-
fontFamily: typeof finalStyles.fontFamily === "string"
|
|
214
|
-
? finalStyles.fontFamily
|
|
215
|
-
: undefined,
|
|
216
|
-
lineHeight: typeof finalStyles.lineHeight === "number"
|
|
217
|
-
? finalStyles.lineHeight
|
|
218
|
-
: undefined,
|
|
219
|
-
textAlign: finalStyles.textAlign,
|
|
220
|
-
letterSpacing: finalStyles.letterSpacing,
|
|
221
|
-
textTransform: finalStyles.textTransform,
|
|
222
|
-
textDecorationLine: finalStyles.textDecorationLine,
|
|
223
|
-
fontStyle: finalStyles.fontStyle,
|
|
224
|
-
opacity: finalStyles.opacity,
|
|
225
|
-
};
|
|
226
|
-
return ((0, jsx_runtime_1.jsx)(exports.TextContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, style: [finalStyles, style], ...props, children: children }) }));
|
|
227
|
-
});
|
|
228
|
-
exports.TextRoot.displayName = "TextRoot";
|
|
229
|
-
// Text span primitive (inherits from parent but doesn't create new context)
|
|
230
|
-
exports.TextSpan = (0, react_1.forwardRef)(({ children, ...props }, ref) => {
|
|
231
|
-
return ((0, jsx_runtime_1.jsx)(exports.TextRoot, { ref: ref, inherit: true, ...props, children: children }));
|
|
232
|
-
});
|
|
233
|
-
exports.TextSpan.displayName = "TextSpan";
|
|
234
|
-
// Text block primitive (always creates new context)
|
|
235
|
-
exports.TextBlock = (0, react_1.forwardRef)(({ children, reset = true, ...props }, ref) => {
|
|
236
|
-
return ((0, jsx_runtime_1.jsx)(exports.TextRoot, { ref: ref, reset: reset, ...props, children: children }));
|
|
237
|
-
});
|
|
238
|
-
exports.TextBlock.displayName = "TextBlock";
|
|
239
|
-
// Hook to access current text context
|
|
240
|
-
function useTextContext() {
|
|
241
|
-
return (0, react_1.useContext)(exports.TextContext);
|
|
242
|
-
}
|
|
243
|
-
// Utility function to create text styles
|
|
244
|
-
function createTextStyle(props) {
|
|
245
|
-
// This is a utility function that can be used to generate styles
|
|
246
|
-
// without rendering a component
|
|
247
|
-
const style = {};
|
|
248
|
-
if (props.size) {
|
|
249
|
-
style.fontSize =
|
|
250
|
-
typeof props.size === "number" ? props.size : sizeMap[props.size];
|
|
251
|
-
}
|
|
252
|
-
if (props.weight) {
|
|
253
|
-
style.fontWeight = weightMap[props.weight];
|
|
254
|
-
}
|
|
255
|
-
if (props.align) {
|
|
256
|
-
style.textAlign = props.align;
|
|
257
|
-
}
|
|
258
|
-
if (props.leading) {
|
|
259
|
-
style.lineHeight =
|
|
260
|
-
typeof props.leading === "number"
|
|
261
|
-
? props.leading
|
|
262
|
-
: leadingMap[props.leading];
|
|
263
|
-
}
|
|
264
|
-
if (props.tracking) {
|
|
265
|
-
style.letterSpacing =
|
|
266
|
-
typeof props.tracking === "number"
|
|
267
|
-
? props.tracking
|
|
268
|
-
: trackingMap[props.tracking];
|
|
269
|
-
}
|
|
270
|
-
if (props.transform && props.transform !== "none") {
|
|
271
|
-
style.textTransform = props.transform;
|
|
272
|
-
}
|
|
273
|
-
if (props.decoration && props.decoration !== "none") {
|
|
274
|
-
style.textDecorationLine = props.decoration;
|
|
275
|
-
}
|
|
276
|
-
if (props.italic) {
|
|
277
|
-
style.fontStyle = "italic";
|
|
278
|
-
}
|
|
279
|
-
if (props.opacity !== undefined) {
|
|
280
|
-
style.opacity = props.opacity;
|
|
281
|
-
}
|
|
282
|
-
return style;
|
|
283
|
-
}
|
|
284
|
-
// Export primitive collection
|
|
285
|
-
exports.TextPrimitive = {
|
|
286
|
-
Root: exports.TextRoot,
|
|
287
|
-
Span: exports.TextSpan,
|
|
288
|
-
Block: exports.TextBlock,
|
|
289
|
-
Context: exports.TextContext,
|
|
290
|
-
useContext: useTextContext,
|
|
291
|
-
createStyle: createTextStyle,
|
|
292
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Resizable = Resizable;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const lucide_react_native_1 = require("lucide-react-native");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const react_native_1 = require("react-native");
|
|
9
|
-
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
10
|
-
const react_native_reanimated_1 = tslib_1.__importStar(require("react-native-reanimated"));
|
|
11
|
-
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
12
|
-
const hooks_1 = require("../../hooks");
|
|
13
|
-
const atoms_1 = require("../../lib/theme/atoms");
|
|
14
|
-
const view_1 = require("./view");
|
|
15
|
-
const AnimatedView = react_native_reanimated_1.default.createAnimatedComponent(view_1.View);
|
|
16
|
-
const { height: SCREEN_HEIGHT } = react_native_1.Dimensions.get("window");
|
|
17
|
-
const SPRING_CONFIG = { damping: 20, stiffness: 100 };
|
|
18
|
-
function Resizable({ startingPercentage, isPlayerRatioGreater, style = {}, children, }) {
|
|
19
|
-
const { slideKeyboard } = (0, hooks_1.useKeyboardSlide)();
|
|
20
|
-
const { bottom: safeBottom } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
21
|
-
const MAX_HEIGHT = (SCREEN_HEIGHT - safeBottom) * 0.5;
|
|
22
|
-
const MIN_HEIGHT = -(SCREEN_HEIGHT - safeBottom) * 0.2;
|
|
23
|
-
const COLLAPSE_HEIGHT = (SCREEN_HEIGHT - safeBottom) * 0.1;
|
|
24
|
-
const sheetHeight = (0, react_native_reanimated_1.useSharedValue)(MIN_HEIGHT);
|
|
25
|
-
const startHeight = (0, react_native_reanimated_1.useSharedValue)(MIN_HEIGHT);
|
|
26
|
-
(0, react_1.useEffect)(() => {
|
|
27
|
-
setTimeout(() => {
|
|
28
|
-
sheetHeight.value = (0, react_native_reanimated_1.withSpring)(startingPercentage ? startingPercentage * SCREEN_HEIGHT : MIN_HEIGHT, SPRING_CONFIG);
|
|
29
|
-
}, 1000);
|
|
30
|
-
}, []);
|
|
31
|
-
const panGesture = react_native_gesture_handler_1.Gesture.Pan()
|
|
32
|
-
.onStart(() => {
|
|
33
|
-
startHeight.value = sheetHeight.value;
|
|
34
|
-
})
|
|
35
|
-
.onUpdate((event) => {
|
|
36
|
-
let newHeight = startHeight.value - event.translationY;
|
|
37
|
-
if (newHeight > MAX_HEIGHT)
|
|
38
|
-
newHeight = MAX_HEIGHT;
|
|
39
|
-
if (newHeight < MIN_HEIGHT)
|
|
40
|
-
newHeight = MIN_HEIGHT;
|
|
41
|
-
sheetHeight.value = newHeight;
|
|
42
|
-
if (newHeight < COLLAPSE_HEIGHT) {
|
|
43
|
-
sheetHeight.value = (0, react_native_reanimated_1.withSpring)(MIN_HEIGHT, SPRING_CONFIG);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const animatedStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
47
|
-
height: sheetHeight.value < COLLAPSE_HEIGHT ? 0 : sheetHeight.value,
|
|
48
|
-
opacity: (0, react_native_reanimated_1.interpolate)(sheetHeight.value, [MIN_HEIGHT, COLLAPSE_HEIGHT], [0, 1], react_native_reanimated_1.Extrapolation.CLAMP),
|
|
49
|
-
transform: [
|
|
50
|
-
{
|
|
51
|
-
translateY: slideKeyboard +
|
|
52
|
-
Math.max(0, -sheetHeight.value) +
|
|
53
|
-
(slideKeyboard < 0 ? 0 : -safeBottom),
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
}));
|
|
57
|
-
const handleAnimatedStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
58
|
-
opacity: sheetHeight.value < COLLAPSE_HEIGHT ? 1 : 0,
|
|
59
|
-
transform: [
|
|
60
|
-
{
|
|
61
|
-
translateY: sheetHeight.value < COLLAPSE_HEIGHT ? 0 : (0, react_native_reanimated_1.withSpring)(20),
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
}));
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: [
|
|
66
|
-
handleAnimatedStyle,
|
|
67
|
-
atoms_1.layout.position.absolute,
|
|
68
|
-
atoms_1.bottom[4],
|
|
69
|
-
atoms_1.w.percent[100],
|
|
70
|
-
atoms_1.layout.flex.center,
|
|
71
|
-
atoms_1.zIndex[1],
|
|
72
|
-
], children: (0, jsx_runtime_1.jsx)(react_native_gesture_handler_1.Pressable, { onPress: () => {
|
|
73
|
-
sheetHeight.value =
|
|
74
|
-
sheetHeight.value === MIN_HEIGHT
|
|
75
|
-
? (0, react_native_reanimated_1.withSpring)(MAX_HEIGHT, SPRING_CONFIG)
|
|
76
|
-
: (0, react_native_reanimated_1.withSpring)(MIN_HEIGHT, SPRING_CONFIG);
|
|
77
|
-
}, children: (0, jsx_runtime_1.jsx)(view_1.View, { style: [
|
|
78
|
-
atoms_1.p[1],
|
|
79
|
-
{
|
|
80
|
-
borderRadius: 999,
|
|
81
|
-
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
82
|
-
overflow: "hidden",
|
|
83
|
-
},
|
|
84
|
-
], children: (0, jsx_runtime_1.jsx)(lucide_react_native_1.ChevronUp, { size: 32, color: "white", style: { marginBottom: 1, marginTop: -1 } }) }) }) }), (0, jsx_runtime_1.jsxs)(AnimatedView, { style: [
|
|
85
|
-
animatedStyle,
|
|
86
|
-
isPlayerRatioGreater
|
|
87
|
-
? atoms_1.layout.position.relative
|
|
88
|
-
: atoms_1.layout.position.absolute,
|
|
89
|
-
atoms_1.bottom[0],
|
|
90
|
-
atoms_1.zIndex[1],
|
|
91
|
-
atoms_1.w.percent[100],
|
|
92
|
-
{
|
|
93
|
-
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
94
|
-
overflow: "visible",
|
|
95
|
-
borderTopLeftRadius: 16,
|
|
96
|
-
borderTopRightRadius: 16,
|
|
97
|
-
minWidth: "100%",
|
|
98
|
-
},
|
|
99
|
-
style,
|
|
100
|
-
], children: [(0, jsx_runtime_1.jsx)(view_1.View, { style: [atoms_1.layout.flex.row, atoms_1.layout.flex.justifyCenter, atoms_1.h[2]], children: (0, jsx_runtime_1.jsx)(react_native_gesture_handler_1.GestureDetector, { gesture: panGesture, children: (0, jsx_runtime_1.jsx)(view_1.View
|
|
101
|
-
// Make the touch area much larger, but keep the visible handle small
|
|
102
|
-
, {
|
|
103
|
-
// Make the touch area much larger, but keep the visible handle small
|
|
104
|
-
style: {
|
|
105
|
-
height: 30, // Large touch area
|
|
106
|
-
width: 120, // Wide enough for thumbs
|
|
107
|
-
alignItems: "center",
|
|
108
|
-
justifyContent: "center",
|
|
109
|
-
//backgroundColor: "rgba(0,255,255,0.1)",
|
|
110
|
-
transform: [{ translateY: -30 }],
|
|
111
|
-
}, children: (0, jsx_runtime_1.jsx)(view_1.View, { style: [
|
|
112
|
-
atoms_1.w[32],
|
|
113
|
-
{
|
|
114
|
-
height: 6,
|
|
115
|
-
backgroundColor: "#eeeeee66",
|
|
116
|
-
borderRadius: 999,
|
|
117
|
-
transform: [{ translateY: 5 }],
|
|
118
|
-
},
|
|
119
|
-
] }) }) }) }), children] })] }));
|
|
120
|
-
}
|
|
121
|
-
Resizable.displayName = "ResizableChatSheet";
|