refactor: prefer barrel exports
This commit is contained in:
64 files changed
+181
-249
No files matched your search
@@ -20,6 +20,7 @@ export abstract class BaseClient {
|
|||||||
abstract type: ClientType
|
abstract type: ClientType
|
||||||
|
|
||||||
abstract getSite(): Promise<types.GetSiteResponse>
|
abstract getSite(): Promise<types.GetSiteResponse>
|
||||||
|
abstract editSite(form: types.EditSite): Promise<types.SiteResponse>
|
||||||
abstract generateTotpSecret(): Promise<types.GenerateTotpSecretResponse>
|
abstract generateTotpSecret(): Promise<types.GenerateTotpSecretResponse>
|
||||||
abstract listLogins(): Promise<types.LoginToken[]>
|
abstract listLogins(): Promise<types.LoginToken[]>
|
||||||
abstract listAllMedia(form: types.ListMedia): Promise<types.ListMediaResponse>
|
abstract listAllMedia(form: types.ListMedia): Promise<types.ListMediaResponse>
|
||||||
@@ -221,6 +222,7 @@ export abstract class BaseClient {
|
|||||||
abstract uploadImage(
|
abstract uploadImage(
|
||||||
form: types.UploadImage,
|
form: types.UploadImage,
|
||||||
): Promise<types.UploadImageResponse>
|
): Promise<types.UploadImageResponse>
|
||||||
|
abstract deleteImage(form: types.DeleteImage): Promise<boolean>
|
||||||
|
|
||||||
abstract setFlair?(form: types.SetPersonFlair): Promise<types.PersonView>
|
abstract setFlair?(form: types.SetPersonFlair): Promise<types.PersonView>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -476,4 +476,14 @@ export class LemmyClient implements BaseClient {
|
|||||||
): ReturnType<BaseClient['uploadImage']> {
|
): ReturnType<BaseClient['uploadImage']> {
|
||||||
return await this.#client.uploadImage(...params)
|
return await this.#client.uploadImage(...params)
|
||||||
}
|
}
|
||||||
|
async editSite(
|
||||||
|
...params: Parameters<BaseClient['editSite']>
|
||||||
|
): ReturnType<BaseClient['editSite']> {
|
||||||
|
return await this.#client.editSite(...params)
|
||||||
|
}
|
||||||
|
async deleteImage(
|
||||||
|
...params: Parameters<BaseClient['deleteImage']>
|
||||||
|
): ReturnType<BaseClient['deleteImage']> {
|
||||||
|
return await this.#client.deleteImage(...params)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -908,4 +908,11 @@ export class PiefedClient implements BaseClient {
|
|||||||
|
|
||||||
return toPersonView(response.person_view)
|
return toPersonView(response.person_view)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async editSite(): ReturnType<BaseClient['editSite']> {
|
||||||
|
throw new Error('unsupported')
|
||||||
|
}
|
||||||
|
async deleteImage(): ReturnType<BaseClient['deleteImage']> {
|
||||||
|
throw new Error('unsupported')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<script>
|
|
||||||
/**
|
|
||||||
* @typedef {Object} Props
|
|
||||||
* @property {import('svelte').Snippet<[any]>} [children]
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @type {Props & { [key: string]: any }} */
|
|
||||||
let { children, ...rest } = $props()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{@render children?.({ ...rest })}
|
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
disabled={loading}
|
disabled={loading}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={Trash} size="16" mini color="text-red-500" />
|
<Icon src={Trash} size="16" mini class="text-red-500" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,25 +3,25 @@
|
|||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
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'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
|
||||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { getClient, site } from '$lib/client/lemmy.svelte'
|
import { client, site } from '$lib/client/lemmy.svelte'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
import { addSubscription } from '$lib/lemmy/user.js'
|
import { addSubscription } from '$lib/lemmy/user.js'
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
|
Label,
|
||||||
MenuButton,
|
MenuButton,
|
||||||
Switch,
|
Switch,
|
||||||
TextInput,
|
TextInput,
|
||||||
toast,
|
toast,
|
||||||
|
Option,
|
||||||
|
Select,
|
||||||
|
Material,
|
||||||
|
Menu
|
||||||
} from 'mono-svelte'
|
} from 'mono-svelte'
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
|
||||||
import Select from 'mono-svelte/forms/select/Select.svelte'
|
|
||||||
import Material from 'mono-svelte/materials/Material.svelte'
|
|
||||||
import Menu from 'mono-svelte/popover/Menu.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'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/**
|
/**
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = edit
|
const res = edit
|
||||||
? await getClient().editCommunity({
|
? await client().editCommunity({
|
||||||
title: formData.displayName,
|
title: formData.displayName,
|
||||||
description: formData.sidebar,
|
description: formData.sidebar,
|
||||||
nsfw: formData.nsfw,
|
nsfw: formData.nsfw,
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
visibility: formData.visibility,
|
visibility: formData.visibility,
|
||||||
discussion_languages: formData.languages,
|
discussion_languages: formData.languages,
|
||||||
})
|
})
|
||||||
: await getClient().createCommunity({
|
: await client().createCommunity({
|
||||||
name: formData.name,
|
name: formData.name,
|
||||||
title: formData.displayName,
|
title: formData.displayName,
|
||||||
description: formData.sidebar,
|
description: formData.sidebar,
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
class="flex flex-col gap-4 h-full w-full"
|
class="flex flex-col gap-4 h-full w-full"
|
||||||
>
|
>
|
||||||
{#if formtitle}{@render formtitle()}{:else}
|
{#if formtitle}{@render formtitle()}{:else}
|
||||||
<Header>{$t('routes.createCommunity')}</Header>
|
<Header>{$t('form.post.community')}</Header>
|
||||||
{/if}
|
{/if}
|
||||||
<TextInput
|
<TextInput
|
||||||
required
|
required
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
</Select>
|
</Select>
|
||||||
|
|
||||||
<div class="space-y-1">
|
<div class="space-y-1">
|
||||||
<SectionTitle>{$t('form.profile.languages.title')}</SectionTitle>
|
<Label>{$t('form.profile.languages.title')}</Label>
|
||||||
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
||||||
{#if site.data}
|
{#if site.data}
|
||||||
<div class="flex gap-2 flex-wrap flex-row">
|
<div class="flex gap-2 flex-wrap flex-row">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||||
@@ -23,6 +22,7 @@
|
|||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
||||||
|
import { CommunityCard } from '.'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
community: CommunityView
|
community: CommunityView
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export { default as CommunityCard } from './CommunityCard.svelte'
|
||||||
|
export { default as CommunityFlair } from './CommunityFlair.svelte'
|
||||||
|
export { default as CommunityForm } from './CommunityForm.svelte'
|
||||||
|
export { default as CommunityHeader } from './CommunityHeader.svelte'
|
||||||
|
export { default as CommunityItem } from './CommunityItem.svelte'
|
||||||
|
export { default as CommunityLink } from './CommunityLink.svelte'
|
||||||
|
export { default as CommunityTitle } from './CommunityTitle.svelte'
|
||||||
+6
-6
@@ -13,12 +13,12 @@
|
|||||||
ServerStack,
|
ServerStack,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import type { ClassValue, HTMLAttributes } from 'svelte/elements'
|
import type { ClassValue, HTMLAttributes } from 'svelte/elements'
|
||||||
import EndPlaceholder from '../ui/EndPlaceholder.svelte'
|
import EndPlaceholder from '../../ui/EndPlaceholder.svelte'
|
||||||
import Expandable from '../ui/Expandable.svelte'
|
import Expandable from '../../ui/Expandable.svelte'
|
||||||
import LabelStat from '../ui/LabelStat.svelte'
|
import LabelStat from '../../ui/LabelStat.svelte'
|
||||||
import SidebarButton from '../ui/sidebar/SidebarButton.svelte'
|
import SidebarButton from '../../ui/sidebar/SidebarButton.svelte'
|
||||||
import ItemList from './generic/ItemList.svelte'
|
import ItemList from '../generic/ItemList.svelte'
|
||||||
import { optimizeImageURL } from './post/helpers'
|
import { optimizeImageURL } from '../post/helpers'
|
||||||
|
|
||||||
interface Props extends HTMLAttributes<HTMLDivElement> {
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
||||||
site: SiteView
|
site: SiteView
|
||||||
@@ -1,18 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault } from 'svelte/legacy'
|
|
||||||
|
|
||||||
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 { getClient } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { toast } from 'mono-svelte'
|
import { Label, toast, Button, Checkbox, Modal } from 'mono-svelte'
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import { Button, Checkbox, Modal } from 'mono-svelte'
|
|
||||||
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 CommunityLink from '../community/CommunityLink.svelte'
|
|
||||||
import Duration from '$lib/components/form/Duration.svelte'
|
import Duration from '$lib/components/form/Duration.svelte'
|
||||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
|
import { CommunityLink } from '../community'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open?: boolean
|
open?: boolean
|
||||||
@@ -57,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (community) {
|
if (community) {
|
||||||
await getClient().banFromCommunity({
|
await client().banFromCommunity({
|
||||||
ban: !banned,
|
ban: !banned,
|
||||||
community_id: community.id,
|
community_id: community.id,
|
||||||
person_id: item.id,
|
person_id: item.id,
|
||||||
@@ -66,7 +62,7 @@
|
|||||||
expires: date,
|
expires: date,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await getClient().banPerson({
|
await client().banPerson({
|
||||||
ban: !banned,
|
ban: !banned,
|
||||||
person_id: item.id,
|
person_id: item.id,
|
||||||
reason: reason || undefined,
|
reason: reason || undefined,
|
||||||
@@ -99,7 +95,13 @@
|
|||||||
title={banned ? $t('moderation.ban.unbanning') : $t('moderation.ban.banning')}
|
title={banned ? $t('moderation.ban.unbanning') : $t('moderation.ban.banning')}
|
||||||
>
|
>
|
||||||
{#if item}
|
{#if item}
|
||||||
<form class="flex flex-col gap-4" onsubmit={preventDefault(submit)}>
|
<form
|
||||||
|
class="flex flex-col gap-4"
|
||||||
|
onsubmit={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
submit()
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<Avatar url={item.avatar} alt={item.name} width={24} />
|
<Avatar url={item.avatar} alt={item.name} width={24} />
|
||||||
<span class="font-bold">{item.name}</span>
|
<span class="font-bold">{item.name}</span>
|
||||||
@@ -119,10 +121,9 @@
|
|||||||
{$t('moderation.ban.warning')}
|
{$t('moderation.ban.warning')}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
<div>
|
<Label text={$t('moderation.ban.expires')}>
|
||||||
<SectionTitle>{$t('moderation.ban.expires')}</SectionTitle>
|
|
||||||
<Duration bind:value={expires}></Duration>
|
<Duration bind:value={expires}></Duration>
|
||||||
</div>
|
</Label>
|
||||||
{/if}
|
{/if}
|
||||||
<Button submit color="primary" {loading} disabled={loading} size="lg">
|
<Button submit color="primary" {loading} disabled={loading} size="lg">
|
||||||
{$t('form.submit')}
|
{$t('form.submit')}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import type {
|
import type {
|
||||||
|
Comment,
|
||||||
CommentView,
|
CommentView,
|
||||||
Community,
|
Community,
|
||||||
MyUserInfo,
|
MyUserInfo,
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
@@ -70,6 +69,7 @@
|
|||||||
type IconSource,
|
type IconSource,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import Material from 'mono-svelte/materials/Material.svelte'
|
import Material from 'mono-svelte/materials/Material.svelte'
|
||||||
|
import { CommunityLink } from '../community'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
community?: Community
|
community?: Community
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import type { HTMLAttributes } from 'svelte/elements'
|
|
||||||
|
|
||||||
interface Props extends HTMLAttributes<HTMLSpanElement> {
|
|
||||||
small?: boolean
|
|
||||||
class?: string
|
|
||||||
children?: import('svelte').Snippet
|
|
||||||
}
|
|
||||||
|
|
||||||
let { small = false, class: clazz = '', children, ...rest }: Props = $props()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<span {...rest} class="{!small ? 'text-lg' : 'text-xs'} font-medium {clazz}">
|
|
||||||
{@render children?.()}
|
|
||||||
</span>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
interface Props {
|
|
||||||
class?: string
|
|
||||||
children?: import('svelte').Snippet
|
|
||||||
}
|
|
||||||
|
|
||||||
let { class: clazz = '', children }: Props = $props()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<aside
|
|
||||||
class="break-words flex shrink
|
|
||||||
flex-col gap-4 px-6 max-w-full w-full h-full
|
|
||||||
overflow-auto text-sm border-slate-200 dark:border-zinc-800 {clazz}"
|
|
||||||
>
|
|
||||||
{@render children?.()}
|
|
||||||
</aside>
|
|
||||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,6 @@
|
|||||||
|
export { default as Header } from './pages/Header.svelte'
|
||||||
|
export { default as Tabs } from './pages/Tabs.svelte'
|
||||||
|
export { default as CommonList } from './CommonList.svelte'
|
||||||
|
export { default as SearchBar } from './SearchBar.svelte'
|
||||||
|
export { default as Shell } from './Shell.svelte'
|
||||||
|
export { default as Pageination } from './Pageination.svelte'
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
isAdmin,
|
isAdmin,
|
||||||
} from '$lib/components/lemmy/moderation/moderation'
|
} from '$lib/components/lemmy/moderation/moderation'
|
||||||
|
|
||||||
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
import SiteCard from '$lib/components/lemmy/instance/InstanceCard.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { site } from '$lib/client/lemmy.svelte'
|
import { site } from '$lib/client/lemmy.svelte'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import { settings } from '$lib/settings.svelte'
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<label
|
<svelte:element
|
||||||
|
this={text || customText ? 'label' : 'h3'}
|
||||||
{...rest}
|
{...rest}
|
||||||
for={forID}
|
for={forID}
|
||||||
class={['text-sm text-slate-800 dark:text-zinc-200 font-medium', clazz]}
|
class={['text-sm text-slate-800 dark:text-zinc-200 font-medium', clazz]}
|
||||||
@@ -33,4 +34,4 @@
|
|||||||
{@render customText?.()}
|
{@render customText?.()}
|
||||||
{/if}
|
{/if}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</label>
|
</svelte:element>
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
// to allow for loading before promises are finished on the client.
|
|
||||||
|
|
||||||
import { browser } from '$app/environment'
|
|
||||||
|
|
||||||
export const awaitIfServer = async <T>(
|
|
||||||
promise: Promise<T>,
|
|
||||||
): Promise<{
|
|
||||||
data: Promise<T> | T
|
|
||||||
}> => ({ data: browser ? promise : await promise })
|
|
||||||
|
|
||||||
export class ReactiveState<T> {
|
|
||||||
value = $state<T>()!
|
|
||||||
|
|
||||||
constructor(initialValue: T) {
|
|
||||||
this.value = initialValue as NonNullable<T>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,6 +6,7 @@ import { toast } from 'mono-svelte'
|
|||||||
import { t } from './i18n/translations'
|
import { t } from './i18n/translations'
|
||||||
import { errorMessage } from './lemmy/error'
|
import { errorMessage } from './lemmy/error'
|
||||||
import { SvelteURL } from 'svelte/reactivity'
|
import { SvelteURL } from 'svelte/reactivity'
|
||||||
|
import { browser } from '$app/environment'
|
||||||
|
|
||||||
// Despite the name, this will round up
|
// Despite the name, this will round up
|
||||||
// Example: findClosestNumber([8, 16, 32, 64, 128], 76) will return 128
|
// Example: findClosestNumber([8, 16, 32, 64, 128], 76) will return 128
|
||||||
@@ -191,3 +192,17 @@ export function fuzzySearch(text: string, pattern: string): number {
|
|||||||
|
|
||||||
return score
|
return score
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const awaitIfServer = async <T>(
|
||||||
|
promise: Promise<T>,
|
||||||
|
): Promise<{
|
||||||
|
data: Promise<T> | T
|
||||||
|
}> => ({ data: browser ? promise : await promise })
|
||||||
|
|
||||||
|
export class ReactiveState<T> {
|
||||||
|
value = $state<T>()!
|
||||||
|
|
||||||
|
constructor(initialValue: T) {
|
||||||
|
this.value = initialValue as NonNullable<T>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
const FEATURES = {
|
|
||||||
moderatorView: '0.19.0',
|
|
||||||
controversialSort: '0.19.0',
|
|
||||||
scaledSort: '0.19.0',
|
|
||||||
unproxiedImageUpload: '0.19.0',
|
|
||||||
cursorPagination: '0.19.0',
|
|
||||||
newTotp: '0.19.0',
|
|
||||||
blockInstances: '0.19.0',
|
|
||||||
hidePosts: '0.19.4',
|
|
||||||
altText: '0.19.4',
|
|
||||||
customThumbnail: '0.19.4',
|
|
||||||
mediaAndVotes: '0.19.4',
|
|
||||||
distinguishComments: '0.19.4',
|
|
||||||
}
|
|
||||||
|
|
||||||
type Feature = keyof typeof FEATURES
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if a feature is supported by the current version.
|
|
||||||
*/
|
|
||||||
export const feature = (feature: Feature, version: string = '0.0.0'): boolean =>
|
|
||||||
versionIsSupported(version, FEATURES[feature])
|
|
||||||
|
|
||||||
export const MINIMUM_VERSION = '0.19.0'
|
|
||||||
export const MAXIMUM_VERSION = '0.999'
|
|
||||||
|
|
||||||
export const versionIsSupported = (v: string, minimum: string) => {
|
|
||||||
const regex = /^(\d+\.)?(\d+\.)?(\*|\d+)*/i
|
|
||||||
const cur = v.match(regex)
|
|
||||||
const min = minimum.match(regex)
|
|
||||||
|
|
||||||
if (!cur || !min) return false
|
|
||||||
|
|
||||||
const [minMajor, minMinor, minPatch] = min.slice(1, 4).map((i) => Number(i))
|
|
||||||
const [curMajor, curMinor, curPatch] = cur.slice(1, 4).map((i) => Number(i))
|
|
||||||
|
|
||||||
if (curMajor < minMajor) return false
|
|
||||||
else if (curMajor > minMajor) return true
|
|
||||||
|
|
||||||
if (curMinor < minMinor) return false
|
|
||||||
else if (curMinor > minMinor) return true
|
|
||||||
|
|
||||||
if (curPatch < minPatch) return false
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
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 Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
|
||||||
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
import SiteCard from '$lib/components/lemmy/instance/InstanceCard.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'
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||||
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { postFeeds } from '$lib/lemmy/postfeed.svelte.js'
|
import { postFeeds } from '$lib/lemmy/postfeed.svelte.js'
|
||||||
import { settings, SSR_ENABLED } from '$lib/settings.svelte.js'
|
import { settings, SSR_ENABLED } from '$lib/settings.svelte.js'
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { env } from '$env/dynamic/public'
|
import { env } from '$env/dynamic/public'
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { postFeed } from '$lib/lemmy/postfeed.svelte.js'
|
import { postFeed } from '$lib/lemmy/postfeed.svelte.js'
|
||||||
import { ReactiveState, awaitIfServer } from '$lib/promise.svelte.js'
|
import { ReactiveState, awaitIfServer } from '$lib/util.svelte.js'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import { settings } from '$lib/settings.svelte'
|
||||||
import type { ListingType, SortType } from '$lib/client/types'
|
import type { ListingType, SortType } from '$lib/client/types'
|
||||||
import { ChevronDoubleUp } from 'svelte-hero-icons'
|
import { ChevronDoubleUp } from 'svelte-hero-icons'
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { Spinner } from 'mono-svelte'
|
import { Spinner } from 'mono-svelte'
|
||||||
import type { ResolveObjectResponse } from '$lib/client/types'
|
import type { ResolveObjectResponse } from '$lib/client/types'
|
||||||
import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte'
|
|
||||||
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
|
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
|
||||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||||
|
import { CommunityItem } from '$lib/components/lemmy/community'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { Option, Select } from 'mono-svelte'
|
import { Option, Select } from 'mono-svelte'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
import { getClient } from '$lib/client/lemmy.svelte'
|
||||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
import { ReactiveState } from '$lib/util.svelte.js'
|
||||||
|
|
||||||
export async function load({ fetch, url }) {
|
export async function load({ fetch, url }) {
|
||||||
if (!profile) return
|
if (!profile) return
|
||||||
|
|||||||
@@ -1,18 +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 ApplicationDenyModal from '$lib/components/lemmy/modal/ApplicationDenyModal.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
|
||||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
|
||||||
import { publishedToDate } from '$lib/components/util/date'
|
|
||||||
import { t } from '$lib/i18n/translations'
|
|
||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import type {
|
import type {
|
||||||
ApproveRegistrationApplication,
|
ApproveRegistrationApplication,
|
||||||
RegistrationApplicationView,
|
RegistrationApplicationView,
|
||||||
} from '$lib/client/types'
|
} from '$lib/client/types'
|
||||||
import { Button, Material, toast } from 'mono-svelte'
|
import ApplicationDenyModal from '$lib/components/lemmy/modal/ApplicationDenyModal.svelte'
|
||||||
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
|
import { publishedToDate } from '$lib/components/util/date'
|
||||||
|
import { t } from '$lib/i18n/translations'
|
||||||
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
|
import { Button, Label, Material, toast } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
Check,
|
Check,
|
||||||
Icon,
|
Icon,
|
||||||
@@ -57,7 +56,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await getClient().approveRegistrationApplication(
|
await client().approveRegistrationApplication(
|
||||||
registrationApplicationAnswer,
|
registrationApplicationAnswer,
|
||||||
)
|
)
|
||||||
toast({
|
toast({
|
||||||
@@ -128,12 +127,12 @@
|
|||||||
class={accepted ? 'text-green-400' : 'text-red-400'}
|
class={accepted ? 'text-green-400' : 'text-red-400'}
|
||||||
/>
|
/>
|
||||||
<UserLink avatar user={application.admin} />
|
<UserLink avatar user={application.admin} />
|
||||||
<SectionTitle>
|
<Label>
|
||||||
{accepted
|
{accepted
|
||||||
? $t('routes.admin.applications.approved')
|
? $t('routes.admin.applications.approved')
|
||||||
: $t('routes.admin.applications.denied')}
|
: $t('routes.admin.applications.denied')}
|
||||||
</SectionTitle>
|
</Label>
|
||||||
<SectionTitle>:</SectionTitle>
|
<Label>:</Label>
|
||||||
</div>
|
</div>
|
||||||
<p>{application.registration_application.deny_reason}</p>
|
<p>{application.registration_application.deny_reason}</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -147,11 +146,11 @@
|
|||||||
class={accepted ? 'text-green-400' : 'text-red-400'}
|
class={accepted ? 'text-green-400' : 'text-red-400'}
|
||||||
/>
|
/>
|
||||||
<UserLink avatar user={application.admin} />
|
<UserLink avatar user={application.admin} />
|
||||||
<SectionTitle>
|
<Label>
|
||||||
{accepted
|
{accepted
|
||||||
? $t('routes.admin.applications.approved')
|
? $t('routes.admin.applications.approved')
|
||||||
: $t('routes.admin.applications.denied')}
|
: $t('routes.admin.applications.denied')}
|
||||||
</SectionTitle>
|
</Label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md:ml-auto"></div>
|
<div class="md:ml-auto"></div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<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 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'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { getClient, site } from '$lib/client/lemmy.svelte'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error.js'
|
import { errorMessage } from '$lib/lemmy/error.js'
|
||||||
import type { EditSite } from '$lib/client/types'
|
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
|
Label,
|
||||||
Material,
|
Material,
|
||||||
Menu,
|
Menu,
|
||||||
MenuButton,
|
MenuButton,
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
saving = true
|
saving = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await getClient().editSite({
|
await client().editSite({
|
||||||
...formData,
|
...formData,
|
||||||
})
|
})
|
||||||
toast({
|
toast({
|
||||||
@@ -182,7 +182,7 @@
|
|||||||
</Switch>
|
</Switch>
|
||||||
|
|
||||||
<div class="space-y-1">
|
<div class="space-y-1">
|
||||||
<SectionTitle>{$t('form.profile.languages.title')}</SectionTitle>
|
<Label>{$t('form.profile.languages.title')}</Label>
|
||||||
<p>{$t('form.profile.languages.description')}</p>
|
<p>{$t('form.profile.languages.description')}</p>
|
||||||
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
||||||
{#if site.data}
|
{#if site.data}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
import { getClient } from '$lib/client/lemmy.svelte'
|
||||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
import { ReactiveState } from '$lib/util.svelte.js'
|
||||||
|
|
||||||
export async function load({ fetch }) {
|
export async function load({ fetch }) {
|
||||||
const instances = await getClient(undefined, fetch).getFederatedInstances()
|
const instances = await getClient(undefined, fetch).getFederatedInstances()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/state'
|
import { page } from '$app/state'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { flip } from 'svelte/animate'
|
import { flip } from 'svelte/animate'
|
||||||
import PictrsImage from '$lib/components/lemmy/PictrsImage.svelte'
|
import PictrsImage from '$lib/components/lemmy/PictrsImage.svelte'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
import { ReactiveState } from '$lib/util.svelte.js'
|
||||||
|
|
||||||
export async function load({ fetch, url }) {
|
export async function load({ fetch, url }) {
|
||||||
const { jwt } = profile.current
|
const { jwt } = profile.current
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
import { getClient } from '$lib/client/lemmy.svelte'
|
||||||
import { ReactiveState } from '$lib/promise.svelte'
|
import { ReactiveState } from '$lib/util.svelte'
|
||||||
|
|
||||||
export async function load({ fetch, params }) {
|
export async function load({ fetch, params }) {
|
||||||
const community = await getClient(undefined, fetch).getCommunity({
|
const community = await getClient(undefined, fetch).getCommunity({
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
||||||
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.svelte'
|
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { site } from '$lib/client/lemmy.svelte'
|
import { site } from '$lib/client/lemmy.svelte'
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import CommunityForm from '$lib/components/lemmy/community/CommunityForm.svelte'
|
import {
|
||||||
import CommunityTitle from '$lib/components/lemmy/community/CommunityTitle.svelte'
|
CommunityForm,
|
||||||
|
CommunityTitle,
|
||||||
|
} from '$lib/components/lemmy/community'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
|
||||||
let { data } = $props()
|
let { data } = $props()
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { navigating, page } from '$app/state'
|
import { navigating, page } from '$app/state'
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte'
|
|
||||||
import Location from '$lib/components/lemmy/dropdowns/Location.svelte'
|
import Location from '$lib/components/lemmy/dropdowns/Location.svelte'
|
||||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||||
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
||||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte'
|
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte'
|
||||||
@@ -16,8 +15,9 @@
|
|||||||
import { QuestionMarkCircle, ServerStack } from 'svelte-hero-icons'
|
import { QuestionMarkCircle, ServerStack } from 'svelte-hero-icons'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
import SearchBar from '../search/SearchBar.svelte'
|
import SearchBar from '../../lib/components/ui/layout/SearchBar.svelte'
|
||||||
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
||||||
|
import { CommunityItem } from '$lib/components/lemmy/community'
|
||||||
|
|
||||||
let { data } = $props()
|
let { data } = $props()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte.js'
|
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte.js'
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { ReactiveState } from '$lib/promise.svelte'
|
import { ReactiveState } from '$lib/util.svelte'
|
||||||
import { type ListingType, type SortType } from '$lib/client/types'
|
import { type ListingType, type SortType } from '$lib/client/types'
|
||||||
|
|
||||||
export async function load({ url, fetch }) {
|
export async function load({ url, fetch }) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import { notifications, profile } from '$lib/auth.svelte.js'
|
import { notifications, profile } from '$lib/auth.svelte.js'
|
||||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
import { getClient } from '$lib/client/lemmy.svelte'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
generalizePersonMention,
|
generalizePersonMention,
|
||||||
generalizePrivateMessage,
|
generalizePrivateMessage,
|
||||||
} from '$lib/lemmy/inbox.js'
|
} from '$lib/lemmy/inbox.js'
|
||||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
import { ReactiveState } from '$lib/util.svelte.js'
|
||||||
import { error } from '@sveltejs/kit'
|
import { error } from '@sveltejs/kit'
|
||||||
|
|
||||||
type InboxFeedType = 'replies' | 'mentions' | 'messages' | 'all'
|
type InboxFeedType = 'replies' | 'mentions' | 'messages' | 'all'
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import { notifications, profile } from '$lib/auth.svelte.js'
|
import { notifications, profile } from '$lib/auth.svelte.js'
|
||||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||||
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
||||||
import PrivateMessageModal from '$lib/components/lemmy/modal/PrivateMessageModal.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'
|
||||||
@@ -20,7 +19,6 @@
|
|||||||
|
|
||||||
let { item = $bindable() }: Props = $props()
|
let { item = $bindable() }: Props = $props()
|
||||||
|
|
||||||
let replying = $state(false)
|
|
||||||
let loading = $state(false)
|
let loading = $state(false)
|
||||||
|
|
||||||
async function markAsRead(isRead: boolean) {
|
async function markAsRead(isRead: boolean) {
|
||||||
@@ -58,10 +56,6 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if replying && item.type == 'private_message'}
|
|
||||||
<PrivateMessageModal bind:open={replying} user={item.item.creator} />
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<Expandable open icon={false}>
|
<Expandable open icon={false}>
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<div class="flex flex-row gap-2 items-center w-full">
|
<div class="flex flex-row gap-2 items-center w-full">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
||||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { awaitIfServer } from '$lib/promise.svelte.js'
|
import { awaitIfServer } from '$lib/util.svelte.js'
|
||||||
|
|
||||||
export async function load({ fetch, url }) {
|
export async function load({ fetch, url }) {
|
||||||
const page = Number(url.searchParams.get('page') || '1')
|
const page = Number(url.searchParams.get('page') || '1')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
import { ReactiveState } from '$lib/util.svelte.js'
|
||||||
|
|
||||||
export async function load({ fetch, params }) {
|
export async function load({ fetch, params }) {
|
||||||
const creator = Number(params.user_id)
|
const creator = Number(params.user_id)
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/state'
|
import { page } from '$app/state'
|
||||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
|
||||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import ProgressBar from '$lib/components/ui/ProgressBar.svelte'
|
import ProgressBar from '$lib/components/ui/ProgressBar.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
@@ -16,6 +15,7 @@
|
|||||||
import { Check, Funnel, Icon, ShieldCheck, XMark } from 'svelte-hero-icons'
|
import { Check, Funnel, Icon, ShieldCheck, XMark } from 'svelte-hero-icons'
|
||||||
import Report from './Report.svelte'
|
import Report from './Report.svelte'
|
||||||
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
||||||
|
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||||
|
|
||||||
let { data = $bindable() } = $props()
|
let { data = $bindable() } = $props()
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
generalizePrivateMessageReport,
|
generalizePrivateMessageReport,
|
||||||
type ReportView,
|
type ReportView,
|
||||||
} from '$lib/lemmy/report.js'
|
} from '$lib/lemmy/report.js'
|
||||||
import { ReactiveState } from '$lib/promise.svelte'
|
import { ReactiveState } from '$lib/util.svelte'
|
||||||
import { error } from '@sveltejs/kit'
|
import { error } from '@sveltejs/kit'
|
||||||
|
|
||||||
type ReportListType = 'unread' | 'all'
|
type ReportListType = 'unread' | 'all'
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
<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/CommentItem.svelte'
|
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||||
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
import PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
||||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import SectionTitle from '$lib/components/ui/SectionTitle.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 { errorMessage } from '$lib/lemmy/error'
|
||||||
import type { ReportView } from '$lib/lemmy/report.js'
|
import type { ReportView } from '$lib/lemmy/report.js'
|
||||||
import { Badge, Button, 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, Icon } from 'svelte-hero-icons'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -204,9 +203,9 @@
|
|||||||
|
|
||||||
<div class="flex flex-row gap-4 items-center flex-wrap">
|
<div class="flex flex-row gap-4 items-center flex-wrap">
|
||||||
<div>
|
<div>
|
||||||
<SectionTitle small>
|
<Label>
|
||||||
{$t('routes.moderation.reason')}
|
{$t('routes.moderation.reason')}
|
||||||
</SectionTitle>
|
</Label>
|
||||||
<p>
|
<p>
|
||||||
{item.reason}
|
{item.reason}
|
||||||
</p>
|
</p>
|
||||||
@@ -222,9 +221,9 @@
|
|||||||
<div class="flex-1"></div>
|
<div class="flex-1"></div>
|
||||||
{#if item.resolver}
|
{#if item.resolver}
|
||||||
<div>
|
<div>
|
||||||
<SectionTitle small>
|
<Label>
|
||||||
{$t('routes.moderation.resolvedBy')}
|
{$t('routes.moderation.resolvedBy')}
|
||||||
</SectionTitle>
|
</Label>
|
||||||
<UserLink avatar user={item.resolver} />
|
<UserLink avatar user={item.resolver} />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte'
|
import { CommunityItem } from '$lib/components/lemmy/community'
|
||||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import { isAdmin } from '$lib/components/lemmy/moderation/moderation.js'
|
import { isAdmin } from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
||||||
import UserAutocomplete from '$lib/components/lemmy/user/UserAutocomplete.svelte'
|
import UserAutocomplete from '$lib/components/lemmy/user/UserAutocomplete.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
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 { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/util.svelte.js'
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import Spinner from 'mono-svelte/loader/Spinner.svelte'
|
import Spinner from 'mono-svelte/loader/Spinner.svelte'
|
||||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
import { postLink } from '$lib/components/lemmy/post/helpers'
|
import { postLink } from '$lib/components/lemmy/post/helpers'
|
||||||
|
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||||
|
|
||||||
let { data = $bindable() } = $props()
|
let { data = $bindable() } = $props()
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Link from '$lib/components/input/Link.svelte'
|
import Link from '$lib/components/input/Link.svelte'
|
||||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import { Material } from 'mono-svelte'
|
import { Label, Material } from 'mono-svelte'
|
||||||
import type { ModLog } from '../+page.js'
|
import type { ModLog } from '../+page.js'
|
||||||
import ModlogAction from '../ModlogAction.svelte'
|
import ModlogAction from '../ModlogAction.svelte'
|
||||||
|
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
item: ModLog
|
item: ModLog
|
||||||
@@ -20,18 +19,18 @@
|
|||||||
{#if item.community}
|
{#if item.community}
|
||||||
<CommunityLink community={item.community} avatar showInstance />
|
<CommunityLink community={item.community} avatar showInstance />
|
||||||
{/if}
|
{/if}
|
||||||
<SectionTitle class="font-normal">
|
<Label class="font-normal">
|
||||||
<RelativeDate date={new Date(item.timestamp)} />
|
<RelativeDate date={new Date(item.timestamp)} />
|
||||||
</SectionTitle>
|
</Label>
|
||||||
</div>
|
</div>
|
||||||
{#if item.actionName}
|
{#if item.actionName}
|
||||||
<SectionTitle class="mt-2">Action</SectionTitle>
|
<Label class="mt-2">Action</Label>
|
||||||
<span class="text-base">
|
<span class="text-base">
|
||||||
<ModlogAction action={item.actionName} />
|
<ModlogAction action={item.actionName} />
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if item.moderator}
|
{#if item.moderator}
|
||||||
<SectionTitle class="mt-2">Moderator</SectionTitle>
|
<Label class="mt-2">Moderator</Label>
|
||||||
<span
|
<span
|
||||||
class="flex items-center gap-1 text-green-600 dark:text-green-400 font-medium"
|
class="flex items-center gap-1 text-green-600 dark:text-green-400 font-medium"
|
||||||
>
|
>
|
||||||
@@ -39,11 +38,11 @@
|
|||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if item.moderatee}
|
{#if item.moderatee}
|
||||||
<SectionTitle class="mt-2">User</SectionTitle>
|
<Label class="mt-2">User</Label>
|
||||||
<UserLink showInstance={true} avatar user={item.moderatee} />
|
<UserLink showInstance={true} avatar user={item.moderatee} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if item.link || item.content}
|
{#if item.link || item.content}
|
||||||
<SectionTitle class="mt-2">Item</SectionTitle>
|
<Label class="mt-2">Item</Label>
|
||||||
{#if item.link && item.content}
|
{#if item.link && item.content}
|
||||||
<Link href={item.link} highlight>
|
<Link href={item.link} highlight>
|
||||||
{item.content}
|
{item.content}
|
||||||
@@ -55,7 +54,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{#if item.reason}
|
{#if item.reason}
|
||||||
<SectionTitle class="mt-2">Reason</SectionTitle>
|
<Label class="mt-2">Reason</Label>
|
||||||
<p>{item.reason}</p>
|
<p>{item.reason}</p>
|
||||||
{/if}
|
{/if}
|
||||||
</Material>
|
</Material>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Link from '$lib/components/input/Link.svelte'
|
import Link from '$lib/components/input/Link.svelte'
|
||||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import type { ModLog } from '../+page.js'
|
import type { ModLog } from '../+page.js'
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { resumables } from '$lib/lemmy/item.js'
|
import { resumables } from '$lib/lemmy/item.js'
|
||||||
import { postFeeds } from '$lib/lemmy/postfeed.svelte'
|
import { postFeeds } from '$lib/lemmy/postfeed.svelte'
|
||||||
import { ReactiveState } from '$lib/promise.svelte'
|
import { ReactiveState } from '$lib/util.svelte'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
import { isImage } from '$lib/ui/image.js'
|
import { isImage } from '$lib/ui/image.js'
|
||||||
import { Button, toast } from 'mono-svelte'
|
import { Button, toast } from 'mono-svelte'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { profile } from '$lib/auth.svelte.js'
|
|||||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { postFeeds } from '$lib/lemmy/postfeed.svelte.js'
|
import { postFeeds } from '$lib/lemmy/postfeed.svelte.js'
|
||||||
import { ReactiveState, awaitIfServer } from '$lib/promise.svelte.js'
|
import { ReactiveState, awaitIfServer } from '$lib/util.svelte.js'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import { settings } from '$lib/settings.svelte'
|
||||||
import { redirect } from '@sveltejs/kit'
|
import { redirect } from '@sveltejs/kit'
|
||||||
import type {
|
import type {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||||
import Entity from '$lib/components/ui/Entity.svelte'
|
import Entity from '$lib/components/ui/Entity.svelte'
|
||||||
@@ -8,7 +7,6 @@
|
|||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
|
||||||
import type {
|
import type {
|
||||||
CommunityBlockView,
|
CommunityBlockView,
|
||||||
InstanceBlockView,
|
InstanceBlockView,
|
||||||
@@ -17,6 +15,8 @@
|
|||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { Check, Icon, XMark } from 'svelte-hero-icons'
|
import { Check, Icon, XMark } from 'svelte-hero-icons'
|
||||||
import type { PageData } from './$types.js'
|
import type { PageData } from './$types.js'
|
||||||
|
import { client } from '$lib/client/lemmy.svelte.js'
|
||||||
|
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
// sveltekit doesn't feel like making types work right now
|
// sveltekit doesn't feel like making types work right now
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
// hack to get reactivity working
|
// hack to get reactivity working
|
||||||
data.person_blocks = data.person_blocks
|
data.person_blocks = data.person_blocks
|
||||||
|
|
||||||
await getClient().blockPerson({
|
await client().blockPerson({
|
||||||
block: false,
|
block: false,
|
||||||
person_id: item.target.id,
|
person_id: item.target.id,
|
||||||
})
|
})
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
// hack to get reactivity working
|
// hack to get reactivity working
|
||||||
data.community_blocks = data.community_blocks
|
data.community_blocks = data.community_blocks
|
||||||
|
|
||||||
await getClient().blockCommunity({
|
await client().blockCommunity({
|
||||||
block: false,
|
block: false,
|
||||||
community_id: item.community.id,
|
community_id: item.community.id,
|
||||||
})
|
})
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
)
|
)
|
||||||
data.my_user.instance_blocks = data.my_user.instance_blocks
|
data.my_user.instance_blocks = data.my_user.instance_blocks
|
||||||
|
|
||||||
await getClient().blockInstance({
|
await client().blockInstance({
|
||||||
block: false,
|
block: false,
|
||||||
instance_id: item.instance.id,
|
instance_id: item.instance.id,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
|
import { getClient, site } from '$lib/client/lemmy.svelte'
|
||||||
|
import type { SaveUserSettings } 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'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { getClient, site } from '$lib/client/lemmy.svelte'
|
|
||||||
import type { SaveUserSettings } from '$lib/client/types'
|
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
|
Label,
|
||||||
Material,
|
Material,
|
||||||
Menu,
|
Menu,
|
||||||
MenuButton,
|
MenuButton,
|
||||||
@@ -112,9 +112,9 @@
|
|||||||
{$t('form.profile.showRead')}
|
{$t('form.profile.showRead')}
|
||||||
</Switch>
|
</Switch>
|
||||||
<div class="space-y-1">
|
<div class="space-y-1">
|
||||||
<SectionTitle id="languages">
|
<Label id="languages">
|
||||||
{$t('form.profile.languages.title')}
|
{$t('form.profile.languages.title')}
|
||||||
</SectionTitle>
|
</Label>
|
||||||
<p>{$t('form.profile.languages.description')}</p>
|
<p>{$t('form.profile.languages.description')}</p>
|
||||||
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
||||||
{#if site.data && formData.discussion_languages}
|
{#if site.data && formData.discussion_languages}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/state'
|
import { page } from '$app/state'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { flip } from 'svelte/animate'
|
import { flip } from 'svelte/animate'
|
||||||
import { expoInOut } from 'svelte/easing'
|
import { expoInOut } from 'svelte/easing'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
import { ReactiveState } from '$lib/util.svelte.js'
|
||||||
|
|
||||||
export async function load({ fetch, url }) {
|
export async function load({ fetch, url }) {
|
||||||
const { jwt } = profile.current
|
const { jwt } = profile.current
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ReactiveState } from '$lib/promise.svelte'
|
import { ReactiveState } from '$lib/util.svelte'
|
||||||
import UserPage from '../../u/[name]/+page.svelte'
|
import UserPage from '../../u/[name]/+page.svelte'
|
||||||
let { data } = $props()
|
let { data } = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
||||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/util.svelte.js'
|
||||||
|
|||||||
@@ -4,16 +4,14 @@
|
|||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
||||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||||
import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte'
|
import { CommunityItem } from '$lib/components/lemmy/community'
|
||||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
|
||||||
import PostItem from '$lib/components/lemmy/post/PostItem.svelte'
|
import PostItem from '$lib/components/lemmy/post/PostItem.svelte'
|
||||||
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
|
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
||||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
import { CommonList, Header, SearchBar } from '$lib/components/ui/layout'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import {
|
import {
|
||||||
isCommentView,
|
isCommentView,
|
||||||
@@ -22,8 +20,7 @@
|
|||||||
isUser,
|
isUser,
|
||||||
} from '$lib/lemmy/item.js'
|
} from '$lib/lemmy/item.js'
|
||||||
import { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/util.svelte.js'
|
||||||
import { Button, Select, TextLoader } from 'mono-svelte'
|
import { Button, Option, Select, TextLoader } from 'mono-svelte'
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
|
||||||
import {
|
import {
|
||||||
AdjustmentsHorizontal,
|
AdjustmentsHorizontal,
|
||||||
ChevronDoubleDown,
|
ChevronDoubleDown,
|
||||||
@@ -33,7 +30,6 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { fly, slide } from 'svelte/transition'
|
import { fly, slide } from 'svelte/transition'
|
||||||
import SearchBar from './SearchBar.svelte'
|
|
||||||
|
|
||||||
let { data } = $props()
|
let { data } = $props()
|
||||||
|
|
||||||
@@ -163,7 +159,7 @@
|
|||||||
<CommunityItem community={object.community} showCounts={false} />
|
<CommunityItem community={object.community} showCounts={false} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if object.post}
|
{#if object.post}
|
||||||
<Post post={object.post} />
|
<PostItem post={object.post} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if object.comment}
|
{#if object.comment}
|
||||||
<CommentItem comment={object.comment} />
|
<CommentItem comment={object.comment} />
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { profile } from '$lib/auth.svelte'
|
|||||||
import { client, getClient } from '$lib/client/lemmy.svelte'
|
import { client, getClient } from '$lib/client/lemmy.svelte'
|
||||||
import { PiefedClient } from '$lib/client/piefed/piefed.js'
|
import { PiefedClient } from '$lib/client/piefed/piefed.js'
|
||||||
import { getItemPublished } from '$lib/lemmy/item.js'
|
import { getItemPublished } from '$lib/lemmy/item.js'
|
||||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
import { ReactiveState } from '$lib/util.svelte.js'
|
||||||
import type { ListingType, SearchType, SortType } from '$lib/client/types'
|
import type { ListingType, SearchType, SortType } from '$lib/client/types'
|
||||||
|
|
||||||
export async function load({ url, fetch }) {
|
export async function load({ url, fetch }) {
|
||||||
|
|||||||
@@ -3,24 +3,25 @@
|
|||||||
|
|
||||||
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 { getClient } from '$lib/client/lemmy.svelte'
|
||||||
|
import type { GetCaptchaResponse } from '$lib/client/types'
|
||||||
import ErrorContainer, {
|
import ErrorContainer, {
|
||||||
clearErrorScope,
|
clearErrorScope,
|
||||||
pushError,
|
pushError,
|
||||||
} from '$lib/components/error/ErrorContainer.svelte'
|
} from '$lib/components/error/ErrorContainer.svelte'
|
||||||
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
import SiteCard from '$lib/components/lemmy/instance/InstanceCard.svelte'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import { getClient } from '$lib/client/lemmy.svelte'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error.js'
|
import { errorMessage } from '$lib/lemmy/error.js'
|
||||||
import type { GetCaptchaResponse } from '$lib/client/types'
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
|
Label,
|
||||||
Material,
|
Material,
|
||||||
Spinner,
|
Spinner,
|
||||||
TextInput,
|
TextInput,
|
||||||
@@ -36,7 +37,6 @@
|
|||||||
QuestionMarkCircle,
|
QuestionMarkCircle,
|
||||||
XCircle,
|
XCircle,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
|
||||||
|
|
||||||
let { data } = $props()
|
let { data } = $props()
|
||||||
|
|
||||||
@@ -230,9 +230,7 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if captchaRequired}
|
{#if captchaRequired}
|
||||||
<SectionTitle class="block -mb-3 font-medium text-sm">
|
<Label class="block -mb-3 font-medium text-sm">Captcha</Label>
|
||||||
Captcha
|
|
||||||
</SectionTitle>
|
|
||||||
<Material rounding="2xl">
|
<Material rounding="2xl">
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
{#await getCaptcha()}
|
{#await getCaptcha()}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { client } from '$lib/client/lemmy.svelte'
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
import { getItemPublished } from '$lib/lemmy/item.js'
|
import { getItemPublished } from '$lib/lemmy/item.js'
|
||||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
import { ReactiveState } from '$lib/util.svelte.js'
|
||||||
import type { SortType } from '$lib/client/types'
|
import type { SortType } from '$lib/client/types'
|
||||||
|
|
||||||
export async function load({ params, url, fetch }) {
|
export async function load({ params, url, fetch }) {
|
||||||
|
|||||||
Reference in new issue
Block a user