format: whole project

This commit is contained in:
James Xylight committed 2025-02-04 16:23:31 -08:00
1 parent b883b5f6e0
commit 80269cf275
79 files changed
+590 -612

No files matched your search

@@ -1,22 +1,22 @@
<script lang="ts">
import { preventDefault } from 'svelte/legacy';
import { preventDefault } from 'svelte/legacy'
import { DocumentPlus, Icon } from 'svelte-hero-icons'
import { Label, TextInput } from 'mono-svelte'
interface Props {
accept?: string;
files?: FileList | undefined | null;
label?: string | undefined;
url?: string | undefined;
accept?: string
files?: FileList | undefined | null
label?: string | undefined
url?: string | undefined
}
let {
accept = 'image/*',
files = $bindable(null),
label = undefined,
url = undefined
}: Props = $props();
url = undefined,
}: Props = $props()
let dragover = $state(false)
@@ -38,7 +38,7 @@ export function buildCommentsTree(
comment_view,
children: [],
depth: depth,
expanded: true
expanded: true,
}
min_depth = Math.min(min_depth, depth)
if (filter(comment_view)) {
+8 -10
View File
@@ -1,14 +1,13 @@
<script lang="ts">
import { Icon, type IconSource } from 'svelte-hero-icons'
interface Props {
icon?: IconSource | undefined;
title: string;
description?: string | undefined;
center?: boolean;
class?: string;
children?: import('svelte').Snippet;
icon?: IconSource | undefined
title: string
description?: string | undefined
center?: boolean
class?: string
children?: import('svelte').Snippet
}
let {
@@ -17,9 +16,8 @@
description = undefined,
center = false,
class: clazz = '',
children
}: Props = $props();
children,
}: Props = $props()
</script>
<div
+4 -4
View File
@@ -1,20 +1,20 @@
<script lang="ts">
import { run } from 'svelte/legacy';
import { run } from 'svelte/legacy'
import { expoOut } from 'svelte/easing'
import { tweened } from 'svelte/motion'
interface Props {
progress?: number;
progress?: number
}
let { progress = 0 }: Props = $props();
let { progress = 0 }: Props = $props()
let tween = tweened(progress, { easing: expoOut })
run(() => {
tween.set(progress)
});
})
</script>
<div
+5 -9
View File
@@ -1,18 +1,14 @@
<script lang="ts">
interface Props {
small?: boolean;
class?: string;
children?: import('svelte').Snippet;
small?: boolean
class?: string
children?: import('svelte').Snippet
[key: string]: any
}
let { small = false, class: clazz = '', children, ...rest }: Props = $props();
let { small = false, class: clazz = '', children, ...rest }: Props = $props()
</script>
<span
{...rest}
class="{!small ? 'text-lg' : 'text-xs'} font-semibold {clazz}"
>
<span {...rest} class="{!small ? 'text-lg' : 'text-xs'} font-semibold {clazz}">
{@render children?.()}
</span>
+3 -4
View File
@@ -1,11 +1,10 @@
<script lang="ts">
interface Props {
class?: string;
children?: import('svelte').Snippet;
class?: string
children?: import('svelte').Snippet
}
let { class: clazz = '', children }: Props = $props();
let { class: clazz = '', children }: Props = $props()
</script>
<aside
@@ -77,7 +77,6 @@
<script lang="ts">
import { settings } from '$lib/settings.svelte.js'
import { themeVars } from '$lib/ui/colors'
import { routes } from '$lib/util.svelte.js'
import { writable, type Readable, type Writable } from 'svelte/store'
interface Props {
@@ -102,9 +101,6 @@
...rest
}: Props = $props()
let title = $derived(
route ? routes[(route.id as keyof typeof routes) ?? ''] : '',
)
let sidePadding = $derived(
calculatePadding($dockProps.noGap, $dockProps.top, false),
)
@@ -147,7 +143,6 @@
: `border-slate-200 dark:border-zinc-800 shadow-2xl
bg-white/50 dark:bg-zinc-950/70`
}`,
title,
style: 'transition: border-radius 250ms;',
})}
</div>
@@ -338,16 +338,14 @@ export function getGroups(
default: t.get('filter.view.compact'),
}),
icon: ViewColumns,
handle: () =>
settings.view = 'compact'
handle: () => (settings.view = 'compact'),
},
{
name: t.get('nav.commands.setViewTo', {
default: t.get('filter.view.cozy'),
}),
icon: ViewColumns,
handle: () =>
settings.view = 'cozy'
handle: () => (settings.view = 'cozy'),
},
],
},
+5 -6
View File
@@ -6,15 +6,14 @@
</script>
<script lang="ts">
interface Props {
wrap?: keyof typeof wrapClass;
class?: string;
children?: import('svelte').Snippet;
wrap?: keyof typeof wrapClass
class?: string
children?: import('svelte').Snippet
}
let { wrap = 'wrap', class: clazz = '', children }: Props = $props();
let { wrap = 'wrap', class: clazz = '', children }: Props = $props()
let classes = $derived(`${wrapClass[wrap]} ${clazz ?? ''}`)
</script>
+8 -12
View File
@@ -1,25 +1,21 @@
<script lang="ts">
import { locale } from '$lib/translations'
interface Props {
number: number;
locale?: string;
options?: Intl.NumberFormatOptions;
class?: string;
number: number
locale?: string
options?: Intl.NumberFormatOptions
class?: string
}
let {
number,
locale: localeToUse = $locale,
options = {
notation: 'compact',
},
class: clazz = ''
}: Props = $props();
notation: 'compact',
},
class: clazz = '',
}: Props = $props()
</script>
<span class={clazz ?? ''}>
+12 -13
View File
@@ -3,7 +3,7 @@
date: Date,
options: Intl.RelativeTimeFormatOptions,
locale?: string,
relativeTo?: Date
relativeTo?: Date,
) {
try {
const now = relativeTo?.getTime() ?? Date.now()
@@ -41,7 +41,6 @@
<script lang="ts">
import { locale } from '$lib/translations'
const toLocaleDateString = (date: Date): string => {
try {
return date.toLocaleString()
@@ -51,24 +50,24 @@
}
interface Props {
date: Date;
relativeTo?: Date | undefined;
options?: Intl.RelativeTimeFormatOptions;
style?: string;
class?: string;
date: Date
relativeTo?: Date | undefined
options?: Intl.RelativeTimeFormatOptions
style?: string
class?: string
}
let {
date,
relativeTo = undefined,
options = {
numeric: 'always',
style: 'narrow',
},
numeric: 'always',
style: 'narrow',
},
style = '',
class: clazz = ''
}: Props = $props();
class: clazz = '',
}: Props = $props()
let dateTime = $derived(toLocaleDateString(date))
</script>
@@ -3,17 +3,19 @@
import { Modal } from 'mono-svelte'
interface Props {
object: any;
open?: boolean;
title?: import('svelte').Snippet;
object: any
open?: boolean
title?: import('svelte').Snippet
}
let { object, open = $bindable(false), title }: Props = $props();
let { object, open = $bindable(false), title }: Props = $props()
</script>
<Modal bind:open>
{#snippet title()}
<span >{#if title}{@render title()}{:else}Debug{/if}</span>
<span>
{#if title}{@render title()}{:else}Debug{/if}
</span>
{/snippet}
<DebugTree {object} isParent={true} />
</Modal>
@@ -1,11 +1,11 @@
<script lang="ts">
import DebugTree from './DebugTree.svelte';
import DebugTree from './DebugTree.svelte'
interface Props {
object: any;
isParent?: boolean;
object: any
isParent?: boolean
}
let { object, isParent = false }: Props = $props();
let { object, isParent = false }: Props = $props()
</script>
<ul class:ml-4={!isParent} class="leading-8">