@streamplace/components 0.7.14 → 0.7.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/package.json +13 -15
  2. package/src/components/mobile-player/fullscreen.native.tsx +14 -3
  3. package/src/components/mobile-player/fullscreen.tsx +10 -2
  4. package/src/components/mobile-player/player.tsx +7 -1
  5. package/src/components/mobile-player/props.tsx +7 -0
  6. package/src/components/mobile-player/video-async.native.tsx +436 -0
  7. package/src/components/mobile-player/video.native.tsx +16 -406
  8. package/src/components/mobile-player/video.tsx +14 -3
  9. package/src/hooks/useLivestreamInfo.ts +6 -2
  10. package/src/lib/browser.ts +27 -0
  11. package/src/livestream-store/stream-key.tsx +1 -28
  12. package/src/streamplace-store/stream.tsx +52 -13
  13. package/dist/assets/emoji-data.json +0 -19371
  14. package/dist/components/chat/chat-box.js +0 -314
  15. package/dist/components/chat/chat-message.js +0 -87
  16. package/dist/components/chat/chat.js +0 -149
  17. package/dist/components/chat/emoji-suggestions.js +0 -35
  18. package/dist/components/chat/mention-suggestions.js +0 -42
  19. package/dist/components/chat/mod-view.js +0 -94
  20. package/dist/components/chat/system-message.js +0 -19
  21. package/dist/components/dashboard/chat-panel.js +0 -38
  22. package/dist/components/dashboard/header.js +0 -80
  23. package/dist/components/dashboard/index.js +0 -14
  24. package/dist/components/dashboard/information-widget.js +0 -234
  25. package/dist/components/dashboard/mod-actions.js +0 -71
  26. package/dist/components/dashboard/problems.js +0 -74
  27. package/dist/components/icons/bluesky-icon.js +0 -9
  28. package/dist/components/keep-awake.js +0 -7
  29. package/dist/components/keep-awake.native.js +0 -16
  30. package/dist/components/mobile-player/fullscreen.js +0 -74
  31. package/dist/components/mobile-player/fullscreen.native.js +0 -141
  32. package/dist/components/mobile-player/player.js +0 -94
  33. package/dist/components/mobile-player/props.js +0 -2
  34. package/dist/components/mobile-player/shared.js +0 -54
  35. package/dist/components/mobile-player/ui/countdown.js +0 -83
  36. package/dist/components/mobile-player/ui/index.js +0 -11
  37. package/dist/components/mobile-player/ui/input.js +0 -42
  38. package/dist/components/mobile-player/ui/metrics.js +0 -44
  39. package/dist/components/mobile-player/ui/report-modal.js +0 -90
  40. package/dist/components/mobile-player/ui/streamer-context-menu.js +0 -7
  41. package/dist/components/mobile-player/ui/streamer-loading-overlay.js +0 -104
  42. package/dist/components/mobile-player/ui/viewer-context-menu.js +0 -51
  43. package/dist/components/mobile-player/ui/viewer-loading-overlay.js +0 -49
  44. package/dist/components/mobile-player/ui/viewers.js +0 -23
  45. package/dist/components/mobile-player/use-webrtc.js +0 -243
  46. package/dist/components/mobile-player/video-retry.js +0 -29
  47. package/dist/components/mobile-player/video.js +0 -460
  48. package/dist/components/mobile-player/video.native.js +0 -276
  49. package/dist/components/mobile-player/webrtc-diagnostics.js +0 -110
  50. package/dist/components/mobile-player/webrtc-primitives.js +0 -27
  51. package/dist/components/mobile-player/webrtc-primitives.native.js +0 -8
  52. package/dist/components/share/sharesheet.js +0 -91
  53. package/dist/components/ui/button.js +0 -223
  54. package/dist/components/ui/dialog.js +0 -206
  55. package/dist/components/ui/dropdown.js +0 -172
  56. package/dist/components/ui/icons.js +0 -25
  57. package/dist/components/ui/index.js +0 -34
  58. package/dist/components/ui/info-box.js +0 -31
  59. package/dist/components/ui/info-row.js +0 -23
  60. package/dist/components/ui/input.js +0 -205
  61. package/dist/components/ui/loader.js +0 -10
  62. package/dist/components/ui/primitives/button.js +0 -125
  63. package/dist/components/ui/primitives/input.js +0 -206
  64. package/dist/components/ui/primitives/modal.js +0 -206
  65. package/dist/components/ui/primitives/text.js +0 -292
  66. package/dist/components/ui/resizeable.js +0 -121
  67. package/dist/components/ui/slider.js +0 -5
  68. package/dist/components/ui/text.js +0 -177
  69. package/dist/components/ui/textarea.js +0 -19
  70. package/dist/components/ui/toast.js +0 -175
  71. package/dist/components/ui/view.js +0 -252
  72. package/dist/hooks/index.js +0 -14
  73. package/dist/hooks/useAvatars.js +0 -35
  74. package/dist/hooks/useCameraToggle.js +0 -12
  75. package/dist/hooks/useKeyboard.js +0 -36
  76. package/dist/hooks/useKeyboardSlide.js +0 -14
  77. package/dist/hooks/useLivestreamInfo.js +0 -65
  78. package/dist/hooks/useOuterAndInnerDimensions.js +0 -30
  79. package/dist/hooks/usePlayerDimensions.js +0 -22
  80. package/dist/hooks/usePointerDevice.js +0 -71
  81. package/dist/hooks/useSegmentDimensions.js +0 -17
  82. package/dist/hooks/useSegmentTiming.js +0 -65
  83. package/dist/index.js +0 -34
  84. package/dist/lib/facet.js +0 -92
  85. package/dist/lib/system-messages.js +0 -101
  86. package/dist/lib/theme/atoms.js +0 -646
  87. package/dist/lib/theme/atoms.types.js +0 -6
  88. package/dist/lib/theme/index.js +0 -35
  89. package/dist/lib/theme/theme.js +0 -256
  90. package/dist/lib/theme/tokens.js +0 -659
  91. package/dist/lib/utils.js +0 -105
  92. package/dist/livestream-provider/index.js +0 -30
  93. package/dist/livestream-provider/websocket.js +0 -45
  94. package/dist/livestream-store/chat.js +0 -286
  95. package/dist/livestream-store/context.js +0 -5
  96. package/dist/livestream-store/index.js +0 -7
  97. package/dist/livestream-store/livestream-state.js +0 -2
  98. package/dist/livestream-store/livestream-store.js +0 -58
  99. package/dist/livestream-store/problems.js +0 -76
  100. package/dist/livestream-store/stream-key.js +0 -119
  101. package/dist/livestream-store/websocket-consumer.js +0 -94
  102. package/dist/player-store/context.js +0 -5
  103. package/dist/player-store/index.js +0 -9
  104. package/dist/player-store/player-provider.js +0 -57
  105. package/dist/player-store/player-state.js +0 -25
  106. package/dist/player-store/player-store.js +0 -199
  107. package/dist/player-store/single-player-provider.js +0 -121
  108. package/dist/streamplace-provider/context.js +0 -5
  109. package/dist/streamplace-provider/index.js +0 -20
  110. package/dist/streamplace-provider/poller.js +0 -49
  111. package/dist/streamplace-provider/xrpc.js +0 -0
  112. package/dist/streamplace-store/block.js +0 -65
  113. package/dist/streamplace-store/index.js +0 -6
  114. package/dist/streamplace-store/stream.js +0 -218
  115. package/dist/streamplace-store/streamplace-store.js +0 -47
  116. package/dist/streamplace-store/user.js +0 -52
  117. package/dist/streamplace-store/xrpc.js +0 -15
  118. package/dist/ui/index.js +0 -79
  119. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
  120. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/56540125 +0 -0
  121. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/67b1eb60 +0 -0
  122. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/7c275f90 +0 -0
  123. package/tsconfig.tsbuildinfo +0 -1
@@ -1,256 +0,0 @@
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
- };