diff --git a/src/lib/components/ui/navbar/commands/actions.ts b/src/lib/components/ui/navbar/commands/actions.svelte.ts
similarity index 92%
rename from src/lib/components/ui/navbar/commands/actions.ts
rename to src/lib/components/ui/navbar/commands/actions.svelte.ts
index f96ee283..9d30bc5d 100644
--- a/src/lib/components/ui/navbar/commands/actions.ts
+++ b/src/lib/components/ui/navbar/commands/actions.svelte.ts
@@ -1,15 +1,15 @@
import { goto } from '$app/navigation'
import { page } from '$app/stores'
-import { setUserID, type Profile } from '$lib/auth'
+import { setUserID, type Profile } from '$lib/auth.svelte'
import {
amModOfAny,
isAdmin,
} from '$lib/components/lemmy/moderation/moderation'
import { resumables, type ResumableItem } from '$lib/lemmy/item'
-import { userSettings } from '$lib/settings.svelte'
+import { settings } from '$lib/settings.svelte'
import { t } from '$lib/translations'
import { colorScheme, theme, themeData, type ThemeData } from '$lib/ui/colors'
-import { fullCommunityName } from '$lib/util'
+import { fullCommunityName } from '$lib/util.svelte'
import {
ArrowRightOnRectangle,
Bookmark,
@@ -339,10 +339,7 @@ export function getGroups(
}),
icon: ViewColumns,
handle: () =>
- userSettings.update((s) => ({
- ...s,
- view: 'compact',
- })),
+ settings.view = 'compact'
},
{
name: t.get('nav.commands.setViewTo', {
@@ -350,10 +347,7 @@ export function getGroups(
}),
icon: ViewColumns,
handle: () =>
- userSettings.update((s) => ({
- ...s,
- view: 'cozy',
- })),
+ settings.view = 'cozy'
},
{
name: t.get('nav.commands.setViewTo', {
@@ -361,21 +355,7 @@ export function getGroups(
}),
icon: ViewColumns,
handle: () =>
- userSettings.update((s) => ({
- ...s,
- view: 'list',
- })),
- },
- {
- name: t.get('nav.commands.setViewTo', {
- default: t.get('filter.view.legacy'),
- }),
- icon: ViewColumns,
- handle: () =>
- userSettings.update((s) => ({
- ...s,
- view: 'card',
- })),
+ settings.view = 'list'
},
],
},
diff --git a/src/lib/components/ui/sidebar/CommunityList.svelte b/src/lib/components/ui/sidebar/CommunityList.svelte
index 10827d13..15bb3b98 100644
--- a/src/lib/components/ui/sidebar/CommunityList.svelte
+++ b/src/lib/components/ui/sidebar/CommunityList.svelte
@@ -1,5 +1,5 @@
{#each items.sort( (a, b) => a.title.localeCompare(b.title), ) as follow (follow.id)}
@@ -65,13 +65,13 @@
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
>
{#snippet label()}
-
+
{follow.title}
{new URL(follow.actor_id).hostname}
- {/snippet}
+ {/snippet}
{/each}
diff --git a/src/lib/components/ui/sidebar/ProfileButton.svelte b/src/lib/components/ui/sidebar/ProfileButton.svelte
index 30a17d9a..30121ee6 100644
--- a/src/lib/components/ui/sidebar/ProfileButton.svelte
+++ b/src/lib/components/ui/sidebar/ProfileButton.svelte
@@ -1,22 +1,21 @@
{/snippet}
- {#if $userSettings.dock.pins?.length ?? 0 > 0}
+ {#if settings.dock.pins?.length ?? 0 > 0}
- {#each $userSettings.dock.pins as pin}
+ {#each settings.dock.pins as pin}
goto(pin.url)}
@@ -46,8 +46,8 @@
selected={`${$page.url.pathname}${$page.url.search}` == pin.url}
on:contextmenu={(e) => {
e.preventDefault()
- $userSettings.dock.pins = $userSettings.dock.pins.toSpliced(
- $userSettings.dock.pins.findLastIndex((p) => pin.url == p.url),
+ settings.dock.pins = settings.dock.pins.toSpliced(
+ settings.dock.pins.findLastIndex((p) => pin.url == p.url),
1,
)
return false
@@ -120,7 +120,7 @@
{#snippet title()}
@@ -148,11 +148,11 @@
{#if $profile?.favorites && $profile?.favorites.length > 0}
{#snippet title()}
@@ -174,11 +174,11 @@
{#if $profile?.user.moderates.length > 0}
{#snippet title()}
@@ -201,11 +201,11 @@
{#snippet title()}
diff --git a/src/lib/components/ui/sidebar/SidebarButton.svelte b/src/lib/components/ui/sidebar/SidebarButton.svelte
index 595af0d1..e4cd0281 100644
--- a/src/lib/components/ui/sidebar/SidebarButton.svelte
+++ b/src/lib/components/ui/sidebar/SidebarButton.svelte
@@ -2,7 +2,7 @@
import { run } from 'svelte/legacy'
import { page } from '$app/stores'
- import { userSettings } from '$lib/settings.js'
+ import { settings } from '$lib/settings.svelte.js'
import { Button } from 'mono-svelte'
import { Icon, type IconSource } from 'svelte-hero-icons'
diff --git a/src/lib/lemmy.ts b/src/lib/lemmy.ts
index b84aa4e3..2681abc5 100644
--- a/src/lib/lemmy.ts
+++ b/src/lib/lemmy.ts
@@ -2,8 +2,8 @@ import { type GetSiteResponse, LemmyHttp } from 'lemmy-js-client'
import { get, writable } from 'svelte/store'
import { error } from '@sveltejs/kit'
import { instance } from '$lib/instance.js'
-import { instanceToURL } from '$lib/util.js'
-import { profile } from '$lib/auth.js'
+import { instanceToURL } from '$lib/util.svelte'
+import { profile } from '$lib/auth.svelte'
import { toast } from 'mono-svelte'
export const site = writable(undefined)
diff --git a/src/lib/lemmy/ProfileAvatar.svelte b/src/lib/lemmy/ProfileAvatar.svelte
index 0f7d512a..d3600089 100644
--- a/src/lib/lemmy/ProfileAvatar.svelte
+++ b/src/lib/lemmy/ProfileAvatar.svelte
@@ -1,13 +1,13 @@
{#if profile}
@@ -40,8 +40,8 @@
style={guest
? `color: gray`
: profile.color
- ? `color: ${profile.color}`
- : `filter: hue-rotate(${index * 50}deg)`}
+ ? `color: ${profile.color}`
+ : `filter: hue-rotate(${index * 50}deg)`}
/>
{/if}
diff --git a/src/lib/lemmy/generic.ts b/src/lib/lemmy/generic.ts
index 79f33e0f..ed047abc 100644
--- a/src/lib/lemmy/generic.ts
+++ b/src/lib/lemmy/generic.ts
@@ -1,4 +1,4 @@
-import { fullCommunityName } from '$lib/util'
+import { fullCommunityName } from '$lib/util.svelte'
import type { Community, Person } from 'lemmy-js-client'
export const communityLink = (community: Community, prefix: string = '') =>
diff --git a/src/lib/lemmy/item.ts b/src/lib/lemmy/item.ts
index 6a1c1361..b08bd904 100644
--- a/src/lib/lemmy/item.ts
+++ b/src/lib/lemmy/item.ts
@@ -1,4 +1,4 @@
-import { profile, profileData } from '$lib/auth'
+import { profile, profileData } from '$lib/auth.svelte'
import type {
CommentReportView,
CommentView,
diff --git a/src/lib/lemmy/user.ts b/src/lib/lemmy/user.ts
index 7ba41b06..de6f90c5 100644
--- a/src/lib/lemmy/user.ts
+++ b/src/lib/lemmy/user.ts
@@ -1,6 +1,6 @@
-import { profile, profileData, type Profile } from '$lib/auth.js'
+import { profile, profileData, type Profile } from '$lib/auth.svelte'
import { getClient } from '$lib/lemmy.js'
-import { trycatch } from '$lib/util.js'
+import { trycatch } from '$lib/util.svelte'
import type { Community, MyUserInfo, PersonView } from 'lemmy-js-client'
import { get } from 'svelte/store'
diff --git a/src/lib/mono/index.ts b/src/lib/mono/index.ts
index c624471b..80280679 100644
--- a/src/lib/mono/index.ts
+++ b/src/lib/mono/index.ts
@@ -8,7 +8,6 @@ export { default as Spinner } from './loader/Spinner.svelte'
export { default as Routebar } from './nav/Routebar.svelte'
export { default as Material } from './materials/Material.svelte'
-export { default as Form } from './forms/Form.svelte'
export { default as Label } from './forms/Label.svelte'
export { default as FileInput } from './forms/FileInput.svelte'
export { default as TextInput } from './forms/TextInput.svelte'
@@ -21,8 +20,6 @@ export { default as Switch } from './forms/Switch.svelte'
export { default as Radio } from './forms/Radio.svelte'
export { default as RadioGroup } from './forms/RadioGroup.svelte'
-export { default as Choicebox } from './forms/Choicebox.svelte'
-export { default as ChoiceboxGroup } from './forms/ChoiceboxGroup.svelte'
export { default as Popover } from './popover/Popover.svelte'
export { default as Menu } from './popover/Menu.svelte'
diff --git a/src/lib/mono/popover/MenuButton.svelte b/src/lib/mono/popover/MenuButton.svelte
index b55a77e1..908ab3af 100644
--- a/src/lib/mono/popover/MenuButton.svelte
+++ b/src/lib/mono/popover/MenuButton.svelte
@@ -3,18 +3,18 @@
type ButtonAlignment,
type ButtonColor,
} from '../button/Button.svelte'
- import { Icon, type IconSource} from 'svelte-hero-icons'
+ import { Icon, type IconSource } from 'svelte-hero-icons'
interface Props {
- color?: ButtonColor;
- alignment?: ButtonAlignment;
- href?: string | undefined;
- disabled?: boolean;
- class?: string;
- icon?: IconSource;
- prefix?: import('svelte').Snippet;
- children?: import('svelte').Snippet;
- suffix?: import('svelte').Snippet;
+ color?: ButtonColor
+ alignment?: ButtonAlignment
+ href?: string | undefined
+ disabled?: boolean
+ class?: string
+ icon?: IconSource
+ prefix?: import('svelte').Snippet
+ children?: import('svelte').Snippet
+ suffix?: import('svelte').Snippet
[key: string]: any
}
@@ -29,8 +29,7 @@
children,
suffix,
...rest
- }: Props = $props();
-
+ }: Props = $props()
@@ -139,20 +141,10 @@
{#snippet sidebar({ style: s, class: c })}
-
+
{/snippet}
{#snippet main({ style: s, class: c })}
{/snippet}
{#snippet navbar({ style: s, class: c })}
-
+
{/snippet}
{#snippet suffix({ class: c, style: s })}
-
+
{#if $page.data.slots?.sidebar?.component}
{@const SvelteComponent = $page.data.slots.sidebar.component}
-
+
{:else if $site}
{
if (browser) {
const initLocale =
- get(userSettings)?.language ?? navigator?.language ?? 'en'
+ settings.language ?? navigator?.language ?? 'en'
console.log(`Loading locale ${aliases.get(initLocale) ?? initLocale}`)
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index b8b2eb4d..a91cba68 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,29 +1,35 @@
-
-
@@ -32,24 +38,18 @@
{$t('routes.frontpage.title')}
{#snippet extended()}
-
- {#if data.type_}
-
- {/if}
-
+
+
+
- {/snippet}
+ {/snippet}
-
+
{#snippet title()}
-
+
Debug
Do NOT share anything from this menu.
- {/snippet}
+ {/snippet}
{/if}
{#if removing.shown && removing.account}
- {#snippet title()}
- Removing Account
- {/snippet}
+ {#snippet customTitle()}
+ Removing Account
+ {/snippet}
@@ -120,14 +120,14 @@
@@ -138,7 +138,7 @@