fix: Fix lint errors (#559)
* cleanup: postactions styling * misc: fix first round of errors * pkg: remove vitest * fix: fix lint errors stage 2 * fix: fix lint errors stage 3 * fix: fix lint errors, stage 3 * misc: update eslint rules to warn for writable derived
This commit is contained in:
1 parent
1824245f13
commit
76c581123a
225 files changed
+1553
-2352
No files matched your search
@@ -27,15 +27,14 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import {
|
||||
Icon,
|
||||
PuzzlePiece,
|
||||
VideoCamera,
|
||||
type IconSource,
|
||||
} from 'svelte-hero-icons'
|
||||
import { optimizeImageURL, type IframeType, type MediaType } from '../helpers'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { get } from 'svelte/store'
|
||||
import { optimizeImageURL, type IframeType } from '../helpers'
|
||||
|
||||
const urlToEmbed = (inputUrl: string) => {
|
||||
if (type == 'video') {
|
||||
@@ -89,7 +88,7 @@
|
||||
type?: IframeType
|
||||
thumbnail?: string | undefined
|
||||
url: string
|
||||
opened?: any
|
||||
opened?: boolean
|
||||
autoplay?: boolean
|
||||
class?: string
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { stopPropagation } from 'svelte/legacy'
|
||||
|
||||
import { settings, type View } from '$lib/settings.svelte'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import { bestImageURL, postLink } from '../helpers'
|
||||
import { showImage } from '$lib/components/ui/ExpandableImage.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import { Button, modal } from 'mono-svelte'
|
||||
import { onMount } from 'svelte'
|
||||
import { bestImageURL, postLink } from '../helpers'
|
||||
|
||||
interface Props {
|
||||
post: Post
|
||||
@@ -54,7 +52,6 @@
|
||||
srcset={bestImageURL(post, false, 1536)}
|
||||
media="(max-width: 1024px)"
|
||||
/>
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<img
|
||||
src={bestImageURL(post, false, -1)}
|
||||
loading="lazy"
|
||||
@@ -74,11 +71,11 @@
|
||||
class="absolute bottom-0 left-0 right-0 flex justify-between items-center
|
||||
rounded-full ml-auto w-max m-2 p-0 gap-1
|
||||
*:bg-white *:border *:border-slate-200 dark:*:border-zinc-800 dark:*:bg-zinc-900"
|
||||
onclick={(e) => e.stopPropagation()}
|
||||
onclick={e => e.stopPropagation()}
|
||||
>
|
||||
{#if post.alt_text}
|
||||
<Button
|
||||
onclick={(e) => {
|
||||
onclick={e => {
|
||||
e.stopPropagation()
|
||||
modal({
|
||||
title: 'Alt',
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
<script lang="ts">
|
||||
import Empty from '$lib/components/helper/Empty.svelte'
|
||||
import PostLink from '$lib/components/lemmy/post/link/PostLink.svelte'
|
||||
import {
|
||||
bestImageURL,
|
||||
postLink,
|
||||
type MediaType,
|
||||
iframeType,
|
||||
type MediaType,
|
||||
} from '$lib/components/lemmy/post/helpers.js'
|
||||
import ExpandableImage, {
|
||||
showImage,
|
||||
} from '$lib/components/ui/ExpandableImage.svelte'
|
||||
import PostLink from '$lib/components/lemmy/post/link/PostLink.svelte'
|
||||
import { settings, type View } from '$lib/settings.svelte.js'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import PostIframe from './PostIframe.svelte'
|
||||
import { Button, Material, modal } from 'mono-svelte'
|
||||
import { onMount } from 'svelte'
|
||||
import { ArrowDownTray, Icon } from 'svelte-hero-icons'
|
||||
import PostImage from './PostImage.svelte'
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -7,17 +7,16 @@
|
||||
} from '$lib/components/lemmy/post/helpers.js'
|
||||
import { showImage } from '$lib/components/ui/ExpandableImage.svelte'
|
||||
import { settings, type View } from '$lib/settings.svelte.js'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { isImage } from '$lib/ui/image'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import { Material, modal, Popover } from 'mono-svelte'
|
||||
import { modal } from 'mono-svelte'
|
||||
import Button from 'mono-svelte/button/Button.svelte'
|
||||
import {
|
||||
DocumentText,
|
||||
ExclamationTriangle,
|
||||
Icon,
|
||||
Link,
|
||||
VideoCamera,
|
||||
ExclamationTriangle,
|
||||
} from 'svelte-hero-icons'
|
||||
|
||||
const thumbnailSize = (view: View) =>
|
||||
@@ -68,6 +67,7 @@
|
||||
}}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
class="cursor-pointer"
|
||||
>
|
||||
{#if post.thumbnail_url || isImage(post.url)}
|
||||
<div class="relative overflow-hidden rounded-xl">
|
||||
@@ -75,16 +75,20 @@
|
||||
<img
|
||||
src={optimizeImageURL(post.thumbnail_url || post.url || '', 256)}
|
||||
loading="lazy"
|
||||
class="object-cover relative overflow-hidden bg-slate-100 dark:bg-zinc-800 rounded-xl
|
||||
transition-colors {size}"
|
||||
class={[
|
||||
'object-cover relative overflow-hidden bg-slate-100 dark:bg-zinc-800 rounded-xl transition-colors',
|
||||
size,
|
||||
]}
|
||||
alt={post.alt_text ?? ' '}
|
||||
class:blur-xl={blur}
|
||||
/>
|
||||
{#if type != 'image'}
|
||||
<div
|
||||
class="absolute w-8 h-8 m-1 bottom-0 left-0 rounded-xl text-slate-800 dark:text-zinc-200
|
||||
bg-slate-25 dark:bg-zinc-900 border border-slate-200 dark:border-zinc-700
|
||||
grid place-items-center"
|
||||
class={[
|
||||
'absolute w-8 h-8 m-1 bottom-0 left-0 rounded-xl text-slate-800 dark:text-zinc-200',
|
||||
'bg-slate-25 dark:bg-zinc-900 border border-slate-200 dark:border-zinc-700',
|
||||
'grid place-items-center',
|
||||
]}
|
||||
>
|
||||
<Icon
|
||||
src={type == 'iframe' ? VideoCamera : Link}
|
||||
@@ -109,10 +113,13 @@
|
||||
{/if}
|
||||
{:else}
|
||||
<div
|
||||
class="object-cover overflow-hidden bg-slate-50 dark:bg-zinc-900 rounded-xl
|
||||
border border-slate-200 dark:border-zinc-800 group-hover/media:border-slate-400
|
||||
dark:group-hover/media:border-zinc-600 transition-colors text-slate-400 dark:text-zinc-600 grid
|
||||
place-items-center {size}"
|
||||
class={[
|
||||
'object-cover overflow-hidden bg-slate-50 dark:bg-zinc-900 rounded-xl',
|
||||
'border border-slate-200 dark:border-zinc-800 group-hover/media:border-slate-400',
|
||||
'dark:group-hover/media:border-zinc-600 transition-colors text-slate-400 dark:text-zinc-600 grid',
|
||||
'place-items-center',
|
||||
size,
|
||||
]}
|
||||
>
|
||||
<Icon
|
||||
src={type == 'embed'
|
||||
|
||||
Reference in new issue
Block a user