@streamplace/components 0.7.26 → 0.7.29
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/components/chat/chat-box.js +2 -2
- package/dist/components/chat/chat.js +1 -1
- package/dist/components/mobile-player/ui/autoplay-button.js +1 -0
- package/dist/components/mobile-player/ui/viewer-context-menu.js +1 -1
- package/dist/components/mobile-player/ui/viewer-loading-overlay.js +2 -2
- package/dist/components/mobile-player/use-webrtc.js +37 -1
- package/dist/components/mobile-player/video.native.js +10 -1
- package/dist/components/ui/button.js +107 -155
- package/dist/components/ui/dialog.js +83 -116
- package/dist/components/ui/dropdown.js +41 -18
- package/dist/components/ui/input.js +53 -128
- package/dist/components/ui/primitives/button.js +0 -2
- package/dist/components/ui/primitives/modal.js +2 -2
- package/dist/components/ui/primitives/text.js +48 -8
- package/dist/components/ui/text.js +37 -66
- package/dist/components/ui/toast.js +78 -40
- package/dist/components/ui/view.js +28 -41
- package/dist/crypto-polyfill.js +0 -0
- package/dist/crypto-polyfill.native.js +24 -0
- package/dist/index.js +1 -0
- package/dist/lib/theme/index.js +1 -2
- package/dist/lib/theme/theme.js +106 -54
- package/dist/lib/theme/tokens.js +94 -1
- package/dist/livestream-store/chat.js +0 -2
- package/dist/livestream-store/stream-key.js +1 -1
- package/dist/player-store/player-provider.js +10 -2
- package/dist/player-store/single-player-provider.js +1 -1
- package/dist/streamplace-store/stream.js +1 -1
- package/dist/ui/index.js +2 -3
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
- package/package.json +3 -2
- package/src/components/chat/chat-box.tsx +6 -3
- package/src/components/chat/chat.tsx +1 -0
- package/src/components/mobile-player/ui/autoplay-button.tsx +1 -0
- package/src/components/mobile-player/ui/viewer-context-menu.tsx +2 -2
- package/src/components/mobile-player/ui/viewer-loading-overlay.tsx +2 -2
- package/src/components/mobile-player/use-webrtc.tsx +41 -1
- package/src/components/mobile-player/video.native.tsx +19 -4
- package/src/components/ui/button.tsx +110 -172
- package/src/components/ui/dialog.tsx +96 -138
- package/src/components/ui/dropdown.tsx +60 -22
- package/src/components/ui/input.tsx +57 -144
- package/src/components/ui/primitives/button.tsx +0 -2
- package/src/components/ui/primitives/modal.tsx +0 -2
- package/src/components/ui/primitives/text.tsx +51 -8
- package/src/components/ui/text.tsx +42 -67
- package/src/components/ui/toast.tsx +108 -90
- package/src/components/ui/view.tsx +27 -41
- package/src/crypto-polyfill.native.tsx +24 -0
- package/src/crypto-polyfill.tsx +0 -0
- package/src/index.tsx +2 -0
- package/src/lib/theme/index.ts +0 -2
- package/src/lib/theme/theme.tsx +179 -72
- package/src/lib/theme/tokens.ts +97 -0
- package/src/livestream-store/chat.tsx +0 -3
- package/src/livestream-store/stream-key.tsx +1 -1
- package/src/player-store/player-provider.tsx +13 -1
- package/src/player-store/single-player-provider.tsx +1 -1
- package/src/streamplace-store/stream.tsx +1 -1
- package/src/ui/index.ts +0 -2
- package/tsconfig.tsbuildinfo +1 -1
package/dist/lib/theme/theme.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createThemeZero = exports.createThemeIcons = exports.createThemeColors = exports.darkTheme = exports.lightTheme = void 0;
|
|
4
4
|
exports.ThemeProvider = ThemeProvider;
|
|
5
5
|
exports.useTheme = useTheme;
|
|
6
6
|
exports.usePlatformTypography = usePlatformTypography;
|
|
@@ -11,44 +11,69 @@ const react_1 = require("react");
|
|
|
11
11
|
const react_native_1 = require("react-native");
|
|
12
12
|
const tokens_1 = require("./tokens");
|
|
13
13
|
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
14
|
+
const ui_1 = require("../../components/ui");
|
|
15
|
+
// Import pairify function for generating theme tokens
|
|
16
|
+
function pairify(obj, styleKeyPrefix) {
|
|
17
|
+
const result = {};
|
|
18
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
19
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
20
|
+
// For nested objects (like color scales), create another level
|
|
21
|
+
result[key] = {};
|
|
22
|
+
for (const [nestedKey, nestedValue] of Object.entries(value)) {
|
|
23
|
+
result[key][nestedKey] = { [styleKeyPrefix]: nestedValue };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
// For simple values, create the style object directly
|
|
28
|
+
result[key] = { [styleKeyPrefix]: value };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
14
33
|
// Create theme colors based on dark mode
|
|
15
|
-
const createThemeColors = (isDark) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
});
|
|
34
|
+
const createThemeColors = (isDark, lightTheme, darkTheme, colorTheme) => {
|
|
35
|
+
let baseColors;
|
|
36
|
+
if (isDark && darkTheme) {
|
|
37
|
+
// Use dark theme
|
|
38
|
+
baseColors = isColorPalette(darkTheme)
|
|
39
|
+
? generateThemeColorsFromPalette(darkTheme, true)
|
|
40
|
+
: darkTheme;
|
|
41
|
+
}
|
|
42
|
+
else if (!isDark && lightTheme) {
|
|
43
|
+
// Use light theme
|
|
44
|
+
baseColors = isColorPalette(lightTheme)
|
|
45
|
+
? generateThemeColorsFromPalette(lightTheme, false)
|
|
46
|
+
: lightTheme;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// Fall back to default gray theme
|
|
50
|
+
const defaultPalette = tokens_1.colors.neutral;
|
|
51
|
+
baseColors = generateThemeColorsFromPalette(defaultPalette, isDark);
|
|
52
|
+
}
|
|
53
|
+
// Merge with custom color overrides if provided
|
|
54
|
+
return {
|
|
55
|
+
...baseColors,
|
|
56
|
+
...colorTheme,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
43
59
|
exports.createThemeColors = createThemeColors;
|
|
44
|
-
// Create theme
|
|
45
|
-
const
|
|
60
|
+
// Create theme-aware zero tokens using pairify
|
|
61
|
+
const createThemeZero = (themeColors) => ({
|
|
62
|
+
// Theme-aware colors using pairify
|
|
63
|
+
bg: pairify(themeColors, "backgroundColor"),
|
|
64
|
+
text: pairify(themeColors, "color"),
|
|
65
|
+
border: {
|
|
66
|
+
...pairify(themeColors, "borderColor"),
|
|
67
|
+
default: { borderColor: themeColors.border },
|
|
68
|
+
},
|
|
69
|
+
// Static design tokens
|
|
46
70
|
shadow: {
|
|
47
71
|
sm: tokens_1.shadows.sm,
|
|
48
72
|
md: tokens_1.shadows.md,
|
|
49
73
|
lg: tokens_1.shadows.lg,
|
|
50
74
|
xl: tokens_1.shadows.xl,
|
|
51
75
|
},
|
|
76
|
+
// Common button styles
|
|
52
77
|
button: {
|
|
53
78
|
primary: {
|
|
54
79
|
backgroundColor: themeColors.primary,
|
|
@@ -69,17 +94,7 @@ const createThemeStyles = (themeColors) => ({
|
|
|
69
94
|
borderWidth: 0,
|
|
70
95
|
},
|
|
71
96
|
},
|
|
72
|
-
|
|
73
|
-
primary: {
|
|
74
|
-
color: themeColors.text,
|
|
75
|
-
},
|
|
76
|
-
muted: {
|
|
77
|
-
color: themeColors.textMuted,
|
|
78
|
-
},
|
|
79
|
-
disabled: {
|
|
80
|
-
color: themeColors.textDisabled,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
97
|
+
// Input styles
|
|
83
98
|
input: {
|
|
84
99
|
base: {
|
|
85
100
|
backgroundColor: themeColors.background,
|
|
@@ -99,6 +114,7 @@ const createThemeStyles = (themeColors) => ({
|
|
|
99
114
|
borderWidth: 2,
|
|
100
115
|
},
|
|
101
116
|
},
|
|
117
|
+
// Card styles
|
|
102
118
|
card: {
|
|
103
119
|
base: {
|
|
104
120
|
backgroundColor: themeColors.card,
|
|
@@ -107,7 +123,7 @@ const createThemeStyles = (themeColors) => ({
|
|
|
107
123
|
},
|
|
108
124
|
},
|
|
109
125
|
});
|
|
110
|
-
exports.
|
|
126
|
+
exports.createThemeZero = createThemeZero;
|
|
111
127
|
// Create theme icons based on colors
|
|
112
128
|
const createThemeIcons = (themeColors) => ({
|
|
113
129
|
color: {
|
|
@@ -129,8 +145,44 @@ const createThemeIcons = (themeColors) => ({
|
|
|
129
145
|
exports.createThemeIcons = createThemeIcons;
|
|
130
146
|
// Create the theme context
|
|
131
147
|
const ThemeContext = (0, react_1.createContext)(null);
|
|
148
|
+
// Helper function to check if input is a ColorPalette or Theme["colors"]
|
|
149
|
+
function isColorPalette(input) {
|
|
150
|
+
return "50" in input && "100" in input && "950" in input;
|
|
151
|
+
}
|
|
152
|
+
// Helper function to generate Theme["colors"] from ColorPalette
|
|
153
|
+
function generateThemeColorsFromPalette(palette, isDark) {
|
|
154
|
+
return {
|
|
155
|
+
background: isDark ? palette[950] : tokens_1.colors.white,
|
|
156
|
+
foreground: isDark ? palette[50] : palette[950],
|
|
157
|
+
card: isDark ? palette[900] : tokens_1.colors.white,
|
|
158
|
+
cardForeground: isDark ? palette[50] : palette[950],
|
|
159
|
+
popover: isDark ? palette[900] : tokens_1.colors.white,
|
|
160
|
+
popoverForeground: isDark ? palette[50] : palette[950],
|
|
161
|
+
primary: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemBlue : tokens_1.colors.primary[500],
|
|
162
|
+
primaryForeground: tokens_1.colors.white,
|
|
163
|
+
secondary: isDark ? palette[800] : palette[100],
|
|
164
|
+
secondaryForeground: isDark ? palette[50] : palette[900],
|
|
165
|
+
muted: isDark ? palette[800] : palette[100],
|
|
166
|
+
mutedForeground: isDark ? palette[400] : palette[500],
|
|
167
|
+
accent: isDark ? palette[800] : palette[100],
|
|
168
|
+
accentForeground: isDark ? palette[50] : palette[900],
|
|
169
|
+
destructive: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemRed : tokens_1.colors.destructive[500],
|
|
170
|
+
destructiveForeground: tokens_1.colors.white,
|
|
171
|
+
success: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemGreen : tokens_1.colors.success[500],
|
|
172
|
+
successForeground: tokens_1.colors.white,
|
|
173
|
+
warning: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemOrange : tokens_1.colors.warning[500],
|
|
174
|
+
warningForeground: tokens_1.colors.white,
|
|
175
|
+
border: isDark ? palette[500] + "30" : palette[200] + "30",
|
|
176
|
+
input: isDark ? palette[800] : palette[200],
|
|
177
|
+
ring: react_native_1.Platform.OS === "ios" ? tokens_1.colors.ios.systemBlue : tokens_1.colors.primary[500],
|
|
178
|
+
text: isDark ? palette[50] : palette[950],
|
|
179
|
+
textMuted: isDark ? palette[400] : palette[500],
|
|
180
|
+
textDisabled: isDark ? palette[600] : palette[400],
|
|
181
|
+
};
|
|
182
|
+
}
|
|
132
183
|
// Theme provider component
|
|
133
|
-
|
|
184
|
+
// Should be surrounded by SafeAreaProvider at the root
|
|
185
|
+
function ThemeProvider({ children, defaultTheme = "system", forcedTheme, colorTheme, lightTheme, darkTheme, }) {
|
|
134
186
|
const systemColorScheme = (0, react_native_1.useColorScheme)();
|
|
135
187
|
const [currentTheme, setCurrentTheme] = (0, react_1.useState)(defaultTheme);
|
|
136
188
|
// Determine if dark mode should be active
|
|
@@ -149,7 +201,7 @@ function ThemeProvider({ children, defaultTheme = "system", forcedTheme, }) {
|
|
|
149
201
|
}, [forcedTheme, currentTheme, systemColorScheme]);
|
|
150
202
|
// Create theme based on dark mode
|
|
151
203
|
const theme = (0, react_1.useMemo)(() => {
|
|
152
|
-
const themeColors = createThemeColors(isDark);
|
|
204
|
+
const themeColors = createThemeColors(isDark, lightTheme, darkTheme, colorTheme);
|
|
153
205
|
return {
|
|
154
206
|
colors: themeColors,
|
|
155
207
|
spacing: tokens_1.spacing,
|
|
@@ -159,10 +211,10 @@ function ThemeProvider({ children, defaultTheme = "system", forcedTheme, }) {
|
|
|
159
211
|
touchTargets: tokens_1.touchTargets,
|
|
160
212
|
animations: tokens_1.animations,
|
|
161
213
|
};
|
|
162
|
-
}, [isDark]);
|
|
163
|
-
// Create
|
|
164
|
-
const
|
|
165
|
-
return
|
|
214
|
+
}, [isDark, lightTheme, darkTheme, colorTheme]);
|
|
215
|
+
// Create theme-aware zero tokens
|
|
216
|
+
const zero = (0, react_1.useMemo)(() => {
|
|
217
|
+
return createThemeZero(theme.colors);
|
|
166
218
|
}, [theme.colors]);
|
|
167
219
|
// Create icon utilities
|
|
168
220
|
const icons = (0, react_1.useMemo)(() => {
|
|
@@ -187,7 +239,7 @@ function ThemeProvider({ children, defaultTheme = "system", forcedTheme, }) {
|
|
|
187
239
|
};
|
|
188
240
|
const value = (0, react_1.useMemo)(() => ({
|
|
189
241
|
theme,
|
|
190
|
-
|
|
242
|
+
zero,
|
|
191
243
|
icons,
|
|
192
244
|
isDark,
|
|
193
245
|
currentTheme: forcedTheme || currentTheme,
|
|
@@ -196,7 +248,7 @@ function ThemeProvider({ children, defaultTheme = "system", forcedTheme, }) {
|
|
|
196
248
|
toggleTheme,
|
|
197
249
|
}), [
|
|
198
250
|
theme,
|
|
199
|
-
|
|
251
|
+
zero,
|
|
200
252
|
icons,
|
|
201
253
|
isDark,
|
|
202
254
|
forcedTheme,
|
|
@@ -205,7 +257,7 @@ function ThemeProvider({ children, defaultTheme = "system", forcedTheme, }) {
|
|
|
205
257
|
setTheme,
|
|
206
258
|
toggleTheme,
|
|
207
259
|
]);
|
|
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, {})] }) }));
|
|
260
|
+
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, {}), (0, jsx_runtime_1.jsx)(ui_1.ToastProvider, {})] }) }));
|
|
209
261
|
}
|
|
210
262
|
// Hook to use theme
|
|
211
263
|
function useTheme() {
|
|
@@ -231,8 +283,8 @@ function usePlatformTypography() {
|
|
|
231
283
|
// Utility function to create theme-aware styles
|
|
232
284
|
function createThemedStyles(styleCreator) {
|
|
233
285
|
return function useThemedStyles() {
|
|
234
|
-
const { theme,
|
|
235
|
-
return (0, react_1.useMemo)(() => styleCreator(theme,
|
|
286
|
+
const { theme, zero, icons } = useTheme();
|
|
287
|
+
return (0, react_1.useMemo)(() => styleCreator(theme, zero, icons), [theme, zero, icons]);
|
|
236
288
|
};
|
|
237
289
|
}
|
|
238
290
|
// Create light and dark theme instances for external use
|
package/dist/lib/theme/tokens.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Inspired by shadcn/ui but adapted for React Native styling
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.breakpoints = exports.animations = exports.touchTargets = exports.shadows = exports.typography = exports.borderRadius = exports.spacing = exports.colors = void 0;
|
|
7
|
+
exports.breakpoints = exports.animations = exports.touchTargets = exports.shadows = exports.fontFamilies = exports.typography = exports.borderRadius = exports.spacing = exports.colors = void 0;
|
|
8
8
|
exports.colors = {
|
|
9
9
|
// Primary colors
|
|
10
10
|
primary: {
|
|
@@ -435,56 +435,67 @@ exports.typography = {
|
|
|
435
435
|
fontSize: 34,
|
|
436
436
|
lineHeight: 41,
|
|
437
437
|
fontWeight: "700",
|
|
438
|
+
fontFamily: "AtkinsonHyperlegibleNext-Bold",
|
|
438
439
|
},
|
|
439
440
|
title1: {
|
|
440
441
|
fontSize: 28,
|
|
441
442
|
lineHeight: 34,
|
|
442
443
|
fontWeight: "700",
|
|
444
|
+
fontFamily: "AtkinsonHyperlegibleNext-Bold",
|
|
443
445
|
},
|
|
444
446
|
title2: {
|
|
445
447
|
fontSize: 22,
|
|
446
448
|
lineHeight: 28,
|
|
447
449
|
fontWeight: "700",
|
|
450
|
+
fontFamily: "AtkinsonHyperlegibleNext-Bold",
|
|
448
451
|
},
|
|
449
452
|
title3: {
|
|
450
453
|
fontSize: 20,
|
|
451
454
|
lineHeight: 25,
|
|
452
455
|
fontWeight: "600",
|
|
456
|
+
fontFamily: "AtkinsonHyperlegibleNext-SemiBold",
|
|
453
457
|
},
|
|
454
458
|
headline: {
|
|
455
459
|
fontSize: 17,
|
|
456
460
|
lineHeight: 22,
|
|
457
461
|
fontWeight: "600",
|
|
462
|
+
fontFamily: "AtkinsonHyperlegibleNext-SemiBold",
|
|
458
463
|
},
|
|
459
464
|
body: {
|
|
460
465
|
fontSize: 17,
|
|
461
466
|
lineHeight: 22,
|
|
462
467
|
fontWeight: "400",
|
|
468
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
463
469
|
},
|
|
464
470
|
callout: {
|
|
465
471
|
fontSize: 16,
|
|
466
472
|
lineHeight: 21,
|
|
467
473
|
fontWeight: "400",
|
|
474
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
468
475
|
},
|
|
469
476
|
subhead: {
|
|
470
477
|
fontSize: 15,
|
|
471
478
|
lineHeight: 20,
|
|
472
479
|
fontWeight: "400",
|
|
480
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
473
481
|
},
|
|
474
482
|
footnote: {
|
|
475
483
|
fontSize: 13,
|
|
476
484
|
lineHeight: 18,
|
|
477
485
|
fontWeight: "400",
|
|
486
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
478
487
|
},
|
|
479
488
|
caption1: {
|
|
480
489
|
fontSize: 12,
|
|
481
490
|
lineHeight: 16,
|
|
482
491
|
fontWeight: "400",
|
|
492
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
483
493
|
},
|
|
484
494
|
caption2: {
|
|
485
495
|
fontSize: 11,
|
|
486
496
|
lineHeight: 13,
|
|
487
497
|
fontWeight: "400",
|
|
498
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
488
499
|
},
|
|
489
500
|
},
|
|
490
501
|
// Android Material typography
|
|
@@ -493,66 +504,79 @@ exports.typography = {
|
|
|
493
504
|
fontSize: 96,
|
|
494
505
|
lineHeight: 112,
|
|
495
506
|
fontWeight: "300",
|
|
507
|
+
fontFamily: "AtkinsonHyperlegibleNext-ExtraLight",
|
|
496
508
|
},
|
|
497
509
|
headline2: {
|
|
498
510
|
fontSize: 60,
|
|
499
511
|
lineHeight: 72,
|
|
500
512
|
fontWeight: "300",
|
|
513
|
+
fontFamily: "AtkinsonHyperlegibleNext-Light",
|
|
501
514
|
},
|
|
502
515
|
headline3: {
|
|
503
516
|
fontSize: 48,
|
|
504
517
|
lineHeight: 56,
|
|
505
518
|
fontWeight: "400",
|
|
519
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
506
520
|
},
|
|
507
521
|
headline4: {
|
|
508
522
|
fontSize: 34,
|
|
509
523
|
lineHeight: 42,
|
|
510
524
|
fontWeight: "400",
|
|
525
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
511
526
|
},
|
|
512
527
|
headline5: {
|
|
513
528
|
fontSize: 24,
|
|
514
529
|
lineHeight: 32,
|
|
515
530
|
fontWeight: "400",
|
|
531
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
516
532
|
},
|
|
517
533
|
headline6: {
|
|
518
534
|
fontSize: 20,
|
|
519
535
|
lineHeight: 28,
|
|
520
536
|
fontWeight: "500",
|
|
537
|
+
fontFamily: "AtkinsonHyperlegibleNext-Medium",
|
|
521
538
|
},
|
|
522
539
|
subtitle1: {
|
|
523
540
|
fontSize: 16,
|
|
524
541
|
lineHeight: 24,
|
|
525
542
|
fontWeight: "400",
|
|
543
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
526
544
|
},
|
|
527
545
|
subtitle2: {
|
|
528
546
|
fontSize: 14,
|
|
529
547
|
lineHeight: 22,
|
|
530
548
|
fontWeight: "500",
|
|
549
|
+
fontFamily: "AtkinsonHyperlegibleNext-Medium",
|
|
531
550
|
},
|
|
532
551
|
body1: {
|
|
533
552
|
fontSize: 16,
|
|
534
553
|
lineHeight: 24,
|
|
535
554
|
fontWeight: "400",
|
|
555
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
536
556
|
},
|
|
537
557
|
body2: {
|
|
538
558
|
fontSize: 14,
|
|
539
559
|
lineHeight: 20,
|
|
540
560
|
fontWeight: "400",
|
|
561
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
541
562
|
},
|
|
542
563
|
button: {
|
|
543
564
|
fontSize: 14,
|
|
544
565
|
lineHeight: 16,
|
|
545
566
|
fontWeight: "500",
|
|
567
|
+
fontFamily: "AtkinsonHyperlegibleNext-Medium",
|
|
546
568
|
},
|
|
547
569
|
caption: {
|
|
548
570
|
fontSize: 12,
|
|
549
571
|
lineHeight: 16,
|
|
550
572
|
fontWeight: "400",
|
|
573
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
551
574
|
},
|
|
552
575
|
overline: {
|
|
553
576
|
fontSize: 10,
|
|
554
577
|
lineHeight: 16,
|
|
555
578
|
fontWeight: "400",
|
|
579
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
556
580
|
},
|
|
557
581
|
},
|
|
558
582
|
// Universal typography scale
|
|
@@ -561,43 +585,112 @@ exports.typography = {
|
|
|
561
585
|
fontSize: 12,
|
|
562
586
|
lineHeight: 16,
|
|
563
587
|
fontWeight: "400",
|
|
588
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
564
589
|
},
|
|
565
590
|
sm: {
|
|
566
591
|
fontSize: 14,
|
|
567
592
|
lineHeight: 20,
|
|
568
593
|
fontWeight: "400",
|
|
594
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
569
595
|
},
|
|
570
596
|
base: {
|
|
571
597
|
fontSize: 16,
|
|
572
598
|
lineHeight: 24,
|
|
573
599
|
fontWeight: "400",
|
|
600
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
574
601
|
},
|
|
575
602
|
lg: {
|
|
576
603
|
fontSize: 18,
|
|
577
604
|
lineHeight: 28,
|
|
578
605
|
fontWeight: "400",
|
|
606
|
+
fontFamily: "AtkinsonHyperlegibleNext-Regular",
|
|
579
607
|
},
|
|
580
608
|
xl: {
|
|
581
609
|
fontSize: 20,
|
|
582
610
|
lineHeight: 28,
|
|
583
611
|
fontWeight: "500",
|
|
612
|
+
fontFamily: "AtkinsonHyperlegibleNext-Medium",
|
|
584
613
|
},
|
|
585
614
|
"2xl": {
|
|
586
615
|
fontSize: 24,
|
|
587
616
|
lineHeight: 32,
|
|
588
617
|
fontWeight: "600",
|
|
618
|
+
fontFamily: "AtkinsonHyperlegibleNext-SemiBold",
|
|
589
619
|
},
|
|
590
620
|
"3xl": {
|
|
591
621
|
fontSize: 30,
|
|
592
622
|
lineHeight: 36,
|
|
593
623
|
fontWeight: "700",
|
|
624
|
+
fontFamily: "AtkinsonHyperlegibleNext-Bold",
|
|
594
625
|
},
|
|
595
626
|
"4xl": {
|
|
596
627
|
fontSize: 36,
|
|
597
628
|
lineHeight: 40,
|
|
598
629
|
fontWeight: "700",
|
|
630
|
+
fontFamily: "AtkinsonHyperlegibleNext-ExtraBold",
|
|
599
631
|
},
|
|
600
632
|
},
|
|
633
|
+
// Monospace typography for code and technical content
|
|
634
|
+
mono: {
|
|
635
|
+
xs: {
|
|
636
|
+
fontSize: 11,
|
|
637
|
+
lineHeight: 16,
|
|
638
|
+
fontWeight: "400",
|
|
639
|
+
fontFamily: "AtkinsonHyperlegibleMono-Regular",
|
|
640
|
+
},
|
|
641
|
+
sm: {
|
|
642
|
+
fontSize: 13,
|
|
643
|
+
lineHeight: 18,
|
|
644
|
+
fontWeight: "400",
|
|
645
|
+
fontFamily: "AtkinsonHyperlegibleMono-Regular",
|
|
646
|
+
},
|
|
647
|
+
base: {
|
|
648
|
+
fontSize: 14,
|
|
649
|
+
lineHeight: 20,
|
|
650
|
+
fontWeight: "400",
|
|
651
|
+
fontFamily: "AtkinsonHyperlegibleMono-Regular",
|
|
652
|
+
},
|
|
653
|
+
lg: {
|
|
654
|
+
fontSize: 16,
|
|
655
|
+
lineHeight: 24,
|
|
656
|
+
fontWeight: "400",
|
|
657
|
+
fontFamily: "AtkinsonHyperlegibleMono-Regular",
|
|
658
|
+
},
|
|
659
|
+
xl: {
|
|
660
|
+
fontSize: 18,
|
|
661
|
+
lineHeight: 28,
|
|
662
|
+
fontWeight: "500",
|
|
663
|
+
fontFamily: "AtkinsonHyperlegibleMono-Medium",
|
|
664
|
+
},
|
|
665
|
+
"2xl": {
|
|
666
|
+
fontSize: 20,
|
|
667
|
+
lineHeight: 32,
|
|
668
|
+
fontWeight: "600",
|
|
669
|
+
fontFamily: "AtkinsonHyperlegibleMono-SemiBold",
|
|
670
|
+
},
|
|
671
|
+
"3xl": {
|
|
672
|
+
fontSize: 24,
|
|
673
|
+
lineHeight: 36,
|
|
674
|
+
fontWeight: "700",
|
|
675
|
+
fontFamily: "AtkinsonHyperlegibleMono-Bold",
|
|
676
|
+
},
|
|
677
|
+
},
|
|
678
|
+
};
|
|
679
|
+
// Font families available in the app
|
|
680
|
+
exports.fontFamilies = {
|
|
681
|
+
// Sans serif fonts
|
|
682
|
+
regular: "AtkinsonHyperlegibleNext-Regular",
|
|
683
|
+
light: "AtkinsonHyperlegibleNext-Light",
|
|
684
|
+
extraLight: "AtkinsonHyperlegibleNext-ExtraLight",
|
|
685
|
+
medium: "AtkinsonHyperlegibleNext-Medium",
|
|
686
|
+
semiBold: "AtkinsonHyperlegibleNext-SemiBold",
|
|
687
|
+
bold: "AtkinsonHyperlegibleNext-Bold",
|
|
688
|
+
extraBold: "AtkinsonHyperlegibleNext-ExtraBold",
|
|
689
|
+
// Monospace fonts
|
|
690
|
+
monoRegular: "AtkinsonHyperlegibleMono-Regular",
|
|
691
|
+
monoMedium: "AtkinsonHyperlegibleMono-Medium",
|
|
692
|
+
monoSemiBold: "AtkinsonHyperlegibleMono-SemiBold",
|
|
693
|
+
monoBold: "AtkinsonHyperlegibleMono-Bold",
|
|
601
694
|
};
|
|
602
695
|
exports.shadows = {
|
|
603
696
|
none: {
|
|
@@ -160,11 +160,9 @@ const reduceChatIncremental = (state, newMessages, blocks, hideUris = []) => {
|
|
|
160
160
|
const newAuthors = { ...state.authors };
|
|
161
161
|
let hasChanges = false;
|
|
162
162
|
const removedKeys = new Set();
|
|
163
|
-
console.log("newMessages", newMessages);
|
|
164
163
|
for (const msg of newMessages) {
|
|
165
164
|
if (msg.deleted) {
|
|
166
165
|
hasChanges = true;
|
|
167
|
-
console.log("deleted", msg.uri);
|
|
168
166
|
removedKeys.add(msg.uri);
|
|
169
167
|
}
|
|
170
168
|
}
|
|
@@ -81,7 +81,7 @@ const useStreamKey = () => {
|
|
|
81
81
|
setStreamKey(JSON.stringify(newKey));
|
|
82
82
|
setKey(newKey);
|
|
83
83
|
};
|
|
84
|
-
generateKey();
|
|
84
|
+
generateKey().catch((err) => setError(err.message));
|
|
85
85
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
86
|
}, [key, setStreamKey]);
|
|
87
87
|
return { streamKey: key, error };
|
|
@@ -3,10 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PlayerProvider = void 0;
|
|
4
4
|
exports.withPlayerProvider = withPlayerProvider;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const crypto_1 = require("crypto");
|
|
7
6
|
const react_1 = require("react");
|
|
8
7
|
const context_1 = require("./context");
|
|
9
8
|
const player_store_1 = require("./player-store");
|
|
9
|
+
function randomUUID() {
|
|
10
|
+
let dt = new Date().getTime();
|
|
11
|
+
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
12
|
+
var r = (dt + Math.random() * 16) % 16 | 0;
|
|
13
|
+
dt = Math.floor(dt / 16);
|
|
14
|
+
return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
|
|
15
|
+
});
|
|
16
|
+
return uuid;
|
|
17
|
+
}
|
|
10
18
|
const PlayerProvider = ({ children, initialPlayers = [], defaultId = Math.random().toString(36).slice(8), }) => {
|
|
11
19
|
const [players, setPlayers] = (0, react_1.useState)(() => {
|
|
12
20
|
// Initialize with any initial player IDs provided
|
|
@@ -21,7 +29,7 @@ const PlayerProvider = ({ children, initialPlayers = [], defaultId = Math.random
|
|
|
21
29
|
return initialPlayerStores;
|
|
22
30
|
});
|
|
23
31
|
const createPlayer = (0, react_1.useCallback)((id) => {
|
|
24
|
-
const playerId = id ||
|
|
32
|
+
const playerId = id || randomUUID();
|
|
25
33
|
const playerStore = (0, player_store_1.makePlayerStore)(playerId);
|
|
26
34
|
setPlayers((prev) => ({
|
|
27
35
|
...prev,
|
|
@@ -12,8 +12,8 @@ const tslib_1 = require("tslib");
|
|
|
12
12
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
13
13
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
14
14
|
const zustand_1 = require("zustand");
|
|
15
|
-
const player_store_1 = require("../player-store");
|
|
16
15
|
const player_state_1 = require("./player-state");
|
|
16
|
+
const player_store_1 = require("./player-store");
|
|
17
17
|
const SinglePlayerContext = (0, react_1.createContext)(null);
|
|
18
18
|
/**
|
|
19
19
|
* Provider component for a single player that creates a scoped context
|
|
@@ -111,7 +111,7 @@ function useCreateStreamRecord() {
|
|
|
111
111
|
}
|
|
112
112
|
// Use customUrl if provided, otherwise fall back to the store URL
|
|
113
113
|
const finalUrl = customUrl || url;
|
|
114
|
-
const u = new URL(
|
|
114
|
+
const u = new URL(url);
|
|
115
115
|
let thumbnail = undefined;
|
|
116
116
|
if (customThumbnail) {
|
|
117
117
|
try {
|
package/dist/ui/index.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* ZeroCSS provides a zero-config, atomic styling system optimized for React Native.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.atomsNS = exports.theme = exports.useTheme = exports.usePlatformTypography = exports.lightTheme = exports.darkTheme = exports.createThemedStyles = exports.
|
|
10
|
-
exports.utils =
|
|
9
|
+
exports.tokens = exports.atomsNS = exports.theme = exports.useTheme = exports.usePlatformTypography = exports.lightTheme = exports.darkTheme = exports.createThemedStyles = exports.createThemeIcons = exports.createThemeColors = exports.ThemeProvider = exports.responsiveValue = exports.platformStyle = exports.mergeStyles = exports.debounce = exports.typography = exports.spacing = exports.shadows = exports.colors = exports.breakpoints = exports.borderRadius = exports.w = exports.top = exports.text = exports.right = exports.r = exports.py = exports.px = exports.pt = exports.pr = exports.position = exports.pl = exports.pb = exports.p = exports.my = exports.mx = exports.mt = exports.mr = exports.ml = exports.mb = exports.m = exports.left = exports.layout = exports.h = exports.gap = exports.flex = exports.bottom = exports.borders = exports.bg = exports.atoms = void 0;
|
|
10
|
+
exports.utils = void 0;
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
12
|
// Export the most commonly used ZeroCSS utilities
|
|
13
13
|
var atoms_1 = require("../lib/theme/atoms");
|
|
@@ -66,7 +66,6 @@ var theme_1 = require("../lib/theme/theme");
|
|
|
66
66
|
Object.defineProperty(exports, "ThemeProvider", { enumerable: true, get: function () { return theme_1.ThemeProvider; } });
|
|
67
67
|
Object.defineProperty(exports, "createThemeColors", { enumerable: true, get: function () { return theme_1.createThemeColors; } });
|
|
68
68
|
Object.defineProperty(exports, "createThemeIcons", { enumerable: true, get: function () { return theme_1.createThemeIcons; } });
|
|
69
|
-
Object.defineProperty(exports, "createThemeStyles", { enumerable: true, get: function () { return theme_1.createThemeStyles; } });
|
|
70
69
|
Object.defineProperty(exports, "createThemedStyles", { enumerable: true, get: function () { return theme_1.createThemedStyles; } });
|
|
71
70
|
Object.defineProperty(exports, "darkTheme", { enumerable: true, get: function () { return theme_1.darkTheme; } });
|
|
72
71
|
Object.defineProperty(exports, "lightTheme", { enumerable: true, get: function () { return theme_1.lightTheme; } });
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamplace/components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.29",
|
|
4
4
|
"description": "Streamplace React (Native) Components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "src/index.tsx",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"author": "Streamplace",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"devDependencies": {
|
|
20
|
+
"@types/sdp-transform": "^2.15.0",
|
|
20
21
|
"tsup": "^8.5.0"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
"start": "tsc --watch --preserveWatchOutput",
|
|
54
55
|
"prepare": "tsc"
|
|
55
56
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "8dba54b751a4a48f125485ef8b0997428f6095cf"
|
|
57
58
|
}
|
|
@@ -421,7 +421,8 @@ export function ChatBox({
|
|
|
421
421
|
>
|
|
422
422
|
<Button
|
|
423
423
|
variant="secondary"
|
|
424
|
-
style={{ borderRadius: 16,
|
|
424
|
+
style={{ borderRadius: 16, maxWidth: 44, aspectRatio: 1 }}
|
|
425
|
+
aria-label="Insert Mention"
|
|
425
426
|
onPress={() => {
|
|
426
427
|
// if the last character is not @, add it
|
|
427
428
|
!message.endsWith("@") && setMessage(message + "@");
|
|
@@ -445,7 +446,8 @@ export function ChatBox({
|
|
|
445
446
|
>
|
|
446
447
|
<Button
|
|
447
448
|
variant="secondary"
|
|
448
|
-
|
|
449
|
+
aria-label="Insert Emoji"
|
|
450
|
+
style={{ borderRadius: 16, maxWidth: 44, aspectRatio: 1 }}
|
|
449
451
|
onPress={() => setShowEmojiSelector(!showEmojiSelector)}
|
|
450
452
|
>
|
|
451
453
|
<Text>{COOL_EMOJI_LIST[emojiIconIndex]}</Text>
|
|
@@ -454,7 +456,8 @@ export function ChatBox({
|
|
|
454
456
|
{!isPopout && (
|
|
455
457
|
<Button
|
|
456
458
|
variant="secondary"
|
|
457
|
-
|
|
459
|
+
aria-label="Popout Chat"
|
|
460
|
+
style={{ borderRadius: 16, maxWidth: 44, aspectRatio: 1 }}
|
|
458
461
|
onPress={() => {
|
|
459
462
|
if (!linfo) return;
|
|
460
463
|
const u = new URL(window.location.href);
|