run trunk fmt

This commit is contained in:
Georges-Antoine Assi
2025-11-21 11:26:56 -05:00
parent 4a43c26e90
commit 4b753945d4
9 changed files with 169 additions and 127 deletions

View File

@@ -7,6 +7,7 @@ import {
useTemplateRef,
watch,
} from "vue";
import { useI18n } from "vue-i18n";
import {
collectionElementRegistry,
smartCollectionElementRegistry,
@@ -19,7 +20,6 @@ import {
getFavoriteCoverImage,
EXTENSION_REGEX,
} from "@/utils/covers";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const props = defineProps<{

View File

@@ -1,9 +1,9 @@
<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref } from "vue";
import { useI18n } from "vue-i18n";
import ArrowKeysIcon from "./icons/ArrowKeysIcon.vue";
import DPadIcon from "./icons/DPadIcon.vue";
import FaceButtons from "./icons/FaceButtons.vue";
import { useI18n } from "vue-i18n";
interface Props {
showNavigation?: boolean;
@@ -85,54 +85,78 @@ onUnmounted(() => {
<template v-if="hasController">
<div v-if="showNavigation" class="flex items-center gap-2">
<DPadIcon class="w-8 h-8 opacity-80" :modal="isModal" />
<span class="font-medium tracking-wide">{{ t('console.nav-navigation') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-navigation")
}}</span>
</div>
<div v-if="showSelect" class="flex items-center gap-2">
<FaceButtons highlight="south" :modal="isModal" />
<span class="font-medium tracking-wide">{{ t('console.nav-select') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-select")
}}</span>
</div>
<div v-if="showBack" class="flex items-center gap-2">
<FaceButtons highlight="east" :modal="isModal" />
<span class="font-medium tracking-wide">{{ t('console.nav-back') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-back")
}}</span>
</div>
<div v-if="showToggleFavorite" class="flex items-center gap-2">
<FaceButtons highlight="north" :modal="isModal" />
<span class="font-medium tracking-wide">{{ t('console.nav-favorite') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-favorite")
}}</span>
</div>
<div v-if="showMenu" class="flex items-center gap-2">
<FaceButtons highlight="west" :modal="isModal" />
<span class="font-medium tracking-wide">{{ t('console.nav-menu') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-menu")
}}</span>
</div>
<div v-if="showDelete" class="flex items-center gap-2">
<FaceButtons highlight="west" :modal="isModal" />
<span class="font-medium tracking-wide">{{ t('console.nav-delete') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-delete")
}}</span>
</div>
</template>
<!-- Keyboard Mode -->
<template v-else>
<div v-if="showNavigation" class="flex items-center gap-2">
<ArrowKeysIcon :modal="isModal" />
<span class="font-medium tracking-wide">{{ t('console.nav-navigation') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-navigation")
}}</span>
</div>
<div v-if="showSelect" class="flex items-center gap-2">
<span class="keycap" :style="keycapStyles">Enter</span>
<span class="font-medium tracking-wide">{{ t('console.nav-select') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-select")
}}</span>
</div>
<div v-if="showBack" class="flex items-center gap-2">
<span class="keycap" :style="keycapStyles">Bkspc</span>
<span class="font-medium tracking-wide">{{ t('console.nav-back') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-back")
}}</span>
</div>
<div v-if="showToggleFavorite" class="flex items-center gap-2">
<span class="keycap" :style="keycapStyles">F</span>
<span class="font-medium tracking-wide">{{ t('console.nav-favorite') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-favorite")
}}</span>
</div>
<div v-if="showMenu" class="flex items-center gap-2">
<span class="keycap" :style="keycapStyles">X</span>
<span class="font-medium tracking-wide">{{ t('console.nav-menu') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-menu")
}}</span>
</div>
<div v-if="showDelete" class="flex items-center gap-2">
<span class="keycap" :style="keycapStyles">X</span>
<span class="font-medium tracking-wide">{{ t('console.nav-delete') }}</span>
<span class="font-medium tracking-wide">{{
t("console.nav-delete")
}}</span>
</div>
</template>
</div>

View File

@@ -1,11 +1,11 @@
<script setup lang="ts">
import { ref, computed, onMounted, onUnmounted } from "vue";
import { useI18n } from "vue-i18n";
import NavigationText from "@/console/components/NavigationText.vue";
import { useConsoleTheme } from "@/console/composables/useConsoleTheme";
import { useInputScope } from "@/console/composables/useInputScope";
import type { InputAction } from "@/console/input/actions";
import { getSfxEnabled, setSfxEnabled } from "@/console/utils/sfx";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const props = defineProps<{
@@ -21,8 +21,8 @@ const { subscribe } = useInputScope();
const selectedOption = ref(0);
const options = computed(() => [
{ label: t('console.theme'), type: "theme" as const },
{ label: t('console.sound-effects'), type: "sfx" as const },
{ label: t("console.theme"), type: "theme" as const },
{ label: t("console.sound-effects"), type: "sfx" as const },
]);
const themeOptions = [
@@ -58,7 +58,8 @@ function handleAction(action: InputAction): boolean {
return true;
case "moveUp":
selectedOption.value =
(selectedOption.value - 1 + options.value.length) % options.value.length;
(selectedOption.value - 1 + options.value.length) %
options.value.length;
return true;
case "moveDown":
selectedOption.value = (selectedOption.value + 1) % options.value.length;
@@ -118,7 +119,7 @@ function getCurrentThemeLabel(): string {
<template #default>
<div class="lightbox-header">
<h2 class="text-h6" :style="{ color: 'var(--console-modal-text)' }">
{{ t('console.console-settings') }}
{{ t("console.console-settings") }}
</h2>
<v-btn
icon="mdi-close"
@@ -152,7 +153,7 @@ function getCurrentThemeLabel(): string {
<div class="sfx-toggle">
<span class="sfx-indicator"></span>
<span class="sfx-status">{{
sfxEnabled ? t('console.enabled') : t('console.disabled')
sfxEnabled ? t("console.enabled") : t("console.disabled")
}}</span>
<span class="sfx-indicator"></span>
</div>

View File

@@ -1,11 +1,11 @@
<script setup lang="ts">
import { computed, onMounted, useTemplateRef } from "vue";
import { useI18n } from "vue-i18n";
import FallbackSystemCard from "@/console/components/FallbackSystemCard.vue";
import { systemElementRegistry } from "@/console/composables/useElementRegistry";
import { useThemeAssets } from "@/console/composables/useThemeAssets";
import { getPlatformTheme } from "@/console/constants/platforms";
import type { Platform } from "@/stores/platforms";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const props = defineProps<{

View File

@@ -9,6 +9,7 @@ import {
nextTick,
useTemplateRef,
} from "vue";
import { useI18n } from "vue-i18n";
import { useRoute, useRouter } from "vue-router";
import type { DetailedRomSchema } from "@/__generated__/models/DetailedRomSchema";
import BackButton from "@/console/components/BackButton.vue";
@@ -28,7 +29,6 @@ import {
getUnmatchedCoverImage,
EXTENSION_REGEX,
} from "@/utils/covers";
import { useI18n } from "vue-i18n";
type FocusZone =
| "play"
@@ -634,7 +634,7 @@ onUnmounted(() => {
@click="play()"
>
<span class="text-lg md:text-xl"></span>
{{ t('console.game-play') }}
{{ t("console.game-play") }}
</button>
<button
class="px-5 md:px-6 py-3 md:py-4 rounded-lg font-semibold transition-all"
@@ -651,7 +651,7 @@ onUnmounted(() => {
}"
@click="openDetails()"
>
{{ t('console.game-detail') }}
{{ t("console.game-detail") }}
</button>
</div>
@@ -660,7 +660,7 @@ onUnmounted(() => {
class="text-[10px] uppercase tracking-wider font-semibold mb-2"
:style="{ color: 'var(--console-game-section-header)' }"
>
{{ t('console.save-states') }}
{{ t("console.save-states") }}
</h3>
<div
ref="save-states-ref"
@@ -734,7 +734,7 @@ onUnmounted(() => {
class="text-xs md:text-sm font-semibold uppercase tracking-wide"
:style="{ color: 'var(--console-game-section-header)' }"
>
{{ t('console.screenshots') }}
{{ t("console.screenshots") }}
</h3>
<div
ref="screenshots-ref"
@@ -852,7 +852,7 @@ onUnmounted(() => {
<template #default>
<div class="lightbox-header">
<h2 class="text-h6" :style="{ color: 'var(--console-modal-text)' }">
{{ t('console.game-detail') }}
{{ t("console.game-detail") }}
</h2>
<v-btn
icon="mdi-close"
@@ -960,7 +960,7 @@ onUnmounted(() => {
class="text-xs font-semibold mb-1 uppercase tracking-wide"
:style="{ color: 'var(--console-modal-text-secondary)' }"
>
{{ t('console.detail-size') }}
{{ t("console.detail-size") }}
</div>
<div
class="text-sm md:text-base leading-6 break-words"
@@ -981,7 +981,7 @@ onUnmounted(() => {
class="text-xs font-semibold mb-1 uppercase tracking-wide"
:style="{ color: 'var(--console-modal-text-secondary)' }"
>
{{ t('console.detail-file') }}
{{ t("console.detail-file") }}
</div>
<div
class="text-sm md:text-base leading-6 break-words"

View File

@@ -9,8 +9,8 @@ import {
useTemplateRef,
onBeforeMount,
} from "vue";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import RIsotipo from "@/components/common/RIsotipo.vue";
import useFavoriteToggle from "@/composables/useFavoriteToggle";
import CollectionCard from "@/console/components/CollectionCard.vue";
@@ -714,7 +714,7 @@ onUnmounted(() => {
class="font-bold text-[28px] drop-shadow-xl"
:style="{ color: 'var(--console-home-title-text)' }"
>
{{ t('console.console') }}
{{ t("console.console") }}
</div>
</div>
@@ -723,7 +723,7 @@ onUnmounted(() => {
class="text-center mt-16"
:style="{ color: 'var(--console-loading-text)' }"
>
{{ t('console.loading-platforms') }}
{{ t("console.loading-platforms") }}
</div>
<div
v-else-if="errorMessage"
@@ -738,7 +738,7 @@ onUnmounted(() => {
class="text-xl font-bold text-fg0 mb-3 drop-shadow pl-8 pr-8"
:style="{ color: 'var(--console-home-category-text)' }"
>
{{ t('console.platforms') }}
{{ t("console.platforms") }}
</h2>
<div class="relative h-[220px]">
<button
@@ -794,7 +794,7 @@ onUnmounted(() => {
class="text-xl font-bold text-fg0 mb-3 drop-shadow pl-8 pr-8"
:style="{ color: 'var(--console-home-category-text)' }"
>
{{ t('console.recently-played') }}
{{ t("console.recently-played") }}
</h2>
<div class="relative h-[400px]">
<button
@@ -855,7 +855,7 @@ onUnmounted(() => {
class="text-xl font-bold text-fg0 mb-3 drop-shadow pl-8 pr-8"
:style="{ color: 'var(--console-home-category-text)' }"
>
{{ t('console.collections') }}
{{ t("console.collections") }}
</h2>
<div class="relative h-[400px]">
<button
@@ -914,7 +914,7 @@ onUnmounted(() => {
class="text-xl font-bold text-fg0 mb-3 drop-shadow pl-8 pr-8"
:style="{ color: 'var(--console-home-category-text)' }"
>
{{ t('console.smart-collections') }}
{{ t("console.smart-collections") }}
</h2>
<div class="relative h-[400px]">
<button
@@ -974,7 +974,7 @@ onUnmounted(() => {
class="text-xl font-bold text-fg0 mb-3 drop-shadow pl-8 pr-8"
:style="{ color: 'var(--console-home-category-text)' }"
>
{{ t('console.virtual-collections') }}
{{ t("console.virtual-collections") }}
</h2>
<div class="relative h-[400px]">
<button

View File

@@ -1,7 +1,15 @@
<script setup lang="ts">
import { useLocalStorage } from "@vueuse/core";
import { storeToRefs } from "pinia";
import { computed, onMounted, onBeforeUnmount, ref, watch, nextTick } from "vue";
import {
computed,
onMounted,
onBeforeUnmount,
ref,
watch,
nextTick,
} from "vue";
import { useI18n } from "vue-i18n";
import { useRoute, useRouter } from "vue-router";
import type { DetailedRomSchema } from "@/__generated__/models/DetailedRomSchema";
import NavigationText from "@/console/components/NavigationText.vue";
@@ -19,7 +27,6 @@ import {
areThreadsRequiredForEJSCore,
getDownloadPath,
} from "@/utils";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const createPlayerStorage = (romId: number, platformSlug: string) => ({
@@ -63,13 +70,21 @@ const loaderStatus = ref<
let pausedByPrompt = false;
const exitOptions = computed(() => [
{ id: "save", label: t('console.game-exit-save'), desc: t('console.game-exit-save-desc') },
{
id: "save",
label: t("console.game-exit-save"),
desc: t("console.game-exit-save-desc"),
},
{
id: "nosave",
label: t('console.game-exit-nosave'),
desc: t('console.game-exit-nosave-desc'),
label: t("console.game-exit-nosave"),
desc: t("console.game-exit-nosave-desc"),
},
{
id: "cancel",
label: t("console.game-exit-cancel"),
desc: t("console.game-exit-cancel-desc"),
},
{ id: "cancel", label: t('console.game-exit-cancel'), desc: t('console.game-exit-cancel-desc') },
]);
const { subscribe } = useInputScope();
@@ -701,7 +716,9 @@ onBeforeUnmount(() => {
{{ t("console.emulator-cdn") }}
</template>
<template v-else-if="loaderStatus === 'failed'">
<div class="text-red-300 font-medium">{{ t("console.emulator-failed") }}</div>
<div class="text-red-300 font-medium">
{{ t("console.emulator-failed") }}
</div>
<div class="mt-1 text-[11px] max-w-xs leading-snug break-words">
{{ loaderError }}
</div>
@@ -739,7 +756,7 @@ onBeforeUnmount(() => {
:style="{ color: 'var(--console-modal-text)' }"
class="text-xl font-bold tracking-wide drop-shadow"
>
{{ t('console.game-exit') }}
{{ t("console.game-exit") }}
</h2>
<button
:disabled="savingState"

View File

@@ -1,43 +1,43 @@
{
"collections": "Kolekce",
"console": "Konzole",
"console-settings": "Nastavení konzole",
"default": "Výchozí",
"detail-file": "Soubor",
"detail-size": "Velikost souboru",
"disabled": "Zakázáno",
"emulator-cdn": "Načítání emulátoru (CDN)…",
"emulator-failed": "Nepodařilo se načíst emulátor",
"emulator-loading": "Načítání emulátoru…",
"enabled": "Povoleno",
"exit-console-mode": "Ukončit režim konzole",
"exit-game": "Stiskni Start + Select (nebo Backspace) pro ukončení",
"fullscreen": "Celá obrazovka",
"game-detail": "Detaily",
"game-exit": "Ukončit hru",
"game-exit-cancel": "Zrušit",
"game-exit-cancel-desc": "Vrátit se zpět do hry",
"game-exit-nosave": "Ukončit bez uložení",
"game-exit-nosave-desc": "Okamžitě ukončí, postup od posledního uložení bude ztracen",
"game-exit-save": "Uložit a ukončit",
"game-exit-save-desc": "Uloží aktuální stav a ukončí hru",
"game-play": "Hrát",
"game-saving": "UKLÁDÁM…",
"games-n": "{n} her | {n} hra | {n} hry | {n} her",
"loading-platforms": "Načítání platforem…",
"nav-back": "Zpět",
"nav-delete": "Smazat",
"nav-favorite": "Oblíbené",
"nav-menu": "Menu",
"nav-navigation": "Navigace",
"nav-select": "Vybrat",
"platforms": "Platformy",
"recently-played": "Nedávno hrané",
"save-states": "ULOŽENÉ STAVY",
"screenshots": "Snímky obrazovky",
"settings": "Nastavení",
"smart-collections": "Chytré kolekce",
"sound-effects": "Zvukové efekty",
"theme": "Téma",
"virtual-collections": "Automaticky vytvořené kolekce"
"collections": "Kolekce",
"console": "Konzole",
"console-settings": "Nastavení konzole",
"default": "Výchozí",
"detail-file": "Soubor",
"detail-size": "Velikost souboru",
"disabled": "Zakázáno",
"emulator-cdn": "Načítání emulátoru (CDN)…",
"emulator-failed": "Nepodařilo se načíst emulátor",
"emulator-loading": "Načítání emulátoru…",
"enabled": "Povoleno",
"exit-console-mode": "Ukončit režim konzole",
"exit-game": "Stiskni Start + Select (nebo Backspace) pro ukončení",
"fullscreen": "Celá obrazovka",
"game-detail": "Detaily",
"game-exit": "Ukončit hru",
"game-exit-cancel": "Zrušit",
"game-exit-cancel-desc": "Vrátit se zpět do hry",
"game-exit-nosave": "Ukončit bez uložení",
"game-exit-nosave-desc": "Okamžitě ukončí, postup od posledního uložení bude ztracen",
"game-exit-save": "Uložit a ukončit",
"game-exit-save-desc": "Uloží aktuální stav a ukončí hru",
"game-play": "Hrát",
"game-saving": "UKLÁDÁM…",
"games-n": "{n} her | {n} hra | {n} hry | {n} her",
"loading-platforms": "Načítání platforem…",
"nav-back": "Zpět",
"nav-delete": "Smazat",
"nav-favorite": "Oblíbené",
"nav-menu": "Menu",
"nav-navigation": "Navigace",
"nav-select": "Vybrat",
"platforms": "Platformy",
"recently-played": "Nedávno hrané",
"save-states": "ULOŽENÉ STAVY",
"screenshots": "Snímky obrazovky",
"settings": "Nastavení",
"smart-collections": "Chytré kolekce",
"sound-effects": "Zvukové efekty",
"theme": "Téma",
"virtual-collections": "Automaticky vytvořené kolekce"
}

View File

@@ -1,43 +1,43 @@
{
"collections": "Collections",
"console": "Console",
"console-settings": "Console Settings",
"default": "Default",
"detail-file": "File",
"detail-size": "File Size",
"disabled": "Disabled",
"emulator-cdn": "Loading emulator (CDN)…",
"emulator-failed": "Failed to load emulator",
"emulator-loading": "Loading emulator…",
"enabled": "Enabled",
"exit-console-mode": "Exit Console Mode",
"exit-game": "Press Start + Select (or Backspace) to exit",
"fullscreen": "Fullscreen",
"game-detail": "Details",
"game-exit": "Exit Game",
"game-exit-cancel": "Cancel",
"game-exit-cancel-desc": "Return to the game",
"game-exit-nosave": "Exit Without Saving",
"game-exit-nosave-desc": "Leave immediately, progress since last save state is lost",
"game-exit-save": "Save & Exit",
"game-exit-save-desc": "Save current state, then quit",
"game-play": "Play",
"game-saving": "SAVING…",
"games-n": "{n} game | {n} games",
"loading-platforms": "Loading Platforms…",
"nav-back": "Back",
"nav-delete": "Delete",
"nav-favorite": "Favorite",
"nav-menu": "Menu",
"nav-navigation": "Navigation",
"nav-select": "Select",
"platforms": "Platforms",
"recently-played": "Recently Played",
"save-states": "SAVE STATES",
"screenshots": "Screenshots",
"settings": "Settings",
"smart-collections": "Smart Collections",
"sound-effects": "Sound Effects",
"theme": "Theme",
"virtual-collections": "Autogenerated Collections"
"collections": "Collections",
"console": "Console",
"console-settings": "Console Settings",
"default": "Default",
"detail-file": "File",
"detail-size": "File Size",
"disabled": "Disabled",
"emulator-cdn": "Loading emulator (CDN)…",
"emulator-failed": "Failed to load emulator",
"emulator-loading": "Loading emulator…",
"enabled": "Enabled",
"exit-console-mode": "Exit Console Mode",
"exit-game": "Press Start + Select (or Backspace) to exit",
"fullscreen": "Fullscreen",
"game-detail": "Details",
"game-exit": "Exit Game",
"game-exit-cancel": "Cancel",
"game-exit-cancel-desc": "Return to the game",
"game-exit-nosave": "Exit Without Saving",
"game-exit-nosave-desc": "Leave immediately, progress since last save state is lost",
"game-exit-save": "Save & Exit",
"game-exit-save-desc": "Save current state, then quit",
"game-play": "Play",
"game-saving": "SAVING…",
"games-n": "{n} game | {n} games",
"loading-platforms": "Loading Platforms…",
"nav-back": "Back",
"nav-delete": "Delete",
"nav-favorite": "Favorite",
"nav-menu": "Menu",
"nav-navigation": "Navigation",
"nav-select": "Select",
"platforms": "Platforms",
"recently-played": "Recently Played",
"save-states": "SAVE STATES",
"screenshots": "Screenshots",
"settings": "Settings",
"smart-collections": "Smart Collections",
"sound-effects": "Sound Effects",
"theme": "Theme",
"virtual-collections": "Autogenerated Collections"
}