migrate: switch to svelte 5 events system for inputs
This commit is contained in:
1 parent
6f442eceab
commit
43a857ed66
11 files changed
+99
-98
No files matched your search
@@ -112,7 +112,7 @@
|
|||||||
value={newComment}
|
value={newComment}
|
||||||
actions={false}
|
actions={false}
|
||||||
preview={true}
|
preview={true}
|
||||||
on:confirm={save}
|
onconfirm={save}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
submit
|
submit
|
||||||
@@ -252,18 +252,18 @@
|
|||||||
label={$t('comment.reply')}
|
label={$t('comment.reply')}
|
||||||
{postId}
|
{postId}
|
||||||
parentId={node.comment_view.comment.id}
|
parentId={node.comment_view.comment.id}
|
||||||
on:comment={(e) => {
|
oncomment={(e) => {
|
||||||
node.children = [
|
node.children = [
|
||||||
{
|
{
|
||||||
children: [],
|
children: [],
|
||||||
comment_view: e.detail.comment_view,
|
comment_view: e.comment_view,
|
||||||
depth: node.depth + 1,
|
depth: node.depth + 1,
|
||||||
},
|
},
|
||||||
...node.children,
|
...node.children,
|
||||||
]
|
]
|
||||||
replying = false
|
replying = false
|
||||||
}}
|
}}
|
||||||
on:cancel={() => (replying = false)}
|
oncancel={() => (replying = false)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,12 +12,6 @@
|
|||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
import { Icon, XMark } from 'svelte-hero-icons'
|
import { Icon, XMark } from 'svelte-hero-icons'
|
||||||
|
|
||||||
const dispatch = createEventDispatcher<{
|
|
||||||
comment: CommentResponse
|
|
||||||
confirm: string
|
|
||||||
cancel: boolean
|
|
||||||
}>()
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
postId: number
|
postId: number
|
||||||
parentId?: number | undefined
|
parentId?: number | undefined
|
||||||
@@ -28,6 +22,9 @@
|
|||||||
value?: string
|
value?: string
|
||||||
actions?: boolean
|
actions?: boolean
|
||||||
preview?: boolean
|
preview?: boolean
|
||||||
|
oncomment?: (comment: CommentResponse) => void
|
||||||
|
onconfirm?: (value: string) => void
|
||||||
|
oncancel?: (cancel: boolean) => void
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,6 +38,9 @@
|
|||||||
value = $bindable(''),
|
value = $bindable(''),
|
||||||
actions = true,
|
actions = true,
|
||||||
preview: previewAction = true,
|
preview: previewAction = true,
|
||||||
|
oncancel,
|
||||||
|
oncomment,
|
||||||
|
onconfirm,
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
post_id: postId,
|
post_id: postId,
|
||||||
parent_id: parentId,
|
parent_id: parentId,
|
||||||
})
|
})
|
||||||
dispatch('comment', response)
|
oncomment?.(response)
|
||||||
|
|
||||||
value = ''
|
value = ''
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -92,13 +92,12 @@
|
|||||||
: (placeholder ?? placeholders.get('comment'))}
|
: (placeholder ?? placeholders.get('comment'))}
|
||||||
bind:value
|
bind:value
|
||||||
disabled={locked || loading || banned}
|
disabled={locked || loading || banned}
|
||||||
on:confirm={() => {
|
onconfirm={() => {
|
||||||
if (actions) {
|
if (actions) {
|
||||||
submit()
|
submit()
|
||||||
dispatch('confirm', value)
|
onconfirm?.(value)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:focus
|
|
||||||
previewButton={previewAction}
|
previewButton={previewAction}
|
||||||
>
|
>
|
||||||
<div class="flex-1"></div>
|
<div class="flex-1"></div>
|
||||||
@@ -106,19 +105,26 @@
|
|||||||
<Button
|
<Button
|
||||||
size="custom"
|
size="custom"
|
||||||
title={$t('common.cancel')}
|
title={$t('common.cancel')}
|
||||||
onclick={() => dispatch('cancel', true)}
|
onclick={() => oncancel?.(true)}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
class="w-8 h-8"
|
class="w-8 h-8"
|
||||||
rounding="xl"
|
rounding="pill"
|
||||||
>
|
>
|
||||||
<Icon src={XMark} size="16" micro />
|
<Icon
|
||||||
|
src={XMark}
|
||||||
|
size="20"
|
||||||
|
micro
|
||||||
|
class="text-slate-600 dark:text-zinc-400"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onclick={submit}
|
onclick={submit}
|
||||||
color="primary"
|
color="primary"
|
||||||
|
rounding="pill"
|
||||||
|
size="sm"
|
||||||
|
class="py-2 px-4"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={locked || loading || banned}
|
disabled={locked || loading || banned}
|
||||||
size="lg"
|
|
||||||
>
|
>
|
||||||
{$t('form.submit')}
|
{$t('form.submit')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
required
|
required
|
||||||
label={$t('form.name')}
|
label={$t('form.name')}
|
||||||
bind:value={formData.name}
|
bind:value={formData.name}
|
||||||
on:input={() => {
|
oninput={() => {
|
||||||
formData.name = formData.name.toLowerCase().replaceAll(' ', '_')
|
formData.name = formData.name.toLowerCase().replaceAll(' ', '_')
|
||||||
}}
|
}}
|
||||||
disabled={edit != undefined}
|
disabled={edit != undefined}
|
||||||
|
|||||||
@@ -32,9 +32,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul
|
<ul
|
||||||
class="flex flex-col list-none {settings.view == 'card'
|
class="flex flex-col list-none divide-y divide-slate-200 dark:divide-zinc-800"
|
||||||
? 'gap-3 md:gap-4'
|
|
||||||
: 'divide-y'} divide-slate-200 dark:divide-zinc-800"
|
|
||||||
>
|
>
|
||||||
{#if posts?.length == 0}
|
{#if posts?.length == 0}
|
||||||
<div class="h-full grid place-items-center">
|
<div class="h-full grid place-items-center">
|
||||||
@@ -63,7 +61,7 @@
|
|||||||
: settings.view}
|
: settings.view}
|
||||||
{post}
|
{post}
|
||||||
class="transition-all duration-250"
|
class="transition-all duration-250"
|
||||||
on:hide={() => {
|
onhide={() => {
|
||||||
posts = posts.toSpliced(index, 1)
|
posts = posts.toSpliced(index, 1)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -100,10 +98,7 @@
|
|||||||
easing: expoOut,
|
easing: expoOut,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span class="text-sm flex flex-row gap-2 items-center">
|
||||||
class="text-sm flex flex-row gap-2 items-center"
|
|
||||||
class:my-4={settings.view == 'card'}
|
|
||||||
>
|
|
||||||
Crossposts <hr class="w-full dark:border-zinc-800" />
|
Crossposts <hr class="w-full dark:border-zinc-800" />
|
||||||
{post.crossposts.length}
|
{post.crossposts.length}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -198,9 +198,7 @@
|
|||||||
<!-- <svelte:window on:keydown={handleKeydown} /> -->
|
<!-- <svelte:window on:keydown={handleKeydown} /> -->
|
||||||
|
|
||||||
<ul
|
<ul
|
||||||
class="flex flex-col list-none {settings.view == 'card'
|
class="flex flex-col list-none divide-y divide-slate-200 dark:divide-zinc-800"
|
||||||
? 'gap-3 md:gap-4'
|
|
||||||
: 'divide-y'} divide-slate-200 dark:divide-zinc-800"
|
|
||||||
>
|
>
|
||||||
{#if posts?.length == 0}
|
{#if posts?.length == 0}
|
||||||
<div class="h-full grid place-items-center">
|
<div class="h-full grid place-items-center">
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
Strikethrough,
|
Strikethrough,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import ImageUploadModal from '../lemmy/modal/ImageUploadModal.svelte'
|
import ImageUploadModal from '../lemmy/modal/ImageUploadModal.svelte'
|
||||||
|
import type { HTMLTextareaAttributes } from 'svelte/elements'
|
||||||
const dispatcher = createEventDispatcher<{ confirm: string }>()
|
import type { TextAreaProps } from 'mono-svelte/forms/TextArea.svelte'
|
||||||
|
|
||||||
let textArea: HTMLTextAreaElement | undefined = $state()
|
let textArea: HTMLTextAreaElement | undefined = $state()
|
||||||
|
|
||||||
@@ -69,9 +69,9 @@
|
|||||||
KeyH: () => wrapSelection('\n# ', ''),
|
KeyH: () => wrapSelection('\n# ', ''),
|
||||||
KeyK: () => wrapSelection('[](', ')'),
|
KeyK: () => wrapSelection('[](', ')'),
|
||||||
Enter: (e: any) => {
|
Enter: (e: any) => {
|
||||||
dispatcher('confirm', value)
|
onconfirm?.(value)
|
||||||
const newEvent = new Event('submit', { cancelable: true })
|
const newEvent = new Event('submit', { cancelable: true })
|
||||||
e.target.form.dispatchEvent(newEvent)
|
e?.target?.form?.dispatchEvent(newEvent)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props extends TextAreaProps {
|
||||||
images?: boolean
|
images?: boolean
|
||||||
value?: string
|
value?: string
|
||||||
label?: string | undefined
|
label?: string | undefined
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
class?: string
|
class?: string
|
||||||
customLabel?: import('svelte').Snippet
|
customLabel?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet
|
children?: import('svelte').Snippet
|
||||||
[key: string]: any
|
onconfirm?: (value: string) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -112,10 +112,11 @@
|
|||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
customLabel,
|
customLabel,
|
||||||
children,
|
children,
|
||||||
|
onconfirm,
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
run(() => {
|
$effect(() => {
|
||||||
if (!previewing && value) adjustHeight()
|
if (!previewing && value) adjustHeight()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -264,7 +265,7 @@ overflow-hidden transition-colors {clazz}"
|
|||||||
class="bg-inherit z-0 border-0 rounded-none !ring-0 focus:!ring-transparent !transition-none resize-none"
|
class="bg-inherit z-0 border-0 rounded-none !ring-0 focus:!ring-transparent !transition-none resize-none"
|
||||||
bind:value
|
bind:value
|
||||||
bind:element={textArea}
|
bind:element={textArea}
|
||||||
on:keydown={(e) => {
|
onkeydown={(e) => {
|
||||||
if (disabled) return
|
if (disabled) return
|
||||||
if (e.ctrlKey || e.metaKey) {
|
if (e.ctrlKey || e.metaKey) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -275,9 +276,8 @@ overflow-hidden transition-colors {clazz}"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:input={adjustHeight}
|
oninput={adjustHeight}
|
||||||
on:focus
|
onpaste={(e) => {
|
||||||
on:paste={(e) => {
|
|
||||||
if (!e.clipboardData?.files) return
|
if (!e.clipboardData?.files) return
|
||||||
const files = Array.from(e.clipboardData.files)
|
const files = Array.from(e.clipboardData.files)
|
||||||
if (files[0]?.type.startsWith('image/')) {
|
if (files[0]?.type.startsWith('image/')) {
|
||||||
|
|||||||
@@ -6,19 +6,8 @@
|
|||||||
md: 'p-4',
|
md: 'p-4',
|
||||||
lg: 'p-5',
|
lg: 'p-5',
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
<script lang="ts">
|
interface Props extends HTMLTextareaAttributes {
|
||||||
import { createBubbler } from 'svelte/legacy'
|
|
||||||
|
|
||||||
const bubble = createBubbler()
|
|
||||||
import Label from '../forms/Label.svelte'
|
|
||||||
import { generateID } from '../forms/helper.js'
|
|
||||||
|
|
||||||
const borderClass = `
|
|
||||||
border border-slate-200 dark:border-zinc-800
|
|
||||||
`
|
|
||||||
interface Props {
|
|
||||||
label?: string | undefined
|
label?: string | undefined
|
||||||
value?: string
|
value?: string
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
@@ -28,13 +17,25 @@
|
|||||||
id?: string
|
id?: string
|
||||||
rows?: number
|
rows?: number
|
||||||
element?: HTMLTextAreaElement | undefined
|
element?: HTMLTextAreaElement | undefined
|
||||||
class?: string
|
class?: ClassValue
|
||||||
customLabel?: import('svelte').Snippet
|
customLabel?: import('svelte').Snippet
|
||||||
suffix?: import('svelte').Snippet
|
suffix?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet
|
children?: import('svelte').Snippet
|
||||||
[key: string]: any
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type { Props as TextAreaProps }
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import type { ClassValue, HTMLTextareaAttributes } from 'svelte/elements'
|
||||||
|
|
||||||
|
import Label from '../forms/Label.svelte'
|
||||||
|
import { generateID } from '../forms/helper.js'
|
||||||
|
|
||||||
|
const borderClass = `
|
||||||
|
border border-slate-200 dark:border-zinc-800
|
||||||
|
`
|
||||||
|
|
||||||
let {
|
let {
|
||||||
label = undefined,
|
label = undefined,
|
||||||
value = $bindable(''),
|
value = $bindable(''),
|
||||||
@@ -74,22 +75,19 @@
|
|||||||
{disabled}
|
{disabled}
|
||||||
{rows}
|
{rows}
|
||||||
bind:value
|
bind:value
|
||||||
oninput={bubble('input')}
|
|
||||||
onchange={bubble('change')}
|
|
||||||
onkeydown={bubble('keydown')}
|
|
||||||
onfocus={bubble('focus')}
|
|
||||||
onpaste={bubble('paste')}
|
|
||||||
bind:this={element}
|
bind:this={element}
|
||||||
{...rest}
|
{...rest}
|
||||||
class="{sizeClass[size]} {borderClass} focus:border-slate-800
|
class={[
|
||||||
focus:dark:border-zinc-200 bg-white dark:bg-zinc-950
|
sizeClass[size],
|
||||||
focus:outline-none focus:ring-2 ring-slate-800/50 rounded-xl
|
borderClass,
|
||||||
dark:ring-zinc-200/50 transition-all text-sm w-full disabled:bg-slate-100
|
`focus:border-slate-800 focus:dark:border-zinc-200 bg-white dark:bg-zinc-950
|
||||||
|
focus:outline-none focus:ring-2 ring-slate-800/50 rounded-xl dark:ring-zinc-200/50
|
||||||
|
transition-all text-sm w-full disabled:bg-slate-100
|
||||||
disabled:cursor-not-allowed disabled:dark:bg-zinc-900 invalid:!border-red-500
|
disabled:cursor-not-allowed disabled:dark:bg-zinc-900 invalid:!border-red-500
|
||||||
peer invalid:text-red-500 z-10
|
peer invalid:text-red-500 z-10`,
|
||||||
{clazz || ''}"
|
suffix && 'rounded-b-none border-b-0',
|
||||||
class:rounded-b-none={suffix}
|
clazz,
|
||||||
class:border-b-0={suffix}
|
]}
|
||||||
></textarea>
|
></textarea>
|
||||||
{#if suffix}
|
{#if suffix}
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -15,16 +15,18 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createBubbler } from 'svelte/legacy'
|
import type {
|
||||||
|
HTMLInputAttributes,
|
||||||
|
HTMLInputTypeAttribute,
|
||||||
|
} from 'svelte/elements'
|
||||||
|
|
||||||
const bubble = createBubbler()
|
|
||||||
import Label from '../forms/Label.svelte'
|
import Label from '../forms/Label.svelte'
|
||||||
import { generateID } from '../forms/helper.js'
|
import { generateID } from '../forms/helper.js'
|
||||||
|
|
||||||
const borderClass = `
|
const borderClass = `
|
||||||
border border-slate-200 border-b-slate-300 dark:border-zinc-900 dark:border-t-zinc-800
|
border border-slate-200 border-b-slate-300 dark:border-zinc-900 dark:border-t-zinc-800
|
||||||
`
|
`
|
||||||
interface Props {
|
interface Props extends Omit<HTMLInputAttributes, 'size' | 'prefix'> {
|
||||||
label?: string | undefined
|
label?: string | undefined
|
||||||
value?: string
|
value?: string
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
@@ -40,7 +42,6 @@
|
|||||||
prefix?: import('svelte').Snippet
|
prefix?: import('svelte').Snippet
|
||||||
suffix?: import('svelte').Snippet
|
suffix?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet
|
children?: import('svelte').Snippet
|
||||||
[key: string]: any
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -78,11 +79,15 @@
|
|||||||
</Label>
|
</Label>
|
||||||
{/if}
|
{/if}
|
||||||
<div
|
<div
|
||||||
class="{shadowClass[shadow]} border {borderClass}
|
class={[
|
||||||
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring-2
|
shadowClass[shadow],
|
||||||
|
borderClass,
|
||||||
|
`border focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring-2
|
||||||
ring-slate-300 dark:ring-zinc-700
|
ring-slate-300 dark:ring-zinc-700
|
||||||
transition-colors
|
transition-colors
|
||||||
rounded-lg flex flex-row items-center text-sm {clazz}"
|
rounded-lg flex flex-row items-center text-sm`,
|
||||||
|
clazz,
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
{#if prefix}
|
{#if prefix}
|
||||||
<div
|
<div
|
||||||
@@ -101,25 +106,27 @@
|
|||||||
{disabled}
|
{disabled}
|
||||||
bind:value
|
bind:value
|
||||||
bind:this={element}
|
bind:this={element}
|
||||||
oninput={bubble('input')}
|
|
||||||
onchange={bubble('change')}
|
|
||||||
onfocus={bubble('focus')}
|
|
||||||
{...rest}
|
{...rest}
|
||||||
class="{sizeClass[size]} bg-white dark:bg-zinc-950
|
class={[
|
||||||
|
sizeClass[size],
|
||||||
|
`bg-white dark:bg-zinc-950
|
||||||
focus:outline-none rounded-lg text-sm w-full disabled:bg-slate-100
|
focus:outline-none rounded-lg text-sm w-full disabled:bg-slate-100
|
||||||
disabled:cursor-not-allowed disabled:dark:bg-zinc-950 invalid:!border-red-500
|
disabled:cursor-not-allowed disabled:dark:bg-zinc-950 invalid:!border-red-500
|
||||||
peer invalid:text-red-500 z-10
|
peer invalid:text-red-500 z-10`,
|
||||||
{clazz || ''}"
|
prefix && 'rounded-l-none',
|
||||||
class:rounded-l-none={prefix}
|
prefix && inlineAffixes && 'border-l-0',
|
||||||
class:border-l-0={prefix && inlineAffixes}
|
suffix && 'rounded-r-none',
|
||||||
class:rounded-r-none={suffix}
|
suffix && inlineAffixes && 'border-r-0',
|
||||||
class:border-r-0={suffix && inlineAffixes}
|
clazz,
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
{#if suffix}
|
{#if suffix}
|
||||||
<div
|
<div
|
||||||
class="rounded-lg rounded-l-none text-slate-600 dark:text-zinc-400 {inlineAffixes
|
class={[
|
||||||
? 'bg-white dark:bg-zinc-950 pl-0'
|
'rounded-lg rounded-l-none text-slate-600 dark:text-zinc-400',
|
||||||
: ''} {sizeClass[size]}"
|
inlineAffixes && 'bg-white dark:bg-zinc-950 pl-0',
|
||||||
|
sizeClass[size],
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
{@render suffix?.()}
|
{@render suffix?.()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -60,13 +60,13 @@
|
|||||||
{#if input}{@render input()}{:else}
|
{#if input}{@render input()}{:else}
|
||||||
<TextInput
|
<TextInput
|
||||||
bind:value={query}
|
bind:value={query}
|
||||||
on:input={(e) => {
|
oninput={(e) => {
|
||||||
searching = true
|
searching = true
|
||||||
openMenu = true
|
openMenu = true
|
||||||
dispatcher('input', e)
|
dispatcher('input', e)
|
||||||
debounceFunc()
|
debounceFunc()
|
||||||
}}
|
}}
|
||||||
on:focus={(e) => {
|
onfocus={(e) => {
|
||||||
searching = true
|
searching = true
|
||||||
openMenu = true
|
openMenu = true
|
||||||
dispatcher('input', e)
|
dispatcher('input', e)
|
||||||
|
|||||||
@@ -433,11 +433,8 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<CommentForm
|
<CommentForm
|
||||||
postId={data.post.post_view.post.id}
|
postId={data.post.post_view.post.id}
|
||||||
on:comment={(comment) =>
|
oncomment={(comment) =>
|
||||||
(comments.comments = [
|
(comments.comments = [comment.comment_view, ...comments.comments])}
|
||||||
comment.detail.comment_view,
|
|
||||||
...comments.comments,
|
|
||||||
])}
|
|
||||||
locked={(data.post.post_view.post.locked &&
|
locked={(data.post.post_view.post.locked &&
|
||||||
!(
|
!(
|
||||||
$profile?.user?.local_user_view.local_user.admin ||
|
$profile?.user?.local_user_view.local_user.admin ||
|
||||||
@@ -447,12 +444,12 @@
|
|||||||
)) ||
|
)) ||
|
||||||
page.params.instance.toLowerCase() != $instance.toLowerCase()}
|
page.params.instance.toLowerCase() != $instance.toLowerCase()}
|
||||||
banned={data.post.community_view.banned_from_community}
|
banned={data.post.community_view.banned_from_community}
|
||||||
on:focus={() => (commenting = true)}
|
onfocus={() => (commenting = true)}
|
||||||
tools={commenting}
|
tools={commenting}
|
||||||
preview={commenting}
|
preview={commenting}
|
||||||
placeholder={commenting ? undefined : $t('routes.post.addComment')}
|
placeholder={commenting ? undefined : $t('routes.post.addComment')}
|
||||||
rows={commenting ? 7 : 1}
|
rows={commenting ? 7 : 1}
|
||||||
on:cancel={() => (commenting = false)}
|
oncancel={() => (commenting = false)}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@
|
|||||||
label={$t('form.signup.chooseInstance')}
|
label={$t('form.signup.chooseInstance')}
|
||||||
required
|
required
|
||||||
{placeholder}
|
{placeholder}
|
||||||
on:input={() => {
|
oninput={() => {
|
||||||
selectedInstance = selectedInstance.toLowerCase().replaceAll(' ', '')
|
selectedInstance = selectedInstance.toLowerCase().replaceAll(' ', '')
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user