@hadoku/game-ui 0.1.157 → 0.1.159
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/sound/once.d.ts +4 -0
- package/dist/sound/once.js +19 -0
- package/package.json +7 -7
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A one-shot cue sounds for its moment, once a page, however many times the screen that draws the moment is
|
|
3
|
+
* drawn (the operator, 2026-11-28: the coin toss sounded again on going back into the match screen). A screen
|
|
4
|
+
* that remembers what it sounded in its own state forgets it when it unmounts, so the memory is the page's:
|
|
5
|
+
* each cue names its moment by something that outlives the screen (the match and the server's stamp, the
|
|
6
|
+
* match and the frame's number), and only the first ask for a name is told to sound.
|
|
7
|
+
*/
|
|
8
|
+
const sounded = new Set();
|
|
9
|
+
/** Whether the moment named `key` has not sounded on this page yet; asking marks it sounded. */
|
|
10
|
+
export function firstSounding(key) {
|
|
11
|
+
if (sounded.has(key))
|
|
12
|
+
return false;
|
|
13
|
+
sounded.add(key);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
/** Tests: every moment may sound again. */
|
|
17
|
+
export function forgetSoundedForTests() {
|
|
18
|
+
sounded.clear();
|
|
19
|
+
}
|
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.159",
|
|
4
|
+
"gitHead": "486072f92185247fc817ea969b924566c555646f",
|
|
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,14 +54,14 @@
|
|
|
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.163",
|
|
58
|
+
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.163",
|
|
59
59
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.2",
|
|
60
|
-
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.
|
|
61
|
-
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.
|
|
60
|
+
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.144",
|
|
61
|
+
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.144",
|
|
62
62
|
"@wolffm/task-ui-components": "npm:@hadoku/task-ui-components@^4.23.49",
|
|
63
63
|
"@wolffm/themes": "npm:@hadoku/themes@^5.14.19",
|
|
64
|
-
"@wolffm/watchparty-ui": "npm:@hadoku/watchparty-ui@^0.45.
|
|
64
|
+
"@wolffm/watchparty-ui": "npm:@hadoku/watchparty-ui@^0.45.144",
|
|
65
65
|
"socket.io-client": "^4.8.3",
|
|
66
66
|
"zod": "4.5.4"
|
|
67
67
|
},
|