@hadoku/game-ui 0.1.147 → 0.1.148

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.
@@ -26,6 +26,11 @@ export declare const registerWhoamiTier: (value: (r: Pick<WhoamiAnswer, "userTyp
26
26
  export declare function tierOfWhoami(r: Pick<WhoamiAnswer, 'userType'>): Who['tier'];
27
27
  /** Whether the fleet names this viewer friend or above — the server's own friends-only floor (`packages/game-server/src/room/tier-floor.ts`). */
28
28
  export declare function atLeastFriend(who: WhoState): boolean;
29
+ /**
30
+ * Whether the fleet names this viewer wife or admin: an operator, with the room leader's tools in every
31
+ * room (the server's `isOperator`, read from the raw edge tier, never the member-promoting one).
32
+ */
33
+ export declare function isOperatorViewer(who: WhoState): boolean;
29
34
  /** Hands `who` to every `useWhoami` below, which then asks nothing of its own. */
30
35
  export declare function WhoProvider({ who, children }: {
31
36
  who: WhoState;
@@ -34,6 +34,13 @@ export function tierOfWhoami(r) {
34
34
  export function atLeastFriend(who) {
35
35
  return who !== null && who !== 'pending' && rankOf(who.edgeTier) >= rankOf('friend');
36
36
  }
37
+ /**
38
+ * Whether the fleet names this viewer wife or admin: an operator, with the room leader's tools in every
39
+ * room (the server's `isOperator`, read from the raw edge tier, never the member-promoting one).
40
+ */
41
+ export function isOperatorViewer(who) {
42
+ return who !== null && who !== 'pending' && rankOf(who.edgeTier) >= rankOf('wife');
43
+ }
37
44
  /** The page's one resolution, when an app shell above has made it (`../app/GameAppShell.tsx`). */
38
45
  const WhoContext = createContext(undefined);
39
46
  /** Hands `who` to every `useWhoami` below, which then asks nothing of its own. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/game-ui",
3
- "version": "0.1.147",
4
- "gitHead": "deeadc58080e22f1d16dbff80069bb9c844d6765",
3
+ "version": "0.1.148",
4
+ "gitHead": "6a384c4363e40e9f65aea9c1c5f2ecb719434aa1",
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.151",
58
- "@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.151",
57
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.152",
58
+ "@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.152",
59
59
  "@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.2",
60
60
  "@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.143",
61
61
  "@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.143",