@hadoku/game-ui 0.1.164 → 0.1.166
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/room/look.d.ts +6 -8
- package/dist/room/look.js +12 -21
- package/dist/seats/SeatChip.js +1 -1
- package/dist/seats/SpectatorRow.js +1 -1
- package/package.json +4 -4
package/dist/room/look.d.ts
CHANGED
|
@@ -21,15 +21,13 @@ export declare const FaceDecor: import("react").NamedExoticComponent<{
|
|
|
21
21
|
look: Look | undefined;
|
|
22
22
|
}>;
|
|
23
23
|
/**
|
|
24
|
-
* A person's name,
|
|
25
|
-
*
|
|
24
|
+
* A person's name, plain, the same for everyone: their name's effect, gradient and font are the
|
|
25
|
+
* chat's alone (the operator, 2026-11-29: *"keep the name display the same for everyone … chat
|
|
26
|
+
* effects like name font, name style are kept only to the chat"*). Their face and its overlay are
|
|
27
|
+
* drawn everywhere (`components/Avatar.tsx`, `FaceDecor`).
|
|
26
28
|
*/
|
|
27
|
-
export declare
|
|
29
|
+
export declare function PlayerName({ name, className, testId }: {
|
|
28
30
|
name: string;
|
|
29
|
-
face: {
|
|
30
|
-
id: string | null | undefined;
|
|
31
|
-
look?: Look | undefined;
|
|
32
|
-
};
|
|
33
31
|
className?: string;
|
|
34
32
|
testId?: string;
|
|
35
|
-
}
|
|
33
|
+
}): import("react").JSX.Element;
|
package/dist/room/look.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* A person's look on our screens: their avatar picture
|
|
4
|
-
* on it
|
|
3
|
+
* A person's look on our screens: their avatar picture and the overlay they wear
|
|
4
|
+
* on it. Their name's effect, gradient and font are the chat's alone (`PlayerName`).
|
|
5
5
|
*
|
|
6
6
|
* The operator, 2026-11-05: *"picture/character are the same thing and all
|
|
7
7
|
* over the entire site it's the same avatar. we must display all
|
|
8
8
|
* customizations everywhere."* So this is drawn with the fleet's own renderer
|
|
9
9
|
* (`@wolffm/prefs-client/cosmetics`), the one watchparty's chat and the avatar
|
|
10
|
-
* dialog use, and every face (`components/Avatar.tsx`)
|
|
11
|
-
* (`PlayerName`)
|
|
10
|
+
* dialog use, and every face (`components/Avatar.tsx`) goes through it. Names
|
|
11
|
+
* left that ruling on 2026-11-29 (`PlayerName`).
|
|
12
12
|
*
|
|
13
13
|
* - What someone wears arrives with their face, resolved by our server
|
|
14
14
|
* (`packages/game-server/src/people.ts`), and is cleaned again here (`cleanWorn`), so
|
|
@@ -21,7 +21,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
21
21
|
*/
|
|
22
22
|
import { memo, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
23
23
|
import { createPortal } from 'react-dom';
|
|
24
|
-
import { cleanWorn, decorHtml,
|
|
24
|
+
import { cleanWorn, decorHtml, onPictureColour, pictureColour, readPictureColour } from '@wolffm/prefs-client/cosmetics';
|
|
25
25
|
import { watchpartyOrigin } from "./avatar.js";
|
|
26
26
|
import './look.css';
|
|
27
27
|
/** What a person wears, safe to draw, or undefined. */
|
|
@@ -198,20 +198,11 @@ export const FaceDecor = memo(function FaceDecor({ avatarId, look }) {
|
|
|
198
198
|
});
|
|
199
199
|
// ── A name ───────────────────────────────────────────────────────────────────
|
|
200
200
|
/**
|
|
201
|
-
* A person's name,
|
|
202
|
-
*
|
|
201
|
+
* A person's name, plain, the same for everyone: their name's effect, gradient and font are the
|
|
202
|
+
* chat's alone (the operator, 2026-11-29: *"keep the name display the same for everyone … chat
|
|
203
|
+
* effects like name font, name style are kept only to the chat"*). Their face and its overlay are
|
|
204
|
+
* drawn everywhere (`components/Avatar.tsx`, `FaceDecor`).
|
|
203
205
|
*/
|
|
204
|
-
export
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const dressed = worn !== undefined && (worn.effect !== undefined || worn.gradient !== undefined || worn.font !== undefined);
|
|
208
|
-
const colour = usePersonColour(face.id ?? undefined, face.look);
|
|
209
|
-
useEffect(() => {
|
|
210
|
-
const el = ref.current;
|
|
211
|
-
return el === null || !dressed ? undefined : idleWhenHidden(el);
|
|
212
|
-
}, [dressed]);
|
|
213
|
-
if (!dressed) {
|
|
214
|
-
return className === undefined && testId === undefined ? (_jsx(_Fragment, { children: name })) : (_jsx("span", { className: className, "data-testid": testId, children: name }));
|
|
215
|
-
}
|
|
216
|
-
return _jsx("span", { ref: ref, className: className, style: colour, "data-testid": testId, "data-dressed": "", dangerouslySetInnerHTML: { __html: nameHtml(name, worn) } });
|
|
217
|
-
});
|
|
206
|
+
export function PlayerName({ name, className, testId }) {
|
|
207
|
+
return className === undefined && testId === undefined ? (_jsx(_Fragment, { children: name })) : (_jsx("span", { className: className, "data-testid": testId, children: name }));
|
|
208
|
+
}
|
package/dist/seats/SeatChip.js
CHANGED
|
@@ -41,6 +41,6 @@ export function SeatList({ slots, iLead, shut = false, readiness = true, fieldFi
|
|
|
41
41
|
}
|
|
42
42
|
const { id, name, avatarId, look, ready, leader, mine } = occupant;
|
|
43
43
|
const face = { id: avatarId ?? null, look };
|
|
44
|
-
return (_jsxs("li", { className: "pod-seats__seat", "data-testid": `pod-seat-${seat}`, "data-mine": mine ? '' : undefined, children: [_jsxs("span", { className: "pod-seats__avatar-wrap", children: [_jsx("span", { className: "pod-seats__avatar", "data-ready": readiness ? (ready ? 'true' : 'false') : undefined, children: _jsx(Avatar, { ...face, fallback: "initial", name: name, className: "pod-seats__avatar-img", fallbackClassName: "pod-seats__avatar-fallback" }) }), leader && (_jsxs("svg", { className: "pod-seats__crown", "data-testid": `pod-seat-${seat}-leader`, viewBox: "0 0 12 12", role: "img", "aria-label": "Room owner", children: [_jsx("title", { children: "Room owner" }), _jsx("path", { d: SEAT_CROWN_PATH })] }))] }), _jsx(PlayerName, { name: name,
|
|
44
|
+
return (_jsxs("li", { className: "pod-seats__seat", "data-testid": `pod-seat-${seat}`, "data-mine": mine ? '' : undefined, children: [_jsxs("span", { className: "pod-seats__avatar-wrap", children: [_jsx("span", { className: "pod-seats__avatar", "data-ready": readiness ? (ready ? 'true' : 'false') : undefined, children: _jsx(Avatar, { ...face, fallback: "initial", name: name, className: "pod-seats__avatar-img", fallbackClassName: "pod-seats__avatar-fallback" }) }), leader && (_jsxs("svg", { className: "pod-seats__crown", "data-testid": `pod-seat-${seat}-leader`, viewBox: "0 0 12 12", role: "img", "aria-label": "Room owner", children: [_jsx("title", { children: "Room owner" }), _jsx("path", { d: SEAT_CROWN_PATH })] }))] }), _jsx(PlayerName, { name: name, className: "pod-seats__label" }), readiness && _jsx(StatusPill, { testId: `pod-seat-${seat}-ready`, state: ready ? 'yes' : 'no', mark: ready ? 'tick' : 'ring', label: ready ? 'ready' : 'not ready' }), iLead && !mine && (onRemoveMember !== undefined || onBotReplace !== undefined || onMakeLeader !== undefined) && (_jsxs("span", { className: "pod-seats__actions", children: [onRemoveMember !== undefined && (_jsx(ActionButton, { action: "remove", className: "pod-seats__action ct-action", "data-testid": "pod-seat-remove", "data-seat": seat, "aria-label": `Remove ${name} from the table`, onPress: () => onRemoveMember(seat, id), children: _jsx("span", { className: "ct-action__label", children: "Remove" }) })), onBotReplace !== undefined && (_jsx(ActionButton, { action: "bot-replace", className: "pod-seats__action ct-action", "data-testid": "pod-seat-bot-replace", "data-seat": seat, "aria-label": `Put the bot in ${name}'s seat`, onPress: () => onBotReplace(seat, id), children: _jsx("span", { className: "ct-action__label", children: "Bot" }) })), onMakeLeader !== undefined && (_jsx(ActionButton, { action: "make-leader", className: "pod-seats__action ct-action", "data-testid": "pod-seat-make-leader", "data-seat": seat, "aria-label": `Make ${name} the room leader`, onPress: () => onMakeLeader(id), children: _jsx("svg", { className: "pod-seats__action-icon", viewBox: "0 0 12 12", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: SEAT_CROWN_PATH }) }) }))] }))] }, seat));
|
|
45
45
|
}) }));
|
|
46
46
|
}
|
|
@@ -18,5 +18,5 @@ import { SEAT_CROWN_PATH } from "./SeatChip.js";
|
|
|
18
18
|
export function SpectatorRow({ spectators, myId, leaderId, onWatch, watchDisabled = false, under = false, onMakeLeader }) {
|
|
19
19
|
if (spectators.length === 0 && onWatch === undefined)
|
|
20
20
|
return null;
|
|
21
|
-
return (_jsxs("div", { className: under ? 'table-side table-side--under' : 'table-side', "data-testid": "room-spectators", children: [_jsx("h3", { className: "table-side__heading", children: "Spectators" }), _jsxs("ul", { className: "pod-seats", children: [spectators.map((member) => (_jsxs("li", { className: "pod-seats__seat", "data-testid": "room-spectator", "data-member": member.id, "data-mine": member.id === myId ? '' : undefined, children: [_jsxs("span", { className: "pod-seats__avatar-wrap", children: [_jsx("span", { className: "pod-seats__avatar", children: _jsx(Avatar, { ...faceOf(member), fallback: "initial", name: member.name, className: "pod-seats__avatar-img", fallbackClassName: "pod-seats__avatar-fallback" }) }), member.id === leaderId && leaderId !== '' && (_jsxs("svg", { className: "pod-seats__crown", viewBox: "0 0 12 12", role: "img", "aria-label": "Room owner", children: [_jsx("title", { children: "Room owner" }), _jsx("path", { d: SEAT_CROWN_PATH })] }))] }), _jsx(PlayerName, { name: member.name,
|
|
21
|
+
return (_jsxs("div", { className: under ? 'table-side table-side--under' : 'table-side', "data-testid": "room-spectators", children: [_jsx("h3", { className: "table-side__heading", children: "Spectators" }), _jsxs("ul", { className: "pod-seats", children: [spectators.map((member) => (_jsxs("li", { className: "pod-seats__seat", "data-testid": "room-spectator", "data-member": member.id, "data-mine": member.id === myId ? '' : undefined, children: [_jsxs("span", { className: "pod-seats__avatar-wrap", children: [_jsx("span", { className: "pod-seats__avatar", children: _jsx(Avatar, { ...faceOf(member), fallback: "initial", name: member.name, className: "pod-seats__avatar-img", fallbackClassName: "pod-seats__avatar-fallback" }) }), member.id === leaderId && leaderId !== '' && (_jsxs("svg", { className: "pod-seats__crown", viewBox: "0 0 12 12", role: "img", "aria-label": "Room owner", children: [_jsx("title", { children: "Room owner" }), _jsx("path", { d: SEAT_CROWN_PATH })] }))] }), _jsx(PlayerName, { name: member.name, className: "pod-seats__label" }), onMakeLeader !== undefined && member.id !== myId && (_jsx("span", { className: "pod-seats__actions", children: _jsx(ActionButton, { action: "make-leader", className: "pod-seats__action ct-action", "data-testid": "spectator-make-leader", "data-member": member.id, "aria-label": `Make ${member.name} the room leader`, onPress: () => onMakeLeader(member.id), children: _jsx("svg", { className: "pod-seats__action-icon", viewBox: "0 0 12 12", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: SEAT_CROWN_PATH }) }) }) }))] }, member.id))), onWatch !== undefined && (_jsxs("li", { className: "pod-seats__seat", children: [_jsx(ActionButton, { action: "stand", className: "pod-seats__avatar pod-seats__avatar--open", "data-testid": "seat-stand", "aria-label": "Spectate", disabled: watchDisabled, onPress: onWatch, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M12 5v14M5 12h14" }) }) }), _jsx("span", { className: "pod-seats__label", children: "Open" })] }))] })] }));
|
|
22
22
|
}
|
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.166",
|
|
4
|
+
"gitHead": "b29326259cf8d3aece629c64ad3d4bcaeab77bd9",
|
|
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.",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"react-dom": "^19.2.8"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
58
|
-
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.
|
|
57
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.170",
|
|
58
|
+
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.170",
|
|
59
59
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.2",
|
|
60
60
|
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.144",
|
|
61
61
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.144",
|