@hadoku/game-ui 0.1.92 → 0.1.94
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/usage.d.ts +6 -3
- package/dist/usage.js +13 -8
- package/package.json +4 -4
package/dist/usage.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { targetName, type UsageDeps as ShellUsageDeps } from '@wolffm/ui-shell/usage';
|
|
1
|
+
import { targetName, type UsageAddress, type UsageDeps as ShellUsageDeps } from '@wolffm/ui-shell/usage';
|
|
2
2
|
export { targetName };
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The screen an address shows, by its route's kind; a room's table is its own screen, and a table's
|
|
5
|
+
* full-screen step (`room/table/<step>`) its own again.
|
|
6
|
+
*/
|
|
7
|
+
export declare function screenOf(address: UsageAddress, base?: string): string;
|
|
5
8
|
export declare function startUsage(deps?: Partial<ShellUsageDeps>): () => void;
|
package/dist/usage.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cardtable's own wiring for the shell's generic usage counter (`@hadoku/ui-shell/usage`): the URL
|
|
3
|
-
* to post to and how
|
|
3
|
+
* to post to and how an address names a screen, a room's table counted apart from its room.
|
|
4
4
|
*/
|
|
5
5
|
import { USAGE_BATCH_MAX, USAGE_PATH } from '@wolffm/platform-wire/telemetry';
|
|
6
6
|
import { startUsage as startUsageShell, targetName } from '@wolffm/ui-shell/usage';
|
|
7
|
-
import { apiUrl } from "./http.js";
|
|
8
|
-
import {
|
|
7
|
+
import { apiUrl, appBase } from "./http.js";
|
|
8
|
+
import { locationRoute } from "./screens/route.js";
|
|
9
9
|
export { targetName };
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The screen an address shows, by its route's kind; a room's table is its own screen, and a table's
|
|
12
|
+
* full-screen step (`room/table/<step>`) its own again.
|
|
13
|
+
*/
|
|
14
|
+
export function screenOf(address, base = appBase()) {
|
|
15
|
+
const route = locationRoute(address, base);
|
|
16
|
+
if (route.kind !== 'room' || route.tableId === undefined)
|
|
17
|
+
return route.kind;
|
|
18
|
+
return route.step === undefined ? 'room/table' : `room/table/${route.step}`;
|
|
14
19
|
}
|
|
15
20
|
export function startUsage(deps = {}) {
|
|
16
|
-
return startUsageShell({ url: apiUrl(USAGE_PATH), screenOf, batchMax: USAGE_BATCH_MAX, ...deps });
|
|
21
|
+
return startUsageShell({ url: apiUrl(USAGE_PATH), screenOf: (address) => screenOf(address), batchMax: USAGE_BATCH_MAX, ...deps });
|
|
17
22
|
}
|
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.94",
|
|
4
|
+
"gitHead": "f1d05adb733a43c0e239197bb1a656eb5575c999",
|
|
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.98",
|
|
53
|
+
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.98",
|
|
54
54
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.31",
|
|
55
55
|
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.128",
|
|
56
56
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.128",
|