@streamplace/components 0.7.14 → 0.7.17

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