misc: bump version
This commit is contained in:
1 parent
75a30b20be
commit
741604d1db
5 files changed
+98
-21
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "photon-lemmy",
|
"name": "photon-lemmy",
|
||||||
"version": "1.30.1",
|
"version": "1.30.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||||
|
import { communityLink } from '$lib/lemmy/generic'
|
||||||
|
import { addResumable } from '$lib/lemmy/item'
|
||||||
import type { Community } from 'lemmy-js-client'
|
import type { Community } from 'lemmy-js-client'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
|
import { Icon, Star } from 'svelte-hero-icons'
|
||||||
import { flip } from 'svelte/animate'
|
import { flip } from 'svelte/animate'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { slide } from 'svelte/transition'
|
import { slide } from 'svelte/transition'
|
||||||
@@ -12,24 +15,41 @@
|
|||||||
|
|
||||||
{#each items.sort( (a, b) => a.title.localeCompare(b.title) ) as follow (follow.id)}
|
{#each items.sort( (a, b) => a.title.localeCompare(b.title) ) as follow (follow.id)}
|
||||||
<div
|
<div
|
||||||
class="inline-flex w-full"
|
class="inline-flex w-full items-center px-3"
|
||||||
animate:flip={{ duration: 500, easing: expoOut }}
|
animate:flip={{ duration: 500, easing: expoOut }}
|
||||||
>
|
>
|
||||||
|
<div class="flex-none grid group">
|
||||||
|
<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;"
|
||||||
|
on:click={() =>
|
||||||
|
addResumable({
|
||||||
|
id: follow.id,
|
||||||
|
name: follow.title,
|
||||||
|
type: 'community',
|
||||||
|
url: communityLink(follow),
|
||||||
|
avatar: follow.icon,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<Icon src={Star} size="16" mini />
|
||||||
|
</Button>
|
||||||
|
<Avatar
|
||||||
|
url={follow.icon}
|
||||||
|
alt={follow.name}
|
||||||
|
title={follow.title}
|
||||||
|
width={28}
|
||||||
|
class="group-hover:hidden"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
class="font-normal w-full h-max"
|
class="font-normal w-full h-max !px-1"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
alignment="left"
|
alignment="left"
|
||||||
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
|
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
|
||||||
>
|
>
|
||||||
<div class="flex-none">
|
|
||||||
<Avatar
|
|
||||||
url={follow.icon}
|
|
||||||
alt={follow.name}
|
|
||||||
title={follow.title}
|
|
||||||
width={24}
|
|
||||||
slot="prefix"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col max-w-full break-words" slot="label">
|
<div class="flex flex-col max-w-full break-words" slot="label">
|
||||||
<span>{follow.title}</span>
|
<span>{follow.title}</span>
|
||||||
<span class="text-xs text-slate-600 dark:text-zinc-400">
|
<span class="text-xs text-slate-600 dark:text-zinc-400">
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
import EndPlaceholder from '../EndPlaceholder.svelte'
|
import EndPlaceholder from '../EndPlaceholder.svelte'
|
||||||
import Application from '../../../../routes/admin/applications/Application.svelte'
|
import Application from '../../../../routes/admin/applications/Application.svelte'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
|
import ItemList from '$lib/components/lemmy/generic/ItemList.svelte'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
@@ -93,15 +94,65 @@
|
|||||||
</SidebarButton>
|
</SidebarButton>
|
||||||
{/if}
|
{/if}
|
||||||
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
|
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
|
||||||
|
{#if $profile?.favorites && $profile?.favorites.length > 0}
|
||||||
|
<Expandable
|
||||||
|
class="max-w-full min-w-0 w-full"
|
||||||
|
bind:open={$userSettings.expand.favorites}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
slot="title"
|
||||||
|
class="px-2 py-1 w-full {$userSettings.expandSidebar
|
||||||
|
? ''
|
||||||
|
: '//max-lg:hidden'}"
|
||||||
|
>
|
||||||
|
<EndPlaceholder>
|
||||||
|
{$t('routes.profile.favorites')}
|
||||||
|
<span slot="action" class="dark:text-white text-black">
|
||||||
|
{$profile.favorites.length}
|
||||||
|
</span>
|
||||||
|
</EndPlaceholder>
|
||||||
|
</span>
|
||||||
|
<ItemList
|
||||||
|
items={$profile.favorites.map((i) => ({
|
||||||
|
avatar: i.avatar ?? '',
|
||||||
|
id: i.id,
|
||||||
|
name: i.name,
|
||||||
|
url: i.url.toString(),
|
||||||
|
instance: 'doesnt exist',
|
||||||
|
}))}
|
||||||
|
/>
|
||||||
|
</Expandable>
|
||||||
|
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
|
||||||
|
{/if}
|
||||||
{#if $profile?.user}
|
{#if $profile?.user}
|
||||||
{#if $profile?.user.moderates.length > 0}
|
{#if $profile?.user.moderates.length > 0}
|
||||||
<CommunityList items={$profile.user.moderates.map((i) => i.community)} />
|
<Expandable
|
||||||
|
class="max-w-full min-w-0 w-full"
|
||||||
|
bind:open={$userSettings.expand.moderates}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
slot="title"
|
||||||
|
class="px-2 py-1 w-full {$userSettings.expandSidebar
|
||||||
|
? ''
|
||||||
|
: '//max-lg:hidden'}"
|
||||||
|
>
|
||||||
|
<EndPlaceholder>
|
||||||
|
{$t('routes.profile.moderates')}
|
||||||
|
<span slot="action" class="dark:text-white text-black">
|
||||||
|
{$profile.user.moderates.length}
|
||||||
|
</span>
|
||||||
|
</EndPlaceholder>
|
||||||
|
</span>
|
||||||
|
<CommunityList
|
||||||
|
items={$profile.user.moderates.map((i) => i.community)}
|
||||||
|
/>
|
||||||
|
</Expandable>
|
||||||
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
|
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<Expandable
|
<Expandable
|
||||||
class="max-w-full min-w-0 w-full"
|
class="max-w-full min-w-0 w-full"
|
||||||
bind:open={$userSettings.expandCommunities}
|
bind:open={$userSettings.expand.communities}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
slot="title"
|
slot="title"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ export const isPrivateMessageReport = (
|
|||||||
): item is PrivateMessageReportView => 'private_message_report' in item
|
): item is PrivateMessageReportView => 'private_message_report' in item
|
||||||
|
|
||||||
export interface ResumableItem {
|
export interface ResumableItem {
|
||||||
url: URL
|
url: string
|
||||||
id: number
|
id: number
|
||||||
name: string
|
name: string
|
||||||
avatar?: string
|
avatar?: string
|
||||||
@@ -88,10 +88,9 @@ export function addResumable(item: ResumableItem) {
|
|||||||
let favs = p.favorites ?? []
|
let favs = p.favorites ?? []
|
||||||
if (favs.map((fav) => fav.url.toString()).includes(item.url.toString()))
|
if (favs.map((fav) => fav.url.toString()).includes(item.url.toString()))
|
||||||
return
|
return
|
||||||
if (favs.length >= 5) favs.pop()
|
|
||||||
favs.unshift(item)
|
favs.unshift(item)
|
||||||
profile.update(() => ({
|
profile.update(() => ({
|
||||||
...p,
|
...p,
|
||||||
favorites: favs
|
favorites: favs,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
+10
-3
@@ -46,7 +46,11 @@ interface Settings {
|
|||||||
removed: boolean
|
removed: boolean
|
||||||
}
|
}
|
||||||
expandSidebar: boolean
|
expandSidebar: boolean
|
||||||
expandCommunities: boolean
|
expand: {
|
||||||
|
communities: boolean
|
||||||
|
moderates: boolean
|
||||||
|
favorites: boolean
|
||||||
|
}
|
||||||
displayNames: boolean
|
displayNames: boolean
|
||||||
nsfwBlur: boolean
|
nsfwBlur: boolean
|
||||||
moderation: {
|
moderation: {
|
||||||
@@ -104,8 +108,11 @@ export const defaultSettings: Settings = {
|
|||||||
removed: toBool(env.PUBLIC_HIDE_REMOVED) ?? true,
|
removed: toBool(env.PUBLIC_HIDE_REMOVED) ?? true,
|
||||||
},
|
},
|
||||||
expandSidebar: toBool(env.PUBLIC_EXPAND_SIDEBAR) ?? true,
|
expandSidebar: toBool(env.PUBLIC_EXPAND_SIDEBAR) ?? true,
|
||||||
expandCommunities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true,
|
expand: {
|
||||||
expandFavorites: toBool(env.PUBLIC_EXPAND_FAVORITES) ?? true,
|
communities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true,
|
||||||
|
favorites: toBool(env.PUBLIC_EXPAND_FAVORITES) ?? true,
|
||||||
|
moderates: toBool(env.PUBLIC_EXPAND_MODERATES) ?? true,
|
||||||
|
},
|
||||||
displayNames: toBool(env.PUBLIC_DISPLAY_NAMES) ?? true,
|
displayNames: toBool(env.PUBLIC_DISPLAY_NAMES) ?? true,
|
||||||
nsfwBlur: toBool(env.PUBLIC_NSFW_BLUR) ?? true,
|
nsfwBlur: toBool(env.PUBLIC_NSFW_BLUR) ?? true,
|
||||||
moderation: {
|
moderation: {
|
||||||
|
|||||||
Reference in new issue
Block a user