misc: bump version
This commit is contained in:
1 parent
1e8958471f
commit
5a8499fd7b
3 files changed
+103
-99
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "photon-lemmy",
|
"name": "photon-lemmy",
|
||||||
"version": "1.31.0-fix.1",
|
"version": "1.31.1",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@catdadcode/svelte-adapter-bun": "^0.5.7",
|
"@catdadcode/svelte-adapter-bun": "^0.5.7",
|
||||||
"@dicebear/core": "^8.0.1",
|
"@dicebear/core": "^8.0.1",
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { slide } from 'svelte/transition'
|
import { slide } from 'svelte/transition'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoInOut, expoOut } from 'svelte/easing'
|
||||||
|
|
||||||
export let node: CommentNodeI
|
export let node: CommentNodeI
|
||||||
export let postId: number
|
export let postId: number
|
||||||
@@ -107,111 +107,113 @@
|
|||||||
: ''} {highlight} {$$props.class}"
|
: ''} {highlight} {$$props.class}"
|
||||||
id="#{node.comment_view.comment.id.toString()}"
|
id="#{node.comment_view.comment.id.toString()}"
|
||||||
>
|
>
|
||||||
<Disclosure bind:open class="flex flex-col">
|
<button
|
||||||
<div
|
on:click={() => (open = !open)}
|
||||||
slot="summary"
|
class="flex flex-row cursor-pointer gap-2 items-center group text-[13px] flex-wrap w-full"
|
||||||
class="flex flex-row cursor-pointer gap-2 items-center group text-[13px] flex-wrap"
|
>
|
||||||
>
|
<span class:font-bold={op} class="flex flex-row gap-1 items-center">
|
||||||
<span class:font-bold={op} class="flex flex-row gap-1 items-center">
|
<UserLink
|
||||||
<UserLink
|
inComment
|
||||||
inComment
|
avatarSize={22}
|
||||||
avatarSize={22}
|
avatar
|
||||||
avatar
|
user={node.comment_view.creator}
|
||||||
user={node.comment_view.creator}
|
>
|
||||||
>
|
<svelte:fragment slot="badges">
|
||||||
<svelte:fragment slot="badges">
|
{#if node.comment_view.creator_is_moderator}
|
||||||
{#if node.comment_view.creator_is_moderator}
|
<ShieldIcon filled width={14} class="text-green-500" />
|
||||||
<ShieldIcon filled width={14} class="text-green-500" />
|
{/if}
|
||||||
{/if}
|
{#if node.comment_view.creator_is_admin}
|
||||||
{#if node.comment_view.creator_is_admin}
|
<ShieldIcon filled width={14} class="text-red-500" />
|
||||||
<ShieldIcon filled width={14} class="text-red-500" />
|
{/if}
|
||||||
{/if}
|
</svelte:fragment>
|
||||||
</svelte:fragment>
|
</UserLink>
|
||||||
</UserLink>
|
{#if op}
|
||||||
{#if op}
|
<span class="text-sky-500">OP</span>
|
||||||
<span class="text-sky-500">OP</span>
|
{/if}
|
||||||
{/if}
|
</span>
|
||||||
</span>
|
<RelativeDate
|
||||||
<RelativeDate
|
class="text-slate-600 dark:text-zinc-400"
|
||||||
class="text-slate-600 dark:text-zinc-400"
|
date={publishedToDate(node.comment_view.comment.published)}
|
||||||
date={publishedToDate(node.comment_view.comment.published)}
|
/>
|
||||||
/>
|
<span class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 ml-1">
|
||||||
<span class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 ml-1">
|
{#if node.comment_view.comment.updated}
|
||||||
{#if node.comment_view.comment.updated}
|
<Icon src={Pencil} solid size="12" title="Edited" />
|
||||||
<Icon src={Pencil} solid size="12" title="Edited" />
|
{/if}
|
||||||
{/if}
|
{#if node.comment_view.comment.deleted || node.comment_view.comment.removed}
|
||||||
{#if node.comment_view.comment.deleted || node.comment_view.comment.removed}
|
<Icon
|
||||||
<Icon
|
src={Trash}
|
||||||
src={Trash}
|
solid
|
||||||
solid
|
size="12"
|
||||||
size="12"
|
title={$t('post.badges.deleted')}
|
||||||
title={$t('post.badges.deleted')}
|
class="text-red-600 dark:text-red-500"
|
||||||
class="text-red-600 dark:text-red-500"
|
|
||||||
/>
|
|
||||||
{/if}
|
|
||||||
{#if node.comment_view.saved}
|
|
||||||
<Icon
|
|
||||||
src={Bookmark}
|
|
||||||
solid
|
|
||||||
size="12"
|
|
||||||
title={$t('post.badges.saved')}
|
|
||||||
class="text-yellow-600 dark:text-yellow-500"
|
|
||||||
/>
|
|
||||||
{/if}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="flex flex-col whitespace-pre-wrap
|
|
||||||
max-w-full gap-1 mt-1 relative"
|
|
||||||
>
|
|
||||||
{#if node.comment_view.comment.distinguished}
|
|
||||||
<div
|
|
||||||
class="-z-10 bg-slate-100 dark:bg-zinc-900 absolute -top-9 -bottom-1.5
|
|
||||||
-inset-x-6 -right-6"
|
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if node.comment_view.saved}
|
||||||
|
<Icon
|
||||||
|
src={Bookmark}
|
||||||
|
solid
|
||||||
|
size="12"
|
||||||
|
title={$t('post.badges.saved')}
|
||||||
|
class="text-yellow-600 dark:text-yellow-500"
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
{#if open}
|
||||||
|
<div transition:slide={{ duration: 500, easing: expoOut }}>
|
||||||
<div
|
<div
|
||||||
class="max-w-full mt-0.5 break-words text-[15px] text-slate-800 dark:text-zinc-100"
|
class="flex flex-col whitespace-pre-wrap
|
||||||
|
max-w-full gap-1 mt-1 relative"
|
||||||
>
|
>
|
||||||
<Markdown source={node.comment_view.comment.content} />
|
{#if node.comment_view.comment.distinguished}
|
||||||
|
<div
|
||||||
|
class="-z-10 bg-slate-100 dark:bg-zinc-900 absolute -top-9 -bottom-1.5
|
||||||
|
-inset-x-6 -right-6"
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
<div
|
||||||
|
class="max-w-full mt-0.5 break-words text-[15px] text-slate-800 dark:text-zinc-100"
|
||||||
|
>
|
||||||
|
<Markdown source={node.comment_view.comment.content} />
|
||||||
|
</div>
|
||||||
|
{#if actions}
|
||||||
|
<div class="flex flex-row gap-2 items-center">
|
||||||
|
<CommentActions
|
||||||
|
bind:comment={node.comment_view}
|
||||||
|
bind:replying
|
||||||
|
on:edit={() => (editing = true)}
|
||||||
|
disabled={node.comment_view.banned_from_community ||
|
||||||
|
node.comment_view.post.locked}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if actions}
|
{#if replying}
|
||||||
<div class="flex flex-row gap-2 items-center">
|
<div
|
||||||
<CommentActions
|
class="max-w-full my-2 border-l border-slate-200 dark:border-zinc-800 pl-4"
|
||||||
bind:comment={node.comment_view}
|
transition:slide={{ axis: 'y', duration: 400, easing: expoOut }}
|
||||||
bind:replying
|
>
|
||||||
on:edit={() => (editing = true)}
|
<h1 class="font-bold text-sm mb-2">{$t('comment.reply')}</h1>
|
||||||
disabled={node.comment_view.banned_from_community ||
|
<CommentForm
|
||||||
node.comment_view.post.locked}
|
{postId}
|
||||||
|
parentId={node.comment_view.comment.id}
|
||||||
|
on:comment={(e) => {
|
||||||
|
node.children = [
|
||||||
|
{
|
||||||
|
children: [],
|
||||||
|
comment_view: e.detail.comment_view,
|
||||||
|
depth: node.depth + 1,
|
||||||
|
},
|
||||||
|
...node.children,
|
||||||
|
]
|
||||||
|
replying = false
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
<div class="bg-transparent dark:bg-transparent">
|
||||||
{#if replying}
|
<slot />
|
||||||
<div
|
|
||||||
class="max-w-full my-2 border-l border-slate-200 dark:border-zinc-800 pl-4"
|
|
||||||
transition:slide={{ axis: 'y', duration: 400, easing: expoOut }}
|
|
||||||
>
|
|
||||||
<h1 class="font-bold text-sm mb-2">{$t('comment.reply')}</h1>
|
|
||||||
<CommentForm
|
|
||||||
{postId}
|
|
||||||
parentId={node.comment_view.comment.id}
|
|
||||||
on:comment={(e) => {
|
|
||||||
node.children = [
|
|
||||||
{
|
|
||||||
children: [],
|
|
||||||
comment_view: e.detail.comment_view,
|
|
||||||
depth: node.depth + 1,
|
|
||||||
},
|
|
||||||
...node.children,
|
|
||||||
]
|
|
||||||
replying = false
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
|
||||||
<div class="bg-transparent dark:bg-transparent">
|
|
||||||
<slot />
|
|
||||||
</div>
|
</div>
|
||||||
</Disclosure>
|
{/if}
|
||||||
</li>
|
</li>
|
||||||
@@ -27,6 +27,7 @@ export function buildCommentsTree(
|
|||||||
baseDepth: number = 0,
|
baseDepth: number = 0,
|
||||||
filter: (c: CommentView) => boolean = (c) => true
|
filter: (c: CommentView) => boolean = (c) => true
|
||||||
): CommentNodeI[] {
|
): CommentNodeI[] {
|
||||||
|
const start = performance.now()
|
||||||
const map = new Map<number, CommentNodeI>()
|
const map = new Map<number, CommentNodeI>()
|
||||||
|
|
||||||
let min_depth = Number.MAX_VALUE
|
let min_depth = Number.MAX_VALUE
|
||||||
@@ -68,6 +69,7 @@ export function buildCommentsTree(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`Built tree in ${performance.now() - start}ms`)
|
||||||
return tree
|
return tree
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user