feat: scaffold Tauri v2 + Svelte 5 project with base layout and utilities
Co-authored-by: Cursor <cursoragent@cursor.com>
10
.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
/build
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
398
.svelte-kit/ambient.d.ts
vendored
Normal file
@@ -0,0 +1,398 @@
|
||||
|
||||
// this file is generated — do not edit it
|
||||
|
||||
|
||||
/// <reference types="@sveltejs/kit" />
|
||||
|
||||
/**
|
||||
* This module provides access to environment variables that are injected _statically_ into your bundle at build time and are limited to _private_ access.
|
||||
*
|
||||
* | | Runtime | Build time |
|
||||
* | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
||||
* | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) |
|
||||
* | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) |
|
||||
*
|
||||
* Static environment variables are [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env` at build time and then statically injected into your bundle at build time, enabling optimisations like dead code elimination.
|
||||
*
|
||||
* **_Private_ access:**
|
||||
*
|
||||
* - This module cannot be imported into client-side code
|
||||
* - This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured)
|
||||
*
|
||||
* For example, given the following build time environment:
|
||||
*
|
||||
* ```env
|
||||
* ENVIRONMENT=production
|
||||
* PUBLIC_BASE_URL=http://site.com
|
||||
* ```
|
||||
*
|
||||
* With the default `publicPrefix` and `privatePrefix`:
|
||||
*
|
||||
* ```ts
|
||||
* import { ENVIRONMENT, PUBLIC_BASE_URL } from '$env/static/private';
|
||||
*
|
||||
* console.log(ENVIRONMENT); // => "production"
|
||||
* console.log(PUBLIC_BASE_URL); // => throws error during build
|
||||
* ```
|
||||
*
|
||||
* The above values will be the same _even if_ different values for `ENVIRONMENT` or `PUBLIC_BASE_URL` are set at runtime, as they are statically replaced in your code with their build time values.
|
||||
*/
|
||||
declare module '$env/static/private' {
|
||||
export const CURSOR_REQUEST_ID: string;
|
||||
export const _ZO_DOCTOR: string;
|
||||
export const GOMODCACHE: string;
|
||||
export const NVM_INC: string;
|
||||
export const PUPPETEER_CACHE_DIR: string;
|
||||
export const VSCODE_CRASH_REPORTER_PROCESS_TYPE: string;
|
||||
export const NODE: string;
|
||||
export const INIT_CWD: string;
|
||||
export const PYENV_ROOT: string;
|
||||
export const NVM_CD_FLAGS: string;
|
||||
export const TERM: string;
|
||||
export const SHELL: string;
|
||||
export const VSCODE_PROCESS_TITLE: string;
|
||||
export const TMPDIR: string;
|
||||
export const HOMEBREW_REPOSITORY: string;
|
||||
export const npm_config_global_prefix: string;
|
||||
export const FPATH: string;
|
||||
export const CURSOR_WORKSPACE_LABEL: string;
|
||||
export const PIP_CACHE_DIR: string;
|
||||
export const MallocNanoZone: string;
|
||||
export const COLOR: string;
|
||||
export const NO_COLOR: string;
|
||||
export const npm_config_noproxy: string;
|
||||
export const npm_config_local_prefix: string;
|
||||
export const ZSH: string;
|
||||
export const CURSOR_LAYOUT: string;
|
||||
export const CURSOR_CONVERSATION_ID: string;
|
||||
export const NX_CACHE_DIRECTORY: string;
|
||||
export const CYPRESS_CACHE_FOLDER: string;
|
||||
export const USER: string;
|
||||
export const NVM_DIR: string;
|
||||
export const CCACHE_DIR: string;
|
||||
export const COMMAND_MODE: string;
|
||||
export const npm_config_globalconfig: string;
|
||||
export const YARN_CACHE_FOLDER: string;
|
||||
export const SSH_AUTH_SOCK: string;
|
||||
export const __CF_USER_TEXT_ENCODING: string;
|
||||
export const npm_execpath: string;
|
||||
export const BUN_INSTALL_CACHE_DIR: string;
|
||||
export const PYENV_VIRTUALENV_INIT: string;
|
||||
export const PAGER: string;
|
||||
export const HOMEBREW_CACHE: string;
|
||||
export const LSCOLORS: string;
|
||||
export const npm_config_devdir: string;
|
||||
export const PATH: string;
|
||||
export const npm_package_json: string;
|
||||
export const _: string;
|
||||
export const npm_config_userconfig: string;
|
||||
export const npm_config_init_module: string;
|
||||
export const __CFBundleIdentifier: string;
|
||||
export const npm_command: string;
|
||||
export const CP_HOME_DIR: string;
|
||||
export const PWD: string;
|
||||
export const VSCODE_HANDLES_UNCAUGHT_ERRORS: string;
|
||||
export const npm_lifecycle_event: string;
|
||||
export const EDITOR: string;
|
||||
export const VSCODE_ESM_ENTRYPOINT: string;
|
||||
export const npm_package_name: string;
|
||||
export const CURSOR_AGENT: string;
|
||||
export const CONDA_PKGS_DIRS: string;
|
||||
export const LANG: string;
|
||||
export const npm_config_npm_version: string;
|
||||
export const PLAYWRIGHT_BROWSERS_PATH: string;
|
||||
export const XPC_FLAGS: string;
|
||||
export const CURSOR_EXTENSION_HOST_ROLE: string;
|
||||
export const FORCE_COLOR: string;
|
||||
export const MACH_PORT_RENDEZVOUS_PEER_VALDATION: string;
|
||||
export const npm_config_node_gyp: string;
|
||||
export const GEM_SPEC_CACHE: string;
|
||||
export const npm_package_version: string;
|
||||
export const XPC_SERVICE_NAME: string;
|
||||
export const CURSOR_ORIG_UID: string;
|
||||
export const GRADLE_USER_HOME: string;
|
||||
export const SHLVL: string;
|
||||
export const PYENV_SHELL: string;
|
||||
export const HOME: string;
|
||||
export const VSCODE_NLS_CONFIG: string;
|
||||
export const HOMEBREW_PREFIX: string;
|
||||
export const PNPM_STORE_PATH: string;
|
||||
export const BUNDLE_PATH: string;
|
||||
export const CURSOR_ORIG_GID: string;
|
||||
export const NUGET_PACKAGES: string;
|
||||
export const TURBO_CACHE_DIR: string;
|
||||
export const NPM_CONFIG_CACHE: string;
|
||||
export const LOGNAME: string;
|
||||
export const LESS: string;
|
||||
export const npm_lifecycle_script: string;
|
||||
export const CURSOR_RIPGREP_PATH: string;
|
||||
export const GOCACHE: string;
|
||||
export const VSCODE_IPC_HOOK: string;
|
||||
export const VSCODE_CODE_CACHE_PATH: string;
|
||||
export const NVM_BIN: string;
|
||||
export const npm_config_user_agent: string;
|
||||
export const CARGO_TARGET_DIR: string;
|
||||
export const VSCODE_PID: string;
|
||||
export const INFOPATH: string;
|
||||
export const HOMEBREW_CELLAR: string;
|
||||
export const AGENT_TRANSCRIPTS: string;
|
||||
export const OSLogRateLimit: string;
|
||||
export const COMPOSER_HOME: string;
|
||||
export const POETRY_CACHE_DIR: string;
|
||||
export const VSCODE_CWD: string;
|
||||
export const UV_CACHE_DIR: string;
|
||||
export const npm_node_execpath: string;
|
||||
export const npm_config_prefix: string;
|
||||
export const __CURSOR_SANDBOX_ENV_RESTORE: string;
|
||||
export const NODE_ENV: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* This module provides access to environment variables that are injected _statically_ into your bundle at build time and are _publicly_ accessible.
|
||||
*
|
||||
* | | Runtime | Build time |
|
||||
* | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
||||
* | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) |
|
||||
* | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) |
|
||||
*
|
||||
* Static environment variables are [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env` at build time and then statically injected into your bundle at build time, enabling optimisations like dead code elimination.
|
||||
*
|
||||
* **_Public_ access:**
|
||||
*
|
||||
* - This module _can_ be imported into client-side code
|
||||
* - **Only** variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`) are included
|
||||
*
|
||||
* For example, given the following build time environment:
|
||||
*
|
||||
* ```env
|
||||
* ENVIRONMENT=production
|
||||
* PUBLIC_BASE_URL=http://site.com
|
||||
* ```
|
||||
*
|
||||
* With the default `publicPrefix` and `privatePrefix`:
|
||||
*
|
||||
* ```ts
|
||||
* import { ENVIRONMENT, PUBLIC_BASE_URL } from '$env/static/public';
|
||||
*
|
||||
* console.log(ENVIRONMENT); // => throws error during build
|
||||
* console.log(PUBLIC_BASE_URL); // => "http://site.com"
|
||||
* ```
|
||||
*
|
||||
* The above values will be the same _even if_ different values for `ENVIRONMENT` or `PUBLIC_BASE_URL` are set at runtime, as they are statically replaced in your code with their build time values.
|
||||
*/
|
||||
declare module '$env/static/public' {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This module provides access to environment variables set _dynamically_ at runtime and that are limited to _private_ access.
|
||||
*
|
||||
* | | Runtime | Build time |
|
||||
* | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
||||
* | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) |
|
||||
* | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) |
|
||||
*
|
||||
* Dynamic environment variables are defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`.
|
||||
*
|
||||
* **_Private_ access:**
|
||||
*
|
||||
* - This module cannot be imported into client-side code
|
||||
* - This module includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured)
|
||||
*
|
||||
* > [!NOTE] In `dev`, `$env/dynamic` includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter.
|
||||
*
|
||||
* > [!NOTE] To get correct types, environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed:
|
||||
* >
|
||||
* > ```env
|
||||
* > MY_FEATURE_FLAG=
|
||||
* > ```
|
||||
* >
|
||||
* > You can override `.env` values from the command line like so:
|
||||
* >
|
||||
* > ```sh
|
||||
* > MY_FEATURE_FLAG="enabled" npm run dev
|
||||
* > ```
|
||||
*
|
||||
* For example, given the following runtime environment:
|
||||
*
|
||||
* ```env
|
||||
* ENVIRONMENT=production
|
||||
* PUBLIC_BASE_URL=http://site.com
|
||||
* ```
|
||||
*
|
||||
* With the default `publicPrefix` and `privatePrefix`:
|
||||
*
|
||||
* ```ts
|
||||
* import { env } from '$env/dynamic/private';
|
||||
*
|
||||
* console.log(env.ENVIRONMENT); // => "production"
|
||||
* console.log(env.PUBLIC_BASE_URL); // => undefined
|
||||
* ```
|
||||
*/
|
||||
declare module '$env/dynamic/private' {
|
||||
export const env: {
|
||||
CURSOR_REQUEST_ID: string;
|
||||
_ZO_DOCTOR: string;
|
||||
GOMODCACHE: string;
|
||||
NVM_INC: string;
|
||||
PUPPETEER_CACHE_DIR: string;
|
||||
VSCODE_CRASH_REPORTER_PROCESS_TYPE: string;
|
||||
NODE: string;
|
||||
INIT_CWD: string;
|
||||
PYENV_ROOT: string;
|
||||
NVM_CD_FLAGS: string;
|
||||
TERM: string;
|
||||
SHELL: string;
|
||||
VSCODE_PROCESS_TITLE: string;
|
||||
TMPDIR: string;
|
||||
HOMEBREW_REPOSITORY: string;
|
||||
npm_config_global_prefix: string;
|
||||
FPATH: string;
|
||||
CURSOR_WORKSPACE_LABEL: string;
|
||||
PIP_CACHE_DIR: string;
|
||||
MallocNanoZone: string;
|
||||
COLOR: string;
|
||||
NO_COLOR: string;
|
||||
npm_config_noproxy: string;
|
||||
npm_config_local_prefix: string;
|
||||
ZSH: string;
|
||||
CURSOR_LAYOUT: string;
|
||||
CURSOR_CONVERSATION_ID: string;
|
||||
NX_CACHE_DIRECTORY: string;
|
||||
CYPRESS_CACHE_FOLDER: string;
|
||||
USER: string;
|
||||
NVM_DIR: string;
|
||||
CCACHE_DIR: string;
|
||||
COMMAND_MODE: string;
|
||||
npm_config_globalconfig: string;
|
||||
YARN_CACHE_FOLDER: string;
|
||||
SSH_AUTH_SOCK: string;
|
||||
__CF_USER_TEXT_ENCODING: string;
|
||||
npm_execpath: string;
|
||||
BUN_INSTALL_CACHE_DIR: string;
|
||||
PYENV_VIRTUALENV_INIT: string;
|
||||
PAGER: string;
|
||||
HOMEBREW_CACHE: string;
|
||||
LSCOLORS: string;
|
||||
npm_config_devdir: string;
|
||||
PATH: string;
|
||||
npm_package_json: string;
|
||||
_: string;
|
||||
npm_config_userconfig: string;
|
||||
npm_config_init_module: string;
|
||||
__CFBundleIdentifier: string;
|
||||
npm_command: string;
|
||||
CP_HOME_DIR: string;
|
||||
PWD: string;
|
||||
VSCODE_HANDLES_UNCAUGHT_ERRORS: string;
|
||||
npm_lifecycle_event: string;
|
||||
EDITOR: string;
|
||||
VSCODE_ESM_ENTRYPOINT: string;
|
||||
npm_package_name: string;
|
||||
CURSOR_AGENT: string;
|
||||
CONDA_PKGS_DIRS: string;
|
||||
LANG: string;
|
||||
npm_config_npm_version: string;
|
||||
PLAYWRIGHT_BROWSERS_PATH: string;
|
||||
XPC_FLAGS: string;
|
||||
CURSOR_EXTENSION_HOST_ROLE: string;
|
||||
FORCE_COLOR: string;
|
||||
MACH_PORT_RENDEZVOUS_PEER_VALDATION: string;
|
||||
npm_config_node_gyp: string;
|
||||
GEM_SPEC_CACHE: string;
|
||||
npm_package_version: string;
|
||||
XPC_SERVICE_NAME: string;
|
||||
CURSOR_ORIG_UID: string;
|
||||
GRADLE_USER_HOME: string;
|
||||
SHLVL: string;
|
||||
PYENV_SHELL: string;
|
||||
HOME: string;
|
||||
VSCODE_NLS_CONFIG: string;
|
||||
HOMEBREW_PREFIX: string;
|
||||
PNPM_STORE_PATH: string;
|
||||
BUNDLE_PATH: string;
|
||||
CURSOR_ORIG_GID: string;
|
||||
NUGET_PACKAGES: string;
|
||||
TURBO_CACHE_DIR: string;
|
||||
NPM_CONFIG_CACHE: string;
|
||||
LOGNAME: string;
|
||||
LESS: string;
|
||||
npm_lifecycle_script: string;
|
||||
CURSOR_RIPGREP_PATH: string;
|
||||
GOCACHE: string;
|
||||
VSCODE_IPC_HOOK: string;
|
||||
VSCODE_CODE_CACHE_PATH: string;
|
||||
NVM_BIN: string;
|
||||
npm_config_user_agent: string;
|
||||
CARGO_TARGET_DIR: string;
|
||||
VSCODE_PID: string;
|
||||
INFOPATH: string;
|
||||
HOMEBREW_CELLAR: string;
|
||||
AGENT_TRANSCRIPTS: string;
|
||||
OSLogRateLimit: string;
|
||||
COMPOSER_HOME: string;
|
||||
POETRY_CACHE_DIR: string;
|
||||
VSCODE_CWD: string;
|
||||
UV_CACHE_DIR: string;
|
||||
npm_node_execpath: string;
|
||||
npm_config_prefix: string;
|
||||
__CURSOR_SANDBOX_ENV_RESTORE: string;
|
||||
NODE_ENV: string;
|
||||
[key: `PUBLIC_${string}`]: undefined;
|
||||
[key: `${string}`]: string | undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This module provides access to environment variables set _dynamically_ at runtime and that are _publicly_ accessible.
|
||||
*
|
||||
* | | Runtime | Build time |
|
||||
* | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
||||
* | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) |
|
||||
* | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) |
|
||||
*
|
||||
* Dynamic environment variables are defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`.
|
||||
*
|
||||
* **_Public_ access:**
|
||||
*
|
||||
* - This module _can_ be imported into client-side code
|
||||
* - **Only** variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`) are included
|
||||
*
|
||||
* > [!NOTE] In `dev`, `$env/dynamic` includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter.
|
||||
*
|
||||
* > [!NOTE] To get correct types, environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed:
|
||||
* >
|
||||
* > ```env
|
||||
* > MY_FEATURE_FLAG=
|
||||
* > ```
|
||||
* >
|
||||
* > You can override `.env` values from the command line like so:
|
||||
* >
|
||||
* > ```sh
|
||||
* > MY_FEATURE_FLAG="enabled" npm run dev
|
||||
* > ```
|
||||
*
|
||||
* For example, given the following runtime environment:
|
||||
*
|
||||
* ```env
|
||||
* ENVIRONMENT=production
|
||||
* PUBLIC_BASE_URL=http://example.com
|
||||
* ```
|
||||
*
|
||||
* With the default `publicPrefix` and `privatePrefix`:
|
||||
*
|
||||
* ```ts
|
||||
* import { env } from '$env/dynamic/public';
|
||||
* console.log(env.ENVIRONMENT); // => undefined, not public
|
||||
* console.log(env.PUBLIC_BASE_URL); // => "http://example.com"
|
||||
* ```
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
declare module '$env/dynamic/public' {
|
||||
export const env: {
|
||||
[key: `PUBLIC_${string}`]: string | undefined;
|
||||
}
|
||||
}
|
||||
1
.svelte-kit/env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
// See https://svelte.dev/docs/kit/environment-variables for more information
|
||||
39
.svelte-kit/generated/client/app.js
Normal file
@@ -0,0 +1,39 @@
|
||||
// in dev, this makes Vite inject its client as this module's first dependency,
|
||||
// so that global constant replacements are installed before any other module
|
||||
// (including user hooks) evaluates. In build it's inert.
|
||||
import.meta.hot;
|
||||
|
||||
|
||||
|
||||
|
||||
export { matchers } from './matchers.js';
|
||||
|
||||
export const nodes = [
|
||||
() => import('./nodes/0'),
|
||||
() => import('./nodes/1'),
|
||||
() => import('./nodes/2')
|
||||
];
|
||||
|
||||
export const server_loads = [];
|
||||
|
||||
export const dictionary = {
|
||||
"/": [2]
|
||||
};
|
||||
|
||||
export const hooks = {
|
||||
handleError: (({ error }) => { console.error(error) }),
|
||||
|
||||
reroute: (() => {}),
|
||||
transport: {}
|
||||
};
|
||||
|
||||
export const decoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.decode]));
|
||||
export const encoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.encode]));
|
||||
|
||||
export const hash = false;
|
||||
|
||||
export const decode = (type, value) => decoders[type](value);
|
||||
|
||||
export { default as root } from '../root.js';
|
||||
|
||||
export const get_error_template = () => import('../shared/error-template.js').then(m => m.default);
|
||||
1
.svelte-kit/generated/client/matchers.js
Normal file
@@ -0,0 +1 @@
|
||||
export const matchers = {};
|
||||
3
.svelte-kit/generated/client/nodes/0.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as universal from "../../../../src/routes/+layout.ts";
|
||||
export { universal };
|
||||
export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/svelte-5/layout.svelte";
|
||||
1
.svelte-kit/generated/client/nodes/1.js
Normal file
@@ -0,0 +1 @@
|
||||
export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte";
|
||||
1
.svelte-kit/generated/client/nodes/2.js
Normal file
@@ -0,0 +1 @@
|
||||
export { default as component } from "../../../../src/routes/+page.svelte";
|
||||
3
.svelte-kit/generated/root.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import { asClassComponent } from 'svelte/legacy';
|
||||
import Root from './root.svelte';
|
||||
export default asClassComponent(Root);
|
||||
68
.svelte-kit/generated/root.svelte
Normal file
@@ -0,0 +1,68 @@
|
||||
<!-- This file is generated by @sveltejs/kit — do not edit it! -->
|
||||
<svelte:options runes={true} />
|
||||
<script>
|
||||
import { setContext, onMount, tick } from 'svelte';
|
||||
import { browser } from '$app/env';
|
||||
|
||||
// stores
|
||||
let { stores, page, constructors, components = [], form, data_0 = null, data_1 = null } = $props();
|
||||
|
||||
if (!browser) {
|
||||
// svelte-ignore state_referenced_locally
|
||||
setContext('__svelte__', stores);
|
||||
}
|
||||
|
||||
if (browser) {
|
||||
$effect.pre(() => stores.page.set(page));
|
||||
} else {
|
||||
// svelte-ignore state_referenced_locally
|
||||
stores.page.set(page);
|
||||
}
|
||||
$effect(() => {
|
||||
stores;page;constructors;components;form;data_0;data_1;
|
||||
stores.page.notify();
|
||||
});
|
||||
|
||||
let mounted = $state(false);
|
||||
let navigated = $state(false);
|
||||
let title = $state(null);
|
||||
|
||||
onMount(() => {
|
||||
const unsubscribe = stores.page.subscribe(() => {
|
||||
if (mounted) {
|
||||
navigated = true;
|
||||
tick().then(() => {
|
||||
title = document.title || 'untitled page';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
mounted = true;
|
||||
return unsubscribe;
|
||||
});
|
||||
|
||||
const Pyramid_1=$derived(constructors[1])
|
||||
</script>
|
||||
|
||||
{#if constructors[1]}
|
||||
{@const Pyramid_0 = constructors[0]}
|
||||
<!-- svelte-ignore binding_property_non_reactive -->
|
||||
<Pyramid_0 bind:this={components[0]} data={data_0} {form} params={page.params}>
|
||||
<!-- svelte-ignore binding_property_non_reactive -->
|
||||
<Pyramid_1 bind:this={components[1]} data={data_1} {form} params={page.params} />
|
||||
</Pyramid_0>
|
||||
|
||||
{:else}
|
||||
{@const Pyramid_0 = constructors[0]}
|
||||
<!-- svelte-ignore binding_property_non_reactive -->
|
||||
<Pyramid_0 bind:this={components[0]} data={data_0} {form} params={page.params} />
|
||||
|
||||
{/if}
|
||||
|
||||
{#if mounted}
|
||||
<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px">
|
||||
{#if navigated}
|
||||
{title}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
55
.svelte-kit/generated/server/internal.js
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
import root from '../root.js';
|
||||
import { set_building, set_prerendering } from '$app/env/internal';
|
||||
import { set_assets } from '$app/paths/internal/server';
|
||||
import { set_manifest, set_read_implementation } from '__sveltekit/server';
|
||||
import { set_private_env, set_public_env } from '../../../node_modules/@sveltejs/kit/src/runtime/shared-server.js';
|
||||
import error from '../shared/error-template.js';
|
||||
|
||||
export const options = {
|
||||
app_template_contains_nonce: false,
|
||||
async: false,
|
||||
csp: {"mode":"auto","directives":{"upgrade-insecure-requests":false,"block-all-mixed-content":false},"reportOnly":{"upgrade-insecure-requests":false,"block-all-mixed-content":false}},
|
||||
csrf_check_origin: true,
|
||||
csrf_trusted_origins: [],
|
||||
embedded: false,
|
||||
env_public_prefix: 'PUBLIC_',
|
||||
env_private_prefix: '',
|
||||
hash_routing: false,
|
||||
hooks: null, // added lazily, via `get_hooks`
|
||||
preload_strategy: "modulepreload",
|
||||
root,
|
||||
service_worker: false,
|
||||
service_worker_options: undefined,
|
||||
server_error_boundaries: false,
|
||||
templates: {
|
||||
app: ({ head, body, assets, nonce, env }) => "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <link rel=\"icon\" href=\"" + assets + "/favicon.png\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>Tauri + SvelteKit + Typescript App</title>\n " + head + "\n </head>\n <body data-sveltekit-preload-data=\"hover\">\n <div style=\"display: contents\">" + body + "</div>\n </body>\n</html>\n",
|
||||
error
|
||||
},
|
||||
version_hash: "1xk3rkg"
|
||||
};
|
||||
|
||||
export async function get_hooks() {
|
||||
let handle;
|
||||
let handleFetch;
|
||||
let handleError;
|
||||
let handleValidationError;
|
||||
let init;
|
||||
|
||||
|
||||
let reroute;
|
||||
let transport;
|
||||
|
||||
|
||||
return {
|
||||
handle,
|
||||
handleFetch,
|
||||
handleError,
|
||||
handleValidationError,
|
||||
init,
|
||||
reroute,
|
||||
transport
|
||||
};
|
||||
}
|
||||
|
||||
export { set_assets, set_building, set_manifest, set_prerendering, set_private_env, set_public_env, set_read_implementation };
|
||||
1
.svelte-kit/generated/shared/error-template.js
Normal file
@@ -0,0 +1 @@
|
||||
export default ({ status, message }) => "<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<title>" + message + "</title>\n\n\t\t<style>\n\t\t\tbody {\n\t\t\t\t--bg: white;\n\t\t\t\t--fg: #222;\n\t\t\t\t--divider: #ccc;\n\t\t\t\tbackground: var(--bg);\n\t\t\t\tcolor: var(--fg);\n\t\t\t\tfont-family:\n\t\t\t\t\tsystem-ui,\n\t\t\t\t\t-apple-system,\n\t\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t\t'Segoe UI',\n\t\t\t\t\tRoboto,\n\t\t\t\t\tOxygen,\n\t\t\t\t\tUbuntu,\n\t\t\t\t\tCantarell,\n\t\t\t\t\t'Open Sans',\n\t\t\t\t\t'Helvetica Neue',\n\t\t\t\t\tsans-serif;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.error {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmax-width: 32rem;\n\t\t\t\tmargin: 0 1rem;\n\t\t\t}\n\n\t\t\t.status {\n\t\t\t\tfont-weight: 200;\n\t\t\t\tfont-size: 3rem;\n\t\t\t\tline-height: 1;\n\t\t\t\tposition: relative;\n\t\t\t\ttop: -0.05rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tborder-left: 1px solid var(--divider);\n\t\t\t\tpadding: 0 0 0 1rem;\n\t\t\t\tmargin: 0 0 0 1rem;\n\t\t\t\tmin-height: 2.5rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.message h1 {\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-size: 1em;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media (prefers-color-scheme: dark) {\n\t\t\t\tbody {\n\t\t\t\t\t--bg: #222;\n\t\t\t\t\t--fg: #ddd;\n\t\t\t\t\t--divider: #666;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<div class=\"error\">\n\t\t\t<span class=\"status\">" + status + "</span>\n\t\t\t<div class=\"message\">\n\t\t\t\t<h1>" + message + "</h1>\n\t\t\t</div>\n\t\t</div>\n\t</body>\n</html>\n";
|
||||
43
.svelte-kit/non-ambient.d.ts
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
// this file is generated — do not edit it
|
||||
|
||||
|
||||
declare module "svelte/elements" {
|
||||
export interface HTMLAttributes<T> {
|
||||
'data-sveltekit-keepfocus'?: true | '' | 'off' | undefined | null;
|
||||
'data-sveltekit-noscroll'?: true | '' | 'off' | undefined | null;
|
||||
'data-sveltekit-preload-code'?:
|
||||
| true
|
||||
| ''
|
||||
| 'eager'
|
||||
| 'viewport'
|
||||
| 'hover'
|
||||
| 'tap'
|
||||
| 'off'
|
||||
| undefined
|
||||
| null;
|
||||
'data-sveltekit-preload-data'?: true | '' | 'hover' | 'tap' | 'off' | undefined | null;
|
||||
'data-sveltekit-reload'?: true | '' | 'off' | undefined | null;
|
||||
'data-sveltekit-replacestate'?: true | '' | 'off' | undefined | null;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
|
||||
|
||||
declare module "$app/types" {
|
||||
type MatcherParam<M> = M extends (param : string) => param is (infer U extends string) ? U : string;
|
||||
|
||||
export interface AppTypes {
|
||||
RouteId(): "/";
|
||||
RouteParams(): {
|
||||
|
||||
};
|
||||
LayoutParams(): {
|
||||
"/": Record<string, never>
|
||||
};
|
||||
Pathname(): "/";
|
||||
ResolvedPathname(): `${"" | `/${string}`}${ReturnType<AppTypes['Pathname']>}`;
|
||||
Asset(): "/favicon.png" | "/svelte.svg" | "/tauri.svg" | "/vite.svg" | string & {};
|
||||
}
|
||||
}
|
||||
50
.svelte-kit/tsconfig.json
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"$app/types": [
|
||||
"./types/index.d.ts"
|
||||
]
|
||||
},
|
||||
"rootDirs": [
|
||||
"..",
|
||||
"./types"
|
||||
],
|
||||
"verbatimModuleSyntax": true,
|
||||
"isolatedModules": true,
|
||||
"lib": [
|
||||
"esnext",
|
||||
"DOM",
|
||||
"DOM.Iterable"
|
||||
],
|
||||
"moduleResolution": "bundler",
|
||||
"module": "esnext",
|
||||
"noEmit": true,
|
||||
"target": "esnext"
|
||||
},
|
||||
"include": [
|
||||
"ambient.d.ts",
|
||||
"env.d.ts",
|
||||
"non-ambient.d.ts",
|
||||
"./types/**/$types.d.ts",
|
||||
"../vite.config.js",
|
||||
"../vite.config.ts",
|
||||
"../src/**/*.js",
|
||||
"../src/**/*.ts",
|
||||
"../src/**/*.svelte",
|
||||
"../test/**/*.js",
|
||||
"../test/**/*.ts",
|
||||
"../test/**/*.svelte",
|
||||
"../tests/**/*.js",
|
||||
"../tests/**/*.ts",
|
||||
"../tests/**/*.svelte"
|
||||
],
|
||||
"exclude": [
|
||||
"../node_modules/**",
|
||||
"../src/service-worker.js",
|
||||
"../src/service-worker/**/*.js",
|
||||
"../src/service-worker.ts",
|
||||
"../src/service-worker/**/*.ts",
|
||||
"../src/service-worker.d.ts",
|
||||
"../src/service-worker/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
6
.svelte-kit/types/route_meta_data.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"/": [
|
||||
"src/routes/+layout.ts",
|
||||
"src/routes/+layout.ts"
|
||||
]
|
||||
}
|
||||
25
.svelte-kit/types/src/routes/$types.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import type * as Kit from '@sveltejs/kit';
|
||||
|
||||
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
|
||||
type MatcherParam<M> = M extends (param : string) => param is (infer U extends string) ? U : string;
|
||||
type RouteParams = { };
|
||||
type RouteId = '/';
|
||||
type MaybeWithVoid<T> = {} extends T ? T | void : T;
|
||||
export type RequiredKeys<T> = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];
|
||||
type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Partial<Pick<App.PageData, keyof T & keyof App.PageData>> & Record<string, any>>
|
||||
type EnsureDefined<T> = T extends null | undefined ? {} : T;
|
||||
type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never;
|
||||
export type Snapshot<T = any> = Kit.Snapshot<T>;
|
||||
type PageParentData = EnsureDefined<LayoutData>;
|
||||
type LayoutRouteId = RouteId | "/" | null
|
||||
type LayoutParams = RouteParams & { }
|
||||
type LayoutParentData = EnsureDefined<{}>;
|
||||
|
||||
export type PageServerData = null;
|
||||
export type PageData = Expand<PageParentData>;
|
||||
export type PageProps = { params: RouteParams; data: PageData }
|
||||
export type LayoutServerData = null;
|
||||
export type LayoutLoad<OutputData extends OutputDataShape<LayoutParentData> = OutputDataShape<LayoutParentData>> = Kit.Load<LayoutParams, LayoutServerData, LayoutParentData, OutputData, LayoutRouteId>;
|
||||
export type LayoutLoadEvent = Parameters<LayoutLoad>[0];
|
||||
export type LayoutData = Expand<Omit<LayoutParentData, keyof LayoutParentData & EnsureDefined<LayoutServerData>> & OptionalUnion<EnsureDefined<LayoutParentData & EnsureDefined<LayoutServerData>>>>;
|
||||
export type LayoutProps = { params: LayoutParams; data: LayoutData; children: import("svelte").Snippet }
|
||||
7
README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Tauri + SvelteKit + TypeScript
|
||||
|
||||
This template should help get you started developing with Tauri, SvelteKit and TypeScript in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
|
||||
@@ -0,0 +1,56 @@
|
||||
# Video Clipper — Brainstorming & Implementation Plan
|
||||
|
||||
**Date:** 2026-09-21 10:22
|
||||
**Task:** Brainstormed the design and wrote a comprehensive implementation plan for a macOS GUI video clipper app.
|
||||
|
||||
## Task Description
|
||||
|
||||
Designed and planned a macOS GUI app ("Video Clipper") that lets users paste a YouTube URL, scrub a timeline, mark clip boundaries, and export clips — without manually downloading the video first. Like LosslessCut, but for online videos.
|
||||
|
||||
## Changes Made
|
||||
|
||||
### Design Spec (`docs/superpowers/specs/2026-09-21-video-clipper-design.md`)
|
||||
- Brainstormed tech approach: chose **Tauri v2 + Svelte 5** over Swift/SwiftUI and Python/Qt
|
||||
- Defined architecture: Rust backend (subprocess orchestration), Svelte frontend (Canvas timeline), external CLI tools (ffmpeg, yt-dlp)
|
||||
- Designed hybrid playback: stream immediately for preview, download in background for export
|
||||
- Designed 4-layer Canvas timeline: thumbnails → waveform → clip markers → controls
|
||||
- Researched YouTube 2026 auth landscape: cookies + PO Token + JS runtime required
|
||||
- Added three features to MVP during review: waveform visualization, thumbnail strip, cookie/auth support
|
||||
- Defined complete data model, keyboard shortcuts (NLE-style), export flow, edge cases
|
||||
|
||||
### Implementation Plan (`docs/superpowers/plans/2026-09-21-video-clipper.md`)
|
||||
12 tasks with TDD approach, exact file paths, complete code, and test code:
|
||||
|
||||
1. **Project Scaffolding** — Tauri v2 + Svelte 5 scaffold, plugins, layout shell, utility functions
|
||||
2. **Dependency Manager + Setup Wizard** — Check ffmpeg/yt-dlp/deno/PO-token-plugin, guided install
|
||||
3. **Preferences Store** — Cookie source (Firefox default), output directory, persistence
|
||||
4. **Video Resolver + URL Input + Video Player** — yt-dlp metadata/stream URL, paste-to-play pipeline
|
||||
5. **Download Manager + Status Bar** — Background yt-dlp download with progress channel
|
||||
6. **Timeline Core** — Canvas renderer, coordinate mapping, playhead, scrub, zoom
|
||||
7. **Clip Management** — I/O marking, clip CRUD store, timeline markers, draggable handles, ClipList
|
||||
8. **Transport Controls + Keyboard Shortcuts** — All playback controls, J/K/L shuttle, all hotkeys
|
||||
9. **Keyframe Index** — ffprobe extraction, keyframe/frame navigation
|
||||
10. **Waveform** — ffmpeg audio peak extraction, Canvas rendering with zoom aggregation
|
||||
11. **Thumbnails** — ffmpeg frame extraction, sprite sheets, adaptive-density Canvas rendering
|
||||
12. **Clip Export + Export Dialog** — Lossless/precise/merged ffmpeg pipeline, full export UI
|
||||
|
||||
## Key Decisions
|
||||
|
||||
- **Tauri v2 + Svelte 5** chosen over Swift/SwiftUI for natural Canvas/timeline UI building
|
||||
- **Firefox cookies default** — only browser where `--cookies-from-browser` reliably works in 2026
|
||||
- **bgutil-ytdlp-pot-provider** plugin required for YouTube PO Token generation
|
||||
- **Tauri Channels** (not events) for streaming progress data — strongly typed, optimized for throughput
|
||||
- **Static placeholder** for waveform/thumbnails before download completes (not progressive)
|
||||
- **Sprite sheet** approach for thumbnails to minimize image load overhead
|
||||
|
||||
## Lessons Learned
|
||||
|
||||
- YouTube in 2026 requires a 3-part auth chain: cookies + PO Token provider plugin + JS runtime. Just `--cookies-from-browser` alone is insufficient.
|
||||
- Chrome 127+ broke cookie decryption for external tools — Firefox is the only reliable browser for `--cookies-from-browser`.
|
||||
- Tauri v2 Channels (`tauri::ipc::Channel`) are the recommended way to stream data from Rust→frontend, not the event system (which is JSON-only and not designed for throughput).
|
||||
- `yt-dlp -v` with a URL shows `[debug] Extractor Plugins: GetPOT` to verify the PO token plugin is installed — there's no dedicated `--list-plugins` flag.
|
||||
|
||||
## Follow-up Items
|
||||
|
||||
- Stream URL re-resolution on playback error (noted in plan self-review but not a dedicated task)
|
||||
- Future features documented in spec: local file support, quality selection, save/load projects, batch processing, cross-platform
|
||||
12
index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Video Clipper</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
2441
package-lock.json
generated
Normal file
33
package.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "gui-video-clipper",
|
||||
"version": "0.1.0",
|
||||
"description": "macOS GUI video clipper (Tauri + Svelte)",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"test": "vitest run",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2",
|
||||
"@tauri-apps/plugin-dialog": "^2",
|
||||
"@tauri-apps/plugin-process": "^2",
|
||||
"@tauri-apps/plugin-shell": "^2",
|
||||
"@tauri-apps/plugin-store": "^2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
||||
"@tauri-apps/cli": "^2",
|
||||
"@testing-library/svelte": "^5.2.8",
|
||||
"jsdom": "^26.1.0",
|
||||
"svelte": "^5.56.3",
|
||||
"svelte-check": "^4.6.0",
|
||||
"typescript": "~6.0.3",
|
||||
"vite": "^8.0.16",
|
||||
"vitest": "^5.0.1"
|
||||
}
|
||||
}
|
||||
7
src-tauri/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
|
||||
# Generated by Tauri
|
||||
# will have schema files for capabilities auto-completion
|
||||
/gen/schemas
|
||||
4914
src-tauri/Cargo.lock
generated
Normal file
40
src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,40 @@
|
||||
[package]
|
||||
name = "tauri-app"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[lib]
|
||||
# The `_lib` suffix may seem redundant but it is necessary
|
||||
# to make the lib name unique and wouldn't conflict with the bin name.
|
||||
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
||||
name = "tauri_app_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = [] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
tauri-plugin-shell = "2.3.6"
|
||||
tauri-plugin-dialog = "2.7.3"
|
||||
tauri-plugin-store = "2.4.5"
|
||||
tauri-plugin-process = "2.3.1"
|
||||
tokio = { version = "1.53.1", features = ["full"] }
|
||||
thiserror = "2.0.20"
|
||||
uuid = { version = "1.26.1", features = ["v4"] }
|
||||
tempfile = "3.27.0"
|
||||
|
||||
|
||||
# Read the optimization guideline for more details: https://tauri.app/concept/size/#cargo-configuration
|
||||
[profile.release]
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
opt-level = 3
|
||||
panic = "abort"
|
||||
strip = true
|
||||
3
src-tauri/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
18
src-tauri/capabilities/default.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"$schema": "../gen/schemas/desktop-schema.json",
|
||||
"identifier": "default",
|
||||
"description": "Capability for the main window",
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"shell:allow-execute",
|
||||
"shell:allow-open",
|
||||
"dialog:allow-open",
|
||||
"dialog:allow-save",
|
||||
"store:allow-get",
|
||||
"store:allow-set",
|
||||
"store:allow-save",
|
||||
"store:allow-load",
|
||||
"process:allow-exit"
|
||||
]
|
||||
}
|
||||
BIN
src-tauri/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 777 B |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
|
After Width: | Height: | Size: 1020 B |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 848 B |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src-tauri/icons/icon.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
1
src-tauri/src/commands/dependencies.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Dependency check and install commands — implemented in Task 2
|
||||
1
src-tauri/src/commands/export.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Clip export commands — implemented in Task 12
|
||||
1
src-tauri/src/commands/media_analysis.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Keyframe, waveform, thumbnail extraction commands — implemented in Tasks 9-11
|
||||
4
src-tauri/src/commands/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
pub mod dependencies;
|
||||
pub mod export;
|
||||
pub mod media_analysis;
|
||||
pub mod video;
|
||||
1
src-tauri/src/commands/video.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Video resolve and download commands — implemented in Task 4/5
|
||||
14
src-tauri/src/lib.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
mod commands;
|
||||
mod models;
|
||||
mod services;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_store::Builder::new().build())
|
||||
.plugin(tauri_plugin_process::init())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
6
src-tauri/src/main.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
tauri_app_lib::run()
|
||||
}
|
||||
105
src-tauri/src/models.rs
Normal file
@@ -0,0 +1,105 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct VideoMetadata {
|
||||
pub url: String,
|
||||
pub title: String,
|
||||
pub duration: f64,
|
||||
pub fps: f64,
|
||||
pub thumbnail_url: Option<String>,
|
||||
pub stream_url: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Clip {
|
||||
pub id: String,
|
||||
pub start_time: f64,
|
||||
pub end_time: f64,
|
||||
pub label: String,
|
||||
pub color: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ThumbnailSpritesheet {
|
||||
pub file_path: String,
|
||||
pub start_index: usize,
|
||||
pub count: usize,
|
||||
pub thumb_width: u32,
|
||||
pub thumb_height: u32,
|
||||
pub columns: u32,
|
||||
pub interval_seconds: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "type")]
|
||||
pub enum CookieSource {
|
||||
#[serde(rename = "browser")]
|
||||
Browser { browser: String },
|
||||
#[serde(rename = "file")]
|
||||
File { path: String },
|
||||
#[serde(rename = "none")]
|
||||
None,
|
||||
}
|
||||
|
||||
impl CookieSource {
|
||||
pub fn to_ytdlp_args(&self) -> Vec<String> {
|
||||
match self {
|
||||
CookieSource::Browser { browser } => {
|
||||
vec!["--cookies-from-browser".to_string(), browser.clone()]
|
||||
}
|
||||
CookieSource::File { path } => {
|
||||
vec!["--cookies".to_string(), path.clone()]
|
||||
}
|
||||
CookieSource::None => vec![],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for CookieSource {
|
||||
fn default() -> Self {
|
||||
CookieSource::Browser {
|
||||
browser: "firefox".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "mode")]
|
||||
pub enum CutMode {
|
||||
#[serde(rename = "lossless")]
|
||||
Lossless,
|
||||
#[serde(rename = "precise")]
|
||||
Precise { format: String },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "scope")]
|
||||
pub enum ExportScope {
|
||||
#[serde(rename = "individual")]
|
||||
Individual,
|
||||
#[serde(rename = "merged")]
|
||||
Merged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExportConfig {
|
||||
pub clips: Vec<Clip>,
|
||||
pub cut_mode: CutMode,
|
||||
pub export_scope: ExportScope,
|
||||
pub output_directory: String,
|
||||
pub video_title: String,
|
||||
pub source_file_path: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DependencyStatus {
|
||||
pub name: String,
|
||||
pub installed: bool,
|
||||
pub version: Option<String>,
|
||||
pub install_command: String,
|
||||
}
|
||||
1
src-tauri/src/services/clip_exporter.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 12
|
||||
1
src-tauri/src/services/dependency_manager.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 2
|
||||
1
src-tauri/src/services/download_manager.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 5
|
||||
1
src-tauri/src/services/keyframe_index.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 9
|
||||
7
src-tauri/src/services/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
pub mod clip_exporter;
|
||||
pub mod dependency_manager;
|
||||
pub mod download_manager;
|
||||
pub mod keyframe_index;
|
||||
pub mod thumbnail_extractor;
|
||||
pub mod video_resolver;
|
||||
pub mod waveform_generator;
|
||||
1
src-tauri/src/services/thumbnail_extractor.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 11
|
||||
1
src-tauri/src/services/video_resolver.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 4
|
||||
1
src-tauri/src/services/waveform_generator.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 10
|
||||
35
src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Video Clipper",
|
||||
"version": "0.1.0",
|
||||
"identifier": "xyz.cottongin.gui-video-clipper",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
"devUrl": "http://localhost:1420",
|
||||
"beforeBuildCommand": "npm run build",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "Video Clipper",
|
||||
"width": 800,
|
||||
"height": 600
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
47
src/App.svelte
Normal file
@@ -0,0 +1,47 @@
|
||||
<script lang="ts">
|
||||
import UrlInput from '$lib/components/UrlInput.svelte';
|
||||
import VideoPlayer from '$lib/components/VideoPlayer.svelte';
|
||||
import TransportControls from '$lib/components/TransportControls.svelte';
|
||||
import Timeline from '$lib/components/Timeline.svelte';
|
||||
import ClipList from '$lib/components/ClipList.svelte';
|
||||
import StatusBar from '$lib/components/StatusBar.svelte';
|
||||
</script>
|
||||
|
||||
<div class="app-shell">
|
||||
<header class="toolbar">
|
||||
<UrlInput />
|
||||
</header>
|
||||
|
||||
<main class="content">
|
||||
<VideoPlayer />
|
||||
<TransportControls />
|
||||
<Timeline />
|
||||
<ClipList />
|
||||
</main>
|
||||
|
||||
<StatusBar />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.app-shell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
background: var(--bg-secondary);
|
||||
border-bottom: 1px solid var(--border);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
72
src/app.css
Normal file
@@ -0,0 +1,72 @@
|
||||
:root {
|
||||
--bg-primary: #1e1e2e;
|
||||
--bg-secondary: #2a2a3e;
|
||||
--bg-tertiary: #353550;
|
||||
--text-primary: #cdd6f4;
|
||||
--text-secondary: #a6adc8;
|
||||
--text-muted: #6c7086;
|
||||
--accent: #89b4fa;
|
||||
--accent-hover: #74c7ec;
|
||||
--danger: #f38ba8;
|
||||
--success: #a6e3a1;
|
||||
--warning: #f9e2af;
|
||||
--border: #45475a;
|
||||
--clip-handle: #ffffff;
|
||||
--timeline-bg: #181825;
|
||||
--placeholder-gradient: linear-gradient(90deg, #2a2a3e 25%, #353550 50%, #2a2a3e 75%);
|
||||
--font-mono: 'SF Mono', 'Fira Code', monospace;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
overflow: hidden;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
#app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
padding: 6px 12px;
|
||||
border-radius: 4px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: var(--accent);
|
||||
color: var(--bg-primary);
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
input[type='text'] {
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border);
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
input[type='text']:focus {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
16
src/lib/components/ClipList.svelte
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="clip-list">
|
||||
<div class="placeholder-text">No clips yet — press I to mark in-point</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.clip-list {
|
||||
padding: 8px 12px;
|
||||
background: var(--bg-secondary);
|
||||
min-height: 80px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.placeholder-text {
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
16
src/lib/components/StatusBar.svelte
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="status-bar">
|
||||
<span class="status-text">Ready</span>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.status-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 4px 12px;
|
||||
background: var(--bg-tertiary);
|
||||
border-top: 1px solid var(--border);
|
||||
font-size: 12px;
|
||||
color: var(--text-secondary);
|
||||
min-height: 24px;
|
||||
}
|
||||
</style>
|
||||
17
src/lib/components/Timeline.svelte
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="timeline">
|
||||
<div class="placeholder-text">Timeline</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.timeline {
|
||||
height: 160px;
|
||||
background: var(--timeline-bg);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.placeholder-text {
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
19
src/lib/components/TransportControls.svelte
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="transport-controls">
|
||||
<span class="placeholder-text">Transport controls</span>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.transport-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
background: var(--bg-secondary);
|
||||
border-top: 1px solid var(--border);
|
||||
border-bottom: 1px solid var(--border);
|
||||
min-height: 40px;
|
||||
}
|
||||
.placeholder-text {
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
12
src/lib/components/UrlInput.svelte
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="url-input">
|
||||
<input type="text" placeholder="Paste a video URL..." />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.url-input {
|
||||
flex: 1;
|
||||
}
|
||||
.url-input input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
18
src/lib/components/VideoPlayer.svelte
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="video-player">
|
||||
<div class="placeholder">Paste a URL above to load a video</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.video-player {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #000;
|
||||
min-height: 200px;
|
||||
}
|
||||
.placeholder {
|
||||
color: var(--text-muted);
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
14
src/lib/utils/colors.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export const CLIP_COLORS = [
|
||||
'#4A90D9',
|
||||
'#E5734A',
|
||||
'#5CB85C',
|
||||
'#D94A7A',
|
||||
'#D9A54A',
|
||||
'#7B68EE',
|
||||
'#20B2AA',
|
||||
'#FF6B6B',
|
||||
] as const;
|
||||
|
||||
export function getClipColor(index: number): string {
|
||||
return CLIP_COLORS[index % CLIP_COLORS.length];
|
||||
}
|
||||
36
src/lib/utils/time.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
export function formatTime(totalSeconds: number): string {
|
||||
const hours = Math.floor(totalSeconds / 3600);
|
||||
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
||||
const seconds = Math.floor(totalSeconds % 60);
|
||||
const millis = Math.round((totalSeconds % 1) * 1000);
|
||||
|
||||
const mm = String(minutes).padStart(2, '0');
|
||||
const ss = String(seconds).padStart(2, '0');
|
||||
const ms = String(millis).padStart(3, '0');
|
||||
|
||||
if (hours > 0) {
|
||||
return `${hours}:${mm}:${ss}.${ms}`;
|
||||
}
|
||||
return `${mm}:${ss}.${ms}`;
|
||||
}
|
||||
|
||||
export function parseTime(str: string): number | null {
|
||||
const hmsMatch = str.match(/^(\d+):(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/);
|
||||
if (hmsMatch) {
|
||||
const h = parseInt(hmsMatch[1], 10);
|
||||
const m = parseInt(hmsMatch[2], 10);
|
||||
const s = parseInt(hmsMatch[3], 10);
|
||||
const ms = hmsMatch[4] ? parseInt(hmsMatch[4].padEnd(3, '0'), 10) : 0;
|
||||
return h * 3600 + m * 60 + s + ms / 1000;
|
||||
}
|
||||
|
||||
const msMatch = str.match(/^(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/);
|
||||
if (msMatch) {
|
||||
const m = parseInt(msMatch[1], 10);
|
||||
const s = parseInt(msMatch[2], 10);
|
||||
const ms = msMatch[3] ? parseInt(msMatch[3].padEnd(3, '0'), 10) : 0;
|
||||
return m * 60 + s + ms / 1000;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
10
src/main.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { mount } from 'svelte';
|
||||
import App from './App.svelte';
|
||||
import './app.css';
|
||||
|
||||
const target = document.getElementById('app');
|
||||
if (!target) {
|
||||
throw new Error('Missing #app mount target');
|
||||
}
|
||||
|
||||
mount(App, { target });
|
||||
2
src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference types="svelte" />
|
||||
/// <reference types="vite/client" />
|
||||
BIN
static/favicon.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
1
static/svelte.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="26.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 308"><path fill="#FF3E00" d="M239.682 40.707C211.113-.182 154.69-12.301 113.895 13.69L42.247 59.356a82.198 82.198 0 0 0-37.135 55.056a86.566 86.566 0 0 0 8.536 55.576a82.425 82.425 0 0 0-12.296 30.719a87.596 87.596 0 0 0 14.964 66.244c28.574 40.893 84.997 53.007 125.787 27.016l71.648-45.664a82.182 82.182 0 0 0 37.135-55.057a86.601 86.601 0 0 0-8.53-55.577a82.409 82.409 0 0 0 12.29-30.718a87.573 87.573 0 0 0-14.963-66.244"></path><path fill="#FFF" d="M106.889 270.841c-23.102 6.007-47.497-3.036-61.103-22.648a52.685 52.685 0 0 1-9.003-39.85a49.978 49.978 0 0 1 1.713-6.693l1.35-4.115l3.671 2.697a92.447 92.447 0 0 0 28.036 14.007l2.663.808l-.245 2.659a16.067 16.067 0 0 0 2.89 10.656a17.143 17.143 0 0 0 18.397 6.828a15.786 15.786 0 0 0 4.403-1.935l71.67-45.672a14.922 14.922 0 0 0 6.734-9.977a15.923 15.923 0 0 0-2.713-12.011a17.156 17.156 0 0 0-18.404-6.832a15.78 15.78 0 0 0-4.396 1.933l-27.35 17.434a52.298 52.298 0 0 1-14.553 6.391c-23.101 6.007-47.497-3.036-61.101-22.649a52.681 52.681 0 0 1-9.004-39.849a49.428 49.428 0 0 1 22.34-33.114l71.664-45.677a52.218 52.218 0 0 1 14.563-6.398c23.101-6.007 47.497 3.036 61.101 22.648a52.685 52.685 0 0 1 9.004 39.85a50.559 50.559 0 0 1-1.713 6.692l-1.35 4.116l-3.67-2.693a92.373 92.373 0 0 0-28.037-14.013l-2.664-.809l.246-2.658a16.099 16.099 0 0 0-2.89-10.656a17.143 17.143 0 0 0-18.398-6.828a15.786 15.786 0 0 0-4.402 1.935l-71.67 45.674a14.898 14.898 0 0 0-6.73 9.975a15.9 15.9 0 0 0 2.709 12.012a17.156 17.156 0 0 0 18.404 6.832a15.841 15.841 0 0 0 4.402-1.935l27.345-17.427a52.147 52.147 0 0 1 14.552-6.397c23.101-6.006 47.497 3.037 61.102 22.65a52.681 52.681 0 0 1 9.003 39.848a49.453 49.453 0 0 1-22.34 33.12l-71.664 45.673a52.218 52.218 0 0 1-14.563 6.398"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
6
static/tauri.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
|
||||
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
1
static/vite.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
8
svelte.config.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
/** @type {import('@sveltejs/vite-plugin-svelte').Config} */
|
||||
const config = {
|
||||
preprocess: vitePreprocess(),
|
||||
};
|
||||
|
||||
export default config;
|
||||
16
tests/lib/utils/colors.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { getClipColor, CLIP_COLORS } from '$lib/utils/colors';
|
||||
|
||||
describe('getClipColor', () => {
|
||||
it('returns a valid hex color for index 0', () => {
|
||||
expect(getClipColor(0)).toMatch(/^#[0-9a-fA-F]{6}$/);
|
||||
});
|
||||
|
||||
it('returns different colors for different indices', () => {
|
||||
expect(getClipColor(0)).not.toBe(getClipColor(1));
|
||||
});
|
||||
|
||||
it('wraps around the palette', () => {
|
||||
expect(getClipColor(0)).toBe(getClipColor(CLIP_COLORS.length));
|
||||
});
|
||||
});
|
||||
42
tests/lib/utils/time.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { formatTime, parseTime } from '$lib/utils/time';
|
||||
|
||||
describe('formatTime', () => {
|
||||
it('formats zero seconds', () => {
|
||||
expect(formatTime(0)).toBe('00:00.000');
|
||||
});
|
||||
|
||||
it('formats seconds with milliseconds', () => {
|
||||
expect(formatTime(83.45)).toBe('01:23.450');
|
||||
});
|
||||
|
||||
it('formats hours', () => {
|
||||
expect(formatTime(3661.5)).toBe('1:01:01.500');
|
||||
});
|
||||
|
||||
it('formats exact minutes', () => {
|
||||
expect(formatTime(120)).toBe('02:00.000');
|
||||
});
|
||||
|
||||
it('handles large values', () => {
|
||||
expect(formatTime(7384.123)).toBe('2:03:04.123');
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseTime', () => {
|
||||
it('parses mm:ss.mmm format', () => {
|
||||
expect(parseTime('01:23.450')).toBeCloseTo(83.45);
|
||||
});
|
||||
|
||||
it('parses h:mm:ss.mmm format', () => {
|
||||
expect(parseTime('1:01:01.500')).toBeCloseTo(3661.5);
|
||||
});
|
||||
|
||||
it('returns null for invalid input', () => {
|
||||
expect(parseTime('not a time')).toBeNull();
|
||||
});
|
||||
|
||||
it('parses mm:ss without milliseconds', () => {
|
||||
expect(parseTime('02:00')).toBeCloseTo(120);
|
||||
});
|
||||
});
|
||||
20
tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "bundler",
|
||||
"module": "ESNext",
|
||||
"target": "ESNext",
|
||||
"isolatedModules": true,
|
||||
"paths": {
|
||||
"$lib/*": ["./src/lib/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.svelte", "tests/**/*.ts", "vite.config.ts"]
|
||||
}
|
||||
41
vite.config.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import path from 'node:path';
|
||||
import process from 'node:process';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { defineConfig } from 'vite';
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const host = process.env.TAURI_DEV_HOST;
|
||||
const libAlias = path.resolve(__dirname, 'src/lib');
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [svelte()],
|
||||
resolve: {
|
||||
alias: {
|
||||
$lib: libAlias,
|
||||
},
|
||||
},
|
||||
clearScreen: false,
|
||||
server: {
|
||||
port: 1420,
|
||||
strictPort: true,
|
||||
host: host || '127.0.0.1',
|
||||
hmr: host
|
||||
? {
|
||||
protocol: 'ws',
|
||||
host,
|
||||
port: 1421,
|
||||
}
|
||||
: undefined,
|
||||
watch: {
|
||||
ignored: ['**/src-tauri/**'],
|
||||
},
|
||||
},
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
include: ['tests/**/*.test.ts'],
|
||||
alias: {
|
||||
$lib: libAlias,
|
||||
},
|
||||
},
|
||||
});
|
||||