@streamplace/components 0.7.0 → 0.7.2
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 +46 -43
- package/dist/components/chat/chat-message.js +36 -33
- package/dist/components/chat/chat.js +31 -27
- package/dist/components/chat/mention-suggestions.js +16 -13
- package/dist/components/chat/mod-view.js +20 -17
- package/dist/components/mobile-player/fullscreen.js +21 -17
- package/dist/components/mobile-player/fullscreen.native.js +39 -35
- package/dist/components/mobile-player/player.js +38 -32
- package/dist/components/mobile-player/props.js +2 -1
- package/dist/components/mobile-player/shared.js +16 -13
- package/dist/components/mobile-player/ui/countdown.js +23 -19
- package/dist/components/mobile-player/ui/index.js +9 -5
- package/dist/components/mobile-player/ui/input.js +16 -12
- package/dist/components/mobile-player/ui/metrics.js +20 -16
- package/dist/components/mobile-player/ui/streamer-context-menu.js +6 -3
- package/dist/components/mobile-player/ui/viewer-context-menu.js +19 -16
- package/dist/components/mobile-player/ui/viewers.js +23 -0
- package/dist/components/mobile-player/use-webrtc.js +29 -24
- package/dist/components/mobile-player/video.js +109 -99
- package/dist/components/mobile-player/video.native.js +108 -84
- package/dist/components/mobile-player/webrtc-diagnostics.js +9 -5
- package/dist/components/mobile-player/webrtc-primitives.js +8 -6
- package/dist/components/mobile-player/webrtc-primitives.native.js +8 -1
- package/dist/components/ui/button.js +26 -23
- package/dist/components/ui/dialog.js +43 -40
- package/dist/components/ui/dropdown.js +121 -116
- package/dist/components/ui/icons.js +8 -5
- package/dist/components/ui/index.js +27 -19
- package/dist/components/ui/input.js +31 -28
- package/dist/components/ui/loader.js +9 -6
- package/dist/components/ui/primitives/button.js +33 -29
- package/dist/components/ui/primitives/input.js +44 -40
- package/dist/components/ui/primitives/modal.js +45 -41
- package/dist/components/ui/primitives/text.js +35 -29
- package/dist/components/ui/resizeable.js +54 -43
- package/dist/components/ui/text.js +50 -48
- package/dist/components/ui/textarea.js +13 -11
- package/dist/components/ui/toast.js +26 -23
- package/dist/components/ui/view.js +41 -39
- package/dist/hooks/index.js +12 -8
- package/dist/hooks/useAvatars.js +11 -8
- package/dist/hooks/useCameraToggle.js +7 -4
- package/dist/hooks/useKeyboard.js +13 -10
- package/dist/hooks/useKeyboardSlide.js +8 -5
- package/dist/hooks/useLivestreamInfo.js +17 -14
- package/dist/hooks/useOuterAndInnerDimensions.js +9 -6
- package/dist/hooks/usePlayerDimensions.js +9 -6
- package/dist/hooks/useSegmentDimensions.js +17 -0
- package/dist/hooks/useSegmentTiming.js +13 -10
- package/dist/index.js +24 -15
- package/dist/lib/facet.js +5 -1
- package/dist/lib/theme/atoms.js +153 -148
- package/dist/lib/theme/atoms.types.js +2 -1
- package/dist/lib/theme/index.js +31 -5
- package/dist/lib/theme/theme.js +91 -83
- package/dist/lib/theme/tokens.js +15 -12
- package/dist/lib/utils.js +22 -11
- package/dist/livestream-provider/index.js +19 -14
- package/dist/livestream-provider/websocket.js +14 -10
- package/dist/livestream-store/chat.js +26 -19
- package/dist/livestream-store/context.js +5 -2
- package/dist/livestream-store/index.js +7 -4
- package/dist/livestream-store/livestream-state.js +2 -1
- package/dist/livestream-store/livestream-store.js +31 -18
- package/dist/livestream-store/stream-key.js +22 -18
- package/dist/livestream-store/websocket-consumer.js +18 -14
- package/dist/player-store/context.js +5 -2
- package/dist/player-store/index.js +8 -5
- package/dist/player-store/player-provider.js +20 -15
- package/dist/player-store/player-state.js +9 -6
- package/dist/player-store/player-store.js +32 -21
- package/dist/player-store/single-player-provider.js +35 -23
- package/dist/streamplace-provider/context.js +5 -2
- package/dist/streamplace-provider/index.js +14 -10
- package/dist/streamplace-provider/poller.js +20 -17
- package/dist/streamplace-store/block.js +6 -3
- package/dist/streamplace-store/index.js +6 -3
- package/dist/streamplace-store/stream.js +14 -10
- package/dist/streamplace-store/streamplace-store.js +23 -13
- package/dist/streamplace-store/user.js +19 -14
- package/dist/streamplace-store/xrpc.js +10 -7
- package/node-compile-cache/v22.15.0-x64-92db9086-0/37be0eec +0 -0
- package/node-compile-cache/v22.15.0-x64-92db9086-0/56540125 +0 -0
- package/node-compile-cache/{v22.15.0-x64-efe9a9df-0 → v22.15.0-x64-92db9086-0}/67b1eb60 +0 -0
- package/node-compile-cache/{v22.15.0-x64-efe9a9df-0 → v22.15.0-x64-92db9086-0}/7c275f90 +0 -0
- package/package.json +6 -7
- package/src/components/mobile-player/ui/index.ts +1 -0
- package/src/components/mobile-player/ui/viewer-context-menu.tsx +5 -4
- package/src/components/mobile-player/ui/viewers.tsx +32 -0
- package/src/components/mobile-player/video.native.tsx +50 -5
- package/src/components/ui/resizeable.tsx +15 -3
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useSegmentDimensions.tsx +18 -0
- package/tsconfig.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- 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
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
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");
|
|
12
17
|
const SPRING_CONFIG = { damping: 20, stiffness: 100 };
|
|
13
|
-
|
|
14
|
-
const { slideKeyboard } = useKeyboardSlide();
|
|
15
|
-
const { bottom: safeBottom } = useSafeAreaInsets();
|
|
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)();
|
|
16
21
|
const MAX_HEIGHT = (SCREEN_HEIGHT - safeBottom) * 0.5;
|
|
17
22
|
const MIN_HEIGHT = -(SCREEN_HEIGHT - safeBottom) * 0.2;
|
|
18
23
|
const COLLAPSE_HEIGHT = (SCREEN_HEIGHT - safeBottom) * 0.1;
|
|
19
|
-
const sheetHeight = useSharedValue(MIN_HEIGHT);
|
|
20
|
-
const startHeight = useSharedValue(MIN_HEIGHT);
|
|
21
|
-
|
|
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()
|
|
22
32
|
.onStart(() => {
|
|
23
33
|
startHeight.value = sheetHeight.value;
|
|
24
34
|
})
|
|
@@ -30,54 +40,55 @@ export function Resizable({ isPlayerRatioGreater, style = {}, children, }) {
|
|
|
30
40
|
newHeight = MIN_HEIGHT;
|
|
31
41
|
sheetHeight.value = newHeight;
|
|
32
42
|
if (newHeight < COLLAPSE_HEIGHT) {
|
|
33
|
-
sheetHeight.value = withSpring(MIN_HEIGHT, SPRING_CONFIG);
|
|
43
|
+
sheetHeight.value = (0, react_native_reanimated_1.withSpring)(MIN_HEIGHT, SPRING_CONFIG);
|
|
34
44
|
}
|
|
35
45
|
});
|
|
36
|
-
const animatedStyle = useAnimatedStyle(() => ({
|
|
46
|
+
const animatedStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
37
47
|
height: sheetHeight.value < COLLAPSE_HEIGHT ? 0 : sheetHeight.value,
|
|
38
|
-
opacity: interpolate(sheetHeight.value, [MIN_HEIGHT, COLLAPSE_HEIGHT], [0, 1], Extrapolation.CLAMP),
|
|
48
|
+
opacity: (0, react_native_reanimated_1.interpolate)(sheetHeight.value, [MIN_HEIGHT, COLLAPSE_HEIGHT], [0, 1], react_native_reanimated_1.Extrapolation.CLAMP),
|
|
39
49
|
transform: [
|
|
40
50
|
{
|
|
41
|
-
translateY: slideKeyboard
|
|
51
|
+
translateY: slideKeyboard +
|
|
52
|
+
Math.max(0, -sheetHeight.value) +
|
|
53
|
+
(slideKeyboard < 0 ? 0 : -safeBottom),
|
|
42
54
|
},
|
|
43
55
|
],
|
|
44
56
|
}));
|
|
45
|
-
const handleAnimatedStyle = useAnimatedStyle(() => ({
|
|
57
|
+
const handleAnimatedStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
46
58
|
opacity: sheetHeight.value < COLLAPSE_HEIGHT ? 1 : 0,
|
|
47
59
|
transform: [
|
|
48
60
|
{
|
|
49
|
-
translateY: sheetHeight.value < COLLAPSE_HEIGHT ? 0 : withSpring(20),
|
|
61
|
+
translateY: sheetHeight.value < COLLAPSE_HEIGHT ? 0 : (0, react_native_reanimated_1.withSpring)(20),
|
|
50
62
|
},
|
|
51
63
|
],
|
|
52
64
|
}));
|
|
53
|
-
return (
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: [
|
|
54
66
|
handleAnimatedStyle,
|
|
55
|
-
layout.position.absolute,
|
|
56
|
-
bottom[4],
|
|
57
|
-
w.percent[100],
|
|
58
|
-
layout.flex.center,
|
|
59
|
-
zIndex[1],
|
|
60
|
-
|
|
61
|
-
], children: _jsx(Pressable, { onPress: () => {
|
|
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: () => {
|
|
62
73
|
sheetHeight.value =
|
|
63
74
|
sheetHeight.value === MIN_HEIGHT
|
|
64
|
-
? withSpring(MAX_HEIGHT, SPRING_CONFIG)
|
|
65
|
-
: withSpring(MIN_HEIGHT, SPRING_CONFIG);
|
|
66
|
-
}, children:
|
|
67
|
-
p[1],
|
|
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],
|
|
68
79
|
{
|
|
69
80
|
borderRadius: 999,
|
|
70
81
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
71
82
|
overflow: "hidden",
|
|
72
83
|
},
|
|
73
|
-
], children:
|
|
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: [
|
|
74
85
|
animatedStyle,
|
|
75
86
|
isPlayerRatioGreater
|
|
76
|
-
? layout.position.relative
|
|
77
|
-
: layout.position.absolute,
|
|
78
|
-
bottom[0],
|
|
79
|
-
zIndex[1],
|
|
80
|
-
w.percent[100],
|
|
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],
|
|
81
92
|
{
|
|
82
93
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
83
94
|
overflow: "visible",
|
|
@@ -86,8 +97,8 @@ export function Resizable({ isPlayerRatioGreater, style = {}, children, }) {
|
|
|
86
97
|
minWidth: "100%",
|
|
87
98
|
},
|
|
88
99
|
style,
|
|
89
|
-
], children: [
|
|
90
|
-
w[32],
|
|
100
|
+
], children: [(0, jsx_runtime_1.jsx)(view_1.View, { style: [atoms_1.layout.flex.row, atoms_1.layout.flex.justifyCenter], children: (0, jsx_runtime_1.jsx)(react_native_gesture_handler_1.GestureDetector, { gesture: panGesture, children: (0, jsx_runtime_1.jsx)(view_1.View, { hitSlop: { top: 20, bottom: 20, left: 20, right: 20 }, style: [
|
|
101
|
+
atoms_1.w[32],
|
|
91
102
|
{
|
|
92
103
|
height: 6,
|
|
93
104
|
transform: [{ translateY: -10 }],
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextPrimitive = exports.textVariants = exports.Span = exports.Code = exports.Label = exports.Caption = exports.Body = exports.Subtitle = exports.Heading = exports.Text = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
7
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const atoms_1 = require("../../lib/theme/atoms");
|
|
10
|
+
const text_1 = require("./primitives/text");
|
|
11
|
+
Object.defineProperty(exports, "TextPrimitive", { enumerable: true, get: function () { return text_1.TextPrimitive; } });
|
|
7
12
|
// Text variants using class-variance-authority pattern
|
|
8
|
-
const textVariants = cva("", {
|
|
13
|
+
const textVariants = (0, class_variance_authority_1.cva)("", {
|
|
9
14
|
variants: {
|
|
10
15
|
variant: {
|
|
11
16
|
h1: "h1",
|
|
@@ -58,9 +63,10 @@ const textVariants = cva("", {
|
|
|
58
63
|
color: "default",
|
|
59
64
|
},
|
|
60
65
|
});
|
|
61
|
-
|
|
66
|
+
exports.textVariants = textVariants;
|
|
67
|
+
exports.Text = (0, react_1.forwardRef)(({ variant = undefined, size = undefined, weight = undefined, color = undefined, muted = false, bold = false, italic = false, underline = false, strikethrough = false, uppercase = false, lowercase = false, capitalize = false, center = false, right = false, justify = false, customColor, style, children, ...props }, ref) => {
|
|
62
68
|
// Create dynamic styles based on atoms
|
|
63
|
-
const styles =
|
|
69
|
+
const styles = react_1.default.useMemo(() => createStyles(), []);
|
|
64
70
|
// Override props based on convenience props
|
|
65
71
|
const finalColor = customColor ? customColor : muted ? "muted" : color;
|
|
66
72
|
const finalTransform = uppercase
|
|
@@ -87,89 +93,85 @@ export const Text = forwardRef(({ variant = undefined, size = undefined, weight
|
|
|
87
93
|
// Get variant-specific styles
|
|
88
94
|
const variantStyle = styles[`${variant}Style`] || {};
|
|
89
95
|
const styleArr = (Array.isArray(style) ? style : [style || undefined]).filter((s) => s !== undefined);
|
|
90
|
-
return (
|
|
96
|
+
return ((0, jsx_runtime_1.jsx)(text_1.TextPrimitive.Root, { ref: ref, variant: variant || "body1", size: size || "base", color: finalColor || "default", align: finalAlign, transform: finalTransform, decoration: finalDecoration, italic: italic, style: [variantStyle, ...styleArr], ...props, children: children }));
|
|
91
97
|
});
|
|
92
|
-
Text.displayName = "Text";
|
|
98
|
+
exports.Text.displayName = "Text";
|
|
93
99
|
// Convenience components for common text elements
|
|
94
|
-
|
|
95
|
-
Heading.displayName = "Heading";
|
|
96
|
-
|
|
97
|
-
Subtitle.displayName = "Subtitle";
|
|
98
|
-
|
|
99
|
-
Body.displayName = "Body";
|
|
100
|
-
|
|
101
|
-
Caption.displayName = "Caption";
|
|
102
|
-
|
|
103
|
-
Label.displayName = "Label";
|
|
104
|
-
|
|
105
|
-
const styles =
|
|
100
|
+
exports.Heading = (0, react_1.forwardRef)(({ level = 1, ...props }, ref) => ((0, jsx_runtime_1.jsx)(exports.Text, { ref: ref, variant: `h${level}`, ...props })));
|
|
101
|
+
exports.Heading.displayName = "Heading";
|
|
102
|
+
exports.Subtitle = (0, react_1.forwardRef)(({ level = 1, ...props }, ref) => ((0, jsx_runtime_1.jsx)(exports.Text, { ref: ref, variant: level === 1 ? "subtitle1" : "subtitle2", ...props })));
|
|
103
|
+
exports.Subtitle.displayName = "Subtitle";
|
|
104
|
+
exports.Body = (0, react_1.forwardRef)(({ level = 1, ...props }, ref) => ((0, jsx_runtime_1.jsx)(exports.Text, { ref: ref, variant: level === 1 ? "body1" : "body2", ...props })));
|
|
105
|
+
exports.Body.displayName = "Body";
|
|
106
|
+
exports.Caption = (0, react_1.forwardRef)((props, ref) => (0, jsx_runtime_1.jsx)(exports.Text, { ref: ref, variant: "caption", ...props }));
|
|
107
|
+
exports.Caption.displayName = "Caption";
|
|
108
|
+
exports.Label = (0, react_1.forwardRef)((props, ref) => ((0, jsx_runtime_1.jsx)(exports.Text, { ref: ref, variant: "subtitle1", weight: "medium", ...props })));
|
|
109
|
+
exports.Label.displayName = "Label";
|
|
110
|
+
exports.Code = (0, react_1.forwardRef)(({ style, ...props }, ref) => {
|
|
111
|
+
const styles = react_1.default.useMemo(() => createStyles(), []);
|
|
106
112
|
// if style is not an array, convert it to an array
|
|
107
113
|
const styleArr = (Array.isArray(style) ? style : [style || undefined]).filter((s) => s !== undefined);
|
|
108
|
-
return
|
|
114
|
+
return (0, jsx_runtime_1.jsx)(exports.Text, { ref: ref, style: [styles.codeStyle, ...styleArr], ...props });
|
|
109
115
|
});
|
|
110
|
-
Code.displayName = "Code";
|
|
116
|
+
exports.Code.displayName = "Code";
|
|
111
117
|
// Span component for inline text styling (inherits from parent)
|
|
112
|
-
|
|
113
|
-
Span.displayName = "Span";
|
|
118
|
+
exports.Span = (0, react_1.forwardRef)(({ children, ...props }, ref) => ((0, jsx_runtime_1.jsx)(text_1.TextPrimitive.Span, { ref: ref, ...props, children: children })));
|
|
119
|
+
exports.Span.displayName = "Span";
|
|
114
120
|
// Create atom-based styles
|
|
115
121
|
function createStyles() {
|
|
116
|
-
return StyleSheet.create({
|
|
122
|
+
return react_native_1.StyleSheet.create({
|
|
117
123
|
// Variant-specific styles
|
|
118
124
|
h1Style: {
|
|
119
|
-
marginBottom: spacing[4],
|
|
125
|
+
marginBottom: atoms_1.spacing[4],
|
|
120
126
|
},
|
|
121
127
|
h2Style: {
|
|
122
|
-
marginBottom: spacing[3],
|
|
128
|
+
marginBottom: atoms_1.spacing[3],
|
|
123
129
|
},
|
|
124
130
|
h3Style: {
|
|
125
|
-
marginBottom: spacing[3],
|
|
131
|
+
marginBottom: atoms_1.spacing[3],
|
|
126
132
|
},
|
|
127
133
|
h4Style: {
|
|
128
|
-
marginBottom: spacing[2],
|
|
134
|
+
marginBottom: atoms_1.spacing[2],
|
|
129
135
|
},
|
|
130
136
|
h5Style: {
|
|
131
|
-
marginBottom: spacing[2],
|
|
137
|
+
marginBottom: atoms_1.spacing[2],
|
|
132
138
|
},
|
|
133
139
|
h6Style: {
|
|
134
|
-
marginBottom: spacing[2],
|
|
140
|
+
marginBottom: atoms_1.spacing[2],
|
|
135
141
|
},
|
|
136
142
|
subtitle1Style: {
|
|
137
|
-
marginBottom: spacing[2],
|
|
143
|
+
marginBottom: atoms_1.spacing[2],
|
|
138
144
|
},
|
|
139
145
|
subtitle2Style: {
|
|
140
|
-
marginBottom: spacing[1],
|
|
146
|
+
marginBottom: atoms_1.spacing[1],
|
|
141
147
|
},
|
|
142
148
|
body1Style: {
|
|
143
|
-
marginBottom: spacing[3],
|
|
149
|
+
marginBottom: atoms_1.spacing[3],
|
|
144
150
|
},
|
|
145
151
|
body2Style: {
|
|
146
|
-
marginBottom: spacing[2],
|
|
152
|
+
marginBottom: atoms_1.spacing[2],
|
|
147
153
|
},
|
|
148
154
|
captionStyle: {
|
|
149
|
-
marginBottom: spacing[1],
|
|
155
|
+
marginBottom: atoms_1.spacing[1],
|
|
150
156
|
},
|
|
151
157
|
overlineStyle: {
|
|
152
|
-
marginBottom: spacing[1],
|
|
158
|
+
marginBottom: atoms_1.spacing[1],
|
|
153
159
|
textTransform: "uppercase",
|
|
154
160
|
letterSpacing: 1,
|
|
155
161
|
},
|
|
156
162
|
labelStyle: {
|
|
157
|
-
marginBottom: spacing[1],
|
|
163
|
+
marginBottom: atoms_1.spacing[1],
|
|
158
164
|
},
|
|
159
165
|
buttonStyle: {
|
|
160
166
|
textAlign: "center",
|
|
161
167
|
},
|
|
162
168
|
codeStyle: {
|
|
163
169
|
fontFamily: "monospace",
|
|
164
|
-
backgroundColor: colors["muted"],
|
|
165
|
-
paddingHorizontal: spacing[1],
|
|
170
|
+
backgroundColor: atoms_1.colors["muted"],
|
|
171
|
+
paddingHorizontal: atoms_1.spacing[1],
|
|
166
172
|
paddingVertical: 2,
|
|
167
|
-
borderRadius:
|
|
173
|
+
borderRadius: atoms_1.borderRadius.sm,
|
|
168
174
|
fontSize: 14,
|
|
169
175
|
},
|
|
170
176
|
});
|
|
171
177
|
}
|
|
172
|
-
// Export text variants for external use
|
|
173
|
-
export { textVariants };
|
|
174
|
-
// Re-export primitive components for advanced usage
|
|
175
|
-
export { TextPrimitive };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Textarea = Textarea;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const atoms_1 = require("../../lib/theme/atoms");
|
|
4
7
|
function Textarea({ style, multiline = true, numberOfLines = 4, ...props }) {
|
|
5
|
-
return (
|
|
6
|
-
flex.values[1],
|
|
7
|
-
borders.width.thin,
|
|
8
|
-
borders.color.gray[400],
|
|
9
|
-
bg.gray[900],
|
|
10
|
-
p[3],
|
|
11
|
-
text.gray[200],
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { style: [
|
|
9
|
+
atoms_1.flex.values[1],
|
|
10
|
+
atoms_1.borders.width.thin,
|
|
11
|
+
atoms_1.borders.color.gray[400],
|
|
12
|
+
atoms_1.bg.gray[900],
|
|
13
|
+
atoms_1.p[3],
|
|
14
|
+
atoms_1.text.gray[200],
|
|
12
15
|
props.editable === false && { opacity: 0.5 },
|
|
13
16
|
{ borderRadius: 10 },
|
|
14
17
|
style,
|
|
15
18
|
], multiline: multiline, numberOfLines: numberOfLines, textAlignVertical: "top", ...props }));
|
|
16
19
|
}
|
|
17
|
-
export { Textarea };
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const [
|
|
12
|
-
const
|
|
13
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Toast = Toast;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const portal_1 = require("@rn-primitives/portal");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
9
|
+
const theme_1 = require("../../lib/theme/theme");
|
|
10
|
+
function Toast({ open, onOpenChange, title, description, actionLabel = "Action", onAction, duration = 3, }) {
|
|
11
|
+
const [seconds, setSeconds] = (0, react_1.useState)(duration);
|
|
12
|
+
const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
13
|
+
const { theme } = (0, theme_1.useTheme)();
|
|
14
|
+
const [fadeAnim] = (0, react_1.useState)(new react_native_1.Animated.Value(0));
|
|
15
|
+
const { width } = (0, react_native_1.useWindowDimensions)();
|
|
16
|
+
const isWeb = react_native_1.Platform.OS === "web";
|
|
14
17
|
const isDesktop = isWeb && width >= 768;
|
|
15
18
|
const containerPosition = isDesktop
|
|
16
19
|
? {
|
|
@@ -30,11 +33,11 @@ export function Toast({ open, onOpenChange, title, description, actionLabel = "A
|
|
|
30
33
|
width: "100%",
|
|
31
34
|
maxWidth: undefined,
|
|
32
35
|
};
|
|
33
|
-
useEffect(() => {
|
|
36
|
+
(0, react_1.useEffect)(() => {
|
|
34
37
|
let interval = null;
|
|
35
38
|
if (open) {
|
|
36
39
|
setSeconds(duration);
|
|
37
|
-
Animated.timing(fadeAnim, {
|
|
40
|
+
react_native_1.Animated.timing(fadeAnim, {
|
|
38
41
|
toValue: 1,
|
|
39
42
|
duration: 200,
|
|
40
43
|
useNativeDriver: true,
|
|
@@ -54,7 +57,7 @@ export function Toast({ open, onOpenChange, title, description, actionLabel = "A
|
|
|
54
57
|
else {
|
|
55
58
|
if (interval)
|
|
56
59
|
clearInterval(interval);
|
|
57
|
-
Animated.timing(fadeAnim, {
|
|
60
|
+
react_native_1.Animated.timing(fadeAnim, {
|
|
58
61
|
toValue: 0,
|
|
59
62
|
duration: 150,
|
|
60
63
|
useNativeDriver: true,
|
|
@@ -69,7 +72,7 @@ export function Toast({ open, onOpenChange, title, description, actionLabel = "A
|
|
|
69
72
|
}, [open, duration]);
|
|
70
73
|
if (!open)
|
|
71
74
|
return null;
|
|
72
|
-
return (
|
|
75
|
+
return ((0, jsx_runtime_1.jsx)(portal_1.Portal, { name: "toast", children: (0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [styles.container, containerPosition, { opacity: fadeAnim }], pointerEvents: "box-none", children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
73
76
|
styles.toast,
|
|
74
77
|
{
|
|
75
78
|
backgroundColor: theme.colors.secondary,
|
|
@@ -81,34 +84,34 @@ export function Toast({ open, onOpenChange, title, description, actionLabel = "A
|
|
|
81
84
|
padding: theme.spacing[4],
|
|
82
85
|
width: isDesktop ? "100%" : "95%",
|
|
83
86
|
},
|
|
84
|
-
], children: [
|
|
87
|
+
], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { gap: theme.spacing[1], width: "100%" }, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [
|
|
85
88
|
{
|
|
86
89
|
color: theme.colors.foreground,
|
|
87
90
|
fontSize: 16,
|
|
88
91
|
fontWeight: "500",
|
|
89
92
|
},
|
|
90
|
-
], children: title }), description ? (
|
|
93
|
+
], children: title }), description ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [{ color: theme.colors.foreground, fontSize: 14 }], children: description })) : null] }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
|
91
94
|
gap: theme.spacing[1],
|
|
92
95
|
flexDirection: "row",
|
|
93
96
|
justifyContent: "flex-end",
|
|
94
97
|
width: "100%",
|
|
95
|
-
}, children: [onAction && (
|
|
98
|
+
}, children: [onAction && ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { style: [
|
|
96
99
|
styles.button,
|
|
97
100
|
{
|
|
98
101
|
borderColor: theme.colors.primary,
|
|
99
102
|
paddingHorizontal: theme.spacing[4],
|
|
100
103
|
paddingVertical: theme.spacing[2],
|
|
101
104
|
},
|
|
102
|
-
], onPress: onAction, children:
|
|
105
|
+
], onPress: onAction, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: theme.colors.foreground }, children: actionLabel }) })), (0, jsx_runtime_1.jsx)(react_native_1.Pressable, { style: [
|
|
103
106
|
styles.button,
|
|
104
107
|
{
|
|
105
108
|
borderColor: theme.colors.primary,
|
|
106
109
|
paddingHorizontal: theme.spacing[4],
|
|
107
110
|
paddingVertical: theme.spacing[2],
|
|
108
111
|
},
|
|
109
|
-
], onPress: () => onOpenChange(false), children:
|
|
112
|
+
], onPress: () => onOpenChange(false), children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: theme.colors.foreground }, children: "Close" }) })] })] }) }) }));
|
|
110
113
|
}
|
|
111
|
-
const styles = StyleSheet.create({
|
|
114
|
+
const styles = react_native_1.StyleSheet.create({
|
|
112
115
|
container: {
|
|
113
116
|
position: "absolute",
|
|
114
117
|
zIndex: 1000,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.viewVariants = exports.Center = exports.Column = exports.Row = exports.Overlay = exports.Surface = exports.Container = exports.Card = exports.View = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const atoms_1 = require("../../lib/theme/atoms");
|
|
9
|
+
const theme_1 = require("../../lib/theme/theme");
|
|
7
10
|
// View variants using class-variance-authority pattern
|
|
8
|
-
const viewVariants = cva("", {
|
|
11
|
+
const viewVariants = (0, class_variance_authority_1.cva)("", {
|
|
9
12
|
variants: {
|
|
10
13
|
variant: {
|
|
11
14
|
default: "default",
|
|
@@ -67,15 +70,16 @@ const viewVariants = cva("", {
|
|
|
67
70
|
flex: "none",
|
|
68
71
|
},
|
|
69
72
|
});
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
exports.viewVariants = viewVariants;
|
|
74
|
+
exports.View = (0, react_1.forwardRef)(({ variant = "default", padding = "none", margin = "none", direction = "column", align = "stretch", justify = "start", flex = "none", fullWidth = false, fullHeight = false, centered = false, backgroundColor, borderColor, borderWidth, borderRadius, shadow = false, style, ...props }, ref) => {
|
|
75
|
+
const { theme } = (0, theme_1.useTheme)();
|
|
72
76
|
// Map variant to styles
|
|
73
77
|
const variantStyles = (() => {
|
|
74
78
|
switch (variant) {
|
|
75
79
|
case "card":
|
|
76
80
|
return {
|
|
77
81
|
backgroundColor: theme.colors.card,
|
|
78
|
-
borderRadius:
|
|
82
|
+
borderRadius: atoms_1.borderRadius.lg,
|
|
79
83
|
shadowColor: "#000",
|
|
80
84
|
shadowOffset: { width: 0, height: 2 },
|
|
81
85
|
shadowOpacity: 0.1,
|
|
@@ -93,7 +97,7 @@ export const View = forwardRef(({ variant = "default", padding = "none", margin
|
|
|
93
97
|
case "container":
|
|
94
98
|
return {
|
|
95
99
|
backgroundColor: theme.colors.background,
|
|
96
|
-
padding: spacing[4],
|
|
100
|
+
padding: atoms_1.spacing[4],
|
|
97
101
|
};
|
|
98
102
|
default:
|
|
99
103
|
return {};
|
|
@@ -103,15 +107,15 @@ export const View = forwardRef(({ variant = "default", padding = "none", margin
|
|
|
103
107
|
const paddingValue = (() => {
|
|
104
108
|
switch (padding) {
|
|
105
109
|
case "xs":
|
|
106
|
-
return spacing[1];
|
|
110
|
+
return atoms_1.spacing[1];
|
|
107
111
|
case "sm":
|
|
108
|
-
return spacing[2];
|
|
112
|
+
return atoms_1.spacing[2];
|
|
109
113
|
case "md":
|
|
110
|
-
return spacing[3];
|
|
114
|
+
return atoms_1.spacing[3];
|
|
111
115
|
case "lg":
|
|
112
|
-
return spacing[4];
|
|
116
|
+
return atoms_1.spacing[4];
|
|
113
117
|
case "xl":
|
|
114
|
-
return spacing[5];
|
|
118
|
+
return atoms_1.spacing[5];
|
|
115
119
|
default:
|
|
116
120
|
return undefined;
|
|
117
121
|
}
|
|
@@ -120,15 +124,15 @@ export const View = forwardRef(({ variant = "default", padding = "none", margin
|
|
|
120
124
|
const marginValue = (() => {
|
|
121
125
|
switch (margin) {
|
|
122
126
|
case "xs":
|
|
123
|
-
return spacing[1];
|
|
127
|
+
return atoms_1.spacing[1];
|
|
124
128
|
case "sm":
|
|
125
|
-
return spacing[2];
|
|
129
|
+
return atoms_1.spacing[2];
|
|
126
130
|
case "md":
|
|
127
|
-
return spacing[3];
|
|
131
|
+
return atoms_1.spacing[3];
|
|
128
132
|
case "lg":
|
|
129
|
-
return spacing[4];
|
|
133
|
+
return atoms_1.spacing[4];
|
|
130
134
|
case "xl":
|
|
131
|
-
return spacing[5];
|
|
135
|
+
return atoms_1.spacing[5];
|
|
132
136
|
default:
|
|
133
137
|
return undefined;
|
|
134
138
|
}
|
|
@@ -228,23 +232,21 @@ export const View = forwardRef(({ variant = "default", padding = "none", margin
|
|
|
228
232
|
const finalStyle = Array.isArray(style)
|
|
229
233
|
? [computedStyle, ...style]
|
|
230
234
|
: [computedStyle, style];
|
|
231
|
-
return
|
|
235
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: finalStyle, ...props });
|
|
232
236
|
});
|
|
233
|
-
View.displayName = "View";
|
|
237
|
+
exports.View.displayName = "View";
|
|
234
238
|
// Convenience components
|
|
235
|
-
|
|
236
|
-
Card.displayName = "Card";
|
|
237
|
-
|
|
238
|
-
Container.displayName = "Container";
|
|
239
|
-
|
|
240
|
-
Surface.displayName = "Surface";
|
|
241
|
-
|
|
242
|
-
Overlay.displayName = "Overlay";
|
|
243
|
-
|
|
244
|
-
Row.displayName = "Row";
|
|
245
|
-
|
|
246
|
-
Column.displayName = "Column";
|
|
247
|
-
|
|
248
|
-
Center.displayName = "Center";
|
|
249
|
-
// Export view variants for external use
|
|
250
|
-
export { viewVariants };
|
|
239
|
+
exports.Card = (0, react_1.forwardRef)((props, ref) => (0, jsx_runtime_1.jsx)(exports.View, { ref: ref, variant: "card", ...props }));
|
|
240
|
+
exports.Card.displayName = "Card";
|
|
241
|
+
exports.Container = (0, react_1.forwardRef)((props, ref) => (0, jsx_runtime_1.jsx)(exports.View, { ref: ref, variant: "container", ...props }));
|
|
242
|
+
exports.Container.displayName = "Container";
|
|
243
|
+
exports.Surface = (0, react_1.forwardRef)((props, ref) => (0, jsx_runtime_1.jsx)(exports.View, { ref: ref, variant: "surface", ...props }));
|
|
244
|
+
exports.Surface.displayName = "Surface";
|
|
245
|
+
exports.Overlay = (0, react_1.forwardRef)((props, ref) => (0, jsx_runtime_1.jsx)(exports.View, { ref: ref, variant: "overlay", ...props }));
|
|
246
|
+
exports.Overlay.displayName = "Overlay";
|
|
247
|
+
exports.Row = (0, react_1.forwardRef)((props, ref) => (0, jsx_runtime_1.jsx)(exports.View, { ref: ref, direction: "row", ...props }));
|
|
248
|
+
exports.Row.displayName = "Row";
|
|
249
|
+
exports.Column = (0, react_1.forwardRef)((props, ref) => (0, jsx_runtime_1.jsx)(exports.View, { ref: ref, direction: "column", ...props }));
|
|
250
|
+
exports.Column.displayName = "Column";
|
|
251
|
+
exports.Center = (0, react_1.forwardRef)((props, ref) => ((0, jsx_runtime_1.jsx)(exports.View, { ref: ref, centered: true, ...props })));
|
|
252
|
+
exports.Center.displayName = "Center";
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
1
4
|
// barrel file :)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
tslib_1.__exportStar(require("./useAvatars"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./useCameraToggle"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./useKeyboard"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./useKeyboardSlide"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./useLivestreamInfo"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./useOuterAndInnerDimensions"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./usePlayerDimensions"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./useSegmentDimensions"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./useSegmentTiming"), exports);
|
package/dist/hooks/useAvatars.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAvatars = useAvatars;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const xrpc_1 = require("../streamplace-store/xrpc");
|
|
6
|
+
function useAvatars(dids) {
|
|
7
|
+
let agent = (0, xrpc_1.usePDSAgent)();
|
|
8
|
+
const [profiles, setProfiles] = (0, react_1.useState)({});
|
|
9
|
+
const inFlight = (0, react_1.useRef)(new Set());
|
|
10
|
+
const missingDids = (0, react_1.useMemo)(() => dids.filter((did) => !(did in profiles) && !inFlight.current.has(did)), [dids, profiles]);
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
9
12
|
if (missingDids.length === 0 || !agent)
|
|
10
13
|
return;
|
|
11
14
|
const toFetch = missingDids.slice(0, 25);
|