diff --git a/apps/desktop/src-tauri/capabilities/default.json b/apps/desktop/src-tauri/capabilities/default.json index 8772be6..1b20c60 100644 --- a/apps/desktop/src-tauri/capabilities/default.json +++ b/apps/desktop/src-tauri/capabilities/default.json @@ -2,7 +2,7 @@ "$schema": "../gen/schemas/desktop-schema.json", "identifier": "default", "description": "Capability for the main window", - "windows": ["main*"], + "windows": ["main*", "splashscreen"], "permissions": [ { "identifier": "http:default", diff --git a/apps/desktop/src-tauri/src/setup/window.rs b/apps/desktop/src-tauri/src/setup/window.rs index 470a69f..5ab5165 100644 --- a/apps/desktop/src-tauri/src/setup/window.rs +++ b/apps/desktop/src-tauri/src/setup/window.rs @@ -53,7 +53,19 @@ impl WindowExt for WebviewWindow { } pub fn setup_window(app: &AppHandle) { - let window = app.get_webview_window("main").unwrap(); #[cfg(target_os = "macos")] - window.set_transparent_titlebar(true, true); + { + let main_win = app.get_webview_window("main").unwrap(); + main_win.set_transparent_titlebar(true, true); + let splashscreen_win = app.get_webview_window("splashscreen").unwrap(); + splashscreen_win.set_transparent_titlebar(true, true); + } + #[cfg(not(target_os = "macos"))] + { + // on linux or windows, set decorations to false + let main_win = app.get_webview_window("main").unwrap(); + main_win + .set_decorations(false) + .expect("Failed to set decorations"); + } } diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index ef42742..e5ca9a9 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -13,7 +13,23 @@ "macOSPrivateApi": true, "security": { "csp": null - } + }, + "windows": [ + { + "hiddenTitle": true, + "url": "/app", + "title": "Kunkun", + "width": 800, + "visible": false, + "height": 600, + "decorations": true + }, + { + "url": "/splashscreen", + "visible": false, + "label": "splashscreen" + } + ] }, "bundle": { "createUpdaterArtifacts": true, diff --git a/apps/desktop/src-tauri/tauri.linux.conf.json b/apps/desktop/src-tauri/tauri.linux.conf.json deleted file mode 100644 index d230edf..0000000 --- a/apps/desktop/src-tauri/tauri.linux.conf.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "identifier": "sh.kunkun.desktop", - "app": { - "windows": [ - { - "hiddenTitle": true, - "title": "Kunkun", - "width": 800, - "height": 600, - "decorations": false - } - ] - } -} diff --git a/apps/desktop/src-tauri/tauri.macos.conf.json b/apps/desktop/src-tauri/tauri.macos.conf.json deleted file mode 100644 index 960e29e..0000000 --- a/apps/desktop/src-tauri/tauri.macos.conf.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "identifier": "sh.kunkun.desktop", - "app": { - "windows": [ - { - "hiddenTitle": true, - "title": "Kunkun", - "width": 800, - "height": 600 - } - ] - } -} diff --git a/apps/desktop/src-tauri/tauri.windows.conf.json b/apps/desktop/src-tauri/tauri.windows.conf.json deleted file mode 100644 index d230edf..0000000 --- a/apps/desktop/src-tauri/tauri.windows.conf.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "identifier": "sh.kunkun.desktop", - "app": { - "windows": [ - { - "hiddenTitle": true, - "title": "Kunkun", - "width": 800, - "height": 600, - "decorations": false - } - ] - } -} diff --git a/apps/desktop/src/lib/cmds/builtin.ts b/apps/desktop/src/lib/cmds/builtin.ts index 644e92f..6f383f7 100644 --- a/apps/desktop/src/lib/cmds/builtin.ts +++ b/apps/desktop/src/lib/cmds/builtin.ts @@ -13,7 +13,6 @@ import { derived } from "svelte/store" import * as clipboard from "tauri-plugin-clipboard-api" import { open } from "tauri-plugin-shellx-api" import { v4 as uuidv4 } from "uuid" -import { hexColor } from "valibot" export const rawBuiltinCmds: BuiltinCmd[] = [ { @@ -25,7 +24,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ description: "Go to Extension Store", function: async () => { appState.clearSearchTerm() - goto("/extension/store") + goto("/app/extension/store") } }, { @@ -36,7 +35,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ }, description: "", function: async () => { - goto("/auth") + goto("/app/auth") } }, { @@ -73,6 +72,23 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ }, 2_000) } }, + { + name: "Splashscreen (Dev)", + icon: { + type: IconEnum.Iconify, + value: "material-symbols:skeleton" + }, + description: "", + flags: { + dev: true + }, + function: async () => { + new WebviewWindow(`splashscreen`, { + url: "/splashscreen" + }) + appState.clearSearchTerm() + } + }, { name: "File Transfer", icon: { @@ -81,7 +97,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ }, description: "", function: async () => { - goto("/extension/file-transfer") + goto("/app/extension/file-transfer") appState.clearSearchTerm() } }, @@ -95,7 +111,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ description: "", function: async () => { appState.clearSearchTerm() - goto("/settings/add-dev-extension") + goto("/app/settings/add-dev-extension") } }, { @@ -120,7 +136,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ function: async () => { // const appStateStore = useAppStateStore() appState.clearSearchTerm() - goto("/settings/set-dev-ext-path") + goto("/app/settings/set-dev-ext-path") } }, { @@ -132,11 +148,11 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ description: "", function: async () => { appState.clearSearchTerm() - // goto("/window-troubleshooter") + // goto("/app/window-troubleshooter") const winLabel = `main:extension-window-troubleshooter-${uuidv4()}` console.log(winLabel) new WebviewWindow(winLabel, { - url: "/troubleshooters/extension-window", + url: "/app/troubleshooters/extension-window", title: "Extension Window Troubleshooter" }) }, @@ -151,7 +167,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ description: "", function: async () => { appState.clearSearchTerm() - goto("/extension/permission-inspector") + goto("/app/extension/permission-inspector") }, keywords: ["extension"] }, @@ -164,7 +180,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ description: "", function: async () => { appState.clearSearchTerm() - goto("/troubleshooters/extension-loading") + goto("/app/troubleshooters/extension-loading") }, keywords: ["extension", "troubleshooter"] }, @@ -177,7 +193,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ description: "Create a Quicklink", function: async () => { appState.clearSearchTerm() - goto("/extension/create-quick-link") + goto("/app/extension/create-quick-link") } }, { @@ -188,7 +204,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ }, description: "Open Settings", function: async () => { - goto("/settings") + goto("/app/settings") appState.clearSearchTerm() } }, @@ -248,7 +264,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ }, description: "Dance", function: async () => { - goto("/dance") + goto("/app/dance") } }, { @@ -289,7 +305,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ description: "Clipboard History", function: async () => { appState.clearSearchTerm() - goto("/extension/clipboard") + goto("/app/extension/clipboard") } }, { @@ -306,7 +322,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ return } const window = new WebviewWindow(`main:pinned-screenshot-${uuidv4()}`, { - url: "/extension/pin-screenshot", + url: "/app/extension/pin-screenshot", title: "Pinned Screenshot", hiddenTitle: true, titleBarStyle: "transparent", @@ -326,7 +342,7 @@ export const rawBuiltinCmds: BuiltinCmd[] = [ }, description: "MDNS Debugger", function: async () => { - goto("/troubleshooters/mdns-debugger") + goto("/app/troubleshooters/mdns-debugger") }, flags: { developer: true diff --git a/apps/desktop/src/lib/cmds/ext.ts b/apps/desktop/src/lib/cmds/ext.ts index 5a6617a..b5c7eb3 100644 --- a/apps/desktop/src/lib/cmds/ext.ts +++ b/apps/desktop/src/lib/cmds/ext.ts @@ -24,7 +24,7 @@ export async function onTemplateUiCmdSelect( ) { await createExtSupportDir(ext.extPath) // console.log("onTemplateUiCmdSelect", ext, cmd, isDev, hmr) - const url = `/extension/ui-worker?extPath=${encodeURIComponent(ext.extPath)}&cmdName=${encodeURIComponent(cmd.name)}` + const url = `/app/extension/ui-worker?extPath=${encodeURIComponent(ext.extPath)}&cmdName=${encodeURIComponent(cmd.name)}` if (cmd.window) { const winLabel = await winExtMap.registerExtensionWithWindow({ extPath: ext.extPath }) const window = launchNewExtWindow(winLabel, url, cmd.window) @@ -52,7 +52,7 @@ export async function onCustomUiCmdSelect( } else { url = decodeURIComponent(convertFileSrc(`${trimSlash(cmd.main)}`, "ext")) } - let url2 = `/extension/ui-iframe?url=${encodeURIComponent(url)}&extPath=${encodeURIComponent(ext.extPath)}` + let url2 = `/app/extension/ui-iframe?url=${encodeURIComponent(url)}&extPath=${encodeURIComponent(ext.extPath)}` if (cmd.window) { const winLabel = await winExtMap.registerExtensionWithWindow({ extPath: ext.extPath, @@ -61,7 +61,7 @@ export async function onCustomUiCmdSelect( if (platform() === "windows" && !useDevMain) { const addr = await spawnExtensionFileServer(winLabel) const newUrl = `http://${addr}` - url2 = `/extension/ui-iframe?url=${encodeURIComponent(newUrl)}&extPath=${encodeURIComponent(ext.extPath)}` + url2 = `/app/extension/ui-iframe?url=${encodeURIComponent(newUrl)}&extPath=${encodeURIComponent(ext.extPath)}` } const window = launchNewExtWindow(winLabel, url2, cmd.window) window.onCloseRequested(async (event) => { @@ -78,7 +78,7 @@ export async function onCustomUiCmdSelect( const addr = await spawnExtensionFileServer(winLabel) // addr has format "127.0.0.1:" console.log("Extension file server address: ", addr) const newUrl = `http://${addr}` - url2 = `/extension/ui-iframe?url=${encodeURIComponent(newUrl)}&extPath=${encodeURIComponent(ext.extPath)}` + url2 = `/app/extension/ui-iframe?url=${encodeURIComponent(newUrl)}&extPath=${encodeURIComponent(ext.extPath)}` } goto(url2) } diff --git a/apps/desktop/src/lib/components/dance/dance.svelte b/apps/desktop/src/lib/components/dance/dance.svelte index ddb2f8f..e05a1b6 100644 --- a/apps/desktop/src/lib/components/dance/dance.svelte +++ b/apps/desktop/src/lib/components/dance/dance.svelte @@ -1,4 +1,5 @@ - import AppContext from "@/components/context/AppContext.svelte" import "../app.css" - import { appConfig, appState, extensions, quickLinks, winExtMap } from "@/stores" - import { initDeeplink } from "@/utils/deeplink" - import { updateAppHotkey } from "@/utils/hotkey" - import { globalKeyDownHandler, goBackOrCloseOnEscape } from "@/utils/key" - import { listenToWindowBlur } from "@/utils/tauri-events" - import { isInMainWindow } from "@/utils/window" - import { listenToKillProcessEvent, listenToRecordExtensionProcessEvent } from "@kksh/api/events" - import { - Button, - ModeWatcher, - themeConfigStore, - ThemeWrapper, - updateTheme, - type ThemeConfig - } from "@kksh/svelte5" - import { Constants, ViewTransition } from "@kksh/ui" - import type { UnlistenFn } from "@tauri-apps/api/event" - import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow" - import { attachConsole, error, info } from "@tauri-apps/plugin-log" - import { afterNavigate, beforeNavigate } from "$app/navigation" - import { gsap } from "gsap" - import { Flip } from "gsap/Flip" - import { onDestroy, onMount } from "svelte" - import { toast, Toaster } from "svelte-sonner" - import * as shellx from "tauri-plugin-shellx-api" - - /* -------------------------------------------------------------------------- */ - /* Gsap Flip Animation */ - /* -------------------------------------------------------------------------- */ - gsap.registerPlugin(Flip) - let flipState: Flip.FlipState - beforeNavigate(() => { - flipState = Flip.getState( - `.${Constants.CLASSNAMES.EXT_LOGO}, .${Constants.CLASSNAMES.BACK_BUTTON}` - ) - }) - - afterNavigate(() => { - if (!flipState) { - return - } - - Flip.from(flipState, { - targets: `.${Constants.CLASSNAMES.EXT_LOGO}, .${Constants.CLASSNAMES.BACK_BUTTON}`, - duration: 0.5, - absolute: true, - scale: true, - ease: "ease-out" - }) - }) + import { ModeWatcher, ThemeWrapper } from "@kksh/svelte5" let { children } = $props() - const unlisteners: UnlistenFn[] = [] - onDestroy(() => { - unlisteners.forEach((unlistener) => unlistener()) - }) - onMount(async () => { - attachConsole().then((unlistener) => unlisteners.push(unlistener)) - initDeeplink().then((unlistener) => unlisteners.push(unlistener)) - shellx - .fixPathEnv() - .then(() => { - info("fixed path env") - }) - .catch(error) - - quickLinks.init() - appConfig.init() - if (isInMainWindow()) { - if ($appConfig.triggerHotkey) { - updateAppHotkey($appConfig.triggerHotkey) - } - unlisteners.push( - await listenToWindowBlur(() => { - const win = getCurrentWebviewWindow() - win.isFocused().then((isFocused) => { - // this extra is focused check may be needed because blur event got triggered somehow when window show() - // for edge case: when settings page is opened and focused, switch to main window, the blur event is triggered for main window - if (!isFocused) { - if ($appConfig.hideOnBlur) { - win.hide() - } - } - }) - }) - ) - extensions.init() - unlisteners.push( - await listenToRecordExtensionProcessEvent(async (event) => { - console.log("record extension process event", event) - winExtMap.registerProcess(event.payload.windowLabel, event.payload.pid) - }) - ) - unlisteners.push( - await listenToKillProcessEvent((event) => { - console.log("kill process event", event) - winExtMap.unregisterProcess(event.payload.pid) - }) - ) - } else { - } - getCurrentWebviewWindow().show() - }) - - - - - - {@render children()} - - + + {@render children()} + diff --git a/apps/desktop/src/routes/+layout.ts b/apps/desktop/src/routes/+layout.ts index e112516..8d7e6d2 100644 --- a/apps/desktop/src/routes/+layout.ts +++ b/apps/desktop/src/routes/+layout.ts @@ -1,13 +1,5 @@ -import { getExtensionsFolder, IS_IN_TAURI } from "@/constants" -import { error } from "@tauri-apps/plugin-log" -import type { LayoutLoad } from "./$types" - // Tauri doesn't have a Node.js server to do proper SSR // so we will use adapter-static to prerender the app (SSG) // See: https://v2.tauri.app/start/frontend/sveltekit/ for more info export const prerender = true export const ssr = false - -export const load: LayoutLoad = async () => { - return { extsInstallDir: IS_IN_TAURI ? await getExtensionsFolder() : "" } -} diff --git a/apps/desktop/src/routes/+page.svelte b/apps/desktop/src/routes/+page.svelte index b828d56..e57ad93 100644 --- a/apps/desktop/src/routes/+page.svelte +++ b/apps/desktop/src/routes/+page.svelte @@ -1,176 +1 @@ - - - - { - if (e.key === "/") { - if (isKeyboardEventFromInputElement(e)) { - e.preventDefault() - } else { - e.preventDefault() - inputEle?.focus() - } - } - }} -/> - - { - return commandScore( - value.startsWith("{") ? (JSON.parse(value) as CmdValue).cmdName : value, - search, - keywords - ) - }} - loop -> - - {#snippet rightSlot()} - - {#each $cmdQueries as cmdQuery} - {@const queryWidth = Math.max(cmdQuery.name.length, cmdQuery.value.length) + 2} - { - if (evt.key === "Enter") { - evt.preventDefault() - evt.stopPropagation() - commandLaunchers.onQuickLinkSelect( - JSON.parse($appState.highlightedCmd), - $cmdQueries - ) - } - }} - bind:value={cmdQuery.value} - /> - {/each} - - - - - - - - - exit()}> - - Quit - - getCurrentWebviewWindow().hide()}> - - Close Window - - - - - Developer - - - Toggle Devtools - ⌃++I - - location.reload()}> - - Reload Window - ⌃++R - - { - appConfig.update((config) => ({ ...config, hmr: !config.hmr })) - }} - > - - Toggle Dev Extension HMR - - - - - {/snippet} - - - No results found. - {#if $appConfig.extensionsInstallDir && $devStoreExts.length > 0} - - {/if} - {#if $appConfig.extensionsInstallDir && $installedStoreExts.length > 0} - - {/if} - - - - - - +

Root

diff --git a/apps/desktop/src/routes/app/+layout.svelte b/apps/desktop/src/routes/app/+layout.svelte new file mode 100644 index 0000000..050b713 --- /dev/null +++ b/apps/desktop/src/routes/app/+layout.svelte @@ -0,0 +1,107 @@ + + + + + + + {@render children()} + diff --git a/apps/desktop/src/routes/app/+layout.ts b/apps/desktop/src/routes/app/+layout.ts new file mode 100644 index 0000000..8af157c --- /dev/null +++ b/apps/desktop/src/routes/app/+layout.ts @@ -0,0 +1,7 @@ +import { getExtensionsFolder, IS_IN_TAURI } from "@/constants" +import { error } from "@tauri-apps/plugin-log" +import type { LayoutLoad } from "./$types" + +export const load: LayoutLoad = async () => { + return { extsInstallDir: IS_IN_TAURI ? await getExtensionsFolder() : "" } +} diff --git a/apps/desktop/src/routes/app/+page.svelte b/apps/desktop/src/routes/app/+page.svelte new file mode 100644 index 0000000..4853da5 --- /dev/null +++ b/apps/desktop/src/routes/app/+page.svelte @@ -0,0 +1,183 @@ + + + + { + if (e.key === "/") { + if (isKeyboardEventFromInputElement(e)) { + e.preventDefault() + } else { + e.preventDefault() + inputEle?.focus() + } + } + }} +/> + { + return commandScore( + value.startsWith("{") ? (JSON.parse(value) as CmdValue).cmdName : value, + search, + keywords + ) + }} + loop +> + + {#snippet rightSlot()} + + {#each $cmdQueries as cmdQuery} + {@const queryWidth = Math.max(cmdQuery.name.length, cmdQuery.value.length) + 2} + { + if (evt.key === "Enter") { + evt.preventDefault() + evt.stopPropagation() + commandLaunchers.onQuickLinkSelect( + JSON.parse($appState.highlightedCmd), + $cmdQueries + ) + } + }} + bind:value={cmdQuery.value} + /> + {/each} + + + + + + + + + exit()}> + + Quit + + getCurrentWebviewWindow().hide()}> + + Close Window + + + + + Developer + + + Toggle Devtools + ⌃++I + + location.reload()}> + + Reload Window + ⌃++R + + { + appConfig.update((config) => ({ ...config, hmr: !config.hmr })) + }} + > + + Toggle Dev Extension HMR + + + + + {/snippet} + + + No results found. + {#if $appConfig.extensionsInstallDir && $devStoreExts.length > 0} + + {/if} + {#if $appConfig.extensionsInstallDir && $installedStoreExts.length > 0} + + {/if} + + + + + + diff --git a/apps/desktop/src/routes/auth/+page.svelte b/apps/desktop/src/routes/app/auth/+page.svelte similarity index 100% rename from apps/desktop/src/routes/auth/+page.svelte rename to apps/desktop/src/routes/app/auth/+page.svelte diff --git a/apps/desktop/src/routes/auth/confirm/+page.svelte b/apps/desktop/src/routes/app/auth/confirm/+page.svelte similarity index 97% rename from apps/desktop/src/routes/auth/confirm/+page.svelte rename to apps/desktop/src/routes/app/auth/confirm/+page.svelte index 78e2035..10a788e 100644 --- a/apps/desktop/src/routes/auth/confirm/+page.svelte +++ b/apps/desktop/src/routes/app/auth/confirm/+page.svelte @@ -44,7 +44,7 @@ function onSignOut() { auth .signOut() - .then(() => goto("/auth")) + .then(() => goto("/app/auth")) .catch((err) => toast.error("Failed to sign out", { description: err.message })) } @@ -56,7 +56,7 @@ size="icon" onclick={() => { console.log("go Home") - goto("/") + goto("/app/") }} > diff --git a/apps/desktop/src/routes/auth/confirm/+page.ts b/apps/desktop/src/routes/app/auth/confirm/+page.ts similarity index 100% rename from apps/desktop/src/routes/auth/confirm/+page.ts rename to apps/desktop/src/routes/app/auth/confirm/+page.ts diff --git a/apps/desktop/src/routes/dance/+page.svelte b/apps/desktop/src/routes/app/dance/+page.svelte similarity index 100% rename from apps/desktop/src/routes/dance/+page.svelte rename to apps/desktop/src/routes/app/dance/+page.svelte diff --git a/apps/desktop/src/routes/extension/clipboard/+page.svelte b/apps/desktop/src/routes/app/extension/clipboard/+page.svelte similarity index 100% rename from apps/desktop/src/routes/extension/clipboard/+page.svelte rename to apps/desktop/src/routes/app/extension/clipboard/+page.svelte diff --git a/apps/desktop/src/routes/extension/clipboard/content-preview.svelte b/apps/desktop/src/routes/app/extension/clipboard/content-preview.svelte similarity index 100% rename from apps/desktop/src/routes/extension/clipboard/content-preview.svelte rename to apps/desktop/src/routes/app/extension/clipboard/content-preview.svelte diff --git a/apps/desktop/src/routes/extension/create-quick-link/+page.svelte b/apps/desktop/src/routes/app/extension/create-quick-link/+page.svelte similarity index 100% rename from apps/desktop/src/routes/extension/create-quick-link/+page.svelte rename to apps/desktop/src/routes/app/extension/create-quick-link/+page.svelte diff --git a/apps/desktop/src/routes/extension/create-quick-link/schema.ts b/apps/desktop/src/routes/app/extension/create-quick-link/schema.ts similarity index 100% rename from apps/desktop/src/routes/extension/create-quick-link/schema.ts rename to apps/desktop/src/routes/app/extension/create-quick-link/schema.ts diff --git a/apps/desktop/src/routes/extension/file-transfer/+page.svelte b/apps/desktop/src/routes/app/extension/file-transfer/+page.svelte similarity index 100% rename from apps/desktop/src/routes/extension/file-transfer/+page.svelte rename to apps/desktop/src/routes/app/extension/file-transfer/+page.svelte diff --git a/apps/desktop/src/routes/extension/file-transfer/file-icon.svelte b/apps/desktop/src/routes/app/extension/file-transfer/file-icon.svelte similarity index 100% rename from apps/desktop/src/routes/extension/file-transfer/file-icon.svelte rename to apps/desktop/src/routes/app/extension/file-transfer/file-icon.svelte diff --git a/apps/desktop/src/routes/extension/permission-inspector/+page.svelte b/apps/desktop/src/routes/app/extension/permission-inspector/+page.svelte similarity index 100% rename from apps/desktop/src/routes/extension/permission-inspector/+page.svelte rename to apps/desktop/src/routes/app/extension/permission-inspector/+page.svelte diff --git a/apps/desktop/src/routes/extension/pin-screenshot/+page.svelte b/apps/desktop/src/routes/app/extension/pin-screenshot/+page.svelte similarity index 100% rename from apps/desktop/src/routes/extension/pin-screenshot/+page.svelte rename to apps/desktop/src/routes/app/extension/pin-screenshot/+page.svelte diff --git a/apps/desktop/src/routes/extension/store/+layout.svelte b/apps/desktop/src/routes/app/extension/store/+layout.svelte similarity index 100% rename from apps/desktop/src/routes/extension/store/+layout.svelte rename to apps/desktop/src/routes/app/extension/store/+layout.svelte diff --git a/apps/desktop/src/routes/extension/store/+page.svelte b/apps/desktop/src/routes/app/extension/store/+page.svelte similarity index 100% rename from apps/desktop/src/routes/extension/store/+page.svelte rename to apps/desktop/src/routes/app/extension/store/+page.svelte diff --git a/apps/desktop/src/routes/extension/store/+page.ts b/apps/desktop/src/routes/app/extension/store/+page.ts similarity index 100% rename from apps/desktop/src/routes/extension/store/+page.ts rename to apps/desktop/src/routes/app/extension/store/+page.ts diff --git a/apps/desktop/src/routes/extension/store/[identifier]/+error.svelte b/apps/desktop/src/routes/app/extension/store/[identifier]/+error.svelte similarity index 91% rename from apps/desktop/src/routes/extension/store/[identifier]/+error.svelte rename to apps/desktop/src/routes/app/extension/store/[identifier]/+error.svelte index 19b2b50..47a29d7 100644 --- a/apps/desktop/src/routes/extension/store/[identifier]/+error.svelte +++ b/apps/desktop/src/routes/app/extension/store/[identifier]/+error.svelte @@ -5,7 +5,7 @@ function handleKeyDown(event: KeyboardEvent) { if (event.key === "Enter") { - goto("/") + goto("/app/") } } @@ -17,7 +17,7 @@ title="Fail to Load Extension" class="w-fit max-w-screen-sm border-2 border-red-500" message={$page.error?.message ?? "Unknown Error"} - onGoBack={() => goto("/")} + onGoBack={() => goto("/app/")} rawJsonError={JSON.stringify($page, null, 2)} /> diff --git a/apps/desktop/src/routes/extension/store/[identifier]/+page.svelte b/apps/desktop/src/routes/app/extension/store/[identifier]/+page.svelte similarity index 98% rename from apps/desktop/src/routes/extension/store/[identifier]/+page.svelte rename to apps/desktop/src/routes/app/extension/store/[identifier]/+page.svelte index 55a7f97..80e0388 100644 --- a/apps/desktop/src/routes/extension/store/[identifier]/+page.svelte +++ b/apps/desktop/src/routes/app/extension/store/[identifier]/+page.svelte @@ -136,7 +136,7 @@ function handleKeydown(e: KeyboardEvent) { if (e.key === "Escape") { if (!delayedImageDialogOpen) { - goto("/extension/store") + goto("/app/extension/store") } } } @@ -148,7 +148,7 @@ size="icon" class={cn("fixed left-3 top-3", Constants.CLASSNAMES.BACK_BUTTON)} data-flip-id={Constants.CLASSNAMES.BACK_BUTTON} - onclick={() => goto("/extension/store")} + onclick={() => goto("/app/extension/store")} > diff --git a/apps/desktop/src/routes/extension/store/[identifier]/+page.ts b/apps/desktop/src/routes/app/extension/store/[identifier]/+page.ts similarity index 100% rename from apps/desktop/src/routes/extension/store/[identifier]/+page.ts rename to apps/desktop/src/routes/app/extension/store/[identifier]/+page.ts diff --git a/apps/desktop/src/routes/extension/ui-iframe/+page.svelte b/apps/desktop/src/routes/app/extension/ui-iframe/+page.svelte similarity index 99% rename from apps/desktop/src/routes/extension/ui-iframe/+page.svelte rename to apps/desktop/src/routes/app/extension/ui-iframe/+page.svelte index cd92fe7..d61618f 100644 --- a/apps/desktop/src/routes/extension/ui-iframe/+page.svelte +++ b/apps/desktop/src/routes/app/extension/ui-iframe/+page.svelte @@ -51,7 +51,7 @@ const iframeUiAPI: IUiIframeServer2 = { goBack: async () => { if (isInMainWindow()) { - goto("/") + goto("/app/") } else { appWin.close() } diff --git a/apps/desktop/src/routes/extension/ui-iframe/+page.ts b/apps/desktop/src/routes/app/extension/ui-iframe/+page.ts similarity index 97% rename from apps/desktop/src/routes/extension/ui-iframe/+page.ts rename to apps/desktop/src/routes/app/extension/ui-iframe/+page.ts index 94efd0c..abf2b94 100644 --- a/apps/desktop/src/routes/extension/ui-iframe/+page.ts +++ b/apps/desktop/src/routes/app/extension/ui-iframe/+page.ts @@ -24,7 +24,7 @@ export const load: PageLoad = async ({ if (!_extPath || !_extUrl) { toast.error("Invalid extension path or url") error("Invalid extension path or url") - goto("/") + goto("/app/") } const extPath = z.string().parse(_extPath) const extUrl = z.string().parse(_extUrl) @@ -36,7 +36,7 @@ export const load: PageLoad = async ({ toast.error("Error loading extension manifest", { description: `${err}` }) - goto("/") + goto("/app/") } const loadedExt = _loadedExt! const extInfoInDB = await db.getUniqueExtensionByPath(loadedExt.extPath) @@ -44,7 +44,7 @@ export const load: PageLoad = async ({ toast.error("Unexpected Error", { description: `Extension ${loadedExt.kunkun.identifier} not found in database. Run Troubleshooter.` }) - goto("/") + goto("/app/") } return { extPath, url: extUrl, loadedExt, extInfoInDB: extInfoInDB! } } diff --git a/apps/desktop/src/routes/extension/ui-worker/+page.svelte b/apps/desktop/src/routes/app/extension/ui-worker/+page.svelte similarity index 99% rename from apps/desktop/src/routes/extension/ui-worker/+page.svelte rename to apps/desktop/src/routes/app/extension/ui-worker/+page.svelte index 3be0770..d87aaba 100644 --- a/apps/desktop/src/routes/extension/ui-worker/+page.svelte +++ b/apps/desktop/src/routes/app/extension/ui-worker/+page.svelte @@ -63,7 +63,7 @@ async function goBack() { if (isInMainWindow()) { - goto("/") + goto("/app/") } else { appWin.close() } diff --git a/apps/desktop/src/routes/extension/ui-worker/+page.ts b/apps/desktop/src/routes/app/extension/ui-worker/+page.ts similarity index 98% rename from apps/desktop/src/routes/extension/ui-worker/+page.ts rename to apps/desktop/src/routes/app/extension/ui-worker/+page.ts index c9f3b03..e4f791c 100644 --- a/apps/desktop/src/routes/extension/ui-worker/+page.ts +++ b/apps/desktop/src/routes/app/extension/ui-worker/+page.ts @@ -27,7 +27,7 @@ export const load: PageLoad = async ({ url }) => { if (!extPath || !cmdName) { toast.error("Invalid extension path or url") error("Invalid extension path or url") - goto("/") + goto("/app/") } let _loadedExt: ExtPackageJsonExtra | undefined @@ -38,7 +38,7 @@ export const load: PageLoad = async ({ url }) => { toast.error("Error loading extension manifest", { description: `${err}` }) - goto("/") + goto("/app/") } const loadedExt = _loadedExt! const extInfoInDB = await db.getUniqueExtensionByPath(loadedExt.extPath) @@ -46,7 +46,7 @@ export const load: PageLoad = async ({ url }) => { toast.error("Unexpected Error", { description: `Extension ${loadedExt.kunkun.identifier} not found in database. Run Troubleshooter.` }) - goto("/") + goto("/app/") } const pkgJsonPath = await join(extPath!, "package.json") if (!(await exists(extPath!))) { diff --git a/apps/desktop/src/routes/settings/+layout.svelte b/apps/desktop/src/routes/app/settings/+layout.svelte similarity index 100% rename from apps/desktop/src/routes/settings/+layout.svelte rename to apps/desktop/src/routes/app/settings/+layout.svelte diff --git a/apps/desktop/src/routes/settings/+page.svelte b/apps/desktop/src/routes/app/settings/+page.svelte similarity index 100% rename from apps/desktop/src/routes/settings/+page.svelte rename to apps/desktop/src/routes/app/settings/+page.svelte diff --git a/apps/desktop/src/routes/settings/about/+page.svelte b/apps/desktop/src/routes/app/settings/about/+page.svelte similarity index 100% rename from apps/desktop/src/routes/settings/about/+page.svelte rename to apps/desktop/src/routes/app/settings/about/+page.svelte diff --git a/apps/desktop/src/routes/settings/add-dev-extension/+page.svelte b/apps/desktop/src/routes/app/settings/add-dev-extension/+page.svelte similarity index 100% rename from apps/desktop/src/routes/settings/add-dev-extension/+page.svelte rename to apps/desktop/src/routes/app/settings/add-dev-extension/+page.svelte diff --git a/apps/desktop/src/routes/settings/developer/+page.svelte b/apps/desktop/src/routes/app/settings/developer/+page.svelte similarity index 100% rename from apps/desktop/src/routes/settings/developer/+page.svelte rename to apps/desktop/src/routes/app/settings/developer/+page.svelte diff --git a/apps/desktop/src/routes/settings/extensions/+page.svelte b/apps/desktop/src/routes/app/settings/extensions/+page.svelte similarity index 100% rename from apps/desktop/src/routes/settings/extensions/+page.svelte rename to apps/desktop/src/routes/app/settings/extensions/+page.svelte diff --git a/apps/desktop/src/routes/settings/set-dev-ext-path/+page.svelte b/apps/desktop/src/routes/app/settings/set-dev-ext-path/+page.svelte similarity index 100% rename from apps/desktop/src/routes/settings/set-dev-ext-path/+page.svelte rename to apps/desktop/src/routes/app/settings/set-dev-ext-path/+page.svelte diff --git a/apps/desktop/src/routes/settings/sidebar.svelte b/apps/desktop/src/routes/app/settings/sidebar.svelte similarity index 90% rename from apps/desktop/src/routes/settings/sidebar.svelte rename to apps/desktop/src/routes/app/settings/sidebar.svelte index a5bfa86..de9a844 100644 --- a/apps/desktop/src/routes/settings/sidebar.svelte +++ b/apps/desktop/src/routes/app/settings/sidebar.svelte @@ -14,32 +14,32 @@ const items = [ { title: "General", - url: "/settings", + url: "/app/settings", icon: Cog }, { title: "Developer", - url: "/settings/developer", + url: "/app/settings/developer", icon: SquareTerminal }, { title: "Extensions", - url: "/settings/extensions", + url: "/app/settings/extensions", icon: Blocks }, { title: "Set Dev Extension", - url: "/settings/set-dev-ext-path", + url: "/app/settings/set-dev-ext-path", icon: Route }, { title: "Add Dev Extension", - url: "/settings/add-dev-extension", + url: "/app/settings/add-dev-extension", icon: FileCode2 }, { title: "About", - url: "/settings/about", + url: "/app/settings/about", icon: Info } ] diff --git a/apps/desktop/src/routes/troubleshooters/+layout.svelte b/apps/desktop/src/routes/app/troubleshooters/+layout.svelte similarity index 100% rename from apps/desktop/src/routes/troubleshooters/+layout.svelte rename to apps/desktop/src/routes/app/troubleshooters/+layout.svelte diff --git a/apps/desktop/src/routes/troubleshooters/extension-loading/+page.svelte b/apps/desktop/src/routes/app/troubleshooters/extension-loading/+page.svelte similarity index 100% rename from apps/desktop/src/routes/troubleshooters/extension-loading/+page.svelte rename to apps/desktop/src/routes/app/troubleshooters/extension-loading/+page.svelte diff --git a/apps/desktop/src/routes/troubleshooters/extension-window/+page.svelte b/apps/desktop/src/routes/app/troubleshooters/extension-window/+page.svelte similarity index 100% rename from apps/desktop/src/routes/troubleshooters/extension-window/+page.svelte rename to apps/desktop/src/routes/app/troubleshooters/extension-window/+page.svelte diff --git a/apps/desktop/src/routes/troubleshooters/mdns-debugger/+page.svelte b/apps/desktop/src/routes/app/troubleshooters/mdns-debugger/+page.svelte similarity index 100% rename from apps/desktop/src/routes/troubleshooters/mdns-debugger/+page.svelte rename to apps/desktop/src/routes/app/troubleshooters/mdns-debugger/+page.svelte diff --git a/apps/desktop/src/routes/troubleshooters/sidebar.svelte b/apps/desktop/src/routes/app/troubleshooters/sidebar.svelte similarity index 92% rename from apps/desktop/src/routes/troubleshooters/sidebar.svelte rename to apps/desktop/src/routes/app/troubleshooters/sidebar.svelte index c4f16aa..5cf0ca4 100644 --- a/apps/desktop/src/routes/troubleshooters/sidebar.svelte +++ b/apps/desktop/src/routes/app/troubleshooters/sidebar.svelte @@ -11,17 +11,17 @@ const items = [ { title: "Extension Loading", - url: "/troubleshooters/extension-loading", + url: "/app/troubleshooters/extension-loading", icon: Loader }, { title: "Extension Window", - url: "/troubleshooters/extension-window", + url: "/app/troubleshooters/extension-window", icon: AppWindow }, { title: "MDNS Debugger", - url: "/troubleshooters/mdns-debugger", + url: "/app/troubleshooters/mdns-debugger", icon: Network } ] diff --git a/apps/desktop/src/routes/splashscreen/+page.svelte b/apps/desktop/src/routes/splashscreen/+page.svelte new file mode 100644 index 0000000..d764d5a --- /dev/null +++ b/apps/desktop/src/routes/splashscreen/+page.svelte @@ -0,0 +1,32 @@ + + + +
+ Logo +

Kunkun

+
+
+ +