diff --git a/src/lib/components/input/ImagePreviewInput.svelte b/src/lib/components/input/ImagePreviewInput.svelte index 6a553aa4..87e6031d 100644 --- a/src/lib/components/input/ImagePreviewInput.svelte +++ b/src/lib/components/input/ImagePreviewInput.svelte @@ -1,22 +1,22 @@
- 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) - }); + })
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() - + {@render children?.()} diff --git a/src/lib/components/ui/StickyCard.svelte b/src/lib/components/ui/StickyCard.svelte index da00cef7..df4e7550 100644 --- a/src/lib/components/ui/StickyCard.svelte +++ b/src/lib/components/ui/StickyCard.svelte @@ -1,11 +1,10 @@
diff --git a/src/lib/components/ui/navbar/commands/actions.svelte.ts b/src/lib/components/ui/navbar/commands/actions.svelte.ts index 4e62362f..25c26c05 100644 --- a/src/lib/components/ui/navbar/commands/actions.svelte.ts +++ b/src/lib/components/ui/navbar/commands/actions.svelte.ts @@ -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'), }, ], }, diff --git a/src/lib/components/ui/text/TextProps.svelte b/src/lib/components/ui/text/TextProps.svelte index 2a8bb1f7..3381521e 100644 --- a/src/lib/components/ui/text/TextProps.svelte +++ b/src/lib/components/ui/text/TextProps.svelte @@ -6,15 +6,14 @@ diff --git a/src/lib/components/util/FormattedNumber.svelte b/src/lib/components/util/FormattedNumber.svelte index 89920f7b..fe64c33b 100644 --- a/src/lib/components/util/FormattedNumber.svelte +++ b/src/lib/components/util/FormattedNumber.svelte @@ -1,25 +1,21 @@ diff --git a/src/lib/components/util/RelativeDate.svelte b/src/lib/components/util/RelativeDate.svelte index 9a1f0270..65561930 100644 --- a/src/lib/components/util/RelativeDate.svelte +++ b/src/lib/components/util/RelativeDate.svelte @@ -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 @@ diff --git a/src/lib/components/util/debug/DebugObject.svelte b/src/lib/components/util/debug/DebugObject.svelte index 735ef64e..fa6a6498 100644 --- a/src/lib/components/util/debug/DebugObject.svelte +++ b/src/lib/components/util/debug/DebugObject.svelte @@ -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() {#snippet title()} - {#if title}{@render title()}{:else}Debug{/if} + + {#if title}{@render title()}{:else}Debug{/if} + {/snippet} diff --git a/src/lib/components/util/debug/DebugTree.svelte b/src/lib/components/util/debug/DebugTree.svelte index 70be7287..09c241e7 100644 --- a/src/lib/components/util/debug/DebugTree.svelte +++ b/src/lib/components/util/debug/DebugTree.svelte @@ -1,11 +1,11 @@
{@render children?.()} diff --git a/src/lib/mono/loader/Spinner.svelte b/src/lib/mono/loader/Spinner.svelte index f10fd16c..065bf39d 100644 --- a/src/lib/mono/loader/Spinner.svelte +++ b/src/lib/mono/loader/Spinner.svelte @@ -1,10 +1,10 @@ - import { createBubbler } from 'svelte/legacy'; + import { createBubbler } from 'svelte/legacy' - const bubble = createBubbler(); + const bubble = createBubbler() type Elevation = keyof typeof elevationClass type Padding = keyof typeof paddingClass type Rounding = keyof typeof roundedClass @@ -46,15 +46,14 @@ none: '', } - interface Props { - elevation?: Elevation; - padding?: Padding; - rounding?: Rounding; - color?: Color; - element?: string; - class?: string; - children?: import('svelte').Snippet; + elevation?: Elevation + padding?: Padding + rounding?: Rounding + color?: Color + element?: string + class?: string + children?: import('svelte').Snippet [key: string]: any } @@ -67,8 +66,7 @@ class: clazz = '', children, ...rest - }: Props = $props(); - + }: Props = $props() (undefined) interface Modal { - actions: Action[] - title: string - body?: string - /** - * Whether the modal has a close button or not - */ - dismissable: boolean - type: 'error' | 'info' | 'success' + actions: Action[] + title: string + body?: string + /** + * Whether the modal has a close button or not + */ + dismissable: boolean + type: 'error' | 'info' | 'success' } type Action = { - /** - * What function to run when this action is clicked. If undefined, it'll close the window. - */ - action: () => any - type: 'danger' | 'secondary' | 'primary' - content: string - icon?: IconSource - close: boolean + /** + * What function to run when this action is clicked. If undefined, it'll close the window. + */ + action: () => any + type: 'danger' | 'secondary' | 'primary' + content: string + icon?: IconSource + close: boolean } export const action = (action?: { - action?: () => any - type?: 'danger' | 'secondary' | 'primary' - content?: string - icon?: IconSource - close?: boolean + action?: () => any + type?: 'danger' | 'secondary' | 'primary' + content?: string + icon?: IconSource + close?: boolean }): Action => ({ - action: action?.action - ? () => { - action?.action?.() - if (action.close) shownModal.set(undefined) - } - : () => shownModal.set(undefined), - type: action?.type ?? 'secondary', - content: action?.content || 'OK', - close: action?.close ?? true + action: action?.action + ? () => { + action?.action?.() + if (action.close) shownModal.set(undefined) + } + : () => shownModal.set(undefined), + type: action?.type ?? 'secondary', + content: action?.content || 'OK', + close: action?.close ?? true, }) export function modal(inputModal: { - actions?: Action[] - title: string - body: string - /** - * Whether the modal has a close button or not - */ - dismissable?: boolean - type?: 'error' | 'info' | 'success' + actions?: Action[] + title: string + body: string + /** + * Whether the modal has a close button or not + */ + dismissable?: boolean + type?: 'error' | 'info' | 'success' }) { - const modal: Modal = { - actions: inputModal.actions ?? [action()], - dismissable: inputModal.dismissable ?? true, - title: inputModal.title, - body: inputModal.body, - type: inputModal.type ?? 'info' - } + const modal: Modal = { + actions: inputModal.actions ?? [action()], + dismissable: inputModal.dismissable ?? true, + title: inputModal.title, + body: inputModal.body, + type: inputModal.type ?? 'info', + } - shownModal.set(modal) + shownModal.set(modal) } diff --git a/src/lib/mono/nav/Routebar.svelte b/src/lib/mono/nav/Routebar.svelte index 9c51f364..457e57c2 100644 --- a/src/lib/mono/nav/Routebar.svelte +++ b/src/lib/mono/nav/Routebar.svelte @@ -1,5 +1,5 @@ diff --git a/src/lib/mono/note/Note.svelte b/src/lib/mono/note/Note.svelte index e95480b5..8ec95334 100644 --- a/src/lib/mono/note/Note.svelte +++ b/src/lib/mono/note/Note.svelte @@ -3,11 +3,11 @@ import { Icon, InformationCircle } from 'svelte-hero-icons' interface Props { - content?: string | undefined; - children?: import('svelte').Snippet; + content?: string | undefined + children?: import('svelte').Snippet } - let { content = undefined, children }: Props = $props(); + let { content = undefined, children }: Props = $props() - /** - * @typedef {Object} Props - * @property {import('svelte').Snippet} [children] - */ + /** + * @typedef {Object} Props + * @property {import('svelte').Snippet} [children] + */ - /** @type {Props} */ - let { children } = $props(); + /** @type {Props} */ + let { children } = $props()
-
{@render children?.()}
-
+
{@render children?.()}
+
diff --git a/src/lib/mono/popover/Portal.svelte b/src/lib/mono/popover/Portal.svelte index a54e4d77..09618504 100644 --- a/src/lib/mono/popover/Portal.svelte +++ b/src/lib/mono/popover/Portal.svelte @@ -3,7 +3,8 @@ // https://github.com/sveltejs/svelte/issues/3088#issuecomment-505785516 import { onMount, onDestroy, createEventDispatcher } from 'svelte' - let slottedElements: HTMLDivElement = $state(), portal: HTMLDivElement + let slottedElements: HTMLDivElement = $state(), + portal: HTMLDivElement const dispatch = createEventDispatcher<{ mounted: void }>() @@ -21,12 +22,11 @@ }) 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()
diff --git a/src/lib/mono/toast/Toast.svelte b/src/lib/mono/toast/Toast.svelte index 2d232c6a..e7597e2a 100644 --- a/src/lib/mono/toast/Toast.svelte +++ b/src/lib/mono/toast/Toast.svelte @@ -14,10 +14,10 @@ import { fly } from 'svelte/transition' interface Props { - toast: Toast; + toast: Toast } - let { toast }: Props = $props(); + let { toast }: Props = $props()
any + id: number + title?: string + content: string + type: ToastType + loading?: boolean + action?: () => any } export const toasts = writable([]) export function toast({ - title, - content, - type = 'info', - duration = 5000, - loading = false, - action + title, + content, + type = 'info', + duration = 5000, + loading = false, + action, }: { - title?: string - content: string - type?: ToastType - duration?: number - loading?: boolean - action?: () => any + title?: string + content: string + type?: ToastType + duration?: number + loading?: boolean + action?: () => any }) { - let id = 0 + let id = 0 - toasts.update((toasts) => { - id = Math.floor(Math.random() * 10000) + toasts.update((toasts) => { + id = Math.floor(Math.random() * 10000) - return [ - ...toasts, - { - id: id, - content: content, - title: title, - type: type, - loading: loading, - action: action - } - ] - }) + return [ + ...toasts, + { + id: id, + content: content, + title: title, + type: type, + loading: loading, + action: action, + }, + ] + }) - setTimeout(() => { - toasts.update((toasts) => toasts.filter((toast) => toast.id != id)) - }, duration) + setTimeout(() => { + toasts.update((toasts) => toasts.filter((toast) => toast.id != id)) + }, duration) - return id + return id } export const removeToast = (id: number) => - toasts.update((toasts) => toasts.filter((toast) => toast.id != id)) + toasts.update((toasts) => toasts.filter((toast) => toast.id != id)) diff --git a/src/lib/mono/util/time.ts b/src/lib/mono/util/time.ts index 28ea0b66..f03681f9 100644 --- a/src/lib/mono/util/time.ts +++ b/src/lib/mono/util/time.ts @@ -1,7 +1,7 @@ export const debounce = (fn: Function, ms = 300) => { - let timeoutId: ReturnType - return function (this: any, ...args: any[]) { - clearTimeout(timeoutId) - timeoutId = setTimeout(() => fn.apply(this, args), ms) - } + let timeoutId: ReturnType + return function (this: any, ...args: any[]) { + clearTimeout(timeoutId) + timeoutId = setTimeout(() => fn.apply(this, args), ms) + } } diff --git a/src/lib/session.ts b/src/lib/session.ts index e74d38e2..a46accbd 100644 --- a/src/lib/session.ts +++ b/src/lib/session.ts @@ -19,7 +19,7 @@ interface SessionStorage { export const setSessionStorage = ( key: keyof SessionStorage, - value: SessionStorage[typeof key] + value: SessionStorage[typeof key], ) => { if (!browser) return if (value == undefined) { @@ -30,7 +30,7 @@ export const setSessionStorage = ( } export const getSessionStorage = ( - key: keyof SessionStorage + key: keyof SessionStorage, ): SessionStorage[typeof key] => { if (!browser) return return JSON.parse(sessionStorage.getItem(key)!) diff --git a/src/lib/settings.svelte.ts b/src/lib/settings.svelte.ts index 48a42f11..57a31151 100644 --- a/src/lib/settings.svelte.ts +++ b/src/lib/settings.svelte.ts @@ -187,8 +187,6 @@ export const defaultSettings: Settings = { logoColorMonth: null, } - - function createSettingsState(initial: Settings): Settings { let settings = $state(initial) if (browser) { @@ -197,9 +195,7 @@ function createSettingsState(initial: Settings): Settings { const merged = mergeDeep(initial, localSettings) settings = merged - } catch (e) { - } - + } catch (e) {} } return settings } @@ -208,7 +204,7 @@ export let settings = createSettingsState(defaultSettings) $effect.root(() => { $effect(() => { - localStorage.setItem('settings', JSON.stringify(settings)) + localStorage.setItem('settings', JSON.stringify(settings)) if (settings.language) { locale.set(settings.language) @@ -217,13 +213,11 @@ $effect.root(() => { } }) - return () => { - - } + return () => {} }) function isObject(item: any) { - return (item && typeof item === 'object' && !Array.isArray(item)); + return item && typeof item === 'object' && !Array.isArray(item) } /** @@ -232,19 +226,19 @@ function isObject(item: any) { * @param ...sources */ function mergeDeep(target: any, ...sources: any[]) { - if (!sources.length) return target; - const source = sources.shift(); + if (!sources.length) return target + const source = sources.shift() if (isObject(target) && isObject(source)) { for (const key in source) { if (isObject(source[key])) { - if (!target[key]) Object.assign(target, { [key]: {} }); - mergeDeep(target[key], source[key]); + if (!target[key]) Object.assign(target, { [key]: {} }) + mergeDeep(target[key], source[key]) } else { - Object.assign(target, { [key]: source[key] }); + Object.assign(target, { [key]: source[key] }) } } } - return mergeDeep(target, ...sources); -} \ No newline at end of file + return mergeDeep(target, ...sources) +} diff --git a/src/lib/translations.ts b/src/lib/translations.ts index 873d50b5..e4394f11 100644 --- a/src/lib/translations.ts +++ b/src/lib/translations.ts @@ -88,7 +88,7 @@ const config: Config = { loader: async () => (await import('./i18n/zh-Hant.json')).default, }, ], - fallbackLocale: 'en' + fallbackLocale: 'en', } export const aliases = new Map([ @@ -111,6 +111,4 @@ export const aliases = new Map([ ['he-IL', 'he'], ]) -export let { t, locale, locales, loading, loadTranslations } = new i18n( - config -) +export let { t, locale, locales, loading, loadTranslations } = new i18n(config) diff --git a/src/lib/ui/colors.ts b/src/lib/ui/colors.ts index 968387c3..5c7eaa7c 100644 --- a/src/lib/ui/colors.ts +++ b/src/lib/ui/colors.ts @@ -84,8 +84,8 @@ function themeStore( fn: ( values: ThemeData, set: (value: Theme) => void, - update: (fn: Updater) => void - ) => any + update: (fn: Updater) => void, + ) => any, ) { const derive: Readable = derived(data, fn) const { subscribe } = derive @@ -107,7 +107,7 @@ export let themeData = writable( scheme: 'system', themes: presets, currentTheme: 0, - } + }, ) themeData.subscribe((themeData) => { @@ -118,7 +118,7 @@ themeData.subscribe((themeData) => { JSON.stringify({ ...themeData, themes: filteredThemes, - }) + }), ) } }) @@ -126,7 +126,7 @@ themeData.subscribe((themeData) => { export let theme = themeStore( themeData, (data) => - data.themes.find((t) => t.id == data.currentTheme) ?? getDefaultTheme() + data.themes.find((t) => t.id == data.currentTheme) ?? getDefaultTheme(), ) export function calculateVars(theme: Theme) { @@ -145,7 +145,7 @@ export const themeVars = derived(theme, (t) => calculateVars(t as Theme)) const configuredColorScheme = env.PUBLIC_COLORSCHEME ?? 'system' export const colorScheme = writable( - configuredColorScheme as ColorScheme + configuredColorScheme as ColorScheme, ) export const toggleColorScheme = () => { @@ -175,7 +175,7 @@ function loadColorScheme() { colorScheme.subscribe((colorScheme) => { if (typeof document != 'undefined') { const prefersDark = window.matchMedia( - '(prefers-color-scheme: dark)' + '(prefers-color-scheme: dark)', ).matches const html = document.querySelector('html') diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 556d43bd..a1cf61e7 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -8,8 +8,7 @@ export let ssr = (env.PUBLIC_SSR_ENABLED?.toLowerCase() ?? 'false') == 'true' export const load = async ({}) => { if (browser) { - const initLocale = - settings.language ?? navigator?.language ?? 'en' + const initLocale = settings.language ?? navigator?.language ?? 'en' console.log(`Loading locale ${aliases.get(initLocale) ?? initLocale}`) diff --git a/src/routes/about/Profile.svelte b/src/routes/about/Profile.svelte index 499077e6..c16c19a0 100644 --- a/src/routes/about/Profile.svelte +++ b/src/routes/about/Profile.svelte @@ -1,14 +1,12 @@
diff --git a/src/routes/admin/+page.ts b/src/routes/admin/+page.ts index 2ac9c2e9..f85964a5 100644 --- a/src/routes/admin/+page.ts +++ b/src/routes/admin/+page.ts @@ -1,5 +1,5 @@ import { redirect } from '@sveltejs/kit' export const load = () => { - redirect(302, '/admin/config'); + redirect(302, '/admin/config') } diff --git a/src/routes/c/[name]/+layout.svelte b/src/routes/c/[name]/+layout.svelte index f6969f48..a9cc9301 100644 --- a/src/routes/c/[name]/+layout.svelte +++ b/src/routes/c/[name]/+layout.svelte @@ -1,5 +1,5 @@ diff --git a/src/routes/c/[name]/+page.ts b/src/routes/c/[name]/+page.ts index 21f19453..ddf2c4d9 100644 --- a/src/routes/c/[name]/+page.ts +++ b/src/routes/c/[name]/+page.ts @@ -10,8 +10,7 @@ export async function load({ params, fetch, url }) { const page = Number(url.searchParams.get('page')) || undefined const sort: SortType = - (url.searchParams.get('sort') as SortType) || - settings.defaultSort.sort + (url.searchParams.get('sort') as SortType) || settings.defaultSort.sort return await postFeed({ id: 'community', diff --git a/src/routes/c/[name]/settings/+page.svelte b/src/routes/c/[name]/settings/+page.svelte index b2315280..adcd75f9 100644 --- a/src/routes/c/[name]/settings/+page.svelte +++ b/src/routes/c/[name]/settings/+page.svelte @@ -3,18 +3,15 @@ import CommunityTitle from '$lib/components/lemmy/community/CommunityTitle.svelte' import Header from '$lib/components/ui/layout/pages/Header.svelte' - let { data } = $props(); + let { data } = $props()
Settings {#snippet extended()} - - {/snippet} + + {/snippet}
{#snippet formtitle()} - {''} - {/snippet} + {''} + {/snippet}
diff --git a/src/routes/comment/[instance]/+page.ts b/src/routes/comment/[instance]/+page.ts index f1e8b8a3..d4202c28 100644 --- a/src/routes/comment/[instance]/+page.ts +++ b/src/routes/comment/[instance]/+page.ts @@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit' export function load({ params }) { // If you somehow got to /comment/instance, it likely means you passed in an ID, not an instance. - redirect(302, `/comment/${getInstance()}/${params.instance}`); + redirect(302, `/comment/${getInstance()}/${params.instance}`) } diff --git a/src/routes/comment/[instance]/[id]/+page.ts b/src/routes/comment/[instance]/[id]/+page.ts index 3f506aab..76e90416 100644 --- a/src/routes/comment/[instance]/[id]/+page.ts +++ b/src/routes/comment/[instance]/[id]/+page.ts @@ -13,6 +13,6 @@ export async function load({ params, fetch }) { redirect( 302, - `/post/${params.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}` + `/post/${params.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`, ) } diff --git a/src/routes/inbox/+page.ts b/src/routes/inbox/+page.ts index 580c505f..07446757 100644 --- a/src/routes/inbox/+page.ts +++ b/src/routes/inbox/+page.ts @@ -55,7 +55,7 @@ export async function load({ url, fetch }) { ].sort( (a, b) => publishedToDate(b.published).getTime() - - publishedToDate(a.published).getTime() + publishedToDate(a.published).getTime(), ) return { diff --git a/src/routes/inbox/messages/[user_id=integer]/+page.svelte b/src/routes/inbox/messages/[user_id=integer]/+page.svelte index e54bf781..bff9d798 100644 --- a/src/routes/inbox/messages/[user_id=integer]/+page.svelte +++ b/src/routes/inbox/messages/[user_id=integer]/+page.svelte @@ -1,5 +1,5 @@
Linked Instances
@@ -18,8 +18,8 @@ Linked {#snippet target()} - - {/snippet} + + {/snippet}

These are the instances your instance can see and interact with content from. @@ -60,8 +60,8 @@ {#snippet target()} - - {/snippet} + + {/snippet}

These are the instances your instance is explicitly blocking content from. diff --git a/src/routes/login_reset/+page.svelte b/src/routes/login_reset/+page.svelte index f1883583..2b930b36 100644 --- a/src/routes/login_reset/+page.svelte +++ b/src/routes/login_reset/+page.svelte @@ -1,5 +1,5 @@ diff --git a/src/routes/modlog/item/ModlogItemTable.svelte b/src/routes/modlog/item/ModlogItemTable.svelte index 563f4968..338cf565 100644 --- a/src/routes/modlog/item/ModlogItemTable.svelte +++ b/src/routes/modlog/item/ModlogItemTable.svelte @@ -7,10 +7,10 @@ import ModlogAction from '../ModlogAction.svelte' interface Props { - item: ModLog; + item: ModLog } - let { item }: Props = $props(); + let { item }: Props = $props() @@ -28,7 +28,8 @@ user={item.moderator} /> {:else} -

Hidden

+

Hidden

+

{/if} diff --git a/src/routes/password_change/[token]/+page.svelte b/src/routes/password_change/[token]/+page.svelte index 9166915e..31cfc2c0 100644 --- a/src/routes/password_change/[token]/+page.svelte +++ b/src/routes/password_change/[token]/+page.svelte @@ -1,5 +1,5 @@ {@render children?.()} diff --git a/src/routes/profile/(local_user)/blocks/+layout.svelte b/src/routes/profile/(local_user)/blocks/+layout.svelte index 79f3a8be..56b27f31 100644 --- a/src/routes/profile/(local_user)/blocks/+layout.svelte +++ b/src/routes/profile/(local_user)/blocks/+layout.svelte @@ -5,7 +5,7 @@ */ /** @type {Props} */ - let { children } = $props(); + let { children } = $props()
import UserPage from '../../u/[name]/+page.svelte' - let { data } = $props(); + let { data } = $props() {#if data.user && data.sort && data.type && data.page} diff --git a/src/routes/profile/user/+page.ts b/src/routes/profile/user/+page.ts index 0f4bdef2..e3d6cdb7 100644 --- a/src/routes/profile/user/+page.ts +++ b/src/routes/profile/user/+page.ts @@ -26,12 +26,12 @@ export async function load({ url, fetch, parent }) { (a, b) => b.counts.upvotes - b.counts.downvotes - - (a.counts.upvotes - a.counts.downvotes) + (a.counts.upvotes - a.counts.downvotes), ) } else if (sort == 'New') { items.sort( (a, b) => - Date.parse(getItemPublished(b)) - Date.parse(getItemPublished(a)) + Date.parse(getItemPublished(b)) - Date.parse(getItemPublished(a)), ) } diff --git a/src/routes/profile/voted/[type]/+page.svelte b/src/routes/profile/voted/[type]/+page.svelte index 71e099d0..d3095db2 100644 --- a/src/routes/profile/voted/[type]/+page.svelte +++ b/src/routes/profile/voted/[type]/+page.svelte @@ -5,9 +5,9 @@ import Header from '$lib/components/ui/layout/pages/Header.svelte' import { t } from '$lib/translations' - let { data = $bindable() } = $props(); + let { data = $bindable() } = $props() - const SvelteComponent = $derived(browser ? VirtualFeed : PostFeed); + const SvelteComponent = $derived(browser ? VirtualFeed : PostFeed)
diff --git a/src/routes/saved/+page.ts b/src/routes/saved/+page.ts index 0eaa461e..6edaef6b 100644 --- a/src/routes/saved/+page.ts +++ b/src/routes/saved/+page.ts @@ -44,7 +44,7 @@ export async function load({ url, fetch }) { const everything = [...posts.posts, ...comments.comments].sort( (a, b) => Date.parse(getSavedItemPublished(b)) - - Date.parse(getSavedItemPublished(a)) + Date.parse(getSavedItemPublished(a)), ) return { page: page, data: everything, type: type } diff --git a/src/routes/search/+page.ts b/src/routes/search/+page.ts index 585b92a2..ae562fb2 100644 --- a/src/routes/search/+page.ts +++ b/src/routes/search/+page.ts @@ -46,7 +46,7 @@ export async function load({ url, fetch }) { everything.sort( (a, b) => new Date(getItemPublished(b)).getTime() - - new Date(getItemPublished(a)).getTime() + new Date(getItemPublished(a)).getTime(), ) } diff --git a/src/routes/settings/Section.svelte b/src/routes/settings/Section.svelte index 0ef1955d..ccfef762 100644 --- a/src/routes/settings/Section.svelte +++ b/src/routes/settings/Section.svelte @@ -4,20 +4,14 @@ import { backOut, expoOut } from 'svelte/easing' import { slide } from 'svelte/transition' - interface Props { - title: string; - id: string; - open?: boolean; - children?: import('svelte').Snippet; + title: string + id: string + open?: boolean + children?: import('svelte').Snippet } - let { - title, - id, - open = $bindable(true), - children - }: Props = $props(); + let { title, id, open = $bindable(true), children }: Props = $props()
diff --git a/src/routes/settings/Setting.svelte b/src/routes/settings/Setting.svelte index ea66e73c..2f9e3bb7 100644 --- a/src/routes/settings/Setting.svelte +++ b/src/routes/settings/Setting.svelte @@ -8,33 +8,31 @@ Icon, } from 'svelte-hero-icons' - interface Props { - supportedPlatforms?: any; - mainClass?: string; - itemsClass?: string; - optionClass?: string; - class?: string; - title?: import('svelte').Snippet; - description?: import('svelte').Snippet; - children?: import('svelte').Snippet; + supportedPlatforms?: any + mainClass?: string + itemsClass?: string + optionClass?: string + class?: string + title?: import('svelte').Snippet + description?: import('svelte').Snippet + children?: import('svelte').Snippet } let { supportedPlatforms = { - desktop: true, - tablet: true, - mobile: true, - }, + desktop: true, + tablet: true, + mobile: true, + }, mainClass = '', itemsClass = '', optionClass = '', class: clazz = '', title, description, - children - }: Props = $props(); - + children, + }: Props = $props()
{#snippet icon()} - - {/snippet} + + {/snippet} {$t('settings.desktop')} {/if} {#if supportedPlatforms.tablet} {#snippet icon()} - - {/snippet} + + {/snippet} {$t('settings.tablet')} {/if} {#if supportedPlatforms.mobile} {#snippet icon()} - - {/snippet} + + {/snippet} {$t('settings.mobile')} {/if} diff --git a/src/routes/settings/ToggleSetting.svelte b/src/routes/settings/ToggleSetting.svelte index 2b69168b..f16d5e58 100644 --- a/src/routes/settings/ToggleSetting.svelte +++ b/src/routes/settings/ToggleSetting.svelte @@ -9,13 +9,12 @@ Icon, } from 'svelte-hero-icons' - interface Props { - title: string; - description?: string | undefined; - checked?: boolean; - beta?: boolean; - supportedPlatforms?: any; + title: string + description?: string | undefined + checked?: boolean + beta?: boolean + supportedPlatforms?: any } let { @@ -24,11 +23,11 @@ checked = $bindable(false), beta = false, supportedPlatforms = { - desktop: true, - tablet: true, - mobile: true, - } - }: Props = $props(); + desktop: true, + tablet: true, + mobile: true, + }, + }: Props = $props()
@@ -41,24 +40,24 @@ {#if supportedPlatforms.desktop} {#snippet icon()} - - {/snippet} + + {/snippet} {$t('settings.desktop')} {/if} {#if supportedPlatforms.tablet} {#snippet icon()} - - {/snippet} + + {/snippet} {$t('settings.tablet')} {/if} {#if supportedPlatforms.mobile} {#snippet icon()} - - {/snippet} + + {/snippet} {$t('settings.mobile')} {/if} diff --git a/src/routes/settings/nav/NavItem.svelte b/src/routes/settings/nav/NavItem.svelte index 79d8b710..d9e4f0ab 100644 --- a/src/routes/settings/nav/NavItem.svelte +++ b/src/routes/settings/nav/NavItem.svelte @@ -2,18 +2,13 @@ import { Material, Popover } from 'mono-svelte' interface Props { - href: string; - size?: keyof typeof sizes; - title?: string; - children?: import('svelte').Snippet; + href: string + size?: keyof typeof sizes + title?: string + children?: import('svelte').Snippet } - let { - href, - size = 'medium', - title = '', - children - }: Props = $props(); + let { href, size = 'medium', title = '', children }: Props = $props() const sizes = { large: 'h-24', @@ -24,13 +19,12 @@ {#snippet target()} - + {@render children?.()} {/snippet} {#snippet popover()}

Photonify links