diff --git a/.github/actions/clippy/src/index.ts b/.github/actions/clippy/src/index.ts index 457cab89..2d4815da 100644 --- a/.github/actions/clippy/src/index.ts +++ b/.github/actions/clippy/src/index.ts @@ -1,11 +1,11 @@ -import { tmpdir as getTmpdir } from 'node:os'; -import { promises as fs } from 'node:fs'; -import { env, cwd as getCwd } from 'node:process'; import { Buffer } from 'node:buffer'; -import { join, relative } from 'pathe'; -import { rmRF } from '@actions/io'; -import { exec } from '@actions/exec'; +import { promises as fs } from 'node:fs'; +import { tmpdir as getTmpdir } from 'node:os'; +import { env, cwd as getCwd } from 'node:process'; import { getInput as getCoreInput, group } from '@actions/core'; +import { exec } from '@actions/exec'; +import { rmRF } from '@actions/io'; +import { join, relative } from 'pathe'; import { installReviewdog } from './installer'; const getInput = (name: string): T => getCoreInput(name) as T; diff --git a/.github/actions/clippy/src/installer.ts b/.github/actions/clippy/src/installer.ts index 4cf49fee..d0fc0918 100644 --- a/.github/actions/clippy/src/installer.ts +++ b/.github/actions/clippy/src/installer.ts @@ -1,7 +1,7 @@ import { arch as getArch, platform as getPlatform } from 'node:process'; -import { join } from 'pathe'; import { Headers, HttpClient, HttpCodes } from '@actions/http-client'; import { downloadTool, extractTar } from '@actions/tool-cache'; +import { join } from 'pathe'; const getUrl = (version: string, platform: string, arch: string) => `https://github.com/reviewdog/reviewdog/releases/download/v${version}/reviewdog_${version}_${platform}_${arch}.tar.gz`; diff --git a/Cargo.lock b/Cargo.lock index 4e78e6dc..a85a4422 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3077,6 +3077,15 @@ dependencies = [ "cfb", ] +[[package]] +name = "infer" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc150e5ce2330295b8616ce0e3f53250e53af31759a9dbedad1621ba29151847" +dependencies = [ + "cfb", +] + [[package]] name = "inotify" version = "0.9.6" @@ -7208,9 +7217,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.0.0-rc.3" +version = "2.0.0-rc.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79776954e2cd6b6c3b56e2cd99905a3a166017495a39ac8eb4c85dd8ea8704b4" +checksum = "e8345ccc676ef16e26b61fc0f5340b4e770678b1e1f53f08c69ebdac5e56b422" dependencies = [ "anyhow", "bytes", @@ -7252,7 +7261,7 @@ dependencies = [ "tracing", "tray-icon", "url", - "urlpattern", + "urlpattern 0.2.0", "uuid 1.10.0", "webkit2gtk", "webview2-com", @@ -7262,9 +7271,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.0-rc.7" +version = "2.0.0-rc.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5ad5fcfaf02cf79aa6727f6c5df38567d8dce172b00b62690c6bc46c08b7ce" +checksum = "4acec578ff9de14da177722c8fb5e3d6c88af296696190c70b83bec91437248a" dependencies = [ "anyhow", "cargo_toml", @@ -7285,9 +7294,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-rc.7" +version = "2.0.0-rc.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809ef6316726fc72593d296cf6f4e7461326e310c313d6a6c42b6e7f1e2671cf" +checksum = "467d3e95b57c860bea13b7c812820d9e7425e4b700e5e69b358d906f22022007" dependencies = [ "base64 0.22.1", "brotli", @@ -7343,9 +7352,9 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.0.0-rc.1" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6719e5f3fcc6c6f5afda68da944a44a50c28f30a3506c457ea7dbcc13377bfe0" +checksum = "4a9d78deb78704d9eeedc23892fc6b25a944c7f9c59354a0ea9a4fb5ab043794" dependencies = [ "arboard", "image 0.24.9", @@ -7359,9 +7368,9 @@ dependencies = [ [[package]] name = "tauri-plugin-deep-link" -version = "2.0.0-rc.1" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c8e169df47aa4892184c812cc9753a486328835d38d2269a4b062179698a242" +checksum = "694ba1e772040fcc3728ad16744ae851059e09394e3bc33353d80d9a945cf974" dependencies = [ "dunce", "log", @@ -7379,9 +7388,9 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.0.0-rc.1" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf99017391fdc40b6c8ae0dae8d970cc8151a8177d48b8805f320f52cac0e3c" +checksum = "aa8bd381f75c47687f41fb603f67fdd99a1af377da22d03d8fb959d2481845c1" dependencies = [ "dunce", "log", @@ -7393,13 +7402,14 @@ dependencies = [ "tauri-plugin", "tauri-plugin-fs", "thiserror", + "url", ] [[package]] name = "tauri-plugin-fs" -version = "2.0.0-rc.0" +version = "2.0.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5df6b25b1f2b7b61565e66c4dbee9eb39e5635d2a763206e380e07cc3f601a67" +checksum = "0704205734f3b4f37d7bf9e9072537716371741bf98b22a22cc5e5340e512467" dependencies = [ "anyhow", "glob", @@ -7416,9 +7426,9 @@ dependencies = [ [[package]] name = "tauri-plugin-shell" -version = "2.0.0-rc.1" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2133e5c6fe2ae0263ff5920feed477d3b1413f89033f537966831b0cb6f61f8e" +checksum = "e83800ddf78b820172efb5ed7310344e8e4f97fd30cd8237a3f20c12a79eb136" dependencies = [ "encoding_rs", "log", @@ -7437,31 +7447,31 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" -version = "2.0.0-rc.0" +version = "2.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de552151b4c9ba9ff72c7244dccaadd47f88d1f0d5caa2603c5c1c12b7636edc" +checksum = "d73c92c98d44d4daba0118d905f45243dfcd6eaac82216c3382a02d17cb74cf2" dependencies = [ "log", "serde", "serde_json", "tauri", "thiserror", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "zbus", ] [[package]] name = "tauri-plugin-updater" -version = "2.0.0-rc.1" +version = "2.0.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dfd104b50e1c17998fc131edd21ced948a9605bac7eb6827f94e099a644f924" +checksum = "f7048854b4271f3bc58ee850f0582f8d9bb0190118afa8397f36fc260daaa68b" dependencies = [ "base64 0.22.1", "dirs 5.0.1", "flate2", "futures-util", "http 1.1.0", - "infer", + "infer 0.15.0", "minisign-verify", "reqwest 0.12.7", "semver", @@ -7481,9 +7491,9 @@ dependencies = [ [[package]] name = "tauri-plugin-window-state" -version = "2.0.0-rc.1" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6839228cbd225b95681c766cc51113e9dad62c4b3f6ebb102234413ba85ee2" +checksum = "303569dd7858361d4c623845448b136b4c95d53b5d2bde6630bea9d7f0022d45" dependencies = [ "bitflags 2.6.0", "log", @@ -7540,9 +7550,9 @@ dependencies = [ [[package]] name = "tauri-specta" -version = "2.0.0-rc.17" +version = "2.0.0-rc.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b37d5f9a690f0c5264e5461a2cd9a273565f9a12acf642692a16ea292e32f6b" +checksum = "c2d58f5067f811ac923825ed15a95baa76313891ddc9ccfe28e4526e86477347" dependencies = [ "heck 0.5.0", "serde", @@ -7569,9 +7579,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.0-rc.7" +version = "2.0.0-rc.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53d9fe87e985b273696ae22ce2b9f099a8f1b44bc8fb127467bda5fcb3e4371" +checksum = "6746b87c4755f493b94920622e245aef2d771f001ddeffc203e315872d323e1c" dependencies = [ "aes-gcm", "brotli", @@ -7581,7 +7591,7 @@ dependencies = [ "getrandom 0.2.15", "glob", "html5ever", - "infer", + "infer 0.16.0", "json-patch", "kuchikiki", "log", @@ -7601,7 +7611,7 @@ dependencies = [ "thiserror", "toml 0.8.2", "url", - "urlpattern", + "urlpattern 0.3.0", "walkdir", ] @@ -8043,9 +8053,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0aeee1ab20514132ef14bf3f4725f39246e82fd4866f7bbd209c36907be44e3" +checksum = "131a65b2cef2081bc14dbcd414c906edbfa3bb5323dd7e748cc298614681196b" dependencies = [ "core-graphics 0.24.0", "crossbeam-channel", @@ -8280,6 +8290,18 @@ dependencies = [ "url", ] +[[package]] +name = "urlpattern" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" +dependencies = [ + "regex", + "serde", + "unic-ucd-ident", + "url", +] + [[package]] name = "user-facing-error-macros" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 40bac067..29e98b52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ onelauncher_prisma_cli = { path = "./packages/prisma-cli" } # # ============= TAURI ============= # # # tauri uses latest crates.io rc channel -tauri = { version = "=2.0.0-rc.3", features = [ +tauri = { version = "=2.0.0-rc.8", features = [ "rustls-tls", "tracing", "specta", @@ -43,21 +43,21 @@ tauri = { version = "=2.0.0-rc.3", features = [ ] } # tauri-build is the codegen utility for our tauri buildscript. -tauri-build = { version = "=2.0.0-rc.7" } +tauri-build = { version = "=2.0.0-rc.8" } # tauri-plugin-shell adds a bridge for opening urls and paths in the frontend. -tauri-plugin-shell = { version = "=2.0.0-rc.1" } +tauri-plugin-shell = { version = "=2.0.0-rc.3" } # tauri-plugin-window-state saves the window position and size to be restored. -tauri-plugin-window-state = { version = "=2.0.0-rc.1" } +tauri-plugin-window-state = { version = "=2.0.0-rc.3" } # tauri-plugin-single-instance ensures that only one instance of the app is running. -tauri-plugin-single-instance = { version = "=2.0.0-rc.0" } +tauri-plugin-single-instance = { version = "=2.0.0-rc.1" } # tauri-plugin-clipboard-manager adds a bridge for reading/writing to the clipboard. -tauri-plugin-clipboard-manager = { version = "=2.0.0-rc.1" } +tauri-plugin-clipboard-manager = { version = "=2.0.0-rc.3" } # tauri-plugin-updater allows for us to use it's functionality for in-app updates. -tauri-plugin-updater = { version = "=2.0.0-rc.1" } +tauri-plugin-updater = { version = "=2.0.0-rc.2" } # tauri-plugin-dialog adds a bridge for opening file manager and message dialogs. -tauri-plugin-dialog = { version = "=2.0.0-rc.1" } +tauri-plugin-dialog = { version = "=2.0.0-rc.3" } # tauri-plugin-deep-link adds a way to handle custom uri schemes (onelauncher://) -tauri-plugin-deep-link = { version = "=2.0.0-rc.1" } +tauri-plugin-deep-link = { version = "=2.0.0-rc.3" } # # ============= CORE ============= # # # rspc is used as a faster and more intuitive replacement for tauri-specta @@ -88,13 +88,13 @@ specta = { version = "=2.0.0-rc.20", features = [ ] } # tauri-specta is the tauri adapter for specta. -tauri-specta = { version = "=2.0.0-rc.17", features = [ "javascript", "typescript", "derive" ] } +tauri-specta = { version = "=2.0.0-rc.18", features = [ "javascript", "typescript", "derive" ] } # specta-typescript is the typescript adapter for specta. specta-typescript = { version = "=0.0.7" } # rspc-specta2 is the specta v2 (rc) adapter for rspc. rspc-tauri2 = { version = "=0.0.1" } # core utilities for minecraft and mod management with pulseflow apis -interpulse = { version = "1.1.0", features = [ "specta" ] } +interpulse = { version = "=1.1.0", features = [ "specta" ] } # # ============= SECURITY ============= # # thiserror = { version = "1.0" } diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 73142756..e6868282 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -24,6 +24,6 @@ "@onelauncher/frontend": "workspace:*" }, "devDependencies": { - "@tauri-apps/cli": "=2.0.0-rc.4" + "@tauri-apps/cli": "=2.0.0-rc.12" } } diff --git a/apps/desktop/src/api/commands/package.rs b/apps/desktop/src/api/commands/package.rs index 9994dce9..9e9126db 100644 --- a/apps/desktop/src/api/commands/package.rs +++ b/apps/desktop/src/api/commands/package.rs @@ -30,7 +30,9 @@ pub async fn get_all_provider_package_versions( game_versions: Option>, loaders: Option>, ) -> Result, String> { - Ok(provider.get_all_versions(&project_id, game_versions, loaders).await?) + Ok(provider + .get_all_versions(&project_id, game_versions, loaders) + .await?) } #[specta::specta] @@ -65,7 +67,10 @@ pub struct ProviderSearchQuery { #[specta::specta] #[tauri::command] -pub async fn search_provider_packages(provider: Providers, query: ProviderSearchQuery) -> Result { +pub async fn search_provider_packages( + provider: Providers, + query: ProviderSearchQuery, +) -> Result { Ok(provider .search( query.query, @@ -105,15 +110,25 @@ pub async fn download_provider_package( let mgd_pkg = provider.get(&package_id).await?; - let (pkg_path, pkg) = package::download_package(&mgd_pkg, &mut cluster, game_version, loader, package_version).await?; - package::add_package(&cluster.cluster_path(), pkg_path, pkg, Some(mgd_pkg.package_type)).await?; + let (pkg_path, pkg) = package::download_package( + &mgd_pkg, + &mut cluster, + game_version, + loader, + package_version, + ) + .await?; + package::add_package( + &cluster.cluster_path(), + pkg_path, + pkg, + Some(mgd_pkg.package_type), + ) + .await?; Ok(()) } - - - #[specta::specta] #[tauri::command] pub async fn get_cluster_package( @@ -165,7 +180,10 @@ pub async fn sync_cluster_packages(cluster_path: ClusterPath) -> Result<(), Stri #[specta::specta] #[tauri::command] -pub async fn sync_cluster_packages_by_type(cluster_path: ClusterPath, package_type: PackageType) -> Result<(), String> { +pub async fn sync_cluster_packages_by_type( + cluster_path: ClusterPath, + package_type: PackageType, +) -> Result<(), String> { package::sync_packages_by_type(&cluster_path, package_type).await?; Ok(()) } diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 593eeb22..db261a79 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -18,7 +18,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@fontsource/poppins": "^5.0.15", + "@fontsource/poppins": "^5.0.16", "@formatjs/intl-durationformat": "^0.2.4", "@leeoniya/ufuzzy": "^1.0.14", "@onelauncher/client": "workspace:*", @@ -26,11 +26,11 @@ "@solid-primitives/refs": "^1.0.8", "@solidjs/router": "^0.14.3", "@t3-oss/env-core": "^0.11.0", - "@tanstack/solid-query": "^5.53.1", - "@tauri-apps/api": "=2.0.0-rc.1", - "@tauri-apps/plugin-clipboard-manager": "=2.0.0-rc.0", - "@tauri-apps/plugin-dialog": "=2.0.0-rc.0", - "@tauri-apps/plugin-shell": "=2.0.0-rc.0", + "@tanstack/solid-query": "^5.55.2", + "@tauri-apps/api": "=2.0.0-rc.4", + "@tauri-apps/plugin-clipboard-manager": "=2.0.0-rc.1", + "@tauri-apps/plugin-dialog": "=2.0.0-rc.1", + "@tauri-apps/plugin-shell": "=2.0.0-rc.1", "@unocss/reset": "^0.62.3", "@untitled-theme/icons-solid": "^0.10.5", "overlayscrollbars": "^2.10.0", @@ -41,15 +41,15 @@ "zod": "^3.23.8" }, "devDependencies": { - "@sentry/vite-plugin": "^2.22.3", + "@sentry/vite-plugin": "^2.22.4", "@solidjs/testing-library": "^0.8.9", - "@tauri-apps/cli": "=2.0.0-rc.4", + "@tauri-apps/cli": "=2.0.0-rc.12", "@testing-library/jest-dom": "^6.5.0", "jsdom": "^25.0.0", "rollup-plugin-visualizer": "^5.12.0", - "sass": "^1.77.8", + "sass": "^1.78.0", "unocss": "^0.62.3", - "vite": "^5.4.2", + "vite": "^5.4.3", "vite-plugin-solid": "^2.10.2", "vite-plugin-solid-svg": "^0.8.1", "vite-tsconfig-paths": "^5.0.1" diff --git a/apps/frontend/src/index.tsx b/apps/frontend/src/index.tsx index afd4411d..47f29028 100644 --- a/apps/frontend/src/index.tsx +++ b/apps/frontend/src/index.tsx @@ -1,24 +1,24 @@ /* @refresh reload */ -import { render } from 'solid-js/web'; - import { Route, Router } from '@solidjs/router'; -import { bridge } from './imports'; +import BrowserRoot from '~ui/pages/browser/BrowserRoot'; +import ClusterRoot from '~ui/pages/cluster/ClusterRoot'; + +import SettingsRoot from '~ui/pages/settings/SettingsRoot'; +import { render } from 'solid-js/web'; +import { bridge } from './imports'; import App from './ui/App'; import HomePage from './ui/pages/Home'; import UpdatesPage from './ui/pages/Updates'; -import ClusterRoot from '~ui/pages/cluster/ClusterRoot'; -import SettingsRoot from '~ui/pages/settings/SettingsRoot'; -import BrowserRoot from '~ui/pages/browser/BrowserRoot'; document.body.setAttribute('data-platform', bridge.PROGRAM_INFO.platform); render(() => ( - - - } /> - } /> - } /> + + + } component={ClusterRoot} path="/clusters" /> + } component={SettingsRoot} path="/settings" /> + } component={BrowserRoot} path="/browser" /> ), document.getElementById('root') as HTMLElement); diff --git a/apps/frontend/src/ui/App.tsx b/apps/frontend/src/ui/App.tsx index 304c1e5d..4205bef4 100644 --- a/apps/frontend/src/ui/App.tsx +++ b/apps/frontend/src/ui/App.tsx @@ -1,17 +1,17 @@ -import type { ParentProps } from 'solid-js'; -import { OverlayScrollbarsComponent } from 'overlayscrollbars-solid'; import { PROGRAM_INFO } from '@onelauncher/client/bindings'; -import WindowFrame from './components/WindowFrame'; -import Navbar from './components/Navbar'; -import ErrorBoundary from './components/ErrorBoundary'; +import { OverlayScrollbarsComponent } from 'overlayscrollbars-solid'; +import type { ParentProps } from 'solid-js'; import AnimatedRoutes from './components/AnimatedRoutes'; -import NotificationOverlay from './components/overlay/notifications/NotificationOverlay'; -import { SettingsProvider } from './hooks/useSettings'; -import { ClusterModalControllerProvider } from './components/overlay/cluster/ClusterCreationModal'; +import ErrorBoundary from './components/ErrorBoundary'; import { MultiProvider } from './components/MultiProvider'; +import Navbar from './components/Navbar'; import { AccountControllerProvider } from './components/overlay/account/AddAccountModal'; +import { ClusterModalControllerProvider } from './components/overlay/cluster/ClusterCreationModal'; import { ModalProvider, ModalRenderer } from './components/overlay/Modal'; +import NotificationOverlay from './components/overlay/notifications/NotificationOverlay'; +import WindowFrame from './components/WindowFrame'; import { BrowserProvider } from './hooks/useBrowser'; +import { SettingsProvider } from './hooks/useSettings'; function App(props: ParentProps) { if (PROGRAM_INFO.dev_build !== true) diff --git a/apps/frontend/src/ui/components/AnimatedRoutes.tsx b/apps/frontend/src/ui/components/AnimatedRoutes.tsx index dfbb10f9..158bc250 100644 --- a/apps/frontend/src/ui/components/AnimatedRoutes.tsx +++ b/apps/frontend/src/ui/components/AnimatedRoutes.tsx @@ -1,6 +1,6 @@ +import useSettings from '~ui/hooks/useSettings'; import { type ParentProps, Show } from 'solid-js'; import { Transition, type TransitionProps } from 'solid-transition-group'; -import useSettings from '~ui/hooks/useSettings'; function AnimatedRoutes(props: TransitionProps & ParentProps) { const { settings } = useSettings(); @@ -17,10 +17,6 @@ function AnimatedRoutes(props: TransitionProps & ParentProps) { return ( {props.children} - )} children={( )} + fallback={( + <>{props.children} + )} + when={settings().disable_animations !== true} /> ); } diff --git a/apps/frontend/src/ui/components/DynamicTime.tsx b/apps/frontend/src/ui/components/DynamicTime.tsx index 6596c41e..56643c74 100644 --- a/apps/frontend/src/ui/components/DynamicTime.tsx +++ b/apps/frontend/src/ui/components/DynamicTime.tsx @@ -1,5 +1,5 @@ -import { type ParentProps, createSignal, onCleanup, onMount } from 'solid-js'; import { formatAsRelative } from '~utils'; +import { createSignal, onCleanup, onMount, type ParentProps } from 'solid-js'; type TimeProps = ParentProps & { timestamp: Date | number; diff --git a/apps/frontend/src/ui/components/ErrorBoundary.tsx b/apps/frontend/src/ui/components/ErrorBoundary.tsx index 19161654..dfa2c74e 100644 --- a/apps/frontend/src/ui/components/ErrorBoundary.tsx +++ b/apps/frontend/src/ui/components/ErrorBoundary.tsx @@ -1,5 +1,5 @@ -import type { ParentProps } from 'solid-js'; import { ErrorBoundary as Boundary, Match, Switch } from 'solid-js'; +import type { ParentProps } from 'solid-js'; function ErrorBoundary(props: ParentProps) { return ( diff --git a/apps/frontend/src/ui/components/MultiProvider.tsx b/apps/frontend/src/ui/components/MultiProvider.tsx index f454159f..1594929e 100644 --- a/apps/frontend/src/ui/components/MultiProvider.tsx +++ b/apps/frontend/src/ui/components/MultiProvider.tsx @@ -3,7 +3,7 @@ * MIT LICENSE */ /* eslint-disable solid/reactivity -- . */ -import { type Context, type ContextProviderComponent, type FlowComponent, type JSX, createComponent } from 'solid-js'; +import { type Context, type ContextProviderComponent, createComponent, type FlowComponent, type JSX } from 'solid-js'; export function MultiProvider(props: { values: { diff --git a/apps/frontend/src/ui/components/Navbar.tsx b/apps/frontend/src/ui/components/Navbar.tsx index f59bb903..c25a48c2 100644 --- a/apps/frontend/src/ui/components/Navbar.tsx +++ b/apps/frontend/src/ui/components/Navbar.tsx @@ -1,15 +1,15 @@ -import { A, useNavigate } from '@solidjs/router'; -import { createSignal } from 'solid-js'; -import { Bell01Icon, Cloud01Icon, Settings01Icon, TerminalBrowserIcon } from '@untitled-theme/icons-solid'; -import { open } from '@tauri-apps/plugin-shell'; import { WEBSITE } from '@onelauncher/client'; +import { A, useNavigate } from '@solidjs/router'; +import { open } from '@tauri-apps/plugin-shell'; +import { Bell01Icon, Cloud01Icon, Settings01Icon, TerminalBrowserIcon } from '@untitled-theme/icons-solid'; +import { createSignal } from 'solid-js'; +import Button from './base/Button'; +import PlayerHead from './game/PlayerHead'; import PolyfrostFull from './logos/PolyfrostFull'; import AccountPopup from './overlay/account/AccountsPopup'; -import PlayerHead from './game/PlayerHead'; -import Button from './base/Button'; +import useAccountController from './overlay/account/AddAccountModal'; import NotificationPopup from './overlay/notifications/NotificationPopup'; import Popup from './overlay/Popup'; -import useAccountController from './overlay/account/AddAccountModal'; interface NavbarLinkProps { path: string; @@ -19,11 +19,11 @@ interface NavbarLinkProps { function NavbarLink(props: NavbarLinkProps) { return ( {props.label} @@ -43,14 +43,14 @@ function Navbar() { return (
-
open(WEBSITE)} class="w-min flex items-center justify-center transition-transform active:scale-90"> +
open(WEBSITE)}>
- - - + + +
@@ -78,26 +78,26 @@ function Navbar() { {/* Account Menu Button */}
Popup.setPos(profileButton, el)} class="mt-2" + ref={el => Popup.setPos(profileButton, el)} + setVisible={setProfileMenuOpen} + visible={profileMenuOpen} /> Popup.setPos(notificationButton, el)} class="mt-2" + ref={el => Popup.setPos(notificationButton, el)} + setVisible={setNotificationMenuOpen} + visible={notificationMenuOpen} />
); diff --git a/apps/frontend/src/ui/components/Sidebar.tsx b/apps/frontend/src/ui/components/Sidebar.tsx index 77a9a3bf..2db912df 100644 --- a/apps/frontend/src/ui/components/Sidebar.tsx +++ b/apps/frontend/src/ui/components/Sidebar.tsx @@ -1,6 +1,6 @@ import { useLocation, useNavigate } from '@solidjs/router'; +import { createEffect, For, splitProps } from 'solid-js'; import type { JSX, ParentProps } from 'solid-js'; -import { For, createEffect, splitProps } from 'solid-js'; type SidebarProps = ParentProps & { base: string; @@ -47,10 +47,10 @@ function Sidebar(props: SidebarProps) { return ( goto(link[2], link[3])} class={ `px-3 py-1 rounded-md text-md border hover:bg-component-bg-hover active:bg-component-bg-pressed ${isActive(link[2], link[3]) ? 'bg-component-bg border-gray-05' : 'border-transparent'}` } + onClick={() => goto(link[2], link[3])} > {link[0]} diff --git a/apps/frontend/src/ui/components/Spinner.tsx b/apps/frontend/src/ui/components/Spinner.tsx index c28be54a..2c33a6a4 100644 --- a/apps/frontend/src/ui/components/Spinner.tsx +++ b/apps/frontend/src/ui/components/Spinner.tsx @@ -1,4 +1,4 @@ -import { type JSX, type ParentProps, Suspense, splitProps } from 'solid-js'; +import { type JSX, type ParentProps, splitProps, Suspense } from 'solid-js'; export interface SpinnerProps extends JSX.HTMLAttributes { diff --git a/apps/frontend/src/ui/components/WindowFrame.tsx b/apps/frontend/src/ui/components/WindowFrame.tsx index 34f45033..15d8bbfd 100644 --- a/apps/frontend/src/ui/components/WindowFrame.tsx +++ b/apps/frontend/src/ui/components/WindowFrame.tsx @@ -1,10 +1,10 @@ import { Window } from '@tauri-apps/api/window'; import { ChevronLeftIcon, Maximize02Icon, MinusIcon, XCloseIcon } from '@untitled-theme/icons-solid'; -import type { JSX } from 'solid-js'; -import { onMount } from 'solid-js'; -import Modal, { createModal } from './overlay/Modal'; -import Button from './base/Button'; import useSettings from '~ui/hooks/useSettings'; +import { onMount } from 'solid-js'; +import type { JSX } from 'solid-js'; +import Button from './base/Button'; +import Modal, { createModal } from './overlay/Modal'; interface TitlebarButtonProps { icon: (any: any) => JSX.Element; @@ -33,11 +33,11 @@ function WindowFrame() { const modal = createModal(props => ( props.hide()}>No, , ]} + title="Close OneLauncher?" /> )); @@ -51,7 +51,7 @@ function WindowFrame() { }); return ( -
+
history.back()} />
@@ -59,7 +59,7 @@ function WindowFrame() {
minimize()} /> maximize()} /> - quit()} danger /> + quit()} />
); diff --git a/apps/frontend/src/ui/components/base/Button.tsx b/apps/frontend/src/ui/components/base/Button.tsx index 1ed8eed5..9aef52aa 100644 --- a/apps/frontend/src/ui/components/base/Button.tsx +++ b/apps/frontend/src/ui/components/base/Button.tsx @@ -1,5 +1,5 @@ -import type { Accessor, JSX, ParentProps } from 'solid-js'; import { createEffect, createSignal, mergeProps, on, splitProps, untrack } from 'solid-js'; +import type { Accessor, JSX, ParentProps } from 'solid-js'; import styles from './Button.module.scss'; type ButtonProps = JSX.ButtonHTMLAttributes & ParentProps & { @@ -41,12 +41,12 @@ Button.Toggle = (props: ButtonToggleProps) => { return ( diff --git a/apps/frontend/src/ui/hooks/useBrowser.tsx b/apps/frontend/src/ui/hooks/useBrowser.tsx index 47b21510..473ca0e5 100644 --- a/apps/frontend/src/ui/hooks/useBrowser.tsx +++ b/apps/frontend/src/ui/hooks/useBrowser.tsx @@ -1,14 +1,14 @@ import { useNavigate } from '@solidjs/router'; -import { type Accessor, type Context, For, type ParentProps, type Setter, Show, createContext, createEffect, createSignal, on, onMount, untrack, useContext } from 'solid-js'; -import type { Cluster, ManagedPackage, PackageType, ProviderSearchQuery, ProviderSearchResults, Providers } from '@onelauncher/client/bindings'; -import useCommand, { tryResult } from './useCommand'; -import { useRecentCluster } from './useCluster'; import { bridge } from '~imports'; -import BrowserPackage from '~ui/pages/browser/BrowserPackage'; -import type { ModalProps } from '~ui/components/overlay/Modal'; -import Modal, { createModal } from '~ui/components/overlay/Modal'; -import Dropdown from '~ui/components/base/Dropdown'; import Button from '~ui/components/base/Button'; +import Dropdown from '~ui/components/base/Dropdown'; +import Modal, { createModal } from '~ui/components/overlay/Modal'; +import BrowserPackage from '~ui/pages/browser/BrowserPackage'; +import { type Accessor, type Context, createContext, createEffect, createSignal, For, on, onMount, type ParentProps, type Setter, Show, untrack, useContext } from 'solid-js'; +import type { Cluster, ManagedPackage, PackageType, Providers, ProviderSearchQuery, ProviderSearchResults } from '@onelauncher/client/bindings'; +import type { ModalProps } from '~ui/components/overlay/Modal'; +import { useRecentCluster } from './useCluster'; +import useCommand, { tryResult } from './useCommand'; export type ProviderSearchOptions = ProviderSearchQuery & { provider: Providers }; @@ -191,11 +191,21 @@ function ChooseClusterModal(props: ModalProps) { return ( , +
} + when={clusters !== undefined} > )} - buttons={[ -
- )} buttons={[ } + title="Package List Style" > BROWSER_VIEWS.indexOf(settings().browser_list_view ?? 'grid')} onChange={value => settings().browser_list_view = BROWSER_VIEWS[value] ?? 'grid'} + selected={() => BROWSER_VIEWS.indexOf(settings().browser_list_view ?? 'grid')} > {view => ( @@ -60,9 +60,9 @@ function SettingsAppearance() { } + title="Disable Animations" > settings().disable_animations ?? false} diff --git a/apps/frontend/src/ui/pages/settings/launcher/SettingsGeneral.tsx b/apps/frontend/src/ui/pages/settings/launcher/SettingsGeneral.tsx index b6f22acf..4c5c5124 100644 --- a/apps/frontend/src/ui/pages/settings/launcher/SettingsGeneral.tsx +++ b/apps/frontend/src/ui/pages/settings/launcher/SettingsGeneral.tsx @@ -1,12 +1,12 @@ -import { AlertSquareIcon, FolderIcon, LinkExternal01Icon, XIcon } from '@untitled-theme/icons-solid'; import { open } from '@tauri-apps/plugin-shell'; -import SettingsRow from '../../../components/SettingsRow'; -import ScrollableContainer from '~ui/components/ScrollableContainer'; +import { AlertSquareIcon, FolderIcon, LinkExternal01Icon, XIcon } from '@untitled-theme/icons-solid'; +import DiscordIcon from '~assets/logos/discord.svg?component-solid'; +import Button from '~ui/components/base/Button'; import Toggle from '~ui/components/base/Toggle'; +import ScrollableContainer from '~ui/components/ScrollableContainer'; import Sidebar from '~ui/components/Sidebar'; import useSettings from '~ui/hooks/useSettings'; -import Button from '~ui/components/base/Button'; -import DiscordIcon from '~assets/logos/discord.svg?component-solid'; +import SettingsRow from '../../../components/SettingsRow'; function SettingsGeneral() { const { settings, saveOnLeave } = useSettings(); @@ -23,9 +23,9 @@ function SettingsGeneral() { } + title="Discord RPC" > !(settings().disable_discord ?? false)} @@ -34,9 +34,9 @@ function SettingsGeneral() { } + title="Hide Close Dialog" > settings().hide_close_prompt ?? true} @@ -45,9 +45,9 @@ function SettingsGeneral() { } + title="Error Analytics" > !(settings().disable_analytics ?? false)} @@ -57,13 +57,13 @@ function SettingsGeneral() { Folders and Files } + title="Launcher Folder" >