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 getSite(): Promise<types.GetSiteResponse>
|
||||
abstract editSite(form: types.EditSite): Promise<types.SiteResponse>
|
||||
abstract generateTotpSecret(): Promise<types.GenerateTotpSecretResponse>
|
||||
abstract listLogins(): Promise<types.LoginToken[]>
|
||||
abstract listAllMedia(form: types.ListMedia): Promise<types.ListMediaResponse>
|
||||
@@ -221,6 +222,7 @@ export abstract class BaseClient {
|
||||
abstract uploadImage(
|
||||
form: types.UploadImage,
|
||||
): Promise<types.UploadImageResponse>
|
||||
abstract deleteImage(form: types.DeleteImage): Promise<boolean>
|
||||
|
||||
abstract setFlair?(form: types.SetPersonFlair): Promise<types.PersonView>
|
||||
}
|
||||
|
||||
@@ -476,4 +476,14 @@ export class LemmyClient implements BaseClient {
|
||||
): ReturnType<BaseClient['uploadImage']> {
|
||||
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)
|
||||
}
|
||||
|
||||
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}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Trash} size="16" mini color="text-red-500" />
|
||||
<Icon src={Trash} size="16" mini class="text-red-500" />
|
||||
{/snippet}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import ImageInputUpload from '$lib/components/form/ImageInputUpload.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 { getClient, site } from '$lib/client/lemmy.svelte'
|
||||
import { client, site } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Label,
|
||||
MenuButton,
|
||||
Switch,
|
||||
TextInput,
|
||||
toast,
|
||||
Option,
|
||||
Select,
|
||||
Material,
|
||||
Menu
|
||||
} 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 { Header } from '$lib/components/ui/layout'
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
try {
|
||||
const res = edit
|
||||
? await getClient().editCommunity({
|
||||
? await client().editCommunity({
|
||||
title: formData.displayName,
|
||||
description: formData.sidebar,
|
||||
nsfw: formData.nsfw,
|
||||
@@ -79,7 +79,7 @@
|
||||
visibility: formData.visibility,
|
||||
discussion_languages: formData.languages,
|
||||
})
|
||||
: await getClient().createCommunity({
|
||||
: await client().createCommunity({
|
||||
name: formData.name,
|
||||
title: formData.displayName,
|
||||
description: formData.sidebar,
|
||||
@@ -146,7 +146,7 @@
|
||||
class="flex flex-col gap-4 h-full w-full"
|
||||
>
|
||||
{#if formtitle}{@render formtitle()}{:else}
|
||||
<Header>{$t('routes.createCommunity')}</Header>
|
||||
<Header>{$t('form.post.community')}</Header>
|
||||
{/if}
|
||||
<TextInput
|
||||
required
|
||||
@@ -188,7 +188,7 @@
|
||||
</Select>
|
||||
|
||||
<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">
|
||||
{#if site.data}
|
||||
<div class="flex gap-2 flex-wrap flex-row">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
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 LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||
@@ -23,6 +22,7 @@
|
||||
Trash,
|
||||
} from 'svelte-hero-icons'
|
||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
||||
import { CommunityCard } from '.'
|
||||
|
||||
interface Props {
|
||||
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,
|
||||
} from 'svelte-hero-icons'
|
||||
import type { ClassValue, HTMLAttributes } from 'svelte/elements'
|
||||
import EndPlaceholder from '../ui/EndPlaceholder.svelte'
|
||||
import Expandable from '../ui/Expandable.svelte'
|
||||
import LabelStat from '../ui/LabelStat.svelte'
|
||||
import SidebarButton from '../ui/sidebar/SidebarButton.svelte'
|
||||
import ItemList from './generic/ItemList.svelte'
|
||||
import { optimizeImageURL } from './post/helpers'
|
||||
import EndPlaceholder from '../../ui/EndPlaceholder.svelte'
|
||||
import Expandable from '../../ui/Expandable.svelte'
|
||||
import LabelStat from '../../ui/LabelStat.svelte'
|
||||
import SidebarButton from '../../ui/sidebar/SidebarButton.svelte'
|
||||
import ItemList from '../generic/ItemList.svelte'
|
||||
import { optimizeImageURL } from '../post/helpers'
|
||||
|
||||
interface Props extends HTMLAttributes<HTMLDivElement> {
|
||||
site: SiteView
|
||||
@@ -1,18 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { preventDefault } from 'svelte/legacy'
|
||||
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import type { Community, Person } from '$lib/client/types'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { Label, toast, Button, Checkbox, Modal } from 'mono-svelte'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { Button, Checkbox, Modal } from 'mono-svelte'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import CommunityLink from '../community/CommunityLink.svelte'
|
||||
import Duration from '$lib/components/form/Duration.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { CommunityLink } from '../community'
|
||||
|
||||
interface Props {
|
||||
open?: boolean
|
||||
@@ -57,7 +53,7 @@
|
||||
}
|
||||
|
||||
if (community) {
|
||||
await getClient().banFromCommunity({
|
||||
await client().banFromCommunity({
|
||||
ban: !banned,
|
||||
community_id: community.id,
|
||||
person_id: item.id,
|
||||
@@ -66,7 +62,7 @@
|
||||
expires: date,
|
||||
})
|
||||
} else {
|
||||
await getClient().banPerson({
|
||||
await client().banPerson({
|
||||
ban: !banned,
|
||||
person_id: item.id,
|
||||
reason: reason || undefined,
|
||||
@@ -99,7 +95,13 @@
|
||||
title={banned ? $t('moderation.ban.unbanning') : $t('moderation.ban.banning')}
|
||||
>
|
||||
{#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">
|
||||
<Avatar url={item.avatar} alt={item.name} width={24} />
|
||||
<span class="font-bold">{item.name}</span>
|
||||
@@ -119,10 +121,9 @@
|
||||
{$t('moderation.ban.warning')}
|
||||
{/snippet}
|
||||
</Checkbox>
|
||||
<div>
|
||||
<SectionTitle>{$t('moderation.ban.expires')}</SectionTitle>
|
||||
<Label text={$t('moderation.ban.expires')}>
|
||||
<Duration bind:value={expires}></Duration>
|
||||
</div>
|
||||
</Label>
|
||||
{/if}
|
||||
<Button submit color="primary" {loading} disabled={loading} size="lg">
|
||||
{$t('form.submit')}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import type {
|
||||
Comment,
|
||||
CommentView,
|
||||
Community,
|
||||
MyUserInfo,
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
@@ -70,6 +69,7 @@
|
||||
type IconSource,
|
||||
} from 'svelte-hero-icons'
|
||||
import Material from 'mono-svelte/materials/Material.svelte'
|
||||
import { CommunityLink } from '../community'
|
||||
|
||||
interface Props {
|
||||
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,
|
||||
} 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 { site } from '$lib/client/lemmy.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<label
|
||||
<svelte:element
|
||||
this={text || customText ? 'label' : 'h3'}
|
||||
{...rest}
|
||||
for={forID}
|
||||
class={['text-sm text-slate-800 dark:text-zinc-200 font-medium', clazz]}
|
||||
@@ -33,4 +34,4 @@
|
||||
{@render customText?.()}
|
||||
{/if}
|
||||
{@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 { errorMessage } from './lemmy/error'
|
||||
import { SvelteURL } from 'svelte/reactivity'
|
||||
import { browser } from '$app/environment'
|
||||
|
||||
// Despite the name, this will round up
|
||||
// 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
|
||||
}
|
||||
|
||||
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 { navigating, page } from '$app/state'
|
||||
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 Shell from '$lib/components/ui/layout/Shell.svelte'
|
||||
import Navbar from '$lib/components/ui/navbar/Navbar.svelte'
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
import Skeleton from '$lib/components/ui/generic/Skeleton.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 { postFeeds } from '$lib/lemmy/postfeed.svelte.js'
|
||||
import { settings, SSR_ENABLED } from '$lib/settings.svelte.js'
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { env } from '$env/dynamic/public'
|
||||
import { t } from '$lib/i18n/translations.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 type { ListingType, SortType } from '$lib/client/types'
|
||||
import { ChevronDoubleUp } from 'svelte-hero-icons'
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { Spinner } from 'mono-svelte'
|
||||
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 Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||
import { CommunityItem } from '$lib/components/lemmy/community'
|
||||
|
||||
interface Props {
|
||||
data: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
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 { t } from '$lib/i18n/translations'
|
||||
import { Option, Select } from 'mono-svelte'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { profile } from '$lib/auth.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 }) {
|
||||
if (!profile) return
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
<script lang="ts">
|
||||
import { notifications, profile } from '$lib/auth.svelte.js'
|
||||
import ApplicationDenyModal from '$lib/components/lemmy/modal/ApplicationDenyModal.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 { client } from '$lib/client/lemmy.svelte'
|
||||
import type {
|
||||
ApproveRegistrationApplication,
|
||||
RegistrationApplicationView,
|
||||
} 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 {
|
||||
Check,
|
||||
Icon,
|
||||
@@ -57,7 +56,7 @@
|
||||
}
|
||||
|
||||
try {
|
||||
await getClient().approveRegistrationApplication(
|
||||
await client().approveRegistrationApplication(
|
||||
registrationApplicationAnswer,
|
||||
)
|
||||
toast({
|
||||
@@ -128,12 +127,12 @@
|
||||
class={accepted ? 'text-green-400' : 'text-red-400'}
|
||||
/>
|
||||
<UserLink avatar user={application.admin} />
|
||||
<SectionTitle>
|
||||
<Label>
|
||||
{accepted
|
||||
? $t('routes.admin.applications.approved')
|
||||
: $t('routes.admin.applications.denied')}
|
||||
</SectionTitle>
|
||||
<SectionTitle>:</SectionTitle>
|
||||
</Label>
|
||||
<Label>:</Label>
|
||||
</div>
|
||||
<p>{application.registration_application.deny_reason}</p>
|
||||
</div>
|
||||
@@ -147,11 +146,11 @@
|
||||
class={accepted ? 'text-green-400' : 'text-red-400'}
|
||||
/>
|
||||
<UserLink avatar user={application.admin} />
|
||||
<SectionTitle>
|
||||
<Label>
|
||||
{accepted
|
||||
? $t('routes.admin.applications.approved')
|
||||
: $t('routes.admin.applications.denied')}
|
||||
</SectionTitle>
|
||||
</Label>
|
||||
</div>
|
||||
<div class="md:ml-auto"></div>
|
||||
{/if}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<script lang="ts">
|
||||
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 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.js'
|
||||
import { getClient, site } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error.js'
|
||||
import type { EditSite } from '$lib/client/types'
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Label,
|
||||
Material,
|
||||
Menu,
|
||||
MenuButton,
|
||||
@@ -46,7 +46,7 @@
|
||||
saving = true
|
||||
|
||||
try {
|
||||
await getClient().editSite({
|
||||
await client().editSite({
|
||||
...formData,
|
||||
})
|
||||
toast({
|
||||
@@ -182,7 +182,7 @@
|
||||
</Switch>
|
||||
|
||||
<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>
|
||||
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
||||
{#if site.data}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 }) {
|
||||
const instances = await getClient(undefined, fetch).getFederatedInstances()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state'
|
||||
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 { flip } from 'svelte/animate'
|
||||
import PictrsImage from '$lib/components/lemmy/PictrsImage.svelte'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { profile } from '$lib/auth.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 }) {
|
||||
const { jwt } = profile.current
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.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 }) {
|
||||
const community = await getClient(undefined, fetch).getCommunity({
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
||||
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.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 { t } from '$lib/i18n/translations.js'
|
||||
import { site } from '$lib/client/lemmy.svelte'
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<script lang="ts">
|
||||
import CommunityForm from '$lib/components/lemmy/community/CommunityForm.svelte'
|
||||
import CommunityTitle from '$lib/components/lemmy/community/CommunityTitle.svelte'
|
||||
import {
|
||||
CommunityForm,
|
||||
CommunityTitle,
|
||||
} from '$lib/components/lemmy/community'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
|
||||
let { data } = $props()
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { navigating, page } from '$app/state'
|
||||
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 Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.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 { t } from '$lib/i18n/translations.js'
|
||||
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte'
|
||||
@@ -16,8 +15,9 @@
|
||||
import { QuestionMarkCircle, ServerStack } from 'svelte-hero-icons'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
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 { CommunityItem } from '$lib/components/lemmy/community'
|
||||
|
||||
let { data } = $props()
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte.js'
|
||||
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'
|
||||
|
||||
export async function load({ url, fetch }) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { notifications, profile } from '$lib/auth.svelte.js'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.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 { t } from '$lib/i18n/translations'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
generalizePersonMention,
|
||||
generalizePrivateMessage,
|
||||
} from '$lib/lemmy/inbox.js'
|
||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
||||
import { ReactiveState } from '$lib/util.svelte.js'
|
||||
import { error } from '@sveltejs/kit'
|
||||
|
||||
type InboxFeedType = 'replies' | 'mentions' | 'messages' | 'all'
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { notifications, profile } from '$lib/auth.svelte.js'
|
||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.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 Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||
@@ -20,7 +19,6 @@
|
||||
|
||||
let { item = $bindable() }: Props = $props()
|
||||
|
||||
let replying = $state(false)
|
||||
let loading = $state(false)
|
||||
|
||||
async function markAsRead(isRead: boolean) {
|
||||
@@ -58,10 +56,6 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if replying && item.type == 'private_message'}
|
||||
<PrivateMessageModal bind:open={replying} user={item.item.creator} />
|
||||
{/if}
|
||||
|
||||
<Expandable open icon={false}>
|
||||
{#snippet title()}
|
||||
<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 CommonList from '$lib/components/ui/layout/CommonList.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 { publishedToDate } from '$lib/components/util/date.js'
|
||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 }) {
|
||||
const page = Number(url.searchParams.get('page') || '1')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 }) {
|
||||
const creator = Number(params.user_id)
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/state'
|
||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.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 ProgressBar from '$lib/components/ui/ProgressBar.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
@@ -16,6 +15,7 @@
|
||||
import { Check, Funnel, Icon, ShieldCheck, XMark } from 'svelte-hero-icons'
|
||||
import Report from './Report.svelte'
|
||||
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
||||
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||
|
||||
let { data = $bindable() } = $props()
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
generalizePrivateMessageReport,
|
||||
type ReportView,
|
||||
} from '$lib/lemmy/report.js'
|
||||
import { ReactiveState } from '$lib/promise.svelte'
|
||||
import { ReactiveState } from '$lib/util.svelte'
|
||||
import { error } from '@sveltejs/kit'
|
||||
|
||||
type ReportListType = 'unread' | 'all'
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
<script lang="ts">
|
||||
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 PrivateMessage from '$lib/components/lemmy/inbox/PrivateMessage.svelte'
|
||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
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'
|
||||
|
||||
interface Props {
|
||||
@@ -204,9 +203,9 @@
|
||||
|
||||
<div class="flex flex-row gap-4 items-center flex-wrap">
|
||||
<div>
|
||||
<SectionTitle small>
|
||||
<Label>
|
||||
{$t('routes.moderation.reason')}
|
||||
</SectionTitle>
|
||||
</Label>
|
||||
<p>
|
||||
{item.reason}
|
||||
</p>
|
||||
@@ -222,9 +221,9 @@
|
||||
<div class="flex-1"></div>
|
||||
{#if item.resolver}
|
||||
<div>
|
||||
<SectionTitle small>
|
||||
<Label>
|
||||
{$t('routes.moderation.resolvedBy')}
|
||||
</SectionTitle>
|
||||
</Label>
|
||||
<UserLink avatar user={item.resolver} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
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 Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { isAdmin } from '$lib/components/lemmy/moderation/moderation.js'
|
||||
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.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 { settings } from '$lib/settings.svelte.js'
|
||||
import { searchParam } from '$lib/util.svelte.js'
|
||||
@@ -26,9 +26,9 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { client } from '$lib/client/lemmy.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 { postLink } from '$lib/components/lemmy/post/helpers'
|
||||
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||
|
||||
let { data = $bindable() } = $props()
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<script lang="ts">
|
||||
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 SectionTitle from '$lib/components/ui/SectionTitle.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 ModlogAction from '../ModlogAction.svelte'
|
||||
import { CommunityLink } from '$lib/components/lemmy/community'
|
||||
|
||||
interface Props {
|
||||
item: ModLog
|
||||
@@ -20,18 +19,18 @@
|
||||
{#if item.community}
|
||||
<CommunityLink community={item.community} avatar showInstance />
|
||||
{/if}
|
||||
<SectionTitle class="font-normal">
|
||||
<Label class="font-normal">
|
||||
<RelativeDate date={new Date(item.timestamp)} />
|
||||
</SectionTitle>
|
||||
</Label>
|
||||
</div>
|
||||
{#if item.actionName}
|
||||
<SectionTitle class="mt-2">Action</SectionTitle>
|
||||
<Label class="mt-2">Action</Label>
|
||||
<span class="text-base">
|
||||
<ModlogAction action={item.actionName} />
|
||||
</span>
|
||||
{/if}
|
||||
{#if item.moderator}
|
||||
<SectionTitle class="mt-2">Moderator</SectionTitle>
|
||||
<Label class="mt-2">Moderator</Label>
|
||||
<span
|
||||
class="flex items-center gap-1 text-green-600 dark:text-green-400 font-medium"
|
||||
>
|
||||
@@ -39,11 +38,11 @@
|
||||
</span>
|
||||
{/if}
|
||||
{#if item.moderatee}
|
||||
<SectionTitle class="mt-2">User</SectionTitle>
|
||||
<Label class="mt-2">User</Label>
|
||||
<UserLink showInstance={true} avatar user={item.moderatee} />
|
||||
{/if}
|
||||
{#if item.link || item.content}
|
||||
<SectionTitle class="mt-2">Item</SectionTitle>
|
||||
<Label class="mt-2">Item</Label>
|
||||
{#if item.link && item.content}
|
||||
<Link href={item.link} highlight>
|
||||
{item.content}
|
||||
@@ -55,7 +54,7 @@
|
||||
{/if}
|
||||
{/if}
|
||||
{#if item.reason}
|
||||
<SectionTitle class="mt-2">Reason</SectionTitle>
|
||||
<Label class="mt-2">Reason</Label>
|
||||
<p>{item.reason}</p>
|
||||
{/if}
|
||||
</Material>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
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 RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||
import type { ModLog } from '../+page.js'
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { resumables } from '$lib/lemmy/item.js'
|
||||
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 { isImage } from '$lib/ui/image.js'
|
||||
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 { client } from '$lib/client/lemmy.svelte'
|
||||
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 { redirect } from '@sveltejs/kit'
|
||||
import type {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
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 EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
import Entity from '$lib/components/ui/Entity.svelte'
|
||||
@@ -8,7 +7,6 @@
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import type {
|
||||
CommunityBlockView,
|
||||
InstanceBlockView,
|
||||
@@ -17,6 +15,8 @@
|
||||
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'
|
||||
|
||||
interface Props {
|
||||
// sveltekit doesn't feel like making types work right now
|
||||
@@ -39,7 +39,7 @@
|
||||
// hack to get reactivity working
|
||||
data.person_blocks = data.person_blocks
|
||||
|
||||
await getClient().blockPerson({
|
||||
await client().blockPerson({
|
||||
block: false,
|
||||
person_id: item.target.id,
|
||||
})
|
||||
@@ -58,7 +58,7 @@
|
||||
// hack to get reactivity working
|
||||
data.community_blocks = data.community_blocks
|
||||
|
||||
await getClient().blockCommunity({
|
||||
await client().blockCommunity({
|
||||
block: false,
|
||||
community_id: item.community.id,
|
||||
})
|
||||
@@ -76,7 +76,7 @@
|
||||
)
|
||||
data.my_user.instance_blocks = data.my_user.instance_blocks
|
||||
|
||||
await getClient().blockInstance({
|
||||
await client().blockInstance({
|
||||
block: false,
|
||||
instance_id: item.instance.id,
|
||||
})
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<script lang="ts">
|
||||
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 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.js'
|
||||
import { getClient, site } from '$lib/client/lemmy.svelte'
|
||||
import type { SaveUserSettings } from '$lib/client/types'
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Label,
|
||||
Material,
|
||||
Menu,
|
||||
MenuButton,
|
||||
@@ -112,9 +112,9 @@
|
||||
{$t('form.profile.showRead')}
|
||||
</Switch>
|
||||
<div class="space-y-1">
|
||||
<SectionTitle id="languages">
|
||||
<Label id="languages">
|
||||
{$t('form.profile.languages.title')}
|
||||
</SectionTitle>
|
||||
</Label>
|
||||
<p>{$t('form.profile.languages.description')}</p>
|
||||
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
||||
{#if site.data && formData.discussion_languages}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state'
|
||||
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 { flip } from 'svelte/animate'
|
||||
import { expoInOut } from 'svelte/easing'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { profile } from '$lib/auth.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 }) {
|
||||
const { jwt } = profile.current
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { ReactiveState } from '$lib/promise.svelte'
|
||||
import { ReactiveState } from '$lib/util.svelte'
|
||||
import UserPage from '../../u/[name]/+page.svelte'
|
||||
let { data } = $props()
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.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 { t } from '$lib/i18n/translations.js'
|
||||
import { searchParam } from '$lib/util.svelte.js'
|
||||
|
||||
@@ -4,16 +4,14 @@
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.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 Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import PostItem from '$lib/components/lemmy/post/PostItem.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 Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import { CommonList, Header, SearchBar } from '$lib/components/ui/layout'
|
||||
import Pageination from '$lib/components/ui/layout/Pageination.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import {
|
||||
isCommentView,
|
||||
@@ -22,8 +20,7 @@
|
||||
isUser,
|
||||
} from '$lib/lemmy/item.js'
|
||||
import { searchParam } from '$lib/util.svelte.js'
|
||||
import { Button, Select, TextLoader } from 'mono-svelte'
|
||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||
import { Button, Option, Select, TextLoader } from 'mono-svelte'
|
||||
import {
|
||||
AdjustmentsHorizontal,
|
||||
ChevronDoubleDown,
|
||||
@@ -33,7 +30,6 @@
|
||||
} from 'svelte-hero-icons'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
import { fly, slide } from 'svelte/transition'
|
||||
import SearchBar from './SearchBar.svelte'
|
||||
|
||||
let { data } = $props()
|
||||
|
||||
@@ -163,7 +159,7 @@
|
||||
<CommunityItem community={object.community} showCounts={false} />
|
||||
{/if}
|
||||
{#if object.post}
|
||||
<Post post={object.post} />
|
||||
<PostItem post={object.post} />
|
||||
{/if}
|
||||
{#if 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 { PiefedClient } from '$lib/client/piefed/piefed.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'
|
||||
|
||||
export async function load({ url, fetch }) {
|
||||
|
||||
@@ -3,24 +3,25 @@
|
||||
|
||||
import { goto } from '$app/navigation'
|
||||
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, {
|
||||
clearErrorScope,
|
||||
pushError,
|
||||
} 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 MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.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 { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error.js'
|
||||
import type { GetCaptchaResponse } from '$lib/client/types'
|
||||
import {
|
||||
Button,
|
||||
Checkbox,
|
||||
Label,
|
||||
Material,
|
||||
Spinner,
|
||||
TextInput,
|
||||
@@ -36,7 +37,6 @@
|
||||
QuestionMarkCircle,
|
||||
XCircle,
|
||||
} from 'svelte-hero-icons'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
|
||||
let { data } = $props()
|
||||
|
||||
@@ -230,9 +230,7 @@
|
||||
/>
|
||||
{/if}
|
||||
{#if captchaRequired}
|
||||
<SectionTitle class="block -mb-3 font-medium text-sm">
|
||||
Captcha
|
||||
</SectionTitle>
|
||||
<Label class="block -mb-3 font-medium text-sm">Captcha</Label>
|
||||
<Material rounding="2xl">
|
||||
<div class="flex flex-col gap-4">
|
||||
{#await getCaptcha()}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.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 { publishedToDate } from '$lib/components/util/date.js'
|
||||
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
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'
|
||||
|
||||
export async function load({ params, url, fetch }) {
|
||||
|
||||
Reference in new issue
Block a user