@hadoku/game-ui 0.1.25 → 0.1.27

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.js CHANGED
@@ -104,6 +104,15 @@ function decorHost(face) {
104
104
  // A face that turns away (a coin's sides) hides what it holds: its overlay stays inside it.
105
105
  if (style.backfaceVisibility === 'hidden')
106
106
  break;
107
+ // A box clipped on purpose to hide its content from sighted eyes — the screen-reader-only idiom
108
+ // (`rooms.css`'s `.rooms__sr`: `clip:rect(0 0 0 0)`), never how a seat's round RING clips (that is
109
+ // `overflow` plus a border-radius, no `clip`/`clip-path` at all) — is not a box to escape: the
110
+ // overlay must stay inside it (a spectator's halo once leaked out of a front-page room card's
111
+ // hidden member list, under the room's own name). Read from the computed STYLE, not a measured
112
+ // size: jsdom lays nothing out, so every box's `getBoundingClientRect()` is 0×0 there regardless
113
+ // of which kind of clip it is.
114
+ if (!['', 'auto'].includes(style.clip) || !['', 'none'].includes(style.clipPath))
115
+ break;
107
116
  if ([style.overflow, style.overflowX, style.overflowY].some((o) => o !== '' && o !== 'visible'))
108
117
  host = box.parentElement;
109
118
  }
@@ -34,6 +34,6 @@ export function SeatList({ slots, iLead, shut = false, fieldFixed = false, realS
34
34
  }
35
35
  const { id, name, avatarId, look, ready, leader, mine } = occupant;
36
36
  const face = { id: avatarId ?? null, look };
37
- 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": ready ? 'true' : 'false', 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, face: face, className: "pod-seats__label" }), _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", "data-testid": "pod-seat-remove", "data-seat": seat, "aria-label": `Remove ${name} from the table`, onPress: () => onRemoveMember(seat, id), children: "Remove" })), onBotReplace !== undefined && (_jsx(ActionButton, { action: "bot-replace", className: "pod-seats__action", "data-testid": "pod-seat-bot-replace", "data-seat": seat, "aria-label": `Put the bot in ${name}'s seat`, onPress: () => onBotReplace(seat, id), children: "Bot" })), onMakeLeader !== undefined && (_jsx(ActionButton, { action: "make-leader", className: "pod-seats__action", "data-testid": "pod-seat-make-leader", "data-seat": seat, "aria-label": `Make ${name} the room leader`, onPress: () => onMakeLeader(id), children: "Lead" }))] }))] }, seat));
37
+ 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": ready ? 'true' : 'false', 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, face: face, className: "pod-seats__label" }), _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", "data-testid": "pod-seat-remove", "data-seat": seat, "aria-label": `Remove ${name} from the table`, onPress: () => onRemoveMember(seat, id), children: "Remove" })), onBotReplace !== undefined && (_jsx(ActionButton, { action: "bot-replace", className: "pod-seats__action", "data-testid": "pod-seat-bot-replace", "data-seat": seat, "aria-label": `Put the bot in ${name}'s seat`, onPress: () => onBotReplace(seat, id), children: "Bot" })), onMakeLeader !== undefined && (_jsx(ActionButton, { action: "make-leader", className: "pod-seats__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));
38
38
  }) }));
39
39
  }
@@ -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, face: faceOf(member), 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", "data-testid": "spectator-make-leader", "data-member": member.id, "aria-label": `Make ${member.name} the room leader`, onPress: () => onMakeLeader(member.id), children: "Lead" }) }))] }, 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" })] }))] })] }));
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, face: faceOf(member), 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", "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.25",
4
- "gitHead": "7bd6f116fbcfe910127a8ca55b0e23e9b33a84c0",
3
+ "version": "0.1.27",
4
+ "gitHead": "4c1814c2cd5b83b9b2c9fcb6534d1956d517ffa2",
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,8 +49,8 @@
49
49
  "react-dom": "^19.2.8"
50
50
  },
51
51
  "dependencies": {
52
- "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.25",
53
- "@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.25",
52
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.27",
53
+ "@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.27",
54
54
  "@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.27",
55
55
  "@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.102",
56
56
  "@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.102",