@streamplace/components 0.7.14 → 0.7.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -15
- package/src/components/mobile-player/fullscreen.native.tsx +14 -3
- package/src/components/mobile-player/fullscreen.tsx +10 -2
- package/src/components/mobile-player/player.tsx +7 -1
- package/src/components/mobile-player/props.tsx +7 -0
- package/src/components/mobile-player/video-async.native.tsx +436 -0
- package/src/components/mobile-player/video.native.tsx +16 -406
- package/src/components/mobile-player/video.tsx +14 -3
- package/src/hooks/useLivestreamInfo.ts +6 -2
- package/src/lib/browser.ts +27 -0
- package/src/livestream-store/stream-key.tsx +1 -28
- package/src/streamplace-store/stream.tsx +52 -13
- package/dist/assets/emoji-data.json +0 -19371
- package/dist/components/chat/chat-box.js +0 -314
- package/dist/components/chat/chat-message.js +0 -87
- package/dist/components/chat/chat.js +0 -149
- package/dist/components/chat/emoji-suggestions.js +0 -35
- package/dist/components/chat/mention-suggestions.js +0 -42
- package/dist/components/chat/mod-view.js +0 -94
- package/dist/components/chat/system-message.js +0 -19
- package/dist/components/dashboard/chat-panel.js +0 -38
- package/dist/components/dashboard/header.js +0 -80
- package/dist/components/dashboard/index.js +0 -14
- package/dist/components/dashboard/information-widget.js +0 -234
- package/dist/components/dashboard/mod-actions.js +0 -71
- package/dist/components/dashboard/problems.js +0 -74
- package/dist/components/icons/bluesky-icon.js +0 -9
- package/dist/components/keep-awake.js +0 -7
- package/dist/components/keep-awake.native.js +0 -16
- package/dist/components/mobile-player/fullscreen.js +0 -74
- package/dist/components/mobile-player/fullscreen.native.js +0 -141
- package/dist/components/mobile-player/player.js +0 -94
- package/dist/components/mobile-player/props.js +0 -2
- package/dist/components/mobile-player/shared.js +0 -54
- package/dist/components/mobile-player/ui/countdown.js +0 -83
- package/dist/components/mobile-player/ui/index.js +0 -11
- package/dist/components/mobile-player/ui/input.js +0 -42
- package/dist/components/mobile-player/ui/metrics.js +0 -44
- package/dist/components/mobile-player/ui/report-modal.js +0 -90
- package/dist/components/mobile-player/ui/streamer-context-menu.js +0 -7
- package/dist/components/mobile-player/ui/streamer-loading-overlay.js +0 -104
- package/dist/components/mobile-player/ui/viewer-context-menu.js +0 -51
- package/dist/components/mobile-player/ui/viewer-loading-overlay.js +0 -49
- package/dist/components/mobile-player/ui/viewers.js +0 -23
- package/dist/components/mobile-player/use-webrtc.js +0 -243
- package/dist/components/mobile-player/video-retry.js +0 -29
- package/dist/components/mobile-player/video.js +0 -460
- package/dist/components/mobile-player/video.native.js +0 -276
- package/dist/components/mobile-player/webrtc-diagnostics.js +0 -110
- package/dist/components/mobile-player/webrtc-primitives.js +0 -27
- package/dist/components/mobile-player/webrtc-primitives.native.js +0 -8
- package/dist/components/share/sharesheet.js +0 -91
- package/dist/components/ui/button.js +0 -223
- package/dist/components/ui/dialog.js +0 -206
- package/dist/components/ui/dropdown.js +0 -172
- package/dist/components/ui/icons.js +0 -25
- package/dist/components/ui/index.js +0 -34
- package/dist/components/ui/info-box.js +0 -31
- package/dist/components/ui/info-row.js +0 -23
- package/dist/components/ui/input.js +0 -205
- package/dist/components/ui/loader.js +0 -10
- package/dist/components/ui/primitives/button.js +0 -125
- package/dist/components/ui/primitives/input.js +0 -206
- package/dist/components/ui/primitives/modal.js +0 -206
- package/dist/components/ui/primitives/text.js +0 -292
- package/dist/components/ui/resizeable.js +0 -121
- package/dist/components/ui/slider.js +0 -5
- package/dist/components/ui/text.js +0 -177
- package/dist/components/ui/textarea.js +0 -19
- package/dist/components/ui/toast.js +0 -175
- package/dist/components/ui/view.js +0 -252
- package/dist/hooks/index.js +0 -14
- package/dist/hooks/useAvatars.js +0 -35
- package/dist/hooks/useCameraToggle.js +0 -12
- package/dist/hooks/useKeyboard.js +0 -36
- package/dist/hooks/useKeyboardSlide.js +0 -14
- package/dist/hooks/useLivestreamInfo.js +0 -65
- package/dist/hooks/useOuterAndInnerDimensions.js +0 -30
- package/dist/hooks/usePlayerDimensions.js +0 -22
- package/dist/hooks/usePointerDevice.js +0 -71
- package/dist/hooks/useSegmentDimensions.js +0 -17
- package/dist/hooks/useSegmentTiming.js +0 -65
- package/dist/index.js +0 -34
- package/dist/lib/facet.js +0 -92
- package/dist/lib/system-messages.js +0 -101
- package/dist/lib/theme/atoms.js +0 -646
- package/dist/lib/theme/atoms.types.js +0 -6
- package/dist/lib/theme/index.js +0 -35
- package/dist/lib/theme/theme.js +0 -256
- package/dist/lib/theme/tokens.js +0 -659
- package/dist/lib/utils.js +0 -105
- package/dist/livestream-provider/index.js +0 -30
- package/dist/livestream-provider/websocket.js +0 -45
- package/dist/livestream-store/chat.js +0 -286
- package/dist/livestream-store/context.js +0 -5
- package/dist/livestream-store/index.js +0 -7
- package/dist/livestream-store/livestream-state.js +0 -2
- package/dist/livestream-store/livestream-store.js +0 -58
- package/dist/livestream-store/problems.js +0 -76
- package/dist/livestream-store/stream-key.js +0 -119
- package/dist/livestream-store/websocket-consumer.js +0 -94
- package/dist/player-store/context.js +0 -5
- package/dist/player-store/index.js +0 -9
- package/dist/player-store/player-provider.js +0 -57
- package/dist/player-store/player-state.js +0 -25
- package/dist/player-store/player-store.js +0 -199
- package/dist/player-store/single-player-provider.js +0 -121
- package/dist/streamplace-provider/context.js +0 -5
- package/dist/streamplace-provider/index.js +0 -20
- package/dist/streamplace-provider/poller.js +0 -49
- package/dist/streamplace-provider/xrpc.js +0 -0
- package/dist/streamplace-store/block.js +0 -65
- package/dist/streamplace-store/index.js +0 -6
- package/dist/streamplace-store/stream.js +0 -218
- package/dist/streamplace-store/streamplace-store.js +0 -47
- package/dist/streamplace-store/user.js +0 -52
- package/dist/streamplace-store/xrpc.js +0 -15
- package/dist/ui/index.js +0 -79
- 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
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/67b1eb60 +0 -0
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/7c275f90 +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -6,7 +6,11 @@ import { LivestreamViewHydrated } from "streamplace/src/useful-types";
|
|
|
6
6
|
import { useUrl } from "./streamplace-store";
|
|
7
7
|
import { usePDSAgent } from "./xrpc";
|
|
8
8
|
|
|
9
|
+
import PackageJson from "../../package.json";
|
|
10
|
+
|
|
9
11
|
import { useEffect, useRef } from "react";
|
|
12
|
+
import { Platform } from "react-native";
|
|
13
|
+
import { getBrowserName } from "../lib/browser";
|
|
10
14
|
|
|
11
15
|
const useUploadThumbnail = () => {
|
|
12
16
|
const abortRef = useRef<AbortController | null>(null);
|
|
@@ -123,11 +127,23 @@ export function useCreateStreamRecord() {
|
|
|
123
127
|
let url = useUrl();
|
|
124
128
|
const uploadThumbnail = useUploadThumbnail();
|
|
125
129
|
|
|
126
|
-
return async (
|
|
127
|
-
title
|
|
128
|
-
customThumbnail
|
|
129
|
-
submitPost
|
|
130
|
-
|
|
130
|
+
return async ({
|
|
131
|
+
title,
|
|
132
|
+
customThumbnail,
|
|
133
|
+
submitPost,
|
|
134
|
+
customUrl,
|
|
135
|
+
}: {
|
|
136
|
+
title: string;
|
|
137
|
+
customThumbnail?: Blob;
|
|
138
|
+
submitPost?: boolean;
|
|
139
|
+
customUrl?: string | null;
|
|
140
|
+
}) => {
|
|
141
|
+
if (!submitPost) {
|
|
142
|
+
submitPost = true;
|
|
143
|
+
}
|
|
144
|
+
if (!customUrl) {
|
|
145
|
+
customUrl = null;
|
|
146
|
+
}
|
|
131
147
|
if (!agent) {
|
|
132
148
|
throw new Error("No PDS agent found");
|
|
133
149
|
}
|
|
@@ -136,9 +152,11 @@ export function useCreateStreamRecord() {
|
|
|
136
152
|
throw new Error("No user DID found, assuming not logged in");
|
|
137
153
|
}
|
|
138
154
|
|
|
139
|
-
|
|
155
|
+
// Use customUrl if provided, otherwise fall back to the store URL
|
|
156
|
+
const finalUrl = customUrl || url;
|
|
157
|
+
const u = new URL(finalUrl);
|
|
140
158
|
|
|
141
|
-
|
|
159
|
+
let thumbnail: BlobRef | undefined = undefined;
|
|
142
160
|
|
|
143
161
|
if (customThumbnail) {
|
|
144
162
|
try {
|
|
@@ -185,10 +203,10 @@ export function useCreateStreamRecord() {
|
|
|
185
203
|
|
|
186
204
|
let newPost: undefined | { uri: string; cid: string } = undefined;
|
|
187
205
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const profile = await agent.getProfile({ actor: did });
|
|
206
|
+
const did = agent.did;
|
|
207
|
+
const profile = await agent.getProfile({ actor: did });
|
|
191
208
|
|
|
209
|
+
if (submitPost) {
|
|
192
210
|
if (!profile) {
|
|
193
211
|
throw new Error("No profile found for the user DID");
|
|
194
212
|
}
|
|
@@ -216,10 +234,28 @@ export function useCreateStreamRecord() {
|
|
|
216
234
|
}
|
|
217
235
|
}
|
|
218
236
|
|
|
237
|
+
let platform: string = Platform.OS;
|
|
238
|
+
let platVersion: string = Platform.Version
|
|
239
|
+
? Platform.Version.toString()
|
|
240
|
+
: "";
|
|
241
|
+
// no Platform.Version on web, so use browser name instead
|
|
242
|
+
if (
|
|
243
|
+
platform === "web" &&
|
|
244
|
+
typeof window !== "undefined" &&
|
|
245
|
+
window.navigator
|
|
246
|
+
) {
|
|
247
|
+
platVersion = getBrowserName(window.navigator.userAgent);
|
|
248
|
+
}
|
|
249
|
+
|
|
219
250
|
const record: PlaceStreamLivestream.Record = {
|
|
220
251
|
title: title,
|
|
221
|
-
url:
|
|
252
|
+
url: finalUrl,
|
|
222
253
|
createdAt: new Date().toISOString(),
|
|
254
|
+
// would match up with e.g. https://stream.place/iame.li
|
|
255
|
+
canonicalUrl: `${finalUrl}/${profile.data.handle}`,
|
|
256
|
+
// user agent style string
|
|
257
|
+
// e.g. `@streamplace/components/0.1.0 (ios, 32.0)`
|
|
258
|
+
agent: `@streamplace/components/${PackageJson.version} (${platform}, ${platVersion})`,
|
|
223
259
|
post: newPost,
|
|
224
260
|
thumb: thumbnail,
|
|
225
261
|
};
|
|
@@ -233,7 +269,7 @@ export function useCreateStreamRecord() {
|
|
|
233
269
|
};
|
|
234
270
|
}
|
|
235
271
|
|
|
236
|
-
export function useUpdateStreamRecord() {
|
|
272
|
+
export function useUpdateStreamRecord(customUrl: string | null = null) {
|
|
237
273
|
let agent = usePDSAgent();
|
|
238
274
|
let url = useUrl();
|
|
239
275
|
const uploadThumbnail = useUploadThumbnail();
|
|
@@ -255,6 +291,9 @@ export function useUpdateStreamRecord() {
|
|
|
255
291
|
throw new Error("No latest record");
|
|
256
292
|
}
|
|
257
293
|
|
|
294
|
+
// Use customUrl if provided, otherwise fall back to the store URL
|
|
295
|
+
const finalUrl = customUrl || url;
|
|
296
|
+
|
|
258
297
|
let rkey = livestream.uri.split("/").pop();
|
|
259
298
|
let oldRecordValue: PlaceStreamLivestream.Record = livestream.record;
|
|
260
299
|
|
|
@@ -275,7 +314,7 @@ export function useUpdateStreamRecord() {
|
|
|
275
314
|
|
|
276
315
|
const record: PlaceStreamLivestream.Record = {
|
|
277
316
|
title: title,
|
|
278
|
-
url:
|
|
317
|
+
url: finalUrl,
|
|
279
318
|
createdAt: new Date().toISOString(),
|
|
280
319
|
post: oldRecordValue.post,
|
|
281
320
|
thumb: thumbnail,
|