diff --git a/src/lib/components/lemmy/comment/CommentActions.svelte b/src/lib/components/lemmy/comment/CommentActions.svelte index 5c749bd1..3e5d72a0 100644 --- a/src/lib/components/lemmy/comment/CommentActions.svelte +++ b/src/lib/components/lemmy/comment/CommentActions.svelte @@ -11,7 +11,7 @@ import { deleteItem, save } from '$lib/lemmy/contentview.js' import { settings } from '$lib/settings.svelte' import type { CommentView } from 'lemmy-js-client' - import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte' + import { Button, Menu, MenuButton } from 'mono-svelte' import { Bookmark, BookmarkSlash, @@ -69,15 +69,14 @@ title={$t('comment.actions.label')} color="tertiary" rounding="pill" - size="square-sm" + size="square-md" class="text-slate-600 dark:text-zinc-400" > {#snippet prefix()} - + {/snippet} {/snippet} - {$t('comment.actions.label')} { if (navigator.share) diff --git a/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte b/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte index 676951dd..9fde335d 100644 --- a/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte +++ b/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte @@ -41,19 +41,14 @@
{#if offsetEl} {#snippet item(index)} -
+
[nodes[index]], v => (nodes[index] = v[0])} {post} diff --git a/src/lib/components/lemmy/community/CommunityCard.svelte b/src/lib/components/lemmy/community/CommunityCard.svelte index 26aaaed1..91508c73 100644 --- a/src/lib/components/lemmy/community/CommunityCard.svelte +++ b/src/lib/components/lemmy/community/CommunityCard.svelte @@ -76,6 +76,8 @@ import Entity from '$lib/components/ui/Entity.svelte' import Expandable from '$lib/components/ui/Expandable.svelte' import LabelStat from '$lib/components/ui/LabelStat.svelte' + import CommonList from '$lib/components/ui/layout/CommonList.svelte' + import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte' import { t } from '$lib/i18n/translations' import { client, getClient } from '$lib/lemmy.svelte.js' import { errorMessage } from '$lib/lemmy/error' @@ -105,9 +107,6 @@ NoSymbol, Plus, } from 'svelte-hero-icons' - import ItemList from '../generic/ItemList.svelte' - import CommonList from '$lib/components/ui/layout/CommonList.svelte' - import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte' let loading = $state({ blocking: false, diff --git a/src/lib/components/lemmy/community/CommunityForm.svelte b/src/lib/components/lemmy/community/CommunityForm.svelte index b1534a43..1849b0e9 100644 --- a/src/lib/components/lemmy/community/CommunityForm.svelte +++ b/src/lib/components/lemmy/community/CommunityForm.svelte @@ -1,13 +1,13 @@
{ + e.preventDefault() + submit() + }} class="flex flex-col gap-4 h-full w-full" > {#if formtitle}{@render formtitle()}{:else} diff --git a/src/lib/components/lemmy/post/Post.svelte b/src/lib/components/lemmy/post/Post.svelte index 4d7c249c..5ccf209d 100644 --- a/src/lib/components/lemmy/post/Post.svelte +++ b/src/lib/components/lemmy/post/Post.svelte @@ -81,7 +81,7 @@ }) -
diff --git a/src/lib/components/lemmy/post/actions/PostActionsMenu.svelte b/src/lib/components/lemmy/post/actions/PostActionsMenu.svelte index c80e9886..a0773a8a 100644 --- a/src/lib/components/lemmy/post/actions/PostActionsMenu.svelte +++ b/src/lib/components/lemmy/post/actions/PostActionsMenu.svelte @@ -1,28 +1,25 @@ - - {$t('post.actions.more.actions')} - {#if profile.current?.user && profile.current?.jwt && profile.current.user.local_user_view.person.id == post.creator.id} (editing = true)}> {#snippet prefix()} @@ -65,52 +72,57 @@ : $t('post.actions.more.markRead')} {/if} - { - if (navigator.share) - navigator.share?.({ - url: localShare - ? `${instanceToURL(profile.current.instance)}/post/${post.post.id}` - : post.post.ap_id, - }) - else - navigator.clipboard.writeText( - localShare - ? `${instanceToURL(profile.current.instance)}/post/${post.post.id}` - : post.post.ap_id, - ) - toast({ content: $t('toast.copied') }) - }} - class="flex-1 py-0!" -> - {#snippet prefix()} - - {/snippet} - {$t('post.actions.more.share')} -
- {#if !post.post.local} -
- - -
- {/if} -
+
+ share()} + class={['flex-1', !post.post.local && 'rounded-r-xl']} + > + {#snippet prefix()} + + {/snippet} + {$t('post.actions.more.share')} + + + +
e.stopPropagation()} + > + {#if !post.post.local} + + {#snippet target()} + + {/snippet} + share(true)}> + {#snippet prefix()} + + {/snippet} + {$t('filter.location.global')} + + share(false)}> + {#snippet prefix()} + + {/snippet} + {$t('filter.location.local')} + + + {/if} +
+
{#if profile.current?.jwt} { diff --git a/src/lib/components/lemmy/post/link/PostLink.svelte b/src/lib/components/lemmy/post/link/PostLink.svelte index 5dc65a08..200ea850 100644 --- a/src/lib/components/lemmy/post/link/PostLink.svelte +++ b/src/lib/components/lemmy/post/link/PostLink.svelte @@ -1,8 +1,9 @@ - @@ -38,16 +39,17 @@ ]} rounding="2xl" element="article" + padding="sm" > {#if thumbnail_url} {/if} -
+
{#if richURL}
{embed_title}

{#if thumbnail_url} - + {#each ['webp'] as format} {:else} - + {/if} diff --git a/src/lib/components/lemmy/post/media/PostImage.svelte b/src/lib/components/lemmy/post/media/PostImage.svelte index 1be8bf54..c7cc5953 100644 --- a/src/lib/components/lemmy/post/media/PostImage.svelte +++ b/src/lib/components/lemmy/post/media/PostImage.svelte @@ -26,8 +26,8 @@ href={postLink(post)} class={[ 'container/a z-10 rounded-2xl cursor-pointer relative overflow-hidden', - 'bg-slate-100 dark:bg-zinc-900 transition-colors p-2', - 'border border-slate-200 dark:border-zinc-800 hover:border-slate-300 hover:dark:border-zinc-700', + 'bg-slate-100 dark:bg-zinc-900 transition-colors', + 'border border-slate-200 dark:border-zinc-800 group', ]} data-sveltekit-preload-data="off" aria-label={post.name} @@ -36,7 +36,7 @@ tabindex="0" > -
+
+ import type { ClassValue } from 'svelte/elements' + + const sizes = { + sm: 'text-sm', + md: 'text-base', + lg: 'text-lg', + } + + const colors = { + subtle: 'text-slate-600 dark:text-zinc-400', + none: '', + } + interface Props { - class?: string + class?: ClassValue + size?: keyof typeof sizes + color?: keyof typeof colors + border?: boolean children?: import('svelte').Snippet action?: import('svelte').Snippet } - let { class: clazz = '', children, action }: Props = $props() + let { + class: clazz = '', + children, + action, + border = true, + size = 'sm', + color = 'subtle', + }: Props = $props()
{@render children?.()} -
+
{@render action?.()}
diff --git a/src/lib/components/ui/layout/pages/Tabs.svelte b/src/lib/components/ui/layout/pages/Tabs.svelte index be3cc77f..341a8879 100644 --- a/src/lib/components/ui/layout/pages/Tabs.svelte +++ b/src/lib/components/ui/layout/pages/Tabs.svelte @@ -10,7 +10,6 @@ }[] currentRoute?: SvelteURL | undefined buildUrl?: (currentRoute: SvelteURL | undefined, href: string) => string - class?: string children?: import('svelte').Snippet } @@ -18,7 +17,6 @@ routes, currentRoute = undefined, buildUrl = (_, href) => href, - class: clazz = '', children, }: Props = $props() @@ -29,25 +27,24 @@