@caisual/kit 0.20.0 → 0.21.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.
- package/README.md +1 -1
- package/dist/kit.js +4 -4
- package/dist/kit.js.map +3 -3
- package/dist/node.js +21 -51
- package/dist/overlay.js +8 -177
- package/dist/overlay.js.map +4 -4
- package/dist/runtime.js +27 -51
- package/dist/types/api.d.ts +1 -8
- package/dist/types/contracts/index.d.ts +0 -1
- package/dist/types/contracts/manifest.d.ts +1 -0
- package/dist/types/contracts/overlay.d.ts +4 -9
- package/dist/types/index.d.ts +0 -40
- package/dist/types/node/index.d.ts +0 -4
- package/dist/types/overlay/host-bridge.d.ts +1 -2
- package/dist/types/overlay/i18n.d.ts +0 -18
- package/dist/types/overlay/index.d.ts +0 -1
- package/dist/types/overlay/styles.d.ts +1 -1
- package/dist/types/overlay/ui-model.d.ts +1 -1
- package/dist/types/overlay/ui.d.ts +0 -2
- package/dist/types/overlay/voice-panel.d.ts +1 -1
- package/dist/types/runtime/index.d.ts +4 -4
- package/dist/types/server/index.d.ts +0 -10
- package/dist/types/session/index.d.ts +1 -2
- package/dist/types/stanza/nucleo.d.ts +4 -1
- package/dist/types/stanza/tipi.d.ts +3 -4
- package/package.json +2 -3
- package/dist/types/contracts/overlay-boards.d.ts +0 -3
- package/dist/types/overlay/boards.d.ts +0 -48
package/dist/node.js
CHANGED
|
@@ -181,10 +181,10 @@ function visitaDiff(prima, dopo, path, patch) {
|
|
|
181
181
|
}
|
|
182
182
|
if (isObject(prima) && isObject(dopo)) {
|
|
183
183
|
for (const key of Object.keys(prima)) {
|
|
184
|
-
if (!(key
|
|
184
|
+
if (!Object.hasOwn(dopo, key)) patch.push({ op: "del", path: [...path, key] });
|
|
185
185
|
}
|
|
186
186
|
for (const [key, value] of Object.entries(dopo)) {
|
|
187
|
-
if (!(key
|
|
187
|
+
if (!Object.hasOwn(prima, key)) patch.push({ op: "set", path: [...path, key], value });
|
|
188
188
|
else visitaDiff(prima[key], value, [...path, key], patch);
|
|
189
189
|
}
|
|
190
190
|
return;
|
|
@@ -351,7 +351,6 @@ var GRAZIA_MS = 6e4;
|
|
|
351
351
|
var STANZA_VUOTA_MS = 5 * 6e4;
|
|
352
352
|
var ATTESA_RIVINCITA_MS = 2 * 6e4;
|
|
353
353
|
var COUNTDOWN_MS = 3e3;
|
|
354
|
-
var GRAZIA_GIORNALIERA_MS = 10 * 6e4;
|
|
355
354
|
var RIPOSO_TICK_MS = 3e4;
|
|
356
355
|
var INATTIVITA_MS = 10 * 6e4;
|
|
357
356
|
var SCADENZA_PERSISTENTE_MS = 30 * 24 * 60 * 6e4;
|
|
@@ -507,15 +506,6 @@ var NucleoStanza = class _NucleoStanza {
|
|
|
507
506
|
schedule(milliseconds, handler, payload) {
|
|
508
507
|
nucleo.pianifica(milliseconds, handler, payload);
|
|
509
508
|
},
|
|
510
|
-
board: {
|
|
511
|
-
submit(player, board, score, options = {}) {
|
|
512
|
-
if (typeof board === "number") {
|
|
513
|
-
const active = nucleo.richiediDati().giocatori.filter((p) => p.role !== "spectator");
|
|
514
|
-
if (nucleo.configurazione.players.max !== 1 || active.length !== 1) throw erroreConCodice("board_player_required", "Specify the player when submitting a multiplayer score.");
|
|
515
|
-
nucleo.accodaPunteggio(active[0].id, player, board, typeof score === "object" ? score : {});
|
|
516
|
-
} else nucleo.accodaPunteggio(idGiocatore(player), board, score, options);
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
509
|
daily,
|
|
520
510
|
time: { now: () => nucleo.adattatore.ora() },
|
|
521
511
|
voice: {
|
|
@@ -979,6 +969,25 @@ var NucleoStanza = class _NucleoStanza {
|
|
|
979
969
|
await this.concludiEvento();
|
|
980
970
|
await this.persistiEProgramma();
|
|
981
971
|
}
|
|
972
|
+
async preparaFlush() {
|
|
973
|
+
const dati = this.richiediDati();
|
|
974
|
+
if (dati.flushInAttesa !== void 0) {
|
|
975
|
+
await this.persistiEProgramma();
|
|
976
|
+
return dati.flushInAttesa;
|
|
977
|
+
}
|
|
978
|
+
if (dati.punteggi.length === 0 && dati.fineInCoda === null) return null;
|
|
979
|
+
dati.flushInAttesa = { id: crypto.randomUUID(), scores: dati.punteggi, ended: dati.fineInCoda };
|
|
980
|
+
dati.punteggi = [];
|
|
981
|
+
dati.fineInCoda = null;
|
|
982
|
+
await this.persistiEProgramma();
|
|
983
|
+
return dati.flushInAttesa;
|
|
984
|
+
}
|
|
985
|
+
async confermaFlush(id) {
|
|
986
|
+
const dati = this.richiediDati();
|
|
987
|
+
if (dati.flushInAttesa?.id !== id) return;
|
|
988
|
+
delete dati.flushInAttesa;
|
|
989
|
+
await this.persistiEProgramma();
|
|
990
|
+
}
|
|
982
991
|
async flush() {
|
|
983
992
|
const dati = this.richiediDati();
|
|
984
993
|
const esito = {
|
|
@@ -1283,45 +1292,6 @@ var NucleoStanza = class _NucleoStanza {
|
|
|
1283
1292
|
const day = this.giornata(ora);
|
|
1284
1293
|
return { day, seed: seedGiornata(this.manifest.id, day), expiresAt: prossimaMezzanotteUtc(ora) };
|
|
1285
1294
|
}
|
|
1286
|
-
accodaPunteggio(playerId, board, score, options) {
|
|
1287
|
-
if (!this.richiediDati().giocatori.some((player2) => player2.id === playerId)) {
|
|
1288
|
-
throw new Error("Player not found.");
|
|
1289
|
-
}
|
|
1290
|
-
if (!CHIAVE.test(board)) {
|
|
1291
|
-
throw new TypeError("Board names must use lowercase letters, numbers, underscores, or hyphens.");
|
|
1292
|
-
}
|
|
1293
|
-
if (!Number.isSafeInteger(score) || score < 0) {
|
|
1294
|
-
throw new TypeError("Score must be a non-negative safe integer.");
|
|
1295
|
-
}
|
|
1296
|
-
const submittedAt = this.adattatore.ora();
|
|
1297
|
-
const daily = options.daily === true || options.day !== void 0;
|
|
1298
|
-
let day = daily ? this.giornata(submittedAt) : null;
|
|
1299
|
-
const start = this.manifest.boards?.[board]?.day === "start";
|
|
1300
|
-
if (options.day !== void 0 && (!start || options.daily === false)) {
|
|
1301
|
-
throw erroreConCodice("board_day_policy", "An explicit day requires a start-day board and a daily score.");
|
|
1302
|
-
}
|
|
1303
|
-
if (daily && start) {
|
|
1304
|
-
const run = this.richiediDati().daily;
|
|
1305
|
-
if (options.day === void 0) throw erroreConCodice("board_day_required", "Submit the daily score with room.daily.day.");
|
|
1306
|
-
if (options.day !== run.day) throw erroreConCodice("board_day_mismatch", "The score day must match room.daily.day.");
|
|
1307
|
-
if (submittedAt > run.expiresAt + GRAZIA_GIORNALIERA_MS) throw erroreConCodice("board_day_expired", "The starting day grace period has expired.");
|
|
1308
|
-
day = run.day;
|
|
1309
|
-
}
|
|
1310
|
-
this.richiediDati().punteggi.push({
|
|
1311
|
-
playerId,
|
|
1312
|
-
board,
|
|
1313
|
-
score,
|
|
1314
|
-
daily,
|
|
1315
|
-
submittedAt,
|
|
1316
|
-
day
|
|
1317
|
-
});
|
|
1318
|
-
const player = this.richiediDati().giocatori.find((item) => item.id === playerId);
|
|
1319
|
-
if (player.connected && player.connessione !== null) this.adattatore.invia(player.connessione, {
|
|
1320
|
-
t: "score-queued",
|
|
1321
|
-
score: { player: playerId, board, score, day, submittedAt }
|
|
1322
|
-
});
|
|
1323
|
-
this.broadcast({ t: "flush" });
|
|
1324
|
-
}
|
|
1325
1295
|
richiediFine(result, rematch = false) {
|
|
1326
1296
|
const json = analizzaJson(result);
|
|
1327
1297
|
if (!json.ok) throw new TypeError("Game result must be valid JSON.");
|
package/dist/overlay.js
CHANGED
|
@@ -683,11 +683,12 @@ var REPLAY_RETENTION_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
|
683
683
|
var REPLAY_ID = /^[A-Za-z0-9_-]{22}$/;
|
|
684
684
|
|
|
685
685
|
// ../contracts/src/overlay.ts
|
|
686
|
-
var OVERLAY_PANELS = ["home", "room", "invite", "friends", "voice"
|
|
686
|
+
var OVERLAY_PANELS = ["home", "room", "invite", "friends", "voice"];
|
|
687
687
|
function overlayConfiguration(manifest, coverUrl = null, invite = null, iconUrl = null) {
|
|
688
688
|
const validated = validaManifest(manifest);
|
|
689
689
|
if (!validated.ok) throw new Error("The overlay manifest is invalid.");
|
|
690
|
-
|
|
690
|
+
const { boards: _legacy, ...visible } = validated.manifest;
|
|
691
|
+
return { manifest: visible, coverUrl, iconUrl, invite };
|
|
691
692
|
}
|
|
692
693
|
function record(value) {
|
|
693
694
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
@@ -756,11 +757,6 @@ function validOverlayRequest(value) {
|
|
|
756
757
|
return false;
|
|
757
758
|
}
|
|
758
759
|
}
|
|
759
|
-
function validBoardDay(value) {
|
|
760
|
-
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return false;
|
|
761
|
-
const at = Date.parse(`${value}T00:00:00Z`);
|
|
762
|
-
return Number.isFinite(at) && new Date(at).toISOString().slice(0, 10) === value;
|
|
763
|
-
}
|
|
764
760
|
function validOverlaySessionState(value) {
|
|
765
761
|
const data = record(value);
|
|
766
762
|
const exact = (v, keys) => v !== null && Object.keys(v).length === keys.length && Object.keys(v).every((key) => keys.includes(key));
|
|
@@ -858,7 +854,6 @@ function creaPonteOspite(input) {
|
|
|
858
854
|
const shortcuts = /* @__PURE__ */ new Set();
|
|
859
855
|
const opens = /* @__PURE__ */ new Set();
|
|
860
856
|
const errors = /* @__PURE__ */ new Set();
|
|
861
|
-
const scores = /* @__PURE__ */ new Set();
|
|
862
857
|
const notify = (listeners, value) => {
|
|
863
858
|
for (const listener of listeners) try {
|
|
864
859
|
listener(value);
|
|
@@ -957,11 +952,6 @@ function creaPonteOspite(input) {
|
|
|
957
952
|
notify(shortcuts, void 0);
|
|
958
953
|
} else if (data2.type === "caisual:overlay-open" && OVERLAY_PANELS.includes(data2.panel)) {
|
|
959
954
|
notify(opens, data2.panel);
|
|
960
|
-
} else if (data2.type === "caisual:overlay-score") {
|
|
961
|
-
const score = record(data2.score);
|
|
962
|
-
if (score && typeof score.board === "string" && typeof score.player === "string" && Number.isSafeInteger(score.score) && Number.isFinite(score.submittedAt) && (score.day === null || typeof score.day === "string")) {
|
|
963
|
-
notify(scores, { board: score.board, player: score.player, score: score.score, day: score.day, submittedAt: score.submittedAt });
|
|
964
|
-
}
|
|
965
955
|
}
|
|
966
956
|
};
|
|
967
957
|
currentPort.start();
|
|
@@ -1026,12 +1016,6 @@ function creaPonteOspite(input) {
|
|
|
1026
1016
|
errors.delete(listener);
|
|
1027
1017
|
};
|
|
1028
1018
|
},
|
|
1029
|
-
onScore(listener) {
|
|
1030
|
-
scores.add(listener);
|
|
1031
|
-
return () => {
|
|
1032
|
-
scores.delete(listener);
|
|
1033
|
-
};
|
|
1034
|
-
},
|
|
1035
1019
|
request(op, args) {
|
|
1036
1020
|
if (!port || !epoch || disposed) return Promise.reject(creaErrore("offline", "The game bridge is not connected."));
|
|
1037
1021
|
if (pending.size >= 32) return Promise.reject(creaErrore("rate_limited", "Too many overlay requests."));
|
|
@@ -1072,7 +1056,6 @@ function creaPonteOspite(input) {
|
|
|
1072
1056
|
states.clear();
|
|
1073
1057
|
opens.clear();
|
|
1074
1058
|
shortcuts.clear();
|
|
1075
|
-
scores.clear();
|
|
1076
1059
|
errors.clear();
|
|
1077
1060
|
}
|
|
1078
1061
|
};
|
|
@@ -1106,100 +1089,6 @@ function measureSafeArea(frame, probe) {
|
|
|
1106
1089
|
};
|
|
1107
1090
|
}
|
|
1108
1091
|
|
|
1109
|
-
// src/overlay/boards.ts
|
|
1110
|
-
function createBoardController(input) {
|
|
1111
|
-
let disposed = false, generation = 0, timer;
|
|
1112
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1113
|
-
let query = null, data = null, error = false, loading = false;
|
|
1114
|
-
let queued = null, saving = null, reads = 0;
|
|
1115
|
-
const later = input.later ?? setTimeout, clear = input.clear ?? clearTimeout;
|
|
1116
|
-
const cancel = () => {
|
|
1117
|
-
if (timer !== void 0) clear(timer);
|
|
1118
|
-
timer = void 0;
|
|
1119
|
-
};
|
|
1120
|
-
const notify = () => {
|
|
1121
|
-
if (!disposed) input.changed();
|
|
1122
|
-
};
|
|
1123
|
-
const matches = () => queued && query?.board === queued.board && query.period === (queued.day ? "daily" : "all-time") && (query.day ?? queued.day) === queued.day;
|
|
1124
|
-
const refresh = async () => {
|
|
1125
|
-
if (!query || disposed) return;
|
|
1126
|
-
cancel();
|
|
1127
|
-
const current = ++generation, selected = { ...query };
|
|
1128
|
-
loading = true;
|
|
1129
|
-
error = false;
|
|
1130
|
-
notify();
|
|
1131
|
-
try {
|
|
1132
|
-
const result = await input.read(selected);
|
|
1133
|
-
if (disposed || current !== generation) return;
|
|
1134
|
-
data = result;
|
|
1135
|
-
if (matches()) {
|
|
1136
|
-
const own = result.me;
|
|
1137
|
-
if (own?.verified && own.score >= queued.score) saving = own.score === queued.score ? "saved" : "bestAlready";
|
|
1138
|
-
}
|
|
1139
|
-
} catch {
|
|
1140
|
-
if (!disposed && current === generation) error = true;
|
|
1141
|
-
}
|
|
1142
|
-
if (disposed || current !== generation) return;
|
|
1143
|
-
loading = false;
|
|
1144
|
-
if (matches() && saving !== "saved" && saving !== "bestAlready") {
|
|
1145
|
-
reads++;
|
|
1146
|
-
if (reads < 2) {
|
|
1147
|
-
saving = "saving";
|
|
1148
|
-
timer = later(() => {
|
|
1149
|
-
void refresh();
|
|
1150
|
-
}, 1600);
|
|
1151
|
-
} else saving = "refreshHint";
|
|
1152
|
-
}
|
|
1153
|
-
notify();
|
|
1154
|
-
};
|
|
1155
|
-
return {
|
|
1156
|
-
get state() {
|
|
1157
|
-
return { query, data, loading, error, saving: matches() ? saving : null };
|
|
1158
|
-
},
|
|
1159
|
-
select(next) {
|
|
1160
|
-
if (JSON.stringify(next) === JSON.stringify(query)) return;
|
|
1161
|
-
cancel();
|
|
1162
|
-
generation++;
|
|
1163
|
-
query = { ...next };
|
|
1164
|
-
data = null;
|
|
1165
|
-
reads = 0;
|
|
1166
|
-
if (matches()) saving = "saving";
|
|
1167
|
-
void refresh();
|
|
1168
|
-
},
|
|
1169
|
-
queued(score) {
|
|
1170
|
-
const board = input.manifest.boards[score.board];
|
|
1171
|
-
if (score.player !== input.player || !board || !Number.isSafeInteger(score.score) || score.score < 0 || score.day !== null && !validBoardDay(score.day) || !(board.periods ?? ["all-time"]).includes(score.day ? "daily" : "all-time")) return;
|
|
1172
|
-
const signature = JSON.stringify(score);
|
|
1173
|
-
if (seen.has(signature)) return;
|
|
1174
|
-
seen.add(signature);
|
|
1175
|
-
if (seen.size > 64) seen.delete(seen.values().next().value);
|
|
1176
|
-
queued = score;
|
|
1177
|
-
saving = "saving";
|
|
1178
|
-
reads = 0;
|
|
1179
|
-
this.select({ board: score.board, period: score.day ? "daily" : "all-time", guests: query?.guests ?? input.guests ?? false, ...score.day ? { day: score.day } : {} });
|
|
1180
|
-
if (!loading) void refresh();
|
|
1181
|
-
notify();
|
|
1182
|
-
},
|
|
1183
|
-
refresh,
|
|
1184
|
-
reset() {
|
|
1185
|
-
seen.clear();
|
|
1186
|
-
cancel();
|
|
1187
|
-
generation++;
|
|
1188
|
-
query = null;
|
|
1189
|
-
data = null;
|
|
1190
|
-
queued = null;
|
|
1191
|
-
saving = null;
|
|
1192
|
-
loading = false;
|
|
1193
|
-
error = false;
|
|
1194
|
-
},
|
|
1195
|
-
dispose() {
|
|
1196
|
-
disposed = true;
|
|
1197
|
-
cancel();
|
|
1198
|
-
generation++;
|
|
1199
|
-
}
|
|
1200
|
-
};
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
1092
|
// src/overlay/locale.ts
|
|
1204
1093
|
var languages = ["en", "it", "es", "fr", "de", "pt", "ja"];
|
|
1205
1094
|
function overlayLanguage(raw) {
|
|
@@ -1297,24 +1186,6 @@ var words = {
|
|
|
1297
1186
|
unavailable: ["Unavailable right now", "Non disponibile ora", "No disponible ahora", "Indisponible pour le moment", "Derzeit nicht verf\xFCgbar", "Indisponivel agora", "\u73FE\u5728\u5229\u7528\u3067\u304D\u307E\u305B\u3093"],
|
|
1298
1187
|
offline: ["Connection unavailable. Try again.", "Connessione non disponibile. Riprova.", "Sin conexi\xF3n. Reintenta.", "Connexion indisponible. R\xE9essayez.", "Keine Verbindung. Erneut versuchen.", "Sem conex\xE3o. Tente novamente.", "\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"],
|
|
1299
1188
|
saveFailed: ["Keep the room code. Resume could not be saved.", "Conserva il codice. Riprendi non \xE8 stato salvato.", "Guarda el c\xF3digo. No se pudo guardar el regreso.", "Gardez le code. La reprise ne peut pas \xEAtre enregistr\xE9e.", "Raumcode aufbewahren. Fortsetzen nicht gespeichert.", "Guarde o c\xF3digo. O retorno n\xE3o foi salvo.", "\u30EB\u30FC\u30E0\u30B3\u30FC\u30C9\u3092\u63A7\u3048\u3066\u304F\u3060\u3055\u3044\u3002\u518D\u958B\u60C5\u5831\u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"],
|
|
1300
|
-
boards: ["Leaderboard", "Classifica", "Clasificaci\xF3n", "Classement", "Bestenliste", "Classifica\xE7\xE3o", "\u30E9\u30F3\u30AD\u30F3\u30B0"],
|
|
1301
|
-
board: ["Board", "Classifica", "Tabla", "Classement", "Bestenliste", "Tabela", "\u30E9\u30F3\u30AD\u30F3\u30B0"],
|
|
1302
|
-
daily: ["Daily", "Giornaliera", "Diaria", "Du jour", "T\xE4glich", "Di\xE1ria", "\u65E5\u5225"],
|
|
1303
|
-
allTime: ["All time", "Di sempre", "Hist\xF3rica", "Tous les temps", "Gesamt", "Geral", "\u5168\u671F\u9593"],
|
|
1304
|
-
accounts: ["Accounts", "Account", "Cuentas", "Comptes", "Konten", "Contas", "\u30A2\u30AB\u30A6\u30F3\u30C8"],
|
|
1305
|
-
guests: ["Guests", "Ospiti", "Invitados", "Invit\xE9s", "G\xE4ste", "Visitantes", "\u30B2\u30B9\u30C8"],
|
|
1306
|
-
category: ["Category", "Categoria", "Categoria", "Cat\xE9gorie", "Kategorie", "Categoria", "\u533A\u5206"],
|
|
1307
|
-
period: ["Period", "Periodo", "Per\xEDodo", "P\xE9riode", "Zeitraum", "Per\xEDodo", "\u671F\u9593"],
|
|
1308
|
-
rank: ["Rank", "Posizione", "Puesto", "Rang", "Platz", "Posicao", "\u9806\u4F4D"],
|
|
1309
|
-
score: ["Score", "Punteggio", "Puntos", "Score", "Punkte", "Pontos", "\u30B9\u30B3\u30A2"],
|
|
1310
|
-
verified: ["Verified", "Verificato", "Verificado", "V\xE9rifi\xE9", "Verifiziert", "Verificado", "\u78BA\u8A8D\u6E08\u307F"],
|
|
1311
|
-
own: ["Your best", "Il tuo record", "Tu record", "Votre record", "Dein Rekord", "Seu recorde", "\u81EA\u5DF1\u30D9\u30B9\u30C8"],
|
|
1312
|
-
empty: ["No scores yet", "Nessun punteggio", "A\xFAn no hay puntos", "Aucun score", "Noch keine Punkte", "Ainda sem pontos", "\u307E\u3060\u30B9\u30B3\u30A2\u304C\u3042\u308A\u307E\u305B\u3093"],
|
|
1313
|
-
saving: ["Saving score...", "Salvataggio punteggio...", "Guardando puntos...", "Enregistrement du score...", "Punkte werden gespeichert...", "Salvando pontos...", "\u30B9\u30B3\u30A2\u3092\u4FDD\u5B58\u4E2D..."],
|
|
1314
|
-
saved: ["Your best is on the board", "Il tuo record \xE8 in classifica", "Tu record est\xE1 en la tabla", "Votre record est au classement", "Dein Rekord ist eingetragen", "Seu recorde est\xE1 na tabela", "\u81EA\u5DF1\u30D9\u30B9\u30C8\u304C\u30E9\u30F3\u30AD\u30F3\u30B0\u306B\u53CD\u6620\u3055\u308C\u307E\u3057\u305F"],
|
|
1315
|
-
bestAlready: ["Your best is already on the board", "Il tuo record era gi\xE0 in classifica", "Tu record ya estaba en la tabla", "Votre record est d\xE9j\xE0 au classement", "Dein Rekord ist bereits eingetragen", "Seu recorde j\xE1 est\xE1 na tabela", "\u81EA\u5DF1\u30D9\u30B9\u30C8\u306F\u53CD\u6620\u6E08\u307F\u3067\u3059"],
|
|
1316
|
-
refresh: ["Refresh", "Aggiorna", "Actualizar", "Actualiser", "Aktualisieren", "Atualizar", "\u66F4\u65B0"],
|
|
1317
|
-
refreshHint: ["Score not visible yet. Refresh to check.", "Punteggio non ancora visibile. Aggiorna per controllare.", "Puntos a\xFAn no visibles. Actualiza.", "Score pas encore visible. Actualisez.", "Punkte noch nicht sichtbar. Aktualisieren.", "Pontos ainda n\xE3o visiveis. Atualize.", "\u30B9\u30B3\u30A2\u304C\u307E\u3060\u8868\u793A\u3055\u308C\u307E\u305B\u3093\u3002\u66F4\u65B0\u3057\u3066\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"],
|
|
1318
1189
|
friends: ["Friends & party", "Amici e gruppo", "Amigos y grupo", "Amis et groupe", "Freunde & Gruppe", "Amigos e grupo", "\u53CB\u9054\u3068\u30D1\u30FC\u30C6\u30A3\u30FC"],
|
|
1319
1190
|
localCrew: ["Friends and party are unavailable in local preview.", "Amici e gruppo non disponibili in anteprima locale.", "Amigos y grupo no disponibles en la vista local.", "Amis et groupe indisponibles en aper\xE7u local.", "Freunde und Gruppe in lokaler Vorschau nicht verf\xFCgbar.", "Amigos e grupo indispon\xEDveis na pr\xE9via local.", "\u30ED\u30FC\u30AB\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC\u3067\u306F\u53CB\u9054\u3068\u30D1\u30FC\u30C6\u30A3\u30FC\u306F\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002"],
|
|
1320
1191
|
loginCrew: ["Sign in on Caisual to use friends and party.", "Accedi a Caisual per amici e gruppo.", "Inicia sesion para amigos y grupo.", "Connectez-vous pour utiliser amis et groupe.", "F\xFCr Freunde und Gruppe bei Caisual anmelden.", "Entre no Caisual para amigos e grupo.", "\u53CB\u9054\u3068\u30D1\u30FC\u30C6\u30A3\u30FC\u3092\u5229\u7528\u3059\u308B\u306B\u306FCaisual\u306B\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002"],
|
|
@@ -1477,7 +1348,7 @@ var styles = `
|
|
|
1477
1348
|
.game-icon{width:28px;height:28px;aspect-ratio:1;object-fit:contain;border-radius:7px;flex:none;vertical-align:middle}.game-icon-title{width:36px;height:36px;border-radius:10px}
|
|
1478
1349
|
.safe-area-probe{position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
|
|
1479
1350
|
:host{all:initial;position:fixed;inset:0;z-index:10000;pointer-events:none;font:15px/1.45 system-ui,sans-serif;color:#f4f4f1;color-scheme:dark;--accent:#a8efc5}
|
|
1480
|
-
[data-layout],[data-surface],.sr{pointer-events:none}*{box-sizing:border-box}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button,select,input{border:1px solid #ffffff30;background:#25292b;color:inherit;border-radius:12px;min-height:44px;padding:10px 14px}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}button:hover:not(:disabled){background:#343b3a}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:3px}a{color:var(--accent)}.primary{background:var(--accent);color:var(--accent-ink,#11221b);border-color:transparent;font-weight:700}.primary:hover:not(:disabled){filter:brightness(1.1);background:var(--accent)}.quiet{background:transparent}label{display:grid;gap:6px;text-align:left}select,input{width:100%;min-width:0}h1,h2,p{margin:0}h1{font-size:clamp(26px,5vw,42px);line-height:1.1;letter-spacing:-.035em}h2{font-size:20px}small,.muted{color:#bdc5c1}.stack{display:grid;gap:16px}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.row>*{flex:0 1 auto}.row .grow,.grow{flex:1}.split{display:grid;grid-template-columns:1fr 1fr;gap:10px}.pill{position:absolute;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));display:flex;height:44px;border:1px solid #ffffff35;border-radius:24px;background:#171e20eF;box-shadow:0 4px 20px #0004;pointer-events:auto;overflow:hidden}.pill button{border:0;border-radius:0;padding:8px 13px;background:transparent}.pill button:focus-visible{outline-offset:-4px}.pill small{margin-left:8px}.backdrop{position:absolute;inset:0;background:#0b151ce8;backdrop-filter:blur(10px);pointer-events:auto;display:grid;place-items:center;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));overflow:auto}.backdrop.home{background-color:#142127;background-size:contain;background-repeat:no-repeat;background-position:center}.dialog{position:relative;width:min(100%,540px);max-height:100%;overflow:auto;overscroll-behavior:contain;background:#141b1df5;border:1px solid #ffffff25;border-radius:22px;padding:24px;box-shadow:0 20px 80px #0005}.dialog.wide{width:min(100%,700px)}.top{display:flex;align-items:center;gap:12px;margin-bottom:18px}.top h2{flex:1}.tabs{display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid #ffffff25;padding-bottom:12px}.tabs button{min-height:36px;padding:6px 10px}.tabs [aria-current=true]{border-color:var(--accent)}.roster{list-style:none;padding:0;margin:0;display:grid;gap:8px;max-height:32dvh;overflow:auto}.roster li{display:flex;align-items:center;gap:8px;padding:10px;background:#ffffff08;border-radius:10px}.roster .name{flex:1;overflow-wrap:anywhere}.badge{border:1px solid #ffffff30;border-radius:6px;padding:2px 6px;font-size:12px}.code{font-size:24px;letter-spacing:.13em;font-variant-numeric:tabular-nums}.notice,.error{border-radius:10px;padding:10px;background:#a8efc514;overflow-wrap:anywhere}.error{background:#ff8b7720;color:#ffd2c9}.countdown{font-size:88px;line-height:1;text-align:center;font-variant-numeric:tabular-nums}.ended{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);width:max-content;background:#171e20f5;pointer-events:auto;border:1px solid #ffffff30;border-radius:16px;padding:10px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}.ended [data-rematch-players]{max-width:100%;max-height:3.2em;overflow:auto;overflow-wrap:anywhere}.standings{list-style:none;margin:0;padding:0;flex-basis:100%;max-height:20dvh;overflow:auto;font-size:13px}.standings li{display:flex;justify-content:space-between;gap:16px;overflow-wrap:anywhere}.ended{max-height:calc(100dvh - 80px);overflow:auto}.ended strong{padding:0 8px}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.
|
|
1351
|
+
[data-layout],[data-surface],.sr{pointer-events:none}*{box-sizing:border-box}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button,select,input{border:1px solid #ffffff30;background:#25292b;color:inherit;border-radius:12px;min-height:44px;padding:10px 14px}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}button:hover:not(:disabled){background:#343b3a}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:3px}a{color:var(--accent)}.primary{background:var(--accent);color:var(--accent-ink,#11221b);border-color:transparent;font-weight:700}.primary:hover:not(:disabled){filter:brightness(1.1);background:var(--accent)}.quiet{background:transparent}label{display:grid;gap:6px;text-align:left}select,input{width:100%;min-width:0}h1,h2,p{margin:0}h1{font-size:clamp(26px,5vw,42px);line-height:1.1;letter-spacing:-.035em}h2{font-size:20px}small,.muted{color:#bdc5c1}.stack{display:grid;gap:16px}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.row>*{flex:0 1 auto}.row .grow,.grow{flex:1}.split{display:grid;grid-template-columns:1fr 1fr;gap:10px}.pill{position:absolute;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));display:flex;height:44px;border:1px solid #ffffff35;border-radius:24px;background:#171e20eF;box-shadow:0 4px 20px #0004;pointer-events:auto;overflow:hidden}.pill button{border:0;border-radius:0;padding:8px 13px;background:transparent}.pill button:focus-visible{outline-offset:-4px}.pill small{margin-left:8px}.backdrop{position:absolute;inset:0;background:#0b151ce8;backdrop-filter:blur(10px);pointer-events:auto;display:grid;place-items:center;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));overflow:auto}.backdrop.home{background-color:#142127;background-size:contain;background-repeat:no-repeat;background-position:center}.dialog{position:relative;width:min(100%,540px);max-height:100%;overflow:auto;overscroll-behavior:contain;background:#141b1df5;border:1px solid #ffffff25;border-radius:22px;padding:24px;box-shadow:0 20px 80px #0005}.dialog.wide{width:min(100%,700px)}.top{display:flex;align-items:center;gap:12px;margin-bottom:18px}.top h2{flex:1}.tabs{display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid #ffffff25;padding-bottom:12px}.tabs button{min-height:36px;padding:6px 10px}.tabs [aria-current=true]{border-color:var(--accent)}.roster{list-style:none;padding:0;margin:0;display:grid;gap:8px;max-height:32dvh;overflow:auto}.roster li{display:flex;align-items:center;gap:8px;padding:10px;background:#ffffff08;border-radius:10px}.roster .name{flex:1;overflow-wrap:anywhere}.badge{border:1px solid #ffffff30;border-radius:6px;padding:2px 6px;font-size:12px}.code{font-size:24px;letter-spacing:.13em;font-variant-numeric:tabular-nums}.notice,.error{border-radius:10px;padding:10px;background:#a8efc514;overflow-wrap:anywhere}.error{background:#ff8b7720;color:#ffd2c9}.countdown{font-size:88px;line-height:1;text-align:center;font-variant-numeric:tabular-nums}.ended{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);width:max-content;background:#171e20f5;pointer-events:auto;border:1px solid #ffffff30;border-radius:16px;padding:10px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}.ended [data-rematch-players]{max-width:100%;max-height:3.2em;overflow:auto;overflow-wrap:anywhere}.standings{list-style:none;margin:0;padding:0;flex-basis:100%;max-height:20dvh;overflow:auto;font-size:13px}.standings li{display:flex;justify-content:space-between;gap:16px;overflow-wrap:anywhere}.ended{max-height:calc(100dvh - 80px);overflow:auto}.ended strong{padding:0 8px}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.checkbox{display:flex;align-items:center;gap:8px;font-size:13px}.checkbox input{width:18px;min-height:18px}.full{width:100%}
|
|
1481
1352
|
.game-heading{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.game-heading h1{font-size:28px;overflow-wrap:anywhere}.home .top{margin-bottom:12px}.game-description{font-size:13px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.experience-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border:1px solid #ffffff18;border-radius:14px;background:#0003}.experience-tabs button{background:transparent;border-color:transparent;font-size:14px;font-weight:600;padding:10px 8px;border-radius:10px;color:#bdc5c1}.experience-tabs [aria-selected=true]{background:#ffffff16;color:#f4f4f1;box-shadow:0 1px 4px #0003}.experience-tabs button:focus-visible{outline-offset:-3px}.home-content{gap:14px;min-width:0}.mode-details{display:grid;gap:6px;min-width:0}.mode-details h2{font-size:16px;font-weight:600}.mode-details label{font-size:13px}.mode-instructions{font-size:12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.play-actions{gap:8px}.play-actions .primary{min-height:50px;font-size:16px}.home-links{gap:4px}.home-links button{border-color:transparent;font-size:13px}.home-links button:hover:not(:disabled){background:#ffffff0a}.resume-action{gap:4px}.resume-action small{text-align:center}.panel-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:18px;padding-top:10px;border-top:1px solid #ffffff18;color:#bdc5c1}.panel-footer .checkbox{font-size:11px;white-space:nowrap;min-height:32px;gap:6px}.panel-footer input{margin:0;accent-color:var(--accent);width:14px;min-height:14px}.panel-footer small{min-width:0;text-align:right;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase}
|
|
1482
1353
|
[hidden]{display:none!important}.voice-peers{list-style:none;margin:0;padding:0;display:grid;gap:10px}.voice-peers li{border:1px solid #ffffff25;border-radius:12px;padding:12px;display:grid;gap:8px}.voice-peers [data-speaking=true]{border-color:var(--accent)}.voice-peers input{width:100%;accent-color:var(--accent);padding:0}.voice-peers label{font-size:13px}.pill .voice-toggle{width:44px;padding:8px}.voice-toggle[data-voice-state=on][data-muted=false]{color:var(--accent)}
|
|
1483
1354
|
.boot{position:absolute;inset:0;z-index:2;isolation:isolate;display:grid;place-items:center;overflow:auto;overscroll-behavior:contain;padding:max(100px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(48px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));background:#0b151c;opacity:1;transition:opacity .4s ease;pointer-events:auto;outline:none}
|
|
@@ -1610,7 +1481,6 @@ function mountOverlay(input) {
|
|
|
1610
1481
|
model.shortcutEnabled = win.localStorage.getItem("caisual-overlay-shortcut-v1") !== "off";
|
|
1611
1482
|
} catch {
|
|
1612
1483
|
}
|
|
1613
|
-
const boards = input.boards ? createBoardController({ manifest, player: input.player.id, guests: input.player.guest, read: input.boards, changed: () => render() }) : null;
|
|
1614
1484
|
const stops = [];
|
|
1615
1485
|
const modeGroups = groupModes(manifest);
|
|
1616
1486
|
const selectedMode = () => manifest.modes.find((mode) => mode.id === model.mode);
|
|
@@ -1693,10 +1563,6 @@ function mountOverlay(input) {
|
|
|
1693
1563
|
const solo = () => model.session?.room?.limits.max === 1;
|
|
1694
1564
|
const roomCode = () => solo() ? null : model.session?.room?.code ?? null;
|
|
1695
1565
|
const setPanel = (panel) => {
|
|
1696
|
-
if (panel === "boards" && boards && !boards.state.query) {
|
|
1697
|
-
const id = Object.keys(manifest.boards)[0];
|
|
1698
|
-
if (id) boards.select({ board: id, period: (manifest.boards[id].periods ?? ["all-time"])[0], guests: input.player.guest });
|
|
1699
|
-
}
|
|
1700
1566
|
copyFallback = null;
|
|
1701
1567
|
dispatch({ type: "panel", panel });
|
|
1702
1568
|
};
|
|
@@ -1776,7 +1642,6 @@ function mountOverlay(input) {
|
|
|
1776
1642
|
const items = [];
|
|
1777
1643
|
if (model.session?.room && !solo()) items.push(["room", "room"], ["invite", "copy"]);
|
|
1778
1644
|
items.push(["friends", "friends"]);
|
|
1779
|
-
if (Object.keys(manifest.boards).length) items.push(["boards", "boards"]);
|
|
1780
1645
|
if (voiceEligible(manifest, model.session)) items.push(["voice", "voice"]);
|
|
1781
1646
|
return `<nav class="tabs" aria-label="Caisual">${items.map(([id, key]) => button(`panel:${id}`, key, ` aria-current="${id === panel}"`)).join("")}</nav>`;
|
|
1782
1647
|
}
|
|
@@ -1801,7 +1666,7 @@ function mountOverlay(input) {
|
|
|
1801
1666
|
<div class="stack play-actions">${!singlePlayer && selected?.matchmaking ? button("match", "find", ' class="primary"', !selected.matchmaking.defaults || !session?.ready) : ""}
|
|
1802
1667
|
${action ? button("play", playKey, singlePlayer || !selected?.matchmaking ? ' class="primary"' : "", !session?.ready) : ""}</div>
|
|
1803
1668
|
${!singlePlayer ? `<div class="split home-links">${button("panel:join", "join", ' class="quiet"', !session?.ready)}${manifest.spectators ? button("panel:watch", "watch", ' class="quiet"', !session?.ready) : ""}</div>` : ""}
|
|
1804
|
-
${!singlePlayer
|
|
1669
|
+
${!singlePlayer ? `<div class="stack home-links">${button("panel:friends", "friends", ' class="quiet"')}</div>` : ""}
|
|
1805
1670
|
${solo() ? button("panel:exit", "exit", ' class="quiet"') : ""}
|
|
1806
1671
|
</div>`;
|
|
1807
1672
|
}
|
|
@@ -1828,17 +1693,6 @@ function mountOverlay(input) {
|
|
|
1828
1693
|
${state.follow ? `<div class="row"><span class="grow"><img class="game-icon" src="${escape(state.follow.game.iconUrl)}" alt="" /> ${escape(state.follow.from.name)} \xB7 ${escape(state.follow.game.name)}</span>${button("follow", "follow", ` data-code="${escape(state.follow.code)}" data-game="${escape(state.follow.game.slug)}"`)}</div>` : ""}
|
|
1829
1694
|
<h2>${t("online")}</h2>${online.length ? `<ul class="roster">${online.map(person).join("")}</ul>` : `<p class="muted">${t("noFriends")}</p>`}`;
|
|
1830
1695
|
}
|
|
1831
|
-
function leaderboard() {
|
|
1832
|
-
if (!boards || !boards.state.query) return `<p>${t("unavailable")}</p>`;
|
|
1833
|
-
const { query, data, loading, error, saving } = boards.state;
|
|
1834
|
-
const board = manifest.boards[query.board];
|
|
1835
|
-
return `<label>${t("board")}<select data-control="board">${Object.entries(manifest.boards).map(([id, value]) => `<option value="${escape(id)}"${query.board === id ? " selected" : ""}>${escape(resolveText(value.label, input.language, manifestLanguages(manifest)[0], id))}</option>`).join("")}</select></label>
|
|
1836
|
-
<div class="split"><label>${t("period")}<select data-control="period">${(board.periods ?? ["all-time"]).map((period) => `<option value="${period}"${query.period === period ? " selected" : ""}>${t(period === "daily" ? "daily" : "allTime")}</option>`).join("")}</select></label><label>${t("category")}<select data-control="category"><option value="accounts"${!query.guests ? " selected" : ""}>${t("accounts")}</option><option value="guests"${query.guests ? " selected" : ""}>${t("guests")}</option></select></label></div>
|
|
1837
|
-
${query.period === "daily" ? `<small data-board-day>${escape(data?.day ?? query.day ?? new Date(input.bridge.serverTime() ?? Date.now()).toISOString().slice(0, 10))}</small>` : ""}
|
|
1838
|
-
${saving ? `<p role="status" data-saving>${t(saving)}</p>` : ""}${error ? `<p role="alert">${t("offline")}</p>` : ""}
|
|
1839
|
-
${data ? `<div class="table-wrap"><table><thead><tr><th>${t("rank")}</th><th>${t(query.guests ? "guests" : "accounts")}</th><th>${t("score")}</th></tr></thead><tbody>${data.entries.map((entry) => `<tr${entry.me ? ' class="self"' : ""}><td>${entry.rank}</td><td>${escape(entry.name)}${entry.verified ? `<small>${t("verified")}</small>` : ""}</td><td>${entry.score}</td></tr>`).join("")}</tbody></table>${data.entries.length ? "" : `<p>${t("empty")}</p>`}</div><p data-own-score>${t("own")} (${t(data.ownGuest ? "guests" : "accounts")}): ${data.me ? `#${data.me.rank} \xB7 ${data.me.score}${data.me.verified ? ` \xB7 ${t("verified")}` : ""}` : t("empty")}</p>` : `<p>${t(loading ? "loading" : "empty")}</p>`}
|
|
1840
|
-
${button("refresh", "refresh", "", loading)}`;
|
|
1841
|
-
}
|
|
1842
1696
|
function content(panel) {
|
|
1843
1697
|
switch (panel) {
|
|
1844
1698
|
case "home":
|
|
@@ -1852,8 +1706,6 @@ function mountOverlay(input) {
|
|
|
1852
1706
|
return crew();
|
|
1853
1707
|
case "voice":
|
|
1854
1708
|
return '<div class="stack" data-voice-panel></div>';
|
|
1855
|
-
case "boards":
|
|
1856
|
-
return leaderboard();
|
|
1857
1709
|
case "join":
|
|
1858
1710
|
case "watch":
|
|
1859
1711
|
return `<form class="stack" data-form="${panel}"><label>${t("code")}<input data-control="code" name="code" autocomplete="off" autocapitalize="characters" spellcheck="false" maxlength="16" value="${escape(codeDraft)}" required></label><button class="primary" type="submit"${disabled()}>${t(panel === "join" ? "join" : "watch")}</button></form>`;
|
|
@@ -1871,7 +1723,7 @@ function mountOverlay(input) {
|
|
|
1871
1723
|
}
|
|
1872
1724
|
}
|
|
1873
1725
|
function title(panel) {
|
|
1874
|
-
const keys = { boot: "loading", home: "home", room: "room", invite: "copy", friends: "friends", voice: "voice",
|
|
1726
|
+
const keys = { boot: "loading", home: "home", room: "room", invite: "copy", friends: "friends", voice: "voice", join: "join", watch: "watch", attaching: "joining", matching: "matching", countdown: "starting", error: "error", exit: "exit" };
|
|
1875
1727
|
return t(keys[panel]);
|
|
1876
1728
|
}
|
|
1877
1729
|
function updateCountdown() {
|
|
@@ -1971,8 +1823,8 @@ function mountOverlay(input) {
|
|
|
1971
1823
|
const label = current === "watching" ? t("watching") : room2?.connection === "reconnecting" ? t("reconnecting") : solo() ? "Caisual" : room2?.code ?? "Caisual";
|
|
1972
1824
|
surface.innerHTML = current === "boot" ? "" : `<div class="pill" data-reserve><button type="button" data-action="menu" aria-label="${t("menu")}" aria-expanded="${!!panel}">C<span aria-hidden="true"><small>${escape(label)}</small></span></button>${voiceEligible(manifest, model.session) && model.session?.kind === "room" ? `<button type="button" class="voice-toggle" data-voice-toggle data-action="panel:voice"></button>` : ""}${invitations ? `<button type="button" data-action="panel:friends" aria-label="${t("friends")} (${invitations})">${invitations}</button>` : ""}</div>
|
|
1973
1825
|
${!panel ? replayBar() : ""}
|
|
1974
|
-
${current === "ended" && !panel && !room2?.replay ? `<div class="ended" data-reserve role="region" aria-label="${t("ended")}">${resultBar()}${replayActions()}${
|
|
1975
|
-
${panel ? `<div class="backdrop${panel === "home" ? " home" : ""}"><section class="dialog${panel === "
|
|
1826
|
+
${current === "ended" && !panel && !room2?.replay ? `<div class="ended" data-reserve role="region" aria-label="${t("ended")}">${resultBar()}${replayActions()}${canPlayAgain(model.session) ? button("again", "again", ' class="primary"') : model.session?.kind === "room" && room2?.status !== "finished" && !solo() ? `<small>${t("waitHost")}</small>` : ""}${rematchBar()}${button("panel:home", "homeMenu")}</div>` : ""}
|
|
1827
|
+
${panel ? `<div class="backdrop${panel === "home" ? " home" : ""}"><section class="dialog${panel === "friends" ? " wide" : ""}" role="dialog" aria-modal="true" aria-labelledby="panel-title" tabindex="-1"><div class="top">${panel === "home" ? `<div class="game-heading">${input.configuration.iconUrl ? `<img class="game-icon game-icon-title" src="${escape(input.configuration.iconUrl)}" alt="" />` : ""}<h1 id="panel-title">${escape(manifest.name)}</h1></div>` : `<h2 id="panel-title">${title(panel)}</h2>`}<button type="button" data-action="close" aria-label="${t("close")}">\xD7</button></div><div class="stack">${content(panel)}${model.error ? `<p class="error" role="alert" data-error>${t(errorText(model.error))}</p>${model.error === "version_outdated" ? button("reload-game", "reloadGame", ' class="primary"') : ""}` : ""}${model.session?.resumeError ? `<p class="error" role="alert">${t("saveFailed")}</p>` : ""}${model.notice ? `<p class="notice" role="status">${escape(model.notice)}</p>` : ""}</div>${panel === "home" || panel === "room" ? footer() : ""}</section></div>` : ""}`;
|
|
1976
1828
|
for (const element of surface.querySelectorAll(".pill,.backdrop,.ended,.replay-controls")) element.style.pointerEvents = "auto";
|
|
1977
1829
|
const backdrop = root.querySelector(".backdrop.home");
|
|
1978
1830
|
if (backdrop && input.configuration.coverUrl) backdrop.style.backgroundImage = `linear-gradient(#0b151c99,#0b151cee),url(${JSON.stringify(input.configuration.coverUrl)})`;
|
|
@@ -2115,9 +1967,6 @@ function mountOverlay(input) {
|
|
|
2115
1967
|
resetBootWait();
|
|
2116
1968
|
input.frame.src = input.frame.src;
|
|
2117
1969
|
break;
|
|
2118
|
-
case "refresh":
|
|
2119
|
-
void boards?.refresh();
|
|
2120
|
-
break;
|
|
2121
1970
|
case "party-create":
|
|
2122
1971
|
input.crew?.party.create();
|
|
2123
1972
|
break;
|
|
@@ -2168,21 +2017,6 @@ function mountOverlay(input) {
|
|
|
2168
2017
|
}
|
|
2169
2018
|
dispatch({ type: "shortcut", enabled });
|
|
2170
2019
|
}
|
|
2171
|
-
const query = boards?.state.query;
|
|
2172
|
-
if (query && ["board", "period", "category"].includes(field ?? "")) {
|
|
2173
|
-
const next = { ...query };
|
|
2174
|
-
if (field === "board") {
|
|
2175
|
-
next.board = target.value;
|
|
2176
|
-
next.period = (manifest.boards[next.board].periods ?? ["all-time"])[0];
|
|
2177
|
-
delete next.day;
|
|
2178
|
-
}
|
|
2179
|
-
if (field === "period") {
|
|
2180
|
-
next.period = target.value;
|
|
2181
|
-
delete next.day;
|
|
2182
|
-
}
|
|
2183
|
-
if (field === "category") next.guests = target.value === "guests";
|
|
2184
|
-
boards.select(next);
|
|
2185
|
-
}
|
|
2186
2020
|
};
|
|
2187
2021
|
const submit = (event) => {
|
|
2188
2022
|
const form = event.target;
|
|
@@ -2258,7 +2092,6 @@ function mountOverlay(input) {
|
|
|
2258
2092
|
}
|
|
2259
2093
|
if (!session) {
|
|
2260
2094
|
lastView = "";
|
|
2261
|
-
boards?.reset();
|
|
2262
2095
|
operation++;
|
|
2263
2096
|
model.busy = false;
|
|
2264
2097
|
}
|
|
@@ -2282,7 +2115,6 @@ function mountOverlay(input) {
|
|
|
2282
2115
|
if (!visiblePanel(model)) setPanel("room");
|
|
2283
2116
|
dispatch({ type: "error", code: error.code });
|
|
2284
2117
|
}));
|
|
2285
|
-
stops.push(input.bridge.onScore((score) => boards?.queued(score)));
|
|
2286
2118
|
if (input.crew) stops.push(input.crew.subscribe(() => {
|
|
2287
2119
|
const state = input.crew.getSnapshot();
|
|
2288
2120
|
if (state.follow || state.invites.length) announce(t("friends"));
|
|
@@ -2293,7 +2125,6 @@ function mountOverlay(input) {
|
|
|
2293
2125
|
disposed = true;
|
|
2294
2126
|
operation++;
|
|
2295
2127
|
stops.forEach((stop) => stop());
|
|
2296
|
-
boards?.dispose();
|
|
2297
2128
|
observer?.disconnect();
|
|
2298
2129
|
win.clearInterval(countdownTimer);
|
|
2299
2130
|
win.cancelAnimationFrame(geometryFrame);
|