refactor: manually write like 3,000 import statements because i must test my willpower
This commit is contained in:
274 files changed
+1222
-1702
No files matched your search
Vendored
-2
@@ -1,7 +1,5 @@
|
|||||||
// See https://kit.svelte.dev/docs/types#app
|
// See https://kit.svelte.dev/docs/types#app
|
||||||
|
|
||||||
import type { Action } from '$comp/ui/navbar/commands/actions.svelte'
|
|
||||||
|
|
||||||
// for information about these interfaces
|
// for information about these interfaces
|
||||||
declare global {
|
declare global {
|
||||||
namespace App {
|
namespace App {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { profile } from '$lib/app/auth.svelte'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
|
import { DEFAULT_INSTANCE_URL } from '$lib/app/instance.svelte'
|
||||||
import { instanceToURL } from '$lib/util.svelte'
|
import { instanceToURL } from '$lib/app/util.svelte'
|
||||||
import { error } from '@sveltejs/kit'
|
import { error } from '@sveltejs/kit'
|
||||||
import { type GetSiteResponse } from '$lib/client/types'
|
import { BaseClient, DEFAULT_CLIENT_TYPE, type ClientType } from './base'
|
||||||
import { LemmyClient } from './lemmy/adapter'
|
import { LemmyClient } from './lemmy/adapter'
|
||||||
import { PiefedClient } from './piefed/adapter'
|
import { PiefedClient } from './piefed/adapter'
|
||||||
import { DEFAULT_CLIENT_TYPE, type ClientType, BaseClient } from './base'
|
import type { GetSiteResponse } from './types'
|
||||||
|
|
||||||
class SiteData {
|
class SiteData {
|
||||||
#data = $state<GetSiteResponse>()
|
#data = $state<GetSiteResponse>()
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { LemmyHttp } from 'lemmy-js-client'
|
|
||||||
import type { BaseClient, ClientType } from '../base'
|
import type { BaseClient, ClientType } from '../base'
|
||||||
import { fromGetPosts, toListingType } from './rewrite'
|
import { fromGetPosts, toListingType } from './rewrite'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as lemmy from 'lemmy-js-client'
|
|
||||||
import type { GetPosts, ListingType } from '../types'
|
import type { GetPosts, ListingType } from '../types'
|
||||||
|
import * as lemmy from '../types'
|
||||||
|
|
||||||
export function fromGetPosts(getPosts: GetPosts): lemmy.GetPosts {
|
export function fromGetPosts(getPosts: GetPosts): lemmy.GetPosts {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import createClient from 'openapi-fetch'
|
import createClient from 'openapi-fetch'
|
||||||
import type {
|
import {
|
||||||
BaseClient,
|
BaseClient,
|
||||||
ClientType,
|
type ClientType,
|
||||||
NullableFnArg,
|
type NullableFnArg,
|
||||||
NullableFnReturn,
|
type NullableFnReturn,
|
||||||
} from '../base'
|
} from '../base'
|
||||||
|
import type { SubscribedType } from '../types'
|
||||||
import {
|
import {
|
||||||
fromCreateComment,
|
fromCreateComment,
|
||||||
fromCreatePost,
|
fromCreatePost,
|
||||||
@@ -33,7 +34,6 @@ import {
|
|||||||
toTopicView,
|
toTopicView,
|
||||||
} from './rewrite'
|
} from './rewrite'
|
||||||
import type { paths } from './schema'
|
import type { paths } from './schema'
|
||||||
import type { SubscribedType } from '../types'
|
|
||||||
|
|
||||||
export class PiefedClient implements BaseClient {
|
export class PiefedClient implements BaseClient {
|
||||||
type: ClientType = { name: 'piefed', baseUrl: '/api/alpha' }
|
type: ClientType = { name: 'piefed', baseUrl: '/api/alpha' }
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
import { Post } from '$lib/feature/post'
|
||||||
|
import { Search } from 'mono-svelte'
|
||||||
import type {
|
import type {
|
||||||
Comment,
|
|
||||||
CommentReplyView,
|
CommentReplyView,
|
||||||
CommentSortType,
|
CommentSortType,
|
||||||
CommentView,
|
CommentView,
|
||||||
@@ -18,10 +19,8 @@ import type {
|
|||||||
Person,
|
Person,
|
||||||
PersonMentionView,
|
PersonMentionView,
|
||||||
PersonView,
|
PersonView,
|
||||||
Post,
|
|
||||||
PostView,
|
PostView,
|
||||||
PrivateMessageView,
|
PrivateMessageView,
|
||||||
Search,
|
|
||||||
SortType,
|
SortType,
|
||||||
SubscribedType,
|
SubscribedType,
|
||||||
TopicView,
|
TopicView,
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { env } from '$env/dynamic/public'
|
import { env } from '$env/dynamic/public'
|
||||||
import { amModOfAny, isAdmin } from '$comp/lemmy/moderation/moderation.js'
|
import { DEFAULT_CLIENT_TYPE, type ClientType } from '$lib/api/base'
|
||||||
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
|
|
||||||
import { client, getClient, site } from '$lib/api/client.svelte'
|
import { client, getClient, site } from '$lib/api/client.svelte'
|
||||||
import { instanceToURL, moveItem } from '$lib/util.svelte'
|
import type { Community, GetSiteResponse, MyUserInfo } from '$lib/api/types'
|
||||||
|
import { amModOfAny, isAdmin } from '$lib/feature/moderation/moderation'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
import { toast } from 'mono-svelte'
|
import { toast } from 'mono-svelte'
|
||||||
import { writable } from 'svelte/store'
|
import { writable } from 'svelte/store'
|
||||||
import { t } from './i18n'
|
|
||||||
import { errorMessage } from './error'
|
import { errorMessage } from './error'
|
||||||
import { publishedToDate } from '../ui/util/date'
|
import { t } from './i18n'
|
||||||
import type { Community, GetSiteResponse, MyUserInfo } from '../api/types'
|
import { DEFAULT_INSTANCE_URL } from './instance.svelte'
|
||||||
import { DEFAULT_CLIENT_TYPE, type ClientType } from '../api/base'
|
import { instanceToURL, moveItem } from './util.svelte'
|
||||||
|
|
||||||
function getFromStorage<T>(key: string): T | undefined {
|
function getFromStorage<T>(key: string): T | undefined {
|
||||||
if (typeof localStorage == 'undefined') return undefined
|
if (typeof localStorage == 'undefined') return undefined
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { t } from '$lib/app/i18n/translations'
|
|
||||||
|
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
export function errorMessage(error: any, instance?: string): string {
|
export function errorMessage(error: any, instance?: string): string {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import i18n, { type Config, type Parser } from 'sveltekit-i18n'
|
import { default as i18n, type Config, type Parser } from 'sveltekit-i18n'
|
||||||
|
|
||||||
const config: Config = {
|
const config: Config = {
|
||||||
loaders: [
|
loaders: [
|
||||||
|
|||||||
@@ -1,7 +1,33 @@
|
|||||||
<script lang="ts" module>
|
<script lang="ts" module>
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
import { linkify, subSupscriptExtension } from './renderers/plugins.js'
|
import { setContext } from 'svelte'
|
||||||
import containerExtension from './renderers/spoiler/spoiler.js'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
|
import MdTree from './MdTree.svelte'
|
||||||
|
import MdCode from './renderers/MdCode.svelte'
|
||||||
|
import MdHeading from './renderers/MdHeading.svelte'
|
||||||
|
import MdHr from './renderers/MdHr.svelte'
|
||||||
|
import MdHtml from './renderers/MdHtml.svelte'
|
||||||
|
import MdImage from './renderers/MdImage.svelte'
|
||||||
|
import MdLink from './renderers/MdLink.svelte'
|
||||||
|
import MdList from './renderers/MdList.svelte'
|
||||||
|
import MdListItem from './renderers/MdListItem.svelte'
|
||||||
|
import MdParagraph from './renderers/MdParagraph.svelte'
|
||||||
|
import MdQuote from './renderers/MdQuote.svelte'
|
||||||
|
import MdSpoiler from './renderers/MdSpoiler.svelte'
|
||||||
|
import MdSubscript from './renderers/MdSubscript.svelte'
|
||||||
|
import MdSuperscript from './renderers/MdSuperscript.svelte'
|
||||||
|
import MdText from './renderers/MdText.svelte'
|
||||||
|
import { linkify, subSupscriptExtension } from './renderers/plugins'
|
||||||
|
import containerExtension from './renderers/spoiler/spoiler'
|
||||||
|
import MdCodespan from './renderers/subtext/MdCodespan.svelte'
|
||||||
|
import MdDel from './renderers/subtext/MdDel.svelte'
|
||||||
|
import MdEm from './renderers/subtext/MdEm.svelte'
|
||||||
|
import MdStrong from './renderers/subtext/MdStrong.svelte'
|
||||||
|
import MdTable from './renderers/table/MdTable.svelte'
|
||||||
|
import MdTableBody from './renderers/table/MdTableBody.svelte'
|
||||||
|
import MdTableCell from './renderers/table/MdTableCell.svelte'
|
||||||
|
import MdTableHead from './renderers/table/MdTableHead.svelte'
|
||||||
|
import MdTableRow from './renderers/table/MdTableRow.svelte'
|
||||||
|
|
||||||
marked.setOptions({
|
marked.setOptions({
|
||||||
gfm: true,
|
gfm: true,
|
||||||
@@ -10,7 +36,6 @@
|
|||||||
|
|
||||||
marked.use(linkify, {
|
marked.use(linkify, {
|
||||||
extensions: [
|
extensions: [
|
||||||
// @ts-expect-error hell with marked
|
|
||||||
containerExtension((params: any) => {
|
containerExtension((params: any) => {
|
||||||
if (params.type == 'spoiler') {
|
if (params.type == 'spoiler') {
|
||||||
return {
|
return {
|
||||||
@@ -22,7 +47,6 @@
|
|||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}),
|
}),
|
||||||
// @ts-expect-error hell with marked
|
|
||||||
subSupscriptExtension((params: any) => {
|
subSupscriptExtension((params: any) => {
|
||||||
if (params.type == 'subscript') {
|
if (params.type == 'subscript') {
|
||||||
return {
|
return {
|
||||||
@@ -87,33 +111,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { setContext } from 'svelte'
|
|
||||||
import type { ClassValue } from 'svelte/elements'
|
|
||||||
import MdTree from './MdTree.svelte'
|
|
||||||
import MdEm from './renderers/subtext/MdEm.svelte'
|
|
||||||
import MdHeading from './renderers/MdHeading.svelte'
|
|
||||||
import MdImage from './renderers/MdImage.svelte'
|
|
||||||
import MdLink from './renderers/MdLink.svelte'
|
|
||||||
import MdQuote from './renderers/MdQuote.svelte'
|
|
||||||
import MdHr from './renderers/MdHr.svelte'
|
|
||||||
import MdHtml from './renderers/MdHtml.svelte'
|
|
||||||
import MdCode from './renderers/MdCode.svelte'
|
|
||||||
import MdList from './renderers/MdList.svelte'
|
|
||||||
import MdSpoiler from './renderers/MdSpoiler.svelte'
|
|
||||||
import MdTable from './renderers/table/MdTable.svelte'
|
|
||||||
import MdTableBody from './renderers/table/MdTableBody.svelte'
|
|
||||||
import MdTableCell from './renderers/table/MdTableCell.svelte'
|
|
||||||
import MdTableHead from './renderers/table/MdTableHead.svelte'
|
|
||||||
import MdTableRow from './renderers/table/MdTableRow.svelte'
|
|
||||||
import MdParagraph from './renderers/MdParagraph.svelte'
|
|
||||||
import MdListItem from './renderers/MdListItem.svelte'
|
|
||||||
import MdSubscript from './renderers/MdSubscript.svelte'
|
|
||||||
import MdSuperscript from './renderers/MdSuperscript.svelte'
|
|
||||||
import MdText from './renderers/MdText.svelte'
|
|
||||||
import MdStrong from './renderers/subtext/MdStrong.svelte'
|
|
||||||
import MdDel from './renderers/subtext/MdDel.svelte'
|
|
||||||
import MdCodespan from './renderers/subtext/MdCodespan.svelte'
|
|
||||||
|
|
||||||
interface RendererOptions {
|
interface RendererOptions {
|
||||||
autoloadImages: boolean
|
autoloadImages: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import MultiSelect from '$comp/input/Switch.svelte'
|
import ImageAttachForm from '$lib/ui/form/ImageAttachForm.svelte'
|
||||||
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
import MultiSelect from '$lib/ui/form/Switch.svelte'
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { Button, Label, Modal, TextArea } from 'mono-svelte'
|
import { Button, Label, Modal, TextArea } from 'mono-svelte'
|
||||||
import type { TextAreaProps } from 'mono-svelte/forms/TextArea.svelte'
|
import type { TextAreaProps } from 'mono-svelte/forms/TextArea.svelte'
|
||||||
import { tick } from 'svelte'
|
import { tick } from 'svelte'
|
||||||
@@ -16,9 +15,10 @@
|
|||||||
ListBullet,
|
ListBullet,
|
||||||
Photo,
|
Photo,
|
||||||
Strikethrough,
|
Strikethrough,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
import ImageAttachForm from '../form/ImageAttachForm.svelte'
|
import { t } from '../i18n'
|
||||||
|
import Markdown from './Markdown.svelte'
|
||||||
|
|
||||||
let textArea: HTMLTextAreaElement | undefined = $state()
|
let textArea: HTMLTextAreaElement | undefined = $state()
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Tokens } from 'marked'
|
import type { Tokens } from 'marked'
|
||||||
import type { Renderer } from './Markdown.svelte'
|
import type { Renderer } from './Markdown.svelte'
|
||||||
|
|
||||||
import Self from './MdTree.svelte'
|
import Self from './MdTree.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { Button, Material, toast } from 'mono-svelte'
|
import { Button, Material, toast } from 'mono-svelte'
|
||||||
import { Icon, ClipboardDocument } from 'svelte-hero-icons'
|
import { ClipboardDocument, Icon } from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
raw: string
|
raw: string
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
import {
|
import {
|
||||||
iframeType,
|
iframeType,
|
||||||
mediaType,
|
mediaType,
|
||||||
optimizeImageURL,
|
optimizeImageURL,
|
||||||
PostIframe,
|
PostIframe,
|
||||||
} from '$comp/lemmy/post'
|
} from '$lib/feature/post'
|
||||||
import { showImage } from '$lib/ui/generic/ExpandableImage.svelte'
|
import { showImage } from '$lib/ui/generic/ExpandableImage.svelte'
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { getContext } from 'svelte'
|
import { getContext } from 'svelte'
|
||||||
import { ArrowDownTray, Icon } from 'svelte-hero-icons'
|
import { ArrowDownTray, Icon } from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
let loaded: boolean = $state(
|
let loaded: boolean = $state(
|
||||||
(getContext('options') as { autoloadImages: boolean })?.autoloadImages ??
|
(getContext('options') as { autoloadImages: boolean })?.autoloadImages ??
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { photonify } from './plugins.js'
|
import { photonify } from './plugins'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
href?: string
|
href?: string
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Expandable from 'mono-svelte/disclosure/Expandable.svelte'
|
import { Expandable } from 'mono-svelte'
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts" generics="T">
|
<script lang="ts" generics="T">
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import { Expandable } from 'mono-svelte'
|
||||||
import { debounce } from 'mono-svelte/util/time'
|
import { debounce } from 'mono-svelte/util/time'
|
||||||
import { onDestroy, onMount, untrack, type Snippet } from 'svelte'
|
import { type Snippet, onDestroy, onMount, untrack } from 'svelte'
|
||||||
import type { HTMLAttributes } from 'svelte/elements'
|
import type { HTMLAttributes } from 'svelte/elements'
|
||||||
import { innerHeight } from 'svelte/reactivity/window'
|
import { innerHeight } from 'svelte/reactivity/window'
|
||||||
import Expandable from '../../ui/shared/disclosure/Expandable.svelte'
|
import { settings } from '../settings.svelte'
|
||||||
|
|
||||||
interface Props extends HTMLAttributes<HTMLDivElement> {
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
||||||
items: T[]
|
items: T[]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import type { CommunityView } from '$lib/client/types'
|
import type { CommunityView } from '$lib/api/types'
|
||||||
|
|
||||||
interface SessionStorage {
|
interface SessionStorage {
|
||||||
lastSeenCommunity?: CommunityView
|
lastSeenCommunity?: CommunityView
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { CommentSortType, ListingType, SortType } from '$lib/client/types'
|
|
||||||
import { env } from '$env/dynamic/public'
|
|
||||||
import { locale } from './i18n'
|
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
|
import { env } from '$env/dynamic/public'
|
||||||
|
import type { CommentSortType, ListingType, SortType } from '$lib/api/types'
|
||||||
|
import { locale } from './i18n'
|
||||||
|
|
||||||
export type View = 'cozy' | 'compact'
|
export type View = 'cozy' | 'compact'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
import { browser } from '$app/environment'
|
|
||||||
import { env } from '$env/dynamic/public'
|
|
||||||
import { getDefaultTheme, presets } from './presets'
|
|
||||||
|
|
||||||
type ColorScheme = 'system' | 'light' | 'dark'
|
type ColorScheme = 'system' | 'light' | 'dark'
|
||||||
|
|
||||||
export interface ThemeData {
|
export interface ThemeData {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
|
import type { Community, Person } from '$lib/api/types'
|
||||||
import { SvelteURL } from 'svelte/reactivity'
|
import { SvelteURL } from 'svelte/reactivity'
|
||||||
import { t } from './i18n'
|
import { t } from './i18n'
|
||||||
import type { Community, Person } from '../api/types'
|
|
||||||
|
|
||||||
// Despite the name, this will round up
|
// Despite the name, this will round up
|
||||||
|
// This is because I do not care
|
||||||
// Example: findClosestNumber([8, 16, 32, 64, 128], 76) will return 128
|
// Example: findClosestNumber([8, 16, 32, 64, 128], 76) will return 128
|
||||||
export const findClosestNumber = (numbers: number[], target: number): number =>
|
export const findClosestNumber = (numbers: number[], target: number): number =>
|
||||||
numbers.reduce((prev, curr) =>
|
numbers.reduce((prev, curr) =>
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/state'
|
import { page } from '$app/state'
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
import { getClient } from '$lib/api/client.svelte'
|
||||||
import UserLink from '$comp/lemmy/user/UserLink.svelte'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
||||||
import { publishedToDate } from '$comp/util/date.js'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
|
import { Button, Modal, toast } from 'mono-svelte'
|
||||||
import RelativeDate, {
|
import RelativeDate, {
|
||||||
formatRelativeDate,
|
formatRelativeDate,
|
||||||
} from '$comp/util/RelativeDate.svelte'
|
} from 'mono-svelte/util/RelativeDate.svelte'
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { getClient } from '$lib/api/client.svelte'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { settings } from '$lib/settings.svelte'
|
|
||||||
import { Button, Modal, toast } from 'mono-svelte'
|
|
||||||
import {
|
import {
|
||||||
Bookmark,
|
Bookmark,
|
||||||
Icon,
|
Icon,
|
||||||
@@ -21,13 +20,14 @@
|
|||||||
Plus,
|
Plus,
|
||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
import { slide } from 'svelte/transition'
|
import { slide } from 'svelte/transition'
|
||||||
import type { CommentNodeI } from './comments.svelte'
|
import UserLink from '../user/UserLink.svelte'
|
||||||
import CommentForm from './CommentForm.svelte'
|
|
||||||
import CommentActions from './CommentActions.svelte'
|
import CommentActions from './CommentActions.svelte'
|
||||||
|
import CommentForm from './CommentForm.svelte'
|
||||||
|
import type { CommentNodeI } from './comments.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: CommentNodeI
|
node: CommentNodeI
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import type { CommentView } from '$lib/api/types'
|
import type { CommentView } from '$lib/api/types'
|
||||||
import CommentModerationMenu from '$comp/lemmy/moderation/CommentModerationMenu.svelte'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import { amMod, isAdmin, report } from '$comp/lemmy/moderation/moderation.js'
|
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { deleteItem, save } from '$lib/lemmy/contentview.js'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import { settings } from '$lib/settings.svelte'
|
|
||||||
import { Button, Menu, MenuButton } from 'mono-svelte'
|
import { Button, Menu, MenuButton } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
Bookmark,
|
Bookmark,
|
||||||
@@ -16,7 +13,10 @@
|
|||||||
PencilSquare,
|
PencilSquare,
|
||||||
Share,
|
Share,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
|
import { deleteItem, save } from '../legacy/contentview'
|
||||||
|
import CommentModerationMenu from '../moderation/CommentModerationMenu.svelte'
|
||||||
|
import { amMod, isAdmin, report } from '../moderation/moderation'
|
||||||
import CommentVote from './CommentVote.svelte'
|
import CommentVote from './CommentVote.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
import { client, site } from '$lib/api/client.svelte'
|
||||||
|
import type { CommentResponse } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
||||||
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
||||||
import { t } from '$lib/app/i18n'
|
import { placeholders } from '$lib/app/util.svelte'
|
||||||
import { client, site } from '$lib/api/client.svelte'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { placeholders } from '$lib/util.svelte.js'
|
|
||||||
import type { CommentResponse } from '$lib/api/types'
|
|
||||||
import { Button, Menu, MenuButton, toast } from 'mono-svelte'
|
import { Button, Menu, MenuButton, toast } from 'mono-svelte'
|
||||||
import { Icon, Language, XMark } from 'svelte-hero-icons'
|
import { Icon, Language, XMark } from 'svelte-hero-icons/dist'
|
||||||
import type { ClassValue, HTMLTextareaAttributes } from 'svelte/elements'
|
import type { ClassValue, HTMLTextareaAttributes } from 'svelte/elements'
|
||||||
|
|
||||||
interface Props extends Omit<HTMLTextareaAttributes, 'oncancel'> {
|
interface Props extends Omit<HTMLTextareaAttributes, 'oncancel'> {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { publishedToDate } from '$comp/util/date.js'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import type { CommentView } from '$lib/api/types'
|
import type { CommentView } from '$lib/api/types'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
import { Button, Material } from 'mono-svelte'
|
import { Button, Material } from 'mono-svelte'
|
||||||
import { ArrowUturnUp, Icon } from 'svelte-hero-icons'
|
import { ArrowUturnUp, Icon } from 'svelte-hero-icons/dist'
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
import { PostMeta } from '../post'
|
import { PostMeta } from '../post'
|
||||||
import Comment from './Comment.svelte'
|
import Comment from './Comment.svelte'
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import VirtualList from '$lib/app/render/VirtualList.svelte'
|
|
||||||
import type { Post } from '$lib/api/types'
|
|
||||||
import type { CommentNodeI } from './comments.svelte'
|
|
||||||
import Comments from './CommentTree.svelte'
|
|
||||||
import { onMount } from 'svelte'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
nodes: CommentNodeI[]
|
nodes: CommentNodeI[]
|
||||||
post: Post
|
post: Post
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import type { Post } from '$lib/api/types'
|
import type { Post } from '$lib/api/types'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { Button, toast } from 'mono-svelte'
|
import { Button, toast } from 'mono-svelte'
|
||||||
import { ArrowDownCircle } from 'svelte-hero-icons'
|
import { ArrowDownCircle } from 'svelte-hero-icons/dist'
|
||||||
import Comment from './Comment.svelte'
|
import Comment from './Comment.svelte'
|
||||||
import Comments from './CommentTree.svelte'
|
import { type CommentNodeI, buildCommentsTree } from './comments.svelte'
|
||||||
import { buildCommentsTree, type CommentNodeI } from './comments.svelte'
|
import CommentTree from './CommentTree.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
nodes: CommentNodeI[]
|
nodes: CommentNodeI[]
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
bind:open={nodes[index].expanded}
|
bind:open={nodes[index].expanded}
|
||||||
>
|
>
|
||||||
{#if node.children?.length > 0}
|
{#if node.children?.length > 0}
|
||||||
<Comments {post} bind:nodes={nodes[index].children} />
|
<CommentTree {post} bind:nodes={nodes[index].children} />
|
||||||
{/if}
|
{/if}
|
||||||
</Comment>
|
</Comment>
|
||||||
{#if node.comment_view.counts.child_count > 0 && node.children.length == 0}
|
{#if node.comment_view.counts.child_count > 0 && node.children.length == 0}
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import { site } from '$lib/api/client.svelte'
|
import { site } from '$lib/api/client.svelte'
|
||||||
import FormattedNumber from '$comp/util/FormattedNumber.svelte'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import FormattedNumber from '$lib/ui/util/FormattedNumber.svelte'
|
||||||
import { buttonColor, toast } from 'mono-svelte'
|
import { buttonColor, toast } from 'mono-svelte'
|
||||||
import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons'
|
import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons/dist'
|
||||||
import { backOut } from 'svelte/easing'
|
import { backOut } from 'svelte/easing'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
import { vote as voteItem } from '../legacy/contentview'
|
||||||
import { shouldShowVoteColor } from '../post/PostVote.svelte'
|
import { shouldShowVoteColor } from '../post/PostVote.svelte'
|
||||||
import { vote as voteItem } from '$lib/lemmy/contentview'
|
|
||||||
import type { Comment } from '$lib/api/types'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
vote?: number
|
vote?: number
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
import { t } from '$lib/app/i18n/translations'
|
|
||||||
import type { Comment, CommentView } from '$lib/client/types'
|
|
||||||
import { SvelteMap } from 'svelte/reactivity'
|
|
||||||
|
|
||||||
export interface CommentNodeI {
|
export interface CommentNodeI {
|
||||||
comment_view: CommentView
|
comment_view: CommentView
|
||||||
children: Array<CommentNodeI>
|
children: Array<CommentNodeI>
|
||||||
|
|||||||
@@ -1,4 +1,47 @@
|
|||||||
<script lang="ts" module>
|
<script lang="ts" module>
|
||||||
|
import { client, getClient } from '$lib/api/client.svelte'
|
||||||
|
import type { CommunityModeratorView, CommunityView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
||||||
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import { fullCommunityName, userLink } from '$lib/app/util.svelte'
|
||||||
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
|
import Entity from '$lib/ui/generic/Entity.svelte'
|
||||||
|
import ItemList from '$lib/ui/generic/ItemList.svelte'
|
||||||
|
import LabelStat from '$lib/ui/info/LabelStat.svelte'
|
||||||
|
import EndPlaceholder from '$lib/ui/layout/EndPlaceholder.svelte'
|
||||||
|
import SidebarButton from '$lib/ui/sidebar/SidebarButton.svelte'
|
||||||
|
import {
|
||||||
|
action,
|
||||||
|
Button,
|
||||||
|
Expandable,
|
||||||
|
Menu,
|
||||||
|
MenuButton,
|
||||||
|
Modal,
|
||||||
|
modal,
|
||||||
|
removeToast,
|
||||||
|
Spinner,
|
||||||
|
toast,
|
||||||
|
} from 'mono-svelte'
|
||||||
|
import {
|
||||||
|
BuildingOffice2,
|
||||||
|
Check,
|
||||||
|
Cog6Tooth,
|
||||||
|
EllipsisHorizontal,
|
||||||
|
Fire,
|
||||||
|
Icon,
|
||||||
|
Newspaper,
|
||||||
|
NoSymbol,
|
||||||
|
Plus,
|
||||||
|
ShieldCheck,
|
||||||
|
Tag,
|
||||||
|
} from 'svelte-hero-icons/dist'
|
||||||
|
import { amMod, isAdmin } from '../moderation/moderation'
|
||||||
|
import { addSubscription } from '../user'
|
||||||
|
import CommunityFlair from './CommunityFlair.svelte'
|
||||||
|
|
||||||
export async function block(id: number, block: boolean) {
|
export async function block(id: number, block: boolean) {
|
||||||
try {
|
try {
|
||||||
const loading = toast({
|
const loading = toast({
|
||||||
@@ -66,50 +109,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import { client, getClient } from '$lib/api/client.svelte'
|
|
||||||
import type { CommunityModeratorView, CommunityView } from '$lib/api/types'
|
|
||||||
import { amMod, isAdmin } from '$comp/lemmy/moderation/moderation.js'
|
|
||||||
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import EndPlaceholder from '$lib/ui/layout/EndPlaceholder.svelte'
|
|
||||||
import Entity from '$lib/ui/generic/Entity.svelte'
|
|
||||||
import Expandable from 'mono-svelte/disclosure/Expandable.svelte'
|
|
||||||
import LabelStat from '$lib/ui/info/LabelStat.svelte'
|
|
||||||
import SidebarButton from '$comp/ui/sidebar/SidebarButton.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { userLink } from '$lib/util.svelte'
|
|
||||||
import { addSubscription } from '$lib/lemmy/user.js'
|
|
||||||
import { settings } from '$lib/settings.svelte'
|
|
||||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
|
||||||
import {
|
|
||||||
action,
|
|
||||||
Button,
|
|
||||||
Menu,
|
|
||||||
MenuButton,
|
|
||||||
Modal,
|
|
||||||
modal,
|
|
||||||
removeToast,
|
|
||||||
Spinner,
|
|
||||||
toast,
|
|
||||||
} from 'mono-svelte'
|
|
||||||
import {
|
|
||||||
BuildingOffice2,
|
|
||||||
Check,
|
|
||||||
Cog6Tooth,
|
|
||||||
EllipsisHorizontal,
|
|
||||||
Fire,
|
|
||||||
Icon,
|
|
||||||
Newspaper,
|
|
||||||
NoSymbol,
|
|
||||||
Plus,
|
|
||||||
ShieldCheck,
|
|
||||||
Tag,
|
|
||||||
} from 'svelte-hero-icons'
|
|
||||||
import ItemList from '../generic/ItemList.svelte'
|
|
||||||
import CommunityFlair from './CommunityFlair.svelte'
|
|
||||||
|
|
||||||
let loading = $state({
|
let loading = $state({
|
||||||
blocking: false,
|
blocking: false,
|
||||||
subscribing: false,
|
subscribing: false,
|
||||||
@@ -202,7 +201,6 @@
|
|||||||
disabled={loading.subscribing}
|
disabled={loading.subscribing}
|
||||||
loading={loading.subscribing}
|
loading={loading.subscribing}
|
||||||
size="md"
|
size="md"
|
||||||
rounding="xl"
|
|
||||||
color={subscribed ? 'secondary' : 'primary'}
|
color={subscribed ? 'secondary' : 'primary'}
|
||||||
onclick={() => subscribe(community_view)}
|
onclick={() => subscribe(community_view)}
|
||||||
class="px-4 relative z-[inherit]"
|
class="px-4 relative z-[inherit]"
|
||||||
@@ -216,7 +214,6 @@
|
|||||||
{#if client().setFlair}
|
{#if client().setFlair}
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
onclick={() => (setFlair = !setFlair)}
|
onclick={() => (setFlair = !setFlair)}
|
||||||
rounding="xl"
|
|
||||||
icon={Tag}
|
icon={Tag}
|
||||||
label={$t('cards.community.flair')}
|
label={$t('cards.community.flair')}
|
||||||
/>
|
/>
|
||||||
@@ -228,7 +225,6 @@
|
|||||||
community_view.community.name,
|
community_view.community.name,
|
||||||
community_view.community.actor_id,
|
community_view.community.actor_id,
|
||||||
)}/settings"
|
)}/settings"
|
||||||
rounding="xl"
|
|
||||||
icon={Cog6Tooth}
|
icon={Cog6Tooth}
|
||||||
label={$t('routes.profile.edit')}
|
label={$t('routes.profile.edit')}
|
||||||
/>
|
/>
|
||||||
@@ -238,7 +234,6 @@
|
|||||||
<SidebarButton
|
<SidebarButton
|
||||||
{@attach attachment}
|
{@attach attachment}
|
||||||
label={$t('post.actions.more.label')}
|
label={$t('post.actions.more.label')}
|
||||||
rounding="xl"
|
|
||||||
icon={EllipsisHorizontal}
|
icon={EllipsisHorizontal}
|
||||||
/>
|
/>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { Button, TextInput, toast } from 'mono-svelte'
|
import { Button, TextInput, toast } from 'mono-svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import ImageInputUpload from '$comp/form/ImageInputUpload.svelte'
|
|
||||||
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { client, site } from '$lib/api/client.svelte'
|
import { client, site } from '$lib/api/client.svelte'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import { addSubscription } from '$lib/lemmy/user.js'
|
import { errorMessage } from '$lib/app/error'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
||||||
|
import ImageInputUpload from '$lib/ui/form/ImageInputUpload.svelte'
|
||||||
|
import { Header } from '$lib/ui/layout'
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
Label,
|
Label,
|
||||||
|
Material,
|
||||||
|
Menu,
|
||||||
MenuButton,
|
MenuButton,
|
||||||
|
Option,
|
||||||
|
Select,
|
||||||
Switch,
|
Switch,
|
||||||
TextInput,
|
TextInput,
|
||||||
toast,
|
toast,
|
||||||
Option,
|
|
||||||
Select,
|
|
||||||
Material,
|
|
||||||
Menu,
|
|
||||||
} from 'mono-svelte'
|
} from 'mono-svelte'
|
||||||
import { GlobeAlt, Icon, MapPin, Plus } from 'svelte-hero-icons'
|
import { GlobeAlt, Icon, MapPin, Plus } from 'svelte-hero-icons/dist'
|
||||||
import { Header } from '$comp/ui/layout'
|
import { addSubscription } from '../user'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,28 +1,29 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import EntityHeader from '$lib/ui/generic/EntityHeader.svelte'
|
|
||||||
import Expandable from 'mono-svelte/disclosure/Expandable.svelte'
|
|
||||||
import { formatRelativeDate } from '$comp/util/RelativeDate.svelte'
|
|
||||||
import { publishedToDate } from '$comp/util/date'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { userLink } from '$lib/util.svelte'
|
|
||||||
import { settings } from '$lib/settings.svelte'
|
|
||||||
import { fullCommunityName } from '$lib/util.svelte'
|
|
||||||
import type {
|
import type {
|
||||||
Community,
|
Community,
|
||||||
CommunityAggregates,
|
CommunityAggregates,
|
||||||
CommunityModeratorView,
|
CommunityModeratorView,
|
||||||
SubscribedType,
|
SubscribedType,
|
||||||
} from '$lib/api/types'
|
} from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import { fullCommunityName, userLink } from '$lib/app/util.svelte'
|
||||||
|
import EntityHeader from '$lib/ui/generic/EntityHeader.svelte'
|
||||||
|
import ItemList from '$lib/ui/generic/ItemList.svelte'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
import {
|
import {
|
||||||
action,
|
action,
|
||||||
Button,
|
Button,
|
||||||
|
Expandable,
|
||||||
Menu,
|
Menu,
|
||||||
MenuButton,
|
MenuButton,
|
||||||
Modal,
|
Modal,
|
||||||
modal,
|
modal,
|
||||||
toast,
|
toast,
|
||||||
} from 'mono-svelte'
|
} from 'mono-svelte'
|
||||||
|
import { formatRelativeDate } from 'mono-svelte/util/RelativeDate.svelte'
|
||||||
import {
|
import {
|
||||||
BuildingOffice2,
|
BuildingOffice2,
|
||||||
Check,
|
Check,
|
||||||
@@ -35,13 +36,11 @@
|
|||||||
Plus,
|
Plus,
|
||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
Tag,
|
Tag,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
import Subscribe from '../../../routes/communities/Subscribe.svelte'
|
||||||
import ItemList from '../generic/ItemList.svelte'
|
|
||||||
import { amMod, isAdmin } from '../moderation/moderation'
|
import { amMod, isAdmin } from '../moderation/moderation'
|
||||||
import { block, blockInstance, purgeCommunity } from './CommunityCard.svelte'
|
import { block, blockInstance, purgeCommunity } from './CommunityCard.svelte'
|
||||||
import CommunityFlair from './CommunityFlair.svelte'
|
import CommunityFlair from './CommunityFlair.svelte'
|
||||||
import { client } from '$lib/api/client.svelte'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
community: Community
|
community: Community
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import CommonItem from '$comp/ui/layout/CommonItem.svelte'
|
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import type { CommunityView } from '$lib/api/types'
|
import type { CommunityView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import { locale, t } from '$lib/app/i18n'
|
import { locale, t } from '$lib/app/i18n'
|
||||||
import { addSubscription } from '$lib/lemmy/user.js'
|
import { fullCommunityName } from '$lib/app/util.svelte'
|
||||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
import CommonItem from '$lib/ui/layout/CommonItem.svelte'
|
||||||
import { Button, modal } from 'mono-svelte'
|
import { Button, modal } from 'mono-svelte'
|
||||||
|
import type { Snippet } from 'svelte'
|
||||||
import {
|
import {
|
||||||
Check,
|
Check,
|
||||||
ExclamationTriangle,
|
ExclamationTriangle,
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
NoSymbol,
|
NoSymbol,
|
||||||
Plus,
|
Plus,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import { SvelteURL } from 'svelte/reactivity'
|
import { SvelteURL } from 'svelte/reactivity'
|
||||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
import Subscribe from '../../../routes/communities/Subscribe.svelte'
|
||||||
|
import { addSubscription } from '../user'
|
||||||
import CommunityCard from './CommunityCard.svelte'
|
import CommunityCard from './CommunityCard.svelte'
|
||||||
import type { Snippet } from 'svelte'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
community: CommunityView
|
community: CommunityView
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Community } from '$lib/api/types'
|
import type { Community } from '$lib/api/types'
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import { communityLink } from '$lib/util.svelte'
|
import { communityLink } from '$lib/app/util.svelte'
|
||||||
import { ExclamationTriangle, Icon } from 'svelte-hero-icons'
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
|
import { ExclamationTriangle, Icon } from 'svelte-hero-icons/dist'
|
||||||
import type { HTMLAnchorAttributes } from 'svelte/elements'
|
import type { HTMLAnchorAttributes } from 'svelte/elements'
|
||||||
|
|
||||||
interface Props extends HTMLAnchorAttributes {
|
interface Props extends HTMLAnchorAttributes {
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import SidebarButton from '$comp/ui/sidebar/SidebarButton.svelte'
|
|
||||||
import { addFavorite } from '$lib/lemmy/item'
|
|
||||||
import { hasFavorite } from '$lib/lemmy/user'
|
|
||||||
import type { Community } from '$lib/api/types'
|
|
||||||
import { Button } from 'mono-svelte'
|
|
||||||
import { Icon, Star, Trash } from 'svelte-hero-icons'
|
|
||||||
import { flip } from 'svelte/animate'
|
|
||||||
import { expoOut } from 'svelte/easing'
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
items: Community[]
|
|
||||||
isFavorites?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
let { items, isFavorites = false }: Props = $props()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#each items.toSorted( (a, b) => a.title.localeCompare(b.title), ) as follow (follow.id)}
|
|
||||||
<div
|
|
||||||
class="inline-flex w-full items-center pl-3
|
|
||||||
transition-colors rounded-lg"
|
|
||||||
animate:flip={{ duration: 500, easing: expoOut }}
|
|
||||||
>
|
|
||||||
<div class="flex-none grid group">
|
|
||||||
{#if profile && !hasFavorite(profile.current, follow.id)}
|
|
||||||
<Button
|
|
||||||
rounding="pill"
|
|
||||||
size="custom"
|
|
||||||
class="hidden group-hover:inline-flex opacity-0 group-hover:opacity-100 transition-all z-20
|
|
||||||
items-center justify-center box-border w-7 h-7"
|
|
||||||
style="grid-column: 1; grid-row: 1;"
|
|
||||||
onclick={() => addFavorite(follow)}
|
|
||||||
>
|
|
||||||
<Icon src={Star} size="16" mini />
|
|
||||||
</Button>
|
|
||||||
{:else if isFavorites && profile && hasFavorite(profile.current, follow.id)}
|
|
||||||
<Button
|
|
||||||
rounding="pill"
|
|
||||||
size="custom"
|
|
||||||
class="hidden group-hover:inline-flex opacity-0 group-hover:opacity-100 transition-all z-20
|
|
||||||
items-center justify-center box-border w-7 h-7"
|
|
||||||
style="grid-column: 1; grid-row: 1;"
|
|
||||||
onclick={() => addFavorite(follow, false)}
|
|
||||||
>
|
|
||||||
<Icon src={Trash} size="16" mini />
|
|
||||||
</Button>
|
|
||||||
{/if}
|
|
||||||
<Avatar
|
|
||||||
url={follow.icon}
|
|
||||||
alt={follow.name}
|
|
||||||
title={follow.title}
|
|
||||||
width={28}
|
|
||||||
class={!isFavorites &&
|
|
||||||
profile &&
|
|
||||||
hasFavorite(profile.current, follow.id)
|
|
||||||
? ''
|
|
||||||
: 'group-hover:hidden'}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<SidebarButton
|
|
||||||
class="font-normal w-full h-max"
|
|
||||||
color="none"
|
|
||||||
alignment="left"
|
|
||||||
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
|
|
||||||
>
|
|
||||||
{#snippet label()}
|
|
||||||
<div class="flex flex-col max-w-full break-words">
|
|
||||||
<span>{follow.title}</span>
|
|
||||||
<span class="text-xs text-slate-600 dark:text-zinc-400">
|
|
||||||
{new URL(follow.actor_id).hostname}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{/snippet}
|
|
||||||
</SidebarButton>
|
|
||||||
</div>
|
|
||||||
{/each}
|
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import type { Community } from '$lib/api/types'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
community: Community
|
community: Community
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import type {
|
import type {
|
||||||
CommentView,
|
CommentView,
|
||||||
CommunityView,
|
CommunityView,
|
||||||
@@ -12,8 +11,9 @@ import type {
|
|||||||
GetPosts,
|
GetPosts,
|
||||||
PostView,
|
PostView,
|
||||||
TopicView,
|
TopicView,
|
||||||
} from '$lib/client/types'
|
} from '$lib/api/types'
|
||||||
import { recursiveEqual } from '$lib/util.svelte'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { recursiveEqual } from '$lib/app/util.svelte'
|
||||||
import { SvelteMap } from 'svelte/reactivity'
|
import { SvelteMap } from 'svelte/reactivity'
|
||||||
|
|
||||||
type FetchFn<P, R> = (params: P) => R
|
type FetchFn<P, R> = (params: P) => R
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/state'
|
import { page } from '$app/state'
|
||||||
|
import { client } from '$lib/api/client.svelte'
|
||||||
|
import { PiefedClient } from '$lib/api/piefed/adapter'
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import { searchParam } from '$lib/util.svelte'
|
import { t } from '$lib/app/i18n'
|
||||||
import { Select } from 'mono-svelte'
|
import { searchParam } from '$lib/app/util.svelte'
|
||||||
|
import { Option, Select } from 'mono-svelte'
|
||||||
|
import { type SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
||||||
import {
|
import {
|
||||||
ChartBar,
|
ChartBar,
|
||||||
GlobeAmericas,
|
GlobeAmericas,
|
||||||
@@ -10,13 +14,8 @@
|
|||||||
MapPin,
|
MapPin,
|
||||||
Newspaper,
|
Newspaper,
|
||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import { amModOfAny } from '../moderation/moderation'
|
import { amModOfAny } from '../moderation/moderation'
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
|
||||||
import type { SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
|
||||||
import { client } from '$lib/api/client.svelte'
|
|
||||||
import { PiefedClient } from '$lib/api/piefed/adapter'
|
|
||||||
|
|
||||||
interface Props extends SelectProps<string> {
|
interface Props extends SelectProps<string> {
|
||||||
selected: string
|
selected: string
|
||||||
|
|||||||
@@ -3,10 +3,9 @@
|
|||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import { LemmyClient } from '$lib/api/lemmy/adapter'
|
import { LemmyClient } from '$lib/api/lemmy/adapter'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/app/util.svelte'
|
||||||
import { Select } from 'mono-svelte'
|
import { Option, Select } from 'mono-svelte'
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
import { type SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
||||||
import type { SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
|
||||||
import {
|
import {
|
||||||
ArrowTrendingDown,
|
ArrowTrendingDown,
|
||||||
ArrowTrendingUp,
|
ArrowTrendingUp,
|
||||||
@@ -23,7 +22,7 @@
|
|||||||
Star,
|
Star,
|
||||||
Sun,
|
Sun,
|
||||||
Trophy,
|
Trophy,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
interface Props extends SelectProps<string> {
|
interface Props extends SelectProps<string> {
|
||||||
selected: string
|
selected: string
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import { Select } from 'mono-svelte'
|
import { Option, Select } from 'mono-svelte'
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
import { type SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
||||||
import type { SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
import {
|
||||||
import { Bars3, Icon, RectangleGroup, ViewColumns } from 'svelte-hero-icons'
|
Bars3,
|
||||||
|
Icon,
|
||||||
|
RectangleGroup,
|
||||||
|
ViewColumns,
|
||||||
|
} from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
interface Props extends SelectProps<string> {
|
interface Props extends SelectProps<string> {
|
||||||
showLabel?: boolean
|
showLabel?: boolean
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import UserLink from '$comp/lemmy/user/UserLink.svelte'
|
|
||||||
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
|
||||||
import type { PrivateMessageView } from '$lib/api/types'
|
import type { PrivateMessageView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
||||||
|
import UserLink from '../user/UserLink.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
message: PrivateMessageView
|
message: PrivateMessageView
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type {
|
|||||||
Person,
|
Person,
|
||||||
PersonMentionView,
|
PersonMentionView,
|
||||||
PrivateMessageView,
|
PrivateMessageView,
|
||||||
} from '$lib/client/types'
|
} from '$lib/api/types'
|
||||||
|
|
||||||
export type InboxItemView =
|
export type InboxItemView =
|
||||||
| PersonMentionView
|
| PersonMentionView
|
||||||
|
|||||||
@@ -1,24 +1,23 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { userLink } from '$lib/util.svelte'
|
|
||||||
import { settings } from '$lib/settings.svelte'
|
|
||||||
import type { PersonView, SiteView, Tagline } from '$lib/api/types'
|
import type { PersonView, SiteView, Tagline } from '$lib/api/types'
|
||||||
import { Badge } from 'mono-svelte'
|
import { t } from '$lib/app/i18n'
|
||||||
|
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
||||||
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import { userLink } from '$lib/app/util.svelte'
|
||||||
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
|
import ItemList from '$lib/ui/generic/ItemList.svelte'
|
||||||
|
import LabelStat from '$lib/ui/info/LabelStat.svelte'
|
||||||
|
import EndPlaceholder from '$lib/ui/layout/EndPlaceholder.svelte'
|
||||||
|
import SidebarButton from '$lib/ui/sidebar/SidebarButton.svelte'
|
||||||
|
import { Badge, Expandable } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
BuildingOffice,
|
BuildingOffice,
|
||||||
Icon,
|
Icon,
|
||||||
Newspaper,
|
Newspaper,
|
||||||
ServerStack,
|
ServerStack,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import type { ClassValue, HTMLAttributes } from 'svelte/elements'
|
import type { ClassValue, HTMLAttributes } from 'svelte/elements'
|
||||||
import EndPlaceholder from '../../ui/EndPlaceholder.svelte'
|
import { optimizeImageURL } from '../post'
|
||||||
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> {
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
||||||
site: SiteView
|
site: SiteView
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Profile } from '$lib/app/auth.svelte.js'
|
import { type ProfileInfo } from '$lib/app/auth.svelte.js'
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
import { Icon, UserCircle } from 'svelte-hero-icons'
|
import { Icon, UserCircle } from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
profile?: Profile | undefined
|
profile?: ProfileInfo | undefined
|
||||||
selected?: boolean
|
selected?: boolean
|
||||||
index?: number
|
index?: number
|
||||||
size?: number
|
size?: number
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { getClient } from '$lib/api/client.svelte'
|
import { getClient } from '$lib/api/client.svelte'
|
||||||
import { isComment, isCommentView } from '$lib/lemmy/item.js'
|
|
||||||
import type {
|
import type {
|
||||||
|
Comment,
|
||||||
CommentView,
|
CommentView,
|
||||||
Person,
|
Person,
|
||||||
PostView,
|
|
||||||
Comment,
|
|
||||||
Post,
|
Post,
|
||||||
|
PostView,
|
||||||
} from '$lib/api/types'
|
} from '$lib/api/types'
|
||||||
|
import { isComment, isCommentView } from './item'
|
||||||
|
|
||||||
export type SubmissionView = PostView | CommentView
|
export type SubmissionView = PostView | CommentView
|
||||||
export type Submission = Post | Comment
|
export type Submission = Post | Comment
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import type {
|
import type {
|
||||||
Comment,
|
Comment,
|
||||||
CommentReportView,
|
CommentReportView,
|
||||||
@@ -6,14 +5,15 @@ import type {
|
|||||||
Community,
|
Community,
|
||||||
CommunityView,
|
CommunityView,
|
||||||
PersonView,
|
PersonView,
|
||||||
Post,
|
|
||||||
PostReportView,
|
PostReportView,
|
||||||
PostView,
|
PostView,
|
||||||
PrivateMessage,
|
PrivateMessage,
|
||||||
PrivateMessageReportView,
|
PrivateMessageReportView,
|
||||||
PrivateMessageView,
|
PrivateMessageView,
|
||||||
} from '$lib/client/types'
|
} from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import { writable } from 'svelte/store'
|
import { writable } from 'svelte/store'
|
||||||
|
import type { Post } from '../post'
|
||||||
|
|
||||||
export type Result =
|
export type Result =
|
||||||
| PostView
|
| PostView
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault } from 'svelte/legacy'
|
|
||||||
|
|
||||||
import UserLink from '$comp/lemmy/user/UserLink.svelte'
|
|
||||||
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import type { Person } from '$lib/api/types'
|
import type { Person } from '$lib/api/types'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
||||||
import { Button, Modal } from 'mono-svelte'
|
import { Button, Modal } from 'mono-svelte'
|
||||||
|
import { preventDefault } from 'svelte/legacy'
|
||||||
|
import UserLink from '../user/UserLink.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open?: boolean
|
open?: boolean
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import type { Community, Person } from '$lib/api/types'
|
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import { Label, toast, Button, Modal, Switch } from 'mono-svelte'
|
import type { Community, Person } from '$lib/api/types'
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
import { errorMessage } from '$lib/app/error'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import Duration from '$comp/form/Duration.svelte'
|
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import Duration from '$lib/ui/form/Duration.svelte'
|
||||||
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
|
import { Button, Label, Modal, Switch, toast } from 'mono-svelte'
|
||||||
import CommunityLink from '../community/CommunityLink.svelte'
|
import CommunityLink from '../community/CommunityLink.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import ShieldIcon from '$comp/lemmy/moderation/ShieldIcon.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { isCommentView } from '$lib/lemmy/item.js'
|
|
||||||
import type { CommentView } from '$lib/api/types'
|
import type { CommentView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte'
|
import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
ArrowsUpDown,
|
ArrowsUpDown,
|
||||||
@@ -13,8 +11,10 @@
|
|||||||
Newspaper,
|
Newspaper,
|
||||||
ShieldExclamation,
|
ShieldExclamation,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
|
import { isCommentView } from '../legacy/item'
|
||||||
import { amMod, ban, feature, isAdmin, remove, viewVotes } from './moderation'
|
import { amMod, ban, feature, isAdmin, remove, viewVotes } from './moderation'
|
||||||
|
import ShieldIcon from './ShieldIcon.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
item: CommentView
|
item: CommentView
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { modals } from '$comp/lemmy/moderation/moderation.js'
|
import { modals } from './moderation'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--These weird await hacks are for lazy loading, better network performance-->
|
<!--These weird await hacks are for lazy loading, better network performance-->
|
||||||
{#if $modals.reporting.open}
|
{#if $modals.reporting.open}
|
||||||
{#await import('$comp/lemmy/moderation/ReportModal.svelte') then { default: ReportModal }}
|
{#await import('./ReportModal.svelte') then { default: ReportModal }}
|
||||||
<ReportModal
|
<ReportModal
|
||||||
bind:open={$modals.reporting.open}
|
bind:open={$modals.reporting.open}
|
||||||
bind:item={$modals.reporting.item}
|
bind:item={$modals.reporting.item}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
{/await}
|
{/await}
|
||||||
{/if}
|
{/if}
|
||||||
{#if $modals.removing.open}
|
{#if $modals.removing.open}
|
||||||
{#await import('$comp/lemmy/moderation/RemoveModal.svelte') then { default: RemoveModal }}
|
{#await import('./RemoveModal.svelte') then { default: RemoveModal }}
|
||||||
<RemoveModal
|
<RemoveModal
|
||||||
bind:open={$modals.removing.open}
|
bind:open={$modals.removing.open}
|
||||||
item={$modals.removing.item}
|
item={$modals.removing.item}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
{/await}
|
{/await}
|
||||||
{/if}
|
{/if}
|
||||||
{#if $modals.banning.open}
|
{#if $modals.banning.open}
|
||||||
{#await import('$comp/lemmy/moderation/BanModal.svelte') then { default: BanModal }}
|
{#await import('./BanModal.svelte') then { default: BanModal }}
|
||||||
<BanModal
|
<BanModal
|
||||||
bind:open={$modals.banning.open}
|
bind:open={$modals.banning.open}
|
||||||
banned={$modals.banning.banned}
|
banned={$modals.banning.banned}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $modals.votes.open}
|
{#if $modals.votes.open}
|
||||||
{#await import('$comp/lemmy/moderation/ViewVotesModal.svelte') then { default: VotesModal }}
|
{#await import('./ViewVotesModal.svelte') then { default: VotesModal }}
|
||||||
<VotesModal bind:open={$modals.votes.open} item={$modals.votes.item} />
|
<VotesModal bind:open={$modals.votes.open} item={$modals.votes.item} />
|
||||||
{/await}
|
{/await}
|
||||||
{/if}
|
{/if}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { getClient } from '$lib/api/client.svelte'
|
import { getClient } from '$lib/api/client.svelte'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
|
|
||||||
import type { CommentView, PostView } from '$lib/api/types'
|
import type { CommentView, PostView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
import { Menu, MenuButton, MenuDivider, toast } from 'mono-svelte'
|
import { Menu, MenuButton, MenuDivider, toast } from 'mono-svelte'
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
import {
|
import {
|
||||||
@@ -17,9 +16,10 @@
|
|||||||
Newspaper,
|
Newspaper,
|
||||||
ShieldExclamation,
|
ShieldExclamation,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import { amMod, ban, isAdmin, remove, viewVotes } from './moderation'
|
|
||||||
import type { Attachment } from 'svelte/attachments'
|
import type { Attachment } from 'svelte/attachments'
|
||||||
|
import { isCommentView, isPostView } from '../legacy/item'
|
||||||
|
import { amMod, ban, isAdmin, remove, viewVotes } from './moderation'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
item: PostView | CommentView
|
item: PostView | CommentView
|
||||||
|
|||||||
@@ -1,23 +1,20 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault, run } from 'svelte/legacy'
|
|
||||||
|
|
||||||
import MultiSelect from '$comp/input/Switch.svelte'
|
|
||||||
import { removalTemplate } from '$comp/lemmy/moderation/moderation.js'
|
|
||||||
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import { getClient } from '$lib/api/client.svelte'
|
import { getClient } from '$lib/api/client.svelte'
|
||||||
import type { CommentView, PostView } from '$lib/api/types'
|
import type { CommentView, PostView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
||||||
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { fullCommunityName } from '$lib/app/util.svelte'
|
||||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
import MultiSelect from '$lib/ui/form/Switch.svelte'
|
||||||
import { Button, Modal, Select, Switch, toast } from 'mono-svelte'
|
import { Button, Modal, Option, Select, Switch, toast } from 'mono-svelte'
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
import { Fire, Trash } from 'svelte-hero-icons/dist'
|
||||||
import { Fire, Trash } from 'svelte-hero-icons'
|
import { preventDefault, run } from 'svelte/legacy'
|
||||||
import Comment from '../comment/Comment.svelte'
|
import Comment from '../comment/Comment.svelte'
|
||||||
|
import { isCommentView, isPostView } from '../legacy/item'
|
||||||
import { Post } from '../post'
|
import { Post } from '../post'
|
||||||
import { amMod, isAdmin } from './moderation'
|
import { amMod, isAdmin, removalTemplate } from './moderation'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean
|
open: boolean
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault, run } from 'svelte/legacy'
|
|
||||||
|
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { getClient } from '$lib/api/client.svelte'
|
import { getClient } from '$lib/api/client.svelte'
|
||||||
import type {
|
import type {
|
||||||
CommentView,
|
CommentView,
|
||||||
PostView,
|
PostView,
|
||||||
PrivateMessageView,
|
PrivateMessageView,
|
||||||
} from '$lib/api/types'
|
} from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
||||||
import { Button, Modal, toast } from 'mono-svelte'
|
import { Button, Modal, toast } from 'mono-svelte'
|
||||||
import PrivateMessage from '../inbox/PrivateMessage.svelte'
|
import { preventDefault, run } from 'svelte/legacy'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { Post } from '../post'
|
|
||||||
import Comment from '../comment/Comment.svelte'
|
import Comment from '../comment/Comment.svelte'
|
||||||
|
import PrivateMessage from '../inbox/PrivateMessage.svelte'
|
||||||
|
import { Post } from '../post'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean
|
open: boolean
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import { isCommentView, isPostView } from '$lib/lemmy/item'
|
|
||||||
import type { CommentView, PostView, VoteView } from '$lib/api/types'
|
import type { CommentView, PostView, VoteView } from '$lib/api/types'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
import { Button, Modal, Spinner } from 'mono-svelte'
|
import { Button, Modal, Spinner } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
ArrowDownCircle,
|
ArrowDownCircle,
|
||||||
@@ -11,7 +10,8 @@
|
|||||||
ChevronRight,
|
ChevronRight,
|
||||||
Icon,
|
Icon,
|
||||||
Newspaper,
|
Newspaper,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
|
import { isCommentView, isPostView } from '../legacy/item'
|
||||||
import UserLink from '../user/UserLink.svelte'
|
import UserLink from '../user/UserLink.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import type {
|
import type {
|
||||||
Comment,
|
|
||||||
CommentView,
|
CommentView,
|
||||||
Community,
|
Community,
|
||||||
MyUserInfo,
|
MyUserInfo,
|
||||||
@@ -8,8 +7,8 @@ import type {
|
|||||||
PostView,
|
PostView,
|
||||||
PrivateMessageView,
|
PrivateMessageView,
|
||||||
} from '$lib/api/types'
|
} from '$lib/api/types'
|
||||||
import type { SubmissionView } from '$lib/lemmy/contentview.js'
|
|
||||||
import { writable } from 'svelte/store'
|
import { writable } from 'svelte/store'
|
||||||
|
import type { SubmissionView } from '../legacy/contentview'
|
||||||
|
|
||||||
interface Modals {
|
interface Modals {
|
||||||
reporting: {
|
reporting: {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { publishedToDate } from '$comp/util/date.js'
|
|
||||||
import type {
|
import type {
|
||||||
CommentReportView,
|
CommentReportView,
|
||||||
CommentView,
|
CommentView,
|
||||||
@@ -7,7 +6,8 @@ import type {
|
|||||||
PostView,
|
PostView,
|
||||||
PrivateMessage,
|
PrivateMessage,
|
||||||
PrivateMessageReportView,
|
PrivateMessageReportView,
|
||||||
} from '$lib/client/types'
|
} from '$lib/api/types'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
|
|
||||||
interface CommentReport {
|
interface CommentReport {
|
||||||
type: 'comment'
|
type: 'comment'
|
||||||
@@ -47,7 +47,7 @@ export const generalizeCommentReport = (
|
|||||||
creator: report.comment_creator,
|
creator: report.comment_creator,
|
||||||
banned_from_community: false,
|
banned_from_community: false,
|
||||||
},
|
},
|
||||||
reason: report.comment_report.reason,
|
reason: report.comment_report.reason!,
|
||||||
type: 'comment',
|
type: 'comment',
|
||||||
timestamp: publishedToDate(report.comment_report.published),
|
timestamp: publishedToDate(report.comment_report.published),
|
||||||
resolved: report.comment_report.resolved,
|
resolved: report.comment_report.resolved,
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import { publishedToDate } from '$comp/util/date.js'
|
|
||||||
import { settings, type View } from '$lib/settings.svelte.js'
|
|
||||||
import type { PostView } from '$lib/api/types'
|
import type { PostView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { type View, settings } from '$lib/app/settings.svelte'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
import {
|
import {
|
||||||
type Tag,
|
|
||||||
PostMeta,
|
|
||||||
PostActions,
|
PostActions,
|
||||||
PostMedia,
|
|
||||||
PostBody,
|
PostBody,
|
||||||
parseTags,
|
PostMedia,
|
||||||
mediaType,
|
|
||||||
PostMediaCompact,
|
PostMediaCompact,
|
||||||
|
PostMeta,
|
||||||
} from '.'
|
} from '.'
|
||||||
|
import { mediaType } from './helpers'
|
||||||
|
import { type Tag, parseTags } from './PostMeta.svelte'
|
||||||
|
|
||||||
function getTagRule(tags: Tag[]): 'blur-sm' | 'hide' | undefined {
|
function getTagRule(tags: Tag[]): 'blur-sm' | 'hide' | undefined {
|
||||||
const tagContent = tags.map((t) => t.content.toLowerCase())
|
const tagContent = tags.map((t) => t.content.toLowerCase())
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { ChevronDown, Icon } from 'svelte-hero-icons'
|
import { ChevronDown, Icon } from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
const MAX_HEIGHT = 192
|
const MAX_HEIGHT = 192
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// This file is genuinely atrocious. It was here since the start of Photon,
|
|
||||||
// 2 years ago. I'm very sorry about this. please don't think this is
|
|
||||||
// my peak of development.
|
|
||||||
|
|
||||||
import { client, site } from '$lib/api/client.svelte'
|
import { client, site } from '$lib/api/client.svelte'
|
||||||
import type {
|
import type {
|
||||||
CommunityView,
|
CommunityView,
|
||||||
@@ -10,19 +6,19 @@
|
|||||||
PostResponse,
|
PostResponse,
|
||||||
PostView,
|
PostView,
|
||||||
} from '$lib/api/types'
|
} from '$lib/api/types'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
||||||
|
import { getSessionStorage, setSessionStorage } from '$lib/app/session'
|
||||||
|
import { placeholders } from '$lib/app/util.svelte'
|
||||||
|
import FreeTextInput from '$lib/ui/form/FreeTextInput.svelte'
|
||||||
|
import ObjectAutocomplete from '$lib/ui/form/ObjectAutocomplete.svelte'
|
||||||
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
import ErrorContainer, {
|
import ErrorContainer, {
|
||||||
clearErrorScope,
|
clearErrorScope,
|
||||||
pushError,
|
pushError,
|
||||||
} from '$lib/ui/info/ErrorContainer.svelte'
|
} from '$lib/ui/info/ErrorContainer.svelte'
|
||||||
import FreeTextInput from '$lib/ui/form/FreeTextInput.svelte'
|
import { Header } from '$lib/ui/layout'
|
||||||
import ObjectAutocomplete from '$lib/ui/form/ObjectAutocomplete.svelte'
|
|
||||||
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
|
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import { Header } from '$comp/ui/layout'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
|
|
||||||
import { placeholders } from '$lib/util.svelte.js'
|
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
@@ -49,7 +45,7 @@
|
|||||||
Sparkles,
|
Sparkles,
|
||||||
Tag,
|
Tag,
|
||||||
XMark,
|
XMark,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
edit?: boolean
|
edit?: boolean
|
||||||
@@ -252,7 +248,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if uploadingImage}
|
{#if uploadingImage}
|
||||||
{#await import('$comp/form/ImageInputModal.svelte') then { default: UploadModal }}
|
{#await import('$lib/ui/form/ImageInputModal.svelte') then { default: UploadModal }}
|
||||||
<UploadModal
|
<UploadModal
|
||||||
bind:open={uploadingImage}
|
bind:open={uploadingImage}
|
||||||
bind:imageUrl={() => '', (v) => (data.url = v)}
|
bind:imageUrl={() => '', (v) => (data.url = v)}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { parseURL } from '$comp/input/Link.svelte'
|
import type { View } from '$lib/app/settings.svelte'
|
||||||
import type { View } from '$lib/settings.svelte'
|
import { parseURL } from '$lib/ui/form/Link.svelte'
|
||||||
import { Material } from 'mono-svelte'
|
import { Material } from 'mono-svelte'
|
||||||
|
import { Icon, Link } from 'svelte-hero-icons/dist'
|
||||||
import { optimizeImageURL } from './helpers'
|
import { optimizeImageURL } from './helpers'
|
||||||
import { Icon, Link } from 'svelte-hero-icons'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
url: string
|
url: string
|
||||||
|
|||||||
@@ -1,4 +1,32 @@
|
|||||||
<script lang="ts" module>
|
<script lang="ts" module>
|
||||||
|
import type { Community, Person, SubscribedType } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
||||||
|
import { type View, settings } from '$lib/app/settings.svelte'
|
||||||
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
|
import { Badge, Material, modal, Popover } from 'mono-svelte'
|
||||||
|
import RelativeDate, {
|
||||||
|
formatRelativeDate,
|
||||||
|
} from 'mono-svelte/util/RelativeDate.svelte'
|
||||||
|
import {
|
||||||
|
type IconSource,
|
||||||
|
Bookmark,
|
||||||
|
ExclamationTriangle,
|
||||||
|
Icon,
|
||||||
|
LockClosed,
|
||||||
|
Megaphone,
|
||||||
|
PaperAirplane,
|
||||||
|
Pencil,
|
||||||
|
ShieldCheck,
|
||||||
|
Tag,
|
||||||
|
Trash,
|
||||||
|
} from 'svelte-hero-icons/dist'
|
||||||
|
import { SvelteMap } from 'svelte/reactivity'
|
||||||
|
import CommunityLink from '../community/CommunityLink.svelte'
|
||||||
|
import UserLink from '../user/UserLink.svelte'
|
||||||
|
|
||||||
type BadgeType =
|
type BadgeType =
|
||||||
| 'nsfw'
|
| 'nsfw'
|
||||||
| 'saved'
|
| 'saved'
|
||||||
@@ -55,34 +83,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import type { Community, Person, SubscribedType } from '$lib/api/types'
|
|
||||||
import UserLink from '$comp/lemmy/user/UserLink.svelte'
|
|
||||||
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import { publishedToDate } from '$comp/util/date'
|
|
||||||
import RelativeDate, {
|
|
||||||
formatRelativeDate,
|
|
||||||
} from '$comp/util/RelativeDate.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { settings, type View } from '$lib/settings.svelte'
|
|
||||||
import { Badge, Material, modal, Popover } from 'mono-svelte'
|
|
||||||
import {
|
|
||||||
Bookmark,
|
|
||||||
ExclamationTriangle,
|
|
||||||
Icon,
|
|
||||||
LockClosed,
|
|
||||||
Megaphone,
|
|
||||||
PaperAirplane,
|
|
||||||
Pencil,
|
|
||||||
ShieldCheck,
|
|
||||||
Tag,
|
|
||||||
Trash,
|
|
||||||
type IconSource,
|
|
||||||
} from 'svelte-hero-icons'
|
|
||||||
import { SvelteMap } from 'svelte/reactivity'
|
|
||||||
import CommunityLink from '../community/CommunityLink.svelte'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
community?: Community
|
community?: Community
|
||||||
showCommunity?: boolean
|
showCommunity?: boolean
|
||||||
@@ -387,7 +387,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@reference '../../../../app.css';
|
@reference '../../../app.css';
|
||||||
|
|
||||||
.meta {
|
.meta {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|||||||
@@ -16,18 +16,18 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import FormattedNumber from '$comp/util/FormattedNumber.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { site } from '$lib/api/client.svelte'
|
import { site } from '$lib/api/client.svelte'
|
||||||
import { vote as voteItem } from '$lib/lemmy/contentview.js'
|
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
|
||||||
import { settings } from '$lib/settings.svelte'
|
|
||||||
import type { Post } from '$lib/api/types'
|
import type { Post } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { errorMessage } from '$lib/app/error'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import FormattedNumber from '$lib/ui/util/FormattedNumber.svelte'
|
||||||
import { buttonColor, toast } from 'mono-svelte'
|
import { buttonColor, toast } from 'mono-svelte'
|
||||||
import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons'
|
import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons/dist'
|
||||||
import { backOut } from 'svelte/easing'
|
import { backOut } from 'svelte/easing'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
import { vote as voteItem } from '../legacy/contentview'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
post: Post
|
post: Post
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
|
||||||
import { amMod, isAdmin } from '$comp/lemmy/moderation/moderation.js'
|
|
||||||
import { publishedToDate } from '$comp/util/date'
|
|
||||||
import FormattedNumber from '$comp/util/FormattedNumber.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { save } from '$lib/lemmy/contentview.js'
|
|
||||||
import { settings, type View } from '$lib/settings.svelte.js'
|
|
||||||
import type { PostView } from '$lib/api/types'
|
import type { PostView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import { settings, type View } from '$lib/app/settings.svelte'
|
||||||
|
import { save } from '$lib/feature/legacy/contentview'
|
||||||
|
import { amMod, isAdmin } from '$lib/feature/moderation/moderation'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
|
import FormattedNumber from '$lib/ui/util/FormattedNumber.svelte'
|
||||||
import { Button, Menu, Modal, Spinner } from 'mono-svelte'
|
import { Button, Menu, Modal, Spinner } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
Bookmark,
|
Bookmark,
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
EllipsisHorizontal,
|
EllipsisHorizontal,
|
||||||
Icon,
|
Icon,
|
||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import { postLink } from '../helpers'
|
|
||||||
import { PostVote } from '..'
|
import { PostVote } from '..'
|
||||||
|
import { postLink } from '../helpers'
|
||||||
|
|
||||||
let saving = $state(false)
|
let saving = $state(false)
|
||||||
let editing = $state(false)
|
let editing = $state(false)
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
></Button>
|
></Button>
|
||||||
{/if}
|
{/if}
|
||||||
{#if profile.current?.user && (amMod(profile.current.user, post.community) || isAdmin(profile.current.user))}
|
{#if profile.current?.user && (amMod(profile.current.user, post.community) || isAdmin(profile.current.user))}
|
||||||
{#await import('$comp/lemmy/moderation/ModerationMenu.svelte') then { default: ModerationMenu }}
|
{#await import('$lib/feature/moderation/ModerationMenu.svelte') then { default: ModerationMenu }}
|
||||||
<ModerationMenu bind:item={post}>
|
<ModerationMenu bind:item={post}>
|
||||||
{#snippet target(attachment, acting)}
|
{#snippet target(attachment, acting)}
|
||||||
<Button
|
<Button
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet children(open)}
|
{#snippet children(open)}
|
||||||
{#if open}
|
{#if open}
|
||||||
{#await import ('./PostActionsMenu.svelte')}
|
{#await import('./PostActionsMenu.svelte')}
|
||||||
<div class="p-8 w-full h-full grid place-items-center">
|
<div class="p-8 w-full h-full grid place-items-center">
|
||||||
<Spinner width={20} />
|
<Spinner width={20} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import { PiefedClient } from '$lib/api/piefed/adapter'
|
import { PiefedClient } from '$lib/api/piefed/adapter'
|
||||||
import type { PostView } from '$lib/api/types'
|
import type { PostView } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { deleteItem, markAsRead } from '$lib/lemmy/contentview'
|
import { setSessionStorage } from '$lib/app/session'
|
||||||
import { setSessionStorage } from '$lib/session'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import { instanceToURL } from '$lib/app/util.svelte'
|
||||||
import { instanceToURL } from '$lib/util.svelte'
|
import { deleteItem, markAsRead } from '$lib/feature/legacy/contentview'
|
||||||
|
import { report } from '$lib/feature/moderation/moderation'
|
||||||
import { Button, Menu, MenuButton, toast } from 'mono-svelte'
|
import { Button, Menu, MenuButton, toast } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
ArrowTopRightOnSquare,
|
ArrowTopRightOnSquare,
|
||||||
@@ -22,8 +23,7 @@
|
|||||||
Share,
|
Share,
|
||||||
Trash,
|
Trash,
|
||||||
XMark,
|
XMark,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import { report } from '../../moderation/moderation'
|
|
||||||
import { hidePost } from '../helpers'
|
import { hidePost } from '../helpers'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PostView } from '$lib/api/types'
|
import type { PostView } from '$lib/api/types'
|
||||||
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import Placeholder from '$lib/ui/info/Placeholder.svelte'
|
import Placeholder from '$lib/ui/info/Placeholder.svelte'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
import { ArchiveBox, Plus } from 'svelte-hero-icons'
|
import { ArchiveBox, Plus } from 'svelte-hero-icons/dist'
|
||||||
import { Post } from '..'
|
import { Post } from '..'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import type { GetPosts } from '$lib/api/types'
|
import type { GetPosts, PostView } from '$lib/api/types'
|
||||||
import VirtualList from '$lib/app/render/VirtualList.svelte'
|
|
||||||
import EndPlaceholder from '$lib/ui/layout/EndPlaceholder.svelte'
|
|
||||||
import Placeholder from '$lib/ui/info/Placeholder.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import VirtualList from '$lib/app/render/VirtualList.svelte'
|
||||||
import type { PostView } from 'lemmy-js-client'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import Placeholder from '$lib/ui/info/Placeholder.svelte'
|
||||||
|
import EndPlaceholder from '$lib/ui/layout/EndPlaceholder.svelte'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { onDestroy, onMount, untrack } from 'svelte'
|
import { onDestroy, onMount, untrack } from 'svelte'
|
||||||
import {
|
import {
|
||||||
@@ -16,7 +15,7 @@
|
|||||||
ChevronDoubleUp,
|
ChevronDoubleUp,
|
||||||
ExclamationTriangle,
|
ExclamationTriangle,
|
||||||
Icon,
|
Icon,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import InfiniteScroll from 'svelte-infinite-scroll'
|
import InfiniteScroll from 'svelte-infinite-scroll'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { SvelteSet } from 'svelte/reactivity'
|
import { SvelteSet } from 'svelte/reactivity'
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import type { CommentView, PersonView, Post } from '$lib/api/types'
|
import type { CommentView, PersonView, Post } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import {
|
import {
|
||||||
canParseUrl,
|
canParseUrl,
|
||||||
findClosestNumber,
|
findClosestNumber,
|
||||||
isImage,
|
isImage,
|
||||||
isVideo,
|
isVideo,
|
||||||
} from '$lib/util.svelte'
|
} from '$lib/app/util.svelte'
|
||||||
|
|
||||||
export const isCommentMutable = (comment: CommentView, me: PersonView) =>
|
export const isCommentMutable = (comment: CommentView, me: PersonView) =>
|
||||||
me.person.id == comment.creator.id
|
me.person.id == comment.creator.id
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
<script lang="ts" module>
|
<script lang="ts" module>
|
||||||
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import {
|
||||||
|
Icon,
|
||||||
|
type IconSource,
|
||||||
|
PuzzlePiece,
|
||||||
|
VideoCamera,
|
||||||
|
} from 'svelte-hero-icons/dist'
|
||||||
|
import { type IframeType, optimizeImageURL } from '../helpers'
|
||||||
|
|
||||||
const youtubeDomain = (place: 'youtube' | 'invidious' | 'piped') => {
|
const youtubeDomain = (place: 'youtube' | 'invidious' | 'piped') => {
|
||||||
switch (place) {
|
switch (place) {
|
||||||
case 'youtube': {
|
case 'youtube': {
|
||||||
@@ -27,15 +36,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { settings } from '$lib/settings.svelte'
|
|
||||||
import {
|
|
||||||
Icon,
|
|
||||||
PuzzlePiece,
|
|
||||||
VideoCamera,
|
|
||||||
type IconSource,
|
|
||||||
} from 'svelte-hero-icons'
|
|
||||||
import { optimizeImageURL, type IframeType } from '../helpers'
|
|
||||||
|
|
||||||
const urlToEmbed = (inputUrl: string) => {
|
const urlToEmbed = (inputUrl: string) => {
|
||||||
if (type == 'video') {
|
if (type == 'video') {
|
||||||
return inputUrl
|
return inputUrl
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { showImage } from '$lib/ui/generic/ExpandableImage.svelte'
|
|
||||||
import { settings } from '$lib/settings.svelte'
|
|
||||||
import type { Post } from '$lib/api/types'
|
import type { Post } from '$lib/api/types'
|
||||||
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import { showImage } from '$lib/ui/generic/ExpandableImage.svelte'
|
||||||
import { Button, modal } from 'mono-svelte'
|
import { Button, modal } from 'mono-svelte'
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import { bestImageURL, postLink } from '../helpers'
|
import { bestImageURL, postLink } from '../helpers'
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { settings, type View } from '$lib/settings.svelte.js'
|
|
||||||
import type { Post } from '$lib/api/types'
|
import type { Post } from '$lib/api/types'
|
||||||
import {
|
import { settings, type View } from '$lib/app/settings.svelte'
|
||||||
PostImage,
|
import { PostIframe, PostImage, PostLink } from '..'
|
||||||
PostIframe,
|
import { iframeType, type MediaType } from '../helpers'
|
||||||
PostLink,
|
|
||||||
type MediaType,
|
|
||||||
iframeType,
|
|
||||||
} from '..'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
view?: View
|
view?: View
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { bestImageURL, postLink, type MediaType } from '..'
|
|
||||||
import { showImage } from '$lib/ui/generic/ExpandableImage.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { settings, type View } from '$lib/settings.svelte.js'
|
|
||||||
import type { Post } from '$lib/api/types'
|
import type { Post } from '$lib/api/types'
|
||||||
import { modal, Button } from 'mono-svelte'
|
import { t } from '$lib/app/i18n'
|
||||||
|
import { settings, type View } from '$lib/app/settings.svelte'
|
||||||
|
import { showImage } from '$lib/ui/generic/ExpandableImage.svelte'
|
||||||
|
import { Button, modal } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
DocumentText,
|
DocumentText,
|
||||||
ExclamationTriangle,
|
ExclamationTriangle,
|
||||||
@@ -12,7 +11,8 @@
|
|||||||
Link,
|
Link,
|
||||||
Photo,
|
Photo,
|
||||||
VideoCamera,
|
VideoCamera,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
|
import { bestImageURL, postLink, type MediaType } from '../helpers'
|
||||||
|
|
||||||
const thumbnailSize = (view: View) =>
|
const thumbnailSize = (view: View) =>
|
||||||
view == 'compact' ? 'w-22 h-22 sm:w-28' : 'w-24 h-24 sm:w-32'
|
view == 'compact' ? 'w-22 h-22 sm:w-28' : 'w-24 h-24 sm:w-32'
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import type { LocalImage, Person } from '$lib/api/types'
|
import type { LocalImage, Person } from '$lib/api/types'
|
||||||
import UserLink from '$comp/lemmy/user/UserLink.svelte'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import { publishedToDate } from '$comp/util/date'
|
|
||||||
import RelativeDate from '$comp/util/RelativeDate.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { instance } from '$lib/app/instance.svelte'
|
import { instance } from '$lib/app/instance.svelte'
|
||||||
import { instanceToURL } from '$lib/util.svelte'
|
import { instanceToURL } from '$lib/app/util.svelte'
|
||||||
|
import { publishedToDate } from '$lib/ui/util/date'
|
||||||
import { action, Button, modal, toast } from 'mono-svelte'
|
import { action, Button, modal, toast } from 'mono-svelte'
|
||||||
import { ArrowDownTray, Trash } from 'svelte-hero-icons'
|
import RelativeDate from 'mono-svelte/util/RelativeDate.svelte'
|
||||||
|
import { ArrowDownTray, Trash } from 'svelte-hero-icons/dist'
|
||||||
|
import UserLink from './UserLink.svelte'
|
||||||
|
|
||||||
let loading = $state(false)
|
let loading = $state(false)
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/state'
|
import { page } from '$app/state'
|
||||||
import { profile, type ProfileInfo } from '$lib/app/auth.svelte'
|
import { profile, type ProfileInfo } from '$lib/app/auth.svelte'
|
||||||
import SidebarButton from '$comp/ui/sidebar/SidebarButton.svelte'
|
|
||||||
import { LINKED_INSTANCE_URL } from '$lib/app/instance.svelte'
|
import { LINKED_INSTANCE_URL } from '$lib/app/instance.svelte'
|
||||||
import ProfileAvatar from '$lib/feature/legacy/ProfileAvatar.svelte'
|
import SidebarButton from '$lib/ui/sidebar/SidebarButton.svelte'
|
||||||
import { Icon, QuestionMarkCircle } from 'svelte-hero-icons'
|
import { Icon, QuestionMarkCircle } from 'svelte-hero-icons/dist'
|
||||||
|
import ProfileAvatar from '../legacy/ProfileAvatar.svelte'
|
||||||
|
|
||||||
let switching: boolean = $state(false)
|
let switching: boolean = $state(false)
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { goto } from '$app/navigation'
|
||||||
|
import { page } from '$app/state'
|
||||||
|
import { DEFAULT_CLIENT_TYPE } from '$lib/api/base'
|
||||||
|
import { profile, type ProfileInfo } from '$lib/app/auth.svelte'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import { LINKED_INSTANCE_URL } from '$lib/app/instance.svelte'
|
||||||
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
import { Badge, Button, Menu, MenuButton } from 'mono-svelte'
|
import { Badge, Button, Menu, MenuButton } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
CheckCircle,
|
CheckCircle,
|
||||||
@@ -6,14 +13,7 @@
|
|||||||
Icon,
|
Icon,
|
||||||
QuestionMarkCircle,
|
QuestionMarkCircle,
|
||||||
UserGroup,
|
UserGroup,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons/dist'
|
||||||
import Avatar from '../Avatar.svelte'
|
|
||||||
import { profile, type ProfileInfo } from '$lib/app/auth.svelte'
|
|
||||||
import { goto } from '$app/navigation'
|
|
||||||
import { page } from '$app/state'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { DEFAULT_CLIENT_TYPE } from '$lib/api/base'
|
|
||||||
import { LINKED_INSTANCE_URL } from '$lib/app/instance.svelte'
|
|
||||||
|
|
||||||
let { profiles }: { profiles: ProfileInfo[] } = $props()
|
let { profiles }: { profiles: ProfileInfo[] } = $props()
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte'
|
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import { getClient } from '$lib/api/client.svelte'
|
import { getClient } from '$lib/api/client.svelte'
|
||||||
import type { ListingType, Person } from '$lib/api/types'
|
import type { ListingType, Person } from '$lib/api/types'
|
||||||
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
import { MenuButton, Search } from 'mono-svelte'
|
import { MenuButton, Search } from 'mono-svelte'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { Icon, XCircle } from 'svelte-hero-icons'
|
import { Icon, XCircle } from 'svelte-hero-icons/dist'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import type { PersonView } from '$lib/api/types'
|
||||||
|
import { userLink } from '$lib/app/util.svelte'
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
import LabelStat from '$lib/ui/info/LabelStat.svelte'
|
import LabelStat from '$lib/ui/info/LabelStat.svelte'
|
||||||
import { userLink } from '$lib/util.svelte'
|
|
||||||
import type { PersonView } from '$lib/api/types'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
user: PersonView
|
user: PersonView
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
<script lang="ts" module>
|
<script lang="ts" module>
|
||||||
import { env } from '$env/dynamic/public'
|
import { env } from '$env/dynamic/public'
|
||||||
|
import type { Person } from '$lib/api/types'
|
||||||
import type { IconSource } from 'svelte-hero-icons'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
|
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
||||||
|
import Logo from '$lib/ui/generic/Logo.svelte'
|
||||||
|
import { Badge } from 'mono-svelte'
|
||||||
|
import {
|
||||||
|
Icon,
|
||||||
|
type IconSource,
|
||||||
|
Language,
|
||||||
|
NoSymbol,
|
||||||
|
} from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
function parseBadge() {
|
function parseBadge() {
|
||||||
try {
|
try {
|
||||||
@@ -48,13 +57,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import Logo from '$lib/ui/generic/Logo.svelte'
|
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
|
||||||
import type { Person } from '$lib/api/types'
|
|
||||||
import { Icon, Language, NoSymbol } from 'svelte-hero-icons'
|
|
||||||
import { Badge } from 'mono-svelte'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
user: Person
|
user: Person
|
||||||
avatar?: boolean
|
avatar?: boolean
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { profile, type ProfileInfo } from '$lib/app/auth.svelte'
|
|
||||||
import { client } from '$lib/api/client.svelte'
|
import { client } from '$lib/api/client.svelte'
|
||||||
import type { Community, MyUserInfo } from '$lib/api/types'
|
import type { Community, MyUserInfo } from '$lib/api/types'
|
||||||
|
import { profile, type ProfileInfo } from '$lib/app/auth.svelte'
|
||||||
|
|
||||||
// TODO obliterate this file
|
// TODO obliterate this file
|
||||||
export async function blockUser(block: boolean, id: number) {
|
export async function blockUser(block: boolean, id: number) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { TextInput, Select, Option } from 'mono-svelte'
|
import { Option, Select, TextInput } from 'mono-svelte'
|
||||||
|
|
||||||
const multipliers = {
|
const multipliers = {
|
||||||
minute: 60,
|
minute: 60,
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/app/auth.svelte.js'
|
import { profile } from '$lib/app/auth.svelte'
|
||||||
import ProgressBar from '$lib/ui/info/ProgressBar.svelte'
|
import { errorMessage } from '$lib/app/error'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { uploadImage } from '$lib/app/util.svelte'
|
||||||
import { uploadImage } from '$lib/util.svelte.js'
|
|
||||||
import { Button, toast } from 'mono-svelte'
|
import { Button, toast } from 'mono-svelte'
|
||||||
import { DocumentPlus, Icon } from 'svelte-hero-icons'
|
import { DocumentPlus, Icon } from 'svelte-hero-icons/dist'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { slide } from 'svelte/transition'
|
import { slide } from 'svelte/transition'
|
||||||
|
import ProgressBar from '../info/ProgressBar.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
image?: FileList | null
|
image?: FileList | null
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Button, Modal, TextInput } from 'mono-svelte'
|
|
||||||
import Switch from '../input/Switch.svelte'
|
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
|
import { Button, Modal, TextInput } from 'mono-svelte'
|
||||||
import ImageAttachForm from './ImageAttachForm.svelte'
|
import ImageAttachForm from './ImageAttachForm.svelte'
|
||||||
|
import Switch from './Switch.svelte'
|
||||||
|
|
||||||
let {
|
let {
|
||||||
open = $bindable(),
|
open = $bindable(),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { Label } from 'mono-svelte'
|
import { Label } from 'mono-svelte'
|
||||||
import { DocumentPlus, Icon, Plus } from 'svelte-hero-icons'
|
import { DocumentPlus, Icon, Plus } from 'svelte-hero-icons/dist'
|
||||||
import ImageInputModal from './ImageInputModal.svelte'
|
import ImageInputModal from './ImageInputModal.svelte'
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault } from 'svelte/legacy'
|
|
||||||
|
|
||||||
import { DocumentPlus, Icon } from 'svelte-hero-icons'
|
|
||||||
import { Label, TextInput } from 'mono-svelte'
|
import { Label, TextInput } from 'mono-svelte'
|
||||||
|
import { DocumentPlus, Icon } from 'svelte-hero-icons/dist'
|
||||||
|
import { preventDefault } from 'svelte/legacy'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
accept?: string
|
accept?: string
|
||||||
@@ -52,7 +51,7 @@
|
|||||||
class="w-full max-w-sm h-full rounded-lg"
|
class="w-full max-w-sm h-full rounded-lg"
|
||||||
/>
|
/>
|
||||||
{:else if url}
|
{:else if url}
|
||||||
<img src={url} />
|
<img src={url} alt="" />
|
||||||
{:else}
|
{:else}
|
||||||
<Icon src={DocumentPlus} class="opacity-50" size="36" />
|
<Icon src={DocumentPlus} class="opacity-50" size="36" />
|
||||||
<p class="text-sm opacity-50">Attach a file</p>
|
<p class="text-sm opacity-50">Attach a file</p>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import { getClient } from '$lib/api/client.svelte'
|
import { getClient } from '$lib/api/client.svelte'
|
||||||
import type { Community, ListingType } from '$lib/api/types'
|
import type { Community, ListingType } from '$lib/api/types'
|
||||||
import { MenuButton, Search } from 'mono-svelte'
|
import { MenuButton, Search } from 'mono-svelte'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { Icon, ServerStack, XCircle } from 'svelte-hero-icons'
|
import { Icon, ServerStack, XCircle } from 'svelte-hero-icons/dist'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
import Avatar from '../generic/Avatar.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
type?: 'community' | 'instance'
|
type?: 'community' | 'instance'
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { findClosestNumber } from '$lib/util.svelte.js'
|
import { findClosestNumber } from '$lib/app/util.svelte'
|
||||||
import { createAvatar } from '@dicebear/core'
|
|
||||||
import * as initials from '@dicebear/initials'
|
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
|
|
||||||
const sizes = [16, 24, 32, 48, 64, 96, 128, 256, 512]
|
const sizes = [16, 24, 32, 48, 64, 96, 128, 256, 512]
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
|
import Markdown from '$lib/app/markdown/Markdown.svelte'
|
||||||
|
import { Expandable } from 'mono-svelte'
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
import Markdown from '../../app/markdown/Markdown.svelte'
|
import FormattedNumber from '../util/FormattedNumber.svelte'
|
||||||
import FormattedNumber from '../../components/util/FormattedNumber.svelte'
|
|
||||||
import Avatar from './Avatar.svelte'
|
import Avatar from './Avatar.svelte'
|
||||||
import Expandable from '../shared/disclosure/Expandable.svelte'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
avatar?: string | undefined
|
avatar?: string | undefined
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
<script lang="ts" module>
|
<script lang="ts" module>
|
||||||
import { pushState } from '$app/navigation'
|
import { pushState } from '$app/navigation'
|
||||||
|
import { page } from '$app/state'
|
||||||
|
import { t } from '$lib/app/i18n'
|
||||||
|
import { Button, Material, toast } from 'mono-svelte'
|
||||||
|
import { Share, XMark } from 'svelte-hero-icons/dist'
|
||||||
|
import { expoOut } from 'svelte/easing'
|
||||||
|
import { fade, scale } from 'svelte/transition'
|
||||||
|
import { trapFocus } from 'trap-focus-svelte'
|
||||||
|
|
||||||
export function showImage(url: string) {
|
export function showImage(url: string) {
|
||||||
pushState('', {
|
pushState('', {
|
||||||
@@ -9,14 +16,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/state'
|
|
||||||
import { t } from '$lib/app/i18n'
|
|
||||||
import { Button, Material, toast } from 'mono-svelte'
|
|
||||||
import { Share, XMark } from 'svelte-hero-icons'
|
|
||||||
import { expoOut } from 'svelte/easing'
|
|
||||||
import { fade, scale } from 'svelte/transition'
|
|
||||||
import { trapFocus } from 'trap-focus-svelte'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/**
|
/**
|
||||||
* The full-resolution image URL
|
* The full-resolution image URL
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Avatar from '$lib/ui/generic/Avatar.svelte'
|
|
||||||
import CommonList from '$comp/ui/layout/CommonList.svelte'
|
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
|
import { CommonList } from '../layout'
|
||||||
|
import Avatar from './Avatar.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
items: {
|
items: {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onDestroy } from 'svelte'
|
import { onDestroy } from 'svelte'
|
||||||
import { ExclamationTriangle, Icon } from 'svelte-hero-icons'
|
import { ExclamationTriangle, Icon } from 'svelte-hero-icons/dist'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { fly, slide } from 'svelte/transition'
|
import { fly, slide } from 'svelte/transition'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import FormattedNumber from '../../components/util/FormattedNumber.svelte'
|
import FormattedNumber from '../util/FormattedNumber.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
label: string
|
label: string
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
import { type IconSource, Icon } from 'svelte-hero-icons/dist'
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
import Avatar from '../Avatar.svelte'
|
import Avatar from '../generic/Avatar.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
href?: string
|
href?: string
|
||||||
icon?: string
|
icon?: string
|
||||||
title: string
|
title: string
|
||||||
detail?: string
|
detail?: string
|
||||||
orientation: 'vertical' | 'horizontal'
|
orientation?: 'vertical' | 'horizontal'
|
||||||
children?: Snippet
|
children?: Snippet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts" generics="T">
|
<script lang="ts" generics="T">
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
import type { ClassValue } from 'svelte/elements'
|
import type { ClassValue } from 'svelte/elements'
|
||||||
|
|
||||||
const sizeDelay: Record<'lg' | 'md' | 'sm' | 'xs', number> = {
|
const sizeDelay: Record<'lg' | 'md' | 'sm' | 'xs', number> = {
|
||||||
lg: 120,
|
lg: 120,
|
||||||
md: 80,
|
md: 80,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { invalidate } from '$app/navigation'
|
||||||
|
import { page as pageData } from '$app/state'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { ChevronLeft, ChevronRight, Icon } from 'svelte-hero-icons'
|
import { ChevronLeft, ChevronRight, Icon } from 'svelte-hero-icons/dist'
|
||||||
import { backOut } from 'svelte/easing'
|
import { backOut } from 'svelte/easing'
|
||||||
import { fly } from 'svelte/transition'
|
|
||||||
import { page as pageData } from '$app/state'
|
|
||||||
import { invalidate } from '$app/navigation'
|
|
||||||
import { SvelteURLSearchParams } from 'svelte/reactivity'
|
import { SvelteURLSearchParams } from 'svelte/reactivity'
|
||||||
|
import { fly } from 'svelte/transition'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
page?: number
|
page?: number
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { navigating, page } from '$app/state'
|
import { navigating, page } from '$app/state'
|
||||||
import { t } from '$lib/app/i18n'
|
import { t } from '$lib/app/i18n'
|
||||||
import { Button, TextInput } from 'mono-svelte'
|
import { Button, TextInput } from 'mono-svelte'
|
||||||
import { MagnifyingGlass } from 'svelte-hero-icons'
|
import { MagnifyingGlass } from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
query?: string | null
|
query?: string | null
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
import type {
|
import type {
|
||||||
ClassValue,
|
ClassValue,
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { page } from '$app/state'
|
import { page } from '$app/state'
|
||||||
import type { GetPosts, ListingType, PostView } from '$lib/api/types'
|
import type {
|
||||||
|
GetPosts,
|
||||||
|
ListingType,
|
||||||
|
PostView,
|
||||||
|
SortType,
|
||||||
|
} from '$lib/api/types'
|
||||||
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import Location from '$lib/feature/filter/Location.svelte'
|
import Location from '$lib/feature/filter/Location.svelte'
|
||||||
import Sort from '$lib/feature/filter/Sort.svelte'
|
import Sort from '$lib/feature/filter/Sort.svelte'
|
||||||
import ViewSelect from '$lib/feature/filter/ViewSelect.svelte'
|
import ViewSelect from '$lib/feature/filter/ViewSelect.svelte'
|
||||||
import PostFeed from '$comp/lemmy/post/feed/PostFeed.svelte'
|
import PostFeed from '$lib/feature/post/feed/PostFeed.svelte'
|
||||||
import VirtualFeed from '$comp/lemmy/post/feed/VirtualFeed.svelte'
|
import VirtualFeed from '$lib/feature/post/feed/VirtualFeed.svelte'
|
||||||
import { Header } from '$comp/ui/layout'
|
import { Button } from 'mono-svelte'
|
||||||
import Pageination from '$comp/ui/layout/Pageination.svelte'
|
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
|
||||||
import type { SortType } from 'lemmy-js-client'
|
|
||||||
import Button from 'mono-svelte/button/Button.svelte'
|
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
import { ArrowRight, Icon } from 'svelte-hero-icons'
|
import { ArrowRight, Icon } from 'svelte-hero-icons/dist'
|
||||||
|
import { Header, Pageination } from '..'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
posts: PostView[]
|
posts: PostView[]
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { invalidateAll } from '$app/navigation'
|
|
||||||
import { page } from '$app/state'
|
|
||||||
import TabButton from '$comp/input/TabButton.svelte'
|
|
||||||
import { SvelteURL } from 'svelte/reactivity'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
routes: {
|
routes: {
|
||||||
href: string
|
href: string
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import type { ButtonProps } from 'mono-svelte/button/Button.svelte'
|
import type { ButtonProps } from 'mono-svelte/button/Button.svelte'
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
import { Icon, type IconSource } from 'svelte-hero-icons/dist'
|
||||||
|
|
||||||
interface Props extends ButtonProps {
|
interface Props extends ButtonProps {
|
||||||
label: string
|
label: string
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@reference '../../../../app.css';
|
@reference '../../../app.css';
|
||||||
|
|
||||||
:global {
|
:global {
|
||||||
.prefix {
|
.prefix {
|
||||||
|
|||||||
Loaded 100 of 274 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user