@streamplace/components 0.9.0 → 0.9.1
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.d.ts.map +1 -1
- package/dist/components/chat/chat-box.js +90 -34
- package/dist/components/chat/chat-box.js.map +1 -1
- package/dist/components/chat/chat-message.d.ts +4 -0
- package/dist/components/chat/chat-message.d.ts.map +1 -1
- package/dist/components/chat/chat-message.js +3 -2
- package/dist/components/chat/chat-message.js.map +1 -1
- package/dist/components/chat/chat.d.ts.map +1 -1
- package/dist/components/chat/chat.js +56 -3
- package/dist/components/chat/chat.js.map +1 -1
- package/dist/components/chat/emoji-suggestions.d.ts.map +1 -1
- package/dist/components/chat/emoji-suggestions.js +11 -11
- package/dist/components/chat/emoji-suggestions.js.map +1 -1
- package/dist/components/chat/mention-suggestions.d.ts.map +1 -1
- package/dist/components/chat/mention-suggestions.js +20 -19
- package/dist/components/chat/mention-suggestions.js.map +1 -1
- package/dist/components/chat/system-message.d.ts +5 -1
- package/dist/components/chat/system-message.d.ts.map +1 -1
- package/dist/components/chat/system-message.js +4 -4
- package/dist/components/chat/system-message.js.map +1 -1
- package/dist/components/mobile-player/shared.d.ts +1 -1
- package/dist/components/mobile-player/shared.d.ts.map +1 -1
- package/dist/components/mobile-player/shared.js +11 -10
- package/dist/components/mobile-player/shared.js.map +1 -1
- package/dist/components/mobile-player/ui/viewer-context-menu.d.ts +1 -1
- package/dist/components/mobile-player/ui/viewer-context-menu.d.ts.map +1 -1
- package/dist/components/mobile-player/ui/viewer-context-menu.js +60 -43
- package/dist/components/mobile-player/ui/viewer-context-menu.js.map +1 -1
- package/dist/components/stream-notification/index.d.ts +3 -0
- package/dist/components/stream-notification/index.d.ts.map +1 -0
- package/dist/components/stream-notification/index.js +9 -0
- package/dist/components/stream-notification/index.js.map +1 -0
- package/dist/components/stream-notification/stream-notification-manager.d.ts +36 -0
- package/dist/components/stream-notification/stream-notification-manager.d.ts.map +1 -0
- package/dist/components/stream-notification/stream-notification-manager.js +96 -0
- package/dist/components/stream-notification/stream-notification-manager.js.map +1 -0
- package/dist/components/stream-notification/stream-notification.d.ts +5 -0
- package/dist/components/stream-notification/stream-notification.d.ts.map +1 -0
- package/dist/components/stream-notification/stream-notification.js +146 -0
- package/dist/components/stream-notification/stream-notification.js.map +1 -0
- package/dist/components/stream-notification/teleport-notification.d.ts +8 -0
- package/dist/components/stream-notification/teleport-notification.d.ts.map +1 -0
- package/dist/components/stream-notification/teleport-notification.js +116 -0
- package/dist/components/stream-notification/teleport-notification.js.map +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +7 -0
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +2 -2
- package/dist/components/ui/dropdown.d.ts +4 -0
- package/dist/components/ui/dropdown.d.ts.map +1 -1
- package/dist/components/ui/dropdown.js +41 -15
- package/dist/components/ui/dropdown.js.map +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/portal.d.ts +2 -0
- package/dist/components/ui/portal.d.ts.map +1 -0
- package/dist/components/ui/portal.js +5 -0
- package/dist/components/ui/portal.js.map +1 -0
- package/dist/components/ui/portal.web.d.ts +11 -0
- package/dist/components/ui/portal.web.d.ts.map +1 -0
- package/dist/components/ui/portal.web.js +22 -0
- package/dist/components/ui/portal.web.js.map +1 -0
- package/dist/components/ui/resizeable.d.ts +2 -1
- package/dist/components/ui/resizeable.d.ts.map +1 -1
- package/dist/components/ui/resizeable.js +68 -26
- package/dist/components/ui/resizeable.js.map +1 -1
- package/dist/components/ui/text.d.ts +1 -1
- package/dist/components/ui/view.d.ts +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/slash-commands/teleport.d.ts +4 -0
- package/dist/lib/slash-commands/teleport.d.ts.map +1 -0
- package/dist/lib/slash-commands/teleport.js +110 -0
- package/dist/lib/slash-commands/teleport.js.map +1 -0
- package/dist/lib/slash-commands.d.ts +16 -0
- package/dist/lib/slash-commands.d.ts.map +1 -0
- package/dist/lib/slash-commands.js +46 -0
- package/dist/lib/slash-commands.js.map +1 -0
- package/dist/lib/stream-notifications.d.ts +13 -0
- package/dist/lib/stream-notifications.d.ts.map +1 -0
- package/dist/lib/stream-notifications.js +46 -0
- package/dist/lib/stream-notifications.js.map +1 -0
- package/dist/lib/system-messages.d.ts +4 -8
- package/dist/lib/system-messages.d.ts.map +1 -1
- package/dist/lib/system-messages.js +38 -2
- package/dist/lib/system-messages.js.map +1 -1
- package/dist/lib/theme/atoms.d.ts +193 -193
- package/dist/livestream-provider/index.d.ts +7 -2
- package/dist/livestream-provider/index.d.ts.map +1 -1
- package/dist/livestream-provider/index.js +72 -4
- package/dist/livestream-provider/index.js.map +1 -1
- package/dist/livestream-store/livestream-state.d.ts +4 -1
- package/dist/livestream-store/livestream-state.d.ts.map +1 -1
- package/dist/livestream-store/livestream-store.d.ts.map +1 -1
- package/dist/livestream-store/livestream-store.js +3 -0
- package/dist/livestream-store/livestream-store.js.map +1 -1
- package/dist/livestream-store/websocket-consumer.d.ts.map +1 -1
- package/dist/livestream-store/websocket-consumer.js +30 -43
- package/dist/livestream-store/websocket-consumer.js.map +1 -1
- package/dist/streamplace-store/index.d.ts +1 -0
- package/dist/streamplace-store/index.d.ts.map +1 -1
- package/dist/streamplace-store/index.js +1 -0
- package/dist/streamplace-store/index.js.map +1 -1
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
- package/package.json +4 -2
- package/src/components/chat/chat-box.tsx +126 -53
- package/src/components/chat/chat-message.tsx +1 -1
- package/src/components/chat/chat.tsx +79 -5
- package/src/components/chat/emoji-suggestions.tsx +27 -25
- package/src/components/chat/mention-suggestions.tsx +36 -33
- package/src/components/chat/system-message.tsx +14 -5
- package/src/components/mobile-player/shared.tsx +2 -1
- package/src/components/mobile-player/ui/viewer-context-menu.tsx +192 -166
- package/src/components/stream-notification/index.ts +5 -0
- package/src/components/stream-notification/stream-notification-manager.ts +140 -0
- package/src/components/stream-notification/stream-notification.tsx +227 -0
- package/src/components/stream-notification/teleport-notification.tsx +187 -0
- package/src/components/ui/button.tsx +7 -0
- package/src/components/ui/dropdown.tsx +96 -26
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/portal.tsx +1 -0
- package/src/components/ui/portal.web.tsx +37 -0
- package/src/components/ui/resizeable.tsx +89 -35
- package/src/index.tsx +3 -0
- package/src/lib/slash-commands/teleport.ts +136 -0
- package/src/lib/slash-commands.ts +65 -0
- package/src/lib/stream-notifications.ts +51 -0
- package/src/lib/system-messages.ts +52 -2
- package/src/livestream-provider/index.tsx +106 -3
- package/src/livestream-store/livestream-state.tsx +4 -0
- package/src/livestream-store/livestream-store.tsx +3 -0
- package/src/livestream-store/websocket-consumer.tsx +35 -54
- package/src/streamplace-store/index.tsx +1 -0
|
@@ -22,6 +22,9 @@ export const makeLivestreamStore = (): StoreApi<LivestreamState> => {
|
|
|
22
22
|
authors: {},
|
|
23
23
|
recentSegments: [],
|
|
24
24
|
problems: [],
|
|
25
|
+
activeTeleport: null,
|
|
26
|
+
activeTeleportUri: null,
|
|
27
|
+
setActiveTeleportUri: (uri) => set({ activeTeleportUri: uri }),
|
|
25
28
|
websocketConnected: false,
|
|
26
29
|
hasReceivedSegment: false,
|
|
27
30
|
moderationPermissions: [],
|
|
@@ -7,10 +7,11 @@ import {
|
|
|
7
7
|
PlaceStreamChatMessage,
|
|
8
8
|
PlaceStreamDefs,
|
|
9
9
|
PlaceStreamLivestream,
|
|
10
|
-
|
|
10
|
+
PlaceStreamLiveTeleport,
|
|
11
11
|
PlaceStreamSegment,
|
|
12
12
|
} from "streamplace";
|
|
13
13
|
import { SystemMessages } from "../lib/system-messages";
|
|
14
|
+
import { formatHandleWithAt } from "../utils/format-handle";
|
|
14
15
|
import { reduceChat } from "./chat";
|
|
15
16
|
import { LivestreamState } from "./livestream-state";
|
|
16
17
|
import { findProblems } from "./problems";
|
|
@@ -121,65 +122,45 @@ export const handleWebSocketMessages = (
|
|
|
121
122
|
pendingHides: newPendingHides,
|
|
122
123
|
};
|
|
123
124
|
state = reduceChat(state, [], [], [hiddenMessageUri]);
|
|
124
|
-
} else if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// This can be a new permission or a deletion marker
|
|
134
|
-
const permRecord = message as
|
|
135
|
-
| PlaceStreamModerationPermission.Record
|
|
136
|
-
| { deleted?: boolean; rkey?: string; streamer?: string };
|
|
125
|
+
} else if (PlaceStreamLiveTeleport.isRecord(message)) {
|
|
126
|
+
const teleportRecord = message as PlaceStreamLiveTeleport.Record;
|
|
127
|
+
state = {
|
|
128
|
+
...state,
|
|
129
|
+
activeTeleport: teleportRecord,
|
|
130
|
+
};
|
|
131
|
+
} else if (PlaceStreamLivestream.isTeleportArrival(message)) {
|
|
132
|
+
// teleport has succeeded, we are now at the target stream
|
|
133
|
+
const arrival = message as PlaceStreamLivestream.TeleportArrival;
|
|
137
134
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// The useCanModerate hook will refetch and repopulate
|
|
135
|
+
// add the teleporter's chat profile to the authors cache FIRST so mention rendering works
|
|
136
|
+
if (arrival.chatProfile && arrival.source.did) {
|
|
141
137
|
state = {
|
|
142
138
|
...state,
|
|
143
|
-
|
|
139
|
+
authors: {
|
|
140
|
+
...state.authors,
|
|
141
|
+
[arrival.source.did]: arrival.chatProfile,
|
|
142
|
+
},
|
|
144
143
|
};
|
|
145
|
-
}
|
|
146
|
-
// Handle new/updated permission: add or update in the list
|
|
147
|
-
// Use createdAt as a unique identifier since multiple records can exist for the same moderator
|
|
148
|
-
// (e.g., one record with "ban" permission, another with "hide" permission)
|
|
149
|
-
// Note: rkey would be ideal but isn't always present in the WebSocket message
|
|
150
|
-
const newPerm =
|
|
151
|
-
permRecord as PlaceStreamModerationPermission.Record & {
|
|
152
|
-
rkey?: string;
|
|
153
|
-
};
|
|
154
|
-
const existingIndex = state.moderationPermissions.findIndex((p) => {
|
|
155
|
-
const pWithRkey = p as PlaceStreamModerationPermission.Record & {
|
|
156
|
-
rkey?: string;
|
|
157
|
-
};
|
|
158
|
-
// Prefer matching by rkey if available, fall back to createdAt
|
|
159
|
-
if (newPerm.rkey && pWithRkey.rkey) {
|
|
160
|
-
return pWithRkey.rkey === newPerm.rkey;
|
|
161
|
-
}
|
|
162
|
-
return (
|
|
163
|
-
p.moderator === newPerm.moderator &&
|
|
164
|
-
p.createdAt === newPerm.createdAt
|
|
165
|
-
);
|
|
166
|
-
});
|
|
144
|
+
}
|
|
167
145
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
146
|
+
const systemMessage = SystemMessages.teleportArrival(
|
|
147
|
+
formatHandleWithAt(arrival.source),
|
|
148
|
+
arrival.source.did,
|
|
149
|
+
arrival.viewerCount,
|
|
150
|
+
arrival.chatProfile,
|
|
151
|
+
);
|
|
152
|
+
// set proper times
|
|
153
|
+
systemMessage.indexedAt = arrival.startsAt;
|
|
154
|
+
systemMessage.record.createdAt = arrival.startsAt;
|
|
177
155
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
156
|
+
state = reduceChat(state, [systemMessage], []);
|
|
157
|
+
} else if (PlaceStreamLivestream.isTeleportCanceled(message)) {
|
|
158
|
+
// teleport was canceled (deleted or denied)
|
|
159
|
+
state = {
|
|
160
|
+
...state,
|
|
161
|
+
activeTeleport: null,
|
|
162
|
+
activeTeleportUri: null,
|
|
163
|
+
};
|
|
183
164
|
}
|
|
184
165
|
}
|
|
185
166
|
}
|