@streamplace/components 0.7.18 → 0.7.21
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/dist/assets/emoji-data.json +19371 -0
- package/dist/components/chat/chat-box.js +319 -0
- package/dist/components/chat/chat-message.js +87 -0
- package/dist/components/chat/chat.js +150 -0
- package/dist/components/chat/emoji-suggestions.js +35 -0
- package/dist/components/chat/mention-suggestions.js +42 -0
- package/dist/components/chat/mod-view.js +112 -0
- package/dist/components/chat/system-message.js +19 -0
- package/dist/components/dashboard/chat-panel.js +38 -0
- package/dist/components/dashboard/header.js +80 -0
- package/dist/components/dashboard/index.js +14 -0
- package/dist/components/dashboard/information-widget.js +234 -0
- package/dist/components/dashboard/mod-actions.js +71 -0
- package/dist/components/dashboard/problems.js +74 -0
- package/dist/components/icons/bluesky-icon.js +9 -0
- package/dist/components/keep-awake.js +7 -0
- package/dist/components/keep-awake.native.js +16 -0
- package/dist/components/mobile-player/fullscreen.js +76 -0
- package/dist/components/mobile-player/fullscreen.native.js +141 -0
- package/dist/components/mobile-player/player.js +94 -0
- package/dist/components/mobile-player/props.js +2 -0
- package/dist/components/mobile-player/shared.js +54 -0
- package/dist/components/mobile-player/ui/autoplay-button.js +68 -0
- package/dist/components/mobile-player/ui/countdown.js +83 -0
- package/dist/components/mobile-player/ui/index.js +12 -0
- package/dist/components/mobile-player/ui/input.js +42 -0
- package/dist/components/mobile-player/ui/metrics.js +44 -0
- package/dist/components/mobile-player/ui/report-modal.js +90 -0
- package/dist/components/mobile-player/ui/streamer-context-menu.js +7 -0
- package/dist/components/mobile-player/ui/streamer-loading-overlay.js +104 -0
- package/dist/components/mobile-player/ui/viewer-context-menu.js +51 -0
- package/dist/components/mobile-player/ui/viewer-loading-overlay.js +49 -0
- package/dist/components/mobile-player/ui/viewers.js +23 -0
- package/dist/components/mobile-player/use-webrtc.js +243 -0
- package/dist/components/mobile-player/video-async.native.js +276 -0
- package/dist/components/mobile-player/video-retry.js +29 -0
- package/dist/components/mobile-player/video.js +475 -0
- package/dist/components/mobile-player/video.native.js +56 -0
- package/dist/components/mobile-player/webrtc-diagnostics.js +110 -0
- package/dist/components/mobile-player/webrtc-primitives.js +27 -0
- package/dist/components/mobile-player/webrtc-primitives.native.js +8 -0
- package/dist/components/share/sharesheet.js +91 -0
- package/dist/components/ui/button.js +223 -0
- package/dist/components/ui/dialog.js +206 -0
- package/dist/components/ui/dropdown.js +172 -0
- package/dist/components/ui/icons.js +25 -0
- package/dist/components/ui/index.js +34 -0
- package/dist/components/ui/info-box.js +31 -0
- package/dist/components/ui/info-row.js +23 -0
- package/dist/components/ui/input.js +205 -0
- package/dist/components/ui/loader.js +10 -0
- package/dist/components/ui/primitives/button.js +125 -0
- package/dist/components/ui/primitives/input.js +206 -0
- package/dist/components/ui/primitives/modal.js +206 -0
- package/dist/components/ui/primitives/text.js +292 -0
- package/dist/components/ui/resizeable.js +121 -0
- package/dist/components/ui/slider.js +5 -0
- package/dist/components/ui/text.js +177 -0
- package/dist/components/ui/textarea.js +19 -0
- package/dist/components/ui/toast.js +175 -0
- package/dist/components/ui/view.js +252 -0
- package/dist/hooks/index.js +14 -0
- package/dist/hooks/useAvatars.js +35 -0
- package/dist/hooks/useCameraToggle.js +12 -0
- package/dist/hooks/useKeyboard.js +36 -0
- package/dist/hooks/useKeyboardSlide.js +14 -0
- package/dist/hooks/useLivestreamInfo.js +69 -0
- package/dist/hooks/useOuterAndInnerDimensions.js +30 -0
- package/dist/hooks/usePlayerDimensions.js +22 -0
- package/dist/hooks/usePointerDevice.js +71 -0
- package/dist/hooks/useSegmentDimensions.js +17 -0
- package/dist/hooks/useSegmentTiming.js +65 -0
- package/dist/index.js +34 -0
- package/dist/lib/browser.js +35 -0
- package/dist/lib/facet.js +92 -0
- package/dist/lib/system-messages.js +101 -0
- package/dist/lib/theme/atoms.js +646 -0
- package/dist/lib/theme/atoms.types.js +6 -0
- package/dist/lib/theme/index.js +35 -0
- package/dist/lib/theme/theme.js +256 -0
- package/dist/lib/theme/tokens.js +659 -0
- package/dist/lib/utils.js +105 -0
- package/dist/livestream-provider/index.js +30 -0
- package/dist/livestream-provider/websocket.js +45 -0
- package/dist/livestream-store/chat.js +308 -0
- package/dist/livestream-store/context.js +5 -0
- package/dist/livestream-store/index.js +7 -0
- package/dist/livestream-store/livestream-state.js +2 -0
- package/dist/livestream-store/livestream-store.js +58 -0
- package/dist/livestream-store/problems.js +76 -0
- package/dist/livestream-store/stream-key.js +88 -0
- package/dist/livestream-store/websocket-consumer.js +94 -0
- package/dist/player-store/context.js +5 -0
- package/dist/player-store/index.js +9 -0
- package/dist/player-store/player-provider.js +58 -0
- package/dist/player-store/player-state.js +25 -0
- package/dist/player-store/player-store.js +201 -0
- package/dist/player-store/single-player-provider.js +121 -0
- package/dist/streamplace-provider/context.js +5 -0
- package/dist/streamplace-provider/index.js +20 -0
- package/dist/streamplace-provider/poller.js +49 -0
- package/dist/streamplace-provider/xrpc.js +0 -0
- package/dist/streamplace-store/block.js +65 -0
- package/dist/streamplace-store/index.js +6 -0
- package/dist/streamplace-store/stream.js +247 -0
- package/dist/streamplace-store/streamplace-store.js +47 -0
- package/dist/streamplace-store/user.js +52 -0
- package/dist/streamplace-store/xrpc.js +15 -0
- package/dist/ui/index.js +79 -0
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
- package/package.json +5 -4
- package/src/components/chat/chat-box.tsx +3 -0
- package/src/components/chat/mod-view.tsx +39 -5
- package/src/components/mobile-player/fullscreen.tsx +2 -0
- package/src/components/mobile-player/ui/autoplay-button.tsx +86 -0
- package/src/components/mobile-player/ui/index.ts +1 -0
- package/src/components/mobile-player/video.tsx +11 -1
- package/src/livestream-store/chat.tsx +22 -0
- package/src/player-store/player-provider.tsx +2 -1
- package/src/player-store/player-state.tsx +6 -0
- package/src/player-store/player-store.tsx +4 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createThemeStyles = exports.createThemeIcons = exports.createThemeColors = exports.darkTheme = exports.lightTheme = void 0;
|
|
4
|
+
exports.ThemeProvider = ThemeProvider;
|
|
5
|
+
exports.useTheme = useTheme;
|
|
6
|
+
exports.usePlatformTypography = usePlatformTypography;
|
|
7
|
+
exports.createThemedStyles = createThemedStyles;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const portal_1 = require("@rn-primitives/portal");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const react_native_1 = require("react-native");
|
|
12
|
+
const tokens_1 = require("./tokens");
|
|
13
|
+
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
14
|
+
// Create theme colors based on dark mode
|
|
15
|
+
const createThemeColors = (isDark) => ({
|
|
16
|
+
background: isDark ? tokens_1.colors.gray[950] : tokens_1.colors.white,
|
|
17
|
+
foreground: isDark ? tokens_1.colors.gray[50] : tokens_1.colors.gray[950],
|
|
18
|
+
card: isDark ? tokens_1.colors.gray[900] : tokens_1.colors.white,
|
|
19
|
+
cardForeground: isDark ? tokens_1.colors.gray[50] : tokens_1.colors.gray[950],
|
|
20
|
+
popover: isDark ? tokens_1.colors.gray[900] : tokens_1.colors.white,
|
|
21
|
+
popoverForeground: isDark ? tokens_1.colors.gray[50] : tokens_1.colors.gray[950],
|
|
22
|
+
primary: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemBlue : tokens_1.colors.primary[500],
|
|
23
|
+
primaryForeground: tokens_1.colors.white,
|
|
24
|
+
secondary: isDark ? tokens_1.colors.gray[800] : tokens_1.colors.gray[100],
|
|
25
|
+
secondaryForeground: isDark ? tokens_1.colors.gray[50] : tokens_1.colors.gray[900],
|
|
26
|
+
muted: isDark ? tokens_1.colors.gray[800] : tokens_1.colors.gray[100],
|
|
27
|
+
mutedForeground: isDark ? tokens_1.colors.gray[400] : tokens_1.colors.gray[500],
|
|
28
|
+
accent: isDark ? tokens_1.colors.gray[800] : tokens_1.colors.gray[100],
|
|
29
|
+
accentForeground: isDark ? tokens_1.colors.gray[50] : tokens_1.colors.gray[900],
|
|
30
|
+
destructive: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemRed : tokens_1.colors.destructive[500],
|
|
31
|
+
destructiveForeground: tokens_1.colors.white,
|
|
32
|
+
success: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemGreen : tokens_1.colors.success[500],
|
|
33
|
+
successForeground: tokens_1.colors.white,
|
|
34
|
+
warning: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemOrange : tokens_1.colors.warning[500],
|
|
35
|
+
warningForeground: tokens_1.colors.white,
|
|
36
|
+
border: isDark ? tokens_1.colors.gray[500] + "30" : tokens_1.colors.gray[200] + "30",
|
|
37
|
+
input: isDark ? tokens_1.colors.gray[800] : tokens_1.colors.gray[200],
|
|
38
|
+
ring: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemBlue : tokens_1.colors.primary[500],
|
|
39
|
+
text: isDark ? tokens_1.colors.gray[50] : tokens_1.colors.gray[950],
|
|
40
|
+
textMuted: isDark ? tokens_1.colors.gray[400] : tokens_1.colors.gray[500],
|
|
41
|
+
textDisabled: isDark ? tokens_1.colors.gray[600] : tokens_1.colors.gray[400],
|
|
42
|
+
});
|
|
43
|
+
exports.createThemeColors = createThemeColors;
|
|
44
|
+
// Create theme styles based on colors
|
|
45
|
+
const createThemeStyles = (themeColors) => ({
|
|
46
|
+
shadow: {
|
|
47
|
+
sm: tokens_1.shadows.sm,
|
|
48
|
+
md: tokens_1.shadows.md,
|
|
49
|
+
lg: tokens_1.shadows.lg,
|
|
50
|
+
xl: tokens_1.shadows.xl,
|
|
51
|
+
},
|
|
52
|
+
button: {
|
|
53
|
+
primary: {
|
|
54
|
+
backgroundColor: themeColors.primary,
|
|
55
|
+
borderWidth: 0,
|
|
56
|
+
...tokens_1.shadows.sm,
|
|
57
|
+
},
|
|
58
|
+
secondary: {
|
|
59
|
+
backgroundColor: themeColors.secondary,
|
|
60
|
+
borderWidth: 0,
|
|
61
|
+
},
|
|
62
|
+
outline: {
|
|
63
|
+
backgroundColor: "transparent",
|
|
64
|
+
borderWidth: 1,
|
|
65
|
+
borderColor: themeColors.border,
|
|
66
|
+
},
|
|
67
|
+
ghost: {
|
|
68
|
+
backgroundColor: "transparent",
|
|
69
|
+
borderWidth: 0,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
text: {
|
|
73
|
+
primary: {
|
|
74
|
+
color: themeColors.text,
|
|
75
|
+
},
|
|
76
|
+
muted: {
|
|
77
|
+
color: themeColors.textMuted,
|
|
78
|
+
},
|
|
79
|
+
disabled: {
|
|
80
|
+
color: themeColors.textDisabled,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
input: {
|
|
84
|
+
base: {
|
|
85
|
+
backgroundColor: themeColors.background,
|
|
86
|
+
borderWidth: 1,
|
|
87
|
+
borderColor: themeColors.border,
|
|
88
|
+
borderRadius: tokens_1.borderRadius.md,
|
|
89
|
+
paddingHorizontal: tokens_1.spacing[3],
|
|
90
|
+
paddingVertical: tokens_1.spacing[3],
|
|
91
|
+
minHeight: tokens_1.touchTargets.minimum,
|
|
92
|
+
},
|
|
93
|
+
focused: {
|
|
94
|
+
borderColor: themeColors.ring,
|
|
95
|
+
borderWidth: 2,
|
|
96
|
+
},
|
|
97
|
+
error: {
|
|
98
|
+
borderColor: themeColors.destructive,
|
|
99
|
+
borderWidth: 2,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
card: {
|
|
103
|
+
base: {
|
|
104
|
+
backgroundColor: themeColors.card,
|
|
105
|
+
borderRadius: tokens_1.borderRadius.lg,
|
|
106
|
+
...tokens_1.shadows.sm,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
exports.createThemeStyles = createThemeStyles;
|
|
111
|
+
// Create theme icons based on colors
|
|
112
|
+
const createThemeIcons = (themeColors) => ({
|
|
113
|
+
color: {
|
|
114
|
+
default: themeColors.text,
|
|
115
|
+
muted: themeColors.textMuted,
|
|
116
|
+
primary: themeColors.primary,
|
|
117
|
+
secondary: themeColors.secondary,
|
|
118
|
+
destructive: themeColors.destructive,
|
|
119
|
+
success: themeColors.success,
|
|
120
|
+
warning: themeColors.warning,
|
|
121
|
+
},
|
|
122
|
+
size: {
|
|
123
|
+
sm: 16,
|
|
124
|
+
md: 20,
|
|
125
|
+
lg: 24,
|
|
126
|
+
xl: 32,
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
exports.createThemeIcons = createThemeIcons;
|
|
130
|
+
// Create the theme context
|
|
131
|
+
const ThemeContext = (0, react_1.createContext)(null);
|
|
132
|
+
// Theme provider component
|
|
133
|
+
function ThemeProvider({ children, defaultTheme = "system", forcedTheme, }) {
|
|
134
|
+
const systemColorScheme = (0, react_native_1.useColorScheme)();
|
|
135
|
+
const [currentTheme, setCurrentTheme] = (0, react_1.useState)(defaultTheme);
|
|
136
|
+
// Determine if dark mode should be active
|
|
137
|
+
const isDark = (0, react_1.useMemo)(() => {
|
|
138
|
+
if (forcedTheme === "light")
|
|
139
|
+
return false;
|
|
140
|
+
if (forcedTheme === "dark")
|
|
141
|
+
return true;
|
|
142
|
+
if (currentTheme === "light")
|
|
143
|
+
return false;
|
|
144
|
+
if (currentTheme === "dark")
|
|
145
|
+
return true;
|
|
146
|
+
if (currentTheme === "system")
|
|
147
|
+
return systemColorScheme === "dark";
|
|
148
|
+
return systemColorScheme === "dark";
|
|
149
|
+
}, [forcedTheme, currentTheme, systemColorScheme]);
|
|
150
|
+
// Create theme based on dark mode
|
|
151
|
+
const theme = (0, react_1.useMemo)(() => {
|
|
152
|
+
const themeColors = createThemeColors(isDark);
|
|
153
|
+
return {
|
|
154
|
+
colors: themeColors,
|
|
155
|
+
spacing: tokens_1.spacing,
|
|
156
|
+
borderRadius: tokens_1.borderRadius,
|
|
157
|
+
typography: tokens_1.typography,
|
|
158
|
+
shadows: tokens_1.shadows,
|
|
159
|
+
touchTargets: tokens_1.touchTargets,
|
|
160
|
+
animations: tokens_1.animations,
|
|
161
|
+
};
|
|
162
|
+
}, [isDark]);
|
|
163
|
+
// Create utility styles
|
|
164
|
+
const styles = (0, react_1.useMemo)(() => {
|
|
165
|
+
return createThemeStyles(theme.colors);
|
|
166
|
+
}, [theme.colors]);
|
|
167
|
+
// Create icon utilities
|
|
168
|
+
const icons = (0, react_1.useMemo)(() => {
|
|
169
|
+
return createThemeIcons(theme.colors);
|
|
170
|
+
}, [theme.colors]);
|
|
171
|
+
// Theme controls
|
|
172
|
+
const setTheme = (newTheme) => {
|
|
173
|
+
if (!forcedTheme) {
|
|
174
|
+
setCurrentTheme(newTheme);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const toggleTheme = () => {
|
|
178
|
+
if (!forcedTheme) {
|
|
179
|
+
setCurrentTheme((prev) => {
|
|
180
|
+
if (prev === "light")
|
|
181
|
+
return "dark";
|
|
182
|
+
if (prev === "dark")
|
|
183
|
+
return "system";
|
|
184
|
+
return "light";
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const value = (0, react_1.useMemo)(() => ({
|
|
189
|
+
theme,
|
|
190
|
+
styles,
|
|
191
|
+
icons,
|
|
192
|
+
isDark,
|
|
193
|
+
currentTheme: forcedTheme || currentTheme,
|
|
194
|
+
systemTheme: systemColorScheme || "light",
|
|
195
|
+
setTheme,
|
|
196
|
+
toggleTheme,
|
|
197
|
+
}), [
|
|
198
|
+
theme,
|
|
199
|
+
styles,
|
|
200
|
+
icons,
|
|
201
|
+
isDark,
|
|
202
|
+
forcedTheme,
|
|
203
|
+
currentTheme,
|
|
204
|
+
systemColorScheme,
|
|
205
|
+
setTheme,
|
|
206
|
+
toggleTheme,
|
|
207
|
+
]);
|
|
208
|
+
return ((0, jsx_runtime_1.jsx)(ThemeContext.Provider, { value: value, children: (0, jsx_runtime_1.jsxs)(react_native_gesture_handler_1.GestureHandlerRootView, { children: [children, (0, jsx_runtime_1.jsx)(portal_1.PortalHost, {})] }) }));
|
|
209
|
+
}
|
|
210
|
+
// Hook to use theme
|
|
211
|
+
function useTheme() {
|
|
212
|
+
const context = (0, react_1.useContext)(ThemeContext);
|
|
213
|
+
if (!context) {
|
|
214
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
215
|
+
}
|
|
216
|
+
return context;
|
|
217
|
+
}
|
|
218
|
+
// Hook to get current platform's typography
|
|
219
|
+
function usePlatformTypography() {
|
|
220
|
+
const { theme } = useTheme();
|
|
221
|
+
return (0, react_1.useMemo)(() => {
|
|
222
|
+
if (react_native_1.Platform.OS === "ios") {
|
|
223
|
+
return theme.typography.ios;
|
|
224
|
+
}
|
|
225
|
+
else if (react_native_1.Platform.OS === "android") {
|
|
226
|
+
return theme.typography.android;
|
|
227
|
+
}
|
|
228
|
+
return theme.typography.universal;
|
|
229
|
+
}, [theme.typography]);
|
|
230
|
+
}
|
|
231
|
+
// Utility function to create theme-aware styles
|
|
232
|
+
function createThemedStyles(styleCreator) {
|
|
233
|
+
return function useThemedStyles() {
|
|
234
|
+
const { theme, styles, icons } = useTheme();
|
|
235
|
+
return (0, react_1.useMemo)(() => styleCreator(theme, styles, icons), [theme, styles, icons]);
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
// Create light and dark theme instances for external use
|
|
239
|
+
exports.lightTheme = {
|
|
240
|
+
colors: createThemeColors(false),
|
|
241
|
+
spacing: tokens_1.spacing,
|
|
242
|
+
borderRadius: tokens_1.borderRadius,
|
|
243
|
+
typography: tokens_1.typography,
|
|
244
|
+
shadows: tokens_1.shadows,
|
|
245
|
+
touchTargets: tokens_1.touchTargets,
|
|
246
|
+
animations: tokens_1.animations,
|
|
247
|
+
};
|
|
248
|
+
exports.darkTheme = {
|
|
249
|
+
colors: createThemeColors(true),
|
|
250
|
+
spacing: tokens_1.spacing,
|
|
251
|
+
borderRadius: tokens_1.borderRadius,
|
|
252
|
+
typography: tokens_1.typography,
|
|
253
|
+
shadows: tokens_1.shadows,
|
|
254
|
+
touchTargets: tokens_1.touchTargets,
|
|
255
|
+
animations: tokens_1.animations,
|
|
256
|
+
};
|