@streamplace/components 0.7.1 → 0.7.3

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 (95) hide show
  1. package/dist/components/chat/chat-box.js +46 -43
  2. package/dist/components/chat/chat-message.js +36 -33
  3. package/dist/components/chat/chat.js +31 -27
  4. package/dist/components/chat/mention-suggestions.js +16 -13
  5. package/dist/components/chat/mod-view.js +20 -17
  6. package/dist/components/mobile-player/fullscreen.js +21 -17
  7. package/dist/components/mobile-player/fullscreen.native.js +39 -35
  8. package/dist/components/mobile-player/player.js +38 -32
  9. package/dist/components/mobile-player/props.js +2 -1
  10. package/dist/components/mobile-player/shared.js +16 -13
  11. package/dist/components/mobile-player/ui/countdown.js +23 -19
  12. package/dist/components/mobile-player/ui/index.js +10 -6
  13. package/dist/components/mobile-player/ui/input.js +16 -12
  14. package/dist/components/mobile-player/ui/loading.js +104 -0
  15. package/dist/components/mobile-player/ui/metrics.js +20 -16
  16. package/dist/components/mobile-player/ui/streamer-context-menu.js +6 -3
  17. package/dist/components/mobile-player/ui/viewer-context-menu.js +19 -16
  18. package/dist/components/mobile-player/ui/viewers.js +13 -9
  19. package/dist/components/mobile-player/use-webrtc.js +29 -24
  20. package/dist/components/mobile-player/video.js +109 -99
  21. package/dist/components/mobile-player/video.native.js +92 -85
  22. package/dist/components/mobile-player/webrtc-diagnostics.js +9 -5
  23. package/dist/components/mobile-player/webrtc-primitives.js +8 -6
  24. package/dist/components/mobile-player/webrtc-primitives.native.js +8 -1
  25. package/dist/components/ui/button.js +26 -23
  26. package/dist/components/ui/dialog.js +43 -40
  27. package/dist/components/ui/dropdown.js +121 -116
  28. package/dist/components/ui/icons.js +8 -5
  29. package/dist/components/ui/index.js +27 -19
  30. package/dist/components/ui/input.js +31 -28
  31. package/dist/components/ui/loader.js +9 -6
  32. package/dist/components/ui/primitives/button.js +33 -29
  33. package/dist/components/ui/primitives/input.js +44 -40
  34. package/dist/components/ui/primitives/modal.js +45 -41
  35. package/dist/components/ui/primitives/text.js +35 -29
  36. package/dist/components/ui/resizeable.js +66 -53
  37. package/dist/components/ui/text.js +50 -48
  38. package/dist/components/ui/textarea.js +13 -11
  39. package/dist/components/ui/toast.js +26 -23
  40. package/dist/components/ui/view.js +41 -39
  41. package/dist/hooks/index.js +12 -9
  42. package/dist/hooks/useAvatars.js +11 -8
  43. package/dist/hooks/useCameraToggle.js +7 -4
  44. package/dist/hooks/useKeyboard.js +13 -10
  45. package/dist/hooks/useKeyboardSlide.js +8 -5
  46. package/dist/hooks/useLivestreamInfo.js +17 -14
  47. package/dist/hooks/useOuterAndInnerDimensions.js +9 -6
  48. package/dist/hooks/usePlayerDimensions.js +9 -6
  49. package/dist/hooks/useSegmentDimensions.js +6 -3
  50. package/dist/hooks/useSegmentTiming.js +13 -10
  51. package/dist/index.js +24 -15
  52. package/dist/lib/facet.js +5 -1
  53. package/dist/lib/theme/atoms.js +153 -148
  54. package/dist/lib/theme/atoms.types.js +2 -1
  55. package/dist/lib/theme/index.js +31 -5
  56. package/dist/lib/theme/theme.js +91 -83
  57. package/dist/lib/theme/tokens.js +15 -12
  58. package/dist/lib/utils.js +22 -11
  59. package/dist/livestream-provider/index.js +19 -14
  60. package/dist/livestream-provider/websocket.js +14 -10
  61. package/dist/livestream-store/chat.js +26 -19
  62. package/dist/livestream-store/context.js +5 -2
  63. package/dist/livestream-store/index.js +7 -4
  64. package/dist/livestream-store/livestream-state.js +2 -1
  65. package/dist/livestream-store/livestream-store.js +31 -18
  66. package/dist/livestream-store/stream-key.js +22 -18
  67. package/dist/livestream-store/websocket-consumer.js +18 -14
  68. package/dist/player-store/context.js +5 -2
  69. package/dist/player-store/index.js +8 -5
  70. package/dist/player-store/player-provider.js +20 -15
  71. package/dist/player-store/player-state.js +9 -6
  72. package/dist/player-store/player-store.js +35 -21
  73. package/dist/player-store/single-player-provider.js +35 -23
  74. package/dist/streamplace-provider/context.js +5 -2
  75. package/dist/streamplace-provider/index.js +14 -10
  76. package/dist/streamplace-provider/poller.js +20 -17
  77. package/dist/streamplace-store/block.js +6 -3
  78. package/dist/streamplace-store/index.js +6 -3
  79. package/dist/streamplace-store/stream.js +58 -33
  80. package/dist/streamplace-store/streamplace-store.js +23 -13
  81. package/dist/streamplace-store/user.js +19 -14
  82. package/dist/streamplace-store/xrpc.js +10 -7
  83. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
  84. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/56540125 +0 -0
  85. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/67b1eb60 +0 -0
  86. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/7c275f90 +0 -0
  87. package/package.json +5 -6
  88. package/src/components/mobile-player/ui/index.ts +1 -0
  89. package/src/components/mobile-player/ui/loading.tsx +154 -0
  90. package/src/components/ui/resizeable.tsx +26 -15
  91. package/src/player-store/player-state.tsx +4 -0
  92. package/src/player-store/player-store.tsx +5 -0
  93. package/src/streamplace-store/stream.tsx +66 -35
  94. package/tsconfig.json +2 -1
  95. package/tsconfig.tsbuildinfo +1 -1
@@ -1,30 +1,33 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { X } from "lucide-react-native";
3
- import { useEffect, useMemo, useRef, useState } from "react";
4
- import { Pressable } from "react-native";
5
- import { Button, Loader, Text, useChat, useCreateChatMessage, useReplyToMessage, useSetReplyToMessage, View, } from "../../";
6
- import { bg, flex, gap, h, layout, mb, pl, pr, w } from "../../lib/theme/atoms";
7
- import { usePDSAgent } from "../../streamplace-store/xrpc";
8
- import { Textarea } from "../ui/textarea";
9
- import { RenderChatMessage } from "./chat-message";
10
- import { MentionSuggestions } from "./mention-suggestions";
11
- export function ChatBox({ isPopout, chatBoxStyle, }) {
12
- const [submitting, setSubmitting] = useState(false);
13
- const [message, setMessage] = useState("");
14
- const [showSuggestions, setShowSuggestions] = useState(false);
15
- const [highlightedIndex, setHighlightedIndex] = useState(0);
16
- const [filteredAuthors, setFilteredAuthors] = useState(new Map());
17
- const chat = useChat();
18
- const createChatMessage = useCreateChatMessage();
19
- const replyTo = useReplyToMessage();
20
- const setReplyToMessage = useSetReplyToMessage();
21
- const textAreaRef = useRef(null);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatBox = ChatBox;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const lucide_react_native_1 = require("lucide-react-native");
6
+ const react_1 = require("react");
7
+ const react_native_1 = require("react-native");
8
+ const __1 = require("../../");
9
+ const atoms_1 = require("../../lib/theme/atoms");
10
+ const xrpc_1 = require("../../streamplace-store/xrpc");
11
+ const textarea_1 = require("../ui/textarea");
12
+ const chat_message_1 = require("./chat-message");
13
+ const mention_suggestions_1 = require("./mention-suggestions");
14
+ function ChatBox({ isPopout, chatBoxStyle, }) {
15
+ const [submitting, setSubmitting] = (0, react_1.useState)(false);
16
+ const [message, setMessage] = (0, react_1.useState)("");
17
+ const [showSuggestions, setShowSuggestions] = (0, react_1.useState)(false);
18
+ const [highlightedIndex, setHighlightedIndex] = (0, react_1.useState)(0);
19
+ const [filteredAuthors, setFilteredAuthors] = (0, react_1.useState)(new Map());
20
+ const chat = (0, __1.useChat)();
21
+ const createChatMessage = (0, __1.useCreateChatMessage)();
22
+ const replyTo = (0, __1.useReplyToMessage)();
23
+ const setReplyToMessage = (0, __1.useSetReplyToMessage)();
24
+ const textAreaRef = (0, react_1.useRef)(null);
22
25
  // are we logged in?
23
- let agent = usePDSAgent();
26
+ let agent = (0, xrpc_1.usePDSAgent)();
24
27
  if (!agent?.did) {
25
- _jsx(View, { style: [layout.flex.row, layout.flex.alignCenter, gap.all[2]], children: _jsx(Text, { children: "Log in to chat." }) });
28
+ (0, jsx_runtime_1.jsx)(__1.View, { style: [atoms_1.layout.flex.row, atoms_1.layout.flex.alignCenter, atoms_1.gap.all[2]], children: (0, jsx_runtime_1.jsx)(__1.Text, { children: "Log in to chat." }) });
26
29
  }
27
- const authors = useMemo(() => {
30
+ const authors = (0, react_1.useMemo)(() => {
28
31
  if (!chat)
29
32
  return null;
30
33
  return chat.reduce((acc, msg) => {
@@ -61,30 +64,30 @@ export function ChatBox({ isPopout, chatBoxStyle, }) {
61
64
  });
62
65
  setSubmitting(false);
63
66
  };
64
- useEffect(() => {
67
+ (0, react_1.useEffect)(() => {
65
68
  if (replyTo && textAreaRef.current) {
66
69
  textAreaRef.current.focus();
67
70
  }
68
71
  }, [replyTo]);
69
- return (_jsxs(View, { style: [layout.flex.column, flex.shrink[1], gap.all[2]], children: [replyTo && (_jsxs(View, { style: [
70
- layout.flex.row,
71
- layout.flex.alignCenter,
72
- layout.flex.spaceBetween,
73
- h[12],
74
- pl[2],
75
- pr[10],
76
- mb[2],
77
- bg.gray[800],
72
+ return ((0, jsx_runtime_1.jsxs)(__1.View, { style: [atoms_1.layout.flex.column, atoms_1.flex.shrink[1], atoms_1.gap.all[2]], children: [replyTo && ((0, jsx_runtime_1.jsxs)(__1.View, { style: [
73
+ atoms_1.layout.flex.row,
74
+ atoms_1.layout.flex.alignCenter,
75
+ atoms_1.layout.flex.spaceBetween,
76
+ atoms_1.h[12],
77
+ atoms_1.pl[2],
78
+ atoms_1.pr[10],
79
+ atoms_1.mb[2],
80
+ atoms_1.bg.gray[800],
78
81
  { borderRadius: 16 },
79
- ], children: [_jsx(RenderChatMessage, { item: replyTo, showReply: false, userCache: authors || new Map() }), _jsx(Pressable, { onPress: () => setReplyToMessage(null), children: _jsx(View, { style: [
80
- layout.flex.row,
81
- layout.flex.alignCenter,
82
- layout.flex.justifyCenter,
83
- h[12],
84
- w[12],
85
- bg.gray[600],
82
+ ], children: [(0, jsx_runtime_1.jsx)(chat_message_1.RenderChatMessage, { item: replyTo, showReply: false, userCache: authors || new Map() }), (0, jsx_runtime_1.jsx)(react_native_1.Pressable, { onPress: () => setReplyToMessage(null), children: (0, jsx_runtime_1.jsx)(__1.View, { style: [
83
+ atoms_1.layout.flex.row,
84
+ atoms_1.layout.flex.alignCenter,
85
+ atoms_1.layout.flex.justifyCenter,
86
+ atoms_1.h[12],
87
+ atoms_1.w[12],
88
+ atoms_1.bg.gray[600],
86
89
  { borderRadius: 999 },
87
- ], children: _jsx(X, { size: 24 }) }) })] })), _jsxs(View, { style: [layout.flex.row, layout.flex.alignCenter, gap.all[2]], children: [_jsx(Textarea, { ref: textAreaRef, numberOfLines: 1, value: message, enterKeyHint: "send", onSubmitEditing: submit, multiline: false, onChangeText: (text) => {
90
+ ], children: (0, jsx_runtime_1.jsx)(lucide_react_native_1.X, { size: 24 }) }) })] })), (0, jsx_runtime_1.jsxs)(__1.View, { style: [atoms_1.layout.flex.row, atoms_1.layout.flex.alignCenter, atoms_1.gap.all[2]], children: [(0, jsx_runtime_1.jsx)(textarea_1.Textarea, { ref: textAreaRef, numberOfLines: 1, value: message, enterKeyHint: "send", onSubmitEditing: submit, multiline: false, onChangeText: (text) => {
88
91
  setMessage(text);
89
92
  updateSuggestions(text);
90
93
  }, onKeyPress: (k) => {
@@ -105,5 +108,5 @@ export function ChatBox({ isPopout, chatBoxStyle, }) {
105
108
  else if (k.nativeEvent.key === "ArrowDown") {
106
109
  setHighlightedIndex((prev) => Math.min(prev + 1, Array.from(filteredAuthors.keys()).length - 1));
107
110
  }
108
- }, style: [chatBoxStyle] }), _jsx(Button, { disabled: submitting, variant: "secondary", style: { borderRadius: 16, height: 36, minWidth: 80 }, onPress: submit, children: submitting ? _jsx(Loader, {}) : "Send" })] }), showSuggestions && (_jsx(MentionSuggestions, { authors: filteredAuthors || [], highlightedIndex: highlightedIndex, onSelect: handleMentionSelect }))] }));
111
+ }, style: [chatBoxStyle] }), (0, jsx_runtime_1.jsx)(__1.Button, { disabled: submitting, variant: "secondary", style: { borderRadius: 16, height: 36, minWidth: 80 }, onPress: submit, children: submitting ? (0, jsx_runtime_1.jsx)(__1.Loader, {}) : "Send" })] }), showSuggestions && ((0, jsx_runtime_1.jsx)(mention_suggestions_1.MentionSuggestions, { authors: filteredAuthors || [], highlightedIndex: highlightedIndex, onSelect: handleMentionSelect }))] }));
109
112
  }
@@ -1,11 +1,14 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { memo, useCallback } from "react";
3
- import { Linking, View } from "react-native";
4
- import { segmentize } from "../../lib/facet";
5
- import { borders, flex, gap, ml, mr, opacity, pl, w, } from "../../lib/theme/atoms";
6
- import { atoms, layout } from "../ui";
7
- import { useLivestreamStore } from "../../livestream-store";
8
- import { Text } from "../ui/text";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RenderChatMessage = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const react_native_1 = require("react-native");
7
+ const facet_1 = require("../../lib/facet");
8
+ const atoms_1 = require("../../lib/theme/atoms");
9
+ const ui_1 = require("../ui");
10
+ const livestream_store_1 = require("../../livestream-store");
11
+ const text_1 = require("../ui/text");
9
12
  const getRgbColor = (color) => color ? `rgb(${color.red}, ${color.green}, ${color.blue})` : "$accentColor";
10
13
  const segmentedObject = (obj, index, userCache) => {
11
14
  if (obj.features && obj.features.length > 0) {
@@ -13,63 +16,63 @@ const segmentedObject = (obj, index, userCache) => {
13
16
  // afaik there shouldn't be a case where facets overlap, at least currently
14
17
  if (ftr.$type === "app.bsky.richtext.facet#link") {
15
18
  let linkftr = ftr;
16
- return (_jsx(Text, { style: [{ color: atoms.colors.ios.systemBlue, cursor: "pointer" }], onPress: () => Linking.openURL(linkftr.uri || ""), children: obj.text }, `mention-${index}`));
19
+ return ((0, jsx_runtime_1.jsx)(text_1.Text, { style: [{ color: ui_1.atoms.colors.ios.systemBlue, cursor: "pointer" }], onPress: () => react_native_1.Linking.openURL(linkftr.uri || ""), children: obj.text }, `mention-${index}`));
17
20
  }
18
21
  else if (ftr.$type === "app.bsky.richtext.facet#mention") {
19
22
  let mtnftr = ftr;
20
23
  const profile = userCache?.[mtnftr.did];
21
24
  console.log(profile, mtnftr.did, userCache);
22
- return (_jsx(Text, { style: [
25
+ return ((0, jsx_runtime_1.jsx)(text_1.Text, { style: [
23
26
  {
24
27
  cursor: "pointer",
25
28
  color: getRgbColor(profile?.color),
26
29
  },
27
- ], onPress: () => Linking.openURL(`https://bsky.app/profile/${mtnftr.did || ""}`), children: obj.text }, `mention-${index}`));
30
+ ], onPress: () => react_native_1.Linking.openURL(`https://bsky.app/profile/${mtnftr.did || ""}`), children: obj.text }, `mention-${index}`));
28
31
  }
29
32
  }
30
33
  else {
31
- return _jsx(Text, { children: obj.text }, `text-${index}`);
34
+ return (0, jsx_runtime_1.jsx)(text_1.Text, { children: obj.text }, `text-${index}`);
32
35
  }
33
36
  };
34
37
  const RichTextMessage = ({ text, facets, }) => {
35
38
  if (!facets?.length)
36
- return _jsx(Text, { children: text });
37
- const userCache = useLivestreamStore((state) => state.authors);
38
- let segs = segmentize(text, facets);
39
+ return (0, jsx_runtime_1.jsx)(text_1.Text, { children: text });
40
+ const userCache = (0, livestream_store_1.useLivestreamStore)((state) => state.authors);
41
+ let segs = (0, facet_1.segmentize)(text, facets);
39
42
  return segs.map((seg, i) => segmentedObject(seg, i, userCache));
40
43
  };
41
- export const RenderChatMessage = memo(function RenderChatMessage({ item, showReply = true, showTime = true, }) {
42
- const formatTime = useCallback((dateString) => {
44
+ exports.RenderChatMessage = (0, react_1.memo)(function RenderChatMessage({ item, showReply = true, showTime = true, }) {
45
+ const formatTime = (0, react_1.useCallback)((dateString) => {
43
46
  return new Date(dateString).toLocaleString(undefined, {
44
47
  hour: "2-digit",
45
48
  minute: "2-digit",
46
49
  hour12: false,
47
50
  });
48
51
  }, []);
49
- return (_jsxs(_Fragment, { children: [item.replyTo && showReply && (_jsx(View, { style: [
50
- gap.all[2],
51
- layout.flex.row,
52
- w.percent[100],
53
- borders.left.width.medium,
54
- borders.left.color.gray[700],
55
- ml[4],
56
- pl[4],
57
- opacity[80],
58
- ], children: _jsxs(Text, { numberOfLines: 1, style: [flex.shrink[1], mr[4]], children: [_jsxs(Text, { style: {
52
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [item.replyTo && showReply && ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
53
+ atoms_1.gap.all[2],
54
+ ui_1.layout.flex.row,
55
+ atoms_1.w.percent[100],
56
+ atoms_1.borders.left.width.medium,
57
+ atoms_1.borders.left.color.gray[700],
58
+ atoms_1.ml[4],
59
+ atoms_1.pl[4],
60
+ atoms_1.opacity[80],
61
+ ], children: (0, jsx_runtime_1.jsxs)(text_1.Text, { numberOfLines: 1, style: [atoms_1.flex.shrink[1], atoms_1.mr[4]], children: [(0, jsx_runtime_1.jsxs)(text_1.Text, { style: {
59
62
  color: getRgbColor(item.replyTo.chatProfile.color),
60
63
  fontWeight: "thin",
61
- }, children: ["@", item.replyTo.author.handle] }), " ", _jsx(Text, { style: {
62
- color: atoms.colors.gray[300],
64
+ }, children: ["@", item.replyTo.author.handle] }), " ", (0, jsx_runtime_1.jsx)(text_1.Text, { style: {
65
+ color: ui_1.atoms.colors.gray[300],
63
66
  fontStyle: "italic",
64
- }, children: item.replyTo.record.text })] }) })), _jsxs(View, { style: [gap.all[2], layout.flex.row, w.percent[100]], children: [showTime && (_jsx(Text, { style: {
67
+ }, children: item.replyTo.record.text })] }) })), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [atoms_1.gap.all[2], ui_1.layout.flex.row, atoms_1.w.percent[100]], children: [showTime && ((0, jsx_runtime_1.jsx)(text_1.Text, { style: {
65
68
  fontVariant: ["tabular-nums"],
66
- color: atoms.colors.gray[300],
67
- }, children: formatTime(item.record.createdAt) })), _jsxs(Text, { weight: "bold", color: "default", style: [flex.shrink[1]], children: [_jsxs(Text, { style: [
69
+ color: ui_1.atoms.colors.gray[300],
70
+ }, children: formatTime(item.record.createdAt) })), (0, jsx_runtime_1.jsxs)(text_1.Text, { weight: "bold", color: "default", style: [atoms_1.flex.shrink[1]], children: [(0, jsx_runtime_1.jsxs)(text_1.Text, { style: [
68
71
  {
69
72
  cursor: "pointer",
70
73
  color: getRgbColor(item.chatProfile?.color),
71
74
  },
72
- ], children: ["@", item.author.handle] }), ":", " ", _jsx(RichTextMessage, { text: item.record.text, facets: item.record.facets || [] })] })] })] }));
75
+ ], children: ["@", item.author.handle] }), ":", " ", (0, jsx_runtime_1.jsx)(RichTextMessage, { text: item.record.text, facets: item.record.facets || [] })] })] })] }));
73
76
  }, (prevProps, nextProps) => {
74
77
  return (prevProps.item.author.handle === nextProps.item.author.handle &&
75
78
  prevProps.item.record.text === nextProps.item.record.text);
@@ -1,44 +1,48 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Reply, ShieldEllipsis } from "lucide-react-native";
3
- import { memo, useRef } from "react";
4
- import { FlatList, Platform, Pressable } from "react-native";
5
- import Swipeable from "react-native-gesture-handler/ReanimatedSwipeable";
6
- import Reanimated, { useAnimatedStyle, } from "react-native-reanimated";
7
- import { Text, useChat, usePlayerStore, useSetReplyToMessage, View, } from "../../";
8
- import { flex, py, w } from "../../lib/theme/atoms";
9
- import { RenderChatMessage } from "./chat-message";
10
- import { ModView } from "./mod-view";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Chat = Chat;
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 ReanimatedSwipeable_1 = tslib_1.__importDefault(require("react-native-gesture-handler/ReanimatedSwipeable"));
10
+ const react_native_reanimated_1 = tslib_1.__importStar(require("react-native-reanimated"));
11
+ const __1 = require("../../");
12
+ const atoms_1 = require("../../lib/theme/atoms");
13
+ const chat_message_1 = require("./chat-message");
14
+ const mod_view_1 = require("./mod-view");
11
15
  function RightAction(prog, drag) {
12
- const styleAnimation = useAnimatedStyle(() => {
16
+ const styleAnimation = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
13
17
  return {
14
18
  transform: [{ translateX: drag.value + 25 }],
15
19
  };
16
20
  });
17
- return (_jsx(Reanimated.View, { style: [styleAnimation], children: _jsx(Reply, { color: "white" }) }));
21
+ return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: [styleAnimation], children: (0, jsx_runtime_1.jsx)(lucide_react_native_1.Reply, { color: "white" }) }));
18
22
  }
19
23
  function LeftAction(prog, drag) {
20
- const styleAnimation = useAnimatedStyle(() => {
24
+ const styleAnimation = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
21
25
  return {
22
26
  transform: [{ translateX: drag.value - 25 }],
23
27
  };
24
28
  });
25
- return (_jsx(Reanimated.View, { style: [styleAnimation], children: _jsx(ShieldEllipsis, { color: "white" }) }));
29
+ return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: [styleAnimation], children: (0, jsx_runtime_1.jsx)(lucide_react_native_1.ShieldEllipsis, { color: "white" }) }));
26
30
  }
27
- const SHOWN_MSGS = Platform.OS === "android" || Platform.OS === "ios" ? 100 : 25;
31
+ const SHOWN_MSGS = react_native_1.Platform.OS === "android" || react_native_1.Platform.OS === "ios" ? 100 : 25;
28
32
  const keyExtractor = (item, index) => {
29
33
  return `${item.uri}`;
30
34
  };
31
- const ChatLine = memo(({ item }) => {
32
- const setReply = useSetReplyToMessage();
33
- const setModMsg = usePlayerStore((state) => state.setModMessage);
34
- const swipeableRef = useRef(null);
35
- return (_jsx(Pressable, { onLongPress: () => setModMsg(item), children: _jsx(Swipeable, { containerStyle: [py[1]], friction: 2, enableTrackpadTwoFingerGesture: true, rightThreshold: 40, renderRightActions: Platform.OS === "android" ? undefined : RightAction, renderLeftActions: Platform.OS === "android" ? undefined : LeftAction, overshootFriction: 9, ref: (ref) => {
35
+ const ChatLine = (0, react_1.memo)(({ item }) => {
36
+ const setReply = (0, __1.useSetReplyToMessage)();
37
+ const setModMsg = (0, __1.usePlayerStore)((state) => state.setModMessage);
38
+ const swipeableRef = (0, react_1.useRef)(null);
39
+ return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { onLongPress: () => setModMsg(item), children: (0, jsx_runtime_1.jsx)(ReanimatedSwipeable_1.default, { containerStyle: [atoms_1.py[1]], friction: 2, enableTrackpadTwoFingerGesture: true, rightThreshold: 40, renderRightActions: react_native_1.Platform.OS === "android" ? undefined : RightAction, renderLeftActions: react_native_1.Platform.OS === "android" ? undefined : LeftAction, overshootFriction: 9, ref: (ref) => {
36
40
  swipeableRef.current = ref;
37
41
  }, onSwipeableOpen: (r) => {
38
- if (r === (Platform.OS === "android" ? "right" : "left")) {
42
+ if (r === (react_native_1.Platform.OS === "android" ? "right" : "left")) {
39
43
  setReply(item);
40
44
  }
41
- if (r === (Platform.OS === "android" ? "left" : "right")) {
45
+ if (r === (react_native_1.Platform.OS === "android" ? "left" : "right")) {
42
46
  setModMsg(item);
43
47
  }
44
48
  // close this swipeable
@@ -46,11 +50,11 @@ const ChatLine = memo(({ item }) => {
46
50
  if (swipeable) {
47
51
  swipeable.close();
48
52
  }
49
- }, children: _jsx(RenderChatMessage, { item: item }) }) }));
53
+ }, children: (0, jsx_runtime_1.jsx)(chat_message_1.RenderChatMessage, { item: item }) }) }));
50
54
  });
51
- export function Chat({ shownMessages = SHOWN_MSGS, style: propsStyle, ...props }) {
52
- const chat = useChat();
55
+ function Chat({ shownMessages = SHOWN_MSGS, style: propsStyle, ...props }) {
56
+ const chat = (0, __1.useChat)();
53
57
  if (!chat)
54
- return (_jsx(View, { style: [flex.shrink[1]], children: _jsx(Text, { children: "Loading chaat..." }) }));
55
- return (_jsxs(View, { style: [flex.shrink[1]].concat(propsStyle || []), children: [_jsx(FlatList, { style: [flex.grow[1], flex.shrink[1], w.percent[100]], data: chat, inverted: true, keyExtractor: keyExtractor, renderItem: ({ item, index }) => _jsx(ChatLine, { item: item }), removeClippedSubviews: true, maxToRenderPerBatch: 10, initialNumToRender: 10, updateCellsBatchingPeriod: 50 }), _jsx(ModView, {})] }));
58
+ return ((0, jsx_runtime_1.jsx)(__1.View, { style: [atoms_1.flex.shrink[1]], children: (0, jsx_runtime_1.jsx)(__1.Text, { children: "Loading chaat..." }) }));
59
+ return ((0, jsx_runtime_1.jsxs)(__1.View, { style: [atoms_1.flex.shrink[1]].concat(propsStyle || []), children: [(0, jsx_runtime_1.jsx)(react_native_1.FlatList, { style: [atoms_1.flex.grow[1], atoms_1.flex.shrink[1], atoms_1.w.percent[100]], data: chat, inverted: true, keyExtractor: keyExtractor, renderItem: ({ item, index }) => (0, jsx_runtime_1.jsx)(ChatLine, { item: item }), removeClippedSubviews: true, maxToRenderPerBatch: 10, initialNumToRender: 10, updateCellsBatchingPeriod: 50 }), (0, jsx_runtime_1.jsx)(mod_view_1.ModView, {})] }));
56
60
  }
@@ -1,18 +1,21 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Pressable } from "react-native";
3
- import { Text, View } from "../..";
4
- import { bg, layout, left, right, zIndex } from "../../lib/theme/atoms";
5
- export function MentionSuggestions({ authors, onSelect, highlightedIndex, }) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MentionSuggestions = MentionSuggestions;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_native_1 = require("react-native");
6
+ const __1 = require("../..");
7
+ const atoms_1 = require("../../lib/theme/atoms");
8
+ function MentionSuggestions({ authors, onSelect, highlightedIndex, }) {
6
9
  if (!authors || authors.size === 0) {
7
10
  return null; // No authors to display
8
11
  }
9
12
  const authorHandles = Array.from(authors.keys());
10
- return (_jsx(View, { style: [
11
- bg.gray[800],
12
- layout.position.absolute,
13
- left[0],
14
- right[0],
15
- zIndex[50],
13
+ return ((0, jsx_runtime_1.jsx)(__1.View, { style: [
14
+ atoms_1.bg.gray[800],
15
+ atoms_1.layout.position.absolute,
16
+ atoms_1.left[0],
17
+ atoms_1.right[0],
18
+ atoms_1.zIndex[50],
16
19
  {
17
20
  bottom: "100%",
18
21
  borderRadius: 8,
@@ -20,7 +23,7 @@ export function MentionSuggestions({ authors, onSelect, highlightedIndex, }) {
20
23
  },
21
24
  ], children: authorHandles.map((handle, index) => {
22
25
  let profile = authors.get(handle);
23
- return (_jsx(Pressable, { onPress: () => onSelect(handle), style: [
26
+ return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { onPress: () => onSelect(handle), style: [
24
27
  {
25
28
  padding: 8,
26
29
  flexDirection: "row",
@@ -29,7 +32,7 @@ export function MentionSuggestions({ authors, onSelect, highlightedIndex, }) {
29
32
  ? "rgba(0, 0, 0, 0.1)"
30
33
  : "rgba(0, 0, 0, 0.5)",
31
34
  },
32
- ], children: _jsxs(Text, { style: {
35
+ ], children: (0, jsx_runtime_1.jsxs)(__1.Text, { style: {
33
36
  color: profile?.color
34
37
  ? `rgb(${profile.color.red}, ${profile.color.green}, ${profile.color.blue})`
35
38
  : "black",
@@ -1,20 +1,23 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useEffect, useRef } from "react";
3
- import { gap, mr } from "../../lib/theme/atoms";
4
- import { usePlayerStore } from "../../player-store";
5
- import { useCreateBlockRecord } from "../../streamplace-store/block";
6
- import { usePDSAgent } from "../../streamplace-store/xrpc";
7
- import { DropdownMenu, DropdownMenuGroup, DropdownMenuItem, DropdownMenuTrigger, layout, ResponsiveDropdownMenuContent, Text, View, } from "../ui";
8
- import { RenderChatMessage } from "./chat-message";
9
- export const ModView = forwardRef(() => {
10
- const triggerRef = useRef(null);
11
- const message = usePlayerStore((state) => state.modMessage);
12
- let agent = usePDSAgent();
13
- let createBlockRecord = useCreateBlockRecord();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModView = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const atoms_1 = require("../../lib/theme/atoms");
7
+ const player_store_1 = require("../../player-store");
8
+ const block_1 = require("../../streamplace-store/block");
9
+ const xrpc_1 = require("../../streamplace-store/xrpc");
10
+ const ui_1 = require("../ui");
11
+ const chat_message_1 = require("./chat-message");
12
+ exports.ModView = (0, react_1.forwardRef)(() => {
13
+ const triggerRef = (0, react_1.useRef)(null);
14
+ const message = (0, player_store_1.usePlayerStore)((state) => state.modMessage);
15
+ let agent = (0, xrpc_1.usePDSAgent)();
16
+ let createBlockRecord = (0, block_1.useCreateBlockRecord)();
14
17
  if (!agent?.did) {
15
- _jsx(View, { style: [layout.flex.row, layout.flex.alignCenter, gap.all[2]], children: _jsx(Text, { children: "Log in to submit mod actions" }) });
18
+ (0, jsx_runtime_1.jsx)(ui_1.View, { style: [ui_1.layout.flex.row, ui_1.layout.flex.alignCenter, atoms_1.gap.all[2]], children: (0, jsx_runtime_1.jsx)(ui_1.Text, { children: "Log in to submit mod actions" }) });
16
19
  }
17
- useEffect(() => {
20
+ (0, react_1.useEffect)(() => {
18
21
  if (message) {
19
22
  console.log("opening mod view");
20
23
  triggerRef.current?.open();
@@ -24,10 +27,10 @@ export const ModView = forwardRef(() => {
24
27
  triggerRef.current?.close();
25
28
  }
26
29
  }, [message]);
27
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { ref: triggerRef, children: _jsx(View, {}) }), _jsx(ResponsiveDropdownMenuContent, { children: message && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuGroup, { children: _jsx(DropdownMenuItem, { children: _jsx(View, { style: [layout.flex.column, mr[5], { gap: 6 }], children: _jsx(RenderChatMessage, { item: message }) }) }) }), _jsx(DropdownMenuGroup, { title: `Moderation actions`, children: _jsx(DropdownMenuItem, { disabled: message.author.did === agent?.did, onPress: () => {
30
+ return ((0, jsx_runtime_1.jsxs)(ui_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(ui_1.DropdownMenuTrigger, { ref: triggerRef, children: (0, jsx_runtime_1.jsx)(ui_1.View, {}) }), (0, jsx_runtime_1.jsx)(ui_1.ResponsiveDropdownMenuContent, { children: message && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ui_1.DropdownMenuGroup, { children: (0, jsx_runtime_1.jsx)(ui_1.DropdownMenuItem, { children: (0, jsx_runtime_1.jsx)(ui_1.View, { style: [ui_1.layout.flex.column, atoms_1.mr[5], { gap: 6 }], children: (0, jsx_runtime_1.jsx)(chat_message_1.RenderChatMessage, { item: message }) }) }) }), (0, jsx_runtime_1.jsx)(ui_1.DropdownMenuGroup, { title: `Moderation actions`, children: (0, jsx_runtime_1.jsx)(ui_1.DropdownMenuItem, { disabled: message.author.did === agent?.did, onPress: () => {
28
31
  console.log("Creating block record");
29
32
  createBlockRecord(message.author.did)
30
33
  .then((r) => console.log(r))
31
34
  .catch((e) => console.error(e));
32
- }, children: _jsx(Text, { color: "destructive", children: message.author.did === agent?.did ? (_jsx(_Fragment, { children: "Block yourself (you can't block yourself)" })) : (_jsxs(_Fragment, { children: ["Block user @", message.author.handle, " from this channel"] })) }) }) })] })) })] }));
35
+ }, children: (0, jsx_runtime_1.jsx)(ui_1.Text, { color: "destructive", children: message.author.did === agent?.did ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Block yourself (you can't block yourself)" })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Block user @", message.author.handle, " from this channel"] })) }) }) })] })) })] }));
33
36
  });
@@ -1,20 +1,24 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useRef } from "react";
3
- import { getFirstPlayerID, usePlayerStore } from "../..";
4
- import { View } from "../../components/ui";
5
- import Video from "./video";
6
- export function Fullscreen(props) {
7
- const playerId = getFirstPlayerID();
8
- const protocol = usePlayerStore((x) => x.protocol, playerId);
9
- const fullscreen = usePlayerStore((x) => x.fullscreen, playerId);
10
- const setFullscreen = usePlayerStore((x) => x.setFullscreen, playerId);
11
- const setSrc = usePlayerStore((x) => x.setSrc);
12
- const divRef = useRef(null);
13
- const videoRef = useRef(null);
14
- useEffect(() => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Fullscreen = Fullscreen;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const __1 = require("../..");
8
+ const ui_1 = require("../../components/ui");
9
+ const video_1 = tslib_1.__importDefault(require("./video"));
10
+ function Fullscreen(props) {
11
+ const playerId = (0, __1.getFirstPlayerID)();
12
+ const protocol = (0, __1.usePlayerStore)((x) => x.protocol, playerId);
13
+ const fullscreen = (0, __1.usePlayerStore)((x) => x.fullscreen, playerId);
14
+ const setFullscreen = (0, __1.usePlayerStore)((x) => x.setFullscreen, playerId);
15
+ const setSrc = (0, __1.usePlayerStore)((x) => x.setSrc);
16
+ const divRef = (0, react_1.useRef)(null);
17
+ const videoRef = (0, react_1.useRef)(null);
18
+ (0, react_1.useEffect)(() => {
15
19
  setSrc(props.src);
16
20
  }, [props.src]);
17
- useEffect(() => {
21
+ (0, react_1.useEffect)(() => {
18
22
  if (!divRef.current) {
19
23
  return;
20
24
  }
@@ -53,7 +57,7 @@ export function Fullscreen(props) {
53
57
  }
54
58
  })();
55
59
  }, [fullscreen, protocol]);
56
- useEffect(() => {
60
+ (0, react_1.useEffect)(() => {
57
61
  const listener = () => {
58
62
  console.log("fullscreenchange", document.fullscreenElement);
59
63
  setFullscreen(!!document.fullscreenElement);
@@ -65,5 +69,5 @@ export function Fullscreen(props) {
65
69
  document.body.removeEventListener("webkitfullscreenchange", listener);
66
70
  };
67
71
  }, []);
68
- return (_jsx(View, { ref: divRef, children: _jsx(Video, {}) }));
72
+ return ((0, jsx_runtime_1.jsx)(ui_1.View, { ref: divRef, children: (0, jsx_runtime_1.jsx)(video_1.default, {}) }));
69
73
  }