@hadoku/game-ui 0.1.74 → 0.1.76
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/seats/platform.d.ts +13 -1
- package/dist/seats/platform.js +14 -1
- package/package.json +7 -7
package/dist/seats/platform.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export interface PlatformSeatRoom {
|
|
|
25
25
|
avatarId?: string;
|
|
26
26
|
look?: Look;
|
|
27
27
|
}[];
|
|
28
|
+
/** The room body's `here`: the members in the room now. Absent (a server that cannot say): every member is. */
|
|
29
|
+
here?: readonly string[];
|
|
28
30
|
/** The bot at each seat, in seat order. Absent (an older server): a bot is drawn faceless, as "Bot". */
|
|
29
31
|
aiSeats?: readonly (AiPersona | null)[];
|
|
30
32
|
}
|
|
@@ -34,7 +36,7 @@ export interface PlatformSeats {
|
|
|
34
36
|
realSeatCount: number;
|
|
35
37
|
/** The viewer's seat, or null while watching. */
|
|
36
38
|
mySeat: number | null;
|
|
37
|
-
/** Every member who holds no seat, as `SpectatorRow` takes them. */
|
|
39
|
+
/** Every member in the room now who holds no seat, as `SpectatorRow` takes them. */
|
|
38
40
|
spectators: {
|
|
39
41
|
id: string;
|
|
40
42
|
name: string;
|
|
@@ -48,4 +50,14 @@ export interface PlatformSeatsOptions {
|
|
|
48
50
|
/** `false` for a game with no Ready step (its Start is a press, never a readiness gate): every member reads ready, so no ring says "not ready" for no reason. */
|
|
49
51
|
readiness?: boolean;
|
|
50
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The members who are in the room now, of `members`: the ones a spectator row may name. A member
|
|
55
|
+
* stays one after their last screen closes (their seat and their sign-up are kept), but only
|
|
56
|
+
* someone connected to the room is watching it (the operator, 2026-11-19). `here` is the room
|
|
57
|
+
* body's, the chat's own roster; the viewer is always in, since their own screen is the proof and
|
|
58
|
+
* its room connection may open a moment after the body is read. Absent `here`: everyone.
|
|
59
|
+
*/
|
|
60
|
+
export declare function membersHere<M extends {
|
|
61
|
+
id: string;
|
|
62
|
+
}>(members: readonly M[], here: readonly string[] | undefined, myId: string | null): M[];
|
|
51
63
|
export declare function platformSeats(room: PlatformSeatRoom, myId: string | null, opts: PlatformSeatsOptions): PlatformSeats;
|
package/dist/seats/platform.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { AI_SEAT, CLOSED_SEAT } from '@wolffm/platform-wire/seats';
|
|
2
|
+
/**
|
|
3
|
+
* The members who are in the room now, of `members`: the ones a spectator row may name. A member
|
|
4
|
+
* stays one after their last screen closes (their seat and their sign-up are kept), but only
|
|
5
|
+
* someone connected to the room is watching it (the operator, 2026-11-19). `here` is the room
|
|
6
|
+
* body's, the chat's own roster; the viewer is always in, since their own screen is the proof and
|
|
7
|
+
* its room connection may open a moment after the body is read. Absent `here`: everyone.
|
|
8
|
+
*/
|
|
9
|
+
export function membersHere(members, here, myId) {
|
|
10
|
+
if (here === undefined)
|
|
11
|
+
return [...members];
|
|
12
|
+
const inRoom = new Set(here);
|
|
13
|
+
return members.filter((m) => m.id === myId || inRoom.has(m.id));
|
|
14
|
+
}
|
|
2
15
|
export function platformSeats(room, myId, opts) {
|
|
3
16
|
const memberOf = (id) => room.members.find((m) => m.id === id);
|
|
4
17
|
const occupantOf = (holder, seat) => {
|
|
@@ -34,7 +47,7 @@ export function platformSeats(room, myId, opts) {
|
|
|
34
47
|
if (full && realSeatCount < opts.ceiling)
|
|
35
48
|
slots.push({ seat: realSeatCount, occupant: { kind: 'open' } });
|
|
36
49
|
const seated = new Set(room.seats);
|
|
37
|
-
const spectators = room.members
|
|
50
|
+
const spectators = membersHere(room.members, room.here, myId)
|
|
38
51
|
.filter((m) => !seated.has(m.id))
|
|
39
52
|
.map((m) => ({ id: m.id, name: m.name, ...(m.avatarId === undefined ? {} : { avatarId: m.avatarId }), ...(m.look === undefined ? {} : { look: m.look }) }));
|
|
40
53
|
return { slots, realSeatCount, mySeat, spectators };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/game-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.76",
|
|
4
|
+
"gitHead": "dd377be610a6dfbc7ae437241d9fdd3b1ef56c57",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The browser parts any hosted game shares, above ui-shell: the room shell and session, seats and looks, the room route, the front page's generic pieces (gate, polls, gallery, patch notes), the bundle slot and relay channel a game's client mounts in, settings and trim screens, the HTTP and socket helpers, and the generic components (modal, popover, avatar, action button, radio cards). Knows no game; Magic's UI (games/magic/ui) plugs in, composed by the site (apps/ui). MIT; imports only react, react-dom, socket.io-client, @wolffm/* and the platform packages.",
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
"react-dom": "^19.2.8"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
53
|
-
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.
|
|
52
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.80",
|
|
53
|
+
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.80",
|
|
54
54
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.31",
|
|
55
|
-
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.
|
|
56
|
-
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.
|
|
55
|
+
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.124",
|
|
56
|
+
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.124",
|
|
57
57
|
"@wolffm/task-ui-components": "npm:@hadoku/task-ui-components@^4.23.44",
|
|
58
58
|
"@wolffm/themes": "npm:@hadoku/themes@^5.14.13",
|
|
59
|
-
"@wolffm/watchparty-ui": "npm:@hadoku/watchparty-ui@^0.45.
|
|
59
|
+
"@wolffm/watchparty-ui": "npm:@hadoku/watchparty-ui@^0.45.124",
|
|
60
60
|
"socket.io-client": "^4.8.3",
|
|
61
61
|
"zod": "4.5.4"
|
|
62
62
|
},
|