@kuncat/avoidant 0.3.1 → 0.4.0

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 (41) hide show
  1. package/README.md +42 -0
  2. package/dist/assets/favicon.svg +1 -1
  3. package/dist/assets/fonts/NOTO-SANS-SYMBOLS-LICENSE.txt +93 -0
  4. package/dist/assets/fonts/noto-sans-symbols-arrows.woff2 +0 -0
  5. package/dist/components/AvoidantGame.svelte +95 -42
  6. package/dist/components/AvoidantGame.svelte.d.ts +11 -0
  7. package/dist/components/MapControls.svelte +27 -1
  8. package/dist/components/MapControls.svelte.d.ts +2 -0
  9. package/dist/components/MultiplayerGame.svelte +69 -10
  10. package/dist/components/MultiplayerGame.svelte.d.ts +3 -1
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.js +2 -0
  13. package/dist/multiplayer/client.d.ts +2 -1
  14. package/dist/multiplayer/client.js +13 -5
  15. package/dist/multiplayer/current-match.d.ts +3 -0
  16. package/dist/multiplayer/current-match.js +37 -0
  17. package/dist/multiplayer/types.d.ts +10 -0
  18. package/dist/paraglide/messages/_index.d.ts +8 -0
  19. package/dist/paraglide/messages/_index.js +8 -0
  20. package/dist/paraglide/messages/action_see_plans.d.ts +16 -0
  21. package/dist/paraglide/messages/action_see_plans.js +29 -0
  22. package/dist/paraglide/messages/error_tv_pairing.d.ts +16 -0
  23. package/dist/paraglide/messages/error_tv_pairing.js +29 -0
  24. package/dist/paraglide/messages/field_public_game.d.ts +16 -0
  25. package/dist/paraglide/messages/field_public_game.js +29 -0
  26. package/dist/paraglide/messages/help_public_game.d.ts +16 -0
  27. package/dist/paraglide/messages/help_public_game.js +29 -0
  28. package/dist/paraglide/messages/share_watch_help.d.ts +16 -0
  29. package/dist/paraglide/messages/share_watch_help.js +29 -0
  30. package/dist/paraglide/messages/status_public_unlisted.d.ts +16 -0
  31. package/dist/paraglide/messages/status_public_unlisted.js +29 -0
  32. package/dist/paraglide/messages/status_tv_showing.d.ts +16 -0
  33. package/dist/paraglide/messages/status_tv_showing.js +29 -0
  34. package/dist/paraglide/messages/text_multiplayer_subscription.d.ts +16 -0
  35. package/dist/paraglide/messages/text_multiplayer_subscription.js +29 -0
  36. package/dist/styles/global.css +11 -0
  37. package/dist/wasm/avoidant_wasm.d.ts +3 -3
  38. package/dist/wasm/avoidant_wasm.js +12 -12
  39. package/dist/wasm/avoidant_wasm_bg.wasm +0 -0
  40. package/dist/wasm/avoidant_wasm_bg.wasm.d.ts +3 -3
  41. package/package.json +1 -1
@@ -15,6 +15,7 @@
15
15
  import type { GameOptions } from "../wasm/avoidant_wasm";
16
16
  import { revealSweep } from "../multiplayer/reveal";
17
17
  import { MatchClient } from "../multiplayer/client";
18
+ import { forgetMatch, rememberMatch } from "../multiplayer/current-match";
18
19
  import {
19
20
  PLAYER_COLORS,
20
21
  type BoardState,
@@ -22,6 +23,7 @@
22
23
  type MultiplayerSetup,
23
24
  type CompetitiveConfig,
24
25
  type MatchSnapshot,
26
+ type SpectatorSession,
25
27
  } from "../multiplayer/types";
26
28
  import init, {
27
29
  type CellMetadataEntry,
@@ -30,12 +32,16 @@
30
32
  } from "../wasm/avoidant_wasm";
31
33
  let {
32
34
  config,
35
+ spectator,
36
+ cameraPan = false,
33
37
  onexit,
34
38
  setup,
35
39
  invitation,
36
40
  playerName = $bindable(),
37
41
  }: {
38
42
  config: CompetitiveConfig;
43
+ spectator?: SpectatorSession;
44
+ cameraPan?: boolean;
39
45
  onexit: () => void;
40
46
  setup?: MultiplayerSetup;
41
47
  invitation?: string;
@@ -43,6 +49,8 @@
43
49
  } = $props();
44
50
  let account = $state<{ id: string; capabilities: string[] } | null>(null);
45
51
  let message = $state("");
52
+ let discoveryNotice = $state("");
53
+ let tvNotice = $state("");
46
54
  let connectionIssue = $state(false);
47
55
  let flat = $state(false);
48
56
  let matchId = $state("");
@@ -141,7 +149,8 @@
141
149
  }
142
150
  let myIndex = $derived(snapshot?.players.findIndex((p) => p.id === account?.id) ?? -1);
143
151
  let canPlay = $derived(
144
- !!snapshot?.started &&
152
+ !spectator &&
153
+ !!snapshot?.started &&
145
154
  !snapshot.finished &&
146
155
  (snapshot.turn === null || snapshot.turn === myIndex),
147
156
  );
@@ -151,6 +160,11 @@
151
160
  void (async () => {
152
161
  try {
153
162
  await init();
163
+ if (spectator) {
164
+ matchId = spectator.id;
165
+ await join();
166
+ return;
167
+ }
154
168
  account = await config.account.account();
155
169
  if (account && invitation) {
156
170
  matchId = invitation;
@@ -224,8 +238,11 @@
224
238
  if (canPlay && player) client?.move(player.sequence + 1, { kind: "select", cell });
225
239
  }
226
240
  async function join() {
227
- if (!account) return;
228
- sessionStorage.setItem("avoidant:competitiveMatch", matchId);
241
+ if (!account && !spectator) return;
242
+ if (!spectator) {
243
+ sessionStorage.setItem("avoidant:competitiveMatch", matchId);
244
+ if (account) rememberMatch(matchId, account.id);
245
+ }
229
246
  client?.close();
230
247
  connectionGeneration++;
231
248
  copied = false;
@@ -237,7 +254,7 @@
237
254
  client = new MatchClient(
238
255
  config,
239
256
  matchId,
240
- account.id,
257
+ account?.id ?? "",
241
258
  (s, m, n) => void receive(s, m, n),
242
259
  (m, reconnect) => {
243
260
  message = m;
@@ -248,14 +265,37 @@
248
265
  (url) => {
249
266
  invitationUrl = url;
250
267
  },
268
+ spectator?.capability,
251
269
  );
252
270
  const url = new SvelteURL(window.location.href);
253
271
  url.search = "";
254
272
  url.hash = "";
255
273
  url.searchParams.set("match", matchId);
256
274
  invitationUrl = url.toString();
275
+ if (!spectator) history.replaceState(null, "", url);
257
276
  await client.connect();
277
+ if (config.tvPair && !spectator) await showOnTV(config.tvPair);
278
+ }
279
+ /** A phone that scanned a TV's code and then joined a game sends that game to the TV. */
280
+ async function showOnTV(pair: { id: string; claim: string }) {
281
+ try {
282
+ const response = await fetch(`${config.serverUrl}/tv/${pair.id}/attach`, {
283
+ method: "POST",
284
+ headers: { "Content-Type": "application/json" },
285
+ body: JSON.stringify({ claim: pair.claim, code: matchId }),
286
+ });
287
+ if (!response.ok) throw new Error((await response.json()).error);
288
+ tvNotice = m.status_tv_showing();
289
+ } catch {
290
+ tvNotice = m.error_tv_pairing();
291
+ } finally {
292
+ sessionStorage.removeItem("avoidant:tv-pair");
293
+ config.tvPair = undefined;
294
+ }
258
295
  }
296
+ $effect(() => {
297
+ if (snapshot?.finished && !spectator) forgetMatch();
298
+ });
259
299
  async function create() {
260
300
  try {
261
301
  const response = await fetch(`${config.serverUrl}/matches`, {
@@ -264,14 +304,20 @@
264
304
  Authorization: `Bearer ${await config.account.token()}`,
265
305
  "Content-Type": "application/json",
266
306
  },
267
- body: JSON.stringify(setup),
307
+ body: JSON.stringify({ ...setup, tvPair: config.tvPair }),
268
308
  });
269
309
  const data = await response.json();
270
310
  if (!response.ok) throw new Error(data.error);
311
+ if (setup?.public && !data.listed) discoveryNotice = m.status_public_unlisted();
271
312
  matchId = data.id;
313
+ if (config.tvPair) {
314
+ sessionStorage.removeItem("avoidant:tv-pair");
315
+ config.tvPair = undefined;
316
+ history.replaceState(null, "", location.pathname);
317
+ }
272
318
  await join();
273
319
  } catch (e) {
274
- message = String(e);
320
+ message = e instanceof Error ? e.message : String(e);
275
321
  }
276
322
  }
277
323
  async function copyInvitation() {
@@ -287,6 +333,7 @@
287
333
  function leave() {
288
334
  resetAnimations();
289
335
  sessionStorage.removeItem("avoidant:competitiveMatch");
336
+ forgetMatch();
290
337
  const url = new SvelteURL(window.location.href);
291
338
  url.searchParams.delete("match");
292
339
  history.replaceState(null, "", url);
@@ -302,6 +349,13 @@
302
349
  <div class="panel-shell panel-header w-full max-w-full">
303
350
  <div class="flex flex-wrap items-center gap-3">
304
351
  <h1 class="panel-title text-lg font-semibold tracking-wide">Avoidant</h1>
352
+ {#if spectator && snapshot}
353
+ <div class="flex flex-wrap gap-4" aria-label="Player scores">
354
+ {#each snapshot.players as p, i (p.id)}<span style:color={PLAYER_COLORS[i]}
355
+ >{displayName(i)} · {p.score}</span
356
+ >{/each}
357
+ </div>
358
+ {/if}
305
359
  {#if snapshot?.started}
306
360
  {@const match = snapshot}
307
361
  <ScoreSummary>
@@ -314,7 +368,7 @@
314
368
  .toLocaleString(getLocale()),
315
369
  })}</strong
316
370
  >
317
- {:else}
371
+ {:else if !spectator}
318
372
  {m.label_score()}:
319
373
  <strong>{(player?.score ?? 0).toLocaleString(getLocale())}</strong>
320
374
  {/if}
@@ -393,10 +447,14 @@
393
447
  </div>
394
448
  </div>
395
449
  {#if snapshot?.finished}<MatchResults players={snapshot.players} />{/if}
450
+ {#if discoveryNotice}<p role="status" class="mt-2 text-sm opacity-80">
451
+ {discoveryNotice}
452
+ </p>{/if}
453
+ {#if tvNotice}<p role="status" class="mt-2 text-sm opacity-80">{tvNotice}</p>{/if}
396
454
  {#if message}
397
455
  <div class="mt-2 flex flex-wrap items-center gap-2 text-sm">
398
456
  <p role="status" class="text-amber-300">{message}</p>
399
- {#if connectionIssue}
457
+ {#if connectionIssue && !spectator}
400
458
  <button class="btn btn-secondary" onclick={() => config.account.login()}
401
459
  >{m.action_login_again()}</button
402
460
  >
@@ -408,7 +466,7 @@
408
466
  {/if}
409
467
  </div>
410
468
  </div>
411
- {#if !snapshot?.started}
469
+ {#if !snapshot?.started && !spectator}
412
470
  <div class="panel-wrapper panel-wrapper-card fixed inset-x-0 z-10 flex justify-center px-3">
413
471
  <div class="panel-shell panel-card w-full max-w-md space-y-4 py-6 text-slate-700">
414
472
  {#if !account}
@@ -466,6 +524,7 @@
466
524
  onclick={(event) => event.currentTarget.select()}
467
525
  />
468
526
  </label>
527
+ <p class="text-sm">{m.share_watch_help()}</p>
469
528
  <div class="flex flex-wrap justify-center gap-2">
470
529
  <button class="btn btn-secondary" onclick={copyInvitation}
471
530
  >{copied ? m.action_copied() : m.action_copy_invitation()}</button
@@ -497,7 +556,7 @@
497
556
  owners={snapshot?.cells.map((c) => c.owner) ?? []}
498
557
  showZeroCounts={snapshot?.options.floodLimit !== null}
499
558
  />
500
- <MapControls {flat} radius={geometry.boundsRadius} />
559
+ <MapControls {flat} radius={geometry.boundsRadius} keyboard={!!spectator} pan={cameraPan} />
501
560
  </Canvas>
502
561
  </div>
503
562
  {/if}
@@ -1,6 +1,8 @@
1
- import { type MultiplayerSetup, type CompetitiveConfig } from "../multiplayer/types";
1
+ import { type MultiplayerSetup, type CompetitiveConfig, type SpectatorSession } from "../multiplayer/types";
2
2
  type $$ComponentProps = {
3
3
  config: CompetitiveConfig;
4
+ spectator?: SpectatorSession;
5
+ cameraPan?: boolean;
4
6
  onexit: () => void;
5
7
  setup?: MultiplayerSetup;
6
8
  invitation?: string;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  export { default as favicon } from "./assets/favicon.svg";
2
2
  export { default as AvoidantGame } from "./components/AvoidantGame.svelte";
3
3
  export type { CompetitiveConfig } from "./multiplayer/types";
4
+ export { default as AvoidantSpectator } from "./components/MultiplayerGame.svelte";
5
+ export type { SpectatorSession } from "./multiplayer/types";
6
+ export { currentMatch, forgetMatch } from "./multiplayer/current-match";
package/dist/index.js CHANGED
@@ -1,2 +1,4 @@
1
1
  export { default as favicon } from "./assets/favicon.svg";
2
2
  export { default as AvoidantGame } from "./components/AvoidantGame.svelte";
3
+ export { default as AvoidantSpectator } from "./components/MultiplayerGame.svelte";
4
+ export { currentMatch, forgetMatch } from "./multiplayer/current-match";
@@ -8,13 +8,14 @@ export declare class MatchClient {
8
8
  private report;
9
9
  private playerName;
10
10
  private invitationReceived?;
11
+ private spectatorCapability?;
11
12
  private socket?;
12
13
  private pending?;
13
14
  private stopped;
14
15
  private finished;
15
16
  private retry?;
16
17
  private retryCount;
17
- constructor(config: CompetitiveConfig, id: string, actor: string, receive: (s: MatchSnapshot, map: string, neighbors: number[][]) => void, report: (s: string, reconnect?: boolean) => void, playerName: () => string, invitationReceived?: ((url: string) => void) | undefined);
18
+ constructor(config: CompetitiveConfig, id: string, actor: string, receive: (s: MatchSnapshot, map: string, neighbors: number[][]) => void, report: (s: string, reconnect?: boolean) => void, playerName: () => string, invitationReceived?: ((url: string) => void) | undefined, spectatorCapability?: string | undefined);
18
19
  connect(): Promise<void>;
19
20
  start(): void;
20
21
  move(sequence: number, action: unknown): void;
@@ -8,13 +8,14 @@ export class MatchClient {
8
8
  report;
9
9
  playerName;
10
10
  invitationReceived;
11
+ spectatorCapability;
11
12
  socket;
12
13
  pending;
13
14
  stopped = false;
14
15
  finished = false;
15
16
  retry;
16
17
  retryCount = 0;
17
- constructor(config, id, actor, receive, report, playerName, invitationReceived) {
18
+ constructor(config, id, actor, receive, report, playerName, invitationReceived, spectatorCapability) {
18
19
  this.config = config;
19
20
  this.id = id;
20
21
  this.actor = actor;
@@ -22,6 +23,7 @@ export class MatchClient {
22
23
  this.report = report;
23
24
  this.playerName = playerName;
24
25
  this.invitationReceived = invitationReceived;
26
+ this.spectatorCapability = spectatorCapability;
25
27
  }
26
28
  async connect() {
27
29
  clearTimeout(this.retry);
@@ -30,10 +32,12 @@ export class MatchClient {
30
32
  this.socket.close();
31
33
  }
32
34
  try {
33
- const response = await fetch(`${this.config.serverUrl}/matches/${this.id}/connect`, {
35
+ const response = await fetch(`${this.config.serverUrl}/matches/${this.id}/${this.spectatorCapability ? "watch" : "connect"}`, {
34
36
  method: "POST",
35
37
  headers: {
36
- Authorization: `Bearer ${await this.config.account.token()}`,
38
+ Authorization: this.spectatorCapability
39
+ ? `Spectator ${this.spectatorCapability}`
40
+ : `Bearer ${await this.config.account.token()}`,
37
41
  "Content-Type": "application/json",
38
42
  },
39
43
  body: JSON.stringify({ name: this.playerName().trim() }),
@@ -92,13 +96,17 @@ export class MatchClient {
92
96
  }
93
97
  catch (error) {
94
98
  this.report(error instanceof Error ? error.message : m.error_connection_failed(), true);
99
+ if (this.spectatorCapability && !this.stopped && !this.finished) {
100
+ this.retry = setTimeout(() => void this.connect(), Math.min(1000 * 2 ** this.retryCount++, 15000));
101
+ }
95
102
  }
96
103
  }
97
104
  start() {
98
- this.send({ kind: "start" });
105
+ if (!this.spectatorCapability)
106
+ this.send({ kind: "start" });
99
107
  }
100
108
  move(sequence, action) {
101
- if (this.pending)
109
+ if (this.spectatorCapability || this.pending)
102
110
  return;
103
111
  if (this.socket?.readyState !== WebSocket.OPEN) {
104
112
  this.report(m.error_reconnect_to_play(), true);
@@ -0,0 +1,3 @@
1
+ export declare function rememberMatch(id: string, actor: string): void;
2
+ export declare function forgetMatch(): void;
3
+ export declare function currentMatch(actor: string | undefined): string | null;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The game this browser last joined. Scanning a TV's QR code opens a new tab, which has
3
+ * no session storage, so the TV pairing page reads this to offer the game in progress.
4
+ * It is kept per account: another account on the same browser must not join that game.
5
+ */
6
+ const KEY = "avoidant:currentMatch";
7
+ const MAX_AGE = 12 * 3600_000;
8
+ export function rememberMatch(id, actor) {
9
+ try {
10
+ localStorage.setItem(KEY, JSON.stringify({ id, actor, at: Date.now() }));
11
+ }
12
+ catch {
13
+ /* Storage can be unavailable in private windows. */
14
+ }
15
+ }
16
+ export function forgetMatch() {
17
+ try {
18
+ localStorage.removeItem(KEY);
19
+ }
20
+ catch {
21
+ /* Nothing was stored. */
22
+ }
23
+ }
24
+ export function currentMatch(actor) {
25
+ try {
26
+ const saved = JSON.parse(localStorage.getItem(KEY) ?? "null");
27
+ return typeof saved?.id === "string" &&
28
+ actor &&
29
+ saved.actor === actor &&
30
+ Date.now() - saved.at < MAX_AGE
31
+ ? saved.id
32
+ : null;
33
+ }
34
+ catch {
35
+ return null;
36
+ }
37
+ }
@@ -11,7 +11,16 @@ export interface BoardState {
11
11
  elevationMax: number;
12
12
  queueExplorePulse(index: number, x: number, y: number, z: number): void;
13
13
  }
14
+ export interface SpectatorSession {
15
+ id: string;
16
+ capability: string;
17
+ invitationUrl?: string;
18
+ }
14
19
  export interface CompetitiveConfig {
20
+ tvPair?: {
21
+ id: string;
22
+ claim: string;
23
+ };
15
24
  serverUrl: string;
16
25
  account: {
17
26
  login(register?: boolean): Promise<void>;
@@ -61,6 +70,7 @@ export interface MatchSnapshot {
61
70
  }
62
71
  export declare const PLAYER_COLORS: string[];
63
72
  export interface MultiplayerSetup {
73
+ public?: boolean;
64
74
  mode: "collaborative" | "territory";
65
75
  map: string;
66
76
  bordering: boolean;
@@ -18,6 +18,7 @@ export * from "./action_random.js";
18
18
  export * from "./action_reconnect.js";
19
19
  export * from "./action_register.js";
20
20
  export * from "./action_save_name.js";
21
+ export * from "./action_see_plans.js";
21
22
  export * from "./action_start.js";
22
23
  export * from "./action_start_match.js";
23
24
  export * from "./aria_close_invitation.js";
@@ -42,6 +43,7 @@ export * from "./error_name_server_update.js";
42
43
  export * from "./error_player_name.js";
43
44
  export * from "./error_reconnect_to_play.js";
44
45
  export * from "./error_replay.js";
46
+ export * from "./error_tv_pairing.js";
45
47
  export * from "./error_unsupported_map.js";
46
48
  export * from "./faces_count.js";
47
49
  export * from "./field_bordering.js";
@@ -61,6 +63,7 @@ export * from "./field_match_duration.js";
61
63
  export * from "./field_match_minutes.js";
62
64
  export * from "./field_play_mode.js";
63
65
  export * from "./field_player_name.js";
66
+ export * from "./field_public_game.js";
64
67
  export * from "./field_radius.js";
65
68
  export * from "./field_radius_x.js";
66
69
  export * from "./field_radius_y.js";
@@ -85,6 +88,7 @@ export * from "./help_match_duration.js";
85
88
  export * from "./help_participation_time.js";
86
89
  export * from "./help_play_mode.js";
87
90
  export * from "./help_player_name.js";
91
+ export * from "./help_public_game.js";
88
92
  export * from "./help_seed.js";
89
93
  export * from "./help_size.js";
90
94
  export * from "./help_spikiness.js";
@@ -128,6 +132,7 @@ export * from "./preset_large.js";
128
132
  export * from "./preset_medium.js";
129
133
  export * from "./preset_small.js";
130
134
  export * from "./shape_label.js";
135
+ export * from "./share_watch_help.js";
131
136
  export * from "./status_connecting.js";
132
137
  export * from "./status_draw.js";
133
138
  export * from "./status_generating_map.js";
@@ -141,15 +146,18 @@ export * from "./status_named_turn.js";
141
146
  export * from "./status_named_winner.js";
142
147
  export * from "./status_player_turn.js";
143
148
  export * from "./status_preparing.js";
149
+ export * from "./status_public_unlisted.js";
144
150
  export * from "./status_realtime_claims.js";
145
151
  export * from "./status_reconnecting.js";
146
152
  export * from "./status_session_complete.js";
153
+ export * from "./status_tv_showing.js";
147
154
  export * from "./status_winner.js";
148
155
  export * from "./text_account_multiplayer.js";
149
156
  export * from "./text_avoided.js";
150
157
  export * from "./text_density_summary.js";
151
158
  export * from "./text_invite_after_opening.js";
152
159
  export * from "./text_multiplayer_login.js";
160
+ export * from "./text_multiplayer_subscription.js";
153
161
  export * from "./text_relay_servers_hint.js";
154
162
  export * from "./text_waiting_lobby.js";
155
163
  export * from "./tutorial_action_dismiss.js";
@@ -20,6 +20,7 @@ export * from './action_random.js'
20
20
  export * from './action_reconnect.js'
21
21
  export * from './action_register.js'
22
22
  export * from './action_save_name.js'
23
+ export * from './action_see_plans.js'
23
24
  export * from './action_start.js'
24
25
  export * from './action_start_match.js'
25
26
  export * from './aria_close_invitation.js'
@@ -44,6 +45,7 @@ export * from './error_name_server_update.js'
44
45
  export * from './error_player_name.js'
45
46
  export * from './error_reconnect_to_play.js'
46
47
  export * from './error_replay.js'
48
+ export * from './error_tv_pairing.js'
47
49
  export * from './error_unsupported_map.js'
48
50
  export * from './faces_count.js'
49
51
  export * from './field_bordering.js'
@@ -63,6 +65,7 @@ export * from './field_match_duration.js'
63
65
  export * from './field_match_minutes.js'
64
66
  export * from './field_play_mode.js'
65
67
  export * from './field_player_name.js'
68
+ export * from './field_public_game.js'
66
69
  export * from './field_radius.js'
67
70
  export * from './field_radius_x.js'
68
71
  export * from './field_radius_y.js'
@@ -87,6 +90,7 @@ export * from './help_match_duration.js'
87
90
  export * from './help_participation_time.js'
88
91
  export * from './help_play_mode.js'
89
92
  export * from './help_player_name.js'
93
+ export * from './help_public_game.js'
90
94
  export * from './help_seed.js'
91
95
  export * from './help_size.js'
92
96
  export * from './help_spikiness.js'
@@ -130,6 +134,7 @@ export * from './preset_large.js'
130
134
  export * from './preset_medium.js'
131
135
  export * from './preset_small.js'
132
136
  export * from './shape_label.js'
137
+ export * from './share_watch_help.js'
133
138
  export * from './status_connecting.js'
134
139
  export * from './status_draw.js'
135
140
  export * from './status_generating_map.js'
@@ -143,15 +148,18 @@ export * from './status_named_turn.js'
143
148
  export * from './status_named_winner.js'
144
149
  export * from './status_player_turn.js'
145
150
  export * from './status_preparing.js'
151
+ export * from './status_public_unlisted.js'
146
152
  export * from './status_realtime_claims.js'
147
153
  export * from './status_reconnecting.js'
148
154
  export * from './status_session_complete.js'
155
+ export * from './status_tv_showing.js'
149
156
  export * from './status_winner.js'
150
157
  export * from './text_account_multiplayer.js'
151
158
  export * from './text_avoided.js'
152
159
  export * from './text_density_summary.js'
153
160
  export * from './text_invite_after_opening.js'
154
161
  export * from './text_multiplayer_login.js'
162
+ export * from './text_multiplayer_subscription.js'
155
163
  export * from './text_relay_servers_hint.js'
156
164
  export * from './text_waiting_lobby.js'
157
165
  export * from './tutorial_action_dismiss.js'
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "See plans" |
5
+ *
6
+ * @param {Action_See_PlansInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const action_see_plans: ((inputs?: Action_See_PlansInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Action_See_PlansInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Action_See_PlansInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Action_See_PlansInputs */
7
+
8
+ const en_action_see_plans = /** @type {(inputs: Action_See_PlansInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`See plans`)
10
+ };
11
+
12
+ const bn_action_see_plans = /** @type {(inputs: Action_See_PlansInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`প্ল্যান দেখুন`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "See plans" |
20
+ *
21
+ * @param {Action_See_PlansInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const action_see_plans = /** @type {((inputs?: Action_See_PlansInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Action_See_PlansInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "bn") return bn_action_see_plans(inputs)
28
+ return en_action_see_plans(inputs)
29
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "Couldn’t reach the TV. Scan its code again." |
5
+ *
6
+ * @param {Error_Tv_PairingInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const error_tv_pairing: ((inputs?: Error_Tv_PairingInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Error_Tv_PairingInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Error_Tv_PairingInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Error_Tv_PairingInputs */
7
+
8
+ const en_error_tv_pairing = /** @type {(inputs: Error_Tv_PairingInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`Couldn’t reach the TV. Scan its code again.`)
10
+ };
11
+
12
+ const bn_error_tv_pairing = /** @type {(inputs: Error_Tv_PairingInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`টিভিতে পৌঁছানো যায়নি। আবার টিভির কোড স্ক্যান করুন।`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "Couldn’t reach the TV. Scan its code again." |
20
+ *
21
+ * @param {Error_Tv_PairingInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const error_tv_pairing = /** @type {((inputs?: Error_Tv_PairingInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Error_Tv_PairingInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "bn") return bn_error_tv_pairing(inputs)
28
+ return en_error_tv_pairing(inputs)
29
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "Public game" |
5
+ *
6
+ * @param {Field_Public_GameInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const field_public_game: ((inputs?: Field_Public_GameInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Field_Public_GameInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Field_Public_GameInputs = {};
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{}} Field_Public_GameInputs */
7
+
8
+ const en_field_public_game = /** @type {(inputs: Field_Public_GameInputs) => LocalizedString} */ () => {
9
+ return /** @type {LocalizedString} */ (`Public game`)
10
+ };
11
+
12
+ const bn_field_public_game = /** @type {(inputs: Field_Public_GameInputs) => LocalizedString} */ () => {
13
+ return /** @type {LocalizedString} */ (`পাবলিক খেলা`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "Public game" |
20
+ *
21
+ * @param {Field_Public_GameInputs} inputs
22
+ * @param {{ locale?: "en" | "bn" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const field_public_game = /** @type {((inputs?: Field_Public_GameInputs, options?: { locale?: "en" | "bn" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Field_Public_GameInputs, { locale?: "en" | "bn" }, {}>} */ ((inputs = {}, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "bn") return bn_field_public_game(inputs)
28
+ return en_field_public_game(inputs)
29
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "List this game in open games so anyone with a Kuncat account can find and join it. Private games need the sharing code." |
5
+ *
6
+ * @param {Help_Public_GameInputs} inputs
7
+ * @param {{ locale?: "en" | "bn" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const help_public_game: ((inputs?: Help_Public_GameInputs, options?: {
11
+ locale?: "en" | "bn";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<Help_Public_GameInputs, {
13
+ locale?: "en" | "bn";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type Help_Public_GameInputs = {};