@hadoku/game-ui 0.1.55 → 0.1.57
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
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) {
|
|
@@ -13,7 +13,7 @@ export interface SettingsParts {
|
|
|
13
13
|
onScaled: () => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const registerSettings: (value: SettingsParts) => void;
|
|
16
|
-
/** The settings as tabs, in the order a player looks for them: how the game plays
|
|
16
|
+
/** The settings as tabs, in the order a player looks for them: how the game plays (and the UI scale, under it), then sound. */
|
|
17
17
|
export declare const CARDTABLE_SETTINGS_TABS: AppSettingsTab[];
|
|
18
18
|
/** Every tab's sections one under another, for a popout with no tabs of its own. */
|
|
19
19
|
export declare function CardtableSettings(): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
3
|
* Cardtable's own settings: one panel, drawn by whichever host is around the game.
|
|
4
4
|
*
|
|
@@ -32,15 +32,14 @@ import { registered } from "../registered.js";
|
|
|
32
32
|
import './settings.css';
|
|
33
33
|
const parts = registered('settings');
|
|
34
34
|
export const registerSettings = parts.set;
|
|
35
|
-
/** The settings as tabs, in the order a player looks for them: how the game plays
|
|
35
|
+
/** The settings as tabs, in the order a player looks for them: how the game plays (and the UI scale, under it), then sound. */
|
|
36
36
|
export const CARDTABLE_SETTINGS_TABS = [
|
|
37
37
|
{
|
|
38
38
|
id: 'game',
|
|
39
39
|
label: 'Game',
|
|
40
|
-
render: () =>
|
|
40
|
+
render: () => (_jsxs("div", { className: "ct-settings__tab", children: [createElement(parts.get().Game), _jsx(DisplaySettings, {})] })),
|
|
41
41
|
},
|
|
42
42
|
{ id: 'sound', label: 'Sound', render: () => _jsx("div", { className: "ct-settings__tab", children: createElement(parts.get().Sound) }) },
|
|
43
|
-
{ id: 'display', label: 'Display', render: () => _jsx("div", { className: "ct-settings__tab", children: _jsx(DisplaySettings, {}) }) },
|
|
44
43
|
];
|
|
45
44
|
/** Every tab's sections one under another, for a popout with no tabs of its own. */
|
|
46
45
|
export function CardtableSettings() {
|
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.57",
|
|
4
|
+
"gitHead": "ac68d11a0057750d0f231f6502f9710f9e3d855d",
|
|
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.
|
|
53
|
-
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.
|
|
52
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.61",
|
|
53
|
+
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.61",
|
|
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",
|