@the-inclusionist/engine 6.36.1
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/LICENSE +661 -0
- package/README.md +107 -0
- package/app/css/style.css +622 -0
- package/app/public/vendor/fonts/andika-400-ext.woff2 +0 -0
- package/app/public/vendor/fonts/andika-400.woff2 +0 -0
- package/app/public/vendor/fonts/andika-700-ext.woff2 +0 -0
- package/app/public/vendor/fonts/andika-700.woff2 +0 -0
- package/app/public/vendor/fonts/atkinson-400-ext.woff2 +0 -0
- package/app/public/vendor/fonts/atkinson-400.woff2 +0 -0
- package/app/public/vendor/fonts/atkinson-700-ext.woff2 +0 -0
- package/app/public/vendor/fonts/atkinson-700.woff2 +0 -0
- package/app/public/vendor/fonts/atkinson-mono-400-ext.woff2 +0 -0
- package/app/public/vendor/fonts/atkinson-mono-400.woff2 +0 -0
- package/app/public/vendor/fonts/comicneue-400.woff2 +0 -0
- package/app/public/vendor/fonts/comicneue-700.woff2 +0 -0
- package/app/public/vendor/fonts/greatvibes-400.woff2 +0 -0
- package/app/public/vendor/fonts/inter-400.woff2 +0 -0
- package/app/public/vendor/fonts/inter-700.woff2 +0 -0
- package/app/public/vendor/fonts/lato-400.woff2 +0 -0
- package/app/public/vendor/fonts/lato-700.woff2 +0 -0
- package/app/public/vendor/fonts/lexend-400-ext.woff2 +0 -0
- package/app/public/vendor/fonts/lexend-400.woff2 +0 -0
- package/app/public/vendor/fonts/lexend-700-ext.woff2 +0 -0
- package/app/public/vendor/fonts/lexend-700.woff2 +0 -0
- package/app/public/vendor/fonts/literata-400.woff2 +0 -0
- package/app/public/vendor/fonts/literata-700.woff2 +0 -0
- package/app/public/vendor/fonts/newsreader-400.woff2 +0 -0
- package/app/public/vendor/fonts/newsreader-700.woff2 +0 -0
- package/app/public/vendor/fonts/opensans-400.woff2 +0 -0
- package/app/public/vendor/fonts/opensans-700.woff2 +0 -0
- package/app/public/vendor/fonts/pinyon-400.woff2 +0 -0
- package/app/public/vendor/fonts/quattro-400.woff2 +0 -0
- package/app/public/vendor/fonts/quattro-700.woff2 +0 -0
- package/app/public/vendor/fonts/sourcesans-400.woff2 +0 -0
- package/app/public/vendor/fonts/sourcesans-700.woff2 +0 -0
- package/app/public/vendor/fonts/sourceserif-400.woff2 +0 -0
- package/app/public/vendor/fonts/sourceserif-700.woff2 +0 -0
- package/app/public/vendor/fonts/ufcook-700.woff2 +0 -0
- package/app/public/vendor/fonts/ufmag-400.woff2 +0 -0
- package/app/public/vendor/fonts.css +88 -0
- package/dist-pkg/boot/create-game.d.ts +159 -0
- package/dist-pkg/boot/create-game.js +266 -0
- package/dist-pkg/core/a11y-sr.d.ts +4 -0
- package/dist-pkg/core/a11y-sr.js +20 -0
- package/dist-pkg/core/actions.d.ts +100 -0
- package/dist-pkg/core/actions.js +149 -0
- package/dist-pkg/core/anel.d.ts +17 -0
- package/dist-pkg/core/anel.js +31 -0
- package/dist-pkg/core/collision.d.ts +21 -0
- package/dist-pkg/core/collision.js +62 -0
- package/dist-pkg/core/constants.d.ts +84 -0
- package/dist-pkg/core/constants.js +64 -0
- package/dist-pkg/core/contract.d.ts +227 -0
- package/dist-pkg/core/contract.js +184 -0
- package/dist-pkg/core/dom-query.d.ts +9 -0
- package/dist-pkg/core/dom-query.js +25 -0
- package/dist-pkg/core/entity.d.ts +150 -0
- package/dist-pkg/core/entity.js +38 -0
- package/dist-pkg/core/escape-html.d.ts +16 -0
- package/dist-pkg/core/escape-html.js +32 -0
- package/dist-pkg/core/i18n.d.ts +71 -0
- package/dist-pkg/core/i18n.js +236 -0
- package/dist-pkg/core/layers.d.ts +39 -0
- package/dist-pkg/core/layers.js +71 -0
- package/dist-pkg/core/letter-grid.d.ts +55 -0
- package/dist-pkg/core/letter-grid.js +116 -0
- package/dist-pkg/core/loop.d.ts +17 -0
- package/dist-pkg/core/loop.js +36 -0
- package/dist-pkg/core/password.d.ts +34 -0
- package/dist-pkg/core/password.js +205 -0
- package/dist-pkg/core/rng.d.ts +20 -0
- package/dist-pkg/core/rng.js +61 -0
- package/dist-pkg/core/rotulo-acessivel.d.ts +17 -0
- package/dist-pkg/core/rotulo-acessivel.js +41 -0
- package/dist-pkg/core/run-state.d.ts +115 -0
- package/dist-pkg/core/run-state.js +40 -0
- package/dist-pkg/core/scenes.d.ts +68 -0
- package/dist-pkg/core/scenes.js +64 -0
- package/dist-pkg/core/screens.d.ts +16 -0
- package/dist-pkg/core/screens.js +28 -0
- package/dist-pkg/core/state.d.ts +138 -0
- package/dist-pkg/core/state.js +290 -0
- package/dist-pkg/core/tiles.d.ts +12 -0
- package/dist-pkg/core/tiles.js +61 -0
- package/dist-pkg/core/world.d.ts +4 -0
- package/dist-pkg/core/world.js +58 -0
- package/dist-pkg/educational/activities-registry.d.ts +47 -0
- package/dist-pkg/educational/activities-registry.js +95 -0
- package/dist-pkg/i18n/en.d.ts +3 -0
- package/dist-pkg/i18n/en.js +560 -0
- package/dist-pkg/i18n/es.d.ts +3 -0
- package/dist-pkg/i18n/es.js +558 -0
- package/dist-pkg/i18n/pt.d.ts +3 -0
- package/dist-pkg/i18n/pt.js +618 -0
- package/dist-pkg/input/default-bindings.d.ts +24 -0
- package/dist-pkg/input/default-bindings.js +122 -0
- package/dist-pkg/input/devices.d.ts +15 -0
- package/dist-pkg/input/devices.js +31 -0
- package/dist-pkg/input/edges.d.ts +58 -0
- package/dist-pkg/input/edges.js +49 -0
- package/dist-pkg/input/gamepad.d.ts +203 -0
- package/dist-pkg/input/gamepad.js +531 -0
- package/dist-pkg/input/keyboard-runtime.d.ts +61 -0
- package/dist-pkg/input/keyboard-runtime.js +83 -0
- package/dist-pkg/input/keyboard.d.ts +45 -0
- package/dist-pkg/input/keyboard.js +80 -0
- package/dist-pkg/input/keydown.d.ts +270 -0
- package/dist-pkg/input/keydown.js +381 -0
- package/dist-pkg/input/latch.d.ts +30 -0
- package/dist-pkg/input/latch.js +63 -0
- package/dist-pkg/input/pointer-space.d.ts +40 -0
- package/dist-pkg/input/pointer-space.js +51 -0
- package/dist-pkg/input/state.d.ts +11 -0
- package/dist-pkg/input/state.js +12 -0
- package/dist-pkg/input/touch-bindings.d.ts +210 -0
- package/dist-pkg/input/touch-bindings.js +365 -0
- package/dist-pkg/input/touch.d.ts +173 -0
- package/dist-pkg/input/touch.js +314 -0
- package/dist-pkg/input/transports.d.ts +90 -0
- package/dist-pkg/input/transports.js +96 -0
- package/dist-pkg/input/vocabulary-migration.d.ts +58 -0
- package/dist-pkg/input/vocabulary-migration.js +125 -0
- package/dist-pkg/platform/audio-ambient.d.ts +27 -0
- package/dist-pkg/platform/audio-ambient.js +89 -0
- package/dist-pkg/platform/audio-earcons.d.ts +24 -0
- package/dist-pkg/platform/audio-earcons.js +62 -0
- package/dist-pkg/platform/audio-jingles.d.ts +17 -0
- package/dist-pkg/platform/audio-jingles.js +54 -0
- package/dist-pkg/platform/audio-mixer.d.ts +14 -0
- package/dist-pkg/platform/audio-mixer.js +62 -0
- package/dist-pkg/platform/audio-nav.d.ts +51 -0
- package/dist-pkg/platform/audio-nav.js +99 -0
- package/dist-pkg/platform/audio-sonar.d.ts +71 -0
- package/dist-pkg/platform/audio-sonar.js +173 -0
- package/dist-pkg/platform/audio.d.ts +32 -0
- package/dist-pkg/platform/audio.js +191 -0
- package/dist-pkg/platform/interruptible-speech.d.ts +19 -0
- package/dist-pkg/platform/interruptible-speech.js +79 -0
- package/dist-pkg/platform/speech.d.ts +2 -0
- package/dist-pkg/platform/speech.js +35 -0
- package/dist-pkg/platform/storage.d.ts +87 -0
- package/dist-pkg/platform/storage.js +148 -0
- package/dist-pkg/platform/tts.d.ts +33 -0
- package/dist-pkg/platform/tts.js +142 -0
- package/dist-pkg/render/camera.d.ts +58 -0
- package/dist-pkg/render/camera.js +105 -0
- package/dist-pkg/render/canvas.d.ts +13 -0
- package/dist-pkg/render/canvas.js +26 -0
- package/dist-pkg/render/cenario-data.d.ts +127 -0
- package/dist-pkg/render/cenario-data.js +145 -0
- package/dist-pkg/render/city-tex.d.ts +63 -0
- package/dist-pkg/render/city-tex.js +228 -0
- package/dist-pkg/render/city-tiles.d.ts +11 -0
- package/dist-pkg/render/city-tiles.js +140 -0
- package/dist-pkg/render/crt.d.ts +19 -0
- package/dist-pkg/render/crt.js +92 -0
- package/dist-pkg/render/cvd-matrices.d.ts +35 -0
- package/dist-pkg/render/cvd-matrices.js +91 -0
- package/dist-pkg/render/draw.d.ts +149 -0
- package/dist-pkg/render/draw.js +221 -0
- package/dist-pkg/render/fx.d.ts +63 -0
- package/dist-pkg/render/fx.js +123 -0
- package/dist-pkg/render/hc-role-data.d.ts +14 -0
- package/dist-pkg/render/hc-role-data.js +24 -0
- package/dist-pkg/render/high-contrast.d.ts +109 -0
- package/dist-pkg/render/high-contrast.js +254 -0
- package/dist-pkg/render/lq-filter.d.ts +37 -0
- package/dist-pkg/render/lq-filter.js +94 -0
- package/dist-pkg/render/minimap.d.ts +11 -0
- package/dist-pkg/render/minimap.js +94 -0
- package/dist-pkg/render/parallax.d.ts +85 -0
- package/dist-pkg/render/parallax.js +158 -0
- package/dist-pkg/render/player-anim.d.ts +71 -0
- package/dist-pkg/render/player-anim.js +152 -0
- package/dist-pkg/render/port.d.ts +143 -0
- package/dist-pkg/render/port.js +29 -0
- package/dist-pkg/render/recycling-tex.d.ts +48 -0
- package/dist-pkg/render/recycling-tex.js +164 -0
- package/dist-pkg/render/scene-city.d.ts +77 -0
- package/dist-pkg/render/scene-city.js +181 -0
- package/dist-pkg/render/scene-parallax.d.ts +72 -0
- package/dist-pkg/render/scene-parallax.js +426 -0
- package/dist-pkg/render/scene-sky.d.ts +126 -0
- package/dist-pkg/render/scene-sky.js +295 -0
- package/dist-pkg/render/screen-pipeline.d.ts +134 -0
- package/dist-pkg/render/screen-pipeline.js +177 -0
- package/dist-pkg/render/set-cenario.d.ts +54 -0
- package/dist-pkg/render/set-cenario.js +103 -0
- package/dist-pkg/render/sprite-fx.d.ts +3 -0
- package/dist-pkg/render/sprite-fx.js +40 -0
- package/dist-pkg/render/textures.d.ts +75 -0
- package/dist-pkg/render/textures.js +240 -0
- package/dist-pkg/render/title-scene.d.ts +46 -0
- package/dist-pkg/render/title-scene.js +75 -0
- package/dist-pkg/render/viewports.d.ts +52 -0
- package/dist-pkg/render/viewports.js +185 -0
- package/dist-pkg/render/viz-axes.d.ts +98 -0
- package/dist-pkg/render/viz-axes.js +184 -0
- package/dist-pkg/render/viz-modes.d.ts +61 -0
- package/dist-pkg/render/viz-modes.js +74 -0
- package/dist-pkg/render/viz-setters.d.ts +130 -0
- package/dist-pkg/render/viz-setters.js +244 -0
- package/dist-pkg/render/weather.d.ts +96 -0
- package/dist-pkg/render/weather.js +171 -0
- package/dist-pkg/render/wheelchair-sprites.d.ts +24 -0
- package/dist-pkg/render/wheelchair-sprites.js +63 -0
- package/dist-pkg/render/world-tex.d.ts +18 -0
- package/dist-pkg/render/world-tex.js +87 -0
- package/dist-pkg/ui/activities-menu.d.ts +258 -0
- package/dist-pkg/ui/activities-menu.js +648 -0
- package/dist-pkg/ui/caa-sets.d.ts +39 -0
- package/dist-pkg/ui/caa-sets.js +65 -0
- package/dist-pkg/ui/changed-mark.d.ts +15 -0
- package/dist-pkg/ui/changed-mark.js +96 -0
- package/dist-pkg/ui/debug-panel.d.ts +67 -0
- package/dist-pkg/ui/debug-panel.js +173 -0
- package/dist-pkg/ui/dom.d.ts +24 -0
- package/dist-pkg/ui/dom.js +47 -0
- package/dist-pkg/ui/focus-trap.d.ts +71 -0
- package/dist-pkg/ui/focus-trap.js +99 -0
- package/dist-pkg/ui/fonts.d.ts +41 -0
- package/dist-pkg/ui/fonts.js +59 -0
- package/dist-pkg/ui/hud.d.ts +137 -0
- package/dist-pkg/ui/hud.js +229 -0
- package/dist-pkg/ui/item-announcement.d.ts +19 -0
- package/dist-pkg/ui/item-announcement.js +36 -0
- package/dist-pkg/ui/layout.d.ts +6 -0
- package/dist-pkg/ui/layout.js +54 -0
- package/dist-pkg/ui/loop-crash.d.ts +19 -0
- package/dist-pkg/ui/loop-crash.js +60 -0
- package/dist-pkg/ui/map-hub.d.ts +56 -0
- package/dist-pkg/ui/map-hub.js +138 -0
- package/dist-pkg/ui/menu-nav.d.ts +141 -0
- package/dist-pkg/ui/menu-nav.js +390 -0
- package/dist-pkg/ui/pause-icons.d.ts +327 -0
- package/dist-pkg/ui/pause-icons.js +620 -0
- package/dist-pkg/ui/reach-notice.d.ts +34 -0
- package/dist-pkg/ui/reach-notice.js +71 -0
- package/dist-pkg/ui/settings-audio.d.ts +139 -0
- package/dist-pkg/ui/settings-audio.js +544 -0
- package/dist-pkg/ui/settings-caa.d.ts +45 -0
- package/dist-pkg/ui/settings-caa.js +137 -0
- package/dist-pkg/ui/settings-controls.d.ts +100 -0
- package/dist-pkg/ui/settings-controls.js +152 -0
- package/dist-pkg/ui/settings-empathy.d.ts +62 -0
- package/dist-pkg/ui/settings-empathy.js +137 -0
- package/dist-pkg/ui/settings-motion.d.ts +95 -0
- package/dist-pkg/ui/settings-motion.js +282 -0
- package/dist-pkg/ui/settings-motor.d.ts +77 -0
- package/dist-pkg/ui/settings-motor.js +215 -0
- package/dist-pkg/ui/settings-panel.d.ts +76 -0
- package/dist-pkg/ui/settings-panel.js +187 -0
- package/dist-pkg/ui/settings-typo.d.ts +74 -0
- package/dist-pkg/ui/settings-typo.js +150 -0
- package/dist-pkg/ui/settings-visual.d.ts +111 -0
- package/dist-pkg/ui/settings-visual.js +252 -0
- package/dist-pkg/ui/shell.d.ts +239 -0
- package/dist-pkg/ui/shell.js +430 -0
- package/dist-pkg/ui/title.d.ts +36 -0
- package/dist-pkg/ui/title.js +60 -0
- package/dist-pkg/ui/vlibras.d.ts +11 -0
- package/dist-pkg/ui/vlibras.js +87 -0
- package/dist-pkg/ui/webcam.d.ts +7 -0
- package/dist-pkg/ui/webcam.js +88 -0
- package/docs/CREDITS.md +64 -0
- package/docs/LICENSES.md +132 -0
- package/package.json +115 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
import type { PlayerView } from '../core/entity.js';
|
|
3
|
+
import type { NavKeys } from '../input/edges.js';
|
|
4
|
+
import type { MotionSceneFlags, MotionSceneKey, MotionCharDef } from './settings-motion.js';
|
|
5
|
+
import type { AudioCatState } from './settings-audio.js';
|
|
6
|
+
/**
|
|
7
|
+
* A LEGENDA de um ícone da barra de acessibilidade — uma função, e não três cópias da mesma expressão.
|
|
8
|
+
*
|
|
9
|
+
* Ela é escrita em TRÊS momentos que parecem diferentes e são o mesmo: o cursor direcional pousa no ícone
|
|
10
|
+
* (`ui/menu-nav`), o dedo o aciona, e o mouse ou o foco passa por cima. Enquanto eram três linhas soltas, o
|
|
11
|
+
* índice do ADR-0044 teria de ser acrescentado em três lugares — e a chance de um ficar para trás é a mesma
|
|
12
|
+
* que este repositório já pagou dezesseis vezes com o `DomQuery`.
|
|
13
|
+
*
|
|
14
|
+
* O `aria-label` já conta o ESTADO ("Alto contraste, ativado"): é ele que o `reflectIconBtn` reescreve a cada
|
|
15
|
+
* mudança, e é por isso que a legenda o lê de volta em vez de recompor o texto por conta própria.
|
|
16
|
+
*/
|
|
17
|
+
export declare function legendaDoIcone(barra: ParentNode, el: HTMLElement): string;
|
|
18
|
+
export interface PauseIcon {
|
|
19
|
+
/** `data-pi` key — the dispatch key of iconAct/iconLabel/reflectIconBtn. */
|
|
20
|
+
k: string;
|
|
21
|
+
/** The emoji glyph rendered inside the button. */
|
|
22
|
+
e: string;
|
|
23
|
+
/** i18n KEY of the base name; also the `aria-label` when the icon carries no state (or is `soon`). */
|
|
24
|
+
n: string;
|
|
25
|
+
/** Under construction: the button announces itself and does nothing else. */
|
|
26
|
+
soon?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** The accessibility shortcut bar at the top of every pause screen (and of the splash `#title-icons`).
|
|
29
|
+
* Sound-bound icons (blind/TTS) require a private audio output; webcam/voice are still `soon`.
|
|
30
|
+
* VERBATIM from game.js in order and behaviour; the names became i18n keys in the Fase-5 pass. */
|
|
31
|
+
export declare const PAUSE_ICONS: readonly PauseIcon[];
|
|
32
|
+
export declare function pauseIcon(k: string): PauseIcon | undefined;
|
|
33
|
+
/** TEA cycle: 0 = normal · 1 = calmo (reduces) · 2 = silencioso (switches off). Never touches TTS/blind mode. */
|
|
34
|
+
export declare const CALM_NAMES: readonly string[];
|
|
35
|
+
/** The audio categories `applyCalm` governs. TTS/sonar/guarda/guia stay untouched — a calm player still needs them. */
|
|
36
|
+
export declare const CALM_AUDIO_CATS: readonly string[];
|
|
37
|
+
/** Colour-vision-deficiency cycle, in `player.viz` values. */
|
|
38
|
+
export declare const CVD_SEQ: readonly string[];
|
|
39
|
+
/** i18n keys of the CVD announcement names, indexed the same as CVD_SEQ.
|
|
40
|
+
*
|
|
41
|
+
* ⚠️ POSITION 0 IS `cvd.tricro` AND NOT `cvd.off`, AND THE TWO KEYS ARE NOT INTERCHANGEABLE.
|
|
42
|
+
* This list names the four CHOICES of the cycle, so position 0 is a way of seeing — trichromatic
|
|
43
|
+
* vision, the one that needs no correction — and it is said as one. `cvd.off` below is a FALLBACK
|
|
44
|
+
* for `s.viz` values that are not corrections at all, and 13 of the 16 viz modes are exactly that:
|
|
45
|
+
* the three simulations, the three contrast levels, the five low-vision modes and blind mode.
|
|
46
|
+
* Announcing "trichromatic vision" there would have the software assert what the child sees, while
|
|
47
|
+
* she is simulating not seeing it. The choice is named; the fallback is switched off. */
|
|
48
|
+
export declare const CVD_NAMES: readonly string[];
|
|
49
|
+
/** `player.viz` → i18n key of the label used by iconLabel (anything else falls back to the 'off' key). */
|
|
50
|
+
export declare const CVD_LABELS: Readonly<Record<string, string>>;
|
|
51
|
+
/** The slice of a player object the pause icons touch. `players` (core/state) is typed `unknown[]`. */
|
|
52
|
+
/**
|
|
53
|
+
* A fatia que os ícones de pausa tocam — derivada de core/entity, e SEM assinatura de índice.
|
|
54
|
+
*
|
|
55
|
+
* Havia uma (`[prop: string]: unknown`), posta ali porque `applyCalm` escreve por nome calculado
|
|
56
|
+
* (`p[c.prop] = …`). Era andaime: `c.prop` tem tipo `MotionCharProp`, que é a união literal
|
|
57
|
+
* `'rmWalk' | 'rmBreath' | 'rmFlavor'`, e o TypeScript verifica acesso por chave literal sem precisar de
|
|
58
|
+
* assinatura nenhuma — bastava que os três campos tivessem nome, que é o que a derivação deu.
|
|
59
|
+
*
|
|
60
|
+
* E ela custava caro: uma assinatura de índice aceita QUALQUER propriedade, com valor `unknown`. Enquanto
|
|
61
|
+
* existiu, um erro de digitação em qualquer campo deste objeto compilava em silêncio. Quem a denunciou foi
|
|
62
|
+
* tipar `core/state.players` como `Player[]`: o compilador recusou converter um `Player` — que não tem
|
|
63
|
+
* assinatura de índice — para ela, e essa recusa é a informação.
|
|
64
|
+
*/
|
|
65
|
+
export type PausePlayer = PlayerView<'viz' | 'toggleMove' | 'audioSink' | 'rmWalk' | 'rmBreath' | 'rmFlavor'>;
|
|
66
|
+
/** One `.pm-btn` descriptor — the shape of game.js's PM_BTNS (owned by ui/activities-menu). */
|
|
67
|
+
export interface PauseMenuButton {
|
|
68
|
+
act: string;
|
|
69
|
+
/** Só é lido quando o botão tem rótulo dinâmico; ver a nota em `PauseBtnDef` (ui/activities-menu). */
|
|
70
|
+
lbl?: string;
|
|
71
|
+
/** Dynamic label (the ABC cycle) — rendered from `lbl`, not from i18n, and NOT given `data-i18n`. */
|
|
72
|
+
letra?: boolean;
|
|
73
|
+
/** Dynamic label (the literacy level) — rendered from quizLevel + qlName. Currently dormant: no PM_BTNS
|
|
74
|
+
* entry sets it, but the branch is live code and is ported verbatim. */
|
|
75
|
+
nivel?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** Everything the label/visual of ONE icon depends on, gathered in one value. */
|
|
78
|
+
export interface IconStateSnapshot {
|
|
79
|
+
modoCego: boolean;
|
|
80
|
+
ttsOn: boolean;
|
|
81
|
+
librasOn: boolean;
|
|
82
|
+
calmMode: number;
|
|
83
|
+
toggleMove: boolean;
|
|
84
|
+
/** `player.viz` — shared by the contrast and CVD icons (they overwrite each other; that is by design). */
|
|
85
|
+
viz: string;
|
|
86
|
+
/** False disables the blind/TTS icons: those need an audio output nobody else is listening to. */
|
|
87
|
+
privateOutput: boolean;
|
|
88
|
+
}
|
|
89
|
+
/** A player has private output when nobody else is on the same sink. Single screen ⇒ always private.
|
|
90
|
+
* Pure form of game.js's hasPrivateOutput (see the report: it had no other caller left). */
|
|
91
|
+
export declare function hasPrivateOutputIn(list: readonly PausePlayer[], count: number, i: number): boolean;
|
|
92
|
+
/** TEA cycle step. */
|
|
93
|
+
export declare function nextCalmMode(cur: number): number;
|
|
94
|
+
/** Next high-contrast level. An unlisted `viz` (e.g. a CVD filter) is treated as index 0 ⇒ jumps to 'hc-direto'. */
|
|
95
|
+
export declare function nextContrast(cur: string | undefined): string;
|
|
96
|
+
/** Next CVD filter. NOTE the asymmetry with nextContrast: an unlisted `viz` maps to index 1 ('fix-protan'),
|
|
97
|
+
* not 0 — verbatim from game.js (`idx = idx<0 ? 1 : (idx+1)%seq.length`). */
|
|
98
|
+
export declare function nextCvd(cur: string | undefined): {
|
|
99
|
+
idx: number;
|
|
100
|
+
mode: string;
|
|
101
|
+
};
|
|
102
|
+
/** What `applyCalm` does to ONE audio category, given the TEA level. Extracted so the (destructive) volume
|
|
103
|
+
* clamp at level 1 is visible and testable — see the report. */
|
|
104
|
+
export declare function calmAudioPlan(calmMode: number, vol: number): {
|
|
105
|
+
on: boolean;
|
|
106
|
+
vol: number;
|
|
107
|
+
};
|
|
108
|
+
/** What `applyCalm` does to the scene/character reduced-motion flags. */
|
|
109
|
+
export declare function calmMotionPlan(calmMode: number): {
|
|
110
|
+
sceneReduced: boolean;
|
|
111
|
+
charFrozen: boolean;
|
|
112
|
+
};
|
|
113
|
+
/** The `aria-label` of one icon — it MUST reflect the current state, on/off or level. This is the whole
|
|
114
|
+
* point of the function: a toggle that looks pressed but does not say so is invisible to a screen reader. */
|
|
115
|
+
export declare function computeIconLabel(k: string, s: IconStateSnapshot): string;
|
|
116
|
+
/** The visual state of one icon button. `active` is what becomes `aria-pressed`. */
|
|
117
|
+
export interface IconVisual {
|
|
118
|
+
/** `.pi-on` — the yellow "this is on" state. */
|
|
119
|
+
on: boolean;
|
|
120
|
+
/** `.pi-dis` — greyed out (blind/TTS without a private audio output). */
|
|
121
|
+
dis: boolean;
|
|
122
|
+
/** `.pi-calm` — TEA level 1 only (white); level 2 uses `.pi-on` instead. */
|
|
123
|
+
calm: boolean;
|
|
124
|
+
/** `.pi-cvd-protan` | `.pi-cvd-deuter` | `.pi-cvd-tritan`, or '' — the two-tone background IS the on-signal. */
|
|
125
|
+
cvd: string;
|
|
126
|
+
/** aria-pressed: on OR calm OR a CVD tint. */
|
|
127
|
+
active: boolean;
|
|
128
|
+
}
|
|
129
|
+
/** Pure form of reflectIconBtn's branching. A `soon` icon lands on all-false — it never claims to be on. */
|
|
130
|
+
export declare function computeIconVisual(k: string, s: IconStateSnapshot): IconVisual;
|
|
131
|
+
/** The CSS classes reflectIconBtn clears before applying a fresh visual — in the original order. */
|
|
132
|
+
export declare const ICON_STATE_CLASSES: readonly string[];
|
|
133
|
+
/** One `.pi-btn`. `soon` icons get `.pi-soon` and the "under construction" suffix baked into the aria-label.
|
|
134
|
+
* The label is the RESTING one: reflectIconBtn overwrites it with the stateful label as soon as the bar is
|
|
135
|
+
* reflected. `ic.n` is an i18n key, so it must be resolved here too — the markup is rendered once at build
|
|
136
|
+
* time and would otherwise ship the raw key to a screen reader. */
|
|
137
|
+
export declare function iconBtnMarkup(ic: PauseIcon): string;
|
|
138
|
+
/** The whole icon bar. Used by the pause screen AND by the splash `#title-icons` (which built the same string
|
|
139
|
+
* by hand in game.js — that duplication dies with this export). */
|
|
140
|
+
export declare function iconsMarkup(): string;
|
|
141
|
+
/** One `.pm-btn`. Dynamic labels (`letra`/`nivel`) are rendered eagerly and carry NO `data-i18n`, so
|
|
142
|
+
* i18n.applyDom() cannot overwrite them. */
|
|
143
|
+
/**
|
|
144
|
+
* ⚠️ O RÓTULO DINÂMICO ENTRA PRONTO (item 19), e a mudança conserta DUAS coisas de uma vez.
|
|
145
|
+
*
|
|
146
|
+
* A linha era `'📚 Nível ' + level + ' · ' + qlName[level]` — e ela tinha dois defeitos que só se enxergam
|
|
147
|
+
* juntos:
|
|
148
|
+
*
|
|
149
|
+
* 1. FRONTEIRA. `level` vinha de `core/state.quizLevel` e `qlName` de uma tabela do jogo. Um menu de pausa
|
|
150
|
+
* da ENGINE montava o rótulo de uma atividade de alfabetização — conteúdo pedagógico, não mecânica.
|
|
151
|
+
* 2. IDIOMA. "Nível" é pt-BR CRU dentro de um módulo de engine. O gate do item 14 vigia o `main.js` e não
|
|
152
|
+
* alcança `ui/`, então esta linha atravessou a i18n inteira sem ser vista. Num build em inglês, o menu
|
|
153
|
+
* de pausa de uma criança dizia "📚 Nível 2 · …".
|
|
154
|
+
*
|
|
155
|
+
* Agora o jogo entrega a frase montada (`dynLabel`), e a engine só a coloca no botão. O jogo é quem sabe o
|
|
156
|
+
* que é um nível, quem sabe o nome dele e quem sabe em que idioma dizê-lo.
|
|
157
|
+
*/
|
|
158
|
+
export declare function pmBtnMarkup(b: PauseMenuButton, dynLabel: (b: PauseMenuButton) => string | null, tr: (key: string) => string): string;
|
|
159
|
+
/**
|
|
160
|
+
* Qual das duas listas o cartão de pausa está mostrando.
|
|
161
|
+
*
|
|
162
|
+
* DUAS listas no markup, UMA visível — e a escondida carrega `hidden`, que a tira da árvore de acessibilidade
|
|
163
|
+
* inteira. É o que faz "um menu por tela" (ADR-0044 §5) valer para quem escuta e não só para quem vê, e é o
|
|
164
|
+
* que permite o anel dar a volta DENTRO da lista visível sem nunca atravessar para a outra.
|
|
165
|
+
*/
|
|
166
|
+
export type PauseSub = 'raiz' | 'opcoes';
|
|
167
|
+
/**
|
|
168
|
+
* Os itens navegáveis de um cartão de pausa — os da lista VISÍVEL, e só eles.
|
|
169
|
+
*
|
|
170
|
+
* Uma constante porque TRÊS módulos a consultam (a navegação em `ui/menu-nav`, a seleção inicial em
|
|
171
|
+
* `ui/shell` e a troca de submenu aqui). Enquanto fosse `.pm-btn` escrito três vezes, bastaria um deles
|
|
172
|
+
* esquecer o `:not([hidden])` para o anel atravessar para a lista invisível — e a criança ouviria itens de um
|
|
173
|
+
* menu que não está na tela.
|
|
174
|
+
*/
|
|
175
|
+
export declare const PM_ITENS_VISIVEIS = ".pause-menu:not([hidden]) .pm-btn";
|
|
176
|
+
/** O innerHTML de UMA `.pause-menu`: a lista, e só ela. */
|
|
177
|
+
export declare function pauseMenuHtml(bs: readonly PauseMenuButton[], sub: PauseSub, dynLabel: (b: PauseMenuButton) => string | null, tr: (key: string) => string): string;
|
|
178
|
+
/**
|
|
179
|
+
* Troca a lista visível de UM cartão de pausa, e põe o cursor no PRIMEIRO item da lista que entrou.
|
|
180
|
+
*
|
|
181
|
+
* Livre (e não um método do `init`) de propósito: `ui/menu-nav` precisa dela para o "não" voltar da lista de
|
|
182
|
+
* opções à raiz, e não tem acesso às tabelas de botões. Como as duas listas já existem no markup, a troca é
|
|
183
|
+
* só DOM — nada a re-renderizar, nada a injetar.
|
|
184
|
+
*/
|
|
185
|
+
export declare function mostrarSubmenuDaPausa(sp: HTMLElement, sub: PauseSub): HTMLElement | null;
|
|
186
|
+
/**
|
|
187
|
+
* A BARRA RÁPIDA DE ACESSIBILIDADE — dez alternadores e a legenda que os explica (ADR-0044, item 7).
|
|
188
|
+
*
|
|
189
|
+
* Saiu do cartão de pausa e passou a viver no HUD. O motivo é de uso, não de arrumação: é DURANTE a partida
|
|
190
|
+
* que uma criança precisa mudar um ajuste que está a atrapalhando, e não depois de pausar. E o motivo
|
|
191
|
+
* secundário é estrutural — sem ela, o cartão deixa de ter duas zonas e vira uma LISTA, o que é o que
|
|
192
|
+
* finalmente autoriza o anel (a XAG 106 permite laço para menu linear e o proíbe para grade).
|
|
193
|
+
*
|
|
194
|
+
* A LEGENDA VIAJA JUNTO. Ela é a dica que substitui, para quem não vê, o `title` que só o mouse revela;
|
|
195
|
+
* deixá-la no cartão tornaria a barra do HUD muda.
|
|
196
|
+
*/
|
|
197
|
+
export declare function quickBarMarkup(): string;
|
|
198
|
+
/**
|
|
199
|
+
* O QUE UMA INTENÇÃO SIGNIFICA DENTRO DO MODO `accessibility` (ADR-0044, item 7).
|
|
200
|
+
*
|
|
201
|
+
* O registro listou este modo entre as consequências NEGATIVAS da decisão, e disse por quê: "um modo em que
|
|
202
|
+
* se entra e não se sabe sair é a própria armadilha de que este registro trata — então a saída dele (START ou
|
|
203
|
+
* VOLTAR) é parte da decisão, e não um detalhe de implementação".
|
|
204
|
+
*
|
|
205
|
+
* Daí a forma desta função: SAIR vem primeiro, e vem por DUAS portas. Não é redundância. VOLTAR é a saída de
|
|
206
|
+
* tudo no jogo, e é o que quem já o conhece tenta primeiro; START é o botão que ABRE a pausa, e a pausa é de
|
|
207
|
+
* onde se entrou aqui — quem se perde tenta voltar por onde veio. Ter só uma das duas seria apostar que a
|
|
208
|
+
* criança adivinhe qual delas foi escolhida.
|
|
209
|
+
*
|
|
210
|
+
* E a precedência é decisão também: um controle registra mais de uma borda no mesmo quadro (dedos apertam
|
|
211
|
+
* junto), e nesse quadro `sair` não pode ficar atrás de `ativar`.
|
|
212
|
+
*/
|
|
213
|
+
export type AcaoNaBarra = 'sair' | 'ativar' | 'andar' | 'nada';
|
|
214
|
+
export declare function acaoNaBarra(k: NavKeys, temStart: boolean): AcaoNaBarra;
|
|
215
|
+
export interface ScreenPauseMarkupOpts {
|
|
216
|
+
/** Screen/player index (0-based); the dialog label and the "· Jogador N" suffix are 1-based. */
|
|
217
|
+
player: number;
|
|
218
|
+
/** Live player count — the suffix only appears in multiplayer. */
|
|
219
|
+
numPlayers: number;
|
|
220
|
+
/** A lista RAIZ: os sete itens do ADR-0044, `resume` primeiro e `quit` último. */
|
|
221
|
+
pmButtons: readonly PauseMenuButton[];
|
|
222
|
+
/** O submenu de opções: os sete painéis de ajuste, com o "Voltar" na frente. */
|
|
223
|
+
optionsButtons: readonly PauseMenuButton[];
|
|
224
|
+
/** Rótulo pronto de um botão DINÂMICO, ou `null` se aquele botão não tem um. Quem monta a frase é o jogo. */
|
|
225
|
+
dynLabel: (b: PauseMenuButton) => string | null;
|
|
226
|
+
t: (key: string) => string;
|
|
227
|
+
}
|
|
228
|
+
/** The full innerHTML of a `.screen-pause`. Pure — every input is a parameter. */
|
|
229
|
+
export declare function screenPauseMarkup(o: ScreenPauseMarkupOpts): string;
|
|
230
|
+
export interface PauseIconsCtx {
|
|
231
|
+
/** Quantos jogadores/telas. Estado de RODADA (ADR-0038): vem da instância que a raiz possui.
|
|
232
|
+
* Era `numPlayers`, um `let` de `core/state` importado como binding vivo — e um `let` de módulo
|
|
233
|
+
* é compartilhado por qualquer segundo jogo que a mesma página carregue (D13 do `demos`). */
|
|
234
|
+
getNumPlayers: () => number;
|
|
235
|
+
/** Os jogadores. Estado de RODADA, pelo mesmo motivo. `readonly unknown[]` porque cada consumidor
|
|
236
|
+
* estreita para a SUA fatia — o tipo real é do jogo, não da engine (ADR-0033). */
|
|
237
|
+
getPlayers: () => readonly unknown[];
|
|
238
|
+
/** aria-live "polite" — every successful toggle announces its NEW state. */
|
|
239
|
+
srSay: (text: string) => void;
|
|
240
|
+
/** aria-live "assertive" — the two refusals (`soon` icon, shared audio output). */
|
|
241
|
+
srAlert: (text: string) => void;
|
|
242
|
+
/**
|
|
243
|
+
* As BARRAS RÁPIDAS por tela (`.screen-a11y`), na ordem dos jogadores.
|
|
244
|
+
*
|
|
245
|
+
* Existe pelo mesmo motivo de `getPauseScreens`: `buildGameHud` REATRIBUI a array a cada remontagem, então
|
|
246
|
+
* o que se injeta é o getter e não a array. E existe separada da pausa porque, desde o item 7, a barra não
|
|
247
|
+
* mora mais dentro dela — o daltonismo é POR JOGADOR, e refletir os ícones exige achar a barra daquela tela.
|
|
248
|
+
*/
|
|
249
|
+
getA11yBars: () => readonly HTMLElement[];
|
|
250
|
+
/** PM_OPTIONS_BTNS — o submenu de opções. Mesma dona, mesmo motivo: ninguém tem duas cópias de uma lista. */
|
|
251
|
+
optionsButtons: readonly PauseMenuButton[];
|
|
252
|
+
/** PM_BTNS — the `.pm-btn` list. Owned by ui/activities-menu; injected, never copied. */
|
|
253
|
+
pmButtons: readonly PauseMenuButton[];
|
|
254
|
+
/** QL_NAME — literacy-level names, for the (dormant) `nivel` button. Same owner as pmButtons. */
|
|
255
|
+
/**
|
|
256
|
+
* O RÓTULO de um botão dinâmico, pronto — ou `null` quando aquele botão não tem um (item 19).
|
|
257
|
+
*
|
|
258
|
+
* Era `quizLevel` (importado de `core/state`) mais `qlName` (tabela do jogo), e este módulo montava a
|
|
259
|
+
* frase. Um menu de pausa da ENGINE não sabe o que é nível de alfabetização, nem em que idioma dizê-lo.
|
|
260
|
+
* Função e não valor, porque o rótulo muda em execução — de nível E de idioma.
|
|
261
|
+
*/
|
|
262
|
+
dynLabel: (b: PauseMenuButton) => string | null;
|
|
263
|
+
/** The `.pm-btn` action table. LAZY: `pauseActs` is a `const` declared far below the init site in game.js. */
|
|
264
|
+
getPauseActs: () => Record<string, (() => void) | undefined>;
|
|
265
|
+
/** Records which player opened the menu. `pauseActor` itself stays in game.js — the gamepad, the keyboard
|
|
266
|
+
* router, openHelp() and openOptions() all read it there. */
|
|
267
|
+
setPauseActor: (i: number) => void;
|
|
268
|
+
/** The live `vpPause` array (game.js rebuilds it on every buildGameHud). Getter, not the array. */
|
|
269
|
+
getPauseScreens: () => readonly Element[];
|
|
270
|
+
getModoCego: () => boolean;
|
|
271
|
+
setModoCego: (on: boolean) => void;
|
|
272
|
+
/**
|
|
273
|
+
* O mixer por categoria. NULO até `initAudioMixer()` — `platform/audio` o declara
|
|
274
|
+
* `Record<string, CatState> | null` porque o import dele é PURO (não lê localStorage), e quem inicializa
|
|
275
|
+
* é o boot do consumidor. Este ctx pedia não-nulo, o que era uma promessa que a fonte não faz.
|
|
276
|
+
*/
|
|
277
|
+
getAudioCat: () => Record<string, AudioCatState> | null;
|
|
278
|
+
/** Re-applies a category's gain node after `on`/`vol` changed. */
|
|
279
|
+
setCatGain: (k: string) => void;
|
|
280
|
+
/** Repaints the TTS row of the auditory panel. See BUG #1 in the report: in game.js this call is behind a
|
|
281
|
+
* `typeof reflectTTS==='function'` guard on a symbol that no longer exists, so it never fires. The guard is
|
|
282
|
+
* ported verbatim as `reflectTtsPanelEnabled` below rather than silently fixed. */
|
|
283
|
+
reflectTtsPanel: () => void;
|
|
284
|
+
/** Verbatim port of game.js's dead guard: `typeof reflectTTS === 'function'`. Pass `false` to preserve
|
|
285
|
+
* today's behaviour (the panel is NOT refreshed), `true` to restore the intended call. */
|
|
286
|
+
reflectTtsPanelEnabled: boolean;
|
|
287
|
+
isLibrasOn: () => boolean;
|
|
288
|
+
toggleLibras: () => void;
|
|
289
|
+
rm: MotionSceneFlags;
|
|
290
|
+
rmKeys: readonly MotionSceneKey[];
|
|
291
|
+
rmChar: readonly MotionCharDef[];
|
|
292
|
+
saveRM: () => void;
|
|
293
|
+
setToggleMove: (i: number, on: boolean) => void;
|
|
294
|
+
setPlayerViz: (i: number, mode: string) => void;
|
|
295
|
+
}
|
|
296
|
+
export interface PauseIconsApi {
|
|
297
|
+
/** Builds one `.screen-pause` (hidden), wired for click + hover/focus caption. Caller appends it. */
|
|
298
|
+
buildScreenPause: (i: number) => HTMLElement;
|
|
299
|
+
/** Monta a BARRA RÁPIDA (`.screen-a11y`) da tela `i`, já fiada. Chamada por ui/hud.ts, uma por tela. */
|
|
300
|
+
buildQuickBar: (i: number) => HTMLElement;
|
|
301
|
+
/** ENTRA no modo `accessibility` da tela `i` — é o que o item `acessibilidade` da pausa faz. */
|
|
302
|
+
entrarNaBarra: (i: number) => void;
|
|
303
|
+
/** SAI do modo e devolve o direcional ao personagem. */
|
|
304
|
+
sairDaBarra: (i: number) => void;
|
|
305
|
+
/** A tela `i` está com o direcional na BARRA em vez de no personagem? Perguntado a cada quadro. */
|
|
306
|
+
naBarraDe: (i: number) => boolean;
|
|
307
|
+
/** Um passo dentro do modo. `temStart` é a borda do botão de pausa — a segunda saída (ADR-0044, item 7). */
|
|
308
|
+
navBar: (i: number, k: NavKeys, temStart?: boolean) => void;
|
|
309
|
+
/** Runs the icon `k` for screen `i`. Does NOT reflect — callers reflect after, as game.js always did. */
|
|
310
|
+
iconAct: (k: string, i: number) => void;
|
|
311
|
+
/** The state-reflecting `aria-label` of icon `k` for screen `i`. */
|
|
312
|
+
iconLabel: (k: string, i: number) => string;
|
|
313
|
+
/** Applies classes + aria-pressed + aria-label to ONE `.pi-btn`. */
|
|
314
|
+
reflectIconBtn: (b: HTMLElement, i: number) => void;
|
|
315
|
+
/** Reflects every `.pi-btn` inside `root` in screen `i`'s scope. `#title-icons` uses i=0 (splash = J1). */
|
|
316
|
+
reflectIconsIn: (root: ParentNode | null, i: number) => void;
|
|
317
|
+
/** Reflects every pause screen (each in its own player's scope). */
|
|
318
|
+
reflectPauseIcons: () => void;
|
|
319
|
+
/** Applies the current TEA level to scene motion, character motion and the five audio categories. */
|
|
320
|
+
applyCalm: () => void;
|
|
321
|
+
getCalmMode: () => number;
|
|
322
|
+
/** Sets the TEA level WITHOUT applying it (applyCalm is the apply step) — for tests and future restore. */
|
|
323
|
+
setCalmMode: (n: number) => void;
|
|
324
|
+
/** Snapshot of everything the label/visual of screen `i` depends on. Exposed for tests and debugging. */
|
|
325
|
+
iconState: (i: number) => IconStateSnapshot;
|
|
326
|
+
}
|
|
327
|
+
export declare function initPauseIcons(ctx: PauseIconsCtx): PauseIconsApi;
|