@hadoku/game-ui 0.1.56 → 0.1.58
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/avatar.d.ts +8 -7
- package/dist/room/avatar.js +10 -8
- package/package.json +6 -6
package/dist/room/avatar.d.ts
CHANGED
|
@@ -11,13 +11,14 @@ export declare function watchpartyOrigin(): string;
|
|
|
11
11
|
/**
|
|
12
12
|
* The image that draws one avatar, or null when there is nothing to draw.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
14
|
+
* The path is watchparty's own media convention, not ours, and it is the room
|
|
15
|
+
* protocol's to spell: `@wolffm/rooms-protocol`'s `avatarPortraitPath`
|
|
16
|
+
* (`square_<id>.png`, plus `?v=<rev>` for art redrawn in place — the sprites are
|
|
17
|
+
* served immutable for a year, so without it a redrawn character kept its old
|
|
18
|
+
* face here). `@wolffm/prefs-client/avatar`'s `ResolvedAvatar` carries no URL
|
|
19
|
+
* for a `sprite` source by design — "the app that owns the art … owns its URL
|
|
20
|
+
* and revision" (its own `.d.ts`). This prefixes the origin, same-origin by
|
|
21
|
+
* construction (no host written down, so a local e2e stays local).
|
|
21
22
|
*
|
|
22
23
|
* Null for an absent, blank or over-long id rather than a URL ending
|
|
23
24
|
* `square_.png`, which is a 404 drawn as a broken image where the caller wanted
|
package/dist/room/avatar.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* keeps one for an account that never picked, so it is the same in every app.
|
|
16
16
|
*/
|
|
17
17
|
import { AVATAR_ID_MAX } from '@wolffm/platform-wire/look';
|
|
18
|
+
import { avatarPortraitPath } from '@wolffm/rooms-protocol';
|
|
18
19
|
/**
|
|
19
20
|
* Watchparty's server, on whatever origin serves this page. In production that
|
|
20
21
|
* is `https://hadoku.me/watchparty` — both apps sit behind the same edge — and
|
|
@@ -30,13 +31,14 @@ export function watchpartyOrigin() {
|
|
|
30
31
|
/**
|
|
31
32
|
* The image that draws one avatar, or null when there is nothing to draw.
|
|
32
33
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
34
|
+
* The path is watchparty's own media convention, not ours, and it is the room
|
|
35
|
+
* protocol's to spell: `@wolffm/rooms-protocol`'s `avatarPortraitPath`
|
|
36
|
+
* (`square_<id>.png`, plus `?v=<rev>` for art redrawn in place — the sprites are
|
|
37
|
+
* served immutable for a year, so without it a redrawn character kept its old
|
|
38
|
+
* face here). `@wolffm/prefs-client/avatar`'s `ResolvedAvatar` carries no URL
|
|
39
|
+
* for a `sprite` source by design — "the app that owns the art … owns its URL
|
|
40
|
+
* and revision" (its own `.d.ts`). This prefixes the origin, same-origin by
|
|
41
|
+
* construction (no host written down, so a local e2e stays local).
|
|
40
42
|
*
|
|
41
43
|
* Null for an absent, blank or over-long id rather than a URL ending
|
|
42
44
|
* `square_.png`, which is a 404 drawn as a broken image where the caller wanted
|
|
@@ -49,7 +51,7 @@ export function avatarSquareUrl(avatarId, origin) {
|
|
|
49
51
|
const id = normalizeAvatarId(avatarId);
|
|
50
52
|
if (id === null)
|
|
51
53
|
return null;
|
|
52
|
-
return `${(origin ?? watchpartyOrigin()).replace(/\/$/, '')}
|
|
54
|
+
return `${(origin ?? watchpartyOrigin()).replace(/\/$/, '')}${avatarPortraitPath(id)}`;
|
|
53
55
|
}
|
|
54
56
|
/** The same two-state reading the server does, so a client cannot send what it would refuse. */
|
|
55
57
|
export function normalizeAvatarId(v) {
|
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.58",
|
|
4
|
+
"gitHead": "5119f426351ddb5c85791ec7568d672924bb5fc3",
|
|
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,13 +49,13 @@
|
|
|
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.62",
|
|
53
|
+
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.62",
|
|
54
54
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.28",
|
|
55
55
|
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.117",
|
|
56
56
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.117",
|
|
57
|
-
"@wolffm/task-ui-components": "npm:@hadoku/task-ui-components@^4.23.
|
|
58
|
-
"@wolffm/themes": "npm:@hadoku/themes@^5.14.
|
|
57
|
+
"@wolffm/task-ui-components": "npm:@hadoku/task-ui-components@^4.23.41",
|
|
58
|
+
"@wolffm/themes": "npm:@hadoku/themes@^5.14.10",
|
|
59
59
|
"@wolffm/watchparty-ui": "npm:@hadoku/watchparty-ui@^0.45.117",
|
|
60
60
|
"socket.io-client": "^4.8.3",
|
|
61
61
|
"zod": "4.5.4"
|