Merge pull request #642 from Xyphyn/2.0.2-fixes

2.0.2 fixes
This commit is contained in:
Xylight authored and GitHub committed 2025-08-30 22:46:14 +00:00
commit 10aed8559e
45 files changed
+351 -343

No files matched your search

-1
View File
@@ -14,7 +14,6 @@ declare global {
slots?: { slots?: {
sidebar?: { sidebar?: {
component?: ComponentType component?: ComponentType
// eslint-disable-next-line
props?: any props?: any
} }
} }
@@ -14,7 +14,6 @@
listing_type?: ListingType listing_type?: ListingType
showWhenEmpty?: boolean showWhenEmpty?: boolean
placeholder?: string placeholder?: string
// eslint-disable-next-line
onselect?: (item: any) => void onselect?: (item: any) => void
} }
@@ -5,7 +5,9 @@
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import { publishedToDate } from '$lib/components/util/date.js' import { publishedToDate } from '$lib/components/util/date.js'
import RelativeDate from '$lib/components/util/RelativeDate.svelte' import RelativeDate, {
formatRelativeDate,
} from '$lib/components/util/RelativeDate.svelte'
import { t } from '$lib/i18n/translations' import { t } from '$lib/i18n/translations'
import { getClient } from '$lib/lemmy.svelte.js' import { getClient } from '$lib/lemmy.svelte.js'
import { errorMessage } from '$lib/lemmy/error' import { errorMessage } from '$lib/lemmy/error'
@@ -168,8 +170,20 @@
date={publishedToDate(node.comment_view.comment.published)} date={publishedToDate(node.comment_view.comment.published)}
/> />
<span class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 ml-1"> <span class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 ml-1">
{#if node.comment_view.comment.updated} {#if node.comment_view.comment.updated}{@const edited = $t(
<Icon src={Pencil} solid size="12" aria-label="Edited" /> 'post.meta.lastEdited',
{
default: formatRelativeDate(
publishedToDate(node.comment_view.comment.updated),
{
style: 'long',
},
),
},
)}
<div title={edited}>
<Icon src={Pencil} micro size="14" />
</div>
{/if} {/if}
{#if node.comment_view.comment.deleted || node.comment_view.comment.removed} {#if node.comment_view.comment.deleted || node.comment_view.comment.removed}
<Icon <Icon
@@ -22,8 +22,6 @@
Sun, Sun,
Trophy, Trophy,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import { backOut } from 'svelte/easing'
import { fly } from 'svelte/transition'
interface Props extends SelectProps<string> { interface Props extends SelectProps<string> {
selected: string selected: string
+13 -3
View File
@@ -55,7 +55,7 @@
import { instance } from '$lib/instance.svelte' import { instance } from '$lib/instance.svelte'
import { settings, type View } from '$lib/settings.svelte' import { settings, type View } from '$lib/settings.svelte'
import type { Community, Person, SubscribedType } from 'lemmy-js-client' import type { Community, Person, SubscribedType } from 'lemmy-js-client'
import { Badge, Popover } from 'mono-svelte' import { Badge, modal, Popover } from 'mono-svelte'
import { import {
Bookmark, Bookmark,
ExclamationTriangle, ExclamationTriangle,
@@ -147,6 +147,7 @@
{#snippet target(attachment)} {#snippet target(attachment)}
<button <button
{@attach attachment} {@attach attachment}
class={[ class={[
'row-span-2 shrink-0 mr-2 self-center group/btn', 'row-span-2 shrink-0 mr-2 self-center group/btn',
'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer', 'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer',
@@ -229,15 +230,24 @@
<RelativeDate date={published} class="shrink-0" /> <RelativeDate date={published} class="shrink-0" />
{/if} {/if}
{#if edited} {#if edited}
<div <button
title={$t('post.meta.lastEdited', { title={$t('post.meta.lastEdited', {
default: formatRelativeDate(publishedToDate(edited), { default: formatRelativeDate(publishedToDate(edited), {
style: 'long', style: 'long',
}), }),
})} })}
onclick={() =>
modal({
title: $t('common.info'),
body: $t('post.meta.lastEdited', {
default: formatRelativeDate(publishedToDate(edited), {
style: 'long',
}),
}),
})}
> >
<Icon src={Pencil} micro size="14" /> <Icon src={Pencil} micro size="14" />
</div> </button>
{/if} {/if}
</div> </div>
<div <div
@@ -23,7 +23,9 @@
Icon, Icon,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import InfiniteScroll from 'svelte-infinite-scroll' import InfiniteScroll from 'svelte-infinite-scroll'
import { expoOut } from 'svelte/easing'
import { SvelteSet } from 'svelte/reactivity' import { SvelteSet } from 'svelte/reactivity'
import { fly } from 'svelte/transition'
interface Props { interface Props {
posts: PostView[] posts: PostView[]
@@ -200,12 +202,11 @@
> >
{#snippet item(row)} {#snippet item(row)}
<li <li
in:fly={row < 7
? { duration: 800, easing: expoOut, y: 24, delay: row * 50 }
: { opacity: 1, duration: 0 }}
data-index={row} data-index={row}
style={row < 7 ? `--anim-delay: ${row * 50}ms` : ''} class={['relative post-container px-3 sm:px-6', row < 7 && '']}
class={[
'relative post-container px-3 sm:px-6',
row < 7 && 'pop-in opacity-0',
]}
> >
<Post <Post
bind:post={posts[row]} bind:post={posts[row]}
@@ -278,21 +279,3 @@
{/if} {/if}
{@render children?.()} {@render children?.()}
</ul> </ul>
<style lang="postcss">
@keyframes popIn {
from {
transform: translateY(24px);
opacity: 0;
}
to {
transform: translateY(0px);
opacity: 1;
}
}
.pop-in {
animation: popIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards
var(--anim-delay);
}
</style>
@@ -36,7 +36,6 @@
marked.use(linkify, { marked.use(linkify, {
extensions: [ extensions: [
// @ts-expect-error hell with marked // @ts-expect-error hell with marked
// eslint-disable-next-line
containerExtension((params: any) => { containerExtension((params: any) => {
if (params.type == 'spoiler') { if (params.type == 'spoiler') {
return { return {
@@ -49,7 +48,6 @@
return null return null
}), }),
// @ts-expect-error hell with marked // @ts-expect-error hell with marked
// eslint-disable-next-line
subSupscriptExtension((params: any) => { subSupscriptExtension((params: any) => {
if (params.type == 'subscript') { if (params.type == 'subscript') {
return { return {
-1
View File
@@ -28,7 +28,6 @@
{#if icon} {#if icon}
<div <div
class={[ class={[
,
iconClass iconClass
? iconClass ? iconClass
: 'bg-slate-100 dark:bg-zinc-900 p-3 rounded-2xl text-primary-900 dark:text-primary-100', : 'bg-slate-100 dark:bg-zinc-900 p-3 rounded-2xl text-primary-900 dark:text-primary-100',
@@ -0,0 +1,19 @@
<script lang="ts">
import type { Snippet } from 'svelte'
const placements = {
top: 'top-6 lg:top-22',
bottom: 'bottom-22 lg:bottom-6',
}
interface Props {
placement: keyof typeof placements
children?: Snippet
}
let { placement, children }: Props = $props()
</script>
<div class={['sticky z-30 mb-0', placements[placement]]}>
{@render children?.()}
</div>
+1 -1
View File
@@ -40,7 +40,7 @@
class={[ class={[
'fixed lg:sticky bottom-0 lg:top-0', 'fixed lg:sticky bottom-0 lg:top-0',
!dockVisible && 'max-lg:-bottom-24', !dockVisible && 'max-lg:-bottom-24',
'max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0', 'max-w-3xl p-3 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
'w-full z-50 pointer-events-none', 'w-full z-50 pointer-events-none',
]} ]}
style="transition: bottom .4s cubic-bezier(0.075, 0.82, 0.165, 1);" style="transition: bottom .4s cubic-bezier(0.075, 0.82, 0.165, 1);"
@@ -43,7 +43,7 @@
{@render children?.()} {@render children?.()}
</h1> </h1>
{#if extended} {#if extended}
<div class="mt-4"> <div class="flex flex-col gap-3 mt-3">
{@render extended?.()} {@render extended?.()}
</div> </div>
{/if} {/if}
@@ -56,7 +56,7 @@
{#snippet prefix()} {#snippet prefix()}
<div class={(icon || customIcon) && adaptive ? 'lg:hidden' : ''}> <div class={(icon || customIcon) && adaptive ? 'lg:hidden' : ''}>
{#if icon} {#if icon}
<Icon src={icon} size="18" micro /> <Icon src={icon} size="20" mini />
{:else} {:else}
{@render customIcon?.({ size: 16, isSelected })} {@render customIcon?.({ size: 16, isSelected })}
{/if} {/if}
+1 -1
View File
@@ -133,7 +133,7 @@
{/snippet} {/snippet}
{$t('nav.menu.settings')} {$t('nav.menu.settings')}
</MenuButton> </MenuButton>
<Select bind:value={theme.colorScheme} size="sm" placement="left"> <Select bind:value={theme.colorScheme} size="sm" placement="bottom">
{#snippet target(attachment)} {#snippet target(attachment)}
<MenuButton <MenuButton
{@attach attachment} {@attach attachment}
@@ -42,7 +42,6 @@
const debounce = (fn: Function, ms = 300) => { const debounce = (fn: Function, ms = 300) => {
let timeoutId: ReturnType<typeof setTimeout> let timeoutId: ReturnType<typeof setTimeout>
// eslint-disable-next-line
return function (this: any, ...args: any[]) { return function (this: any, ...args: any[]) {
clearTimeout(timeoutId) clearTimeout(timeoutId)
timeoutId = setTimeout(() => fn.apply(this, args), ms) timeoutId = setTimeout(() => fn.apply(this, args), ms)
@@ -182,7 +182,7 @@ export function getGroups(
{ {
name: t.get('filter.sort.top.time.6hours'), name: t.get('filter.sort.top.time.6hours'),
icon: ChartBar, icon: ChartBar,
href: '/?sort=TopSixHours', href: '/?sort=TopSixHour',
}, },
{ {
name: t.get('filter.sort.top.time.hour'), name: t.get('filter.sort.top.time.hour'),
@@ -3,7 +3,6 @@
import { Modal } from 'mono-svelte' import { Modal } from 'mono-svelte'
interface Props { interface Props {
// eslint-disable-next-line
object: any object: any
open?: boolean open?: boolean
title?: import('svelte').Snippet title?: import('svelte').Snippet
@@ -1,7 +1,6 @@
<script lang="ts"> <script lang="ts">
import DebugTree from './DebugTree.svelte' import DebugTree from './DebugTree.svelte'
interface Props { interface Props {
// eslint-disable-next-line
object: any object: any
isParent?: boolean isParent?: boolean
} }
+4 -3
View File
@@ -603,12 +603,12 @@
"title": "Removing Submission", "title": "Removing Submission",
"titleRestore": "Restoring Submission", "titleRestore": "Restoring Submission",
"titlePurge": "Purging Submission", "titlePurge": "Purging Submission",
"withReason": "Reply with reason", "withReason": "Notify user",
"comment": "Comment", "comment": "Comment",
"message": "Message", "message": "Message",
"failReply": "Failed to post reply. Removing anyway...", "failReply": "Failed to post reply. Removing anyway...",
"failMessage": "Failed to message user. Removing anyway...", "failMessage": "Failed to message user. Removing anyway...",
"failEmptyReply": "Your reply cannot be empty if 'Reply with reason' is enabled.", "failEmptyReply": "Your reply cannot be empty if 'Notify user' is enabled.",
"successPurge": "Successfully purged that submission." "successPurge": "Successfully purged that submission."
}, },
"reportModal": { "reportModal": {
@@ -648,7 +648,8 @@
"general": "General", "general": "General",
"remove": "Remove", "remove": "Remove",
"download": "Download", "download": "Download",
"attach": "Attach file" "attach": "Attach file",
"info": "Info"
}, },
"message": { "message": {
"success": "Success", "success": "Success",
+1 -1
View File
@@ -127,7 +127,7 @@ export const aliases = new Map([
]) ])
export const { t, locale, locales, loading, loadTranslations } = new i18n< export const { t, locale, locales, loading, loadTranslations } = new i18n<
Parser.Params<any, object>, // eslint-disable-line Parser.Params<any, object>,
object, object,
object object
>(config) >(config)
-1
View File
@@ -14,7 +14,6 @@ export function errorMessage(error: any, instance?: string): string {
return t.get(`error.${error}`) return t.get(`error.${error}`)
} catch { } catch {
// eslint-disable-next-line
return error as any return error as any
} }
} }
+7 -4
View File
@@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import type { Snippet } from 'svelte'
import type { ClassValue, HTMLAttributes } from 'svelte/elements' import type { ClassValue, HTMLAttributes } from 'svelte/elements'
interface Props extends HTMLAttributes<HTMLSpanElement> { interface Props extends HTMLAttributes<HTMLSpanElement> {
@@ -8,13 +9,14 @@
*/ */
text?: string | undefined text?: string | undefined
class?: ClassValue class?: ClassValue
children?: import('svelte').Snippet customText?: Snippet
} }
let { let {
for: forID = undefined, for: forID = undefined,
text = undefined, text = undefined,
class: clazz = '', class: clazz = '',
customText,
children, children,
...rest ...rest
}: Props = $props() }: Props = $props()
@@ -26,8 +28,9 @@
class={['text-sm text-slate-800 dark:text-zinc-200 font-medium', clazz]} class={['text-sm text-slate-800 dark:text-zinc-200 font-medium', clazz]}
> >
{#if text} {#if text}
{text} <div class="inline-block">{text}</div>
{:else if children} {:else if customText}
{@render children?.()} {@render customText?.()}
{/if} {/if}
{@render children?.()}
</label> </label>
+85 -84
View File
@@ -93,91 +93,92 @@
</script> </script>
{#snippet selectTarget(attachment: Attachment)} {#snippet selectTarget(attachment: Attachment)}
<Label text={label} class={['space-y-1 relative', clazz, baseClass]}> <Label text={label} customText={customLabel} class={['space-y-1 relative', clazz, baseClass]}>
{@render customLabel?.()} <div class="relative" role="presentation">
<Icon <select
src={ChevronUpDown} {@attach attachment}
micro {...rest}
size="16" bind:this={element}
class="absolute right-1.5 bottom-1 box-border pointer-events-none z-10 text-slate-600 dark:text-zinc-400" class={[
/> buttonSize[size],
<select buttonShadow[shadow],
{@attach attachment} buttonColor.secondary,
{...rest} 'appearance-none transition-colors rounded-xl text-sm w-full min-w-full cursor-pointer pr-6',
bind:this={element} selectClass,
class={[ clazz,
buttonSize[size], ]}
buttonShadow[shadow], bind:value
buttonColor.secondary, onmousedown={e => {
'appearance-none transition-colors rounded-xl text-sm w-full min-w-full cursor-pointer pr-6', e.preventDefault()
selectClass, }}
clazz, onkeypress={e => {
]} e.preventDefault()
bind:value open = !open
onmousedown={e => { }}
e.preventDefault() {onchange}
}} {oncontextmenu}
onkeypress={e => { {placeholder}
e.preventDefault() >
open = !open {#if placeholder}
}} <option disabled selected value="">{placeholder}</option>
{onchange} {/if}
{oncontextmenu} {@render children?.()}
{placeholder} </select>
> <Icon
{#if placeholder} src={ChevronUpDown}
<option disabled selected value="">{placeholder}</option> micro
{/if} size="16"
{@render children?.()} class="absolute bottom-1/2 translate-y-1/2 right-1 box-border pointer-events-none z-10 text-slate-600 dark:text-zinc-400"
</select> />
</div>
</Label> </Label>
{/snippet} {/snippet}
<Menu bind:open {placement}> <Menu bind:open {placement}>
{#snippet target(attachment)} {#snippet target(attachment)}
{@const render = passedTarget ?? selectTarget} {@const render = passedTarget ?? selectTarget}
{@render render?.(attachment)} {@render render?.(attachment)}
{/snippet} {/snippet}
{#each context.options as option (option)} {#each context.options as option (option)}
{#if customOption}{@render customOption({ {#if customOption}{@render customOption({
option, option,
selected: option.value == value, selected: option.value == value,
})}{:else} })}{:else}
<MenuButton <MenuButton
onclick={async () => { onclick={async () => {
value = option.value value = option.value
await tick() await tick()
element?.dispatchEvent(new Event('change', { bubbles: true })) element?.dispatchEvent(new Event('change', { bubbles: true }))
}} }}
size="custom" size="custom"
disabled={option.disabled} disabled={option.disabled}
color="none" color="none"
class={[ class={[
'min-h-0! py-1 hover:bg-slate-100 dark:hover:bg-zinc-800', 'min-h-0! py-1 hover:bg-slate-100 dark:hover:bg-zinc-800',
option.value == value && option.value == value &&
'bg-slate-100 dark:bg-zinc-800 text-primary-900 dark:text-primary-100 font-medium', 'bg-slate-100 dark:bg-zinc-800 text-primary-900 dark:text-primary-100 font-medium',
option.disabled && option.disabled &&
'pointer-events-none text-slate-600 dark:text-zinc-400', 'pointer-events-none text-slate-600 dark:text-zinc-400',
option.isLabel && 'text-xs mt-2', option.isLabel && 'text-xs mt-2',
]} ]}
> >
{#if option.value == value} {#if option.value == value}
<Icon <Icon
src={CheckCircle} src={CheckCircle}
size="16" size="16"
micro micro
class="text-primary-900 dark:text-primary-100" class="text-primary-900 dark:text-primary-100"
/> />
{:else if option.icon} {:else if option.icon}
<Icon <Icon
src={option.icon} src={option.icon}
size="16" size="16"
micro micro
class="text-slate-600 dark:text-zinc-400" class="text-slate-600 dark:text-zinc-400"
/> />
{/if}
{@html option.label}
</MenuButton>
{/if} {/if}
{/each} {@html option.label}
</Menu> </MenuButton>
{/if}
{/each}
</Menu>
+1 -1
View File
@@ -100,7 +100,7 @@ bg-white/50 dark:bg-black/50 box-border p-4"
}} }}
class="w-full border border-slate-200 border-b-slate-300 class="w-full border border-slate-200 border-b-slate-300
dark:border-zinc-900 dark:border-zinc-900
rounded-3xl max-w-lg box-border mx-auto overscroll-contain shadow-lg overflow-auto rounded-2xl max-w-lg box-border mx-auto overscroll-contain shadow-lg overflow-auto
p-5 flex flex-col gap-2 dark:bg-zinc-950 p-5 flex flex-col gap-2 dark:bg-zinc-950
bg-slate-50 relative {clazz}" bg-slate-50 relative {clazz}"
> >
-1
View File
@@ -1,6 +1,5 @@
export const debounce = (fn: Function, ms = 300) => { export const debounce = (fn: Function, ms = 300) => {
let timeoutId: ReturnType<typeof setTimeout> let timeoutId: ReturnType<typeof setTimeout>
// eslint-disable-next-line
return function (this: any, ...args: any[]) { return function (this: any, ...args: any[]) {
clearTimeout(timeoutId) clearTimeout(timeoutId)
timeoutId = setTimeout(() => fn.apply(this, args), ms) timeoutId = setTimeout(() => fn.apply(this, args), ms)
+3 -2
View File
@@ -76,12 +76,13 @@
let nprogressTimeout = -1 let nprogressTimeout = -1
$effect(() => { $effect(() => {
if (navigating.to) if (navigating.to) {
clearTimeout(nprogressTimeout)
nprogressTimeout = setTimeout( nprogressTimeout = setTimeout(
() => nProgress.start(), () => nProgress.start(),
200, 200,
) as unknown as number ) as unknown as number
else { } else {
if (nprogressTimeout > -1) { if (nprogressTimeout > -1) {
clearTimeout(nprogressTimeout) clearTimeout(nprogressTimeout)
nprogressTimeout = -1 nprogressTimeout = -1
+30 -24
View File
@@ -21,12 +21,12 @@
onMount(async () => { onMount(async () => {
await data.feed.value await data.feed.value
$effect(() => { })
if (data.filters.value.type_) $effect(() => {
settings.defaultSort.feed = data.filters.value.type_ if (data.filters.value.type_)
if (data.filters.value.sort) settings.defaultSort.feed = data.filters.value.type_
settings.defaultSort.sort = data.filters.value.sort if (data.filters.value.sort)
}) settings.defaultSort.sort = data.filters.value.sort
}) })
const FeedComponent = $derived( const FeedComponent = $derived(
@@ -45,27 +45,33 @@
{$t('routes.frontpage.title')} {$t('routes.frontpage.title')}
{#snippet extended()} {#snippet extended()}
<form class="flex items-center gap-2" method="get" action="/"> <form class="" method="get" action="/">
{#if data.filters.value.type_} <div class="flex flex-row gap-4">
<Location {#if data.filters.value.type_}
name="type" <Location
name="type"
navigate
bind:selected={data.filters.value.type_}
/>
{/if}
<Sort
placement="bottom"
name="sort"
navigate navigate
bind:selected={data.filters.value.type_} bind:selected={data.filters.value.sort}
/> />
{/if} <ViewSelect placement="bottom" />
<Sort
placement="bottom"
name="sort"
navigate
bind:selected={data.filters.value.sort}
/>
<ViewSelect placement="bottom" />
<noscript> <noscript>
<Button class="self-end h-[34px] aspect-square" size="custom" submit> <Button
<Icon src={ArrowRight} size="16" micro /> class="self-end h-[34px] aspect-square"
</Button> size="custom"
</noscript> submit
>
<Icon src={ArrowRight} size="16" micro />
</Button>
</noscript>
</div>
</form> </form>
{/snippet} {/snippet}
</Header> </Header>
+1 -1
View File
@@ -126,7 +126,7 @@
</div> </div>
{/snippet} {/snippet}
</Header> </Header>
<form class="accounts-grid mt-4 sm:mt-6 gap-4"> <form class="accounts-grid gap-4">
<CommonList <CommonList
selected={p => p.id == profile.meta.profile} selected={p => p.id == profile.meta.profile}
items={profile.meta.profiles} items={profile.meta.profiles}
-7
View File
@@ -1,15 +1,9 @@
<script> <script>
import { notifications } from '$lib/auth.svelte' import { notifications } from '$lib/auth.svelte'
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte' import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import {} from '$lib/components/ui/layout/Shell.svelte'
import { t } from '$lib/i18n/translations' import { t } from '$lib/i18n/translations'
import { Badge } from 'mono-svelte' import { Badge } from 'mono-svelte'
/**
* @typedef {Object} Props
* @property {import('svelte').Snippet} [children]
*/
/** @type {Props} */
let { children } = $props() let { children } = $props()
</script> </script>
@@ -49,7 +43,6 @@
name: $t('routes.admin.media.title'), name: $t('routes.admin.media.title'),
}, },
]} ]}
class="overflow-auto"
/> />
{@render children?.()} {@render children?.()}
</div> </div>
+3
View File
@@ -1,6 +1,9 @@
import { profile } from '$lib/auth.svelte.js'
import { getClient, site as siteStore } from '$lib/lemmy.svelte.js' import { getClient, site as siteStore } from '$lib/lemmy.svelte.js'
import { error } from '@sveltejs/kit'
export async function load({ fetch }) { export async function load({ fetch }) {
if (!profile.current.jwt) error(403)
const site = siteStore const site = siteStore
if (!site.data) { if (!site.data) {
+2 -2
View File
@@ -74,7 +74,7 @@
{/if} {/if}
</ul> </ul>
<form <form
class="flex flex-row items-center gap-2 mt-auto w-full" class="flex flex-row gap-2 mt-auto w-full"
onsubmit={preventDefault(() => { onsubmit={preventDefault(() => {
trycatch(async () => { trycatch(async () => {
if (!profile.current?.jwt || newAdmin == '') return if (!profile.current?.jwt || newAdmin == '') return
@@ -106,7 +106,7 @@
disabled={adding} disabled={adding}
rounding="xl" rounding="xl"
color="primary" color="primary"
class="h-full" size="sm"
submit submit
> >
{#snippet prefix()} {#snippet prefix()}
+3 -4
View File
@@ -41,14 +41,13 @@
<title>{$t('routes.communities.title')}</title> <title>{$t('routes.communities.title')}</title>
</svelte:head> </svelte:head>
<Header pageHeader class="justify-between"> <Header pageHeader>
<span>{$t('routes.communities.title')}</span> {$t('routes.communities.title')}
{#snippet extended()} {#snippet extended()}
<form method="get" action="/communities" class="contents" bind:this={form}> <form method="get" action="/communities" class="contents" bind:this={form}>
<SearchBar bind:query={search} /> <SearchBar bind:query={search} />
<div class="flex flex-row flex-wrap gap-4 mt-4 items-center"> <div class="flex flex-row flex-wrap gap-4 items-center">
<Location <Location
name="type" name="type"
selected={data.type} selected={data.type}
+1 -2
View File
@@ -2,7 +2,6 @@
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { profile } from '$lib/auth.svelte.js' import { profile } from '$lib/auth.svelte.js'
import PostForm from '$lib/components/lemmy/post/form/PostForm.svelte' import PostForm from '$lib/components/lemmy/post/form/PostForm.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/i18n/translations.js' import { t } from '$lib/i18n/translations.js'
import { getSessionStorage, setSessionStorage } from '$lib/session.js' import { getSessionStorage, setSessionStorage } from '$lib/session.js'
import { onDestroy, onMount } from 'svelte' import { onDestroy, onMount } from 'svelte'
@@ -24,7 +23,7 @@
}) })
// TODO remove this // TODO remove this
// eslint-disable-next-line
let post = getSessionStorage('postDraft') as any let post = getSessionStorage('postDraft') as any
</script> </script>
+3 -4
View File
@@ -12,6 +12,7 @@
import { Button, Option, Select } from 'mono-svelte' import { Button, Option, Select } from 'mono-svelte'
import { ArrowPath, Check, Funnel, Icon, Inbox } from 'svelte-hero-icons' import { ArrowPath, Check, Funnel, Icon, Inbox } from 'svelte-hero-icons'
import InboxItem from './InboxItem.svelte' import InboxItem from './InboxItem.svelte'
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
let { data } = $props() let { data } = $props()
@@ -114,9 +115,7 @@
</CommonList> </CommonList>
{/if} {/if}
{#if !(data.page == 1 && (data?.inbox?.value.length ?? 0) == 0)} {#if !(data.page == 1 && (data?.inbox?.value.length ?? 0) == 0)}
<div <Fixate placement="bottom">
class="sticky z-30 mx-auto max-w-full self-end mt-auto bottom-22 lg:bottom-6"
>
<Pageination <Pageination
hasMore={!( hasMore={!(
!data.inbox || (data.inbox.value?.length ?? 0) < (data?.limit ?? 0) !data.inbox || (data.inbox.value?.length ?? 0) < (data?.limit ?? 0)
@@ -124,5 +123,5 @@
page={data.page} page={data.page}
href={page => `?page=${page}`} href={page => `?page=${page}`}
/> />
</div> </Fixate>
{/if} {/if}
+1
View File
@@ -92,6 +92,7 @@
<Button <Button
color="primary" color="primary"
rounding="pill" rounding="pill"
class="w-max"
onclick={() => (searchModal.open = !searchModal.open)} onclick={() => (searchModal.open = !searchModal.open)}
> >
<Icon src={ChatBubbleOvalLeftEllipsis} size="18" mini /> <Icon src={ChatBubbleOvalLeftEllipsis} size="18" mini />
+1 -3
View File
@@ -21,6 +21,4 @@
}, },
]} ]}
/> />
<div class="w-full space-y-4 pb-8"> {@render children?.()}
{@render children?.()}
</div>
+76 -72
View File
@@ -15,6 +15,7 @@
import { tick } from 'svelte' import { tick } from 'svelte'
import { Check, Funnel, Icon, ShieldCheck, XMark } from 'svelte-hero-icons' import { Check, Funnel, Icon, ShieldCheck, XMark } from 'svelte-hero-icons'
import Report from './Report.svelte' import Report from './Report.svelte'
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
let { data = $bindable() } = $props() let { data = $bindable() } = $props()
@@ -71,67 +72,67 @@
} }
</script> </script>
<div class="mb-4 flex flex-col gap-4"> <Header pageHeader>
<Header pageHeader> {$t('routes.moderation.title')}
{$t('routes.moderation.title')} {#snippet extended()}
{#snippet extended()} <div class="flex flex-row gap-2 flex-wrap items-end">
<div class="flex flex-row gap-2 flex-wrap items-end"> <Select
<Select bind:value={data.type.value}
bind:value={data.type.value} onchange={async () => {
onchange={async () => { await tick()
await tick() searchParam(page.url, 'type', data.type.value, 'page')
searchParam(page.url, 'type', data.type.value, 'page') }}
}} >
> {#snippet customLabel()}
{#snippet customLabel()} <span class="flex items-center gap-1">
<span class="flex items-center gap-1"> <Icon src={Funnel} size="15" mini />
<Icon src={Funnel} size="15" mini /> {$t('filter.filter')}
{$t('filter.filter')} </span>
</span> {/snippet}
{/snippet} <Option value="all">{$t('filter.location.all')}</Option>
<Option value="all">{$t('filter.location.all')}</Option> <Option value="unread">{$t('filter.unread')}</Option>
<Option value="unread">{$t('filter.unread')}</Option> </Select>
</Select> <Button
<Button loading={batch.progress >= 0}
loading={batch.progress >= 0} disabled={batch.progress >= 0 || data.items.value?.length == 0}
disabled={batch.progress >= 0 || data.items.value?.length == 0} onclick={markAllAsResolved}
onclick={markAllAsResolved} class="h-max ml-auto"
class="h-max ml-auto" rounding="pill"
rounding="pill" color="primary"
color="primary" >
> <Icon src={Check} size="16" mini />
<Icon src={Check} size="16" mini /> {$t('routes.moderation.markAll')}
{$t('routes.moderation.markAll')} </Button>
</Button> </div>
</div> {#if data.filters.community}
{#if data.filters.community} <ul class="font-normal flex flex-col gap-2 mt-2">
<ul class="font-normal flex flex-col gap-2 mt-2"> <li>
<li> <span class="text-sm text-slate-600 dark:text-zinc-400">
<span class="text-sm text-slate-600 dark:text-zinc-400"> {$t('form.post.community')}
{$t('form.post.community')} </span>
</span> {#await client().getCommunity({ id: data.filters.community })}
{#await client().getCommunity({ id: data.filters.community })} <Spinner width={24} />
<Spinner width={24} /> {:then community}
{:then community} <a
<a class="inline"
class="inline" aria-label={$t('common.remove')}
aria-label={$t('common.remove')} href="?community="
href="?community=" >
> <Icon src={XMark} size="16" micro class="inline" />
<Icon src={XMark} size="16" micro class="inline" /> </a>
</a> <CommunityLink
<CommunityLink class="w-max inline"
class="w-max inline" community={community.community_view.community}
community={community.community_view.community} />
/> {/await}
{/await} </li>
</li> </ul>
</ul> {/if}
{/if} {/snippet}
{/snippet} </Header>
</Header> {#if batch.progress > 0}
</div> <ProgressBar progress={batch.progress} />
<ProgressBar progress={batch.progress} /> {/if}
{#if data.items?.value && data.items?.value.length > 0} {#if data.items?.value && data.items?.value.length > 0}
<CommonList items={data.items?.value} size="lg"> <CommonList items={data.items?.value} size="lg">
{#snippet item(item)} {#snippet item(item)}
@@ -153,16 +154,19 @@
{/if} {/if}
{/snippet} {/snippet}
</CommonList> </CommonList>
<Pageination <Fixate placement="bottom">
page={data.page} <Pageination
href={current => `?page=${current}`} page={data.page}
hasMore={data.items.value.length >= 20} href={current => `?page=${current}`}
/> hasMore={data.items.value.length >= 20}
/>
</Fixate>
{:else} {:else}
<Placeholder <div class="h-full grid place-items-center">
icon={ShieldCheck} <Placeholder
title={$t('routes.moderation.empty.title')} icon={ShieldCheck}
description={$t('routes.moderation.empty.description')} title={$t('routes.moderation.empty.title')}
/> description={$t('routes.moderation.empty.description')}
/>
</div>
{/if} {/if}
<div class="h-4"></div>
@@ -2,10 +2,11 @@
import { profile } from '$lib/auth.svelte.js' import { profile } from '$lib/auth.svelte.js'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte' import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
import Entity from '$lib/components/ui/Entity.svelte' import Entity from '$lib/components/ui/Entity.svelte'
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte' import Header from '$lib/components/ui/layout/pages/Header.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { t } from '$lib/i18n/translations.js' import { t } from '$lib/i18n/translations.js'
import { getClient } from '$lib/lemmy.svelte.js' import { getClient } from '$lib/lemmy.svelte.js'
import type { import type {
@@ -14,11 +15,8 @@
PersonBlockView, PersonBlockView,
} from 'lemmy-js-client' } from 'lemmy-js-client'
import { Button } from 'mono-svelte' import { Button } from 'mono-svelte'
import Material from 'mono-svelte/materials/Material.svelte'
import { Check, Icon, XMark } from 'svelte-hero-icons' import { Check, Icon, XMark } from 'svelte-hero-icons'
import type { PageData } from './$types.js' import type { PageData } from './$types.js'
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
interface Props { interface Props {
// sveltekit doesn't feel like making types work right now // sveltekit doesn't feel like making types work right now
+3 -2
View File
@@ -2,6 +2,7 @@
import { page } from '$app/state' import { page } from '$app/state'
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte' import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
import PostItem from '$lib/components/lemmy/post/PostItem.svelte' import PostItem from '$lib/components/lemmy/post/PostItem.svelte'
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
import CommonList from '$lib/components/ui/layout/CommonList.svelte' import CommonList from '$lib/components/ui/layout/CommonList.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte' import Header from '$lib/components/ui/layout/pages/Header.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
@@ -78,10 +79,10 @@
{/snippet} {/snippet}
</CommonList> </CommonList>
{/if} {/if}
<div class="sticky z-30 mx-auto max-w-full bottom-22 lg:bottom-6"> <Fixate placement="bottom">
<Pageination <Pageination
hasMore={data.data.length == 40} hasMore={data.data.length == 40}
href={page => `?page=${page}`} href={page => `?page=${page}`}
page={data.page} page={data.page}
/> />
</div> </Fixate>
+1 -1
View File
@@ -26,7 +26,7 @@ export async function load({ url, fetch }) {
const { posts, comments } = await client({ func: fetch }).getPersonDetails({ const { posts, comments } = await client({ func: fetch }).getPersonDetails({
saved_only: true, saved_only: true,
limit: 20, limit: 20,
page: 1, page: page,
person_id: user?.local_user_view.person.id, person_id: user?.local_user_view.person.id,
}) })
+1 -6
View File
@@ -55,12 +55,7 @@
<Header pageHeader> <Header pageHeader>
{$t('routes.search.title')} {$t('routes.search.title')}
{#snippet extended()} {#snippet extended()}
<form <form method="get" action="/search" class="contents" bind:this={form}>
method="get"
action="/search"
class="flex flex-col gap-4"
bind:this={form}
>
<SearchBar bind:query={data.filters.value.query} /> <SearchBar bind:query={data.filters.value.query} />
<div class="flex flex-row flex-wrap items-center gap-4"> <div class="flex flex-row flex-wrap items-center gap-4">
<Select <Select
+23 -25
View File
@@ -13,30 +13,28 @@
let searchElement = $state<HTMLInputElement>() let searchElement = $state<HTMLInputElement>()
</script> </script>
<div class="mt-4 mb-0 sticky z-30 top-6 lg:top-22"> <div
<div class="flex gap-2 flex-row items-center w-full text-base h-10 drop-shadow-xl"
class="flex gap-2 flex-row items-center w-full text-base h-10 drop-shadow-xl" >
<TextInput
bind:value={query}
bind:element={searchElement}
name="q"
placeholder={$t('routes.search.query')}
size="lg"
class="flex-1 rounded-full! h-full text-base!"
/>
<Button
submit
color="primary"
size="custom"
class="shrink-0 h-full aspect-square shadow-md"
title="Search"
rounding="pill"
loading={navigating.to?.route.id == '/search'}
> >
<TextInput {#snippet prefix()}
bind:value={query} <Icon src={MagnifyingGlass} size="16" micro />
bind:element={searchElement} {/snippet}
name="q" </Button>
placeholder={$t('routes.search.query')}
size="lg"
class="flex-1 rounded-full! h-full text-base!"
/>
<Button
submit
color="primary"
size="custom"
class="shrink-0 h-full aspect-square shadow-md"
title="Search"
rounding="pill"
loading={navigating.to?.route.id == '/search'}
>
{#snippet prefix()}
<Icon src={MagnifyingGlass} size="16" micro />
{/snippet}
</Button>
</div>
</div> </div>
+34 -40
View File
@@ -153,47 +153,41 @@
class="flex flex-row flex-wrap class="flex flex-row flex-wrap
flex-1 gap-2 w-full lg:w-max max-w-full lg:self-end" flex-1 gap-2 w-full lg:w-max max-w-full lg:self-end"
> >
<div class="max-w-full"> <Select bind:value={settings.defaultSort.feed}>
<Select bind:value={settings.defaultSort.feed}> {#snippet customLabel()}
{#snippet customLabel()} <div class="flex items-center gap-1">
<span class="flex items-center gap-1"> <Icon src={GlobeAmericas} size="16" mini />
<Icon src={GlobeAmericas} size="16" mini /> {$t('filter.location.label')}
{$t('filter.location.label')} </div>
</span> {/snippet}
{/snippet} <Option value="All">{$t('filter.location.all')}</Option>
<Option value="All">{$t('filter.location.all')}</Option> <Option value="Local">{$t('filter.location.local')}</Option>
<Option value="Local">{$t('filter.location.local')}</Option> <Option value="Subscribed">
<Option value="Subscribed"> {$t('filter.location.subscribed')}
{$t('filter.location.subscribed')} </Option>
</Option> <Option value="Moderator">
<Option value="Moderator"> {$t('filter.location.moderator')}
{$t('filter.location.moderator')} </Option>
</Option> </Select>
</Select> <Sort bind:selected={settings.defaultSort.sort} navigate={false} />
</div> <Select bind:value={settings.defaultSort.comments}>
<div class="max-w-full"> {#snippet customLabel()}
<Sort bind:selected={settings.defaultSort.sort} navigate={false} /> <div class="flex items-center gap-1">
</div> <Icon src={ChatBubbleOvalLeftEllipsis} size="14" mini />
<div class="max-w-full"> {$t('content.comments')}
<Select bind:value={settings.defaultSort.comments}> </div>
{#snippet customLabel()} {/snippet}
<span class="flex items-center gap-1">
<Icon src={ChatBubbleOvalLeftEllipsis} size="14" mini />
{$t('content.comments')}
</span>
{/snippet}
<Option icon={Fire} value="Hot">{$t('filter.sort.hot')}</Option> <Option icon={Fire} value="Hot">{$t('filter.sort.hot')}</Option>
<Option icon={Trophy} value="Top"> <Option icon={Trophy} value="Top">
{$t('filter.sort.top.label')} {$t('filter.sort.top.label')}
</Option> </Option>
<Option icon={Star} value="New">{$t('filter.sort.new')}</Option> <Option icon={Star} value="New">{$t('filter.sort.new')}</Option>
<Option icon={Clock} value="Old">{$t('filter.sort.old')}</Option> <Option icon={Clock} value="Old">{$t('filter.sort.old')}</Option>
<Option icon={ArrowTrendingDown} value="Controversial"> <Option icon={ArrowTrendingDown} value="Controversial">
{$t('filter.sort.controversial')} {$t('filter.sort.controversial')}
</Option> </Option>
</Select> </Select>
</div>
</div> </div>
</Setting> </Setting>
<ToggleSetting <ToggleSetting
+1 -1
View File
@@ -157,7 +157,7 @@
class="flex flex-col gap-4 h-full w-full flex-2/3" class="flex flex-col gap-4 h-full w-full flex-2/3"
onsubmit={preventDefault(submit)} onsubmit={preventDefault(submit)}
> >
<Button href="/signup" class="inline-block mb-4 w-max" rounding="pill"> <Button href="/accounts" class="inline-block mb-4 w-max" rounding="pill">
<Icon src={ArrowLeft} size="16" micro /> <Icon src={ArrowLeft} size="16" micro />
{$t('common.back')} {$t('common.back')}
</Button> </Button>
+2 -2
View File
@@ -51,10 +51,10 @@
</Modal> </Modal>
{/if} {/if}
<Header pageHeader>{$t('routes.theme.title')}</Header>
<div class="flex flex-col gap-4 h-full"> <div class="flex flex-col gap-4 h-full">
<Header pageHeader>{$t('routes.theme.title')}</Header>
<h3 <h3
class="relative top-[26px] z-10 left-6 font-medium text-sm bg-slate-25 dark:bg-zinc-925 w-max px-1" class="relative -mb-7 z-10 left-6 font-medium text-sm bg-slate-25 dark:bg-zinc-925 w-max px-1"
> >
{$t('routes.theme.preset.presets')} {$t('routes.theme.preset.presets')}
</h3> </h3>
+2 -2
View File
@@ -11,7 +11,7 @@
--font-display: Inter, system-ui, sans-serif; --font-display: Inter, system-ui, sans-serif;
--font-mono: monospace; --font-mono: monospace;
--animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards; --animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1);
--ease-cubic: cubic-bezier(0.075, 0.82, 0.165, 1); --ease-cubic: cubic-bezier(0.075, 0.82, 0.165, 1);
--spacing-22: 88px; --spacing-22: 88px;
@@ -50,7 +50,7 @@
@keyframes pop-in { @keyframes pop-in {
0% { 0% {
transform: translateY(16px); transform: translateY(12px);
opacity: 0; opacity: 0;
} }
100% { 100% {