# Prism : écrire un thème d'interface Ce document est autonome. Lisez-le en entier, puis écrivez le thème. N'employez que ce qu'il liste. Le jeu vérifie chaque thème en Rust et REFUSE tout nom, toute propriété, valeur, classe, tout chemin ou toute sortie qui n'est pas dans ses listes fermées. Un nom inventé est un thème rejeté. ## RÈGLES ABSOLUES - N'INVENTEZ RIEN. Chaque jeton, attribut de nœud, propriété CSS, chemin d'entrée, sortie, place et partie que vous écrivez doit figurer dans les listes en fin de document. - Si la demande exige ce que les listes n'offrent pas, DITES-LE (« un thème ne peut pas faire X ») et proposez ce qui s'en approche le plus parmi ce qui est permis. Ne simulez jamais. - Écrivez les fichiers, lancez le vérificateur (voir Marche à suivre), lisez chaque message, corrigez, relancez. Ne vous arrêtez que lorsque le vérificateur n'affiche aucun problème. - Écrivez le code, les identifiants et les commentaires en anglais. Répondez à l'utilisateur dans sa langue. ## Ce qu'est un thème - Un thème est un DOSSIER de DONNÉES, pas un programme. Il restyle et réorganise l'interface du jeu. Il ne s'exécute pas pendant que le jeu dessine. - Il a jusqu'à quatre fichiers : un manifeste (`theme.json`), des jetons de design (`tokens.css`), du CSS facultatif pour les classes du thème (`theme.css`), et un script de templates facultatif (`theme.ts`) qui décide où se tiennent les parties d'un écran. - `theme.ts` s'exécute UNE FOIS au chargement du thème, sous budgets, et renvoie un arbre de nœuds d'une liste fermée. Le jeu dessine l'arbre avec un seul moteur générique. - Rust valide tout avant que quoi que ce soit n'atteigne la page. Ce qui passe est appliqué ; rien d'autre ne l'est. ## Ce qu'un thème n'est pas - Pas du JavaScript dans la page. Aucun accès au DOM, au réseau ni aux fichiers. Le script ne voit que le langage et les constructeurs. - Pas un nouveau comportement. Un thème déplace et style ce que le jeu fait déjà. Il ne peut ni ajouter une action, ni retirer Play, ni appeler autre chose qu'une `output` du contrat. - Pas un nouvel écran. Il met en template les écrans et composants listés dans le bloc Contrats. - Il ne peut pas cacher l'illustration de la map. L'image derrière les menus doit rester visible (voir Règles strictes). - Pas du CSS libre. `theme.css` est un sous-ensemble validé (voir Liste autorisée du CSS). ## Disposition du dossier Un thème vit dans `themes//`. `` : lettres minuscules, chiffres et tirets, 32 caractères au plus, qui commence par une lettre ou un chiffre. Le nom du dossier EST l'identifiant. ```text themes// theme.json REQUIRED the manifest tokens.css REQUIRED design tokens (file name set by "tokens" in theme.json, default tokens.css) theme.css optional styles for the theme's own classes theme.ts optional the templates: defineTheme({ screens, components }) preview.png optional picker preview (named by "preview" in theme.json) images/... optional png, jpg, webp, gif or svg, at most 4 MiB each; named from tokens, theme.css and theme.ts ``` Un thème sans `theme.ts` hérite des templates par défaut du jeu (le thème `_base`) pour chaque écran et composant. Un thème avec `theme.ts` ne remplace que les templates qu'il écrit. Ne créez jamais un dossier nommé `_base`. Le jeu cherche `themes/` à côté du jeu, puis `/themes`. Dans le dépôt, les thèmes livrés sont dans `content/themes/`. Un joueur installe un thème en copiant son dossier dans `/themes/` ; supprimer le dossier le retire. ### theme.json - OBLIGATOIRES : `id` (égal au nom du dossier), `name` (1 à 48 caractères). - Facultatifs : `description` (0 à 240), `version` (lettres, chiffres et `. _ + -`, 32 au plus), `author` (0 à 64), `order` (0 à 1000, 100 par défaut : place dans le sélecteur), `themeApi` (un entier à partir de 1, 1 par défaut : la version du contrat de thème pour laquelle le thème est écrit), `tokens` (un nom de fichier `.css`), `preview` (une image du dossier), `accent` (`"preference"` par défaut : l'accent suit le réglage du joueur ; `"fixed"` : l'accent est toujours le `--pv-accent` du thème), `localized` (`{ "fr": { "name": "...", "description": "..." } }`, codes de langue comme `en`, `fr`, `zh`, `ko`, 16 au plus). - Écrivez `"themeApi": 2` dans un nouveau thème (le jeu parle 2). Un thème qui demande un contrat plus récent que celui que le jeu parle est refusé. Un thème qui déclare 1 (ou rien) continue de se charger, mais les templates des écrans et faces ajoutés en version 2 (`since:2` dans les contrats ci-dessous) et `"accent": "map"` lui sont refusés avec `requires themeApi 2: …`. ### tokens.css - UN bloc `:root { --pv-name: value; ... }`, plus au plus deux blocs `@media (max-width: px) { :root { ... } }` (n de 320 à 4000). Rien d'autre : aucun autre sélecteur, règle @, imbrication, `@import`, `@font-face`, `url()` ni `expression`. Les `/* commentaires */` sont permis. - Chaque déclaration est un jeton `--pv-*` du bloc Jetons, avec une valeur du type de ce jeton (color, length, font, weight, opacity, easing, clip, layers, filter, image, duration, shadow, ratio, case, scheme, choice) dans la plage du jeton. `var()` n'est permis que pour référencer un jeton de couleur dans une couleur. Chaque jeton est déclaré une fois au plus. - Un jeton omis garde la valeur neutre du jeu : un thème peut être partiel. Commencez par la palette (`--pv-bg`, `--pv-plate*`, `--pv-line`, `--pv-text*`, `--pv-accent`, `--pv-ink`) et les formes. - Limites : 64 Kio par fichier, 200 déclarations, 600 caractères par valeur. ### theme.css - Style les classes que `theme.ts` emploie et atteint les parties du jeu par leurs marques `data-*`. Validé puis réécrit : chaque `.name` devient `.tpl--name` et chaque sélecteur est placé sous `[data-direction=""]` : un thème ne peut pas toucher au reste du jeu. - Limites : 256 Kio, 2048 règles, 40 déclarations par règle. - Les sélecteurs commencent par une classe du thème (`.name`) et peuvent continuer avec `[data-x]`, `[data-x="value"]`, les pseudo-classes de la Liste autorisée du CSS, les combinateurs descendant et `>`, des virgules, et un `::before` ou `::after` final (avec `content`). JAMAIS un sélecteur d'élément, `*`, `#id`, `:root`, `body`, ni une classe du jeu. - Ni `!important`, ni `@import`, ni `@font-face`, ni échappements `\`. Images : `url("images/x.png")` seulement, pour un fichier du dossier `images/` du thème. - `@media` accepte `(min-width | max-width | min-height | max-height: px)` et `(prefers-reduced-motion: reduce | no-preference)`, deux conditions au plus jointes par `and`. Les `@keyframes` sont permis (leurs noms sont réécrits par thème). - Les couleurs, tailles et polices viennent de `var(--pv-*)`. Variables que vous pouvez définir : `--tpl-` (posée par les `vars` d'un nœud), les variables des plaques `--plate`, `--edge`, `--clip`, `--clip-edge`, et des jetons `--pv-*` des types permis. ### theme.ts - Un fichier TypeScript qui appelle `defineTheme({ screens: { library: fn, settings: fn }, components: { 'library.footer': fn } })` exactement une fois. Les clés de `screens` sont des noms d'écran sans le préfixe `screen.` ; les clés de `components` sont des noms de contrat (voir Contrats). - Chaque `fn` reçoit un contexte typé `c` et renvoie UN nœud. Typez-la avec `ThemeContext<'screen.library'>` (ou le nom du contrat). Les types viennent de `content/mods/sdk/theme.d.ts` (servi à `/dev/sdk/theme.d.ts`) : un chemin ou une classe faux est une erreur avant que Rust le voie. - Un fichier qui déclare des noms de plus haut niveau à lui (fonctions, constantes) ajoute `export {};` en tête pour être un module. - Le script s'exécute une fois et seul l'arbre renvoyé survit. Employez librement fonctions, tableaux et boucles pour le construire ; une fonction, un `NaN` ou un cycle laissé dans le résultat est refusé. - Constructeurs (tous sur `c`) : `box`, `row`, `column`, `stack`, `grid`, `scroll`, `spacer`, `text`, `icon`, `image`, `button`, `toggle`, `meter`, `dropdown`, `slot`, `each`, `when`. Valeurs : `c.bind('path')`, `c.t('i18n.key', { arg })`, `c.fmt.rate | count | percent | duration | fixed('path', digits?)`. Conditions : `c.field('path')` puis `.eq .ne .in .gt .ge .lt .le .truthy() .falsy()`, combinées par `.and() .or() .not()`. Événements : `on: c.on.press('output', ...args)`, `c.on.change(...)`, `c.on.pick(...)`. - Les attributs exacts de chaque nœud sont dans le bloc Nœuds. - Un appel minimal, en texte : ```text c.row({ class: ['screen', 'pv-screen'] }, c.slot('list'), c.slot('footer')) c.when(c.field('selection.shown').truthy(), [c.slot('header'), c.slot('tabs')], c.slot('header')) c.each('map.equalizer', item => item.box({ class: 'eq-bar', vars: { '--tpl-live': item.bind('live') } })) c.button({ class: 'go', label: 'Go', on: c.on.press('confirm') }) ``` ## Marche à suivre Suivez ces étapes dans l'ordre. Ne sautez pas la vérification. 1. Créez le dossier `themes//` (l'identifiant est le nom du dossier). 2. Écrivez `theme.json` : `id`, `name`, `"themeApi": 2` et une `description`. 3. Écrivez `tokens.css` : une palette, puis des formes. Seulement des jetons du bloc Jetons, avec des valeurs du bon type. 4. Si la demande change la mise en page : écrivez d'abord `theme.css` pour les classes, puis `theme.ts` qui les emploie. Chaque classe que vous posez sur un nœud de `theme.ts` doit être définie dans `theme.css` ou être une classe du jeu listée pour cet écran ou ce contrat. 5. Lancez le vérificateur sur le dossier qui CONTIENT les dossiers de thèmes : ```bash cargo run -p modding --example check_theme -- themes ``` Sans clone du dépôt, le jeu installé fait la même vérification : `prism.exe --check-theme `. Sans argument, il vérifie `content/themes`. Il affiche `N theme(s) loaded`, une ligne par thème, puis une ligne par problème `"": : : `, et sort avec le code 1 s'il y a un problème. 6. Lisez chaque message de gauche à droite : le thème, le FICHIER (`theme.json`, `tokens.css`, `theme.css`, `theme.ts`), l'endroit (un numéro de ligne, un jeton, ou pour `theme.ts` le template, la chaîne de nœuds et l'attribut), puis la raison en toutes lettres. La raison dit ce qui est permis. Corrigez exactement cela, dans ce fichier. 7. Relancez. Recommencez jusqu'à ce qu'il n'y ait plus aucune ligne `problem:`. Une ligne `warning:` est aussi un problème (code de sortie 1) : corrigez-la. 8. Un problème dans `theme.json`, `tokens.css` ou `theme.css` RETIRE tout le thème. Un problème dans `theme.ts` ne retire que le template concerné : le thème se charge quand même avec le template par défaut du jeu pour celui-là. Une erreur du script retire tous les templates du thème. 9. Si vous ne pouvez pas lancer le vérificateur, dites-le. Relisez chaque fichier contre les Règles strictes et les listes ci-dessous avant de répondre, et dites à l'utilisateur que le thème n'a pas été vérifié. ## Règles strictes Listes fermées - Les nœuds, attributs de nœuds, rôles, icônes, propriétés CSS, pseudo-classes, noms de jetons et valeurs de jetons viennent de listes fermées. Rien en dehors n'est accepté. - Chaque chemin d'entrée que vous liez avec `bind` ou testez avec `field` doit exister dans l'entrée de cet écran ou contrat. Les opérateurs vont avec le type du champ ; une énumération ne se compare qu'à ses propres valeurs. - Chaque sortie que vous appelez (`on.press('confirm')`) doit être une sortie de cet écran ou contrat, avec ses arguments dans l'ordre et du bon type. Un template de composant ne peut pas appeler une sortie d'écran. - Un nom de `slot` doit être une place de cet écran ou contrat, ou un contrat que vous pouvez monter avec `{ from }`. - Une `part` doit être une partie du contrat. Un écran n'a pas de parties. Obligatoire - Un template d'écran DOIT placer CHAQUE place obligatoire de son écran (dans un `when`, elle compte). Une place manquante est refusée : `the required slot "footer" is not placed`. - Un template de composant DOIT lier chaque sortie `required` de son contrat à un contrôle. Pour `library.footer`, un `button` doit appeler `confirm`, sinon Play disparaîtrait. - Un `button` a besoin d'un `label` ou d'enfants (il lui faut un nom). Une `image` a besoin d'un `alt` et d'une `src`. Un `each` a besoin du chemin d'une liste. Classes - Chaque `class` s'écrit en lettres minuscules, chiffres et `-`, commence par une lettre, 40 caractères au plus, 8 au plus par nœud. - Chaque `class` doit être SOIT définie dans `theme.css`, SOIT une classe du jeu listée pour l'écran ou le contrat (`hostClasses`). Ni l'une ni l'autre est refusée. Les DEUX est refusé comme ambigu : renommez celle du thème. - Ne visez pas les classes du jeu dans `theme.css`. Atteignez les éléments du jeu par leurs marques `data-*` (`[data-part='play']`). Faces - `library.setCard`, `library.chartRow` et `leaderboard.card` sont des FACES : le jeu garde le bouton, le clavier, les menus et les actions ; le thème ne dessine que l'intérieur. - Une face NE DOIT PAS contenir de `button`, `toggle` ou `dropdown`, de `slot` qui monte un autre contrat, ni d'événement. Employez `box`, `row`, `column`, `text`, `icon`, `image`, `meter`, `slot` (ses propres places), `each`, `when`. Illustration de la map - L'image derrière les menus doit rester visible. Au moins 20 % de sa lumière doivent atteindre l'écran, en moyenne sur la fenêtre. Chaque dégradé de `--pv-shade` couvre au plus 90 % en moyenne (jamais un aplat opaque). Dans `--pv-art-filter` : `brightness()` au moins 0,25, `opacity()` au moins 0,4, `contrast()` au moins 0,5. Teinter, assombrir et flouter sont permis ; cacher est refusé. Mouvement - AUCUNE animation infinie sur un écran au repos. `animation-iteration-count: infinite` (ou `infinite` dans le raccourci `animation`) repeint la page à chaque image et est signalé comme avertissement. Jouez le mouvement décoratif une fois par sélection en l'accrochant à `[data-entering]` (donnez au nœud `data: { entering: c.bind('selection.entering') }`), ou avec un nombre fini d'itérations sur `:hover` / `:focus-visible`. - Posez les animations qui bougent dans `@media (prefers-reduced-motion: no-preference)`. - Préférez `transform` et `opacity` à `height`, `width` ou `top` pour tout ce qui bouge. Une barre pilotée par des données vivantes (`map.equalizer[].live`) emploie `transform: scaleY(calc(var(--tpl-live) / 100))` et AUCUNE `transition` : la page lisse déjà les valeurs. - Un `filter` ou une `box-shadow` sur un élément qui a un `clip-path` est coupé. Posez `filter: drop-shadow(...)` sur le PARENT de l'élément découpé. Budgets - `theme.ts` : 128 Kio de source au plus. Le script s'exécute une fois en 500 ms et 16 Mio de mémoire au plus, construit 4000 nœuds au plus (comptés avec les répétitions) et renvoie 1 Mio de JSON au plus. Au-delà d'un budget, le thème se charge sans templates. - Les templates validés d'un thème : 1500 nœuds au plus, 24 niveaux de profondeur, 64 templates, 200 caractères par texte littéral, 64 enfants par nœud, 8 entrées dans `data` et dans `vars`, 12 pistes dans une grille. - Ne bouclez ni ne récursez sans fin. Employez des boucles simples sur de petits tableaux. ## Un thème minimal complet Un thème qui déplace la bande Play en haut du panneau de la map choisie. Les quatre fichiers ; reprenez la forme. `theme.json` ```json { "id": "first-layout", "name": "First layout", "description": "The list on the left and the Play strip moved to the top of the selected-map panel: a theme.ts and a theme.css on top of a palette.", "version": "1.0.0", "author": "Prism docs", "themeApi": 2, "accent": "fixed", "tokens": "tokens.css", "localized": { "fr": { "name": "Première mise en page", "description": "La liste à gauche et le pied Play déplacé en haut du panneau de la map choisie : un theme.ts et un theme.css sur une palette." } } } ``` `tokens.css` ```css /* First layout: a warm palette. The layout itself is theme.ts and theme.css. */ :root { --pv-color-scheme: dark; --pv-bg: #17110e; --pv-plate: rgb(36 27 22 / .86); --pv-plate-raised: rgb(52 39 31 / .92); --pv-plate-hover: rgb(72 54 43 / .96); --pv-plate-active: rgb(251 146 60 / .18); --pv-plate-active-hover: rgb(251 146 60 / .28); --pv-line: rgb(255 255 255 / .14); --pv-track: rgb(255 255 255 / .1); --pv-text: #fbf3ec; --pv-text-2: #d3c3b5; --pv-text-3: #a08f80; --pv-ink: #24120a; --pv-accent: #fb923c; --pv-accent-2: #5eead4; --pv-clip-lg: inset(0 round 12px); --pv-clip-md: inset(0 round 9px); --pv-clip-sm: inset(0 round 5px); --pv-radius-input: 8px; --pv-radius-panel: 12px; } ``` `theme.ts` ```ts theme // First layout: the library (the list) on the left, the selected map on the right with the Play strip ABOVE its heading. // // theme.ts runs ONCE, when the theme loads, and returns data: a tree of nodes that Rust checks against the contract of `screen.library`. // The validator refuses a template that drops a place the screen requires, so every place is still placed here: only their order and their wrappers change. // The file declares names of its own (functions), so it is a module. export {}; // The `c` of the library screen: its input paths, its places and its classes are typed by theme.d.ts. type Screen = ThemeContext<'screen.library'>; // The entry point: one template for the screen `screen.library`. defineTheme({ screens: { library: libraryScreen } }); // The screen: two columns side by side, the list first. `pv-screen` is a class of the screen (the game styles it), `screen` is this theme's, defined in theme.css. // `--selection-color` is a variable of the screen: the colour of the selected row, read from the input. function libraryScreen(c: Screen): ThemeNode { return c.row( { class: ['screen', 'pv-screen'], vars: { '--selection-color': c.bind('browser.color') } }, library(c), selectedMap(c), ); } // The selected map: the Play strip first (the `footer` place: rating, judgement, Play), then the heading, the tabs and their panels. // While nothing is selected, `when` draws the heading alone: it is the invitation to pick a map. function selectedMap(c: Screen): ThemeNode { return c.column( { as: 'section', class: 'map', aria: { label: c.t('ui.selected_map'), busy: c.bind('selection.busy') }, vars: { '--difficulty-color': c.bind('browser.color') } }, c.when( c.field('selection.shown').truthy(), [c.box({ class: 'play' }, c.slot('footer')), c.box({ class: 'details' }, c.slot('header'), c.slot('tabs'), c.slot('panels'))], c.slot('header'), ), ); } // The library: the toolbar, the search and the list. The playlists and the visualizer cover the list, so they are placed next to it // (`browser-body`, `browser-list` and `browser-playlists` are classes of the screen: the game stacks the lists with them). function library(c: Screen): ThemeNode { const covered = c.field('browser.covered').truthy(); return c.column( { as: 'section', class: 'library', aria: { label: c.t('ui.available_beatmapsets') } }, c.slot('intent'), c.slot('toolbar'), c.box( { class: 'browser-body' }, c.box({ class: 'browser-list', classWhen: { covered }, inert: covered }, c.slot('search'), c.slot('list')), c.when(c.field('browser.view').eq('playlists'), c.box({ class: 'browser-playlists', focusable: true }, c.slot('playlistSearch'), c.slot('playlists'))), c.when(c.field('browser.visualizer').truthy(), c.slot('visualizer')), ), ); } ``` `theme.css` ```css /* The classes of theme.ts: two columns, the library first, the selected map second. */ .screen { display: flex; flex-direction: row; align-items: stretch; gap: var(--pv-s6); height: 100%; min-height: 0; } .map { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; } .library { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; } .map > .details { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: hidden; } /* The Play strip stays pinned above the heading; a hairline under it separates it from the map. */ .map > .play { border-bottom: 1px solid var(--pv-line); padding-bottom: var(--pv-s3); } ``` Pourquoi il passe : chaque place de l'écran est placée (seuls leur ordre et leurs enveloppes changent) ; les classes `screen`, `map`, `library`, `details`, `play` sont définies dans `theme.css` ; `pv-screen`, `browser-body`, `browser-list` et `browser-playlists` sont des classes du jeu de l'écran ; `footer` est placée, donc Play reste. Pour aller plus loin, lisez `content/themes/stage/` (`theme.ts` d'abord) : le thème livré écrit comme un programme, avec une fonction par zone. ## Erreurs courantes Chaque ligne est `"": : : `. `` et `` sont remplis par le jeu. Le thème est RETIRÉ quand le fichier est `theme.json`, `tokens.css` ou `theme.css` (un `warning:` le garde). Un problème de `theme.ts` retire un template, sauf `interrupted` et une erreur du script, qui les retirent tous. | Message | Correction | | --- | --- | | `theme.json: themeApi 99 is newer than this game speaks (theme API ): update the game, or use a version of the theme written for API ` | Écrivez `"themeApi": ` (la version que le jeu parle) ou retirez le champ. | | `theme.ts: screen.settings: requires themeApi 2: the screen "screen.settings" was added in theme API 2 and this theme declares themeApi 1; set "themeApi": 2 in theme.json …` | Écrivez `"themeApi": 2` dans theme.json (le template est retiré, le thème se charge quand même). | | `theme.json: the id "" must be the folder name` | Faites de `id` le nom du dossier. | | `the folder name must be lower-case letters, digits and hyphens (at most 32)` | Renommez le dossier. | | `tokens.css: line 5: --pv-acent is not a theme token` | Le nom du jeton n'est pas dans le bloc Jetons : corrigez la faute. | | `tokens.css: line 5: --pv-accent: a hex colour has 3, 4, 6 or 8 digits` | La valeur ne convient pas au type du jeton : écrivez une valeur de ce type (voir sa ligne dans Jetons). | | `tokens.css: a second :root block (put width-dependent values in @media blocks)` | Un seul `:root` ; employez `@media (max-width: px)` (320 à 4000, deux blocs au plus). | | `tokens.css: line : --pv- is declared twice` | Supprimez l'une des deux. | | `tokens.css: the map picture must stay visible: a --pv-shade layer covers 100% of the picture on average; at most 90%` | Baissez l'opacité de la couche `--pv-shade` sous 1, ou retirez-la. Aussi : `--pv-shade and --pv-art-filter leave % of it on average; at least 20% is required` : allégez le voile ou le filtre. | | `theme.css: line 2: the selector "button": element selectors are not allowed: select the theme's classes` | Sélectionnez une classe du thème (`.name`) ; atteignez les éléments du jeu par `.name [data-part='x']`. | | `theme.css: line 1: isolation: this property is not allowed in theme.css` | Employez une propriété de la Liste autorisée du CSS. | | ``theme.css: line : : `!important` and `!` are not allowed`` | Retirez `!important` ; répétez une marque `[data-*]` pour monter la spécificité. | | `theme.css: line : : this token is set in tokens.css, not in theme.css (a rule may set the colours, lengths, fonts, weights, shadows, durations and easings)` | Déplacez ce jeton `--pv-*` dans `tokens.css`. | | ``theme.css: line : the selector "": a selector starts with one of the theme's classes (`.name`)`` | Commencez le sélecteur par une classe du thème. | | ``theme.css: warning: line 3: an infinite animation repaints the page every frame, even on an idle screen; play it a few times (a finite `animation-iteration-count`), or once per selection under `[data-entering]` `` | Employez un nombre fini d'itérations, ou accrochez l'animation à `[data-entering]`. Le mot `infinite` sur une ligne quelconque le déclenche. | | `theme.ts: interrupted` | Le script a dépassé son budget de 500 ms (une boucle sans fin). Retirez la boucle sans borne. | | `theme.ts never called defineTheme({ screens, components })` | Appelez `defineTheme` une fois au plus haut niveau. | | ``theme.ts: defineTheme(): component "": (): attribute `` is required`` | Ajoutez l'attribut dont le constructeur a besoin (un `button` a besoin de `on`). | | ``theme.ts: screen.library: the required slot "footer" is not placed (place it with slot("footer"); inside a `when` it counts)`` | Ajoutez `c.slot('footer')` (chaque place obligatoire de l'écran). | | `theme.ts: library.footer: the required output "confirm" is not bound to any control (a button must call it)` | Ajoutez `c.button({ label: 'Play', on: c.on.press('confirm') })`. | | `theme.ts: screen.library › … (on.press › output): "back" is not an output of screen.library (outputs: )` | Appelez une sortie de la liste, ou retirez le bouton. | | `theme.ts: screen.library › … (value › bind): the path "map.titel" is not in the screen: no field "titel" in "map" (fields: )` | Employez un chemin du bloc Contrats ; le message liste les champs de ce niveau. | | `theme.ts: screen.library › … (class[0]): the class "unknown" is neither defined by theme.css nor a class of the game here (game classes: )` | Définissez `.unknown` dans `theme.css`, ou employez une classe du jeu listée. | | `the class "" is both a class of the game and a class of theme.css: rename the theme's` | Renommez la classe du thème dans les deux fichiers. | | `theme.ts: library.setCard › … › button: a button is not allowed in library.setCard: the host draws and owns the card's own button, keyboard, menus and actions, a theme draws what is inside it (box, row, column, text, icon, image, meter, slot, each, when)` | Retirez le `button`, `toggle`, `dropdown` ou `slot` de montage de la face ; employez `text`, `icon`, `image`, `meter`, `each`, `when`. | | `"" is not a slot of the (slots: )` | Employez un nom de place de cet écran ou contrat dans le bloc Contrats. | | `"" is not in the theme's images/ folder` | Ajoutez le fichier à `images/` ou corrigez le nom. | ## Jetons La liste complète des jetons : nom, type, plage ou options, et rôle. Employez ces noms et aucun autre. ```text # --pv- [bounds]. Bounds apply to px values; choices list their words (first = default). # color: #rgb|#rgba|#rrggbb|#rrggbbaa, rgb()/rgba()/hsl()/hsla(), color-mix(in srgb, c [n%], c [n%]), transparent|white|black, var(--pv-) # length: px|em|rem|%|vw|vh|vmin|vmax or 0, clamp(a,b,c)/min(a,b)/max(a,b); >= 0 unless 'signed'; px bounds # font: 1..8 families (quoted or plain words), last generic: sans-serif|serif|monospace|system-ui|ui-monospace|cursive # weight: integer 1..1000. opacity: 0..1. duration: 0..3s (ms|s). ratio: unitless in bounds # easing: ease|ease-in|ease-out|ease-in-out|linear|cubic-bezier(x1,y1,x2,y2) x 0..1, y -4..4 # clip: none|polygon(x y, ...) 3..16 points (length or calc(n% +/- npx))|inset(1..4 offsets [round 1..4 radii]) # layers: none|1..4 linear-gradient()/repeating-linear-gradient(), angle -720..720deg or 'to side [side]', 2..12 stops # filter: none|<=6 of saturate brightness contrast grayscale sepia opacity (<=4 or 400%), hue-rotate(ndeg), blur(<=12px), drop-shadow(x y [blur] color) (offsets <=48px) # image: none|image("rel/path.png") in the theme folder (png, jpg, jpeg, webp, gif, svg). shadow: none|1..4 of [inset] x y [blur [spread]] color (px, <=128) # case: none|uppercase|lowercase|capitalize. scheme: dark|light. choice: one listed word # file: ':root' block + <=2 '@media (max-width: <320..4000>px)' blocks; <=64 KiB, <=200 declarations, <=600 chars/value; image tokens in base :root only # rules: --pv-shade+--pv-art-filter leave >=20% of the map picture (shade layer <=90% coverage; brightness>=0.25, opacity>=0.4, contrast>=0.5); --pv-graph-combo, --pv-graph-accuracy, --pv-graph-density-mid pairwise >=30deg hue (greys >=0.25 lightness) --pv-bg color --pv-plate color --pv-plate-raised color --pv-plate-hover color --pv-plate-active color --pv-plate-active-hover color --pv-line color --pv-track color --pv-text color --pv-text-2 color --pv-text-3 color --pv-ink color --pv-accent color --pv-accent-2 color --pv-ok color --pv-warn color --pv-danger color --pv-offset-ok color --pv-offset-warn color --pv-offset-high color --pv-offset-bad color --pv-tier-platinum color --pv-tier-diamond color --pv-tier-prism color --pv-tier-prism-b color --pv-tier-prism-c color --pv-gold color --pv-silver color --pv-bronze color --pv-graph-surface color --pv-graph-grid color --pv-graph-zero color --pv-graph-cursor color --pv-clip-lg clip --pv-clip-md clip --pv-clip-sm clip --pv-clip-edge-lg clip --pv-clip-edge-md clip --pv-clip-edge-sm clip --pv-clip-meter clip --pv-graph-bar-clip clip --pv-art-clip clip --pv-inset-lg length --pv-inset-md length --pv-inset-sm length --pv-edge-w length <=64px --pv-meter-h length <=64px --pv-radius-input length <=64px --pv-radius-panel length 0..40px --pv-graph-line-w length <=64px --pv-graph-bar-gap length <=64px --pv-h-sm length --pv-h-md length --pv-h-lg length --pv-art-inset length --pv-art-left length --pv-art-w length --pv-art-pad length --pv-set-row length 8..400px --pv-set-gap length 0..100px --pv-diff-row length 8..400px --pv-diff-gap length 0..100px --pv-set-grid-w length 0..600px --pv-set-grid-aspect ratio 0.3..3 --pv-shift-base length --pv-rail-w length 40..600px --pv-drawer-w length 40..600px --pv-page-pad length 0..160px --pv-page-max length 800..8000px --pv-display-ls length signed --pv-label-ls length signed --pv-title-ls length signed --pv-hero-ls length signed --pv-fs-xs length >=12px --pv-fs-sm length >=12px --pv-fs-md length >=12px --pv-fs-lg length >=12px --pv-fs-xl length >=12px --pv-fs-2xl length >=12px --pv-fs-3xl length >=12px --pv-fs-hero length >=12px --pv-fs-meta length >=12px --pv-fs-accuracy length >=12px --pv-fs-title length >=12px --pv-fs-rating length >=12px --pv-font-display font --pv-font-body font --pv-font-num font --pv-font-label font --pv-font-mono font --pv-fw-display weight --pv-fw-num weight --pv-fw-label weight --pv-art-opacity opacity --pv-ease easing --pv-ease-spring easing --pv-display-case case --pv-label-case case --pv-color-scheme scheme --pv-meter-ticks layers --pv-art-mask layers --pv-graph-scan layers --pv-shade layers --pv-art-filter filter --pv-page-scrim color --pv-page-art-blur length 0..40px --pv-plate-filter filter --pv-plate-sheen layers --pv-overlay-image image --pv-thumb color --pv-switch color --pv-bg-image image --pv-graph-low color --pv-graph-mid color --pv-graph-high color --pv-graph-peak color --pv-graph-bar-stroke color --pv-layout-list choice right|left|center --pv-layout-tabs choice top|rail|dock|sidebar --pv-layout-play choice bottom|top --pv-layout-density choice comfortable|compact|dense --pv-layout-chrome choice none|titlebar|nav --pv-layout-drawer choice left|right|bottom --pv-layout-rows choice cover|strip|text|list --pv-layout-profile choice top|rail --pv-layout-cards choice rich|compact --pv-layout-buttons choice plate|bracket|link --pv-layout-focus choice ring|blink --pv-layout-icons choice none|icon --pv-layout-visualize choice label|icon --pv-layout-groups choice plain|inset --pv-layout-controls choice plain|pill --pv-layout-hero choice plate|open --pv-layout-settings choice side|top|index|rail --pv-layout-settings-rows choice inline|stacked --pv-layout-pause choice panel|side|open|prompt --pv-tier-dark opacity --pv-graph-progression choice steps|lines|area|bars --pv-graph-grid-style choice lines|none|dots|scanlines --pv-graph-cursor-shape choice dashed|solid|band --pv-graph-marker choice none|dot|diamond|square --pv-graph-miss-style choice bands|ticks --pv-graph-curve-w length 1..6px --pv-graph-fill-opacity opacity --pv-graph-combo color #rrggbb --pv-graph-accuracy color #rrggbb --pv-graph-density-low color #rrggbb --pv-graph-density-mid color #rrggbb --pv-graph-density-high color #rrggbb --pv-rating-dark opacity --pv-accent-hover color --pv-accent-press color --pv-accent-soft color --pv-info color --pv-ok-soft color --pv-warn-soft color --pv-danger-soft color --pv-info-soft color --pv-danger-hover color --pv-danger-press color --pv-text-disabled color --pv-text-placeholder color --pv-text-link color --pv-border color --pv-border-strong color --pv-border-focus color --pv-scrim color --pv-surface-1 color --pv-surface-2 color --pv-surface-3 color --pv-surface-4 color --pv-surface-sunken color --pv-elev-0 shadow --pv-elev-1 shadow --pv-elev-2 shadow --pv-elev-3 shadow --pv-elev-4 shadow --pv-shadow-1 shadow --pv-shadow-2 shadow --pv-shadow-3 shadow --pv-shadow-4 shadow --pv-glow-accent shadow --pv-glow-danger shadow --pv-fs-2xs length >=12px --pv-fs-4xl length >=12px --pv-lh-tight ratio 0.8..3 --pv-lh-snug ratio 0.8..3 --pv-lh-normal ratio 0.8..3 --pv-lh-loose ratio 0.8..3 --pv-ls-tight length signed --pv-ls-normal length signed --pv-ls-wide length signed --pv-fw-regular weight --pv-fw-medium weight --pv-fw-semibold weight --pv-fw-bold weight --pv-fw-body weight --pv-s0 length 0..400px --pv-s1 length 0..400px --pv-s2 length 0..400px --pv-s3 length 0..400px --pv-s4 length 0..400px --pv-s5 length 0..400px --pv-s6 length 0..400px --pv-s7 length 0..400px --pv-s8 length 0..400px --pv-s9 length 0..400px --pv-s10 length 0..400px --pv-gap-sm length 0..400px --pv-gap-md length 0..400px --pv-gap-lg length 0..400px --pv-gutter length 0..400px --pv-radius-xs length 0..1000px --pv-radius-sm length 0..1000px --pv-radius-md length 0..1000px --pv-radius-lg length 0..1000px --pv-radius-xl length 0..1000px --pv-radius-pill length 0..1000px --pv-bw-1 length 0..16px --pv-bw-2 length 0..16px --pv-bw-3 length 0..16px --pv-focus-ring-w length 0..16px --pv-focus-ring-offset length -16..16px --pv-focus-ring-color color --pv-dur-1 duration --pv-dur-2 duration --pv-dur-3 duration --pv-dur-4 duration --pv-stagger-step duration --pv-ease-in easing --pv-ease-out easing --pv-ease-in-out easing --pv-ease-emphasis easing --pv-motion-intensity opacity --pv-row-h length 16..200px --pv-control-h-sm length 16..200px --pv-control-h-md length 16..200px --pv-control-h-lg length 16..200px --pv-control-pad-x length 0..400px --pv-card-bg color --pv-card-bg-hover color --pv-card-fg color --pv-card-border color --pv-card-border-w length 0..400px --pv-card-radius length 0..400px --pv-card-pad length 0..400px --pv-card-gap length 0..400px --pv-card-shadow shadow --pv-button-bg color --pv-button-bg-hover color --pv-button-bg-press color --pv-button-fg color --pv-button-border color --pv-button-primary-bg color --pv-button-primary-bg-hover color --pv-button-primary-bg-press color --pv-button-primary-fg color --pv-button-danger-bg color --pv-button-danger-bg-hover color --pv-button-danger-fg color --pv-button-h length 0..400px --pv-button-pad-x length 0..400px --pv-button-radius length 0..400px --pv-button-border-w length 0..400px --pv-button-fs length >=12px --pv-button-fw weight --pv-button-disabled-opacity opacity --pv-input-bg color --pv-input-fg color --pv-input-border color --pv-input-border-hover color --pv-input-border-focus color --pv-input-placeholder color --pv-input-h length 0..400px --pv-input-pad-x length 0..400px --pv-input-radius length 0..400px --pv-input-border-w length 0..400px --pv-tab-fg color --pv-tab-fg-hover color --pv-tab-fg-active color --pv-tab-bg color --pv-tab-bg-hover color --pv-tab-bg-active color --pv-tab-indicator color --pv-tab-h length 0..400px --pv-tab-pad-x length 0..400px --pv-tab-radius length 0..400px --pv-tab-indicator-w length 0..400px --pv-tab-gap length 0..400px --pv-tooltip-bg color --pv-tooltip-fg color --pv-tooltip-border color --pv-tooltip-radius length 0..400px --pv-tooltip-pad-x length 0..400px --pv-tooltip-pad-y length 0..400px --pv-tooltip-max-w length 0..400px --pv-tooltip-fs length >=12px --pv-tooltip-shadow shadow --pv-list-row-bg color --pv-list-row-bg-hover color --pv-list-row-bg-selected color --pv-list-row-bg-selected-hover color --pv-list-row-fg color --pv-list-row-fg-muted color --pv-list-row-border color --pv-list-row-accent color --pv-list-row-h length 0..400px --pv-list-row-pad-x length 0..400px --pv-list-row-radius length 0..400px --pv-list-row-gap length 0..400px ``` ## Contrats Chaque écran et composant que vous pouvez mettre en template : ses chemins d'entrée, sorties, places (les OBLIGATOIRES sont marquées), classes de l'hôte, parties, obligations (musts) et s'il est une face. ```text # Screens and components of the contracts table (since:N = needs "themeApi": N in theme.json; absent = 1). s=string n=number b=boolean; a|b = closed set; x? = may be null; x[] = list; ref:T = opaque type. # slots: name[*]=required, :contract = mounts that contract. out: output(args) [*]=required. in: nested paths (dotted in c.bind). Component states: state={extra fields}. # musts: id=kind:part detail @states (part=data-part exists, absent, emits=gesture calls output, shows=path, enabled, disabled, excludes=needle never inside). # template key: screens. for screen.; components[''] for components. face = the host owns the card root; no button/toggle/dropdown/slot-of-contract/outputs inside. ## screen.chat (screens.chat) since:2 slots: tabs* users* close* panes* out: channel.select(channel:s) users.toggle() close() host: card bar push panes pv-plate pv-plate--lg vars: - replaceable: - in: channels[]{id:s label:s unread:n direct:b clan:b selected:b} active:s gate:ready|login|offline|server|unsupported usersShown:b unread:n ## screen.clan (screens.clan) since:2 slots: back* title* online* gate* failed* tag manage* facts members* none* tabs* chat* ranking* out: back() site.open() refresh() settings.open() side.select(side:s) ranking.sort(sort:s) ranking.page(offset:n) host: clan pv-screen pv-ui pv-plate pv-plate--lg page-head label-line push body cols left right band title-line place lead-badge note vars: - replaceable: - in: gate:page|offline-note|login mine:loading|none|clan side:chat|ranking failure?{text:s} clan?{name:s tag:s rank?:n top:b leader:b members:n memberLimit:n online:n totalPp:s averagePp:s} ranking{sort:total|average|members loaded:b empty:b loading:b total:n entries:n page:n pages:n} chat{available:b} ## screen.download (screens.download) since:2 slots: title* sources* choices* search* notices* results* catalog* queue* out: tab.select(tab:s) link.paste() search.focus() queue.clear() host: download pv-screen top body panel previewing vars: - replaceable: download.card catalog.card in: tab:s mode:results|prism|catalog section:s previewing:b results{count:n loading:b failed:b} queue{total:n active:n finished:n} folder?:s ## screen.help (screens.help) since:2 slots: back* title* search* topics* content* out: back() topic.jump(id:s) search.focus() search.clear() host: help-page pv-screen pv-ui page-head push body vars: - replaceable: - in: topics[]{id:s title:s current:b} total:n search{active:b query:s found:n} ## screen.library (screens.library) slots: toolbar:library.toolbar views online visualize intent* search*:library.search searchField searchTools list* playlistSearch*:library.search playlists* visualizer* header*:selected.header tabs*:selected.tabs panels* infoPanel leaderboardPanel modsPanel trainingPanel historyPanel mapsPanel editorPanel footer*:library.footer out: drawer.toggle() random() mods.open() settings.open() mod.set(key:s,on:b) rate.set(value:n) mods.reset() preview.seek(at:n) preview.toggle() host: song-select pv-screen map-browser browser-body browser-list covered browser-playlists selected-map selected-body no-selection vars: --selection-color --difficulty-color --row-distance replaceable: library.setCard library.chartRow leaderboard.card rate.control maps.toPlay in: selection{state:map|playlist|pick|empty shown:b color:s busy:b entering:b changed:b tab:s} browser{view:maps|playlists|mapsToPlay covered:b visualizer:b color:s} map?{artist:s title:s difficulty:s keysText:s keys:n creator?:s background?:s rating{value?:n text:s unit:s label:s} rate?:n duration{text:s seconds?:n} bpm:s bpmValue?:n notes:s holds:s holdShare?:n nps{average:s peak:s averageValue?:n peakValue?:n} skillsets[]{label:s short:s display:s hue:s level:n} patterns[]{label:s short:s display:s hue:s level:n rank:n position:n} equalizer[]{i:n level:n live:n} listening:b fresh:b difficultyCount:n record?{plays:n bestAccuracy?:n bestPerformance?:s lastPlayed?:s top?{accuracy:n performance?:s combo:n misses:n rate:n rateText:s date:s}}} mods[]{key:s id:s name:s short:s description:s group:s groupLabel:s icon:s enabled:b conflicts[]:s} modsOn:n preview{shown:b playing:b position:n duration:n progress:n positionText:s durationText:s steps[]{i:n at:n level:n passed:b}} online{state:offline|signedOut|connecting|online name?:s avatar?:s players?:n friendsOnline:n friends[]{name:s avatar?:s status:online|inLobby|playing} unread:n} rateControl{state=ready|atDefault|atMin|atMax value:n text:s min:n max:n minText:s maxText:s step:n typed:n steps{down:n up:n} ready{} atDefault{} atMin{} atMax{}} keys{play:s menu:s up:s down:s previousSet:s nextSet:s random:s palette:s visualize:s chat:s} ## screen.lobby (screens.lobby) since:2 slots: title* code* switches* notice* playersHead compare* roster* files* map* panel* draft:lobby.draft leave* spectate* ready* out: leave() ready.set(ready:b) spectate.set(spectate:b) code.copy() map.open() host: room band grid people players-panel side actions push pv-plate pv-plate--lg pv-plate--md vars: - replaceable: player.card in: lobby{name:s code:s codeHidden:b open:b hostRotation:b started:b} self{host:b ready:b spectating:b waiting:b} players{count:n rivals:n results:n} map{chosen:b title:s artist:s rate:n shared:b} files{count:n replays:n} draft{active:b} ## screen.mods (screens.mods) since:2 slots: title* actions* folder* list* interfaces messages* out: mod.install() mods.folder() mods.reload() skins.open() host: mods-page settings-heading vars: - replaceable: - in: mods{count:n active:n disabled:n failed:n} folder:s interfaces:n messages:n ## screen.profile (screens.profile) since:2 slots: avatar title* account* badges* rating* accuracy* trackers* choices* loading* tabs* panel* out: tab.select(tab:s) plays.open(view:s) refresh() host: profile pv-screen pv-ui pv-plate pv-plate--lg pv-plate--md identity-band wraps identity name-line figures section-bar status vars: - replaceable: - in: state:pending|unavailable|empty|ready sessionOpen:b tab:s tabs[]{id:s label:s count:n selected:b} view:best|recent|pinned|left player{name:s initial:s charts:n plays:n playTime:s} account?{name:s offline:b} rating?{value:n unit:s digits:n performance:b} accuracy?:n skillsets[]{name:s value:n text:s color:s share:n main:b} crowded:b loading{active:b done:n total:n progress:n} ## screen.replay (screens.replay) since:2 slots: back* title* judgement* performance* rating* compare* watch* sideBySide* export* share* train* standings* notices* transport* banner comparison* player* stats* tiers* graphs* status* out: back() watch() watch.sideBySide() share(replayId:s) compare.pick(replayId:s) compare.clear() host: replay-page pv-screen page-header replay-controls replay-actions replay-scroll replay-content replay-layout score-overview pv-plate pv-plate--lg vars: --map-color replaceable: - in: status:loading|ready|error|unavailable loading:b mock:b lobby:b playback:stopped|loading|playing map{title:s artist:s difficulty:s keys:s creator:s picture?:s color:s rate:s mods:s} score?{replayId:s player:s received:b playedAt:s accuracy:n maxCombo:n misses:n ranked:b pauses?:n performance?:n performanceUnit:s rating?:n ratingUnit:s ratingName:s meanOffsetMs?:n} judgement:s tiers[]{id:s name:s color:s count:n share:n} comparison{shown:b chosen:b player:s rate:s newRecord:b firstPlay:b failed:b references[]{replayId:s player:s rate:s mods:s accuracy:n maxCombo:n picked:b}} ## screen.result (screens.result) since:2 slots: title* tiers* close* out: dismiss() host: results vars: - replaceable: - in: aborted:b auto:b ranked:b judgement:s accuracy:n maxCombo:n clear:aborted|perfect|fullCombo|clear newBest:b hits:n misses:n tiers[]{id:s name:s color:s count:n} ## screen.settings (screens.settings) since:2 slots: title* search* actions* close* notices* rail* panel* hints out: close() category.select(id:s) search.focus() search.clear() host: settings-page settings-top settings-top-actions settings-layout vars: - replaceable: - in: category{id:gameplay|controls|audio|display|library|online|system label:s blurb:s changed:n index:n hasSummary:b} categories[]{id:gameplay|controls|audio|display|library|online|system label:s blurb:s changed:n selected:b} search{active:b query:s found:n} changed:n ## screen.skins (screens.skins) since:2 slots: title* notices* interfaces* skinsHead* skins* problems* out: interface.use(id:s) skin.use(id:s) skin.customize() skins.import() skins.folder() skins.reload() host: skins-page settings-heading skins-section vars: - replaceable: - in: interfaces{count:n current:s currentName:s} skins{count:n shown:n selected:s searching:b importers:n} problems:n ## screen.title (screens.title) since:2 slots: logo name* press* band version nowPlaying out: enter() host: title-center title-foot title-glow vars: --beat replaceable: - in: version:s leaving:b nowPlaying{known:b title:s artist:s} ## screen.tournaments (screens.tournaments) since:2 slots: back* title* online* gate* failed* notice* tabs* filters* list* detail* qualifier entries* bracket* standings* match* mine* out: back() nav.up() refresh() settings.open() view.select(view:s) filter.select(filter:s) page.select(offset:n) tournament.open(slug:s) match.open(matchId:s) register(teamName:s?) join.team(code:s) withdraw() member.remove(userId:s) session.take(sessionId:s) session.join() session.leave(sessionId:s) host: tournaments pv-screen pv-ui pv-plate page-head label-line push body bar cards card facts bracket-scroll bracket-col mark note pager countdown vars: - replaceable: - in: gate:page|offline-note|login view:list|detail|match|mine filter:all|registration|running|finished loading:b failure?{text:s} notice?{text:s} list{total:n page:n pages:n empty:b items[]{slug:s name:s format:s status:draft|registration|seeding|running|finished|cancelled statusText:s mode:s entries:n maxEntries?:n when:s winner?:s}} tournament?{slug:s name:s description?:s format:s status:draft|registration|seeding|running|finished|cancelled statusText:s mode:s metric:s bestOf:n entries:n maxEntries?:n registration:s starts:s entered:b canRegister:b canWithdraw:b entriesList[]{id:s seed?:s name:s status:s members[]{userId:s username:s captain:b self:b}} bracket[]{bracket:winners|losers|grand_final name:s matches[]{id:s round:s state:pending|ready|running|done|void bestOf:n sides[]{name:s score?:s winner:b seed?:s} when?:s referee?:s forfeit?:s}} standings[]?{rank:n name:s points:s maps[]{slot:s value:s} tiebreaks[]?{label:s value:s}} forfeitAfterMin:n pool[]{slot:s tag:s tiebreaker:b playbackRate:s map:s} qualifier?{rules:s phaseText:s attempts?:s sessions[]{id:s n:n when:s countdown:s seats:s state:scheduled|frozen|open|running|closed|cancelled stateText:s seat?{state:subscribed|played|no_show|withdrawn text:s} canTake:b canLeave:b playable:b joinable:b}}} game?{id:s round:s bestOf:n sides[]{name:s score?:s winner:b seed?:s} games[]{number:n map:s playbackRate:s pickedBy?:s winner?:n scores[]{side:n value:s}}} mine[]{slug:s name:s status:s entryStatus:registered|incomplete|disqualified|withdrawn entryText:s nextMatch?{id:s opponent:s when:s countdown:s} joinCode?:s qualifier?{attempts:s next?{session:s when:s countdown:s playable:b joinable:b}}} ## catalog.card (components['catalog.card']) face since:2 slots: permissions progress below out: install.ask() install.cancel(kind:skin|mod|playlist,id:s) parts: cover:img install:button cancel:button installed:img host: - in: state=available|update|installed|downloading|installing kind:skin|mod|playlist id:s name:s versionText:s byText:s size:s hash:s description?:s tags[]:s cover?:s shots[]{url:s alt:s} permissions[]:s badge?:s available{} update{from:s} installed{disabled:b} downloading{percent?:n} installing{} musts: install-button=part:install button focusable @available,update; install-click=emits:install click->install.ask() @available,update; install-enter=emits:install Enter->install.ask() @available,update; no-install-when-running=absent:install @installed,downloading,installing; cancel-button=part:cancel button focusable @downloading; cancel-click=emits:cancel click->install.cancel(kind,id) @downloading; installed-mark=part:installed img @installed ## download.card (components['download.card']) face since:2 slots: contents out: download.start() download.action(action:s) download.retry(jobId:n) settings.open(target:s) preview.open() pack.toggle(id:n) parts: toggle:button download:button retry:button lock:button installed:img queued:img progress:text reason:status preview:button host: - in: state=idle|locked|unavailable|queued|active|failed|installed shape:set|pack kind:osu|quaver|etterna|mod id:n title:s edge:s set?{artist:s creator?:s creatorText?:s cover:s badges[]:s keySummary:s difficulties[]{keysText:s keys:n rating?:s color:s title:s skills[]{badge:s color:s}} more:n bpm?:s plays?:s longNotes?:s extra?{tags[]:s size?:s details[]{label:s value:s}}} pack?{cover?:s nsfw:b songs:s size:s plays:s tags:s skills[]{key:s label:s value:s color:s main:b} open:b} progress?:n reason?{text:s detail?:s message?:s} startDisabled:b actions[]{id:s label:s} previewable:b idle{redownload:b} locked{lock:quaver|mod} unavailable{} queued{} active{phase:downloading|extracting percent?:n} failed{jobId:n} installed{} musts: download-button=part:download button focusable @idle; download-click=emits:download click->download.start() @idle; download-enter=emits:download Enter->download.start() @idle; no-download-when-running=absent:download @queued,active,failed,installed,locked,unavailable; retry-click=emits:retry click->download.retry(jobId) @failed; retry-enter=emits:retry Enter->download.retry(jobId) @failed; lock-button=part:lock button focusable @locked; installed-mark=part:installed img @installed; queued-mark=part:queued img @queued; progress-shown=shows:progress percent @active ## leaderboard.card (components['leaderboard.card']) face slots: tiers pauses out: replay.open(replayId:s)* replay.watch(replayId:n)* replay.retry(replayId:n) replay.share(replayId:s) ghost.pick(ghostId:s,chosen:b) play.report(scoreId:n,player:s) parts: open:button rank:text name:text rate:text mods:text combo:text misses:text accuracy:text performance:text date:time ghost:button share:button watch:button retry:button loading:img report:button host: - in: state=local|localGhost|online|onlineGhost|onlineLoading|onlineFailed|onlineStatic|own rank:n podium?:gold|silver|bronze player{name?:s label:s} badges{received:b mirror:b osuImport:b unranked:b} rate{value:n text:s} mods?:s pauses?:ref:@pvng/library:PauseCounts combo:n misses?:n tiers[]?{name:s color:s gradient[]?:s symbol?:ref:@pvng/desktop:JudgementSymbol count:n} accuracy{value:n text:s} performance?{text:s unavailable:b} nonstandard:b date{ms:n iso:s text:s} report?{scoreId:n player:s label:s} local{replayId:s} localGhost{replayId:s ghost{id:s chosen:b disabled?:b title:s}} online{replayId:n watchLabel:s} onlineGhost{replayId:n watchLabel:s ghost{id:s chosen:b disabled?:b title:s}} onlineLoading{replayId:n watchLabel:s ghost?{id:s chosen:b disabled?:b title:s}} onlineFailed{replayId:n watchLabel:s ghost?{id:s chosen:b disabled?:b title:s}} onlineStatic{} own{} musts: open-is-button=part:open button focusable @local,localGhost,online,onlineGhost,onlineLoading,onlineFailed; no-open-without-replay=absent:open @onlineStatic,own; open-local-click=emits:open click->replay.open(replayId) @local,localGhost; open-local-enter=emits:open Enter->replay.open(replayId) @local,localGhost; open-online-click=emits:open click->replay.watch(replayId) @online,onlineGhost,onlineLoading,onlineFailed; open-online-enter=emits:open Enter->replay.watch(replayId) @online,onlineGhost,onlineLoading,onlineFailed; rate-shown=shows:rate rate.text; name-shown=shows:name player.label; accuracy-shown=shows:accuracy accuracy.text; date-shown=shows:date date.text; no-misses-with-tiers=absent:misses @local,localGhost; ghost-toggle=part:ghost button focusable @localGhost,onlineGhost; ghost-click=emits:ghost click->ghost.pick(ghost.id,ghost.chosen) @localGhost,onlineGhost; ghost-enter=emits:ghost Enter->ghost.pick(ghost.id,ghost.chosen) @localGhost,onlineGhost; no-ghost-unoffered=absent:ghost @local,online,onlineStatic,own; share-click=emits:share click->replay.share(replayId) @local,localGhost; share-enter=emits:share Enter->replay.share(replayId) @local,localGhost; no-share-online=absent:share @online,onlineGhost,onlineLoading,onlineFailed,onlineStatic,own; watch-click=emits:watch click->replay.watch(replayId) @online,onlineGhost; watch-enter=emits:watch Enter->replay.watch(replayId) @online,onlineGhost; wait-while-loading=part:loading img @onlineLoading; no-watch-while-loading=absent:watch @onlineLoading,onlineFailed,onlineStatic,own,local,localGhost; retry-click=emits:retry click->replay.retry(replayId) @onlineFailed; retry-enter=emits:retry Enter->replay.retry(replayId) @onlineFailed; no-report-own-or-local=absent:report @local,localGhost,own ## library.chartRow (components['library.chartRow']) face since:2 slots: goal missing out: activate(position:n,difficulty:n,alreadySelected:b,dragDistance:n)* pickPlaylistMap(path:s,variant:n)* menu.open(x:n,y:n) parts: keys:text name:text rate:text similar:text rateOf:text pattern:text rating:text plays:text host: - in: state=normal|selected|playlist position:n difficulty:n path:s variant:n selected:b themed:b name:s keysText:s color:s missing?:audio|background|both noAudio:b noted:b goal?:open|reached rate?{text:s title:s} similar?{text:s title:s} rateOf?{label:s help:s} pattern?{short:s color:s names:s} rating:s ratingUnit:s stars[]{lit:b} plays?{text:s title:s} normal{} selected{} playlist{} musts: button=part:root button focusable; activate-click=emits:root click->activate(position,difficulty,selected,0±1) @normal,selected; activate-enter=emits:root Enter->activate(position,difficulty,selected,0±1) @normal,selected; pick-playlist-map=emits:root click->pickPlaylistMap(path,variant) @playlist; name=shows:name name; keys=shows:keys keysText; rating=shows:rating rating ## library.footer (components['library.footer']) slots: - out: rating.pick(value:s) judgement.pick(value:s) judgement.settings() confirm()* playlist.start(playlistId:n) marathon.start(playlistId:n) parts: rating:button judgement:button refusal:alert play:button unranked:none reason:none start:button marathon:button host: - in: state=mapReady|mapBlocked|mapRefused|mapNoPlay|playlistReady|playlistBlocked rating{value:s options[]{value:s label:s group:s detail:s}} judgement{value:s label:s ariaLabel:s options[]{value:s label:s group:s detail:s}} refusal?:s mapReady{play{label:s intent:play|train|pick-lobby-map} unrankedSlot:b unranked:b} mapBlocked{play{label:s intent:play|train|pick-lobby-map} unrankedSlot:b unranked:b reason{kind:lobby|loading|section|staircase|busy text:s}} mapRefused{play{label:s intent:play|train|pick-lobby-map} unrankedSlot:b unranked:b} mapNoPlay{} playlistReady{playlistId:n} playlistBlocked{playlistId:n reason{kind:empty|running text:s}} musts: rating-picker=part:rating button focusable; judgement-picker=part:judgement button focusable; rating-stays-on=enabled:rating; judgement-stays-on=enabled:judgement; play-is-a-button=part:play button focusable @mapReady; play-click=emits:play click->confirm() @mapReady; play-enter=emits:play Enter->confirm() @mapReady; play-label=shows:play play.label @mapReady,mapBlocked,mapRefused; play-off=disabled:play @mapBlocked,mapRefused; play-reason=shows:play reason.text @mapBlocked; play-refusal=shows:play refusal @mapRefused; refusal-alert=part:refusal alert @mapRefused; no-play-in-playlist=absent:play @mapNoPlay; marathon-is-a-button=part:marathon button focusable @playlistReady; marathon-click=emits:marathon click->marathon.start(playlistId) @playlistReady; playlist-start-click=emits:start click->playlist.start(playlistId) @playlistReady; playlist-off=disabled:marathon @playlistBlocked; playlist-start-off=disabled:start @playlistBlocked; playlist-reason=shows:marathon reason.text @playlistBlocked; playlist-start-reason=shows:start reason.text @playlistBlocked ## library.search (components['library.search']) slots: filterWindow out: query.set(text:s) query.commit(text:s) sort.set(key:s) sort.toggleDirection() group.set(key:s) group.collapseAll() group.expandAll() reshuffle() filter.edit(key:s) filter.remove(key:s) history.restore(id:s) history.pin(id:s) history.remove(id:s) history.clear() history.pause() history.resume() duplicates.review() duplicates.reveal() parts: bar:none field:combobox clear:button history:region sort:button direction:button group:button filters:group status:status syntax:status error:alert host: library-search search-bar filter-chips bar-menu pv-plate in: state=ready|filtered|blocked|invalid mode:maps|playlists query:s sort{value:s label:s options[]{value:s label:s group:s} descending:b active:b caption:s directionLabel:s} group?{value:s label:s options[]{value:s label:s group:s} grouped:b allFolded:b canFoldAll:b caption:s} filters[]{key:s label:s value:s tip:s removeLabel:s unavailable:b} fieldKeys[]:s history?{enabled:b entries[]{id:s query:s label:s pinned:b}} reviewing:b syntax{pending?:s unrecognised?:s} ready{} filtered{} blocked{status:s error?:s} invalid{error:s} musts: field=part:field combobox focusable; sort=part:sort button focusable; direction=emits:direction click->sort.toggleDirection(); filters-listed=part:filters group @filtered,blocked; filters-absent=absent:filters @ready; status-shown=shows:status status @blocked; error-alert=part:error alert @invalid; error-shown=shows:error error @invalid ## library.setCard (components['library.setCard']) face slots: goal missing out: toggle(position:n)* selectPlaylist(playlistId:n)* filter.name(key:host/artist|host/creator,name:s) menu.open(x:n,y:n) more.show(id:s,x:n,y:n,by:pointer|focus) more.hide() parts: art:presentation title:text artist:text meta:text creator:text keys:text rating:text strip:presentation more:img host: - in: state=collapsed|selected|expanded|playlist|loading collapsed{position:n id:s selected:b expanded:b themed:b title:s artist:s creator?{name:s text:s} color:s thumbnail:s mosaic[]?:s similar?{text:s title:s} newText?:s countText:s missing?:audio|background|both noted:b plays?{text:s title:s} keysText:s goal?:open|reached advice?{kind:comfort|push|stretch text:s} rating{text:s range:s unit:s} strip{tier:dot|rating|full|pattern chipWidth:n gap:n maxWidth:n minWidth:n chips[]{key:n color:s keysText:s short:s pattern?{short:s color:s}} more?{count:n label:s}}} selected{position:n id:s selected:b expanded:b themed:b title:s artist:s creator?{name:s text:s} color:s thumbnail:s mosaic[]?:s similar?{text:s title:s} newText?:s countText:s missing?:audio|background|both noted:b plays?{text:s title:s} keysText:s goal?:open|reached advice?{kind:comfort|push|stretch text:s} rating{text:s range:s unit:s} strip{tier:dot|rating|full|pattern chipWidth:n gap:n maxWidth:n minWidth:n chips[]{key:n color:s keysText:s short:s pattern?{short:s color:s}} more?{count:n label:s}}} expanded{position:n id:s selected:b expanded:b themed:b title:s artist:s creator?{name:s text:s} color:s thumbnail:s mosaic[]?:s similar?{text:s title:s} newText?:s countText:s missing?:audio|background|both noted:b plays?{text:s title:s} keysText:s goal?:open|reached advice?{kind:comfort|push|stretch text:s} rating{text:s range:s unit:s} strip{tier:dot|rating|full|pattern chipWidth:n gap:n maxWidth:n minWidth:n chips[]{key:n color:s keysText:s short:s pattern?{short:s color:s}} more?{count:n label:s}}} playlist{position:n id:s selected:b expanded:b themed:b title:s artist:s creator?{name:s text:s} color:s thumbnail:s mosaic[]?:s similar?{text:s title:s} newText?:s countText:s missing?:audio|background|both noted:b plays?{text:s title:s} keysText:s goal?:open|reached advice?{kind:comfort|push|stretch text:s} rating{text:s range:s unit:s} strip{tier:dot|rating|full|pattern chipWidth:n gap:n maxWidth:n minWidth:n chips[]{key:n color:s keysText:s short:s pattern?{short:s color:s}} more?{count:n label:s}} playlistId:n} loading{} musts: button=part:root button focusable @collapsed,selected,expanded,playlist; toggle-click=emits:root click->toggle(position) @collapsed,selected,expanded; toggle-enter=emits:root Enter->toggle(position) @collapsed,selected,expanded; select-playlist=emits:root click->selectPlaylist(playlistId) @playlist; select-playlist-enter=emits:root Enter->selectPlaylist(playlistId) @playlist; title=shows:title title @collapsed,selected,expanded,playlist; artist=shows:artist artist @collapsed,selected,expanded,playlist; count=shows:meta countText @collapsed,selected,expanded,playlist; keys=shows:keys keysText @collapsed,selected,expanded,playlist; rating=shows:rating rating.range @collapsed,selected,expanded,playlist; loading-empty=absent:title @loading; loading-no-badge=absent:more @loading ## library.toolbar (components['library.toolbar']) slots: online out: view.set(view:maps|playlists|mapsToPlay)* random() demo() visualize() multiplayer() menu.open(x:n,y:n) menu.run(id:s) parts: views:radiogroup playlists:radio mapsToPlay:radio random:button menu:button action:button multiplayer:button visualize:button host: library-toolbar bar bar-side online viz viz-label tb-label active in: state=maps|mapsBusy|mapsEmpty|playlists|mapsToPlay views[]{value:maps|playlists|mapsToPlay label:s count:n countText:s exact?:s disabled:b} visualizer{open:b available:b label:s iconOnly:b} menu[]{id:s label:s unavailable?:s} menuOpen:b maps{} mapsBusy{} mapsEmpty{locked:b} playlists{} mapsToPlay{} musts: playlists-click=emits:playlists click->view.set("playlists") @maps,mapsEmpty; maps-to-play-click=emits:mapsToPlay click->view.set("mapsToPlay") @maps; random-click=emits:random click->random() @maps; random-off=disabled:random @mapsBusy,mapsEmpty; no-random-in-playlists=absent:random @playlists,mapsToPlay; multiplayer-is-a-button=part:multiplayer button focusable; multiplayer-click=emits:multiplayer click->multiplayer(); visualize=part:visualize button ## lobby.draft (components['lobby.draft']) slots: - out: start(bestOf:n,bansPerSide:n,first:a|b,pickRule:alternate|loser_picks,turnSecs:n) ban(slot:s) pick(slot:s) forfeit(side:a|b) abort() pool.add() pool.remove(slot:s) parts: heading:heading denial:status problem:status start:button poolAdd:button poolRemove:button pool:list map:listitem ban:button pick:button turn:status score:status forfeit:button abort:button host: - in: state=setup|banning|picking|playing|finished host:b denial?:not_in_lobby|not_host|not_captain|not_your_turn|wrong_phase|bad_config|bad_sides|unknown_map|map_taken|map_reserved|not_members|started|draft_active|no_draft|feature_unavailable|unknown setup{poolLimit:n pool[]{slot:s title:s artist:s art?:s difficulty?:s rateText:s noteHash:s playbackRate:n judgement:s} candidate?{title:s artist:s rateText:s inPool:b} sides?{a[]:s b[]:s}} banning{series{bestOf:n a:n b:n} sides{a{captain?:s members[]:s mine:b} b{captain?:s members[]:s mine:b}} bansPerSide:n pickRule:alternate|loser_picks|unknown maps[]{slot:s title:s artist:s art?:s difficulty?:s rateText:s status:open|banned|picked|played by?:a|b winner?:a|b game?:n auto:b current:b tiebreaker:b} turn?{side:a|b kind:ban|pick mine:b secondsLeft?:n}} picking{series{bestOf:n a:n b:n} sides{a{captain?:s members[]:s mine:b} b{captain?:s members[]:s mine:b}} bansPerSide:n pickRule:alternate|loser_picks|unknown maps[]{slot:s title:s artist:s art?:s difficulty?:s rateText:s status:open|banned|picked|played by?:a|b winner?:a|b game?:n auto:b current:b tiebreaker:b} turn?{side:a|b kind:ban|pick mine:b secondsLeft?:n}} playing{series{bestOf:n a:n b:n} sides{a{captain?:s members[]:s mine:b} b{captain?:s members[]:s mine:b}} bansPerSide:n pickRule:alternate|loser_picks|unknown maps[]{slot:s title:s artist:s art?:s difficulty?:s rateText:s status:open|banned|picked|played by?:a|b winner?:a|b game?:n auto:b current:b tiebreaker:b} turn?{side:a|b kind:ban|pick mine:b secondsLeft?:n} game{number:n slot:s title:s}} finished{series{bestOf:n a:n b:n} sides{a{captain?:s members[]:s mine:b} b{captain?:s members[]:s mine:b}} bansPerSide:n pickRule:alternate|loser_picks|unknown maps[]{slot:s title:s artist:s art?:s difficulty?:s rateText:s status:open|banned|picked|played by?:a|b winner?:a|b game?:n auto:b current:b tiebreaker:b} turn?{side:a|b kind:ban|pick mine:b secondsLeft?:n} winner?:a|b reason:won|forfeit|aborted|unknown} musts: heading=part:heading heading; setup-start=part:start button focusable @setup; setup-start-click=emits:start click->start(3,1,"a","alternate",60) @setup; pool-add-click=emits:poolAdd click->pool.add() @setup; pool-remove-click=emits:poolRemove click->pool.remove("M1") @setup; problem=part:problem status @setup; ban-click=emits:ban click->ban("M2") @banning; pick-click=emits:pick click->pick("M3") @picking; turn=part:turn status @banning,picking; score=part:score status @playing,finished; forfeit-click=emits:forfeit click->forfeit("a") @banning,picking,playing; abort-click=emits:abort click->abort() @banning,picking,playing; no-times-sign=excludes:pool "×" @banning,picking,playing,finished; no-check-mark=excludes:pool "✓" @banning,picking,playing,finished; denial=part:denial status @setup,banning,picking,playing,finished ## maps.toPlay (components['maps.toPlay']) slots: - out: goTo(index:n,title:s,rate:n)* filter.keys(keys:n) filter.pattern(pattern:s) retry() parts: heading:heading keys:group key:button patterns:group pattern:button list:list entry:listitem goTo:button message:status retry:button host: - in: state=loading|ready|notEnough|noLevel|empty|unavailable|retry keys?:n keyOptions[]{value:n label:s active:b} pattern:s patterns[]{id:s label:s color?:s plays:n levelText?:s listed:b active:b} ratingName:s loading{} ready{entries[]{id:s index:n title:s artist:s difficulty:s keys:n pattern:s patternColor?:s kind:comfort|push|stretch rate:n rateText:s ratingText:s ratingAtRateText:s expectedText:s bandText:s current:b}} notEnough{have:n need:n} noLevel{} empty{} unavailable{reason:judgement|noRating} retry{reason:busy|failed} musts: heading=part:heading heading; keys=part:keys group @ready,notEnough,noLevel,empty; key-click=emits:key click->filter.keys(4) @ready,notEnough,noLevel,empty; patterns=part:patterns group @ready,notEnough,noLevel,empty; strongest-click=emits:pattern click->filter.pattern("") @ready,notEnough,noLevel,empty; list=part:list list @ready; go-to-reachable=part:goTo button focusable @ready; go-to-click=emits:goTo click->goTo(12,"Strong 280",1.15) @ready; go-to-enter=emits:goTo Enter->goTo(12,"Strong 280",1.15) @ready; no-times-sign=excludes:list "×" @ready; message=part:message status @loading,notEnough,noLevel,empty,unavailable,retry; no-list-without-numbers=absent:goTo @loading,notEnough,noLevel,empty,unavailable,retry; retry-click=emits:retry click->retry() @retry ## player.card (components['player.card']) face since:2 slots: avatar playerName clan friend flag title rank marks status tiers out: replay.watch(userId:s) parts: avatar:img name:text rank:text status:text ready:status accuracy:text watch:button host: - in: state=lobby|round|user userId:s name:s initial:s channel:s self:b index:n tone:n place:n picture:b host:b spectator:b waiting:b hasMap?:b rank?{value:n text:s top:b label:s tip:s} country?:s title?{name:s style?:s colour?:s} clan?{tag:s name:s} friend?{mutual:b} watchable:b side?:a|b strip:b lobby{ready:b last?{accuracy:s detail:s tiers[]?{name:s color:s gradient[]?:s symbol?:ref:@pvng/desktop:JudgementSymbol count:n}}} round{standing?{kind:result|live figures{accuracy:s detail:s tiers[]?{name:s color:s gradient[]?:s symbol?:ref:@pvng/desktop:JudgementSymbol count:n}}} note:noScore|waiting|spectating|none} user{status:online|inLobby|playing statusText:s} musts: name-shown=shows:name name; status-shown=shows:status statusText @user ## rate.control (components['rate.control']) slots: aside out: set(value:n)* parts: heading:heading value:spinbutton decrease:button increase:button slider:slider reset:button mark:button host: - in: state=ready|atDefault|atMin|atMax value:n text:s min:n max:n minText:s maxText:s step:n typed:n steps{down:n up:n} ready{} atDefault{} atMin{} atMax{} musts: value-field=part:value spinbutton focusable; value-shows-rate=shows:value text; no-times-sign=excludes:root "×"; enter-commits=emits:value Enter->set(value); arrow-up=emits:value ArrowUp->set(steps.up); arrow-down=emits:value ArrowDown->set(steps.down); slider=part:slider slider focusable; increase-asks-step=emits:increase click->set(steps.up) @ready,atDefault,atMin; decrease-asks-step=emits:decrease click->set(steps.down) @ready,atDefault,atMax; no-decrease-at-min=disabled:decrease @atMin; no-increase-at-max=disabled:increase @atMax; reset-to-one=emits:reset click->set(1) @ready,atMin,atMax; no-reset-at-default=disabled:reset @atDefault ## selected.header (components['selected.header']) slots: - out: name.filter(key:host/artist|host/creator,name:s) rateCopy.go(index:n,title:s) folders.add()* parts: heading:none title:heading artist:text difficulty:text rating:group stats:none rateCopy:button rateStatus:status addFolders:button host: song-heading pv-plate pv-plate--lg pv-plate--sm pv-stat artist difficulty-name name-filter rate-copy main-rating rating-value favourite-mark map-metrics map-stat rate-status no-selection in: state=map|rateCopy|playlist|pick|empty|emptyBusy color:s map{artist:s title:s difficulty:s keysText:s creator?:s favourite:b missing?{kind:audio|background|both chart:s} rating{value?:n unit:s label:s title:s} stats[]{label:s text:s numbers[]:n clock:b icon:clock|activity|music|rectangle-vertical|library|zap} rateStatus{error?:s unavailable?:s previous?:s}} rateCopy{artist:s title:s difficulty:s keysText:s creator?:s favourite:b missing?{kind:audio|background|both chart:s} rateCopy{label:s help:s baseIndex:n baseTitle:s} rating{value?:n unit:s label:s title:s} stats[]{label:s text:s numbers[]:n clock:b icon:clock|activity|music|rectangle-vertical|library|zap} rateStatus{error?:s unavailable?:s previous?:s}} playlist{name:s countText:s creator?:s missingText?:s rating{value?:n unit:s label:s title:s} stats[]{label:s text:s numbers[]:n clock:b icon:clock|activity|music|rectangle-vertical|library|zap}} pick{} empty{} emptyBusy{} musts: title=part:title heading; title-shows=shows:title title @map,rateCopy; playlist-name=shows:title name @playlist; rating-named=part:rating group @map,rateCopy,playlist; rating-label=shows:rating rating.label @map,rateCopy,playlist; rate-status=part:rateStatus status @map,rateCopy,playlist; rate-copy-reachable=part:rateCopy button focusable @rateCopy; rate-copy-click=emits:rateCopy click->rateCopy.go(rateCopy.baseIndex,rateCopy.baseTitle) @rateCopy; add-folders-off=disabled:addFolders @emptyBusy; add-folders=part:addFolders button focusable @empty; add-folders-click=emits:addFolders click->folders.add() @empty; add-folders-enter=emits:addFolders Enter->folders.add() @empty ## selected.tabs (components['selected.tabs']) slots: actions out: select(id:s)* playlist.select(id:s) parts: tablist:tablist tab:tab actions:none more:button moreLabel:none host: chart-bar in: state=chart|playlist active:s vertical:b tabs[]{id:s label:s icon:s dirty:b controls:s} chart{} playlist{} musts: tablist=part:tablist tablist; tab=part:tab tab focusable; tab-click=emits:tab click->select("info") @chart; playlist-tab-click=emits:tab click->playlist.select("info") @playlist ``` ## Nœuds Les types de nœuds et leurs attributs. ```text # theme.ts: defineTheme({ screens: { : (c) => node }, components: { '': (c) => node } }); c = ThemeContext<'screen.' | ''>. Builders below are members of c (and untyped globals). # attrs of a node = {common + layout/container/own}; children = ThemeChild[] (node | null | undefined | false | list). # Part, HostClass, CssVar, Slot, Contract = the names of the screen or component being templated (see the contracts). S = the scope of its input paths. Opaque: ThemeValue (bind, t, fmt), ThemeCond (field(...).cmp), ThemeEvent (on.press|change|pick), ThemeNode. type type ThemeText = string | number | boolean | ThemeValue | readonly ThemeText[] type type ThemeChild = ThemeNode | null | undefined | false | readonly ThemeChild[] type type ThemeArg = T | ThemeValue type type ThemeStep = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" box(...children: ThemeChild[]): ThemeNode box(attrs: ThemeContainerAttrs, ...children: ThemeChild[]): ThemeNode row(...children: ThemeChild[]): ThemeNode row(attrs: ThemeContainerAttrs, ...children: ThemeChild[]): ThemeNode column(...children: ThemeChild[]): ThemeNode column(attrs: ThemeContainerAttrs, ...children: ThemeChild[]): ThemeNode stack(...children: ThemeChild[]): ThemeNode stack(attrs: ThemeContainerAttrs, ...children: ThemeChild[]): ThemeNode grid(...children: ThemeChild[]): ThemeNode grid(attrs: ThemeLayout & { columns?: readonly string[]; rows?: readonly string[] }, ...children: ThemeChild[]): ThemeNode scroll(...children: ThemeChild[]): ThemeNode scroll(attrs: ThemeLayout & { axis?: "y" | "x" | "both" }, ...children: ThemeChild[]): ThemeNode spacer(attrs?: ThemeAttrs & { size?: ThemeStep }): ThemeNode text(value: ThemeText, attrs?: ThemeAttrs & { as?: ThemeTextTag; tween?: boolean; letters?: boolean; scramble?: boolean }): ThemeNode icon(name: ThemeIcon | ThemeValue, attrs?: ThemeAttrs & { size?: number }): ThemeNode image(src: string | ThemeValue, attrs: ThemeAttrs & { alt: ThemeText; fit?: "cover" | "contain" }): ThemeNode button(attrs: ThemeAttrs & { variant?: "primary" | "plain" | "quiet"; label?: ThemeText; disabled?: ThemeCond; pressed?: ThemeCond; describedBy?: Part; on: ThemeEvent<"press"> }, ...children: ThemeChild[]): ThemeNode toggle(attrs: ThemeAttrs & { label: ThemeText; checked: ThemeCond; on: ThemeEvent<"change"> }): ThemeNode meter(attrs: ThemeAttrs & { value: ThemeText; min?: number; max?: number; label: ThemeText }): ThemeNode dropdown(attrs: ThemeAttrs & { label: ThemeText; ariaLabel?: ThemeText; value: ThemeText; options: keyof S["paths"] & string | keyof S["lists"] & string; displayValue?: ThemeText; on: ThemeEvent<"pick"> }): ThemeNode slot(name: Slot): ThemeNode slot(contract: Contract, options: { from: ThemeFrom }): ThemeNode each(of: L, build: (item: ThemeBuilders) => ThemeNode | readonly ThemeNode[], options?: { as?: string; key?: keyof S["lists"][L]["paths"] & string }): ThemeNode when(test: ThemeCond, then: ThemeNode | readonly ThemeNode[], otherwise?: ThemeNode | readonly ThemeNode[]): ThemeNode interface ThemeAttrs: class?: HostClass | string | readonly (HostClass | string)[]; classWhen?: { readonly [name: string]: ThemeCond } | readonly { class: string; if: ThemeCond }[]; part?: Part; role?: ThemeRole; aria?: { busy?: ThemeText; live?: "polite" | "assertive" | "off"; label?: ThemeText; pressed?: ThemeText; expanded?: ThemeText; current?: ThemeText; describedby?: ThemeText }; hidden?: ThemeCond; inert?: ThemeCond; data?: { readonly [name: string]: ThemeText }; vars?: { readonly [K in CssVar | `--tpl-${string}`]?: ThemeText } interface ThemeLayout: gap?: ThemeStep; pad?: ThemeStep; align?: "start" | "center" | "end" | "stretch" | "baseline"; justify?: "start" | "center" | "end" | "between" | "around" | "evenly"; wrap?: boolean; grow?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; focusable?: boolean (extends ThemeAttrs) interface ThemeContainerAttrs: as?: ThemeContainerTag (extends ThemeLayout) grid attrs += { columns?: readonly string[]; rows?: readonly string[] } scroll attrs += { axis?: "y" | "x" | "both" } spacer attrs += { size?: ThemeStep } text attrs += { as?: ThemeTextTag; tween?: boolean; letters?: boolean; scramble?: boolean } icon attrs += { size?: number } image attrs += { alt: ThemeText; fit?: "cover" | "contain" } button attrs += { variant?: "primary" | "plain" | "quiet"; label?: ThemeText; disabled?: ThemeCond; pressed?: ThemeCond; describedBy?: Part; on: ThemeEvent<"press"> } toggle attrs += { label: ThemeText; checked: ThemeCond; on: ThemeEvent<"change"> } meter attrs += { value: ThemeText; min?: number; max?: number; label: ThemeText } dropdown attrs += { label: ThemeText; ariaLabel?: ThemeText; value: ThemeText; options: keyof S["paths"] & string | keyof S["lists"] & string; displayValue?: ThemeText; on: ThemeEvent<"pick"> } context (c): bind

>(path: P): ThemeValue field

(path: P): ThemeFieldOf t(key: string, args?: { readonly [name: string]: ThemeText }): ThemeValue on: ThemeOn fmt: ThemeFmt on.press(output: O, ...args: ThemeArgs): ThemeEvent<"press"> on.change(output: O, ...args: ThemeArgs>): ThemeEvent<"change"> on.pick(output: O, ...args: ThemeArgs>): ThemeEvent<"pick"> fmt.rate(path: ThemeNumeric, digits?: 0 | 1 | 2 | 3 | 4 | 5 | 6): ThemeValue fmt.count(path: ThemeNumeric, digits?: 0 | 1 | 2 | 3 | 4 | 5 | 6): ThemeValue fmt.percent(path: ThemeNumeric, digits?: 0 | 1 | 2 | 3 | 4 | 5 | 6): ThemeValue fmt.duration(path: ThemeNumeric, digits?: 0 | 1 | 2 | 3 | 4 | 5 | 6): ThemeValue fmt.fixed(path: ThemeNumeric, digits?: 0 | 1 | 2 | 3 | 4 | 5 | 6): ThemeValue field(path).truthy(): ThemeCond field(path).falsy(): ThemeCond field(path).eq(value: T): ThemeCond field(path).ne(value: T): ThemeCond field(path).in(values: readonly T[]): ThemeCond field(path).gt(value: number): ThemeCond field(path).ge(value: number): ThemeCond field(path).lt(value: number): ThemeCond field(path).le(value: number): ThemeCond cond.and(...others: ThemeCond[]): ThemeCond cond.or(...others: ThemeCond[]): ThemeCond cond.not(): ThemeCond role: group|region|toolbar|tablist|tabpanel|status|search|list|listitem|navigation|none|presentation|img gap|pad|size: 0|1|2|3|4|5|6|7|8|9|10 (--pv-s) as (containers): div|section|header|footer|nav|aside|main|article|ul|li as (text): span|p|h1|h2|h3|strong|em|label|small icon: any lucide name (lucide.dev/icons), e.g. a-arrow-down|a-arrow-up|a-large-small|accessibility|activity|air-vent data-* names refused: part contract state direction gap align justify wrap grow pad size axis variant kind slot limits: depth<=24; nodes<=1500/theme; templates<=64; text<=200 chars; children<=64; classes<=8; data+vars entries<=8; grid tracks<=12 script: <=500ms, 16 MiB heap, source<=128 KiB, <=4000 nodes built, JSON<=1 MiB; runs once; no function, NaN or cycle in the result ``` ## Liste autorisée du CSS Les sélecteurs, règles @, propriétés et formes de valeurs que `theme.css` accepte. - **Limits**: file <= 256 KiB; <= 2048 rules (style rules + keyframe steps); <= 40 declarations per rule; <= 200 words/numbers per value; functions nest <= 5; strings <= 80 chars (no `\`); class, keyframes name <= 40 chars (a-z 0-9 -, start with a letter); data-name <= 24, data value <= 40; no `!important`, no nesting, comments allowed. - **Selectors**: `.class` first (compound `.a.b`), `[data-x]`, `[data-x="v"]`; `:hover` `:focus-visible` `:focus-within` `:active` `:disabled` `:first-child` `:last-child`; `:not(.a)` `:is(.a)` `:where(.a)` (classes only, not nested); `::before` `::after` (once, last, with `content`); combinators: descendant, `>`; comma lists. Refused: elements, `*`, `#id`, `+`, `~`, `&`. - **At-rules**: `@keyframes` `@media` only. `@media (: )` <= 2 joined by `and`; features `max-width` `min-width` `max-height` `min-height` `prefers-reduced-motion` (px 1..10000; reduced-motion reduce|no-preference); style rules only inside. `@keyframes name` steps `from`|`to`|`n%`, <= 24; every animation name must be defined in the file. - **Values**: length px|em|rem|vw|vh|vmin|vmax|ch or 0 (|n| <= 10000); % (<= 10000); number (<= 100000); angle deg|turn|rad (<= 3600); time s|ms (<= 60000); fr (<= 1000); "string"; colour #rgb|#rgba|#rrggbb|#rrggbbaa; `url("images/")` of a picture the theme has; plain words are accepted unless the property is a closed list; `var(--x[, fallback])` anywhere. - **Properties** (any other property is refused; `*` = every property with that prefix): length: letter-spacing word-spacing; length+color: box-shadow text-shadow; length+number+color: outline, outline-*; length+percentage: background-* bottom column-gap flex-basis gap height inset left margin, margin-* mask-position mask-size max-height max-width min-height min-width object-position padding, padding-* right row-gap top transform-origin width; length+percentage+number: flex font-* line-height; length+percentage+number+color: border, border-* (except border-image*) text-*; length+percentage+number+color+angle+url+gradient: background; length+percentage+number+fraction+string+grid: grid, grid-*; length+percentage+number+string: font; percentage+number: opacity; number: aspect-ratio flex-grow flex-shrink order; number+time+easing: animation-* transition, transition-*; color: background-color color; string: content font-family; url+gradient: background-image mask-image; transform: transform; filter+backdrop: filter; backdrop: backdrop-filter; shape: clip-path; words: align-* flex-direction flex-flow flex-wrap justify-* overflow-wrap place-* white-space word-break. - **Closed words**: cursor: auto|default|pointer|text|move|not-allowed|grab|grabbing|wait|help|crosshair|progress|zoom-in|zoom-out|none; display: flex|grid|block|none|inline-flex|inline-block|inline|inline-grid|contents; mask-repeat: repeat|no-repeat|repeat-x|repeat-y|round|space; mix-blend-mode: normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity|plus-lighter; object-fit: fill|contain|cover|none|scale-down; overflow: visible|hidden|auto|scroll|clip; overflow-x: visible|hidden|auto|scroll|clip; overflow-y: visible|hidden|auto|scroll|clip; pointer-events: auto|none; position: static|relative|absolute|sticky; visibility: visible|hidden|collapse; writing-mode: horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr; z-index: integer -50..50|auto; content: string (no attr(), counters). - **Functions**: backdrop: blur saturate; color: rgb rgba hsl hsla hwb color-mix; easing: cubic-bezier steps; filter: blur brightness contrast drop-shadow grayscale hue-rotate saturate sepia; gradient: linear-gradient repeating-linear-gradient radial-gradient repeating-radial-gradient conic-gradient repeating-conic-gradient; grid: repeat minmax fit-content; math: calc min max clamp var; shape: polygon inset; transform: translate translatex translatey translatez translate3d scale scalex scaley scale3d rotate rotatex rotatey rotatez skew skewx skewy. - **Variables**: `--tpl-` (<= 32 chars, any value); design tokens of kind case|clip|color|duration|easing|filter|font|length|opacity|ratio|shadow|weight (subtree only; the other kinds and --pv-art-filter stay in tokens.css); plate variables --plate --edge --clip --clip-edge. Class names become `.tpl--name` and every rule is scoped under `[data-direction=""]`.