migrate: run bunx migrate
This commit is contained in:
115 files changed
+329
-326
No files matched your search
@@ -17,12 +17,12 @@
|
||||
import { goto } from '$app/navigation'
|
||||
import type { ClassValue } from 'svelte/elements'
|
||||
|
||||
function getTagRule(tags: Tag[]): 'blur' | 'hide' | undefined {
|
||||
function getTagRule(tags: Tag[]): 'blur-sm' | 'hide' | undefined {
|
||||
const tagContent = tags.map((t) => t.content.toLowerCase())
|
||||
|
||||
let rule: 'blur' | 'hide' | undefined
|
||||
let rule: 'blur-sm' | 'hide' | undefined
|
||||
if (settings.nsfwBlur && (post.post.nsfw || post.community.nsfw))
|
||||
rule = 'blur'
|
||||
rule = 'blur-sm'
|
||||
tagContent.forEach((tag) => {
|
||||
if (settings.tagRules?.[tag]) rule = settings.tagRules?.[tag] ?? rule
|
||||
if (rule == 'hide') return rule
|
||||
@@ -104,7 +104,7 @@
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<div
|
||||
class={[
|
||||
'post relative max-w-full min-w-0 w-full cursor-pointer outline-none group',
|
||||
'post relative max-w-full min-w-0 w-full cursor-pointer outline-hidden group',
|
||||
settings.leftAlign && 'left-align',
|
||||
view == 'compact' && 'py-3 list-type compact',
|
||||
view == 'cozy' && 'py-5 flex flex-col gap-2',
|
||||
@@ -146,7 +146,7 @@
|
||||
{#if rule != 'hide'}
|
||||
<PostMedia
|
||||
post={post.post}
|
||||
blur={rule == 'blur' ? true : undefined}
|
||||
blur={rule == 'blur-sm' ? true : undefined}
|
||||
{view}
|
||||
{type}
|
||||
/>
|
||||
@@ -158,9 +158,9 @@
|
||||
{type}
|
||||
class="{settings.leftAlign
|
||||
? 'mr-3'
|
||||
: 'ml-3'} flex-shrink no-list-margin"
|
||||
: 'ml-3'} shrink no-list-margin"
|
||||
style="grid-area: media;"
|
||||
blur={rule == 'blur' ? true : undefined}
|
||||
blur={rule == 'blur-sm' ? true : undefined}
|
||||
{view}
|
||||
/>
|
||||
{/if}
|
||||
@@ -181,8 +181,8 @@
|
||||
class="absolute overflow-hidden inset-0
|
||||
sm:rounded-xl bg-slate-50 dark:bg-zinc-900
|
||||
opacity-0 transition-all -z-50 no-list-margin
|
||||
group-hover:inset-y-0.5 group-hover:-inset-x-4 group-hover:sm:-inset-x-5 group-hover:opacity-100
|
||||
group-focus:inset-y-0.5 group-focus:-inset-x-4 group-focus:sm:-inset-x-5 group-focus:opacity-100
|
||||
group-hover:inset-y-0.5 group-hover:-inset-x-4 sm:group-hover:-inset-x-5 group-hover:opacity-100
|
||||
group-focus:inset-y-0.5 group-focus:-inset-x-4 sm:group-focus:-inset-x-5 group-focus:opacity-100
|
||||
duration-150"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
{/if}
|
||||
|
||||
<footer
|
||||
class="flex flex-row gap-2 items-center flex-shrink-0 {buttonHeight}"
|
||||
class="flex flex-row gap-2 items-center shrink-0 {buttonHeight}"
|
||||
class:flex-row-reverse={settings.posts.reverseActions}
|
||||
{style}
|
||||
>
|
||||
@@ -131,7 +131,7 @@
|
||||
<Button
|
||||
size="custom"
|
||||
href="{postLink(post.post)}#comments"
|
||||
class="!text-inherit h-full px-3 relative"
|
||||
class="text-inherit! h-full px-3 relative"
|
||||
color="ghost"
|
||||
rounding="pill"
|
||||
target={settings.openLinksInNewTab ? '_blank' : ''}
|
||||
@@ -280,7 +280,7 @@
|
||||
<MenuDivider>{$t('post.actions.more.creator')}</MenuDivider>
|
||||
<MenuButton link href={userLink(post.creator)}>
|
||||
{#snippet prefix()}
|
||||
<Icon src={UserCircle} size="16" micro class="flex-shrink-0" />
|
||||
<Icon src={UserCircle} size="16" micro class="shrink-0" />
|
||||
{/snippet}
|
||||
<TextProps wrap="no-wrap">
|
||||
{post.creator.name}
|
||||
@@ -288,7 +288,7 @@
|
||||
</MenuButton>
|
||||
<MenuButton link href={communityLink(post.community)}>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Newspaper} size="16" micro class="flex-shrink-0" />
|
||||
<Icon src={Newspaper} size="16" micro class="shrink-0" />
|
||||
{/snippet}
|
||||
<TextProps wrap="no-wrap">
|
||||
{post.community.title}
|
||||
@@ -338,7 +338,7 @@
|
||||
)
|
||||
toast({ content: $t('toast.copied') })
|
||||
}}
|
||||
class="flex-1 !py-0"
|
||||
class="flex-1 py-0!"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Share} size="16" micro />
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
{style}
|
||||
class="{!expanded
|
||||
? ` overflow-hidden
|
||||
bg-gradient-to-b text-transparent from-slate-600 via-slate-600
|
||||
bg-linear-to-b text-transparent from-slate-600 via-slate-600
|
||||
dark:from-zinc-400 dark:via-zinc-400 bg-clip-text z-0 max-h-36`
|
||||
: 'text-slate-600 dark:text-zinc-400 max-h-full'} text-base {clazz}"
|
||||
class:pointer-events-none={!clickThrough}
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<Popover autoClose={false} popoverClass="backdrop-blur-xl rounded-2xl">
|
||||
{#snippet target()}
|
||||
<button
|
||||
class="row-span-2 flex-shrink-0 mr-2 self-center group/btn bg-slate-200 dark:bg-zinc-800 rounded-full"
|
||||
class="row-span-2 shrink-0 mr-2 self-center group/btn bg-slate-200 dark:bg-zinc-800 rounded-full"
|
||||
>
|
||||
<Avatar
|
||||
url={community?.icon}
|
||||
@@ -147,7 +147,7 @@
|
||||
{#if community && subscribed}
|
||||
<div
|
||||
class="bg-white/80 dark:bg-zinc-900/90 border border-slate-200 dark:border-zinc-800 rounded-2xl shadow-xl p-4
|
||||
max-w-2xl w-full max-h-[32rem] overflow-auto"
|
||||
max-w-2xl w-full max-h-128 overflow-auto"
|
||||
>
|
||||
<CommunityHeader {community} {subscribed} />
|
||||
</div>
|
||||
@@ -159,7 +159,7 @@
|
||||
<CommunityLink
|
||||
{community}
|
||||
style="grid-area: community;"
|
||||
class="flex-shrink no-list-margin"
|
||||
class="shrink no-list-margin"
|
||||
badges={{
|
||||
nsfw: community.nsfw,
|
||||
}}
|
||||
@@ -186,7 +186,7 @@
|
||||
avatarSize={20}
|
||||
{user}
|
||||
avatar={!showCommunity}
|
||||
class="flex-shrink "
|
||||
class="shrink "
|
||||
>
|
||||
{#snippet extraBadges()}
|
||||
{#if badges.moderator}
|
||||
@@ -200,7 +200,7 @@
|
||||
</address>
|
||||
{/if}
|
||||
{#if published}
|
||||
<RelativeDate date={published} class="flex-shrink-0" />
|
||||
<RelativeDate date={published} class="shrink-0" />
|
||||
{/if}
|
||||
{#if edited}
|
||||
<div
|
||||
@@ -216,7 +216,7 @@
|
||||
</div>
|
||||
<div
|
||||
class="flex flex-row min-[480px]:justify-end items-center self-center
|
||||
flex-wrap gap-2 [&>*]:flex-shrink-0 badges min-[480px]:ml-2"
|
||||
flex-wrap gap-2 *:shrink-0 badges min-[480px]:ml-2"
|
||||
style="grid-area: badges;"
|
||||
>
|
||||
{#if tags}
|
||||
@@ -306,7 +306,7 @@
|
||||
<a
|
||||
href="/post/{encodeURIComponent(instance.data)}/{id}"
|
||||
class="inline hover:underline
|
||||
hover:text-primary-900 hover:dark:text-primary-100 transition-colors max-[480px]:!mt-0
|
||||
hover:text-primary-900 dark:hover:text-primary-100 transition-colors max-[480px]:mt-0!
|
||||
{settings.font == 'satoshi/nunito'
|
||||
? 'font-display font-semibold'
|
||||
: 'font-medium'} {titleClass}"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
export const voteColor = (vote: number, border: boolean = false) =>
|
||||
vote == 1
|
||||
? `bg-gradient-to-br from-blue-500 to-indigo-500 dark:from-blue-400 dark:to-indigo-500 text-slate-50 dark:text-zinc-900`
|
||||
? `bg-linear-to-br from-blue-500 to-indigo-500 dark:from-blue-400 dark:to-indigo-500 text-slate-50 dark:text-zinc-900`
|
||||
: vote == -1
|
||||
? `bg-gradient-to-br from-red-500 to-pink-500 dark:from-red-400 dark:to-pink-600 text-slate-50 `
|
||||
? `bg-linear-to-br from-red-500 to-pink-500 dark:from-red-400 dark:to-pink-600 text-slate-50 `
|
||||
: ''
|
||||
|
||||
export const shouldShowVoteColor = (
|
||||
@@ -73,10 +73,10 @@
|
||||
{#if children}{@render children({ vote, score })}{:else}
|
||||
<div
|
||||
class="{buttonColor.ghost} rounded-full h-full font-medium flex items-center *:p-2
|
||||
hover:bg-white hover:dark:bg-zinc-900 overflow-hidden transition-colors flex-shrink-0
|
||||
hover:bg-white dark:hover:bg-zinc-900 overflow-hidden transition-colors shrink-0
|
||||
{vote != 0
|
||||
? ''
|
||||
: '!text-inherit'} !text-inherit divide-x divide-slate-200 dark:divide-zinc-800
|
||||
: 'text-inherit!'} text-inherit! divide-x divide-slate-200 dark:divide-zinc-800
|
||||
{loading ? 'animate-pulse opacity-75 pointer-events-none' : ''}"
|
||||
role="group"
|
||||
aria-label={$t('aria.vote.group')}
|
||||
@@ -86,7 +86,7 @@
|
||||
class="flex items-center gap-0.5 transition-colors relative z-0
|
||||
{vote == 1
|
||||
? shouldShowVoteColor(vote, 'upvotes')
|
||||
: 'hover:bg-slate-100 hover:dark:bg-zinc-800'}"
|
||||
: 'hover:bg-slate-100 dark:hover:bg-zinc-800'}"
|
||||
aria-pressed={vote == 1}
|
||||
aria-label={$t('post.actions.vote.upvote')}
|
||||
>
|
||||
@@ -112,7 +112,7 @@
|
||||
class="flex items-center flex-row-reverse gap-0.5 transition-colors
|
||||
{vote == -1
|
||||
? shouldShowVoteColor(vote, 'downvotes')
|
||||
: 'hover:bg-slate-100 hover:dark:bg-zinc-800'}"
|
||||
: 'hover:bg-slate-100 dark:hover:bg-zinc-800'}"
|
||||
aria-pressed={vote == -1}
|
||||
aria-label={$t('post.actions.vote.downvote')}
|
||||
>
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<div
|
||||
class="flex flex-col justify-center items-center
|
||||
rounded-xl gap-2 py-8 mt-6
|
||||
border !border-b !border-red-500 bg-red-500/5 px-4"
|
||||
border border-b! border-red-500! bg-red-500/5 px-4"
|
||||
>
|
||||
<div class="bg-red-500/30 rounded-full p-3 text-red-500">
|
||||
<Icon src={ExclamationTriangle} size="24" solid></Icon>
|
||||
@@ -229,7 +229,7 @@
|
||||
class="w-96 max-w-full h-8 bg-slate-100 dark:bg-zinc-800 rounded-md"
|
||||
></div>
|
||||
<div class="w-full h-48 bg-slate-100 dark:bg-zinc-800 rounded-md"></div>
|
||||
<div class="!bg-transparent h-8 flex justify-between">
|
||||
<div class="bg-transparent! h-8 flex justify-between">
|
||||
<div class="w-48 h-8 bg-slate-100 dark:bg-zinc-800 rounded-md"></div>
|
||||
<div class="w-24 h-8 bg-slate-100 dark:bg-zinc-800 rounded-md"></div>
|
||||
</div>
|
||||
|
||||
@@ -298,7 +298,7 @@
|
||||
<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 bg-white! dark:bg-black! h-[38px]"
|
||||
onclick={() => (data.community = null)}
|
||||
alignment="left"
|
||||
size="sm"
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
class="flex flex-col-reverse sm:flex-row
|
||||
overflow-hidden gap-4 embed-card z-0 relative
|
||||
dark:border-t-zinc-800 border-opacity-80 max-w-full
|
||||
dark:bg-zinc-950 group-hover/link:bg-slate-50 group-hover/link:dark:bg-zinc-900 transition-colors"
|
||||
dark:bg-zinc-950 group-hover/link:bg-slate-50 dark:group-hover/link:bg-zinc-900 transition-colors"
|
||||
rounding="2xl"
|
||||
element="article"
|
||||
>
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
{#if thumbnail_url}
|
||||
<picture
|
||||
class="-m-4 mb-auto sm:-mb-4 sm:ml-auto flex-shrink-0 sm:w-1/3 sm:max-w-60"
|
||||
class="-m-4 mb-auto sm:-mb-4 sm:ml-auto shrink-0 sm:w-1/3 sm:max-w-60"
|
||||
>
|
||||
<source
|
||||
srcset={optimizeImageURL(thumbnail_url, 256)}
|
||||
@@ -98,7 +98,7 @@
|
||||
href={url}
|
||||
target="_blank"
|
||||
class="text-slate-900 dark:text-zinc-300 items-center
|
||||
text-xs overflow-hidden max-w-full block flex-shrink self-start w-max"
|
||||
text-xs overflow-hidden max-w-full block shrink self-start w-max"
|
||||
size="xs"
|
||||
color="ghost"
|
||||
rounding="pill"
|
||||
|
||||
@@ -135,12 +135,12 @@
|
||||
{#if thumbnail}
|
||||
<img
|
||||
src={optimizeImageURL(thumbnail, 512)}
|
||||
class="absolute top-0 left-0 -z-10 brightness-[25%] w-full object-cover h-full"
|
||||
class="absolute top-0 left-0 -z-10 brightness-25 w-full object-cover h-full"
|
||||
alt=""
|
||||
/>
|
||||
{:else}
|
||||
<div
|
||||
class="absolute blur-3xl -z-10 top-0 left-0 w-full h-full bg-gradient-to-br from-green-800 via-blue-900 via-20% to-red-700"
|
||||
class="absolute blur-3xl -z-10 top-0 left-0 w-full h-full bg-linear-to-br from-green-800 via-blue-900 via-20% to-red-700"
|
||||
></div>
|
||||
{/if}
|
||||
<Icon src={data.icon} solid size="48" />
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<div
|
||||
class="absolute bottom-0 left-0 right-0 flex justify-between items-center
|
||||
rounded-full ml-auto w-max m-2 p-0 gap-1
|
||||
*:bg-white *:border *:border-slate-200 *:dark:border-zinc-800 *:dark:bg-zinc-900"
|
||||
*:bg-white *:border *:border-slate-200 dark:*:border-zinc-800 dark:*:bg-zinc-900"
|
||||
onclick={(e) => e.stopPropagation()}
|
||||
>
|
||||
{#if post.alt_text}
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
<div
|
||||
class="object-cover overflow-hidden bg-slate-50 dark:bg-zinc-900 rounded-xl
|
||||
border border-slate-200 dark:border-zinc-800 group-hover/media:border-slate-400
|
||||
group-hover/media:dark:border-zinc-600 transition-colors text-slate-400 dark:text-zinc-600 grid
|
||||
dark:group-hover/media:border-zinc-600 transition-colors text-slate-400 dark:text-zinc-600 grid
|
||||
place-items-center {size}"
|
||||
>
|
||||
<Icon
|
||||
|
||||
Reference in new issue
Block a user