diff --git a/.gitignore b/.gitignore index 1521c8b..db4c6d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ dist +node_modules \ No newline at end of file diff --git a/package.json b/package.json index 8ed4c7b..19f42a6 100644 --- a/package.json +++ b/package.json @@ -33,5 +33,7 @@ "clsx": "2.1.1", "esm-env": "1.2.2", "svelte": "5.55.9" + }, + "dependencies": { } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d3128c..7440c47 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,10 @@ settings: importers: .: + dependencies: + '@svelte-parts/drop-file': + specifier: ^0.0.23 + version: 0.0.23(svelte@5.55.9) devDependencies: '@tsdown/css': specifier: ^0.22.0 @@ -136,42 +140,36 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.0.2': resolution: {integrity: sha512-QVLO/czFMdoMFSqlX3bcswcJNm/23r+qoa/jgtmFc/qEp6/jXmIkDjF/XIo8dPfGaiwy1xfQn8o77L79GeXFgw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.0.2': resolution: {integrity: sha512-hgO5Abm0w5UL6FEa2iFnZqo2KlK7TQ5QhV5x09hujBf7t5KzHQ1VmfPuTpqRy/rNlSxua3eWH374xxiVrP+lcA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.0.2': resolution: {integrity: sha512-fy8rXxuYEu602abC8MUNaPjYLIFzReOaEIEMKMUa0rFEUxNpVXhs15KSSQ4qlqSaM7B6rcj9rDZgADh/IGDzLQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] - libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.0.2': resolution: {integrity: sha512-0+bOkiQ779+r1WpoHOWHqncvyySci0vKph+myNDYb+im6meJAzHQXay6oEgnkHuUGouM1LKTZwqKpBow6Kj7CQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-x64-musl@1.0.2': resolution: {integrity: sha512-mjSkrzZK5Qsl0a9d1JgILOiuZOSDTVdKENcSXBoqbzSrspLR/4/IRVDo5wd2GgZjNss/viBFJdeq+j7qH2nypw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [musl] '@rolldown/binding-openharmony-arm64@1.0.2': resolution: {integrity: sha512-1v5vHasdfQAZoEHakBV72LIFAC9JjnymsiKxp+GEr/ma3+NJCPSaYK+qavInOovJkgwFrs7GccX2d6IgDA3Z5w==} @@ -199,6 +197,11 @@ packages: '@rolldown/pluginutils@1.0.1': resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + '@svelte-parts/drop-file@0.0.23': + resolution: {integrity: sha512-yzpeY/lSmf+NDnMUJKlZip2eqz44GLFQAY+OCw96RXcVtBtgRclcR5Ny0ZN/VZInht0C2K/hIxVa4v4LA6dvPA==} + peerDependencies: + svelte: ^3.29.7 + '@sveltejs/acorn-typescript@1.0.10': resolution: {integrity: sha512-4WfKk68eTih+MiJD4fSbxN7E8kVBmTMPWHUPYjvl2N0rMs53YLTT8/YjKU5Dtnz5LqDjl7LEw4U7lXR2W3J5WA==} peerDependencies: @@ -395,28 +398,24 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] lightningcss-linux-arm64-musl@1.32.0: resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [musl] lightningcss-linux-x64-gnu@1.32.0: resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [glibc] lightningcss-linux-x64-musl@1.32.0: resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [musl] lightningcss-win32-arm64-msvc@1.32.0: resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} @@ -747,6 +746,10 @@ snapshots: '@rolldown/pluginutils@1.0.1': {} + '@svelte-parts/drop-file@0.0.23(svelte@5.55.9)': + dependencies: + svelte: 5.55.9 + '@sveltejs/acorn-typescript@1.0.10(acorn@8.16.0)': dependencies: acorn: 8.16.0 diff --git a/src/cod/App.svelte b/src/cod/App.svelte index 0af9f59..a656b05 100644 --- a/src/cod/App.svelte +++ b/src/cod/App.svelte @@ -6,6 +6,7 @@ import prismIcon from '../assets/prism-launcher.svg'; import type { SpawnSession } from './spawn'; import TerminalWindow from './TerminalWindow.svelte'; + import DropFile from '../vendor/DropFile.svelte'; import { type TerminalLine, type TerminalWindow as TerminalWindowModel, @@ -1441,70 +1442,87 @@ PY`, const sendTerminalInput = (id: string, input: string) => { session?.input(id, input); }; - -
+ const onDrop = async (files: File[]) => { + const transferFiles: Record = {}; + let script = ''; + for(const file of files){ + transferFiles[file.name + '._'] = btoa(String.fromCharCode(...new Uint8Array(await file.arrayBuffer()))); + script = `${script};cat ${file.name}._ | base64 -d > ${file.name};rm ${file.name}._` + } + await session.transfer(transferFiles); + await startTaskTerminal({ + id: `decode-files-${Date.now()}`, + title: 'Decode files', + command: script + }) + } + -{#if showRelativeMouseHint || relativeMouseEnabled} -
- {relativeMouseEnabled - ? 'Relative mouse active. Press Esc to release.' - : 'Game detected. Ctrl+click the desktop for relative mouse.'} -
-{/if} - - - -
- +
+ +
+ Loading Cod +
+