format files

This commit is contained in:
maxDorninger
2025-06-28 22:49:23 +02:00
parent a1c7b9b941
commit e44fb29852
44 changed files with 481 additions and 515 deletions

View File

@@ -1,16 +1,17 @@
<script lang="ts">
import {Button} from '$lib/components/ui/button/index.js';
import {env} from '$env/dynamic/public';
import {Button} from '$lib/components/ui/button/index.js';
import {env} from '$env/dynamic/public';
import * as Card from '$lib/components/ui/card/index.js';
import {ImageOff} from 'lucide-svelte';
import {goto} from '$app/navigation';
import {base} from '$app/paths';
import type {MetaDataProviderShowSearchResult} from '$lib/types.js';
import {ImageOff} from 'lucide-svelte';
import {goto} from '$app/navigation';
import {base} from '$app/paths';
import type {MetaDataProviderShowSearchResult} from '$lib/types.js';
const apiUrl = env.PUBLIC_API_URL;
let loading = $state(false);
let errorMessage = $state(null);
let {result, isShow = true}: { result: MetaDataProviderShowSearchResult, isShow: boolean } = $props();
let {result, isShow = true}: { result: MetaDataProviderShowSearchResult; isShow: boolean } =
$props();
console.log('Add Show Card Result: ', result);
async function addMedia() {
@@ -42,27 +43,27 @@
{/if}
</Card.Title>
<Card.Description class="truncate"
>{result.overview !== '' ? result.overview : 'No overview available'}</Card.Description
>{result.overview !== '' ? result.overview : 'No overview available'}</Card.Description
>
</Card.Header>
<Card.Content class="flex flex-1 items-center justify-center">
{#if result.poster_path != null}
<img
class="h-full w-full rounded-lg object-contain"
src={result.poster_path}
alt="{result.name}'s Poster Image"
class="h-full w-full rounded-lg object-contain"
src={result.poster_path}
alt="{result.name}'s Poster Image"
/>
{:else}
<div class="flex h-full w-full items-center justify-center">
<ImageOff class="h-12 w-12 text-gray-400"/>
<ImageOff class="h-12 w-12 text-gray-400"/>
</div>
{/if}
</Card.Content>
<Card.Footer class="flex flex-col items-start gap-2 rounded-b-lg border-t bg-card p-4">
<Button
class="w-full font-semibold"
disabled={result.added || loading}
onclick={() => addMedia(result)}
class="w-full font-semibold"
disabled={result.added || loading}
onclick={() => addMedia(result)}
>
{#if loading}
<span class="animate-pulse">Loading...</span>
@@ -74,9 +75,9 @@
{#if result.vote_average != null}
<span class="flex items-center text-sm font-medium text-yellow-600">
<svg class="mr-1 h-4 w-4 text-yellow-400" fill="currentColor" viewBox="0 0 20 20"
><path
><path
d="M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.561-.955L10 0l2.951 5.955 6.561.955-4.756 4.635 1.122 6.545z"
/></svg
/></svg
>
Rating: {Math.round(result.vote_average)}/10
</span>

View File

@@ -1,5 +1,5 @@
<script lang="ts" module>
import {Home, Info, LifeBuoy, Send, Settings, TvIcon, Clapperboard} from 'lucide-svelte';
import {Clapperboard, Home, Info, LifeBuoy, Send, Settings, TvIcon} from 'lucide-svelte';
import {PUBLIC_VERSION} from '$env/static/public';
const data = {

View File

@@ -4,11 +4,10 @@
import {Input} from '$lib/components/ui/input';
import {Label} from '$lib/components/ui/label';
import {toast} from 'svelte-sonner';
import {Badge} from "$lib/components/ui/badge/index.js";
import {Badge} from '$lib/components/ui/badge/index.js';
import type {PublicIndexerQueryResult} from '$lib/types.js';
import {convertTorrentSeasonRangeToIntegerRange, getFullyQualifiedMediaName} from '$lib/utils';
import {getFullyQualifiedMediaName} from '$lib/utils';
import {LoaderCircle} from 'lucide-svelte';
import * as Dialog from '$lib/components/ui/dialog/index.js';
import * as Tabs from '$lib/components/ui/tabs/index.js';
@@ -60,9 +59,7 @@
}
}
async function getTorrents(
override: boolean = false
): Promise<PublicIndexerQueryResult[]> {
async function getTorrents(override: boolean = false): Promise<PublicIndexerQueryResult[]> {
isLoadingTorrents = true;
torrentsError = null;
torrents = [];
@@ -157,8 +154,8 @@
</Select.Content>
</Select.Root>
<p class="text-sm text-muted-foreground">
This is necessary to differentiate between versions of the same movie, for
example a 1080p and a 4K version.
This is necessary to differentiate between versions of the same movie, for example a
1080p and a 4K version.
</p>
<Label for="file-suffix-display"
>The files will be saved in the following directory:</Label
@@ -192,7 +189,8 @@
</Button>
</div>
<p class="text-sm text-muted-foreground">
The custom query will override the default search string like "A Minecraft Movie (2025)".
The custom query will override the default search string like "A Minecraft Movie
(2025)".
</p>
<Label for="file-suffix">Filepath suffix</Label>
<Input
@@ -203,8 +201,8 @@
type="text"
/>
<p class="text-sm text-muted-foreground">
This is necessary to differentiate between versions of the same movie, for
example a 1080p and a 4K version.
This is necessary to differentiate between versions of the same movie, for example a
1080p and a 4K version.
</p>
<Label for="file-suffix-display"

View File

@@ -6,13 +6,13 @@
import {toast} from 'svelte-sonner';
import type {PublicIndexerQueryResult} from '$lib/types.js';
import {convertTorrentSeasonRangeToIntegerRange, getFullyQualifiedMediaName} from '$lib/utils';
import {convertTorrentSeasonRangeToIntegerRange, getFullyQualifiedMediaName} from '$lib/utils';
import {LoaderCircle} from 'lucide-svelte';
import * as Dialog from '$lib/components/ui/dialog/index.js';
import * as Tabs from '$lib/components/ui/tabs/index.js';
import * as Select from '$lib/components/ui/select/index.js';
import * as Table from '$lib/components/ui/table/index.js';
import {Badge} from "$lib/components/ui/badge";
import {Badge} from '$lib/components/ui/badge';
const apiUrl = env.PUBLIC_API_URL;
let {show} = $props();

View File

@@ -1,17 +1,17 @@
<script lang="ts">
import {Button} from '$lib/components/ui/button/index.js';
import {Button} from '$lib/components/ui/button/index.js';
import * as Card from '$lib/components/ui/card/index.js';
import {Input} from '$lib/components/ui/input/index.js';
import {Label} from '$lib/components/ui/label/index.js';
import {goto} from '$app/navigation';
import {env} from '$env/dynamic/public';
import {Input} from '$lib/components/ui/input/index.js';
import {Label} from '$lib/components/ui/label/index.js';
import {goto} from '$app/navigation';
import {env} from '$env/dynamic/public';
import * as Tabs from '$lib/components/ui/tabs/index.js';
import {toast} from 'svelte-sonner';
import {toast} from 'svelte-sonner';
import LoadingBar from '$lib/components/loading-bar.svelte';
const apiUrl = env.PUBLIC_API_URL;
let {oauthProvider} = $props();
let {oauthProvider} = $props();
let oauthProviderName = $derived(oauthProvider.oauth_name);
let email = $state('');
@@ -113,21 +113,21 @@
async function handleOauth() {
try {
const response = await fetch(
apiUrl + '/auth/cookie/' + oauthProviderName + '/authorize?scopes=email',
{
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
}
apiUrl + '/auth/cookie/' + oauthProviderName + '/authorize?scopes=email',
{
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
}
);
if (response.ok) {
let result = await response.json();
console.log(
'Redirecting to OAuth provider:',
oauthProviderName,
'url: ',
result.authorization_url
'Redirecting to OAuth provider:',
oauthProviderName,
'url: ',
result.authorization_url
);
toast.success('Redirecting to ' + oauthProviderName + ' for authentication...');
window.location = result.authorization_url;
@@ -146,18 +146,18 @@
{#snippet oauthLogin()}
{#await oauthProvider}
<LoadingBar/>
<LoadingBar/>
{:then result}
{#if result.oauth_name != null}
<div
class="relative mt-2 text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t after:border-border"
class="relative mt-2 text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t after:border-border"
>
<span class="relative z-10 bg-background px-2 text-muted-foreground">
Or continue with
</span>
</div>
<Button class="mt-2 w-full" onclick={() => handleOauth()} variant="outline"
>Login with {result.oauth_name}</Button
>Login with {result.oauth_name}</Button
>
{/if}
{/await}
@@ -174,11 +174,11 @@
<div class="grid gap-2">
<Label for="email">Email</Label>
<Input
bind:value={email}
id="email"
placeholder="m@example.com"
required
type="email"
bind:value={email}
id="email"
placeholder="m@example.com"
required
type="email"
/>
</div>
<div class="grid gap-2">
@@ -189,7 +189,7 @@
Forgot your password?
</a>
</div>
<Input bind:value={password} id="password" required type="password"/>
<Input bind:value={password} id="password" required type="password"/>
</div>
{#if errorMessage}
@@ -226,18 +226,18 @@
<div class="grid gap-2">
<Label for="email2">Email</Label>
<Input
bind:value={email}
id="email2"
placeholder="m@example.com"
required
type="email"
bind:value={email}
id="email2"
placeholder="m@example.com"
required
type="email"
/>
</div>
<div class="grid gap-2">
<div class="flex items-center">
<Label for="password2">Password</Label>
</div>
<Input bind:value={password} id="password2" required type="password"/>
<Input bind:value={password} id="password2" required type="password"/>
</div>
{#if errorMessage}
@@ -256,7 +256,7 @@
<div class="mt-4 text-center text-sm">
<Button onclick={() => (tabValue = 'login')} variant="link"
>Already have an account? Login
>Already have an account? Login
</Button>
</div>
</Card.Content>

View File

@@ -4,7 +4,7 @@
const apiUrl = env.PUBLIC_API_URL;
let {media} = $props();
console.log("got media: ", media);
console.log('got media: ', media);
</script>
<picture>

View File

@@ -1,29 +1,32 @@
<script lang="ts">
import Autoplay from 'embla-carousel-autoplay';
import * as Carousel from '$lib/components/ui/carousel/index.js';
import type {MetaDataProviderShowSearchResult} from '$lib/types';
import AddMediaCard from '$lib/components/add-media-card.svelte';
import {Skeleton} from "$lib/components/ui/skeleton";
import {Button} from "$lib/components/ui/button";
import {ChevronDown, ChevronRight} from "lucide-svelte";
import {Skeleton} from '$lib/components/ui/skeleton';
import {Button} from '$lib/components/ui/button';
import {ChevronRight} from 'lucide-svelte';
let {media, isShow, isLoading}: {
media: MetaDataProviderShowSearchResult[],
isShow: boolean,
isLoading: boolean
let {
media,
isShow,
isLoading
}: {
media: MetaDataProviderShowSearchResult[];
isShow: boolean;
isLoading: boolean;
} = $props();
</script>
<div class="grid w-full gap-4 sm:grid-cols-1
md:grid-cols-2 lg:grid-cols-3">
<div
class="grid w-full gap-4 sm:grid-cols-1
md:grid-cols-2 lg:grid-cols-3"
>
{#if isLoading}
<Skeleton class="w-full h-[70vh]"/>
<Skeleton class="w-full h-[70vh]"/>
<Skeleton class="w-full h-[70vh]"/>
{:else }
<Skeleton class="h-[70vh] w-full"/>
<Skeleton class="h-[70vh] w-full"/>
<Skeleton class="h-[70vh] w-full"/>
{:else}
{#each media.slice(0, 3) as mediaItem}
<AddMediaCard isShow={isShow} result={mediaItem}/>
<AddMediaCard {isShow} result={mediaItem}/>
{/each}
{/if}
{#if isShow}
@@ -31,11 +34,10 @@
More recommendations
<ChevronRight/>
</Button>
{:else }
{:else}
<Button class="md:col-start-2" variant="secondary" href="/dashboard/movies/add-movie">
More recommendations
<ChevronRight/>
</Button>
{/if}
</div>

View File

@@ -5,7 +5,7 @@
import {Label} from '$lib/components/ui/label';
import * as Select from '$lib/components/ui/select/index.js';
import LoaderCircle from '@lucide/svelte/icons/loader-circle';
import type {CreateSeasonRequest, PublicMovie, PublicShow, Quality} from '$lib/types.js';
import type {PublicMovie, Quality} from '$lib/types.js';
import {getFullyQualifiedMediaName, getTorrentQualityString} from '$lib/utils.js';
import {toast} from 'svelte-sonner';
@@ -21,11 +21,7 @@
let qualityOptions = $derived(
qualityValues.map((q) => ({value: q, label: getTorrentQualityString(q)}))
);
let isFormInvalid = $derived(
!minQuality ||
!wantedQuality ||
wantedQuality > minQuality
);
let isFormInvalid = $derived(!minQuality || !wantedQuality || wantedQuality > minQuality);
async function handleRequestMovie() {
isSubmittingRequest = true;
@@ -78,9 +74,7 @@
<Dialog.Content class="max-h-[90vh] w-fit min-w-[clamp(300px,50vw,600px)] overflow-y-auto">
<Dialog.Header>
<Dialog.Title>Request {getFullyQualifiedMediaName(movie)}</Dialog.Title>
<Dialog.Description>
Select desired qualities to submit a request.
</Dialog.Description>
<Dialog.Description>Select desired qualities to submit a request.</Dialog.Description>
</Dialog.Header>
<div class="grid gap-4 py-4">
<!-- Min Quality Select -->

View File

@@ -17,13 +17,17 @@
return true;
},
isShow = true
}: { requests: SeasonRequest[]; filter: (request: SeasonRequest) => boolean, isShow: boolean } = $props();
}: {
requests: SeasonRequest[];
filter: (request: SeasonRequest) => boolean;
isShow: boolean;
} = $props();
const user: () => User = getContext('user');
async function approveRequest(requestId: string, currentAuthorizedStatus: boolean) {
try {
const response = await fetch(
`${apiUrl}${isShow ? "/tv/seasons" : "/movies"}/requests/${requestId}?authorized_status=${!currentAuthorizedStatus}`,
`${apiUrl}${isShow ? '/tv/seasons' : '/movies'}/requests/${requestId}?authorized_status=${!currentAuthorizedStatus}`,
{
method: 'PATCH',
headers: {
@@ -58,13 +62,16 @@
async function deleteRequest(requestId: string) {
try {
const response = await fetch(`${apiUrl}${isShow ? "/tv/seasons" : "/movies"}/requests/${requestId}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include'
});
const response = await fetch(
`${apiUrl}${isShow ? '/tv/seasons' : '/movies'}/requests/${requestId}`,
{
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include'
}
);
if (response.ok) {
const index = requests.findIndex((r) => r.id === requestId);
@@ -89,7 +96,7 @@
<Table.Caption>A list of all requests.</Table.Caption>
<Table.Header>
<Table.Row>
<Table.Head>{isShow ? "Show" : "Movie"}</Table.Head>
<Table.Head>{isShow ? 'Show' : 'Movie'}</Table.Head>
{#if isShow}
<Table.Head>Season</Table.Head>
{/if}
@@ -108,10 +115,8 @@
<Table.Cell>
{#if isShow}
{getFullyQualifiedMediaName(request.show)}
{:else}
{getFullyQualifiedMediaName(request.movie)}
{/if}
</Table.Cell>
{#if isShow}
@@ -163,7 +168,6 @@
Download manually
</Button>
{/if}
{/if}
{#if user().is_superuser || user().id === request.requested_by?.id}
<Button variant="destructive" size="sm" onclick={() => deleteRequest(request.id)}

View File

@@ -1,37 +1,36 @@
<script lang="ts" module>
import {type VariantProps, tv} from "tailwind-variants";
import {type VariantProps, tv} from 'tailwind-variants';
export const badgeVariants = tv({
base: "focus:ring-ring inline-flex select-none items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",
base: 'focus:ring-ring inline-flex select-none items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2',
variants: {
variant: {
default:
"bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow",
default: 'bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow',
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
'bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent',
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow",
outline: "text-foreground",
},
'bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow',
outline: 'text-foreground'
}
},
defaultVariants: {
variant: "default",
},
variant: 'default'
}
});
export type BadgeVariant = VariantProps<typeof badgeVariants>["variant"];
export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
</script>
<script lang="ts">
import type {WithElementRef} from "bits-ui";
import type {HTMLAnchorAttributes} from "svelte/elements";
import {cn} from "$lib/utils.js";
import type {WithElementRef} from 'bits-ui';
import type {HTMLAnchorAttributes} from 'svelte/elements';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
href,
class: className,
variant = "default",
variant = 'default',
children,
...restProps
}: WithElementRef<HTMLAnchorAttributes> & {
@@ -40,11 +39,11 @@
</script>
<svelte:element
this={href ? 'a' : 'span'}
{...restProps}
bind:this={ref}
class={cn(badgeVariants({ variant }), className)}
{href}
this={href ? "a" : "span"}
>
{@render children?.()}
</svelte:element>

View File

@@ -1,2 +1,2 @@
export {default as Badge} from "./badge.svelte";
export {badgeVariants, type BadgeVariant} from "./badge.svelte";
export {default as Badge} from './badge.svelte';
export {badgeVariants, type BadgeVariant} from './badge.svelte';

View File

@@ -1,8 +1,8 @@
<script lang="ts">
import {Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild} from 'bits-ui';
import {Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild} from 'bits-ui';
import Check from '@lucide/svelte/icons/check';
import Minus from '@lucide/svelte/icons/minus';
import {cn} from '$lib/utils.js';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -14,16 +14,16 @@
</script>
<CheckboxPrimitive.Root
{...restProps}
bind:checked
bind:indeterminate
bind:ref
class={cn(
{...restProps}
bind:checked
bind:indeterminate
bind:ref
class={cn(
'peer box-content size-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[disabled=true]:opacity-50',
className
)}
>
{#snippet children({checked, indeterminate})}
{#snippet children({checked, indeterminate})}
<span class="flex items-center justify-center text-current">
{#if indeterminate}
<Minus class="size-4"/>

View File

@@ -1,15 +1,15 @@
import {Menubar as MenubarPrimitive} from "bits-ui";
import Root from "./menubar.svelte";
import CheckboxItem from "./menubar-checkbox-item.svelte";
import Content from "./menubar-content.svelte";
import Item from "./menubar-item.svelte";
import GroupHeading from "./menubar-group-heading.svelte";
import RadioItem from "./menubar-radio-item.svelte";
import Separator from "./menubar-separator.svelte";
import Shortcut from "./menubar-shortcut.svelte";
import SubContent from "./menubar-sub-content.svelte";
import SubTrigger from "./menubar-sub-trigger.svelte";
import Trigger from "./menubar-trigger.svelte";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import Root from './menubar.svelte';
import CheckboxItem from './menubar-checkbox-item.svelte';
import Content from './menubar-content.svelte';
import Item from './menubar-item.svelte';
import GroupHeading from './menubar-group-heading.svelte';
import RadioItem from './menubar-radio-item.svelte';
import Separator from './menubar-separator.svelte';
import Shortcut from './menubar-shortcut.svelte';
import SubContent from './menubar-sub-content.svelte';
import SubTrigger from './menubar-sub-trigger.svelte';
import Trigger from './menubar-trigger.svelte';
const Menu = MenubarPrimitive.Menu;
const Group = MenubarPrimitive.Group;
@@ -47,5 +47,5 @@ export {
Menu as MenubarMenu,
Group as MenubarGroup,
Sub as MenubarSub,
RadioGroup as MenubarRadioGroup,
RadioGroup as MenubarRadioGroup
};

View File

@@ -1,9 +1,9 @@
<script lang="ts">
import {Menubar as MenubarPrimitive, type WithoutChildrenOrChild} from "bits-ui";
import Check from "@lucide/svelte/icons/check";
import Minus from "@lucide/svelte/icons/minus";
import {cn} from "$lib/utils.js";
import type {Snippet} from "svelte";
import {Menubar as MenubarPrimitive, type WithoutChildrenOrChild} from 'bits-ui';
import Check from '@lucide/svelte/icons/check';
import Minus from '@lucide/svelte/icons/minus';
import {cn} from '$lib/utils.js';
import type {Snippet} from 'svelte';
let {
ref = $bindable(null),
@@ -23,7 +23,7 @@
bind:indeterminate
bind:ref
class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50',
className
)}
>
@@ -32,7 +32,7 @@
{#if indeterminate}
<Minus class="size-4"/>
{:else}
<Check class={cn("size-4", !checked && "text-transparent")}/>
<Check class={cn('size-4', !checked && 'text-transparent')}/>
{/if}
</span>
{@render childrenProp?.()}

View File

@@ -1,14 +1,14 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
class: className,
sideOffset = 8,
alignOffset = -4,
align = "start",
side = "bottom",
align = 'start',
side = 'bottom',
portalProps,
...restProps
}: MenubarPrimitive.ContentProps & {
@@ -23,7 +23,7 @@
{alignOffset}
bind:ref
class={cn(
"bg-popover text-popover-foreground z-50 min-w-[12rem] rounded-md border p-1 shadow-md focus:outline-none",
'z-50 min-w-[12rem] rounded-md border bg-popover p-1 text-popover-foreground shadow-md focus:outline-none',
className
)}
{side}

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -15,5 +15,5 @@
<MenubarPrimitive.GroupHeading
{...restProps}
bind:ref
class={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)}
class={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
/>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -16,8 +16,8 @@
{...restProps}
bind:ref
class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
inset && "pl-8",
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50',
inset && 'pl-8',
className
)}
/>

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import {Menubar as MenubarPrimitive, type WithoutChild} from "bits-ui";
import Circle from "@lucide/svelte/icons/circle";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive, type WithoutChild} from 'bits-ui';
import Circle from '@lucide/svelte/icons/circle';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -15,7 +15,7 @@
{...restProps}
bind:ref
class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50',
className
)}
>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -12,5 +12,5 @@
<MenubarPrimitive.Separator
{...restProps}
bind:ref
class={cn("bg-muted -mx-1 my-1 h-px", className)}
class={cn('-mx-1 my-1 h-px bg-muted', className)}
/>

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import type {HTMLAttributes} from "svelte/elements";
import type {WithElementRef} from "bits-ui";
import {cn} from "$lib/utils.js";
import type {HTMLAttributes} from 'svelte/elements';
import type {WithElementRef} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -14,7 +14,7 @@
<span
{...restProps}
bind:this={ref}
class={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)}
class={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}
>
{@render children?.()}
</span>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -13,7 +13,7 @@
{...restProps}
bind:ref
class={cn(
"bg-popover text-popover-foreground z-50 min-w-max rounded-md border p-1 shadow-lg focus:outline-none",
'z-50 min-w-max rounded-md border bg-popover p-1 text-popover-foreground shadow-lg focus:outline-none',
className
)}
/>

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import ChevronRight from "@lucide/svelte/icons/chevron-right";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import ChevronRight from '@lucide/svelte/icons/chevron-right';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -18,8 +18,8 @@
{...restProps}
bind:ref
class={cn(
"data-[highlighted]:bg-accent data-[state=open]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
inset && "pl-8",
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[state=open]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:text-accent-foreground data-[disabled]:opacity-50',
inset && 'pl-8',
className
)}
>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -13,7 +13,7 @@
{...restProps}
bind:ref
class={cn(
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none",
'flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
className
)}
/>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -13,7 +13,7 @@
{...restProps}
bind:ref
class={cn(
"bg-background flex h-9 items-center space-x-1 rounded-md border p-1 shadow-sm",
'flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm',
className
)}
/>

View File

@@ -1,7 +1,7 @@
import Root from "./skeleton.svelte";
import Root from './skeleton.svelte';
export {
Root,
//
Root as Skeleton,
Root as Skeleton
};

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import type {WithElementRef, WithoutChildren} from "bits-ui";
import type {HTMLAttributes} from "svelte/elements";
import {cn} from "$lib/utils.js";
import type {WithElementRef, WithoutChildren} from 'bits-ui';
import type {HTMLAttributes} from 'svelte/elements';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -12,6 +12,6 @@
<div
bind:this={ref}
class={cn("bg-primary/10 animate-pulse rounded-md", className)}
class={cn('animate-pulse rounded-md bg-primary/10', className)}
{...restProps}
></div>

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import {Button} from '$lib/components/ui/button/index.js';
import {env} from '$env/dynamic/public';
import {toast} from 'svelte-sonner';
import {Button} from '$lib/components/ui/button/index.js';
import {env} from '$env/dynamic/public';
import {toast} from 'svelte-sonner';
import * as Dialog from '$lib/components/ui/dialog/index.js';
import {Label} from '$lib/components/ui/label/index.js';
import {Input} from '$lib/components/ui/input/index.js';
import {Label} from '$lib/components/ui/label/index.js';
import {Input} from '$lib/components/ui/input/index.js';
const apiUrl = env.PUBLIC_API_URL;
let newPassword: string = $state('');
@@ -20,8 +20,8 @@
},
credentials: 'include',
body: JSON.stringify({
...(newPassword !== '' && {password: newPassword}),
...(newEmail !== '' && {password: newEmail})
...(newPassword !== '' && {password: newPassword}),
...(newEmail !== '' && {password: newEmail})
})
});
@@ -36,7 +36,7 @@
} catch (error) {
console.error('Error updating user:', error);
toast.error(
'Error updating user: ' + (error instanceof Error ? error.message : String(error))
'Error updating user: ' + (error instanceof Error ? error.message : String(error))
);
} finally {
newPassword = '';
@@ -63,22 +63,22 @@
<div>
<Label class="mb-1 block text-sm font-medium" for="email">Email</Label>
<Input
bind:value={newEmail}
class="w-full"
id="email"
placeholder="Keep empty to not change the email"
type="email"
bind:value={newEmail}
class="w-full"
id="email"
placeholder="Keep empty to not change the email"
type="email"
/>
</div>
<!-- Password -->
<div>
<Label class="mb-1 block text-sm font-medium" for="password">Password</Label>
<Input
bind:value={newPassword}
class="w-full"
id="password"
placeholder="Keep empty to not change the password"
type="password"
bind:value={newPassword}
class="w-full"
id="password"
placeholder="Keep empty to not change the password"
type="password"
/>
</div>
</div>