prep: replace $$props.class with props
This commit is contained in:
1 parent
3ca72662ca
commit
0718c8e0c6
69 files changed
+383
-214
No files matched your search
@@ -26,9 +26,11 @@
|
||||
export let taglines: Tagline[] | undefined = undefined
|
||||
export let admins: PersonView[] | undefined = undefined
|
||||
export let version: string | undefined = undefined
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<StickyCard class="w-full {$$props.class} text-slate-600 dark:text-zinc-400">
|
||||
<StickyCard class="w-full {clazz} text-slate-600 dark:text-zinc-400">
|
||||
{#if site.site.banner}
|
||||
<div
|
||||
class="rounded-xl
|
||||
|
||||
@@ -46,6 +46,10 @@
|
||||
|
||||
let editingLoad = false
|
||||
|
||||
export let contentClass: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
|
||||
async function save() {
|
||||
if (!$profile?.jwt || newComment.length <= 0) return
|
||||
|
||||
@@ -111,7 +115,7 @@
|
||||
<li
|
||||
class="py-3 relative {node.comment_view.comment.distinguished
|
||||
? ' text-primary-900 dark:text-primary-100'
|
||||
: ''} {highlight} {$$props.class}"
|
||||
: ''} {highlight} {clazz}"
|
||||
id={node.comment_view.comment.id.toString()}
|
||||
>
|
||||
{#if meta}
|
||||
@@ -194,7 +198,7 @@
|
||||
{/if}
|
||||
{#if open}
|
||||
<div
|
||||
class="relative {$$props.contentClass}"
|
||||
class="relative {contentClass}"
|
||||
transition:slide={{ duration: 400, easing: expoOut }}
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
export let community = false
|
||||
|
||||
export let meta: boolean = true
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Material
|
||||
@@ -23,7 +25,7 @@
|
||||
? 'py-5'
|
||||
: view == 'compact'
|
||||
? 'py-4'
|
||||
: 'py-5'} {$$props.class}"
|
||||
: 'py-5'} {clazz}"
|
||||
color="distinct"
|
||||
padding="none"
|
||||
>
|
||||
|
||||
@@ -140,11 +140,11 @@
|
||||
|
||||
loading.subscribing = false
|
||||
}
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<StickyCard
|
||||
class="min-w-full pt-0 text-slate-600 dark:text-zinc-400 {$$props.class}"
|
||||
>
|
||||
<StickyCard class="min-w-full pt-0 text-slate-600 dark:text-zinc-400 {clazz}">
|
||||
<Entity
|
||||
name={community_view.community.title}
|
||||
label="!{fullCommunityName(
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
export let counts: CommunityAggregates | undefined = undefined
|
||||
export let moderators: CommunityModeratorView[] = []
|
||||
export let blocked: boolean = false
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<EntityHeader
|
||||
@@ -67,7 +69,7 @@
|
||||
]
|
||||
: []}
|
||||
bio={community.description}
|
||||
class={$$props.class}
|
||||
class={clazz}
|
||||
>
|
||||
<button
|
||||
on:click={() => {
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
export let showCounts: boolean = true
|
||||
|
||||
let showInfo = false
|
||||
let clazz: string = 'py-4 flex flex-col gap-4 text-sm max-w-full relative'
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
{#if showInfo}
|
||||
@@ -36,10 +38,7 @@
|
||||
</Modal>
|
||||
{/if}
|
||||
|
||||
<div
|
||||
class={$$props.class ??
|
||||
'py-4 flex flex-col gap-4 text-sm max-w-full relative'}
|
||||
>
|
||||
<div class={clazz}>
|
||||
<div
|
||||
class="flex
|
||||
{view == 'cozy'
|
||||
|
||||
@@ -16,12 +16,15 @@
|
||||
export let badges = {
|
||||
nsfw: false,
|
||||
}
|
||||
|
||||
let clazz: string = ''
|
||||
export let instanceClass: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<a
|
||||
{...$$restProps}
|
||||
class="items-center flex flex-row gap-2 hover:underline max-w-full min-w-0 {$$props.class ||
|
||||
''}"
|
||||
class="items-center flex flex-row gap-2 hover:underline max-w-full min-w-0 {clazz}"
|
||||
href="/c/{community.name}@{new URL(community.actor_id).hostname}"
|
||||
data-sveltekit-preload-data="tap"
|
||||
>
|
||||
@@ -42,7 +45,7 @@
|
||||
{#if showInstance}
|
||||
<span
|
||||
class="text-slate-500 dark:text-zinc-500 font-normal
|
||||
instance-text flex-shrink {$$props.instanceClass || ''}"
|
||||
instance-text flex-shrink {instanceClass || ''}"
|
||||
>
|
||||
@{new URL(community.actor_id).hostname}
|
||||
</span>
|
||||
|
||||
@@ -37,9 +37,12 @@
|
||||
$: changeDefault
|
||||
? ($userSettings.defaultSort.sort = selected as SortType)
|
||||
: undefined
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div class="flex flex-row {$$props.class}">
|
||||
<div class="flex flex-row {clazz}">
|
||||
<Select
|
||||
{...$$restProps}
|
||||
class={selected?.startsWith('Top') ? 'rounded-r-none' : ''}
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
|
||||
export let message: PrivateMessageView
|
||||
export let meta: boolean = true
|
||||
|
||||
export let style: string = ''
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-2 text-sm" style={$$props.style ?? ''}>
|
||||
<div class="flex flex-col gap-2 text-sm" {style}>
|
||||
{#if meta}
|
||||
<div class="flex flex-row gap-2 items-center flex-wrap">
|
||||
<span class="font-medium text-xs">From</span>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<script lang="ts">
|
||||
export let width: number = 16
|
||||
export let filled: boolean = false
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
{#if filled}
|
||||
@@ -10,7 +13,7 @@
|
||||
viewBox="0 0 20 22"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="inline {$$props.class}"
|
||||
class="inline {clazz}"
|
||||
>
|
||||
<path
|
||||
d="M10.516 1.17C10.3767 1.03791 10.192 0.964283 10 0.964283C9.80801 0.964283 9.62333 1.03791 9.484 1.17C7.36127 3.18588 4.53412 4.29133 1.607 4.25C1.44753 4.24793 1.29156 4.29674 1.16172 4.38935C1.03189 4.48196 0.934957 4.61355 0.885 4.765C0.462973 6.05116 0.248618 7.39637 0.25 8.75C0.25 14.692 4.314 19.683 9.813 21.098C9.93566 21.1296 10.0643 21.1296 10.187 21.098C15.686 19.683 19.75 14.692 19.75 8.75C19.75 7.36 19.527 6.02 19.115 4.765C19.0652 4.61336 18.9684 4.48156 18.8385 4.38875C18.7087 4.29595 18.5526 4.247 18.393 4.249L18.25 4.25C15.254 4.25 12.533 3.08 10.516 1.17Z"
|
||||
@@ -24,7 +27,7 @@
|
||||
viewBox="0 0 20 22"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="inline {$$props.class}"
|
||||
class="inline {clazz}"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
|
||||
@@ -74,6 +74,10 @@
|
||||
goto(postLink(post.post))
|
||||
}
|
||||
}
|
||||
|
||||
export let style: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@@ -91,7 +95,7 @@
|
||||
{view == 'compact' ? 'py-3 list-type compact' : ''}
|
||||
{view == 'list' ? 'py-5 list-type' : ''}
|
||||
{view == 'cozy' ? 'py-5 flex flex-col gap-2' : ''}
|
||||
{$$props.class ?? ''}"
|
||||
{clazz ?? ''}"
|
||||
id={post.post.id.toString()}
|
||||
on:click={(e) => {
|
||||
onClick(e)
|
||||
@@ -101,7 +105,7 @@
|
||||
if (e.key == 'Enter') onClick(e)
|
||||
}}
|
||||
tabindex="0"
|
||||
style={$$props.style ?? ''}
|
||||
{style}
|
||||
>
|
||||
<PostMeta
|
||||
community={post.community}
|
||||
|
||||
@@ -82,6 +82,8 @@
|
||||
|
||||
$: buttonHeight = view == 'compact' ? 'h-7' : 'h-8'
|
||||
$: buttonSquare = view == 'compact' ? 'w-7 h-7' : 'w-8 h-8'
|
||||
|
||||
export let style: string = ''
|
||||
</script>
|
||||
|
||||
{#if editing}
|
||||
@@ -119,7 +121,7 @@
|
||||
<footer
|
||||
class="flex flex-row gap-2 items-center flex-shrink-0 {buttonHeight}"
|
||||
class:flex-row-reverse={$userSettings.posts.reverseActions}
|
||||
style={$$props.style ?? ''}
|
||||
{style}
|
||||
>
|
||||
<PostVote
|
||||
post={post.post}
|
||||
|
||||
@@ -27,18 +27,21 @@
|
||||
}
|
||||
|
||||
$: overflows = isOverflown(element, body)
|
||||
|
||||
export let style: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<svelte:element
|
||||
this={htmlElement}
|
||||
style={$$props.style ?? ''}
|
||||
{style}
|
||||
class="{!expanded
|
||||
? ` overflow-hidden
|
||||
bg-gradient-to-b text-transparent from-slate-600 via-slate-600
|
||||
dark:from-zinc-400 dark:via-zinc-400 bg-clip-text z-0
|
||||
${view == 'list' ? `max-h-24` : 'max-h-48'}`
|
||||
: 'text-slate-600 dark:text-zinc-400 max-h-full'} text-base {$$props.class ??
|
||||
''}"
|
||||
: 'text-slate-600 dark:text-zinc-400 max-h-full'} text-base {clazz}"
|
||||
class:pointer-events-none={!clickThrough}
|
||||
bind:this={element}
|
||||
>
|
||||
|
||||
@@ -98,6 +98,9 @@
|
||||
export let tags: Tag[] = []
|
||||
|
||||
let popoverOpen = false
|
||||
|
||||
export let style: string = ''
|
||||
export let titleClass: string = ''
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@@ -109,7 +112,7 @@
|
||||
? 'grid-rows-2'
|
||||
: 'grid-rows-1'} text-xs min-w-0 max-w-full"
|
||||
class:compact={view == 'compact'}
|
||||
style={$$props.style ?? ''}
|
||||
{style}
|
||||
>
|
||||
{#if showCommunity && community && subscribed && showCommunity}
|
||||
<Popover bind:open={popoverOpen} manual>
|
||||
@@ -280,7 +283,7 @@
|
||||
hover:text-primary-900 hover:dark:text-primary-100 transition-colors max-[480px]:!mt-0
|
||||
{$userSettings.font == 'satoshi/nunito'
|
||||
? 'font-display font-semibold'
|
||||
: 'font-medium'} {$$props.titleClass ?? ''}"
|
||||
: 'font-medium'} {titleClass}"
|
||||
class:text-slate-600={$userSettings.markReadPosts && read}
|
||||
class:dark:text-zinc-400={$userSettings.markReadPosts && read}
|
||||
class:text-base={view == 'compact'}
|
||||
|
||||
@@ -93,6 +93,9 @@
|
||||
|
||||
$: data = typeData(type)
|
||||
$: embedUrl = urlToEmbed(url)
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@@ -102,7 +105,7 @@
|
||||
{#if opened}
|
||||
{#if type == 'video'}
|
||||
<!-- svelte-ignore a11y-media-has-caption -->
|
||||
<video {autoplay} controls class="rounded-xl aspect-video {$$props.class}">
|
||||
<video {autoplay} controls class="rounded-xl aspect-video {clazz}">
|
||||
<source src={url} />
|
||||
</video>
|
||||
{:else}
|
||||
@@ -112,7 +115,7 @@
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen
|
||||
class="aspect-video rounded-xl dark:bg-zinc-900 {$$props.class ?? ''}"
|
||||
class="aspect-video rounded-xl dark:bg-zinc-900 {clazz ?? ''}"
|
||||
/>
|
||||
{/if}
|
||||
{:else}
|
||||
|
||||
@@ -27,16 +27,17 @@
|
||||
view == 'compact' ? 'w-22 h-22 sm:w-28' : 'w-24 h-24 sm:w-32'
|
||||
|
||||
$: size = thumbnailSize(view)
|
||||
|
||||
export let style: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@component
|
||||
Thumbnails for compact and list view posts.
|
||||
-->
|
||||
<div
|
||||
class="{size} relative group/media {$$props.class ?? ''}"
|
||||
style={$$props.style ?? ''}
|
||||
>
|
||||
<div class="{size} relative group/media {clazz ?? ''}" {style}>
|
||||
{#if post.alt_text}
|
||||
<Popover
|
||||
openOnHover
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
export let user: PersonView
|
||||
export let view: 'cozy' | 'compact' = 'compact'
|
||||
export let showCounts: boolean = true
|
||||
|
||||
let clazz: string = 'py-4 flex flex-col gap-4 text-sm max-w-full relative'
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div
|
||||
class={$$props.class ??
|
||||
'py-4 flex flex-col gap-4 text-sm max-w-full relative'}
|
||||
>
|
||||
<div class={clazz}>
|
||||
<div
|
||||
class="flex
|
||||
{view == 'cozy'
|
||||
|
||||
@@ -65,11 +65,14 @@
|
||||
export let displayName = $userSettings.displayNames
|
||||
|
||||
$: envBadge = getEnvBadge(user.actor_id)
|
||||
|
||||
export let instanceClass: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<a
|
||||
class="items-center flex flex-row gap-1 hover:underline max-w-full min-w-0 {$$props.class ??
|
||||
''}"
|
||||
class="items-center flex flex-row gap-1 hover:underline max-w-full min-w-0 {clazz}"
|
||||
href="/u/{user.name}@{new URL(user.actor_id).hostname}"
|
||||
data-sveltekit-preload-data="tap"
|
||||
>
|
||||
@@ -94,7 +97,7 @@
|
||||
</span>
|
||||
{#if showInstance}
|
||||
<span
|
||||
class="text-slate-500 dark:text-zinc-500 font-normal instance-text flex-shrink {$$props.instanceClass ??
|
||||
class="text-slate-500 dark:text-zinc-500 font-normal instance-text flex-shrink {instanceClass ??
|
||||
''}"
|
||||
>
|
||||
@{new URL(user.actor_id).hostname}
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
loading = true
|
||||
goto(`/search?q=${query}`).then(() => (loading = false))
|
||||
}
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<form on:submit|preventDefault={search} class="w-full h-full {$$props.class}">
|
||||
<form on:submit|preventDefault={search} class="w-full h-full {clazz}">
|
||||
<TextInput
|
||||
bind:value={query}
|
||||
class="w-full h-full {$$props.class}"
|
||||
class="w-full h-full {clazz}"
|
||||
placeholder={$t('nav.search')}
|
||||
autofocus
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user