@hadoku/game-ui 0.0.0-stage → 0.1.5

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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chrome/HeaderLinks.d.ts +16 -0
  3. package/dist/chrome/HeaderLinks.js +24 -0
  4. package/dist/components/ActionButton.d.ts +9 -0
  5. package/dist/components/ActionButton.js +49 -0
  6. package/dist/components/Avatar.d.ts +43 -0
  7. package/dist/components/Avatar.js +53 -0
  8. package/dist/components/ConnectionBanner.css +77 -0
  9. package/dist/components/ConnectionBanner.d.ts +33 -0
  10. package/dist/components/ConnectionBanner.js +33 -0
  11. package/dist/components/Modal.css +69 -0
  12. package/dist/components/Modal.d.ts +12 -0
  13. package/dist/components/Modal.js +31 -0
  14. package/dist/components/OverPage.d.ts +4 -0
  15. package/dist/components/OverPage.js +21 -0
  16. package/dist/components/Popover.css +58 -0
  17. package/dist/components/Popover.d.ts +20 -0
  18. package/dist/components/Popover.js +63 -0
  19. package/dist/components/RadioCards.css +178 -0
  20. package/dist/components/RadioCards.d.ts +33 -0
  21. package/dist/components/RadioCards.js +41 -0
  22. package/dist/components/StatusPill.d.ts +16 -0
  23. package/dist/components/StatusPill.js +17 -0
  24. package/dist/components/connection-state.d.ts +32 -0
  25. package/dist/components/connection-state.js +5 -0
  26. package/dist/dom.d.ts +17 -0
  27. package/dist/dom.js +57 -0
  28. package/dist/front/Gallery.d.ts +22 -0
  29. package/dist/front/Gallery.js +48 -0
  30. package/dist/front/PatchNotesCard.d.ts +1 -0
  31. package/dist/front/PatchNotesCard.js +59 -0
  32. package/dist/front/camera.d.ts +80 -0
  33. package/dist/front/camera.js +120 -0
  34. package/dist/front/countdown.d.ts +2 -0
  35. package/dist/front/countdown.js +16 -0
  36. package/dist/front/discordChat.d.ts +22 -0
  37. package/dist/front/discordChat.js +52 -0
  38. package/dist/front/gallery.d.ts +13 -0
  39. package/dist/front/gallery.js +32 -0
  40. package/dist/front/gate.d.ts +23 -0
  41. package/dist/front/gate.js +55 -0
  42. package/dist/front/icons.d.ts +43 -0
  43. package/dist/front/icons.js +99 -0
  44. package/dist/front/patchNotes.d.ts +37 -0
  45. package/dist/front/patchNotes.js +95 -0
  46. package/dist/front/polls.d.ts +24 -0
  47. package/dist/front/polls.js +95 -0
  48. package/dist/front/shape.d.ts +11 -0
  49. package/dist/front/shape.js +52 -0
  50. package/dist/http.d.ts +28 -0
  51. package/dist/http.js +83 -0
  52. package/dist/idle.d.ts +2 -0
  53. package/dist/idle.js +7 -0
  54. package/dist/lazy.d.ts +9 -0
  55. package/dist/lazy.js +63 -0
  56. package/dist/popover.d.ts +13 -0
  57. package/dist/popover.js +39 -0
  58. package/dist/registered.d.ts +5 -0
  59. package/dist/registered.js +6 -0
  60. package/dist/restart-notice.d.ts +20 -0
  61. package/dist/restart-notice.js +54 -0
  62. package/dist/room/RoomShell.d.ts +116 -0
  63. package/dist/room/RoomShell.js +222 -0
  64. package/dist/room/SessionPrompt.d.ts +12 -0
  65. package/dist/room/SessionPrompt.js +54 -0
  66. package/dist/room/avatar.d.ts +31 -0
  67. package/dist/room/avatar.js +60 -0
  68. package/dist/room/look.css +13 -0
  69. package/dist/room/look.d.ts +35 -0
  70. package/dist/room/look.js +189 -0
  71. package/dist/room/seatsOpen.d.ts +7 -0
  72. package/dist/room/seatsOpen.js +37 -0
  73. package/dist/room/session.d.ts +26 -0
  74. package/dist/room/session.js +108 -0
  75. package/dist/room/socket-options.d.ts +33 -0
  76. package/dist/room/socket-options.js +40 -0
  77. package/dist/room/tab-id.d.ts +6 -0
  78. package/dist/room/tab-id.js +90 -0
  79. package/dist/room/whoami.d.ts +15 -0
  80. package/dist/room/whoami.js +48 -0
  81. package/dist/rooms/bundle-slot.fixture.d.ts +11 -0
  82. package/dist/rooms/bundle-slot.fixture.js +21 -0
  83. package/dist/rooms/game-clients.d.ts +12 -0
  84. package/dist/rooms/game-clients.js +30 -0
  85. package/dist/rooms/game-setup.d.ts +63 -0
  86. package/dist/rooms/game-setup.js +33 -0
  87. package/dist/rooms/relay-channel.d.ts +29 -0
  88. package/dist/rooms/relay-channel.js +123 -0
  89. package/dist/rooms/screen/RoomShell.d.ts +33 -0
  90. package/dist/rooms/screen/RoomShell.js +7 -0
  91. package/dist/screens/route.d.ts +143 -0
  92. package/dist/screens/route.js +359 -0
  93. package/dist/settings/Settings.d.ts +39 -0
  94. package/dist/settings/Settings.js +131 -0
  95. package/dist/settings/TrimScreen.d.ts +2 -0
  96. package/dist/settings/TrimScreen.js +29 -0
  97. package/dist/settings/settings.css +116 -0
  98. package/dist/settings/siteTrim.d.ts +3 -0
  99. package/dist/settings/siteTrim.js +9 -0
  100. package/dist/settings/trim-screen.css +30 -0
  101. package/dist/sound/index.d.ts +12 -0
  102. package/dist/sound/index.js +34 -0
  103. package/dist/stale-build.d.ts +16 -0
  104. package/dist/stale-build.js +59 -0
  105. package/dist/top-layer.css +22 -0
  106. package/dist/topLayer.d.ts +19 -0
  107. package/dist/topLayer.js +44 -0
  108. package/dist/usage.d.ts +5 -0
  109. package/dist/usage.js +17 -0
  110. package/dist/visible.d.ts +14 -0
  111. package/dist/visible.js +35 -0
  112. package/package.json +42 -4
  113. package/README.md +0 -3
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Reading something again while the tab is shown, and never while it is hidden.
3
+ *
4
+ * A hidden tab reads nothing; shown again, it reads at once, then on the timer. The room feed's
5
+ * resilience read (`rooms/follow.ts`) and the front page's calendar and polls (`front/events.ts`,
6
+ * `front/polls.ts`) all re-read on a timer, and a tab left open in the background used to keep
7
+ * the last two going around the clock, each poll a request through the edge (and the polls one a
8
+ * read of Rally behind it).
9
+ */
10
+ export function documentVisibility(doc = globalThis.document) {
11
+ return {
12
+ hidden: () => doc?.visibilityState === 'hidden',
13
+ onChange: (listener) => {
14
+ doc?.addEventListener('visibilitychange', listener);
15
+ return () => doc?.removeEventListener('visibilitychange', listener);
16
+ },
17
+ };
18
+ }
19
+ /** Calls `read` now, every `ms` while the tab is shown, and once whenever it is shown again. Returns the stop. */
20
+ export function rereadWhileVisible(read, ms, deps = {}) {
21
+ const page = deps.page ?? documentVisibility();
22
+ const every = deps.setInterval ?? ((fn, at) => globalThis.setInterval(fn, at));
23
+ const stopEvery = deps.clearInterval ?? ((h) => globalThis.clearInterval(h));
24
+ const whileVisible = () => {
25
+ if (!page.hidden())
26
+ read();
27
+ };
28
+ whileVisible();
29
+ const timer = every(whileVisible, ms);
30
+ const stopVisibility = page.onChange(whileVisible);
31
+ return () => {
32
+ stopEvery(timer);
33
+ stopVisibility();
34
+ };
35
+ }
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "@hadoku/game-ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.5",
4
+ "gitHead": "5ed24a59e1d1340e34c2ba1abe31c152f396282b",
5
+ "type": "module",
6
+ "license": "MIT",
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.",
8
+ "exports": {
9
+ "./*.ts": {
10
+ "types": "./dist/*.d.ts",
11
+ "import": "./dist/*.js"
12
+ },
13
+ "./*.tsx": {
14
+ "types": "./dist/*.d.ts",
15
+ "import": "./dist/*.js"
16
+ },
17
+ "./*.css": "./dist/*.css"
18
+ },
19
+ "peerDependencies": {
20
+ "react": "^19.2.8",
21
+ "react-dom": "^19.2.8"
22
+ },
23
+ "dependencies": {
24
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.5",
25
+ "@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.5",
26
+ "@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.27",
27
+ "@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.92",
28
+ "@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.92",
29
+ "@wolffm/task-ui-components": "npm:@hadoku/task-ui-components@^4.23.35",
30
+ "@wolffm/themes": "npm:@hadoku/themes@^5.14.4",
31
+ "@wolffm/watchparty-ui": "npm:@hadoku/watchparty-ui@^0.45.92",
32
+ "socket.io-client": "^4.8.3",
33
+ "zod": "4.5.4"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "LICENSE"
38
+ ],
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/WolffM/hadoku-cardtable.git",
42
+ "directory": "packages/game-ui"
43
+ }
44
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.