refactor: use icon prop instead of snippet prefix
This commit is contained in:
56 files changed
+385
-571
No files matched your search
+2
-1
@@ -12,5 +12,6 @@
|
|||||||
"svelteBracketNewLine": true,
|
"svelteBracketNewLine": true,
|
||||||
"svelteIndentScriptAndStyle": true,
|
"svelteIndentScriptAndStyle": true,
|
||||||
"svelteSortOrder": "scripts-options-markup-styles",
|
"svelteSortOrder": "scripts-options-markup-styles",
|
||||||
"svelteStrictMode": false
|
"svelteStrictMode": false,
|
||||||
|
"useTabs": false
|
||||||
}
|
}
|
||||||
+2
-2
@@ -12,7 +12,7 @@
|
|||||||
"@sveltejs/adapter-node": "^5.2.9",
|
"@sveltejs/adapter-node": "^5.2.9",
|
||||||
"@sveltejs/adapter-static": "^3.0.8",
|
"@sveltejs/adapter-static": "^3.0.8",
|
||||||
"@sveltejs/kit": "^2.17.1",
|
"@sveltejs/kit": "^2.17.1",
|
||||||
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
"@sveltejs/vite-plugin-svelte": "^4.0.4",
|
||||||
"@tailwindcss/container-queries": "^0.1.1",
|
"@tailwindcss/container-queries": "^0.1.1",
|
||||||
"@tailwindcss/postcss": "^4.1.8",
|
"@tailwindcss/postcss": "^4.1.8",
|
||||||
"@types/nprogress": "^0.2.0",
|
"@types/nprogress": "^0.2.0",
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"openapi-fetch": "^0.14.0",
|
"openapi-fetch": "^0.14.0",
|
||||||
"postcss": "^8.4.30",
|
"postcss": "^8.4.30",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"prettier-plugin-svelte": "^3.2.7",
|
"prettier-plugin-svelte": "^3.4.0",
|
||||||
"svelte": "^5.37.3",
|
"svelte": "^5.37.3",
|
||||||
"svelte-adapter-bun-next": "^1.0.3",
|
"svelte-adapter-bun-next": "^1.0.3",
|
||||||
"svelte-check": "^4.0.0",
|
"svelte-check": "^4.0.0",
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
|
import type { LocalImage, Person } from '$lib/client/types'
|
||||||
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
import { publishedToDate } from '$lib/components/util/date'
|
import { publishedToDate } from '$lib/components/util/date'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { instance } from '$lib/instance.svelte'
|
import { instance } from '$lib/instance.svelte'
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
|
||||||
import { instanceToURL } from '$lib/util.svelte'
|
import { instanceToURL } from '$lib/util.svelte'
|
||||||
import type { LocalImage, Person } from '$lib/client/types'
|
|
||||||
import { action, Button, modal, toast } from 'mono-svelte'
|
import { action, Button, modal, toast } from 'mono-svelte'
|
||||||
import { ArrowDownTray, Icon, Trash } from 'svelte-hero-icons'
|
import { ArrowDownTray, Trash } from 'svelte-hero-icons'
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
|
||||||
|
|
||||||
let loading = $state(false)
|
let loading = $state(false)
|
||||||
|
|
||||||
@@ -60,11 +60,8 @@
|
|||||||
href="{instanceToURL(instance.data)}/pictrs/image/{image.pictrs_alias}"
|
href="{instanceToURL(instance.data)}/pictrs/image/{image.pictrs_alias}"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
class="ml-auto"
|
class="ml-auto"
|
||||||
>
|
icon={ArrowDownTray}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={ArrowDownTray} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
title={$t('post.actions.more.delete')}
|
title={$t('post.actions.more.delete')}
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
@@ -88,10 +85,7 @@
|
|||||||
size="square-md"
|
size="square-md"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
>
|
icon={Trash}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={Trash} size="16" mini class="text-red-500" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -74,11 +74,8 @@
|
|||||||
rounding="pill"
|
rounding="pill"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
class="text-slate-600 dark:text-zinc-400"
|
class="text-slate-600 dark:text-zinc-400"
|
||||||
>
|
icon={EllipsisHorizontal}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={EllipsisHorizontal} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
@@ -88,18 +85,13 @@
|
|||||||
})
|
})
|
||||||
else navigator.clipboard.writeText(comment.comment.ap_id)
|
else navigator.clipboard.writeText(comment.comment.ap_id)
|
||||||
}}
|
}}
|
||||||
|
icon={Share}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Share} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('post.actions.more.share')}
|
{$t('post.actions.more.share')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if profile.current?.jwt}
|
{#if profile.current?.jwt}
|
||||||
{#if comment.creator.id == profile.current.user?.local_user_view.person.id}
|
{#if comment.creator.id == profile.current.user?.local_user_view.person.id}
|
||||||
<MenuButton onclick={() => onedit?.(comment)}>
|
<MenuButton onclick={() => onedit?.(comment)} icon={PencilSquare}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={PencilSquare} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('post.actions.more.edit')}
|
{$t('post.actions.more.edit')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -108,10 +100,8 @@
|
|||||||
if (profile.current?.jwt)
|
if (profile.current?.jwt)
|
||||||
comment.saved = await save(comment, !comment.saved)
|
comment.saved = await save(comment, !comment.saved)
|
||||||
}}
|
}}
|
||||||
|
icon={comment.saved ? BookmarkSlash : Bookmark}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={comment.saved ? BookmarkSlash : Bookmark} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
|
{comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if profile.current?.user && profile.current.jwt && profile.current.user.local_user_view.person.id == comment.creator.id}
|
{#if profile.current?.user && profile.current.jwt && profile.current.user.local_user_view.person.id == comment.creator.id}
|
||||||
@@ -124,20 +114,19 @@
|
|||||||
!comment.comment.deleted,
|
!comment.comment.deleted,
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
icon={Trash}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Trash} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{comment.comment.deleted
|
{comment.comment.deleted
|
||||||
? $t('post.actions.more.restore')
|
? $t('post.actions.more.restore')
|
||||||
: $t('post.actions.more.delete')}
|
: $t('post.actions.more.delete')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
{#if profile.current.jwt && profile.current.user?.local_user_view.person.id != comment.creator.id}
|
{#if profile.current.jwt && profile.current.user?.local_user_view.person.id != comment.creator.id}
|
||||||
<MenuButton onclick={() => report(comment)} color="danger-subtle">
|
<MenuButton
|
||||||
{#snippet prefix()}
|
onclick={() => report(comment)}
|
||||||
<Icon src={Flag} mini size="16" />
|
color="danger-subtle"
|
||||||
{/snippet}
|
icon={Flag}
|
||||||
|
>
|
||||||
{$t('moderation.report')}
|
{$t('moderation.report')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
onsubmit={e => {
|
onsubmit={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
submit()
|
submit()
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { t } from '$lib/i18n/translations'
|
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import type { Post } from '$lib/client/types'
|
import type { Post } from '$lib/client/types'
|
||||||
|
import { t } from '$lib/i18n/translations'
|
||||||
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
import { Button, toast } from 'mono-svelte'
|
import { Button, toast } from 'mono-svelte'
|
||||||
import { ArrowDownCircle, Icon } from 'svelte-hero-icons'
|
import { ArrowDownCircle } from 'svelte-hero-icons'
|
||||||
import Comment from './Comment.svelte'
|
import Comment from './Comment.svelte'
|
||||||
import Comments from './CommentTree.svelte'
|
import Comments from './CommentTree.svelte'
|
||||||
import { buildCommentsTree, type CommentNodeI } from './comments.svelte'
|
import { buildCommentsTree, type CommentNodeI } from './comments.svelte'
|
||||||
@@ -129,15 +129,8 @@
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
icon={ArrowDownCircle}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon
|
|
||||||
src={ArrowDownCircle}
|
|
||||||
micro
|
|
||||||
size="16"
|
|
||||||
class="text-primary-900 dark:text-primary-100"
|
|
||||||
/>
|
|
||||||
{/snippet}
|
|
||||||
{$t('comment.more', {
|
{$t('comment.more', {
|
||||||
comments: node.comment_view.counts.child_count,
|
comments: node.comment_view.counts.child_count,
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -139,7 +139,6 @@
|
|||||||
loading.subscribing = false
|
loading.subscribing = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let setFlair = $state(false)
|
let setFlair = $state(false)
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -155,7 +154,6 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
{#await community_view}
|
{#await community_view}
|
||||||
<div
|
<div
|
||||||
class="w-full h-full grid place-items-center"
|
class="w-full h-full grid place-items-center"
|
||||||
@@ -166,7 +164,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{:then community_view}
|
{:then community_view}
|
||||||
<Modal title={$t('cards.community.flair')} bind:open={setFlair}>
|
<Modal title={$t('cards.community.flair')} bind:open={setFlair}>
|
||||||
<CommunityFlair community={community_view.community.id} onsubmit={() => setFlair = !setFlair} />
|
<CommunityFlair
|
||||||
|
community={community_view.community.id}
|
||||||
|
onsubmit={() => (setFlair = !setFlair)}
|
||||||
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
<aside
|
<aside
|
||||||
class={[
|
class={[
|
||||||
@@ -198,7 +199,7 @@
|
|||||||
</EndPlaceholder>
|
</EndPlaceholder>
|
||||||
{#if profile.current?.jwt}
|
{#if profile.current?.jwt}
|
||||||
{@const subscribed = profile.current.user?.follows.some(
|
{@const subscribed = profile.current.user?.follows.some(
|
||||||
i => i.community.id == community_view.community.id,
|
(i) => i.community.id == community_view.community.id,
|
||||||
)}
|
)}
|
||||||
<Button
|
<Button
|
||||||
disabled={loading.subscribing}
|
disabled={loading.subscribing}
|
||||||
@@ -209,21 +210,15 @@
|
|||||||
onclick={() => subscribe(community_view)}
|
onclick={() => subscribe(community_view)}
|
||||||
class="px-4 relative z-[inherit]"
|
class="px-4 relative z-[inherit]"
|
||||||
alignment="left"
|
alignment="left"
|
||||||
|
icon={community_view.subscribed == 'Subscribed' ? Check : Plus}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon
|
|
||||||
src={community_view.subscribed == 'Subscribed' ? Check : Plus}
|
|
||||||
mini
|
|
||||||
size="16"
|
|
||||||
/>
|
|
||||||
{/snippet}
|
|
||||||
{subscribed
|
{subscribed
|
||||||
? $t('cards.community.subscribed')
|
? $t('cards.community.subscribed')
|
||||||
: $t('cards.community.subscribe')}
|
: $t('cards.community.subscribe')}
|
||||||
</Button>
|
</Button>
|
||||||
{#if client().setFlair}
|
{#if client().setFlair}
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
onclick={() => setFlair = !setFlair}
|
onclick={() => (setFlair = !setFlair)}
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
icon={Tag}
|
icon={Tag}
|
||||||
label={$t('cards.community.flair')}
|
label={$t('cards.community.flair')}
|
||||||
@@ -269,10 +264,8 @@
|
|||||||
size="lg"
|
size="lg"
|
||||||
onclick={() =>
|
onclick={() =>
|
||||||
block(community_view.community.id, !community_view.blocked)}
|
block(community_view.community.id, !community_view.blocked)}
|
||||||
|
icon={NoSymbol}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={NoSymbol} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{community_view.blocked
|
{community_view.blocked
|
||||||
? $t('cards.community.unblock')
|
? $t('cards.community.unblock')
|
||||||
: $t('cards.community.block')}
|
: $t('cards.community.block')}
|
||||||
@@ -282,10 +275,8 @@
|
|||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
size="lg"
|
size="lg"
|
||||||
onclick={() => blockInstance(community_view.community.instance_id)}
|
onclick={() => blockInstance(community_view.community.instance_id)}
|
||||||
|
icon={BuildingOffice2}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={BuildingOffice2} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('cards.community.blockInstance')}
|
{$t('cards.community.blockInstance')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -312,10 +303,8 @@
|
|||||||
dismissable: true,
|
dismissable: true,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
})}
|
})}
|
||||||
|
icon={Fire}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Fire} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('admin.purge')}
|
{$t('admin.purge')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -364,7 +353,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<ItemList
|
<ItemList
|
||||||
items={moderators.map(i => ({
|
items={moderators.map((i) => ({
|
||||||
id: i.moderator.id,
|
id: i.moderator.id,
|
||||||
name: i.moderator.display_name || i.moderator.name,
|
name: i.moderator.display_name || i.moderator.name,
|
||||||
url: userLink(i.moderator),
|
url: userLink(i.moderator),
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
Option,
|
Option,
|
||||||
Select,
|
Select,
|
||||||
Material,
|
Material,
|
||||||
Menu
|
Menu,
|
||||||
} from 'mono-svelte'
|
} from 'mono-svelte'
|
||||||
import { GlobeAlt, Icon, MapPin, Plus } from 'svelte-hero-icons'
|
import { GlobeAlt, Icon, MapPin, Plus } from 'svelte-hero-icons'
|
||||||
import { Header } from '$lib/components/ui/layout'
|
import { Header } from '$lib/components/ui/layout'
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
if (profile.current.user) {
|
if (profile.current.user) {
|
||||||
const c = profile.current.user.moderates
|
const c = profile.current.user.moderates
|
||||||
.map(m => m.community.id)
|
.map((m) => m.community.id)
|
||||||
.indexOf(res.community_view.community.id)
|
.indexOf(res.community_view.community.id)
|
||||||
if (c != -1) {
|
if (c != -1) {
|
||||||
profile.current.user.moderates[c] = {
|
profile.current.user.moderates[c] = {
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
onsubmit={e => {
|
onsubmit={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
submit()
|
submit()
|
||||||
}}
|
}}
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
</Badge>
|
</Badge>
|
||||||
</button>
|
</button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#each site.data.all_languages.filter(l => !formData.languages?.includes(l.id)) as language (language.id)}
|
{#each site.data.all_languages.filter((l) => !formData.languages?.includes(l.id)) as language (language.id)}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
class="min-h-[16px] py-0"
|
class="min-h-[16px] py-0"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
@@ -217,7 +217,7 @@
|
|||||||
</Menu>
|
</Menu>
|
||||||
{#each formData.languages ?? [] as languageId, index (languageId)}
|
{#each formData.languages ?? [] as languageId, index (languageId)}
|
||||||
{@const language = site.data.all_languages.find(
|
{@const language = site.data.all_languages.find(
|
||||||
l => l.id == languageId,
|
(l) => l.id == languageId,
|
||||||
)}
|
)}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -14,7 +14,15 @@
|
|||||||
CommunityModeratorView,
|
CommunityModeratorView,
|
||||||
SubscribedType,
|
SubscribedType,
|
||||||
} from '$lib/client/types'
|
} from '$lib/client/types'
|
||||||
import { action, Button, Menu, MenuButton, Modal, modal, toast } from 'mono-svelte'
|
import {
|
||||||
|
action,
|
||||||
|
Button,
|
||||||
|
Menu,
|
||||||
|
MenuButton,
|
||||||
|
Modal,
|
||||||
|
modal,
|
||||||
|
toast,
|
||||||
|
} from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
BuildingOffice2,
|
BuildingOffice2,
|
||||||
Check,
|
Check,
|
||||||
@@ -61,9 +69,11 @@
|
|||||||
let setFlair = $state(false)
|
let setFlair = $state(false)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<Modal title={$t('cards.community.flair')} bind:open={setFlair}>
|
<Modal title={$t('cards.community.flair')} bind:open={setFlair}>
|
||||||
<CommunityFlair community={community.id} onsubmit={() => setFlair = !setFlair} />
|
<CommunityFlair
|
||||||
|
community={community.id}
|
||||||
|
onsubmit={() => (setFlair = !setFlair)}
|
||||||
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<EntityHeader
|
<EntityHeader
|
||||||
@@ -119,7 +129,7 @@
|
|||||||
<hr class="flex-1 border-slate-200 dark:border-zinc-800 mx-3" />
|
<hr class="flex-1 border-slate-200 dark:border-zinc-800 mx-3" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<ItemList
|
<ItemList
|
||||||
items={moderators.map(m => ({
|
items={moderators.map((m) => ({
|
||||||
id: m.moderator.id,
|
id: m.moderator.id,
|
||||||
name: m.moderator.name,
|
name: m.moderator.name,
|
||||||
url: userLink(m.moderator),
|
url: userLink(m.moderator),
|
||||||
@@ -129,7 +139,12 @@
|
|||||||
/>
|
/>
|
||||||
</Expandable>
|
</Expandable>
|
||||||
{/if}
|
{/if}
|
||||||
<div class={["flex items-center gap-2 h-max w-max", compact == 'lg' && 'lg:hidden']}>
|
<div
|
||||||
|
class={[
|
||||||
|
'flex items-center gap-2 h-max w-max',
|
||||||
|
compact == 'lg' && 'lg:hidden',
|
||||||
|
]}
|
||||||
|
>
|
||||||
{#if profile.current?.jwt}
|
{#if profile.current?.jwt}
|
||||||
<Subscribe
|
<Subscribe
|
||||||
community={{
|
community={{
|
||||||
@@ -152,14 +167,8 @@
|
|||||||
}}
|
}}
|
||||||
class="relative z-[inherit]"
|
class="relative z-[inherit]"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
|
icon={subscribed != 'NotSubscribed' ? Check : Plus}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon
|
|
||||||
src={subscribed != 'NotSubscribed' ? Check : Plus}
|
|
||||||
micro
|
|
||||||
size="16"
|
|
||||||
/>
|
|
||||||
{/snippet}
|
|
||||||
{subscribed == 'Subscribed' || subscribed == 'Pending'
|
{subscribed == 'Subscribed' || subscribed == 'Pending'
|
||||||
? $t('cards.community.subscribed')
|
? $t('cards.community.subscribed')
|
||||||
: $t('cards.community.subscribe')}
|
: $t('cards.community.subscribe')}
|
||||||
@@ -167,13 +176,19 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
</Subscribe>
|
</Subscribe>
|
||||||
|
|
||||||
<Button size="custom" class="h-9 aspect-square" rounding="pill" onclick={() => setFlair = !setFlair} aria-label={$t('cards.community.flair')}>
|
<Button
|
||||||
|
size="custom"
|
||||||
|
class="h-9 aspect-square"
|
||||||
|
rounding="pill"
|
||||||
|
onclick={() => (setFlair = !setFlair)}
|
||||||
|
aria-label={$t('cards.community.flair')}
|
||||||
|
>
|
||||||
<Icon src={Tag} size="16" micro />
|
<Icon src={Tag} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if profile.current?.user && profile.current.user.moderates
|
{#if profile.current?.user && profile.current.user.moderates
|
||||||
.map(c => c.community.id)
|
.map((c) => c.community.id)
|
||||||
.includes(community.id)}
|
.includes(community.id)}
|
||||||
<Button
|
<Button
|
||||||
color="secondary"
|
color="secondary"
|
||||||
@@ -190,11 +205,13 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<Menu placement="top-end">
|
<Menu placement="top-end">
|
||||||
{#snippet target(attachment)}
|
{#snippet target(attachment)}
|
||||||
<Button {@attach attachment} size="custom" rounding="pill" class="h-8.5 aspect-square">
|
<Button
|
||||||
{#snippet prefix()}
|
{@attach attachment}
|
||||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
size="custom"
|
||||||
{/snippet}
|
rounding="pill"
|
||||||
</Button>
|
class="h-8.5 aspect-square"
|
||||||
|
icon={EllipsisHorizontal}
|
||||||
|
></Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuButton href="/modlog?community={community.id}">
|
<MenuButton href="/modlog?community={community.id}">
|
||||||
<Icon src={Newspaper} size="16" mini />
|
<Icon src={Newspaper} size="16" mini />
|
||||||
@@ -214,10 +231,8 @@
|
|||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
size="lg"
|
size="lg"
|
||||||
onclick={() => block(community.id, !blocked)}
|
onclick={() => block(community.id, !blocked)}
|
||||||
|
icon={NoSymbol}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={NoSymbol} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{blocked
|
{blocked
|
||||||
? $t('cards.community.unblock')
|
? $t('cards.community.unblock')
|
||||||
: $t('cards.community.block')}
|
: $t('cards.community.block')}
|
||||||
@@ -227,10 +242,8 @@
|
|||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
size="lg"
|
size="lg"
|
||||||
onclick={() => blockInstance(community.instance_id)}
|
onclick={() => blockInstance(community.instance_id)}
|
||||||
|
icon={BuildingOffice2}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={BuildingOffice2} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('cards.community.blockInstance')}
|
{$t('cards.community.blockInstance')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -257,10 +270,8 @@
|
|||||||
dismissable: true,
|
dismissable: true,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
})}
|
})}
|
||||||
|
icon={Fire}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Fire} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('admin.purge')}
|
{$t('admin.purge')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -201,10 +201,8 @@
|
|||||||
? 'aspect-square @md:px-2 @md:min-w-30 @md:aspect-auto'
|
? 'aspect-square @md:px-2 @md:min-w-30 @md:aspect-auto'
|
||||||
: 'px-3',
|
: 'px-3',
|
||||||
]}
|
]}
|
||||||
|
icon={subscribed ? Check : Plus}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={subscribed ? Check : Plus} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
<span class={[view == 'compact' && 'hidden', '@md:block']}>
|
<span class={[view == 'compact' && 'hidden', '@md:block']}>
|
||||||
{#if subscribed}
|
{#if subscribed}
|
||||||
{$t('cards.community.subscribed')}
|
{$t('cards.community.subscribed')}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import type { Community, Person } from '$lib/client/types'
|
import type { Community, Person } from '$lib/client/types'
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { Label, toast, Button, Checkbox, Modal } from 'mono-svelte'
|
import { Label, toast, Button, Modal, Switch } from 'mono-svelte'
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
@@ -115,12 +115,12 @@
|
|||||||
label={$t('moderation.reason')}
|
label={$t('moderation.reason')}
|
||||||
/>
|
/>
|
||||||
{#if !banned}
|
{#if !banned}
|
||||||
<Checkbox bind:checked={deleteData}>
|
<Switch bind:checked={deleteData}>
|
||||||
{$t('moderation.ban.deleteData')}
|
{$t('moderation.ban.deleteData')}
|
||||||
{#snippet description()}
|
{#snippet description()}
|
||||||
{$t('moderation.ban.warning')}
|
{$t('moderation.ban.warning')}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Label text={$t('moderation.ban.expires')}>
|
<Label text={$t('moderation.ban.expires')}>
|
||||||
<Duration bind:value={expires}></Duration>
|
<Duration bind:value={expires}></Duration>
|
||||||
</Label>
|
</Label>
|
||||||
|
|||||||
@@ -43,10 +43,7 @@
|
|||||||
{$t('moderation.label')}
|
{$t('moderation.label')}
|
||||||
{/if}
|
{/if}
|
||||||
</MenuDivider>
|
</MenuDivider>
|
||||||
<MenuButton color="danger-subtle" onclick={() => remove(item)}>
|
<MenuButton color="danger-subtle" onclick={() => remove(item)} icon={Trash}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Trash} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{#if isCommentView(item)}
|
{#if isCommentView(item)}
|
||||||
{item.comment.removed
|
{item.comment.removed
|
||||||
? $t('moderation.restore')
|
? $t('moderation.restore')
|
||||||
@@ -59,10 +56,8 @@
|
|||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
onclick={() =>
|
onclick={() =>
|
||||||
ban(item.creator_banned_from_community, item.creator, item.community)}
|
ban(item.creator_banned_from_community, item.creator, item.community)}
|
||||||
|
icon={ShieldExclamation}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ShieldExclamation} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{item.creator_banned_from_community
|
{item.creator_banned_from_community
|
||||||
? $t('moderation.ban.unbanFromCommunity')
|
? $t('moderation.ban.unbanFromCommunity')
|
||||||
: $t('moderation.ban.banFromCommunity')}
|
: $t('moderation.ban.banFromCommunity')}
|
||||||
@@ -81,10 +76,8 @@
|
|||||||
)
|
)
|
||||||
).comment_view.comment
|
).comment_view.comment
|
||||||
}}
|
}}
|
||||||
|
icon={Megaphone}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Megaphone} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{item.comment.distinguished
|
{item.comment.distinguished
|
||||||
? $t('moderation.unfeature')
|
? $t('moderation.unfeature')
|
||||||
: $t('moderation.feature')}
|
: $t('moderation.feature')}
|
||||||
@@ -107,10 +100,11 @@
|
|||||||
|
|
||||||
{#if profile.current?.user && isAdmin(profile.current.user)}
|
{#if profile.current?.user && isAdmin(profile.current.user)}
|
||||||
<MenuDivider showLabel>{$t('admin.label')}</MenuDivider>
|
<MenuDivider showLabel>{$t('admin.label')}</MenuDivider>
|
||||||
<MenuButton color="danger-subtle" onclick={() => remove(item, true)}>
|
<MenuButton
|
||||||
{#snippet prefix()}
|
color="danger-subtle"
|
||||||
<Icon src={Fire} size="16" mini />
|
onclick={() => remove(item, true)}
|
||||||
{/snippet}
|
icon={Fire}
|
||||||
|
>
|
||||||
{$t('admin.purge')}
|
{$t('admin.purge')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -91,10 +91,8 @@
|
|||||||
color="warning-subtle"
|
color="warning-subtle"
|
||||||
onclick={() => lock(!item.post.locked)}
|
onclick={() => lock(!item.post.locked)}
|
||||||
loading={acting}
|
loading={acting}
|
||||||
|
icon={item.post.locked ? LockOpen : LockClosed}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={item.post.locked ? LockOpen : LockClosed} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{item.post.locked ? $t('moderation.unlock') : $t('moderation.lock')}
|
{item.post.locked ? $t('moderation.unlock') : $t('moderation.lock')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
|
|
||||||
|
|||||||
@@ -2,22 +2,22 @@
|
|||||||
import { preventDefault, run } from 'svelte/legacy'
|
import { preventDefault, run } from 'svelte/legacy'
|
||||||
|
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
|
import { getClient } from '$lib/client/lemmy.svelte'
|
||||||
|
import type { CommentView, PostView } from '$lib/client/types'
|
||||||
import MultiSelect from '$lib/components/input/Switch.svelte'
|
import MultiSelect from '$lib/components/input/Switch.svelte'
|
||||||
import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js'
|
import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
|
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
import { fullCommunityName } from '$lib/util.svelte.js'
|
||||||
import type { CommentView, PostView } from '$lib/client/types'
|
|
||||||
import { Button, Modal, Select, Switch, toast } from 'mono-svelte'
|
import { Button, Modal, Select, Switch, toast } from 'mono-svelte'
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||||
import { Fire, Icon, Trash } from 'svelte-hero-icons'
|
import { Fire, Trash } from 'svelte-hero-icons'
|
||||||
import { amMod, isAdmin } from './moderation'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { Post } from '../post'
|
|
||||||
import { Comment } from '../comment'
|
import { Comment } from '../comment'
|
||||||
|
import { Post } from '../post'
|
||||||
|
import { amMod, isAdmin } from './moderation'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean
|
open: boolean
|
||||||
@@ -257,10 +257,8 @@
|
|||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
submit
|
submit
|
||||||
|
icon={purge ? Fire : Trash}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={purge ? Fire : Trash} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{#if purge}
|
{#if purge}
|
||||||
{$t('admin.purge')}
|
{$t('admin.purge')}
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts" module> type BadgeType =
|
<script lang="ts" module>
|
||||||
|
type BadgeType =
|
||||||
| 'nsfw'
|
| 'nsfw'
|
||||||
| 'saved'
|
| 'saved'
|
||||||
| 'featured'
|
| 'featured'
|
||||||
@@ -86,11 +87,11 @@
|
|||||||
|
|
||||||
const newTitle = title
|
const newTitle = title
|
||||||
.toString()
|
.toString()
|
||||||
.replace(/^(\[.[^\]]+\])|(\[.[^\]]+\])$/g, match => {
|
.replace(/^(\[.[^\]]+\])|(\[.[^\]]+\])$/g, (match) => {
|
||||||
const contents = match.split(',').map((part: string) => part.trim())
|
const contents = match.split(',').map((part: string) => part.trim())
|
||||||
|
|
||||||
contents
|
contents
|
||||||
.map(i => i.replaceAll(/(\[|\])/g, ''))
|
.map((i) => i.replaceAll(/(\[|\])/g, ''))
|
||||||
.forEach((content: string) => {
|
.forEach((content: string) => {
|
||||||
extracted.push(
|
extracted.push(
|
||||||
textToTag.get(content) ?? {
|
textToTag.get(content) ?? {
|
||||||
@@ -332,12 +333,13 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#each Object.keys(badges)
|
{#each Object.keys(badges)
|
||||||
// filter by ones that are true
|
// filter by ones that are true
|
||||||
.filter(i => badges[i as BadgeType] == true)
|
.filter((i) => badges[i as BadgeType] == true)
|
||||||
// get from predetermined map
|
// get from predetermined map
|
||||||
.map(i => badgeToData.get(i as BadgeType))
|
.map((i) => badgeToData.get(i as BadgeType))
|
||||||
// remove null
|
// remove null
|
||||||
.filter(i => i != undefined) as badge}
|
.filter((i) => i != undefined) as badge}
|
||||||
<Badge label={badge.label} color={badge.color} allowIconOnly>{#snippet icon()}
|
<Badge label={badge.label} color={badge.color} allowIconOnly
|
||||||
|
>{#snippet icon()}
|
||||||
<Icon src={badge.icon} micro size="14" />{/snippet}{badge.label}
|
<Icon src={badge.icon} micro size="14" />{/snippet}{badge.label}
|
||||||
</Badge>
|
</Badge>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -358,10 +360,8 @@
|
|||||||
<a
|
<a
|
||||||
href={useAttachedUrl
|
href={useAttachedUrl
|
||||||
? postUrl
|
? postUrl
|
||||||
: `/post/${encodeURIComponent(profile.current.intsance)}/${id}`}
|
: `/post/${encodeURIComponent(profile.current.instance)}/${id}`}
|
||||||
target={useAttachedUrl
|
target={useAttachedUrl ? '_blank' : undefined}
|
||||||
? '_blank'
|
|
||||||
: undefined}
|
|
||||||
rel={useAttachedUrl ? 'noopener noreferrer' : undefined}
|
rel={useAttachedUrl ? 'noopener noreferrer' : undefined}
|
||||||
class="inline-block hover:underline hover:text-primary-900 dark:hover:text-primary-100 transition-colors"
|
class="inline-block hover:underline hover:text-primary-900 dark:hover:text-primary-100 transition-colors"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<PostForm
|
<PostForm
|
||||||
edit
|
edit
|
||||||
editingPost={post.post}
|
editingPost={post.post}
|
||||||
onsubmit={e => {
|
onsubmit={(e) => {
|
||||||
editing = false
|
editing = false
|
||||||
post = e
|
post = e
|
||||||
onedit?.(e)
|
onedit?.(e)
|
||||||
@@ -124,11 +124,8 @@
|
|||||||
color="secondary"
|
color="secondary"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
class={buttonSquare}
|
class={buttonSquare}
|
||||||
>
|
icon={BugAnt}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={BugAnt} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/if}
|
{/if}
|
||||||
{#if profile.current?.user && (amMod(profile.current.user, post.community) || isAdmin(profile.current.user))}
|
{#if profile.current?.user && (amMod(profile.current.user, post.community) || isAdmin(profile.current.user))}
|
||||||
{#await import('$lib/components/lemmy/moderation/ModerationMenu.svelte') then { default: ModerationMenu }}
|
{#await import('$lib/components/lemmy/moderation/ModerationMenu.svelte') then { default: ModerationMenu }}
|
||||||
@@ -164,11 +161,8 @@
|
|||||||
loading={saving}
|
loading={saving}
|
||||||
disabled={saving}
|
disabled={saving}
|
||||||
title={post.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
|
title={post.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
|
||||||
>
|
icon={post.saved ? BookmarkSlash : Bookmark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={post.saved ? BookmarkSlash : Bookmark} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<Menu placement="bottom-end">
|
<Menu placement="bottom-end">
|
||||||
@@ -180,11 +174,8 @@
|
|||||||
rounding="pill"
|
rounding="pill"
|
||||||
size="custom"
|
size="custom"
|
||||||
class={buttonSquare}
|
class={buttonSquare}
|
||||||
>
|
icon={EllipsisHorizontal}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={EllipsisHorizontal} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet children(open)}
|
{#snippet children(open)}
|
||||||
{#if open}
|
{#if open}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
|
import { PiefedClient } from '$lib/client/piefed/piefed'
|
||||||
|
import type { PostView } from '$lib/client/types'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { deleteItem, markAsRead } from '$lib/lemmy/contentview'
|
import { deleteItem, markAsRead } from '$lib/lemmy/contentview'
|
||||||
import { setSessionStorage } from '$lib/session'
|
import { setSessionStorage } from '$lib/session'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import { settings } from '$lib/settings.svelte'
|
||||||
import { instanceToURL } from '$lib/util.svelte'
|
import { instanceToURL } from '$lib/util.svelte'
|
||||||
import type { PostView } from '$lib/client/types'
|
|
||||||
import { Button, Menu, MenuButton, toast } from 'mono-svelte'
|
import { Button, Menu, MenuButton, toast } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
ArrowTopRightOnSquare,
|
ArrowTopRightOnSquare,
|
||||||
@@ -15,7 +17,6 @@
|
|||||||
EyeSlash,
|
EyeSlash,
|
||||||
Flag,
|
Flag,
|
||||||
GlobeAlt,
|
GlobeAlt,
|
||||||
Icon,
|
|
||||||
MapPin,
|
MapPin,
|
||||||
PencilSquare,
|
PencilSquare,
|
||||||
Share,
|
Share,
|
||||||
@@ -24,8 +25,6 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { report } from '../../moderation/moderation'
|
import { report } from '../../moderation/moderation'
|
||||||
import { hidePost } from '../helpers'
|
import { hidePost } from '../helpers'
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
|
||||||
import { PiefedClient } from '$lib/client/piefed/piefed'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
post: PostView
|
post: PostView
|
||||||
@@ -52,10 +51,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if profile.current?.user && profile.current?.jwt && profile.current.user.local_user_view.person.id == post.creator.id}
|
{#if profile.current?.user && profile.current?.jwt && profile.current.user.local_user_view.person.id == post.creator.id}
|
||||||
<MenuButton onclick={() => (editing = true)}>
|
<MenuButton onclick={() => (editing = true)} icon={PencilSquare}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={PencilSquare} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('post.actions.more.edit')}
|
{$t('post.actions.more.edit')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -65,10 +61,8 @@
|
|||||||
if (profile.current?.jwt)
|
if (profile.current?.jwt)
|
||||||
post.read = await markAsRead(post.post, !post.read)
|
post.read = await markAsRead(post.post, !post.read)
|
||||||
}}
|
}}
|
||||||
|
icon={post.read ? EyeSlash : Eye}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={post.read ? EyeSlash : Eye} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{post.read
|
{post.read
|
||||||
? $t('post.actions.more.markUnread')
|
? $t('post.actions.more.markUnread')
|
||||||
: $t('post.actions.more.markRead')}
|
: $t('post.actions.more.markRead')}
|
||||||
@@ -78,10 +72,8 @@
|
|||||||
<MenuButton
|
<MenuButton
|
||||||
onclick={() => share()}
|
onclick={() => share()}
|
||||||
class={['flex-1', !post.post.local && 'rounded-r-lg']}
|
class={['flex-1', !post.post.local && 'rounded-r-lg']}
|
||||||
|
icon={Share}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Share} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('post.actions.more.share')}
|
{$t('post.actions.more.share')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if !post.post.local}
|
{#if !post.post.local}
|
||||||
@@ -94,27 +86,13 @@
|
|||||||
size="custom"
|
size="custom"
|
||||||
class="w-6 h-6 self-center"
|
class="w-6 h-6 self-center"
|
||||||
data-autoclose="false"
|
data-autoclose="false"
|
||||||
>
|
icon={EllipsisHorizontal}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon
|
|
||||||
src={EllipsisHorizontal}
|
|
||||||
size="16"
|
|
||||||
micro
|
|
||||||
class="text-slate-600 dark:text-zinc-400"
|
|
||||||
/>
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/snippet}
|
|
||||||
<MenuButton onclick={() => share(true)}>
|
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={GlobeAlt} size="16" micro />
|
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
<MenuButton onclick={() => share(true)} icon={GlobeAlt}>
|
||||||
{$t('filter.location.global')}
|
{$t('filter.location.global')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton onclick={() => share(false)}>
|
<MenuButton onclick={() => share(false)} icon={MapPin}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={MapPin} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('filter.location.local')}
|
{$t('filter.location.local')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
</Menu>
|
</Menu>
|
||||||
@@ -141,10 +119,8 @@
|
|||||||
|
|
||||||
goto('/create/post?crosspost=true')
|
goto('/create/post?crosspost=true')
|
||||||
}}
|
}}
|
||||||
|
icon={ArrowTopRightOnSquare}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowTopRightOnSquare} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('post.actions.more.crosspost')}
|
{$t('post.actions.more.crosspost')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if profile.current.user && post.creator.id == profile.current.user.local_user_view.person.id}
|
{#if profile.current.user && post.creator.id == profile.current.user.local_user_view.person.id}
|
||||||
@@ -154,10 +130,8 @@
|
|||||||
post.post.deleted = await deleteItem(post, !post.post.deleted)
|
post.post.deleted = await deleteItem(post, !post.post.deleted)
|
||||||
}}
|
}}
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
|
icon={Trash}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Trash} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{post.post.deleted
|
{post.post.deleted
|
||||||
? $t('post.actions.more.restore')
|
? $t('post.actions.more.restore')
|
||||||
: $t('post.actions.more.delete')}
|
: $t('post.actions.more.delete')}
|
||||||
@@ -177,19 +151,14 @@
|
|||||||
if (hidden) onhide?.(hidden)
|
if (hidden) onhide?.(hidden)
|
||||||
}}
|
}}
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
|
icon={XMark}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={XMark} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{post.hidden
|
{post.hidden
|
||||||
? $t('post.actions.more.unhide')
|
? $t('post.actions.more.unhide')
|
||||||
: $t('post.actions.more.hide')}
|
: $t('post.actions.more.hide')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuButton onclick={() => report(post)} color="danger-subtle">
|
<MenuButton onclick={() => report(post)} color="danger-subtle" icon={Flag}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Flag} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('moderation.report')}
|
{$t('moderation.report')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import type { PostView } from '$lib/client/types'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
import type { PostView } from '$lib/client/types'
|
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
import { ArchiveBox, Icon, Plus } from 'svelte-hero-icons'
|
import { ArchiveBox, Plus } from 'svelte-hero-icons'
|
||||||
import { Post } from '..'
|
import { Post } from '..'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -26,10 +26,7 @@
|
|||||||
title="No posts"
|
title="No posts"
|
||||||
description="There are no posts that match this filter."
|
description="There are no posts that match this filter."
|
||||||
>
|
>
|
||||||
<Button href="/communities">
|
<Button href="/communities" icon={Plus}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Plus} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
<span>Follow some communities</span>
|
<span>Follow some communities</span>
|
||||||
</Button>
|
</Button>
|
||||||
</Placeholder>
|
</Placeholder>
|
||||||
|
|||||||
@@ -181,10 +181,12 @@
|
|||||||
title={$t('routes.frontpage.empty.title')}
|
title={$t('routes.frontpage.empty.title')}
|
||||||
description={$t('routes.frontpage.empty.description')}
|
description={$t('routes.frontpage.empty.description')}
|
||||||
>
|
>
|
||||||
<Button href="/communities" rounding="pill" color="primary">
|
<Button
|
||||||
{#snippet prefix()}
|
href="/communities"
|
||||||
<Icon src={ArrowTopRightOnSquare} size="16" mini />
|
rounding="pill"
|
||||||
{/snippet}
|
color="primary"
|
||||||
|
icon={ArrowTopRightOnSquare}
|
||||||
|
>
|
||||||
{$t('nav.communities')}
|
{$t('nav.communities')}
|
||||||
</Button>
|
</Button>
|
||||||
</Placeholder>
|
</Placeholder>
|
||||||
@@ -265,10 +267,7 @@
|
|||||||
community_name: feedData.community_name ?? 'undefined',
|
community_name: feedData.community_name ?? 'undefined',
|
||||||
})}
|
})}
|
||||||
{#snippet action()}
|
{#snippet action()}
|
||||||
<Button color="tertiary">
|
<Button color="tertiary" icon={ChevronDoubleUp}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ChevronDoubleUp} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('routes.post.scrollToTop')}
|
{$t('routes.post.scrollToTop')}
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -360,10 +360,8 @@
|
|||||||
size="sm"
|
size="sm"
|
||||||
color={data.alt_text ? 'primary' : 'ghost'}
|
color={data.alt_text ? 'primary' : 'ghost'}
|
||||||
class="text-xs"
|
class="text-xs"
|
||||||
>
|
icon={ChatBubbleBottomCenterText}
|
||||||
{#snippet prefix()}
|
>{$t('form.post.altText')}
|
||||||
<Icon src={ChatBubbleBottomCenterText} size="15" micro />
|
|
||||||
{/snippet}{$t('form.post.altText')}
|
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
<Button
|
<Button
|
||||||
@@ -372,10 +370,8 @@
|
|||||||
size="sm"
|
size="sm"
|
||||||
color="ghost"
|
color="ghost"
|
||||||
class="text-xs"
|
class="text-xs"
|
||||||
|
icon={Photo}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Photo} size="15" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('form.post.uploadImage')}
|
{$t('form.post.uploadImage')}
|
||||||
</Button>
|
</Button>
|
||||||
{#if generation.generatable}
|
{#if generation.generatable}
|
||||||
@@ -386,10 +382,8 @@
|
|||||||
size="sm"
|
size="sm"
|
||||||
color="ghost"
|
color="ghost"
|
||||||
class="text-xs"
|
class="text-xs"
|
||||||
|
icon={Sparkles}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Sparkles} size="15" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('form.post.generateTitle')}
|
{$t('form.post.generateTitle')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { Button, Material, toast } from 'mono-svelte'
|
import { Button, Material, toast } from 'mono-svelte'
|
||||||
import { focusTrap } from 'svelte-focus-trap'
|
import { focusTrap } from 'svelte-focus-trap'
|
||||||
import { Icon, Share, XMark } from 'svelte-hero-icons'
|
import { Share, XMark } from 'svelte-hero-icons'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { fade, scale } from 'svelte/transition'
|
import { fade, scale } from 'svelte/transition'
|
||||||
|
|
||||||
@@ -66,22 +66,16 @@
|
|||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
aria-label={$t('post.actions.more.share')}
|
aria-label={$t('post.actions.more.share')}
|
||||||
>
|
icon={Share}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={Share} size="20" micro />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
onclick={() => history.back()}
|
onclick={() => history.back()}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
aria-label={$t('common.back')}
|
aria-label={$t('common.back')}
|
||||||
>
|
icon={XMark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={XMark} size="20" micro />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</Material>
|
</Material>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { navigating } from '$app/state'
|
import { navigating } from '$app/state'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { Button, TextInput } from 'mono-svelte'
|
import { Button, TextInput } from 'mono-svelte'
|
||||||
import { Icon, MagnifyingGlass } from 'svelte-hero-icons'
|
import { MagnifyingGlass } from 'svelte-hero-icons'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
query?: string | null
|
query?: string | null
|
||||||
@@ -30,9 +30,6 @@
|
|||||||
title="Search"
|
title="Search"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
loading={navigating.to?.route.id == '/search'}
|
loading={navigating.to?.route.id == '/search'}
|
||||||
>
|
icon={MagnifyingGlass}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={MagnifyingGlass} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
label={$t('nav.admin')}
|
label={$t('nav.admin')}
|
||||||
icon={ServerStack}
|
icon={ServerStack}
|
||||||
class="relative"
|
class="relative"
|
||||||
isSelectedFilter={path => path.startsWith('/admin')}
|
isSelectedFilter={(path) => path.startsWith('/admin')}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if amModOfAny(profile.current?.user)}
|
{#if amModOfAny(profile.current?.user)}
|
||||||
|
|||||||
@@ -66,10 +66,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
{#if profile.current?.jwt}
|
{#if profile.current?.jwt}
|
||||||
<MenuButton href="/inbox">
|
<MenuButton href="/inbox" icon={Inbox}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Inbox} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('profile.inbox')}
|
{$t('profile.inbox')}
|
||||||
{#if $notifications.inbox > 0}
|
{#if $notifications.inbox > 0}
|
||||||
<Badge color="red-subtle" class="text-xs ml-auto font-bold py-0.5!">
|
<Badge color="red-subtle" class="text-xs ml-auto font-bold py-0.5!">
|
||||||
@@ -94,43 +91,25 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuDivider>{$t('profile.profile')}</MenuDivider>
|
<MenuDivider>{$t('profile.profile')}</MenuDivider>
|
||||||
<MenuButton href="/profile">
|
<MenuButton href="/profile" icon={UserCircle}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={UserCircle} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('profile.profile')}
|
{$t('profile.profile')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton href="/saved">
|
<MenuButton href="/saved" icon={Bookmark}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Bookmark} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('profile.saved')}
|
{$t('profile.saved')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{:else}
|
{:else}
|
||||||
<MenuButton href="/accounts/login">
|
<MenuButton href="/accounts/login" icon={ArrowLeftOnRectangle}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowLeftOnRectangle} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('account.login')}
|
{$t('account.login')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton href="/signup">
|
<MenuButton href="/signup" icon={Identification}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Identification} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('account.signup')}
|
{$t('account.signup')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuButton href="/accounts">
|
<MenuButton href="/accounts" icon={UserGroup}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={UserGroup} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('account.accounts')}
|
{$t('account.accounts')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuDivider>{$t('nav.menu.app')}</MenuDivider>
|
<MenuDivider>{$t('nav.menu.app')}</MenuDivider>
|
||||||
<MenuButton href="/settings">
|
<MenuButton href="/settings" icon={Cog6Tooth}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Cog6Tooth} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('nav.menu.settings')}
|
{$t('nav.menu.settings')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<Select bind:value={theme.colorScheme} size="sm" placement="bottom">
|
<Select bind:value={theme.colorScheme} size="sm" placement="bottom">
|
||||||
@@ -158,19 +137,11 @@
|
|||||||
</Option>
|
</Option>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Select>
|
</Select>
|
||||||
<MenuButton href="/theme">
|
<MenuButton href="/theme" icon={Swatch}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Swatch} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('nav.menu.theme')}
|
{$t('nav.menu.theme')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if settings.debugInfo}
|
{#if settings.debugInfo}
|
||||||
<MenuButton href="/util">
|
<MenuButton href="/util" icon={BugAnt}>Debug</MenuButton>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={BugAnt} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
Debug
|
|
||||||
</MenuButton>
|
|
||||||
{/if}
|
{/if}
|
||||||
<li class="flex flex-col px-2 py-1 mx-auto my-1 text-xs w-full">
|
<li class="flex flex-col px-2 py-1 mx-auto my-1 text-xs w-full">
|
||||||
<div class="flex flex-row gap-2 w-full items-center">
|
<div class="flex flex-row gap-2 w-full items-center">
|
||||||
|
|||||||
@@ -48,7 +48,10 @@
|
|||||||
<div class="font-medium">{profile.current.username}</div>
|
<div class="font-medium">{profile.current.username}</div>
|
||||||
{#if !LINKED_INSTANCE_URL}
|
{#if !LINKED_INSTANCE_URL}
|
||||||
<div class="text-xs text-slate-500 dark:text-zinc-500">
|
<div class="text-xs text-slate-500 dark:text-zinc-500">
|
||||||
<span class="capitalize">{profile.current.client?.name ?? DEFAULT_CLIENT_TYPE.name}</span> • {profile.current.instance}
|
<span class="capitalize"
|
||||||
|
>{profile.current.client?.name ?? DEFAULT_CLIENT_TYPE.name}</span
|
||||||
|
>
|
||||||
|
• {profile.current.instance}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -75,7 +78,10 @@
|
|||||||
<div class="font-medium text-sm">{p.username}</div>
|
<div class="font-medium text-sm">{p.username}</div>
|
||||||
{#if !LINKED_INSTANCE_URL}
|
{#if !LINKED_INSTANCE_URL}
|
||||||
<div class="text-xs text-slate-500 dark:text-zinc-500">
|
<div class="text-xs text-slate-500 dark:text-zinc-500">
|
||||||
<span class="capitalize">{p.client?.name ?? DEFAULT_CLIENT_TYPE.name}</span> • {p.instance}
|
<span class="capitalize"
|
||||||
|
>{p.client?.name ?? DEFAULT_CLIENT_TYPE.name}</span
|
||||||
|
>
|
||||||
|
• {p.instance}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -95,10 +101,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/each}
|
{/each}
|
||||||
<MenuButton href="/accounts">
|
<MenuButton href="/accounts" icon={UserGroup}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={UserGroup} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('account.accounts')}
|
{$t('account.accounts')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
</Menu>
|
</Menu>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<ItemList
|
<ItemList
|
||||||
items={profile.current.user.moderates.map(i => ({
|
items={profile.current.user.moderates.map((i) => ({
|
||||||
id: i.community.id,
|
id: i.community.id,
|
||||||
name: i.community.title,
|
name: i.community.title,
|
||||||
url: communityLink(i.community),
|
url: communityLink(i.community),
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
<ItemList
|
<ItemList
|
||||||
items={profile.current.user.follows.map(i => ({
|
items={profile.current.user.follows.map((i) => ({
|
||||||
id: i.community.id,
|
id: i.community.id,
|
||||||
name: i.community.title,
|
name: i.community.title,
|
||||||
url: communityLink(i.community),
|
url: communityLink(i.community),
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
children?: Snippet
|
children?: Snippet
|
||||||
suffix?: Snippet
|
suffix?: Snippet
|
||||||
onclick?: HTMLButtonAttributes['onclick']
|
onclick?: HTMLButtonAttributes['onclick']
|
||||||
|
icon?: IconSource
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { Props as ButtonProps }
|
export type { Props as ButtonProps }
|
||||||
@@ -87,6 +88,7 @@
|
|||||||
|
|
||||||
import Spinner from '../loader/Spinner.svelte'
|
import Spinner from '../loader/Spinner.svelte'
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
|
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||||
|
|
||||||
let {
|
let {
|
||||||
loading = false,
|
loading = false,
|
||||||
@@ -103,6 +105,7 @@
|
|||||||
prefix,
|
prefix,
|
||||||
children,
|
children,
|
||||||
suffix,
|
suffix,
|
||||||
|
icon,
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
@@ -136,6 +139,8 @@
|
|||||||
<Spinner width={loaderWidth ?? 16} />
|
<Spinner width={loaderWidth ?? 16} />
|
||||||
{:else if prefix}
|
{:else if prefix}
|
||||||
{@render prefix?.()}
|
{@render prefix?.()}
|
||||||
|
{:else if icon}
|
||||||
|
<Icon src={icon} size="16" mini />
|
||||||
{/if}
|
{/if}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
{@render suffix?.()}
|
{@render suffix?.()}
|
||||||
|
|||||||
@@ -93,8 +93,12 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#snippet selectTarget(attachment: Attachment)}
|
{#snippet selectTarget(attachment: Attachment)}
|
||||||
<Label text={label} customText={customLabel} class={['space-y-1 relative', baseClass]}>
|
<Label
|
||||||
<div class="relative" role="presentation">
|
text={label}
|
||||||
|
customText={customLabel}
|
||||||
|
class={['space-y-1 relative', baseClass]}
|
||||||
|
>
|
||||||
|
<div class="relative w-max max-w-full" role="presentation">
|
||||||
<select
|
<select
|
||||||
{@attach attachment}
|
{@attach attachment}
|
||||||
{...rest}
|
{...rest}
|
||||||
@@ -109,10 +113,10 @@
|
|||||||
clazz,
|
clazz,
|
||||||
]}
|
]}
|
||||||
bind:value
|
bind:value
|
||||||
onmousedown={e => {
|
onmousedown={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}}
|
}}
|
||||||
onkeypress={e => {
|
onkeypress={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
open = !open
|
open = !open
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { pushState, replaceState } from '$app/navigation'
|
||||||
|
import { page } from '$app/state'
|
||||||
|
import type { Snippet } from 'svelte'
|
||||||
import { focusTrap } from 'svelte-focus-trap'
|
import { focusTrap } from 'svelte-focus-trap'
|
||||||
import { Icon, XMark } from 'svelte-hero-icons'
|
import { XMark } from 'svelte-hero-icons'
|
||||||
import { backOut } from 'svelte/easing'
|
import { backOut } from 'svelte/easing'
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
import { fade, scale } from 'svelte/transition'
|
import { fade, scale } from 'svelte/transition'
|
||||||
import { Button } from '../index.js'
|
import { Button } from '../index.js'
|
||||||
import Portal from '../popover/Portal.svelte'
|
import Portal from '../popover/Portal.svelte'
|
||||||
import type { Snippet } from 'svelte'
|
|
||||||
import { page } from '$app/state'
|
|
||||||
import { pushState, replaceState } from '$app/navigation'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
action?: string | undefined
|
action?: string | undefined
|
||||||
@@ -110,11 +110,8 @@ bg-white/50 dark:bg-black/50 box-border p-4"
|
|||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="square-sm"
|
size="square-sm"
|
||||||
onclick={() => onclose()}
|
onclick={() => onclose()}
|
||||||
>
|
icon={XMark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={XMark} size="20" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/if}
|
{/if}
|
||||||
{#if title !== null}
|
{#if title !== null}
|
||||||
<h1 class="font-semibold text-xl max-w-full">
|
<h1 class="font-semibold text-xl max-w-full">
|
||||||
|
|||||||
@@ -70,13 +70,13 @@
|
|||||||
<TextInput
|
<TextInput
|
||||||
{@attach attachment}
|
{@attach attachment}
|
||||||
bind:value={query}
|
bind:value={query}
|
||||||
oninput={e => {
|
oninput={(e) => {
|
||||||
searching = true
|
searching = true
|
||||||
openMenu = true
|
openMenu = true
|
||||||
oninput?.(e)
|
oninput?.(e)
|
||||||
debounceFunc()
|
debounceFunc()
|
||||||
}}
|
}}
|
||||||
onfocus={e => {
|
onfocus={(e) => {
|
||||||
searching = true
|
searching = true
|
||||||
openMenu = true
|
openMenu = true
|
||||||
oninput?.(e)
|
oninput?.(e)
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { navigating, page } from '$app/state'
|
import { navigating, page } from '$app/state'
|
||||||
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
|
import { site } from '$lib/client/lemmy.svelte'
|
||||||
import SiteCard from '$lib/components/lemmy/instance/InstanceCard.svelte'
|
import SiteCard from '$lib/components/lemmy/instance/InstanceCard.svelte'
|
||||||
|
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
|
||||||
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
||||||
import Shell from '$lib/components/ui/layout/Shell.svelte'
|
import Shell from '$lib/components/ui/layout/Shell.svelte'
|
||||||
import Navbar from '$lib/components/ui/navbar/Navbar.svelte'
|
import Navbar from '$lib/components/ui/navbar/Navbar.svelte'
|
||||||
import Sidebar from '$lib/components/ui/sidebar/Sidebar.svelte'
|
import Sidebar from '$lib/components/ui/sidebar/Sidebar.svelte'
|
||||||
import { locale } from '$lib/i18n/translations'
|
import { locale } from '$lib/i18n/translations'
|
||||||
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte'
|
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte'
|
||||||
import { site } from '$lib/client/lemmy.svelte'
|
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
|
import { getDefaultColors } from '$lib/ui/theme/presets'
|
||||||
import {
|
import {
|
||||||
inDarkColorScheme,
|
inDarkColorScheme,
|
||||||
rgbToHex,
|
rgbToHex,
|
||||||
theme,
|
theme,
|
||||||
} from '$lib/ui/theme/theme.svelte.js'
|
} from '$lib/ui/theme/theme.svelte.js'
|
||||||
import { getDefaultColors } from '$lib/ui/theme/presets'
|
|
||||||
import { Button, ModalContainer, Spinner, ToastContainer } from 'mono-svelte'
|
import { Button, ModalContainer, Spinner, ToastContainer } from 'mono-svelte'
|
||||||
import nProgress from 'nprogress'
|
import nProgress from 'nprogress'
|
||||||
import 'nprogress/nprogress.css'
|
import 'nprogress/nprogress.css'
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import { Forward, Icon } from 'svelte-hero-icons'
|
import { Forward } from 'svelte-hero-icons'
|
||||||
import '../style/app.css'
|
import '../style/app.css'
|
||||||
interface Props {
|
interface Props {
|
||||||
children?: import('svelte').Snippet
|
children?: import('svelte').Snippet
|
||||||
@@ -121,10 +121,8 @@
|
|||||||
<Button
|
<Button
|
||||||
class="fixed -top-16 focus:top-0 left-0 m-4 z-300 transition-all"
|
class="fixed -top-16 focus:top-0 left-0 m-4 z-300 transition-all"
|
||||||
href="#main"
|
href="#main"
|
||||||
|
icon={Forward}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Forward} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
Skip Navigation
|
Skip Navigation
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|||||||
@@ -103,23 +103,20 @@
|
|||||||
rounding="pill"
|
rounding="pill"
|
||||||
class="px-4"
|
class="px-4"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
icon={ArrowLeftOnRectangle}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowLeftOnRectangle} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('account.login')}
|
{$t('account.login')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button href="/signup" rounding="pill" class="px-4">
|
<Button
|
||||||
{#snippet prefix()}
|
href="/signup"
|
||||||
<Icon src={Identification} size="16" mini />
|
rounding="pill"
|
||||||
{/snippet}
|
class="px-4"
|
||||||
|
icon={Identification}
|
||||||
|
>
|
||||||
{$t('account.signup')}
|
{$t('account.signup')}
|
||||||
</Button>
|
</Button>
|
||||||
{#if !LINKED_INSTANCE_URL}
|
{#if !LINKED_INSTANCE_URL}
|
||||||
<Button href="/accounts/login/guest" rounding="pill">
|
<Button href="/accounts/login/guest" rounding="pill" icon={Plus}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Plus} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('account.addGuest')}
|
{$t('account.addGuest')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -129,7 +126,7 @@
|
|||||||
</Header>
|
</Header>
|
||||||
<form class="accounts-grid 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}
|
||||||
animate={false}
|
animate={false}
|
||||||
>
|
>
|
||||||
@@ -168,7 +165,10 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
||||||
<span class="capitalize">{p.client?.name ?? DEFAULT_CLIENT_TYPE.name}</span> • {p.instance}
|
<span class="capitalize"
|
||||||
|
>{p.client?.name ?? DEFAULT_CLIENT_TYPE.name}</span
|
||||||
|
>
|
||||||
|
• {p.instance}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Menu placement="bottom-end">
|
<Menu placement="bottom-end">
|
||||||
@@ -179,38 +179,29 @@
|
|||||||
color="tertiary"
|
color="tertiary"
|
||||||
class="justify-self-end ml-auto z-50"
|
class="justify-self-end ml-auto z-50"
|
||||||
aria-label={$t('post.actions.more.label')}
|
aria-label={$t('post.actions.more.label')}
|
||||||
>
|
icon={EllipsisHorizontal}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={EllipsisHorizontal} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||||
<div
|
<div
|
||||||
class="px-4 py-2 flex items-center gap-2"
|
class="px-4 py-2 flex items-center gap-2"
|
||||||
onclick={e => e.stopPropagation()}
|
onclick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="square-md"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
title={$t('account.moveUp')}
|
title={$t('account.moveUp')}
|
||||||
onclick={() => profile.move(p.id, true)}
|
onclick={() => profile.move(p.id, true)}
|
||||||
>
|
icon={ChevronUp}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={ChevronUp} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="square-md"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
title={$t('account.moveDown')}
|
title={$t('account.moveDown')}
|
||||||
onclick={() => profile.move(p.id, false)}
|
onclick={() => profile.move(p.id, false)}
|
||||||
>
|
icon={ChevronDown}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={ChevronDown} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{#if settings.debugInfo}
|
{#if settings.debugInfo}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
@@ -218,10 +209,8 @@
|
|||||||
debugProfile = p
|
debugProfile = p
|
||||||
debugging = !debugging
|
debugging = !debugging
|
||||||
}}
|
}}
|
||||||
|
icon={BugAnt}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={BugAnt} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('common.debug')}
|
{$t('common.debug')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -232,10 +221,8 @@
|
|||||||
removing.shown = !removing.shown
|
removing.shown = !removing.shown
|
||||||
}}
|
}}
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
|
icon={ArrowRightOnRectangle}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowRightOnRectangle} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('account.logout')}
|
{$t('account.logout')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -167,11 +167,8 @@
|
|||||||
onclick={() => review(false)}
|
onclick={() => review(false)}
|
||||||
loading={denying || reviewing}
|
loading={denying || reviewing}
|
||||||
disabled={approving || denying || reviewing}
|
disabled={approving || denying || reviewing}
|
||||||
>
|
icon={XMark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={XMark} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="square-md"
|
||||||
class="hover:bg-slate-200 {application.creator_local_user
|
class="hover:bg-slate-200 {application.creator_local_user
|
||||||
@@ -182,10 +179,7 @@
|
|||||||
onclick={() => review(true)}
|
onclick={() => review(true)}
|
||||||
loading={approving}
|
loading={approving}
|
||||||
disabled={approving || denying || reviewing}
|
disabled={approving || denying || reviewing}
|
||||||
>
|
icon={Check}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={Check} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</Material>
|
</Material>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import { client, getClient, site } from '$lib/client/lemmy.svelte'
|
import { client, site } from '$lib/client/lemmy.svelte'
|
||||||
import type { EditSite } from '$lib/client/types'
|
import type { EditSite } from '$lib/client/types'
|
||||||
import ImageInputUpload from '$lib/components/form/ImageInputUpload.svelte'
|
import ImageInputUpload from '$lib/components/form/ImageInputUpload.svelte'
|
||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
<form
|
<form
|
||||||
class="flex flex-col gap-4"
|
class="flex flex-col gap-4"
|
||||||
onsubmit={e => {
|
onsubmit={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
save()
|
save()
|
||||||
}}
|
}}
|
||||||
@@ -80,25 +80,25 @@
|
|||||||
<Header pageHeader>{$t('routes.admin.config.title')}</Header>
|
<Header pageHeader>{$t('routes.admin.config.title')}</Header>
|
||||||
{#if formData}
|
{#if formData}
|
||||||
<TextInput
|
<TextInput
|
||||||
bind:value={() => formData.name ?? '', v => (formData.description = v)}
|
bind:value={() => formData.name ?? '', (v) => (formData.description = v)}
|
||||||
label={$t('form.name')}
|
label={$t('form.name')}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
bind:value={
|
bind:value={
|
||||||
() => formData.description ?? '', v => (formData.description = v)
|
() => formData.description ?? '', (v) => (formData.description = v)
|
||||||
}
|
}
|
||||||
label={$t('form.description')}
|
label={$t('form.description')}
|
||||||
/>
|
/>
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
previewButton
|
previewButton
|
||||||
bind:value={() => formData.sidebar ?? '', v => (formData.sidebar = v)}
|
bind:value={() => formData.sidebar ?? '', (v) => (formData.sidebar = v)}
|
||||||
label={$t('routes.admin.config.sidebar')}
|
label={$t('routes.admin.config.sidebar')}
|
||||||
/>
|
/>
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
previewButton
|
previewButton
|
||||||
bind:value={
|
bind:value={
|
||||||
() => formData.legal_information ?? '',
|
() => formData.legal_information ?? '',
|
||||||
v => (formData.legal_information = v)
|
(v) => (formData.legal_information = v)
|
||||||
}
|
}
|
||||||
label={$t('routes.legal.title')}
|
label={$t('routes.legal.title')}
|
||||||
/>
|
/>
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
</Badge>
|
</Badge>
|
||||||
</button>
|
</button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#each site.data.all_languages.filter(l => !formData.discussion_languages?.includes(l.id)) as language (language.id)}
|
{#each site.data.all_languages.filter((l) => !formData.discussion_languages?.includes(l.id)) as language (language.id)}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
class="min-h-[16px] py-0"
|
class="min-h-[16px] py-0"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
@@ -209,7 +209,7 @@
|
|||||||
</Menu>
|
</Menu>
|
||||||
{#each formData.discussion_languages ?? [] as languageId, index (languageId)}
|
{#each formData.discussion_languages ?? [] as languageId, index (languageId)}
|
||||||
{@const language = site.data.all_languages.find(
|
{@const language = site.data.all_languages.find(
|
||||||
l => l.id == languageId,
|
(l) => l.id == languageId,
|
||||||
)}
|
)}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -172,10 +172,7 @@
|
|||||||
{#if data.site && data.instances.value?.blocked}
|
{#if data.site && data.instances.value?.blocked}
|
||||||
<FileInput preview={false} bind:files={csv}>
|
<FileInput preview={false} bind:files={csv}>
|
||||||
{#snippet button()}
|
{#snippet button()}
|
||||||
<Button class="w-max">
|
<Button class="w-max" icon={Plus}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Plus} mini size="18" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('routes.admin.federation.csv')}
|
{$t('routes.admin.federation.csv')}
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -235,11 +232,8 @@
|
|||||||
(i) => i.id != instance.id,
|
(i) => i.id != instance.id,
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
>
|
icon={XMark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={XMark} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
{:else}
|
{:else}
|
||||||
@@ -319,11 +313,8 @@
|
|||||||
(i) => i.id != instance.id,
|
(i) => i.id != instance.id,
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
>
|
icon={XMark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={XMark} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -96,10 +96,7 @@
|
|||||||
>
|
>
|
||||||
<MarkdownEditor bind:value={newTagline} images={false} />
|
<MarkdownEditor bind:value={newTagline} images={false} />
|
||||||
|
|
||||||
<Button size="lg" submit>
|
<Button size="lg" submit icon={Plus}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Plus} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('common.add')}
|
{$t('common.add')}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
@@ -127,10 +124,7 @@
|
|||||||
images={false}
|
images={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button size="lg" submit>
|
<Button size="lg" submit icon={Plus}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Plus} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('common.add')}
|
{$t('common.add')}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -109,10 +109,8 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
size="sm"
|
size="sm"
|
||||||
submit
|
submit
|
||||||
|
icon={Plus}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Plus} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('common.add')}
|
{$t('common.add')}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -146,10 +146,8 @@
|
|||||||
rounding="xl"
|
rounding="xl"
|
||||||
color="primary"
|
color="primary"
|
||||||
submit
|
submit
|
||||||
|
icon={Plus}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Plus} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('common.add')}
|
{$t('common.add')}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
@@ -54,28 +54,23 @@
|
|||||||
class="rounded-2xl h-9 aspect-square"
|
class="rounded-2xl h-9 aspect-square"
|
||||||
rounding="none"
|
rounding="none"
|
||||||
aria-label={$t('common.refresh')}
|
aria-label={$t('common.refresh')}
|
||||||
>
|
icon={ArrowPath}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
onclick={markAllAsRead}
|
onclick={markAllAsRead}
|
||||||
loading={markingAsRead}
|
loading={markingAsRead}
|
||||||
disabled={markingAsRead || data.inbox.value.length == 0}
|
disabled={markingAsRead || data.inbox.value.length == 0}
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
icon={Check}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Check} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('routes.inbox.markAsRead')}
|
{$t('routes.inbox.markAsRead')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Header>
|
</Header>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
class="relative w-max"
|
class="relative"
|
||||||
bind:value={
|
bind:value={
|
||||||
() => data.unreadOnly.value.toString(),
|
() => data.unreadOnly.value.toString(),
|
||||||
(v) => (data.unreadOnly.value = v == 'true')
|
(v) => (data.unreadOnly.value = v == 'true')
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { notifications, profile } from '$lib/auth.svelte.js'
|
import { notifications, profile } from '$lib/auth.svelte.js'
|
||||||
|
import { getClient } from '$lib/client/lemmy.svelte'
|
||||||
|
import { CommentItem } from '$lib/components/lemmy/comment'
|
||||||
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
|
||||||
import type { InboxItem } from '$lib/lemmy/inbox.js'
|
import type { InboxItem } from '$lib/lemmy/inbox.js'
|
||||||
import { escapeHtml } from '$lib/util.svelte'
|
import { escapeHtml } from '$lib/util.svelte'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { Eye, EyeSlash, Icon } from 'svelte-hero-icons'
|
import { Eye, EyeSlash } from 'svelte-hero-icons'
|
||||||
import { CommentItem } from '$lib/components/lemmy/comment'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
item: InboxItem
|
item: InboxItem
|
||||||
@@ -99,10 +99,8 @@
|
|||||||
size="sm"
|
size="sm"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
class="shrink-0"
|
class="shrink-0"
|
||||||
|
icon={item.read ? EyeSlash : Eye}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={item.read ? EyeSlash : Eye} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{item.read
|
{item.read
|
||||||
? $t('post.actions.more.markUnread')
|
? $t('post.actions.more.markUnread')
|
||||||
: $t('post.actions.more.markRead')}
|
: $t('post.actions.more.markRead')}
|
||||||
@@ -132,10 +130,8 @@
|
|||||||
}}
|
}}
|
||||||
size="sm"
|
size="sm"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
|
icon={item.read ? EyeSlash : Eye}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={item.read ? EyeSlash : Eye} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{item.read
|
{item.read
|
||||||
? $t('post.actions.more.markUnread')
|
? $t('post.actions.more.markUnread')
|
||||||
: $t('post.actions.more.markRead')}
|
: $t('post.actions.more.markRead')}
|
||||||
|
|||||||
@@ -109,11 +109,12 @@
|
|||||||
{$t('filter.inbox.messages')}
|
{$t('filter.inbox.messages')}
|
||||||
{#snippet extended()}
|
{#snippet extended()}
|
||||||
<div class="flex flex-wrap gap-4">
|
<div class="flex flex-wrap gap-4">
|
||||||
<Button size="square-md" href="." title={$t('common.back')}>
|
<Button
|
||||||
{#snippet prefix()}
|
size="square-md"
|
||||||
<Icon src={ArrowLeft} micro size="16" />
|
href="."
|
||||||
{/snippet}
|
title={$t('common.back')}
|
||||||
</Button>
|
icon={ArrowLeft}
|
||||||
|
></Button>
|
||||||
<UserLink avatar user={data.creator.value.person_view.person} />
|
<UserLink avatar user={data.creator.value.person_view.person} />
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -239,11 +240,8 @@
|
|||||||
submit
|
submit
|
||||||
loading={textbox.loading}
|
loading={textbox.loading}
|
||||||
disabled={textbox.loading}
|
disabled={textbox.loading}
|
||||||
>
|
icon={PaperAirplane}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={PaperAirplane} size="18" micro />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -64,17 +64,19 @@
|
|||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#if primary}
|
{#if primary}
|
||||||
<MenuButton color="danger-subtle" onclick={() => ondelete?.(true)}>
|
<MenuButton
|
||||||
{#snippet prefix()}
|
color="danger-subtle"
|
||||||
<Icon src={Trash} size="16" micro />
|
onclick={() => ondelete?.(true)}
|
||||||
{/snippet}
|
icon={Trash}
|
||||||
|
>
|
||||||
{$t('post.actions.more.delete')}
|
{$t('post.actions.more.delete')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{:else}
|
{:else}
|
||||||
<MenuButton color="danger-subtle" onclick={() => onreport?.(true)}>
|
<MenuButton
|
||||||
{#snippet prefix()}
|
color="danger-subtle"
|
||||||
<Icon src={Flag} size="16" micro />
|
onclick={() => onreport?.(true)}
|
||||||
{/snippet}
|
icon={Flag}
|
||||||
|
>
|
||||||
{$t('moderation.report')}
|
{$t('moderation.report')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
import type { ReportView } from '$lib/lemmy/report.js'
|
import type { ReportView } from '$lib/lemmy/report.js'
|
||||||
import { Badge, Button, Label, Material, Modal, toast } from 'mono-svelte'
|
import { Badge, Button, Label, Material, Modal, toast } from 'mono-svelte'
|
||||||
import { CheckBadge, Icon } from 'svelte-hero-icons'
|
import { CheckBadge } from 'svelte-hero-icons'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
item: ReportView[]
|
item: ReportView[]
|
||||||
@@ -175,10 +175,8 @@
|
|||||||
rounding="pill"
|
rounding="pill"
|
||||||
size="sm"
|
size="sm"
|
||||||
color={item.resolved ? 'secondary' : 'primary'}
|
color={item.resolved ? 'secondary' : 'primary'}
|
||||||
|
icon={CheckBadge}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={CheckBadge} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{!item.resolved
|
{!item.resolved
|
||||||
? $t('routes.moderation.resolve')
|
? $t('routes.moderation.resolve')
|
||||||
: $t('routes.moderation.unresolve')}
|
: $t('routes.moderation.unresolve')}
|
||||||
|
|||||||
@@ -24,7 +24,15 @@
|
|||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
import CommentProvider from './CommentProvider.svelte'
|
import CommentProvider from './CommentProvider.svelte'
|
||||||
import { mediaType, parseTags, Post, PostActions, postLink, PostMedia, PostMeta } from '$lib/components/lemmy/post'
|
import {
|
||||||
|
mediaType,
|
||||||
|
parseTags,
|
||||||
|
Post,
|
||||||
|
PostActions,
|
||||||
|
postLink,
|
||||||
|
PostMedia,
|
||||||
|
PostMeta,
|
||||||
|
} from '$lib/components/lemmy/post'
|
||||||
|
|
||||||
let { data } = $props()
|
let { data } = $props()
|
||||||
|
|
||||||
@@ -307,10 +315,8 @@
|
|||||||
<Button
|
<Button
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
onclick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
|
onclick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
|
||||||
|
icon={ChevronDoubleUp}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ChevronDoubleUp} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('routes.post.scrollToTop')}
|
{$t('routes.post.scrollToTop')}
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -107,11 +107,8 @@
|
|||||||
class="h-8.5 w-8.5"
|
class="h-8.5 w-8.5"
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
onclick={onupdate}
|
onclick={onupdate}
|
||||||
>
|
icon={ArrowPath}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</EndPlaceholder>
|
</EndPlaceholder>
|
||||||
@@ -150,11 +147,13 @@
|
|||||||
{$t('filter.sort.controversial')}
|
{$t('filter.sort.controversial')}
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
<Button size="custom" class="h-8.5 w-8.5" rounding="xl" onclick={onupdate}>
|
<Button
|
||||||
{#snippet prefix()}
|
size="custom"
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
class="h-8.5 w-8.5"
|
||||||
{/snippet}
|
rounding="xl"
|
||||||
</Button>
|
onclick={onupdate}
|
||||||
|
icon={ArrowPath}
|
||||||
|
></Button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{#if virtualize}
|
{#if virtualize}
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import { client } from '$lib/client/lemmy.svelte.js'
|
||||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.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'
|
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations.js'
|
|
||||||
import type {
|
import type {
|
||||||
CommunityBlockView,
|
CommunityBlockView,
|
||||||
InstanceBlockView,
|
InstanceBlockView,
|
||||||
PersonBlockView,
|
PersonBlockView,
|
||||||
} from '$lib/client/types'
|
} from '$lib/client/types'
|
||||||
import { Button } from 'mono-svelte'
|
|
||||||
import { Check, Icon, XMark } from 'svelte-hero-icons'
|
|
||||||
import type { PageData } from './$types.js'
|
|
||||||
import { client } from '$lib/client/lemmy.svelte.js'
|
|
||||||
import { CommunityLink } from '$lib/components/lemmy/community'
|
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||||
|
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 { Header } from '$lib/components/ui/layout'
|
||||||
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
|
import { t } from '$lib/i18n/translations.js'
|
||||||
|
import { Button } from 'mono-svelte'
|
||||||
|
import { Check, XMark } from 'svelte-hero-icons'
|
||||||
|
import type { PageData } from './$types.js'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
// sveltekit doesn't feel like making types work right now
|
// sveltekit doesn't feel like making types work right now
|
||||||
@@ -109,11 +109,8 @@
|
|||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
onclick={() => unblockCommunity(block)}
|
onclick={() => unblockCommunity(block)}
|
||||||
>
|
icon={XMark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={XMark} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</CommonList>
|
</CommonList>
|
||||||
@@ -139,11 +136,8 @@
|
|||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
onclick={() => unblockUser(block)}
|
onclick={() => unblockUser(block)}
|
||||||
>
|
icon={XMark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={XMark} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</CommonList>
|
</CommonList>
|
||||||
@@ -173,11 +167,8 @@
|
|||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
onclick={() => unblockInstances(block)}
|
onclick={() => unblockInstances(block)}
|
||||||
>
|
icon={XMark}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={XMark} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</CommonList>
|
</CommonList>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
<form
|
<form
|
||||||
class="flex flex-col gap-4 h-full"
|
class="flex flex-col gap-4 h-full"
|
||||||
onsubmit={e => {
|
onsubmit={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
save()
|
save()
|
||||||
}}
|
}}
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
/>
|
/>
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
images={false}
|
images={false}
|
||||||
bind:value={() => formData.bio ?? '', v => (formData.bio = v)}
|
bind:value={() => formData.bio ?? '', (v) => (formData.bio = v)}
|
||||||
label={$t('form.profile.bio')}
|
label={$t('form.profile.bio')}
|
||||||
previewButton
|
previewButton
|
||||||
/>
|
/>
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
</Badge>
|
</Badge>
|
||||||
</button>
|
</button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#each site.data.all_languages.filter(l => !formData.discussion_languages?.includes(l.id)) as language (language.id)}
|
{#each site.data.all_languages.filter((l) => !formData.discussion_languages?.includes(l.id)) as language (language.id)}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
class="min-h-[16px] py-0"
|
class="min-h-[16px] py-0"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
</Menu>
|
</Menu>
|
||||||
{#each formData.discussion_languages as languageId, index (languageId)}
|
{#each formData.discussion_languages as languageId, index (languageId)}
|
||||||
{@const language = site.data.all_languages.find(
|
{@const language = site.data.all_languages.find(
|
||||||
l => l.id == languageId,
|
(l) => l.id == languageId,
|
||||||
)}
|
)}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -59,22 +59,13 @@
|
|||||||
<Icon src={EllipsisHorizontal} size="16" micro />
|
<Icon src={EllipsisHorizontal} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuButton href="/profile/media">
|
<MenuButton href="/profile/media" icon={Photo}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Photo} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
{$t('routes.profile.media.title')}
|
{$t('routes.profile.media.title')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton href="/profile/voted/up">
|
<MenuButton href="/profile/voted/up" icon={ArrowUp}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowUp} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('routes.profile.upvoted')}
|
{$t('routes.profile.upvoted')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton href="/profile/voted/down">
|
<MenuButton href="/profile/voted/down" icon={ArrowDown}>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowDown} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('routes.profile.downvoted')}
|
{$t('routes.profile.downvoted')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
@@ -3,14 +3,9 @@
|
|||||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { defaultSettings, settings } from '$lib/settings.svelte'
|
import { defaultSettings, settings } from '$lib/settings.svelte'
|
||||||
import { Button, toast, Modal, modal, action } from 'mono-svelte'
|
import { action, Button, Modal, modal, toast } from 'mono-svelte'
|
||||||
import TextArea from 'mono-svelte/forms/TextArea.svelte'
|
import TextArea from 'mono-svelte/forms/TextArea.svelte'
|
||||||
import {
|
import { ArrowDownTray, ArrowPath, ArrowUpTray } from 'svelte-hero-icons'
|
||||||
ArrowDownTray,
|
|
||||||
ArrowPath,
|
|
||||||
ArrowUpTray,
|
|
||||||
Icon,
|
|
||||||
} from 'svelte-hero-icons'
|
|
||||||
|
|
||||||
let { children } = $props()
|
let { children } = $props()
|
||||||
let importing = $state(false)
|
let importing = $state(false)
|
||||||
@@ -57,10 +52,8 @@
|
|||||||
importing = true
|
importing = true
|
||||||
}}
|
}}
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
|
icon={ArrowDownTray}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowDownTray} mini size="18" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('settings.import')}
|
{$t('settings.import')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
@@ -70,10 +63,8 @@
|
|||||||
toast({ content: $t('toast.copied') })
|
toast({ content: $t('toast.copied') })
|
||||||
}}
|
}}
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
|
icon={ArrowUpTray}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowUpTray} mini size="18" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('settings.export')}
|
{$t('settings.export')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
@@ -95,10 +86,8 @@
|
|||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
|
icon={ArrowPath}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={ArrowPath} mini size="18" />
|
|
||||||
{/snippet}
|
|
||||||
{$t('settings.reset')}
|
{$t('settings.reset')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -85,10 +85,8 @@
|
|||||||
href="https://buymeacoffee.com/xylight"
|
href="https://buymeacoffee.com/xylight"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
|
icon={Heart}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Heart} size="16" micro />
|
|
||||||
{/snippet}
|
|
||||||
{$t('nav.menu.donate')}
|
{$t('nav.menu.donate')}
|
||||||
</Button>
|
</Button>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import { settings } from '$lib/settings.svelte'
|
||||||
import { Checkbox, Switch } from 'mono-svelte'
|
import { Switch } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
Bars3,
|
Bars3,
|
||||||
BookOpen,
|
BookOpen,
|
||||||
@@ -75,23 +75,21 @@
|
|||||||
/>
|
/>
|
||||||
<Setting icon={ServerStack}>
|
<Setting icon={ServerStack}>
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<span>{$t('settings.lemmy.instances.title')}</span>
|
{$t('settings.lemmy.instances.title')}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet description()}
|
{#snippet description()}
|
||||||
<span>
|
|
||||||
{$t('settings.lemmy.instances.description')}
|
{$t('settings.lemmy.instances.description')}
|
||||||
</span>
|
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<div class="flex flex-row flex-wrap items-center gap-4">
|
<div class="flex flex-row flex-wrap items-center gap-4">
|
||||||
<Checkbox bind:checked={settings.showInstances.user}>
|
<Switch bind:checked={settings.showInstances.user}>
|
||||||
{$t('content.users')}
|
{$t('content.users')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={settings.showInstances.comments}>
|
<Switch bind:checked={settings.showInstances.comments}>
|
||||||
{$t('content.comments')}
|
{$t('content.comments')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={settings.showInstances.community}>
|
<Switch bind:checked={settings.showInstances.community}>
|
||||||
{$t('content.communities')}
|
{$t('content.communities')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
</Setting>
|
</Setting>
|
||||||
<ToggleSetting
|
<ToggleSetting
|
||||||
|
|||||||
@@ -92,10 +92,8 @@
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
}}
|
}}
|
||||||
|
icon={Plus}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={Plus} micro size="16" />
|
|
||||||
{/snippet}
|
|
||||||
Add Preset
|
Add Preset
|
||||||
</Button>
|
</Button>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault } from 'svelte/legacy'
|
|
||||||
|
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/state'
|
import { page } from '$app/state'
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
@@ -20,10 +18,10 @@
|
|||||||
import { errorMessage } from '$lib/lemmy/error.js'
|
import { errorMessage } from '$lib/lemmy/error.js'
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
|
||||||
Label,
|
Label,
|
||||||
Material,
|
Material,
|
||||||
Spinner,
|
Spinner,
|
||||||
|
Switch,
|
||||||
TextInput,
|
TextInput,
|
||||||
toast,
|
toast,
|
||||||
} from 'mono-svelte'
|
} from 'mono-svelte'
|
||||||
@@ -155,7 +153,10 @@
|
|||||||
{#if stage == 'signup'}
|
{#if stage == 'signup'}
|
||||||
<form
|
<form
|
||||||
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={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
submit()
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Button href="/accounts" class=" mb-4 w-max" rounding="pill">
|
<Button href="/accounts" class=" mb-4 w-max" rounding="pill">
|
||||||
<Icon src={ArrowLeft} size="16" micro />
|
<Icon src={ArrowLeft} size="16" micro />
|
||||||
@@ -267,7 +268,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</Material>
|
</Material>
|
||||||
{/if}
|
{/if}
|
||||||
<Checkbox bind:checked={nsfw}>{$t('form.profile.showNSFW')}</Checkbox>
|
<Switch bind:checked={nsfw}>{$t('form.profile.showNSFW')}</Switch>
|
||||||
<input type="dn" name="honeypot" bind:value={honeypot} class="hidden" />
|
<input type="dn" name="honeypot" bind:value={honeypot} class="hidden" />
|
||||||
<Button
|
<Button
|
||||||
submit
|
submit
|
||||||
|
|||||||
@@ -103,11 +103,8 @@
|
|||||||
title: $t('routes.theme.preset.delete.title'),
|
title: $t('routes.theme.preset.delete.title'),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
>
|
icon={Trash}
|
||||||
{#snippet prefix()}
|
></Button>
|
||||||
<Icon src={Trash} size="16" mini />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</Material>
|
</Material>
|
||||||
|
|||||||
@@ -3,11 +3,27 @@
|
|||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import type { PersonView } from '$lib/client/types'
|
import type { PersonView } from '$lib/client/types'
|
||||||
import { ban, isAdmin } from '$lib/components/lemmy/moderation/moderation'
|
import { ban, isAdmin } from '$lib/components/lemmy/moderation/moderation'
|
||||||
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { blockUser, isBlocked } from '$lib/lemmy/user'
|
import { blockUser, isBlocked } from '$lib/lemmy/user'
|
||||||
import { Button, Menu, MenuButton, Modal, removeToast, toast } from 'mono-svelte'
|
import {
|
||||||
import { AtSymbol, EllipsisHorizontal, Envelope, Fire, Icon, Newspaper, NoSymbol, ShieldExclamation } from 'svelte-hero-icons'
|
Button,
|
||||||
|
Menu,
|
||||||
|
MenuButton,
|
||||||
|
Modal,
|
||||||
|
removeToast,
|
||||||
|
toast,
|
||||||
|
} from 'mono-svelte'
|
||||||
|
import {
|
||||||
|
AtSymbol,
|
||||||
|
EllipsisHorizontal,
|
||||||
|
Envelope,
|
||||||
|
Fire,
|
||||||
|
Icon,
|
||||||
|
Newspaper,
|
||||||
|
NoSymbol,
|
||||||
|
ShieldCheck,
|
||||||
|
ShieldExclamation,
|
||||||
|
} from 'svelte-hero-icons'
|
||||||
|
|
||||||
let { person }: { person: PersonView } = $props()
|
let { person }: { person: PersonView } = $props()
|
||||||
|
|
||||||
@@ -29,8 +45,6 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{#if purgingUser}
|
{#if purgingUser}
|
||||||
<Modal bind:open={purgingUser}>
|
<Modal bind:open={purgingUser}>
|
||||||
{#snippet customTitle()}
|
{#snippet customTitle()}
|
||||||
@@ -41,19 +55,12 @@
|
|||||||
{person.person.name}
|
{person.person.name}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>Are you sure you want to do this?</p>
|
||||||
Are you sure you want to do this?
|
|
||||||
</p>
|
|
||||||
<div class="flex flex-row gap-2">
|
<div class="flex flex-row gap-2">
|
||||||
<Button size="lg" onclick={() => (purgingUser = false)} class="flex-1">
|
<Button size="lg" onclick={() => (purgingUser = false)} class="flex-1">
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button size="lg" color="danger" onclick={purgeUser} class="flex-1">
|
||||||
size="lg"
|
|
||||||
color="danger"
|
|
||||||
onclick={purgeUser}
|
|
||||||
class="flex-1"
|
|
||||||
>
|
|
||||||
Purge
|
Purge
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,10 +74,8 @@
|
|||||||
rounding="pill"
|
rounding="pill"
|
||||||
color="primary"
|
color="primary"
|
||||||
href="/inbox/messages/{person.person.id}"
|
href="/inbox/messages/{person.person.id}"
|
||||||
|
icon={Envelope}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon micro size="16" src={Envelope} />
|
|
||||||
{/snippet}
|
|
||||||
{$t('content.message')}
|
{$t('content.message')}
|
||||||
</Button>
|
</Button>
|
||||||
{#if person.person.matrix_user_id}
|
{#if person.person.matrix_user_id}
|
||||||
@@ -89,49 +94,55 @@
|
|||||||
{#if isAdmin(profile.current?.user)}
|
{#if isAdmin(profile.current?.user)}
|
||||||
<Menu class="ml-auto" placement="bottom-end">
|
<Menu class="ml-auto" placement="bottom-end">
|
||||||
{#snippet target(attachment)}
|
{#snippet target(attachment)}
|
||||||
<Button {@attach attachment} size="sm" rounding="pill">
|
<Button
|
||||||
<ShieldIcon width={16} filled />
|
{@attach attachment}
|
||||||
|
size="sm"
|
||||||
|
rounding="pill"
|
||||||
|
icon={ShieldCheck}
|
||||||
|
>
|
||||||
{$t('moderation.label')}
|
{$t('moderation.label')}
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
href="/modlog?user={person.person.id}"
|
href="/modlog?user={person.person.id}"
|
||||||
color="success-subtle"
|
color="success-subtle"
|
||||||
|
icon={Newspaper}
|
||||||
>
|
>
|
||||||
<Icon src={Newspaper} size="16" micro />
|
|
||||||
{$t('moderation.modlog.user')}
|
{$t('moderation.modlog.user')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
onclick={() => ban(person.person.banned, person.person)}
|
onclick={() => ban(person.person.banned, person.person)}
|
||||||
|
icon={ShieldExclamation}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon mini size="16" src={ShieldExclamation} />
|
|
||||||
{/snippet}
|
|
||||||
{person.person.banned ? 'Unban' : 'Ban'}
|
{person.person.banned ? 'Unban' : 'Ban'}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
onclick={() => (purgingUser = !purgingUser)}
|
onclick={() => (purgingUser = !purgingUser)}
|
||||||
|
icon={Fire}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon mini size="16" src={Fire} />
|
|
||||||
{/snippet}
|
|
||||||
Purge
|
Purge
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
</Menu>
|
</Menu>
|
||||||
{/if}
|
{/if}
|
||||||
<Menu placement="bottom-end">
|
<Menu placement="bottom-end">
|
||||||
{#snippet target(attachment)}
|
{#snippet target(attachment)}
|
||||||
<Button {@attach attachment} size="custom" class="h-8 w-8" rounding="pill">
|
<Button
|
||||||
{#snippet prefix()}
|
{@attach attachment}
|
||||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
size="custom"
|
||||||
{/snippet}
|
class="h-8 w-8"
|
||||||
</Button>
|
rounding="pill"
|
||||||
|
icon={EllipsisHorizontal}
|
||||||
|
></Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
onclick={() => blockUser(isBlocked(profile.current.user!, person.person.id), person.person.id)}
|
onclick={() =>
|
||||||
|
blockUser(
|
||||||
|
isBlocked(profile.current.user!, person.person.id),
|
||||||
|
person.person.id,
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon mini size="16" src={NoSymbol} />
|
<Icon mini size="16" src={NoSymbol} />
|
||||||
|
|||||||
Reference in new issue
Block a user