Merge remote-tracking branch 'origin/main' into piefed-3

This commit is contained in:
James Xylight committed 2025-09-05 22:28:22 -07:00
commit aa270be722
25 files changed
+164 -110

No files matched your search

+5
View File
@@ -72,8 +72,12 @@ export function client({
clientType = profile.current.client ?? DEFAULT_CLIENT_TYPE
}
// we use nullish coealsiaihsa something so that
// we can set auth = '' to remove it
const jwt = auth ?? profile.current?.jwt
// but not here, so that if jwt == '', it doesnt put a bearer
const headers = jwt ? { authorization: `Bearer ${jwt}` } : {}
return new (clientType.name == 'piefed' ? PiefedClient : LemmyClient)(
@@ -85,6 +89,7 @@ export function client({
)
}
// here for parts where i forgor to switch
export function getClient(
instanceURL?: string,
func?: (
@@ -54,7 +54,7 @@
<div class={clazz}>
<div
class={[
view == 'cozy' ? 'flex-col gap-2 items-center' : 'flex-row',
view == 'cozy' ? 'flex-col gap-2' : 'flex-row',
'flex max-w-full w-full',
]}
>
@@ -63,7 +63,7 @@
community.community.name,
community.community.actor_id,
)}"
class="flex-1 w-full overflow-hidden"
class="flex-1 w-full overflow-hidden group"
data-sveltekit-preload-data="tap"
>
<div class="flex flex-row gap-2 items-center">
@@ -88,7 +88,9 @@
<div
class="font-medium text-base overflow-hidden text-ellipsis leading-5"
>
<span>{community.community.title}</span>
<h3 class="group-hover:underline text-left">
{community.community.title}
</h3>
{#if community.community.deleted}
<Icon
src={Trash}
@@ -126,10 +128,7 @@
/>
{/if}
</div>
<div
class="text-sm text-slate-500 dark:text-zinc-500 flex gap-0.5"
class:justify-center={view == 'cozy'}
>
<div class="text-sm text-slate-500 dark:text-zinc-500 flex gap-0.5">
<span class="overflow-hidden text-ellipsis">
{new URL(community.community.actor_id).hostname}
</span>
+1 -1
View File
@@ -78,7 +78,7 @@
-->
<article
class={[
'relative cursor-pointer group/post',
'relative group/post',
settings.leftAlign && 'left-align',
view == 'compact' && 'py-3 list-type compact',
view == 'cozy' && 'py-5 flex flex-col gap-2',
@@ -342,7 +342,7 @@
<h3
class={[
'max-sm:m-0!',
'font-medium text-balance max-w-xl',
'font-medium',
titleClass,
settings.markReadPosts && read && 'text-slate-600 dark:text-zinc-400',
view == 'compact' ? 'text-base' : 'text-lg',
@@ -314,10 +314,11 @@
<div class="flex flex-col gap-1">
<span class="font-medium text-sm">{$t('form.post.community')}</span>
<Button
class="w-full bg-white! dark:bg-black! h-[38px]"
class="w-full"
onclick={() => (data.community = null)}
alignment="left"
size="sm"
rounding="xl"
>
{#snippet prefix()}
<Avatar
@@ -327,7 +328,7 @@
/>
{/snippet}
<div class="flex flex-col gap-0">
<span class="text-xs">{data.community.name}</span>
<span class="text-sm">{data.community.name}</span>
<span class="text-[10px] leading-3">
{new URL(data.community.actor_id).hostname}
</span>
+55 -49
View File
@@ -42,61 +42,67 @@
}
</script>
<nav
aria-label={$t('aria.pagination.nav')}
class="flex flex-row gap-2 items-center justify-center backdrop-blur-xl border border-slate-200 dark:border-zinc-800 rounded-full overflow-hidden w-max mx-auto p-0.5"
>
{#if children}
<span class="text-sm text-slate-600 dark:text-zinc-400 font-medium">
{@render children?.()}
</span>
<hr class="border-slate-200 dark:border-zinc-800 flex-1" />
{/if}
{#if back}
{#if hasMore || page != 1}
<nav
aria-label={$t('aria.pagination.nav')}
class={[
'flex flex-row gap-2 items-center justify-center bg-white dark:bg-zinc-900',
'border border-slate-200 dark:border-zinc-800 rounded-full overflow-hidden w-max mx-auto p-0.5',
'shadow-md',
]}
>
{#if children}
<span class="text-sm text-slate-600 dark:text-zinc-400 font-medium">
{@render children?.()}
</span>
<hr class="border-slate-200 dark:border-zinc-800 flex-1" />
{/if}
{#if back}
<Button
href={customHref(href?.(cursor?.back ?? page - 1))}
color="tertiary"
onclick={() => invalidate(pageData.url)}
title={$t('common.back')}
rounding="pill"
size="custom"
class="text-inherit dark:text-inherit p-1"
disabled={(cursor?.back == undefined && cursor?.next != undefined) ||
page <= 1}
>
{#snippet suffix()}
<Icon src={ChevronLeft} size="24" mini />
{/snippet}
</Button>
{/if}
{#if page}
<div style="display: grid;">
{#key page}
<div
in:fly={{ y: 8, easing: backOut, duration: 400, delay: 100 }}
out:fly={{ y: 8, easing: backOut, duration: 400 }}
class="text-lg font-medium"
style="grid-column: 1; grid-row: 1;"
>
{page}
</div>
{/key}
</div>
{/if}
<Button
href={customHref(href?.(cursor?.back ?? page - 1))}
href={customHref(href?.(cursor?.next ?? page + 1))}
color="tertiary"
onclick={() => invalidate(pageData.url)}
title={$t('common.back')}
rounding="pill"
title={$t('common.next')}
size="custom"
rounding="pill"
class="text-inherit dark:text-inherit p-1"
disabled={(cursor?.back == undefined && cursor?.next != undefined) ||
page <= 1}
disabled={!hasMore}
>
{#snippet suffix()}
<Icon src={ChevronLeft} size="24" mini />
<Icon src={ChevronRight} size="24" mini />
{/snippet}
</Button>
{/if}
{#if page}
<div style="display: grid;">
{#key page}
<div
in:fly={{ y: 8, easing: backOut, duration: 400, delay: 100 }}
out:fly={{ y: 8, easing: backOut, duration: 400 }}
class="text-lg font-medium"
style="grid-column: 1; grid-row: 1;"
>
{page}
</div>
{/key}
</div>
{/if}
<Button
href={customHref(href?.(cursor?.next ?? page + 1))}
color="tertiary"
onclick={() => invalidate(pageData.url)}
title={$t('common.next')}
size="custom"
rounding="pill"
class="text-inherit dark:text-inherit p-1"
disabled={!hasMore}
>
{#snippet suffix()}
<Icon src={ChevronRight} size="24" mini />
{/snippet}
</Button>
</nav>
</nav>
{/if}
+1 -1
View File
@@ -3,7 +3,7 @@
const placements = {
top: 'top-6 lg:top-22',
bottom: 'bottom-22 lg:bottom-6',
bottom: 'bottom-22 lg:bottom-6 mt-6',
}
interface Props {
@@ -13,6 +13,7 @@
buildUrl?: (currentRoute: SvelteURL | undefined, href: string) => string
children?: import('svelte').Snippet
style?: 'header' | 'subpage'
margin?: boolean
}
let {
@@ -21,6 +22,7 @@
buildUrl = (_, href) => href,
children,
style = 'header',
margin = true,
}: Props = $props()
let matchType = $derived<('search' | 'pathname')[]>(
@@ -53,10 +55,12 @@
<nav
class={[
'flex flex-row items-center my-2 sm:mt-0 flex-wrap z-20',
'flex flex-row items-center sm:mt-0 flex-wrap z-20',
style == 'header'
? 'p-1 gap-x-8 gap-y-4 justify-center sm:justify-start'
: 'gap-2',
margin && 'my-2',
margin && style == 'subpage' && 'mb-3',
]}
>
{#each routes as route, index (route.href)}
@@ -86,7 +90,3 @@
{/each}
{@render children?.()}
</nav>
{#if style == 'subpage'}
<div class="h-3"></div>
{/if}
+1
View File
@@ -3,6 +3,7 @@
export { default as Button } from './button/Button.svelte'
export { buttonColor, buttonSize, buttonShadow } from './button/Button.svelte'
export { default as Spinner } from './loader/Spinner.svelte'
export { default as TextLoader } from './loader/TextLoader.svelte'
export { default as Material } from './materials/Material.svelte'
export { default as Label } from './forms/Label.svelte'
+42
View File
@@ -0,0 +1,42 @@
<script lang="ts">
import type { Snippet } from 'svelte'
interface Props {
children: Snippet
}
let { children }: Props = $props()
</script>
<div class="text-loader">
{@render children?.()}
</div>
<style>
.text-loader {
color: transparent;
background: linear-gradient(
to right,
var(--color-zinc-500),
var(--color-zinc-50),
var(--color-zinc-500)
);
background-size: 200%;
background-clip: text;
display: inline;
width: max-content;
animation: pulse 1s infinite linear;
}
@keyframes pulse {
0% {
background-position: 100%;
}
50% {
background-position: 0%;
}
100% {
background-position: -100%;
}
}
</style>
+2 -2
View File
@@ -24,8 +24,8 @@
<div
class={[
toastColors[toast.type],
'relative rounded-xl overflow-hidden flex flex-row items-center gap-2 px-3 py-3',
'bg-white dark:bg-zinc-900 shadow-lg',
'relative rounded-xl overflow-hidden flex flex-row items-center gap-2 px-3 py-3 border border-slate-200 dark:border-zinc-800',
'bg-white dark:bg-zinc-925 shadow-lg',
toast.long ? 'w-full max-w-lg' : 'w-80',
]}
transition:fly={{