migrate: switch to callbacks instead of events
This commit is contained in:
1 parent
c7e2963390
commit
b291aeebf8
67 files changed
+331
-356
No files matched your search
@@ -64,7 +64,7 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => clearErrorScope(scope)}
|
onclick={() => clearErrorScope(scope)}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="square-sm"
|
size="square-sm"
|
||||||
class="ml-auto"
|
class="ml-auto"
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
{#snippet noresults()}
|
{#snippet noresults()}
|
||||||
<div class="w-full h-full">
|
<div class="w-full h-full">
|
||||||
{#if q == '' && showWhenEmpty}
|
{#if q == '' && showWhenEmpty}
|
||||||
<MenuButton on:click={() => dispatcher('select', undefined)}>
|
<MenuButton onclick={() => dispatcher('select', undefined)}>
|
||||||
<Icon src={XCircle} size="16" mini />
|
<Icon src={XCircle} size="16" mini />
|
||||||
<div class="flex flex-col text-left">
|
<div class="flex flex-col text-left">
|
||||||
<span>None</span>
|
<span>None</span>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet children({ item, select })}
|
{#snippet children({ item, select })}
|
||||||
<div in:fly|global={{ y: -4, opacity: 0 }}>
|
<div in:fly|global={{ y: -4, opacity: 0 }}>
|
||||||
<MenuButton on:click={() => select(item)}>
|
<MenuButton onclick={() => select(item)}>
|
||||||
<Avatar url={item.icon} alt={item.title} width={24} />
|
<Avatar url={item.icon} alt={item.title} width={24} />
|
||||||
<div class="flex flex-col text-left">
|
<div class="flex flex-col text-left">
|
||||||
<span>{item.title}</span>
|
<span>{item.title}</span>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
{#snippet noresults()}
|
{#snippet noresults()}
|
||||||
<div class="w-full h-full">
|
<div class="w-full h-full">
|
||||||
{#if q == '' && showWhenEmpty}
|
{#if q == '' && showWhenEmpty}
|
||||||
<MenuButton on:click={() => dispatcher('select', undefined)}>
|
<MenuButton onclick={() => dispatcher('select', undefined)}>
|
||||||
<div class="flex flex-col text-left">
|
<div class="flex flex-col text-left">
|
||||||
<span>None (Start typing to search)</span>
|
<span>None (Start typing to search)</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet children({ item, select })}
|
{#snippet children({ item, select })}
|
||||||
<div in:fly|global={{ y: -4, opacity: 0 }}>
|
<div in:fly|global={{ y: -4, opacity: 0 }}>
|
||||||
<MenuButton on:click={() => select(item)}>
|
<MenuButton onclick={() => select(item)}>
|
||||||
<Icon src={ServerStack} size="16" mini />
|
<Icon src={ServerStack} size="16" mini />
|
||||||
<div class="flex flex-col text-left">
|
<div class="flex flex-col text-left">
|
||||||
<span>{item.domain}</span>
|
<span>{item.domain}</span>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
color="tertiary"
|
color="tertiary"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
class="text-slate-700 dark:text-zinc-300"
|
class="text-slate-700 dark:text-zinc-300"
|
||||||
on:click={() => (replying = !replying)}
|
onclick={() => (replying = !replying)}
|
||||||
disabled={comment.post.locked || disabled}
|
disabled={comment.post.locked || disabled}
|
||||||
>
|
>
|
||||||
<Icon src={ChatBubbleOvalLeft} size="14" micro />
|
<Icon src={ChatBubbleOvalLeft} size="14" micro />
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuDivider>{$t('comment.actions.label')}</MenuDivider>
|
<MenuDivider>{$t('comment.actions.label')}</MenuDivider>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
navigator.share?.({
|
navigator.share?.({
|
||||||
url: comment.comment.ap_id,
|
url: comment.comment.ap_id,
|
||||||
}) ?? navigator.clipboard.writeText(comment.comment.ap_id)
|
}) ?? navigator.clipboard.writeText(comment.comment.ap_id)
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if settings.translator}
|
{#if settings.translator}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
text.set(comment.comment.content)
|
text.set(comment.comment.content)
|
||||||
translating = !translating
|
translating = !translating
|
||||||
@@ -117,13 +117,13 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
{#if comment.creator.id == $profile.user?.local_user_view.person.id}
|
{#if comment.creator.id == $profile.user?.local_user_view.person.id}
|
||||||
<MenuButton on:click={() => dispatcher('edit', comment)}>
|
<MenuButton onclick={() => dispatcher('edit', comment)}>
|
||||||
<Icon src={PencilSquare} mini size="16" />
|
<Icon src={PencilSquare} mini size="16" />
|
||||||
<span>{$t('post.actions.more.edit')}</span>
|
<span>{$t('post.actions.more.edit')}</span>
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if ($profile?.jwt)
|
if ($profile?.jwt)
|
||||||
comment.saved = await save(comment, !comment.saved, $profile.jwt)
|
comment.saved = await save(comment, !comment.saved, $profile.jwt)
|
||||||
}}
|
}}
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
{#if $profile?.user && $profile.jwt && $profile.user.local_user_view.person.id == comment.creator.id}
|
{#if $profile?.user && $profile.jwt && $profile.user.local_user_view.person.id == comment.creator.id}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if ($profile?.jwt)
|
if ($profile?.jwt)
|
||||||
comment.comment.deleted = await deleteItem(
|
comment.comment.deleted = await deleteItem(
|
||||||
comment,
|
comment,
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
{#if $profile.jwt && $profile.user?.local_user_view.person.id != comment.creator.id}
|
{#if $profile.jwt && $profile.user?.local_user_view.person.id != comment.creator.id}
|
||||||
<MenuButton on:click={() => report(comment)} color="danger-subtle">
|
<MenuButton onclick={() => report(comment)} color="danger-subtle">
|
||||||
<Icon src={Flag} mini size="16" />
|
<Icon src={Flag} mini size="16" />
|
||||||
<span>{$t('moderation.report')}</span>
|
<span>{$t('moderation.report')}</span>
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<Button
|
<Button
|
||||||
size="custom"
|
size="custom"
|
||||||
title={$t('common.cancel')}
|
title={$t('common.cancel')}
|
||||||
on:click={() => dispatch('cancel', true)}
|
onclick={() => dispatch('cancel', true)}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
class="w-8 h-8"
|
class="w-8 h-8"
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
<Icon src={XMark} size="16" micro />
|
<Icon src={XMark} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={submit}
|
onclick={submit}
|
||||||
color="primary"
|
color="primary"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={locked || loading || banned}
|
disabled={locked || loading || banned}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
color="tertiary"
|
color="tertiary"
|
||||||
class="font-normal text-slate-600 dark:text-zinc-400"
|
class="font-normal text-slate-600 dark:text-zinc-400"
|
||||||
loaderWidth={16}
|
loaderWidth={16}
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
if (node.depth > 4) {
|
if (node.depth > 4) {
|
||||||
goto(
|
goto(
|
||||||
`/comment/${$page.params.instance}/${node.comment_view.comment.id}#comments`,
|
`/comment/${$page.params.instance}/${node.comment_view.comment.id}#comments`,
|
||||||
|
|||||||
@@ -234,7 +234,7 @@
|
|||||||
color={community_view.subscribed == 'Subscribed'
|
color={community_view.subscribed == 'Subscribed'
|
||||||
? 'secondary'
|
? 'secondary'
|
||||||
: 'primary'}
|
: 'primary'}
|
||||||
on:click={subscribe}
|
onclick={subscribe}
|
||||||
class="flex-1 relative z-[inherit]"
|
class="flex-1 relative z-[inherit]"
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
@@ -279,7 +279,7 @@
|
|||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
size="lg"
|
size="lg"
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
block(community_view.community.id, !community_view.blocked)}
|
block(community_view.community.id, !community_view.blocked)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
size="lg"
|
size="lg"
|
||||||
on:click={() => blockInstance(community_view.community.instance_id)}
|
onclick={() => blockInstance(community_view.community.instance_id)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={BuildingOffice2} size="16" mini />
|
<Icon src={BuildingOffice2} size="16" mini />
|
||||||
@@ -304,7 +304,7 @@
|
|||||||
{#if $profile?.user && isAdmin($profile.user)}
|
{#if $profile?.user && isAdmin($profile.user)}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
modal({
|
modal({
|
||||||
title: $t('admin.purgeCommunity.title'),
|
title: $t('admin.purgeCommunity.title'),
|
||||||
body: `${community_view.community.title}: ${$t('admin.purgeCommunity.warning')}`,
|
body: `${community_view.community.title}: ${$t('admin.purgeCommunity.warning')}`,
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text
|
|||||||
loading={subscribing}
|
loading={subscribing}
|
||||||
size="lg"
|
size="lg"
|
||||||
color={subscribed == 'NotSubscribed' ? 'primary' : 'secondary'}
|
color={subscribed == 'NotSubscribed' ? 'primary' : 'secondary'}
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
subscribed =
|
subscribed =
|
||||||
(await subscribe())?.community_view.subscribed ??
|
(await subscribe())?.community_view.subscribed ??
|
||||||
'NotSubscribed'
|
'NotSubscribed'
|
||||||
@@ -186,7 +186,7 @@ dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text
|
|||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
size="lg"
|
size="lg"
|
||||||
on:click={() => block(community.id, !blocked)}
|
onclick={() => block(community.id, !blocked)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={NoSymbol} size="16" mini />
|
<Icon src={NoSymbol} size="16" mini />
|
||||||
@@ -199,7 +199,7 @@ dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text
|
|||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
size="lg"
|
size="lg"
|
||||||
on:click={() => blockInstance(community.instance_id)}
|
onclick={() => blockInstance(community.instance_id)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={BuildingOffice2} size="16" mini />
|
<Icon src={BuildingOffice2} size="16" mini />
|
||||||
@@ -210,7 +210,7 @@ dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text
|
|||||||
{#if $profile?.user && isAdmin($profile.user)}
|
{#if $profile?.user && isAdmin($profile.user)}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
modal({
|
modal({
|
||||||
title: $t('admin.purgeCommunity.title'),
|
title: $t('admin.purgeCommunity.title'),
|
||||||
body: `${community.title}: ${$t('admin.purgeCommunity.warning')}`,
|
body: `${community.title}: ${$t('admin.purgeCommunity.warning')}`,
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="flex flex-row items-center gap-2">
|
<div class="flex flex-row items-center gap-2">
|
||||||
<Button size="square-md" on:click={() => (showInfo = !showInfo)}>
|
<Button size="square-md" onclick={() => (showInfo = !showInfo)}>
|
||||||
<Icon src={InformationCircle} size="16" micro />
|
<Icon src={InformationCircle} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
<Subscribe {community}>
|
<Subscribe {community}>
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
<Button
|
<Button
|
||||||
disabled={subscribing || !$profile?.jwt}
|
disabled={subscribing || !$profile?.jwt}
|
||||||
loading={subscribing}
|
loading={subscribing}
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
const res = await subscribe()
|
const res = await subscribe()
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
{$t('moderation.label')}
|
{$t('moderation.label')}
|
||||||
{/if}
|
{/if}
|
||||||
</MenuDivider>
|
</MenuDivider>
|
||||||
<MenuButton color="danger-subtle" on:click={() => remove(item)}>
|
<MenuButton color="danger-subtle" onclick={() => remove(item)}>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={Trash} size="16" mini />
|
<Icon src={Trash} size="16" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<!--Comment made by someone else-->
|
<!--Comment made by someone else-->
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
ban(item.creator_banned_from_community, item.creator, item.community)}
|
ban(item.creator_banned_from_community, item.creator, item.community)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
<!--Comment made by self-->
|
<!--Comment made by self-->
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="success-subtle"
|
color="success-subtle"
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if (!$profile.jwt) return
|
if (!$profile.jwt) return
|
||||||
item.comment = (
|
item.comment = (
|
||||||
await feature(
|
await feature(
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
{#if $profile?.user && isAdmin($profile.user)}
|
{#if $profile?.user && isAdmin($profile.user)}
|
||||||
<MenuDivider>{$t('admin.label')}</MenuDivider>
|
<MenuDivider>{$t('admin.label')}</MenuDivider>
|
||||||
<MenuButton color="danger-subtle" on:click={() => remove(item, true)}>
|
<MenuButton color="danger-subtle" onclick={() => remove(item, true)}>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={Fire} size="16" mini />
|
<Icon src={Fire} size="16" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
</MenuDivider>
|
</MenuDivider>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="warning-subtle"
|
color="warning-subtle"
|
||||||
on:click={() => lock(!item.post.locked)}
|
onclick={() => lock(!item.post.locked)}
|
||||||
loading={locking}
|
loading={locking}
|
||||||
disabled={locking}
|
disabled={locking}
|
||||||
>
|
>
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
|
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="success-subtle"
|
color="success-subtle"
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
pin(isPostView(item) ? !item.post.featured_community : false)}
|
pin(isPostView(item) ? !item.post.featured_community : false)}
|
||||||
loading={pinning}
|
loading={pinning}
|
||||||
disabled={pinning}
|
disabled={pinning}
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton color="danger-subtle" on:click={() => remove(item)}>
|
<MenuButton color="danger-subtle" onclick={() => remove(item)}>
|
||||||
<Icon src={Trash} size="16" mini />
|
<Icon src={Trash} size="16" mini />
|
||||||
{#if isCommentView(item)}
|
{#if isCommentView(item)}
|
||||||
{item.comment.removed
|
{item.comment.removed
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
{#if $profile?.user && $profile.user.local_user_view.person.id != item.creator.id}
|
{#if $profile?.user && $profile.user.local_user_view.person.id != item.creator.id}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
ban(item.creator_banned_from_community, item.creator, item.community)}
|
ban(item.creator_banned_from_community, item.creator, item.community)}
|
||||||
>
|
>
|
||||||
<Icon src={ShieldExclamation} size="16" mini />
|
<Icon src={ShieldExclamation} size="16" mini />
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<MenuDivider>{$t('admin.label')}</MenuDivider>
|
<MenuDivider>{$t('admin.label')}</MenuDivider>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="success-subtle"
|
color="success-subtle"
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
pin(isPostView(item) ? !item.post.featured_local : false, true)}
|
pin(isPostView(item) ? !item.post.featured_local : false, true)}
|
||||||
>
|
>
|
||||||
<Icon src={Megaphone} size="16" mini />
|
<Icon src={Megaphone} size="16" mini />
|
||||||
@@ -170,7 +170,7 @@
|
|||||||
<span class="text-xs opacity-80">{$t('admin.instance')}</span>
|
<span class="text-xs opacity-80">{$t('admin.instance')}</span>
|
||||||
</div>
|
</div>
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton color="danger-subtle" on:click={() => remove(item, true)}>
|
<MenuButton color="danger-subtle" onclick={() => remove(item, true)}>
|
||||||
<Icon src={Fire} size="16" mini />
|
<Icon src={Fire} size="16" mini />
|
||||||
{$t('admin.purge')}
|
{$t('admin.purge')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
item?: PostView | CommentView | PrivateMessageView | undefined
|
item?: PostView | CommentView | PrivateMessageView | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
let { open = $bindable(), item = undefined }: Props = $props()
|
let { open = $bindable(), item = $bindable() }: Props = $props()
|
||||||
|
|
||||||
const isComment = (
|
const isComment = (
|
||||||
item: PostView | CommentView | PrivateMessageView,
|
item: PostView | CommentView | PrivateMessageView,
|
||||||
|
|||||||
@@ -170,7 +170,7 @@
|
|||||||
{/await}
|
{/await}
|
||||||
{/if}
|
{/if}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => (debug = true)}
|
onclick={() => (debug = true)}
|
||||||
title="Debug"
|
title="Debug"
|
||||||
size="custom"
|
size="custom"
|
||||||
color="ghost"
|
color="ghost"
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
|
|
||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
<Button
|
<Button
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if (!$profile?.jwt) return
|
if (!$profile?.jwt) return
|
||||||
saving = true
|
saving = true
|
||||||
post.saved = await save(post, !post.saved, $profile?.jwt)
|
post.saved = await save(post, !post.saved, $profile?.jwt)
|
||||||
@@ -312,7 +312,7 @@
|
|||||||
{$t('post.actions.more.actions')}
|
{$t('post.actions.more.actions')}
|
||||||
</MenuDivider>
|
</MenuDivider>
|
||||||
{#if $profile?.user && $profile?.jwt && $profile.user.local_user_view.person.id == post.creator.id}
|
{#if $profile?.user && $profile?.jwt && $profile.user.local_user_view.person.id == post.creator.id}
|
||||||
<MenuButton on:click={() => (editing = true)}>
|
<MenuButton onclick={() => (editing = true)}>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={PencilSquare} size="16" micro />
|
<Icon src={PencilSquare} size="16" micro />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -321,7 +321,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if ($profile?.jwt)
|
if ($profile?.jwt)
|
||||||
post.read = await markAsRead(post.post, !post.read, $profile.jwt)
|
post.read = await markAsRead(post.post, !post.read, $profile.jwt)
|
||||||
}}
|
}}
|
||||||
@@ -335,7 +335,7 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
navigator.share?.({
|
navigator.share?.({
|
||||||
url: localShare
|
url: localShare
|
||||||
? `${instanceToURL(getInstance())}/post/${post.post.id}`
|
? `${instanceToURL(getInstance())}/post/${post.post.id}`
|
||||||
@@ -361,7 +361,7 @@
|
|||||||
color={!localShare ? 'primary' : 'secondary'}
|
color={!localShare ? 'primary' : 'secondary'}
|
||||||
size="square-md"
|
size="square-md"
|
||||||
roundingSide="left"
|
roundingSide="left"
|
||||||
on:click={() => (localShare = false)}
|
onclick={() => (localShare = false)}
|
||||||
title={$t('filter.location.global')}
|
title={$t('filter.location.global')}
|
||||||
>
|
>
|
||||||
<Icon src={GlobeAmericas} size="16" micro />
|
<Icon src={GlobeAmericas} size="16" micro />
|
||||||
@@ -370,7 +370,7 @@
|
|||||||
color={localShare ? 'primary' : 'secondary'}
|
color={localShare ? 'primary' : 'secondary'}
|
||||||
size="square-md"
|
size="square-md"
|
||||||
roundingSide="right"
|
roundingSide="right"
|
||||||
on:click={() => (localShare = true)}
|
onclick={() => (localShare = true)}
|
||||||
title={$t('filter.location.local')}
|
title={$t('filter.location.local')}
|
||||||
>
|
>
|
||||||
<Icon src={MapPin} size="16" micro />
|
<Icon src={MapPin} size="16" micro />
|
||||||
@@ -380,7 +380,7 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if post.post.body && settings.translator}
|
{#if post.post.body && settings.translator}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
text.set(post.post.body)
|
text.set(post.post.body)
|
||||||
translating = !translating
|
translating = !translating
|
||||||
@@ -394,7 +394,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
setSessionStorage('postDraft', {
|
setSessionStorage('postDraft', {
|
||||||
body: `${
|
body: `${
|
||||||
settings.crosspostOriginalLink
|
settings.crosspostOriginalLink
|
||||||
@@ -423,7 +423,7 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if $profile.user && post.creator.id == $profile.user.local_user_view.person.id}
|
{#if $profile.user && post.creator.id == $profile.user.local_user_view.person.id}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if ($profile?.jwt)
|
if ($profile?.jwt)
|
||||||
post.post.deleted = await deleteItem(
|
post.post.deleted = await deleteItem(
|
||||||
post,
|
post,
|
||||||
@@ -444,7 +444,7 @@
|
|||||||
{#if $profile.user?.local_user_view.person.id != post.creator.id}
|
{#if $profile.user?.local_user_view.person.id != post.creator.id}
|
||||||
{#if feature('hidePosts', $site?.version)}
|
{#if feature('hidePosts', $site?.version)}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if (!$profile?.jwt) return
|
if (!$profile?.jwt) return
|
||||||
const hidden = await hidePost(
|
const hidden = await hidePost(
|
||||||
post.post.id,
|
post.post.id,
|
||||||
@@ -466,7 +466,7 @@
|
|||||||
: $t('post.actions.more.hide')}
|
: $t('post.actions.more.hide')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuButton on:click={() => report(post)} color="danger-subtle">
|
<MenuButton onclick={() => report(post)} color="danger-subtle">
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={Flag} width={16} micro />
|
<Icon src={Flag} width={16} micro />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ ${view == 'list' ? `max-h-24` : 'max-h-48'}`
|
|||||||
<Markdown inline={!expanded} source={expanded ? body : body.slice(0, 1000)} />
|
<Markdown inline={!expanded} source={expanded ? body : body.slice(0, 1000)} />
|
||||||
{#if overflows}
|
{#if overflows}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => (expanded = !expanded)}
|
onclick={() => (expanded = !expanded)}
|
||||||
size="square-sm"
|
size="square-sm"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
class="text-black dark:text-white absolute z-10 isolate pointer-events-auto bottom-0 {expanded
|
class="text-black dark:text-white absolute z-10 isolate pointer-events-auto bottom-0 {expanded
|
||||||
|
|||||||
@@ -278,7 +278,7 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
on:click={() => loadMore()}
|
onclick={() => loadMore()}
|
||||||
>
|
>
|
||||||
{$t('message.retry')}
|
{$t('message.retry')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -295,7 +295,7 @@
|
|||||||
<span class="font-medium text-sm">{$t('form.post.community')}</span>
|
<span class="font-medium text-sm">{$t('form.post.community')}</span>
|
||||||
<Button
|
<Button
|
||||||
class="w-full !bg-white dark:!bg-black h-[38px]"
|
class="w-full !bg-white dark:!bg-black h-[38px]"
|
||||||
on:click={() => (data.community = null)}
|
onclick={() => (data.community = null)}
|
||||||
alignment="left"
|
alignment="left"
|
||||||
size="sm"
|
size="sm"
|
||||||
>
|
>
|
||||||
@@ -347,7 +347,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{#if data.url}
|
{#if data.url}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => (addAltText = !addAltText)}
|
onclick={() => (addAltText = !addAltText)}
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
size="sm"
|
size="sm"
|
||||||
color="ghost"
|
color="ghost"
|
||||||
@@ -359,7 +359,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => (uploadingImage = !uploadingImage)}
|
onclick={() => (uploadingImage = !uploadingImage)}
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
size="sm"
|
size="sm"
|
||||||
color="ghost"
|
color="ghost"
|
||||||
@@ -372,7 +372,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
{#if generation.generatable}
|
{#if generation.generatable}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => generateTitle(data.url)}
|
onclick={() => generateTitle(data.url)}
|
||||||
loading={generation.loading}
|
loading={generation.loading}
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -391,7 +391,7 @@
|
|||||||
<div class="flex flex-row gap-2 flex-wrap">
|
<div class="flex flex-row gap-2 flex-wrap">
|
||||||
{#if data.url === undefined}
|
{#if data.url === undefined}
|
||||||
<Button
|
<Button
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
data.url = ''
|
data.url = ''
|
||||||
try {
|
try {
|
||||||
const url = new URL(await navigator.clipboard.readText())
|
const url = new URL(await navigator.clipboard.readText())
|
||||||
@@ -406,7 +406,7 @@
|
|||||||
{$t('form.post.addUrl')}
|
{$t('form.post.addUrl')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
data.url = ''
|
data.url = ''
|
||||||
uploadingImage = true
|
uploadingImage = true
|
||||||
}}
|
}}
|
||||||
@@ -418,7 +418,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
{#if data.language_id === undefined}
|
{#if data.language_id === undefined}
|
||||||
<Button size="sm" rounding="pill" on:click={() => (data.language_id = 0)}>
|
<Button size="sm" rounding="pill" onclick={() => (data.language_id = 0)}>
|
||||||
<Icon src={Language} size="16" micro />
|
<Icon src={Language} size="16" micro />
|
||||||
{$t('form.post.setLanguage')}
|
{$t('form.post.setLanguage')}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -466,7 +466,7 @@
|
|||||||
|
|
||||||
{#if !edit}
|
{#if !edit}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
toast({ content: $t('toast.restoredFromDraft') })
|
toast({ content: $t('toast.restoredFromDraft') })
|
||||||
const draft = getSessionStorage('postDraft')
|
const draft = getSessionStorage('postDraft')
|
||||||
if (draft && !edit) {
|
if (draft && !edit) {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
{/each}
|
{/each}
|
||||||
<MenuDivider>{$t('post.actions.link.actions')}</MenuDivider>
|
<MenuDivider>{$t('post.actions.link.actions')}</MenuDivider>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
navigator?.share?.({ url: url }) ?? navigator?.clipboard?.writeText?.(url)
|
navigator?.share?.({ url: url }) ?? navigator?.clipboard?.writeText?.(url)
|
||||||
|
|
||||||
toast({ content: $t('toast.copied') })
|
toast({ content: $t('toast.copied') })
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
>
|
>
|
||||||
{#if post.alt_text}
|
{#if post.alt_text}
|
||||||
<Button
|
<Button
|
||||||
on:click={(e) => {
|
onclick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
modal({
|
modal({
|
||||||
title: 'Alt',
|
title: 'Alt',
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
{#snippet noresults()}
|
{#snippet noresults()}
|
||||||
<div class="w-full h-full">
|
<div class="w-full h-full">
|
||||||
{#if showWhenEmpty}
|
{#if showWhenEmpty}
|
||||||
<MenuButton on:click={() => dispatcher('select', undefined)}>
|
<MenuButton onclick={() => dispatcher('select', undefined)}>
|
||||||
<Icon src={XCircle} size="16" mini />
|
<Icon src={XCircle} size="16" mini />
|
||||||
<div class="flex flex-col text-left">
|
<div class="flex flex-col text-left">
|
||||||
<span>None</span>
|
<span>None</span>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet children({ item, select })}
|
{#snippet children({ item, select })}
|
||||||
<div in:fly|global={{ y: -4, opacity: 0 }}>
|
<div in:fly|global={{ y: -4, opacity: 0 }}>
|
||||||
<MenuButton on:click={() => select(item)}>
|
<MenuButton onclick={() => select(item)}>
|
||||||
<Avatar url={item.avatar} alt={item.name} width={24} />
|
<Avatar url={item.avatar} alt={item.name} width={24} />
|
||||||
<div class="flex flex-col text-left">
|
<div class="flex flex-col text-left">
|
||||||
<span>{item.name}</span>
|
<span>{item.name}</span>
|
||||||
|
|||||||
@@ -165,63 +165,63 @@ overflow-hidden transition-colors {clazz}"
|
|||||||
: ''}"
|
: ''}"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('**', '**')}
|
onclick={() => wrapSelection('**', '**')}
|
||||||
title="Bold"
|
title="Bold"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<Icon src={Bold} size="16" mini />
|
<Icon src={Bold} size="16" mini />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('*', '*')}
|
onclick={() => wrapSelection('*', '*')}
|
||||||
title="Italic"
|
title="Italic"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<Icon src={Italic} size="16" micro />
|
<Icon src={Italic} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('[', '](https://example.com)')}
|
onclick={() => wrapSelection('[', '](https://example.com)')}
|
||||||
title="Link"
|
title="Link"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<Icon src={Link} size="16" micro />
|
<Icon src={Link} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('\n# ', '')}
|
onclick={() => wrapSelection('\n# ', '')}
|
||||||
title="Header"
|
title="Header"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<Icon src={H1} size="16" micro />
|
<Icon src={H1} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('~~', '~~')}
|
onclick={() => wrapSelection('~~', '~~')}
|
||||||
title="Strikethrough"
|
title="Strikethrough"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<Icon src={Strikethrough} size="16" micro />
|
<Icon src={Strikethrough} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('\n> ', '')}
|
onclick={() => wrapSelection('\n> ', '')}
|
||||||
title="Quote"
|
title="Quote"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<span class="font-bold font-serif text-lg">"</span>
|
<span class="font-bold font-serif text-lg">"</span>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('\n- ', '')}
|
onclick={() => wrapSelection('\n- ', '')}
|
||||||
title="List"
|
title="List"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<Icon src={ListBullet} micro size="16" />
|
<Icon src={ListBullet} micro size="16" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('`', '`')}
|
onclick={() => wrapSelection('`', '`')}
|
||||||
title="Code"
|
title="Code"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<Icon src={CodeBracket} micro size="16" />
|
<Icon src={CodeBracket} micro size="16" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
wrapSelection('::: spoiler <spoiler title>\n', '\n:::')}
|
wrapSelection('::: spoiler <spoiler title>\n', '\n:::')}
|
||||||
title="Spoiler"
|
title="Spoiler"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
@@ -229,7 +229,7 @@ overflow-hidden transition-colors {clazz}"
|
|||||||
<Icon src={ExclamationTriangle} micro size="16" />
|
<Icon src={ExclamationTriangle} micro size="16" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('~', '~')}
|
onclick={() => wrapSelection('~', '~')}
|
||||||
title="Subscript"
|
title="Subscript"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
@@ -239,7 +239,7 @@ overflow-hidden transition-colors {clazz}"
|
|||||||
</span>
|
</span>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => wrapSelection('^', '^')}
|
onclick={() => wrapSelection('^', '^')}
|
||||||
title="Superscript"
|
title="Superscript"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
@@ -250,7 +250,7 @@ overflow-hidden transition-colors {clazz}"
|
|||||||
</Button>
|
</Button>
|
||||||
{#if images}
|
{#if images}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => (uploadingImage = !uploadingImage)}
|
onclick={() => (uploadingImage = !uploadingImage)}
|
||||||
title="Image"
|
title="Image"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<Button
|
<Button
|
||||||
size="square-sm"
|
size="square-sm"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
navigator?.clipboard?.writeText(codeblock.code)
|
navigator?.clipboard?.writeText(codeblock.code)
|
||||||
toast({ content: $t('toast.copied') })
|
toast({ content: $t('toast.copied') })
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<Modal title={$t('post.actions.more.translate')} bind:open>
|
<Modal title={$t('post.actions.more.translate')} bind:open>
|
||||||
<TextArea bind:value={$text} rows={2}>
|
<TextArea bind:value={$text} rows={2}>
|
||||||
{#snippet suffix()}
|
{#snippet suffix()}
|
||||||
<Button on:click={() => translate($text)} color="primary">
|
<Button onclick={() => translate($text)} color="primary">
|
||||||
{$t('post.actions.more.translate')}
|
{$t('post.actions.more.translate')}
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
rounding="full"
|
rounding="full"
|
||||||
padding="none"
|
padding="none"
|
||||||
color="uniform"
|
color="uniform"
|
||||||
on:click={(e) => e.stopPropagation()}
|
onclick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
download
|
download
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
<Icon src={ArrowDownTray} size="20" micro />
|
<Icon src={ArrowDownTray} size="20" micro />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if (navigator.share) {
|
if (navigator.share) {
|
||||||
const file = await downloadImage($page.state.openImage)
|
const file = await downloadImage($page.state.openImage)
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
zoomed = !zoomed
|
zoomed = !zoomed
|
||||||
}}
|
}}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => history.back()}
|
onclick={() => history.back()}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
|
|||||||
@@ -13,18 +13,18 @@
|
|||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
page?: number;
|
page?: number
|
||||||
cursor?: { next?: string; back?: string } | undefined;
|
cursor?: { next?: string; back?: string } | undefined
|
||||||
hasMore?: boolean;
|
hasMore?: boolean
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
page = $bindable(0),
|
page = $bindable(0),
|
||||||
cursor = undefined,
|
cursor = undefined,
|
||||||
hasMore = true,
|
hasMore = true,
|
||||||
children
|
children,
|
||||||
}: Props = $props();
|
}: Props = $props()
|
||||||
|
|
||||||
const dispatcher = createEventDispatcher<{ change: number; cursor: string }>()
|
const dispatcher = createEventDispatcher<{ change: number; cursor: string }>()
|
||||||
</script>
|
</script>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<Button
|
<Button
|
||||||
color="ghost"
|
color="ghost"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
if (cursor?.back) dispatcher('cursor', cursor?.back)
|
if (cursor?.back) dispatcher('cursor', cursor?.back)
|
||||||
else dispatcher('change', --page)
|
else dispatcher('change', --page)
|
||||||
}}
|
}}
|
||||||
@@ -52,8 +52,8 @@
|
|||||||
disabled={(!cursor?.back && cursor?.next) || page <= 1}
|
disabled={(!cursor?.back && cursor?.next) || page <= 1}
|
||||||
>
|
>
|
||||||
{#snippet suffix()}
|
{#snippet suffix()}
|
||||||
<Icon src={ChevronLeft} size="24" mini />
|
<Icon src={ChevronLeft} size="24" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{#if page}
|
{#if page}
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
color="ghost"
|
color="ghost"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
if (cursor?.next) dispatcher('cursor', cursor?.next)
|
if (cursor?.next) dispatcher('cursor', cursor?.next)
|
||||||
else dispatcher('change', ++page)
|
else dispatcher('change', ++page)
|
||||||
}}
|
}}
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
disabled={!hasMore}
|
disabled={!hasMore}
|
||||||
>
|
>
|
||||||
{#snippet suffix()}
|
{#snippet suffix()}
|
||||||
<Icon src={ChevronRight} size="24" mini />
|
<Icon src={ChevronRight} size="24" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -4,18 +4,15 @@
|
|||||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||||
import { dockProps } from '../layout/Shell.svelte'
|
import { dockProps } from '../layout/Shell.svelte'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
label: string;
|
label: string
|
||||||
icon?: IconSource | undefined;
|
icon?: IconSource | undefined
|
||||||
href?: string | undefined;
|
href?: string | undefined
|
||||||
adaptive?: boolean;
|
adaptive?: boolean
|
||||||
isSelectedFilter?: (path: string) => boolean;
|
isSelectedFilter?: (path: string) => boolean
|
||||||
class?: string;
|
class?: string
|
||||||
customIcon?: import('svelte').Snippet<[any]>;
|
customIcon?: import('svelte').Snippet<[any]>
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,13 +21,12 @@
|
|||||||
icon = undefined,
|
icon = undefined,
|
||||||
href = undefined,
|
href = undefined,
|
||||||
adaptive = true,
|
adaptive = true,
|
||||||
isSelectedFilter = (path) =>
|
isSelectedFilter = (path) => href != undefined && path == href,
|
||||||
href != undefined && path == href,
|
|
||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
customIcon,
|
customIcon,
|
||||||
children,
|
children,
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props()
|
||||||
|
|
||||||
let isSelected = $derived(isSelectedFilter($page.url.pathname))
|
let isSelected = $derived(isSelectedFilter($page.url.pathname))
|
||||||
let isPanel = $derived(adaptive ? $dockProps.noGap : false)
|
let isPanel = $derived(adaptive ? $dockProps.noGap : false)
|
||||||
@@ -39,7 +35,7 @@
|
|||||||
<Button
|
<Button
|
||||||
color={isPanel ? 'secondary' : 'tertiary'}
|
color={isPanel ? 'secondary' : 'tertiary'}
|
||||||
{...rest}
|
{...rest}
|
||||||
on:click
|
onclick
|
||||||
on:contextmenu
|
on:contextmenu
|
||||||
class="rounded-full w-10 h-10 flex-shrink-0 {adaptive
|
class="rounded-full w-10 h-10 flex-shrink-0 {adaptive
|
||||||
? '@3xl:h-8 @3xl:px-3 @3xl:rounded-[10px] @3xl:w-auto'
|
? '@3xl:h-8 @3xl:px-3 @3xl:rounded-[10px] @3xl:w-auto'
|
||||||
@@ -60,7 +56,7 @@
|
|||||||
size={isPanel ? '16' : '18'}
|
size={isPanel ? '16' : '18'}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
{@render customIcon?.({ size: isPanel ? 16 : 18, isSelected, })}
|
{@render customIcon?.({ size: isPanel ? 16 : 18, isSelected })}
|
||||||
{/if}
|
{/if}
|
||||||
<span class="hidden {adaptive ? '@3xl:block' : ''}">{label}</span>
|
<span class="hidden {adaptive ? '@3xl:block' : ''}">{label}</span>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
|
|||||||
@@ -209,7 +209,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => (showInstance = !showInstance)}
|
onclick={() => (showInstance = !showInstance)}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
title={$t('nav.menu.instance')}
|
title={$t('nav.menu.instance')}
|
||||||
size="square-md"
|
size="square-md"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
href={action.href}
|
href={action.href}
|
||||||
on:click
|
onclick
|
||||||
alignment="left"
|
alignment="left"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="lg"
|
size="lg"
|
||||||
|
|||||||
@@ -278,7 +278,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<CommandItem
|
<CommandItem
|
||||||
{action}
|
{action}
|
||||||
on:click={(e) => {
|
onclick={(e) => {
|
||||||
if (action.href) {
|
if (action.href) {
|
||||||
togglePalette()
|
togglePalette()
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
class="hidden group-hover:inline-flex opacity-0 group-hover:opacity-100 transition-all z-20
|
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"
|
items-center justify-center box-border w-7 h-7"
|
||||||
style="grid-column: 1; grid-row: 1;"
|
style="grid-column: 1; grid-row: 1;"
|
||||||
on:click={() => addFavorite(follow)}
|
onclick={() => addFavorite(follow)}
|
||||||
>
|
>
|
||||||
<Icon src={Star} size="16" mini />
|
<Icon src={Star} size="16" mini />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
class="hidden group-hover:inline-flex opacity-0 group-hover:opacity-100 transition-all z-20
|
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"
|
items-center justify-center box-border w-7 h-7"
|
||||||
style="grid-column: 1; grid-row: 1;"
|
style="grid-column: 1; grid-row: 1;"
|
||||||
on:click={() => addFavorite(follow, false)}
|
onclick={() => addFavorite(follow, false)}
|
||||||
>
|
>
|
||||||
<Icon src={Trash} size="16" mini />
|
<Icon src={Trash} size="16" mini />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
loading={switching}
|
loading={switching}
|
||||||
loaderWidth={20}
|
loaderWidth={20}
|
||||||
selected={$profile?.id == prof.id}
|
selected={$profile?.id == prof.id}
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
switching = true
|
switching = true
|
||||||
|
|
||||||
if ($profile?.id != prof.id) {
|
if ($profile?.id != prof.id) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
{#each settings.dock.pins as pin}
|
{#each settings.dock.pins as pin}
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
icon={iconOfLink(pin.url)}
|
icon={iconOfLink(pin.url)}
|
||||||
on:click={() => goto(pin.url)}
|
onclick={() => goto(pin.url)}
|
||||||
alignment="center"
|
alignment="center"
|
||||||
selected={`${$page.url.pathname}${$page.url.search}` == pin.url}
|
selected={`${$page.url.pathname}${$page.url.search}` == pin.url}
|
||||||
on:contextmenu={(e) => {
|
on:contextmenu={(e) => {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
alignment="left"
|
alignment="left"
|
||||||
{...rest}
|
{...rest}
|
||||||
{href}
|
{href}
|
||||||
on:click
|
onclick
|
||||||
on:contextmenu
|
on:contextmenu
|
||||||
class="font-normal block !origin-left border border-transparent {!selected
|
class="font-normal block !origin-left border border-transparent {!selected
|
||||||
? 'text-slate-600 dark:text-zinc-400'
|
? 'text-slate-600 dark:text-zinc-400'
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
in:fly={{ duration: 300, easing: expoOut, y: 6, delay: 100 }}
|
in:fly={{ duration: 300, easing: expoOut, y: 6, delay: 100 }}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
filters.clear()
|
filters.clear()
|
||||||
filters = filters
|
filters = filters
|
||||||
}}
|
}}
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#each uniqueIds as id}
|
{#each uniqueIds as id}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
if (filters.has(id)) filters.delete(id)
|
if (filters.has(id)) filters.delete(id)
|
||||||
else filters.add(id)
|
else filters.add(id)
|
||||||
filters = filters
|
filters = filters
|
||||||
|
|||||||
@@ -65,9 +65,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createBubbler } from 'svelte/legacy';
|
|
||||||
|
|
||||||
const bubble = createBubbler();
|
|
||||||
import Spinner from '../loader/Spinner.svelte'
|
import Spinner from '../loader/Spinner.svelte'
|
||||||
|
|
||||||
type ButtonRoundness = 'pill' | 'xl' | 'lg' | 'md' | 'none'
|
type ButtonRoundness = 'pill' | 'xl' | 'lg' | 'md' | 'none'
|
||||||
@@ -115,27 +112,23 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
loading?: boolean;
|
loading?: boolean
|
||||||
submit?: boolean;
|
submit?: boolean
|
||||||
color?: ButtonColor;
|
color?: ButtonColor
|
||||||
size?: ButtonSize;
|
size?: ButtonSize
|
||||||
rounding?: ButtonRoundness;
|
rounding?: ButtonRoundness
|
||||||
roundingSide?: ButtonRoundingSide;
|
roundingSide?: ButtonRoundingSide
|
||||||
alignment?: ButtonAlignment;
|
alignment?: ButtonAlignment
|
||||||
shadow?: ButtonShadow;
|
shadow?: ButtonShadow
|
||||||
column?: boolean;
|
column?: boolean
|
||||||
animations?: any;
|
animations?: any
|
||||||
loaderWidth?: number | undefined;
|
loaderWidth?: number | undefined
|
||||||
href?: string | undefined;
|
href?: string | undefined
|
||||||
class?: string;
|
class?: string
|
||||||
prefix?: import('svelte').Snippet;
|
prefix?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet
|
||||||
suffix?: import('svelte').Snippet;
|
suffix?: import('svelte').Snippet
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,9 +143,9 @@
|
|||||||
shadow = 'none',
|
shadow = 'none',
|
||||||
column = false,
|
column = false,
|
||||||
animations = {
|
animations = {
|
||||||
scale: false,
|
scale: false,
|
||||||
large: false,
|
large: false,
|
||||||
},
|
},
|
||||||
loaderWidth = undefined,
|
loaderWidth = undefined,
|
||||||
href = undefined,
|
href = undefined,
|
||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
@@ -160,8 +153,7 @@
|
|||||||
children,
|
children,
|
||||||
suffix,
|
suffix,
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:element
|
<svelte:element
|
||||||
@@ -169,12 +161,6 @@
|
|||||||
role={href ? 'link' : 'button'}
|
role={href ? 'link' : 'button'}
|
||||||
{href}
|
{href}
|
||||||
{...rest}
|
{...rest}
|
||||||
onclick={bubble('click')}
|
|
||||||
oncontextmenu={bubble('contextmenu')}
|
|
||||||
ondrag={bubble('drag')}
|
|
||||||
ondrop={bubble('drop')}
|
|
||||||
ondragstart={bubble('dragstart')}
|
|
||||||
ondragend={bubble('dragend')}
|
|
||||||
class="
|
class="
|
||||||
{loading ? buttonColor.secondary : buttonColor[color]}
|
{loading ? buttonColor.secondary : buttonColor[color]}
|
||||||
{buttonSize[size]}
|
{buttonSize[size]}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import { Check, Icon, Clipboard } from 'svelte-hero-icons'
|
import { Check, Icon, Clipboard } from 'svelte-hero-icons'
|
||||||
import { scale } from 'svelte/transition'
|
import { scale } from 'svelte/transition'
|
||||||
|
|
||||||
|
|
||||||
let copied = $state(false)
|
let copied = $state(false)
|
||||||
|
|
||||||
let pre: HTMLPreElement = $state()
|
let pre: HTMLPreElement = $state()
|
||||||
@@ -18,11 +17,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
src: string;
|
src: string
|
||||||
filename?: string | undefined;
|
filename?: string | undefined
|
||||||
htmlSrc?: string | undefined;
|
htmlSrc?: string | undefined
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet
|
||||||
class?: string;
|
class?: string
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,8 +32,7 @@
|
|||||||
children,
|
children,
|
||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Material
|
<Material
|
||||||
@@ -51,7 +49,7 @@
|
|||||||
size="square-sm"
|
size="square-sm"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
aria-label="Copy"
|
aria-label="Copy"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
copied = true
|
copied = true
|
||||||
copy()
|
copy()
|
||||||
setTimeout(() => (copied = false), 2000)
|
setTimeout(() => (copied = false), 2000)
|
||||||
|
|||||||
@@ -3,21 +3,18 @@
|
|||||||
import { Check, Icon, Clipboard } from 'svelte-hero-icons'
|
import { Check, Icon, Clipboard } from 'svelte-hero-icons'
|
||||||
import { scale } from 'svelte/transition'
|
import { scale } from 'svelte/transition'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let copied = $state(false)
|
let copied = $state(false)
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/**
|
/**
|
||||||
* Show a copy button.
|
* Show a copy button.
|
||||||
*/
|
*/
|
||||||
value: string;
|
value: string
|
||||||
copy?: boolean;
|
copy?: boolean
|
||||||
class?: string;
|
class?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
let { value, copy = true, class: clazz = '' }: Props = $props();
|
let { value, copy = true, class: clazz = '' }: Props = $props()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -32,7 +29,7 @@
|
|||||||
size="square-md"
|
size="square-md"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
aria-label="Copy"
|
aria-label="Copy"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
copied = true
|
copied = true
|
||||||
navigator.clipboard.writeText(value)
|
navigator.clipboard.writeText(value)
|
||||||
setTimeout(() => (copied = false), 2000)
|
setTimeout(() => (copied = false), 2000)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { run, createBubbler } from 'svelte/legacy';
|
import { run, createBubbler } from 'svelte/legacy'
|
||||||
|
|
||||||
const bubble = createBubbler();
|
const bubble = createBubbler()
|
||||||
import {
|
import {
|
||||||
buttonColor,
|
buttonColor,
|
||||||
buttonSize,
|
buttonSize,
|
||||||
@@ -24,12 +24,11 @@
|
|||||||
|
|
||||||
type T = $$Generic
|
type T = $$Generic
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let open = $state(false)
|
let open = $state(false)
|
||||||
let element: HTMLSelectElement | undefined = $state()
|
let element: HTMLSelectElement | undefined = $state()
|
||||||
|
|
||||||
let options: { value: any; label: string | null; disabled: boolean }[] = $state([])
|
let options: { value: any; label: string | null; disabled: boolean }[] =
|
||||||
|
$state([])
|
||||||
|
|
||||||
// Capture all options from the select element
|
// Capture all options from the select element
|
||||||
run(() => {
|
run(() => {
|
||||||
@@ -40,7 +39,7 @@
|
|||||||
disabled: option.disabled,
|
disabled: option.disabled,
|
||||||
}))
|
}))
|
||||||
: []
|
: []
|
||||||
});
|
})
|
||||||
|
|
||||||
const dispatcher = createEventDispatcher<{
|
const dispatcher = createEventDispatcher<{
|
||||||
change: any
|
change: any
|
||||||
@@ -48,16 +47,16 @@
|
|||||||
input: any
|
input: any
|
||||||
}>()
|
}>()
|
||||||
interface Props {
|
interface Props {
|
||||||
value?: T | undefined;
|
value?: T | undefined
|
||||||
placeholder?: string | undefined;
|
placeholder?: string | undefined
|
||||||
label?: string | undefined;
|
label?: string | undefined
|
||||||
size?: ButtonSize;
|
size?: ButtonSize
|
||||||
shadow?: ButtonShadow;
|
shadow?: ButtonShadow
|
||||||
id?: string;
|
id?: string
|
||||||
class?: string;
|
class?: string
|
||||||
customLabel?: import('svelte').Snippet;
|
customLabel?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet
|
||||||
customOption?: import('svelte').Snippet<[any]>;
|
customOption?: import('svelte').Snippet<[any]>
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -70,9 +69,8 @@
|
|||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
customLabel,
|
customLabel,
|
||||||
children,
|
children,
|
||||||
customOption
|
customOption,
|
||||||
}: Props = $props();
|
}: Props = $props()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 {clazz}">
|
<div class="flex flex-col gap-1 {clazz}">
|
||||||
@@ -85,8 +83,7 @@
|
|||||||
<div class="w-full relative">
|
<div class="w-full relative">
|
||||||
<Menu bind:open>
|
<Menu bind:open>
|
||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
<select
|
<select
|
||||||
|
|
||||||
{id}
|
{id}
|
||||||
bind:this={element}
|
bind:this={element}
|
||||||
class="{buttonSize[size]} {buttonShadow[
|
class="{buttonSize[size]} {buttonShadow[
|
||||||
@@ -96,12 +93,12 @@
|
|||||||
{clazz}"
|
{clazz}"
|
||||||
bind:value
|
bind:value
|
||||||
onmousedown={(e) => {
|
onmousedown={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}}
|
}}
|
||||||
onkeypress={(e) => {
|
onkeypress={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
open = !open
|
open = !open
|
||||||
}}
|
}}
|
||||||
onchange={bubble('change')}
|
onchange={bubble('change')}
|
||||||
oncontextmenu={bubble('contextmenu')}
|
oncontextmenu={bubble('contextmenu')}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
@@ -111,13 +108,16 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</select>
|
</select>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
{#each options as option}
|
{#each options as option}
|
||||||
{#if customOption}{@render customOption({ option, selected: option.value == value, })}{:else}
|
{#if customOption}{@render customOption({
|
||||||
|
option,
|
||||||
|
selected: option.value == value,
|
||||||
|
})}{:else}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:contextmenu={() => dispatcher('contextmenu')}
|
on:contextmenu={() => dispatcher('contextmenu')}
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
value = option.value
|
value = option.value
|
||||||
dispatcher('change')
|
dispatcher('change')
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -8,13 +8,13 @@
|
|||||||
import Portal from '../popover/Portal.svelte'
|
import Portal from '../popover/Portal.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
action?: string | undefined;
|
action?: string | undefined
|
||||||
open?: boolean;
|
open?: boolean
|
||||||
title?: string | undefined;
|
title?: string | undefined
|
||||||
dismissable?: boolean;
|
dismissable?: boolean
|
||||||
customTitle?: import('svelte').Snippet;
|
customTitle?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet
|
||||||
actions?: import('svelte').Snippet<[any]>;
|
actions?: import('svelte').Snippet<[any]>
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
dismissable = true,
|
dismissable = true,
|
||||||
customTitle,
|
customTitle,
|
||||||
children,
|
children,
|
||||||
actions
|
actions,
|
||||||
}: Props = $props();
|
}: Props = $props()
|
||||||
|
|
||||||
let el: any = $state()
|
let el: any = $state()
|
||||||
|
|
||||||
@@ -70,14 +70,14 @@ bg-white/50 dark:bg-black/50 box-border p-4"
|
|||||||
class="absolute top-0 right-0 m-2 text-slate-600 dark:text-zinc-400"
|
class="absolute top-0 right-0 m-2 text-slate-600 dark:text-zinc-400"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="square-sm"
|
size="square-sm"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
open = false
|
open = false
|
||||||
dispatcher('dismissed')
|
dispatcher('dismissed')
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={XMark} size="20" mini />
|
<Icon src={XMark} size="20" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
<h1 class="font-semibold text-xl max-w-full">
|
<h1 class="font-semibold text-xl max-w-full">
|
||||||
@@ -90,10 +90,10 @@ bg-white/50 dark:bg-black/50 box-border p-4"
|
|||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
{#if action}
|
{#if action}
|
||||||
<div class="mt-2 flex w-full">
|
<div class="mt-2 flex w-full">
|
||||||
{#if actions}{@render actions({ action, })}{:else}
|
{#if actions}{@render actions({ action })}{:else}
|
||||||
<Button
|
<Button
|
||||||
class="w-full"
|
class="w-full"
|
||||||
on:click={(e) => {
|
onclick={(e) => {
|
||||||
dispatcher('action', e)
|
dispatcher('action', e)
|
||||||
open = false
|
open = false
|
||||||
dispatcher('dismissed')
|
dispatcher('dismissed')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { run } from 'svelte/legacy';
|
import { run } from 'svelte/legacy'
|
||||||
|
|
||||||
import Button from '../button/Button.svelte'
|
import Button from '../button/Button.svelte'
|
||||||
import Modal from '../modal/Modal.svelte'
|
import Modal from '../modal/Modal.svelte'
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
// reactivity hack
|
// reactivity hack
|
||||||
run(() => {
|
run(() => {
|
||||||
open = $shownModal ? true : false
|
open = $shownModal ? true : false
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $shownModal}
|
{#if $shownModal}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<Button
|
<Button
|
||||||
size="lg"
|
size="lg"
|
||||||
class="flex-1 w-full"
|
class="flex-1 w-full"
|
||||||
on:click={action.action}
|
onclick={action.action}
|
||||||
color={action.type}
|
color={action.type}
|
||||||
>
|
>
|
||||||
{#if action.icon}
|
{#if action.icon}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
{...rest}
|
{...rest}
|
||||||
on:click
|
|
||||||
{color}
|
{color}
|
||||||
rounding="none"
|
rounding="none"
|
||||||
class="w-full px-2 rounded-lg min-h-[36px] font-normal {disabled
|
class="w-full px-2 rounded-lg min-h-[36px] font-normal {disabled
|
||||||
|
|||||||
@@ -4,12 +4,9 @@
|
|||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { Icon, MagnifyingGlass } from 'svelte-hero-icons'
|
import { Icon, MagnifyingGlass } from 'svelte-hero-icons'
|
||||||
|
|
||||||
|
|
||||||
type T = $$Generic
|
type T = $$Generic
|
||||||
let items: T[] = $state([])
|
let items: T[] = $state([])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is here so that the menu doesn't open as soon as it's mounted.
|
* This is here so that the menu doesn't open as soon as it's mounted.
|
||||||
*/
|
*/
|
||||||
@@ -22,14 +19,14 @@
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
query?: string;
|
query?: string
|
||||||
selected?: T | undefined;
|
selected?: T | undefined
|
||||||
search: (query: string) => Promise<T[]>;
|
search: (query: string) => Promise<T[]>
|
||||||
extractName: (item: T) => string;
|
extractName: (item: T) => string
|
||||||
select?: any;
|
select?: any
|
||||||
input?: import('svelte').Snippet;
|
input?: import('svelte').Snippet
|
||||||
noresults?: import('svelte').Snippet;
|
noresults?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet<[any]>;
|
children?: import('svelte').Snippet<[any]>
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,15 +36,15 @@
|
|||||||
search,
|
search,
|
||||||
extractName,
|
extractName,
|
||||||
select = (item: T) => {
|
select = (item: T) => {
|
||||||
selected = item
|
selected = item
|
||||||
query = extractName(item)
|
query = extractName(item)
|
||||||
dispatcher('select', item)
|
dispatcher('select', item)
|
||||||
},
|
},
|
||||||
input,
|
input,
|
||||||
noresults,
|
noresults,
|
||||||
children,
|
children,
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props()
|
||||||
|
|
||||||
const debounceFunc = debounce(async () => {
|
const debounceFunc = debounce(async () => {
|
||||||
searching = true
|
searching = true
|
||||||
@@ -60,7 +57,7 @@
|
|||||||
<div class="relative">
|
<div class="relative">
|
||||||
<Menu bind:open={openMenu}>
|
<Menu bind:open={openMenu}>
|
||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
{#if input}{@render input()}{:else}
|
{#if input}{@render input()}{:else}
|
||||||
<TextInput
|
<TextInput
|
||||||
bind:value={query}
|
bind:value={query}
|
||||||
on:input={(e) => {
|
on:input={(e) => {
|
||||||
@@ -79,13 +76,13 @@
|
|||||||
inlineAffixes
|
inlineAffixes
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<div class="h-5 flex items-center">
|
<div class="h-5 flex items-center">
|
||||||
<Icon src={MagnifyingGlass} mini size="16" />
|
<Icon src={MagnifyingGlass} mini size="16" />
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</TextInput>
|
</TextInput>
|
||||||
{/if}
|
{/if}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#if searching}
|
{#if searching}
|
||||||
<div class="w-full h-24 grid place-items-center">
|
<div class="w-full h-24 grid place-items-center">
|
||||||
<Spinner width={24} />
|
<Spinner width={24} />
|
||||||
@@ -96,8 +93,13 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
{#each items as item}
|
{#each items as item}
|
||||||
{#if children}{@render children({ extractName, item, dispatcher, select, })}{:else}
|
{#if children}{@render children({
|
||||||
<MenuButton on:click={() => select(item)}>
|
extractName,
|
||||||
|
item,
|
||||||
|
dispatcher,
|
||||||
|
select,
|
||||||
|
})}{:else}
|
||||||
|
<MenuButton onclick={() => select(item)}>
|
||||||
{extractName(item)}
|
{extractName(item)}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<Button
|
<Button
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
on:click={() => goto($page.url, { invalidateAll: true })}
|
onclick={() => goto($page.url, { invalidateAll: true })}
|
||||||
>
|
>
|
||||||
{$t('message.retry')}
|
{$t('message.retry')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
+23
-20
@@ -77,28 +77,31 @@
|
|||||||
themeVars.subscribe((vars) => {
|
themeVars.subscribe((vars) => {
|
||||||
document.body.setAttribute('style', vars)
|
document.body.setAttribute('style', vars)
|
||||||
})
|
})
|
||||||
// $effect(() => {
|
|
||||||
// if (settings) {
|
|
||||||
// document.body.classList.remove(
|
|
||||||
// 'font-display',
|
|
||||||
// 'font-inter',
|
|
||||||
// 'font-sans',
|
|
||||||
// 'font-system',
|
|
||||||
// 'font-nunito',
|
|
||||||
// )
|
|
||||||
// document.body.classList.add(
|
|
||||||
// settings.font == 'inter'
|
|
||||||
// ? 'font-inter'
|
|
||||||
// : settings.font == 'system'
|
|
||||||
// ? 'font-system'
|
|
||||||
// : settings.font == 'satoshi/nunito'
|
|
||||||
// ? 'font-nunito'
|
|
||||||
// : 'font-sans',
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (browser) {
|
||||||
|
$effect(() => {
|
||||||
|
if (settings) {
|
||||||
|
document.body.classList.remove(
|
||||||
|
'font-display',
|
||||||
|
'font-inter',
|
||||||
|
'font-sans',
|
||||||
|
'font-system',
|
||||||
|
'font-nunito',
|
||||||
|
)
|
||||||
|
document.body.classList.add(
|
||||||
|
settings.font == 'inter'
|
||||||
|
? 'font-inter'
|
||||||
|
: settings.font == 'system'
|
||||||
|
? 'font-system'
|
||||||
|
: settings.font == 'satoshi/nunito'
|
||||||
|
? 'font-nunito'
|
||||||
|
: 'font-sans',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
@@ -85,15 +85,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<p>This removes the account from Photon, it does not delete the account.</p>
|
<p>This removes the account from Photon, it does not delete the account.</p>
|
||||||
<div class="flex flex-row gap-2 items-center">
|
<div class="flex flex-row gap-2 items-center">
|
||||||
<Button
|
<Button size="lg" class="flex-1" onclick={() => (removing.shown = false)}>
|
||||||
size="lg"
|
|
||||||
class="flex-1"
|
|
||||||
on:click={() => (removing.shown = false)}
|
|
||||||
>
|
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
removing.shown = false
|
removing.shown = false
|
||||||
if (removing.account) deleteProfile(removing.account.id)
|
if (removing.account) deleteProfile(removing.account.id)
|
||||||
}}
|
}}
|
||||||
@@ -182,7 +178,7 @@
|
|||||||
title={profile.id == $currentProfile?.id
|
title={profile.id == $currentProfile?.id
|
||||||
? 'Switch'
|
? 'Switch'
|
||||||
: 'Current'}
|
: 'Current'}
|
||||||
on:click={async () => {
|
onclick={async () => {
|
||||||
if (profile.id != $currentProfile?.id) {
|
if (profile.id != $currentProfile?.id) {
|
||||||
switching = profile.id
|
switching = profile.id
|
||||||
await setUserID(profile.id)
|
await setUserID(profile.id)
|
||||||
@@ -248,7 +244,7 @@
|
|||||||
size="square-md"
|
size="square-md"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
title={$t('account.moveUp')}
|
title={$t('account.moveUp')}
|
||||||
on:click={() => moveProfile(profile.id, true)}
|
onclick={() => moveProfile(profile.id, true)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ChevronUp} size="16" mini />
|
<Icon src={ChevronUp} size="16" mini />
|
||||||
@@ -258,7 +254,7 @@
|
|||||||
size="square-md"
|
size="square-md"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
title={$t('account.moveDown')}
|
title={$t('account.moveDown')}
|
||||||
on:click={() => moveProfile(profile.id, false)}
|
onclick={() => moveProfile(profile.id, false)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ChevronDown} size="16" mini />
|
<Icon src={ChevronDown} size="16" mini />
|
||||||
@@ -267,7 +263,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
disabled={!profile.color}
|
disabled={!profile.color}
|
||||||
on:click={() => (profile.color = undefined)}
|
onclick={() => (profile.color = undefined)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ArrowUturnLeft} size="16" mini />
|
<Icon src={ArrowUturnLeft} size="16" mini />
|
||||||
@@ -276,7 +272,7 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if settings.debugInfo}
|
{#if settings.debugInfo}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
debugProfile = profile
|
debugProfile = profile
|
||||||
debugging = !debugging
|
debugging = !debugging
|
||||||
}}
|
}}
|
||||||
@@ -289,7 +285,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if !LINKED_INSTANCE_URL || profile.user}
|
{#if !LINKED_INSTANCE_URL || profile.user}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:click={() => action(profile)}
|
onclick={() => action(profile)}
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
size="custom"
|
size="custom"
|
||||||
color="none"
|
color="none"
|
||||||
class="w-max hover:underline text-slate-600 dark:text-zinc-400"
|
class="w-max hover:underline text-slate-600 dark:text-zinc-400"
|
||||||
on:click={() => history?.back()}
|
onclick={() => history?.back()}
|
||||||
>
|
>
|
||||||
<Icon src={ArrowLeft} size="16" micro />
|
<Icon src={ArrowLeft} size="16" micro />
|
||||||
{$t('account.accounts')}
|
{$t('account.accounts')}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
size="custom"
|
size="custom"
|
||||||
color="none"
|
color="none"
|
||||||
class="w-max hover:underline text-slate-600 dark:text-zinc-400"
|
class="w-max hover:underline text-slate-600 dark:text-zinc-400"
|
||||||
on:click={() => history?.back()}
|
onclick={() => history?.back()}
|
||||||
>
|
>
|
||||||
<Icon src={ArrowLeft} size="16" micro />
|
<Icon src={ArrowLeft} size="16" micro />
|
||||||
{$t('account.accounts')}
|
{$t('account.accounts')}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
? '!text-red-500'
|
? '!text-red-500'
|
||||||
: ''}"
|
: ''}"
|
||||||
aria-label={$t('routes.admin.applications.deny')}
|
aria-label={$t('routes.admin.applications.deny')}
|
||||||
on:click={() => review(false)}
|
onclick={() => review(false)}
|
||||||
loading={denying || reviewing}
|
loading={denying || reviewing}
|
||||||
disabled={approving || denying || reviewing}
|
disabled={approving || denying || reviewing}
|
||||||
>
|
>
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
? '!text-green-500'
|
? '!text-green-500'
|
||||||
: ''}"
|
: ''}"
|
||||||
title={$t('routes.admin.applications.approve')}
|
title={$t('routes.admin.applications.approve')}
|
||||||
on:click={() => review(true)}
|
onclick={() => review(true)}
|
||||||
loading={approving}
|
loading={approving}
|
||||||
disabled={approving || denying || reviewing}
|
disabled={approving || denying || reviewing}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
|
|
||||||
<Header pageHeader class="font-bold text-2xl flex items-center justify-between">
|
<Header pageHeader class="font-bold text-2xl flex items-center justify-between">
|
||||||
{$t('routes.admin.federation.title')}
|
{$t('routes.admin.federation.title')}
|
||||||
<Button color="primary" on:click={save} loading={saving} disabled={saving}>
|
<Button color="primary" onclick={save} loading={saving} disabled={saving}>
|
||||||
{$t('common.save')}
|
{$t('common.save')}
|
||||||
</Button>
|
</Button>
|
||||||
</Header>
|
</Header>
|
||||||
@@ -239,7 +239,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="square-md"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
if (!data.federated_instances?.federated_instances?.blocked)
|
if (!data.federated_instances?.federated_instances?.blocked)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="square-md"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
if (!data.federated_instances?.federated_instances?.allowed)
|
if (!data.federated_instances?.federated_instances?.allowed)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
<Header pageHeader class="justify-between">
|
<Header pageHeader class="justify-between">
|
||||||
{$t('routes.admin.taglines.title')}<Button
|
{$t('routes.admin.taglines.title')}<Button
|
||||||
color="primary"
|
color="primary"
|
||||||
on:click={save}
|
onclick={save}
|
||||||
loading={saving}
|
loading={saving}
|
||||||
disabled={saving}
|
disabled={saving}
|
||||||
size="lg"
|
size="lg"
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<Markdown source={tagline} inline />
|
<Markdown source={tagline} inline />
|
||||||
|
|
||||||
<div class="flex gap-2 ml-auto">
|
<div class="flex gap-2 ml-auto">
|
||||||
<Button on:click={() => action(tagline)} size="square-md">
|
<Button onclick={() => action(tagline)} size="square-md">
|
||||||
<Icon src={Trash} mini size="16" />
|
<Icon src={Trash} mini size="16" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<Button on:click={save} color="primary" size="lg" class="w-full">
|
<Button onclick={save} color="primary" size="lg" class="w-full">
|
||||||
{$t('common.save')}
|
{$t('common.save')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
{#each data.site?.admins ?? [] as admin}
|
{#each data.site?.admins ?? [] as admin}
|
||||||
<div class="py-3 flex items-center justify-between">
|
<div class="py-3 flex items-center justify-between">
|
||||||
<UserLink avatar showInstance={false} user={admin.person} />
|
<UserLink avatar showInstance={false} user={admin.person} />
|
||||||
<Button on:click={() => action(admin.person.id)} size="square-md">
|
<Button onclick={() => action(admin.person.id)} size="square-md">
|
||||||
<Icon src={Trash} mini size="16" />
|
<Icon src={Trash} mini size="16" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button size="square-md" on:click={() => action(moderator.moderator)}>
|
<Button size="square-md" onclick={() => action(moderator.moderator)}>
|
||||||
<Icon src={Trash} mini size="16" />
|
<Icon src={Trash} mini size="16" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ items-center px-2 w-max"
|
|||||||
|
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<Button
|
<Button
|
||||||
on:click={() => goto($page.url, { invalidateAll: true })}
|
onclick={() => goto($page.url, { invalidateAll: true })}
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
title={$t('common.refresh')}
|
title={$t('common.refresh')}
|
||||||
@@ -146,7 +146,7 @@ items-center px-2 w-max"
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={markAllAsRead}
|
onclick={markAllAsRead}
|
||||||
loading={markingAsRead}
|
loading={markingAsRead}
|
||||||
disabled={markingAsRead}
|
disabled={markingAsRead}
|
||||||
size="lg"
|
size="lg"
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
color={item.read ? 'secondary' : 'primary'}
|
color={item.read ? 'secondary' : 'primary'}
|
||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
on:click={(e) => {
|
onclick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
markAsRead(!item.read)
|
markAsRead(!item.read)
|
||||||
}}
|
}}
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
color={item.read ? 'secondary' : 'primary'}
|
color={item.read ? 'secondary' : 'primary'}
|
||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
on:click={(e) => {
|
onclick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
markAsRead(!item.read)
|
markAsRead(!item.read)
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
import { EllipsisVertical, Flag, Icon, Trash } from 'svelte-hero-icons'
|
import { EllipsisVertical, Flag, Icon, Trash } from 'svelte-hero-icons'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
message: PrivateMessageView;
|
message: PrivateMessageView
|
||||||
primary?: boolean;
|
primary?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
let { message, primary = false }: Props = $props();
|
let { message, primary = false }: Props = $props()
|
||||||
|
|
||||||
const dispatch = createEventDispatcher<{ delete: boolean; report: boolean }>()
|
const dispatch = createEventDispatcher<{ delete: boolean; report: boolean }>()
|
||||||
</script>
|
</script>
|
||||||
@@ -33,36 +33,35 @@
|
|||||||
</div>
|
</div>
|
||||||
<Menu>
|
<Menu>
|
||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
<Button
|
<Button
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
class="opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-all flex-shrink-0"
|
class="opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-all flex-shrink-0"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
|
|
||||||
title={$t('post.actions.more.actions')}
|
title={$t('post.actions.more.actions')}
|
||||||
>
|
>
|
||||||
<Icon src={EllipsisVertical} size="16" micro />
|
<Icon src={EllipsisVertical} size="16" micro />
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuDivider>{$t('post.actions.more.actions')}</MenuDivider>
|
<MenuDivider>{$t('post.actions.more.actions')}</MenuDivider>
|
||||||
{#if primary}
|
{#if primary}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() => dispatch('delete', true)}
|
onclick={() => dispatch('delete', true)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={Trash} size="16" micro />
|
<Icon src={Trash} size="16" micro />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{$t('post.actions.more.delete')}
|
{$t('post.actions.more.delete')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{:else}
|
{:else}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() => dispatch('report', true)}
|
onclick={() => dispatch('report', true)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={Flag} size="16" micro />
|
<Icon src={Flag} size="16" micro />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{$t('moderation.report')}
|
{$t('moderation.report')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<Button
|
<Button
|
||||||
on:click={resolve}
|
onclick={resolve}
|
||||||
class="ml-auto {item.resolved
|
class="ml-auto {item.resolved
|
||||||
? '!text-green-600 dark:!text-green-400'
|
? '!text-green-600 dark:!text-green-400'
|
||||||
: ''}"
|
: ''}"
|
||||||
|
|||||||
@@ -157,7 +157,7 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
searchParam(
|
searchParam(
|
||||||
$page.url,
|
$page.url,
|
||||||
'',
|
'',
|
||||||
|
|||||||
@@ -236,7 +236,7 @@
|
|||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
<Button
|
<Button
|
||||||
class="ml-auto"
|
class="ml-auto"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
if ($profile?.jwt) {
|
if ($profile?.jwt) {
|
||||||
fetchOnHome($profile?.jwt)
|
fetchOnHome($profile?.jwt)
|
||||||
}
|
}
|
||||||
@@ -272,7 +272,7 @@
|
|||||||
title={data.post.post_view.post.name}
|
title={data.post.post_view.post.name}
|
||||||
style="width: max-content;"
|
style="width: max-content;"
|
||||||
/>
|
/>
|
||||||
<Button on:click={() => history.back()} size="square-md">
|
<Button onclick={() => history.back()} size="square-md">
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ArrowLeft} micro size="16" />
|
<Icon src={ArrowLeft} micro size="16" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -350,7 +350,7 @@
|
|||||||
? `/comment/${$page.params.instance}/${data.thread.showContext}`
|
? `/comment/${$page.params.instance}/${data.thread.showContext}`
|
||||||
: undefined}
|
: undefined}
|
||||||
class="hover:bg-white/50 dark:hover:bg-zinc-800/30"
|
class="hover:bg-white/50 dark:hover:bg-zinc-800/30"
|
||||||
on:click={data.thread.singleThread ? reloadComments : undefined}
|
onclick={data.thread.singleThread ? reloadComments : undefined}
|
||||||
>
|
>
|
||||||
{data.thread.showContext
|
{data.thread.showContext
|
||||||
? $t('routes.post.thread.context')
|
? $t('routes.post.thread.context')
|
||||||
@@ -381,7 +381,7 @@
|
|||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
{#if !commenting}
|
{#if !commenting}
|
||||||
<EndPlaceholder class="">
|
<EndPlaceholder class="">
|
||||||
<Button color="primary" on:click={() => (commenting = true)}>
|
<Button color="primary" onclick={() => (commenting = true)}>
|
||||||
<Icon src={PlusCircle} size="16" micro />
|
<Icon src={PlusCircle} size="16" micro />
|
||||||
{$t('routes.post.addComment')}
|
{$t('routes.post.addComment')}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -401,7 +401,7 @@
|
|||||||
{$t('filter.sort.controversial')}
|
{$t('filter.sort.controversial')}
|
||||||
</option>
|
</option>
|
||||||
</Select>
|
</Select>
|
||||||
<Button size="square-md" on:click={reloadComments}>
|
<Button size="square-md" onclick={reloadComments}>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
<Icon src={ArrowPath} size="16" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -447,7 +447,7 @@
|
|||||||
{$t('filter.sort.controversial')}
|
{$t('filter.sort.controversial')}
|
||||||
</option>
|
</option>
|
||||||
</Select>
|
</Select>
|
||||||
<Button size="square-md" on:click={reloadComments}>
|
<Button size="square-md" onclick={reloadComments}>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
<Icon src={ArrowPath} size="16" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -485,7 +485,7 @@
|
|||||||
{#snippet action()}
|
{#snippet action()}
|
||||||
<Button
|
<Button
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
on:click={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
|
onclick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ChevronDoubleUp} mini size="16" />
|
<Icon src={ChevronDoubleUp} mini size="16" />
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
title="Unblock"
|
title="Unblock"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
on:click={() => action(block)}
|
onclick={() => action(block)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={XMark} mini size="16" />
|
<Icon src={XMark} mini size="16" />
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
title="Unblock"
|
title="Unblock"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
on:click={() => action(block)}
|
onclick={() => action(block)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={XMark} mini size="16" />
|
<Icon src={XMark} mini size="16" />
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
title="Unblock"
|
title="Unblock"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
on:click={() => action(block)}
|
onclick={() => action(block)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={XMark} mini size="16" />
|
<Icon src={XMark} mini size="16" />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { run, preventDefault } from 'svelte/legacy';
|
import { run, preventDefault } from 'svelte/legacy'
|
||||||
|
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
@@ -10,15 +10,15 @@
|
|||||||
import { Button, Material, TextInput, toast } from 'mono-svelte'
|
import { Button, Material, TextInput, toast } from 'mono-svelte'
|
||||||
import { ClipboardDocument, Icon } from 'svelte-hero-icons'
|
import { ClipboardDocument, Icon } from 'svelte-hero-icons'
|
||||||
|
|
||||||
let { data } = $props();
|
let { data } = $props()
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let totpLink: string | undefined = $state(undefined)
|
let totpLink: string | undefined = $state(undefined)
|
||||||
let totpEnabled;
|
let totpEnabled
|
||||||
run(() => {
|
run(() => {
|
||||||
totpEnabled =
|
totpEnabled =
|
||||||
data.my_user?.local_user_view.local_user.totp_2fa_enabled ?? totpLink
|
data.my_user?.local_user_view.local_user.totp_2fa_enabled ?? totpLink
|
||||||
});
|
})
|
||||||
|
|
||||||
let verify_totp = $state('')
|
let verify_totp = $state('')
|
||||||
|
|
||||||
@@ -65,18 +65,17 @@
|
|||||||
label={$t('form.profile.2fa.totp')}
|
label={$t('form.profile.2fa.totp')}
|
||||||
>
|
>
|
||||||
{#snippet suffix()}
|
{#snippet suffix()}
|
||||||
<button
|
<button
|
||||||
|
|
||||||
class="contents"
|
class="contents"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
if (!totpLink) return
|
if (!totpLink) return
|
||||||
navigator.clipboard?.writeText(totpLink)
|
navigator.clipboard?.writeText(totpLink)
|
||||||
toast({ content: $t('toast.copied') })
|
toast({ content: $t('toast.copied') })
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon src={ClipboardDocument} size="20" mini />
|
<Icon src={ClipboardDocument} size="20" mini />
|
||||||
</button>
|
</button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<span class="font-normal text-xs">
|
<span class="font-normal text-xs">
|
||||||
{$t('form.profile.2fa.paste')}
|
{$t('form.profile.2fa.paste')}
|
||||||
</span>
|
</span>
|
||||||
@@ -92,17 +91,17 @@
|
|||||||
label={$t('form.2fa')}
|
label={$t('form.2fa')}
|
||||||
/>
|
/>
|
||||||
{#if totpEnabled}
|
{#if totpEnabled}
|
||||||
<Button on:click={() => twofa(false, true)} size="lg" color="primary">
|
<Button onclick={() => twofa(false, true)} size="lg" color="primary">
|
||||||
{$t('common.disable')}
|
{$t('common.disable')}
|
||||||
</Button>
|
</Button>
|
||||||
{:else}
|
{:else}
|
||||||
<Button on:click={() => twofa(true, true)} size="lg" color="primary">
|
<Button onclick={() => twofa(true, true)} size="lg" color="primary">
|
||||||
{$t('common.enable')}
|
{$t('common.enable')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
</form>
|
</form>
|
||||||
{:else}
|
{:else}
|
||||||
<Button on:click={() => twofa(true)} size="lg" color="primary">
|
<Button onclick={() => twofa(true)} size="lg" color="primary">
|
||||||
{$t('form.setup')}
|
{$t('form.setup')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Switch>
|
</Switch>
|
||||||
<Button size="lg" color="danger" on:click={() => deleteAccount(3)}>
|
<Button size="lg" color="danger" onclick={() => deleteAccount(3)}>
|
||||||
{$t('routes.profile.delete.title')}
|
{$t('routes.profile.delete.title')}
|
||||||
</Button>
|
</Button>
|
||||||
</Material>
|
</Material>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
title={$t('post.actions.more.delete')}
|
title={$t('post.actions.more.delete')}
|
||||||
on:click={() => deleteImage(image)}
|
onclick={() => deleteImage(image)}
|
||||||
size="square-md"
|
size="square-md"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@
|
|||||||
size="square-lg"
|
size="square-lg"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
class="self-end justify-self-center"
|
class="self-end justify-self-center"
|
||||||
on:click={() => (moreOptions = !moreOptions)}
|
onclick={() => (moreOptions = !moreOptions)}
|
||||||
>
|
>
|
||||||
<Icon src={ChevronDown} size="20" mini />
|
<Icon src={ChevronDown} size="20" mini />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<Button
|
<Button
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
importText = ''
|
importText = ''
|
||||||
importing = true
|
importing = true
|
||||||
}}
|
}}
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
const json = JSON.stringify(settings)
|
const json = JSON.stringify(settings)
|
||||||
navigator?.clipboard?.writeText?.(json)
|
navigator?.clipboard?.writeText?.(json)
|
||||||
toast({ content: $t('toast.copied') })
|
toast({ content: $t('toast.copied') })
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
toast({
|
toast({
|
||||||
content: $t('toast.resetSettings'),
|
content: $t('toast.resetSettings'),
|
||||||
action: () => {},
|
action: () => {},
|
||||||
@@ -508,7 +508,7 @@
|
|||||||
disabled={settings.dock.pins
|
disabled={settings.dock.pins
|
||||||
?.map((p) => p.url)
|
?.map((p) => p.url)
|
||||||
?.includes(pin.url)}
|
?.includes(pin.url)}
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
settings.dock.pins = [...(settings.dock.pins ?? []), pin]
|
settings.dock.pins = [...(settings.dock.pins ?? []), pin]
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -705,7 +705,7 @@
|
|||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="lg"
|
rounding="lg"
|
||||||
class="ml-auto"
|
class="ml-auto"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
settings.moderation.presets.splice(index, 1)
|
settings.moderation.presets.splice(index, 1)
|
||||||
settings.moderation.presets = settings.moderation.presets
|
settings.moderation.presets = settings.moderation.presets
|
||||||
}}
|
}}
|
||||||
@@ -740,7 +740,7 @@
|
|||||||
<Button
|
<Button
|
||||||
color="none"
|
color="none"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
settings.moderation.presets = [
|
settings.moderation.presets = [
|
||||||
...settings.moderation.presets,
|
...settings.moderation.presets,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -194,7 +194,7 @@
|
|||||||
{err}
|
{err}
|
||||||
</Material>
|
</Material>
|
||||||
{/await}
|
{/await}
|
||||||
<Button on:click={() => getCaptcha()} size="square-md">
|
<Button onclick={() => getCaptcha()} size="square-md">
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
<Icon src={ArrowPath} size="16" mini />
|
||||||
</Button>
|
</Button>
|
||||||
<TextInput required bind:value={verifyCaptcha} />
|
<TextInput required bind:value={verifyCaptcha} />
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
</Material>
|
</Material>
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
importing = !importing
|
importing = !importing
|
||||||
}}
|
}}
|
||||||
size="lg"
|
size="lg"
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
{$t('routes.theme.import')}
|
{$t('routes.theme.import')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
navigator.clipboard.writeText(JSON.stringify($theme.colors))
|
navigator.clipboard.writeText(JSON.stringify($theme.colors))
|
||||||
toast({ content: 'Copied theme to clipboard.' })
|
toast({ content: 'Copied theme to clipboard.' })
|
||||||
}}
|
}}
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={$theme.id <= 0}
|
disabled={$theme.id <= 0}
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
modal({
|
modal({
|
||||||
actions: [
|
actions: [
|
||||||
action({
|
action({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault } from 'svelte/legacy';
|
import { preventDefault } from 'svelte/legacy'
|
||||||
|
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { calculateVars, themeData, type Theme } from '$lib/ui/colors'
|
import { calculateVars, themeData, type Theme } from '$lib/ui/colors'
|
||||||
@@ -7,10 +7,10 @@
|
|||||||
import { CheckCircle, Icon, Trash } from 'svelte-hero-icons'
|
import { CheckCircle, Icon, Trash } from 'svelte-hero-icons'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
theme: Theme;
|
theme: Theme
|
||||||
}
|
}
|
||||||
|
|
||||||
let { theme = $bindable() }: Props = $props();
|
let { theme = $bindable() }: Props = $props()
|
||||||
|
|
||||||
let editingName = $state(false)
|
let editingName = $state(false)
|
||||||
</script>
|
</script>
|
||||||
@@ -33,10 +33,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="bg-white dark:bg-zinc-900 w-8 h-4 rounded-sm border border-slate-200 dark:border-zinc-800"
|
class="bg-white dark:bg-zinc-900 w-8 h-4 rounded-sm border border-slate-200 dark:border-zinc-800"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
class="w-3 h-3 bg-primary-900 dark:bg-primary-100 rounded-full ml-auto"
|
class="w-3 h-3 bg-primary-900 dark:bg-primary-100 rounded-full ml-auto"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
{#if theme.id == $themeData.currentTheme}
|
{#if theme.id == $themeData.currentTheme}
|
||||||
<Icon
|
<Icon
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
color="ghost"
|
color="ghost"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
class="flex-shrink-0"
|
class="flex-shrink-0"
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
modal({
|
modal({
|
||||||
actions: [
|
actions: [
|
||||||
action({
|
action({
|
||||||
@@ -97,8 +97,8 @@
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={Trash} size="16" mini />
|
<Icon src={Trash} size="16" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -138,13 +138,13 @@
|
|||||||
Are you sure you want to do this? (The button will enable in 3 seconds.)
|
Are you sure you want to do this? (The button will enable in 3 seconds.)
|
||||||
</p>
|
</p>
|
||||||
<div class="flex flex-row gap-2">
|
<div class="flex flex-row gap-2">
|
||||||
<Button size="lg" on:click={() => (purgingUser = false)} class="flex-1">
|
<Button size="lg" onclick={() => (purgingUser = false)} class="flex-1">
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
size="lg"
|
size="lg"
|
||||||
color="danger"
|
color="danger"
|
||||||
on:click={purgeUser}
|
onclick={purgeUser}
|
||||||
disabled={!purgeEnabled}
|
disabled={!purgeEnabled}
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
>
|
>
|
||||||
@@ -250,7 +250,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() =>
|
onclick={() =>
|
||||||
ban(
|
ban(
|
||||||
data.person_view.person.banned,
|
data.person_view.person.banned,
|
||||||
data.person_view.person,
|
data.person_view.person,
|
||||||
@@ -263,7 +263,7 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() => (purgingUser = !purgingUser)}
|
onclick={() => (purgingUser = !purgingUser)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon mini size="16" src={Fire} />
|
<Icon mini size="16" src={Fire} />
|
||||||
@@ -282,7 +282,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() => blockUser(data.person_view.person.id)}
|
onclick={() => blockUser(data.person_view.person.id)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon mini size="16" src={NoSymbol} />
|
<Icon mini size="16" src={NoSymbol} />
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<p>
|
<p>
|
||||||
{post}
|
{post}
|
||||||
</p>
|
</p>
|
||||||
<Button on:click={() => (post = placeholders.get('post'))} class="w-max">
|
<Button onclick={() => (post = placeholders.get('post'))} class="w-max">
|
||||||
Generate
|
Generate
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<p>
|
<p>
|
||||||
{comment}
|
{comment}
|
||||||
</p>
|
</p>
|
||||||
<Button on:click={() => (comment = placeholders.get('comment'))} class="w-max">
|
<Button onclick={() => (comment = placeholders.get('comment'))} class="w-max">
|
||||||
Generate
|
Generate
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
@@ -33,6 +33,6 @@
|
|||||||
<p>
|
<p>
|
||||||
{url}
|
{url}
|
||||||
</p>
|
</p>
|
||||||
<Button on:click={() => (url = placeholders.get('url'))} class="w-max">
|
<Button onclick={() => (url = placeholders.get('url'))} class="w-max">
|
||||||
Generate
|
Generate
|
||||||
</Button>
|
</Button>
|
||||||
Reference in new issue
Block a user