chore: svelte 5 🎉 (#13738)

chore: svelte 5

Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
This commit is contained in:
Daniel Dietzler 2024-11-02 16:49:07 +01:00 committed by GitHub
parent fed882a28a
commit eadcbd52fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 287 additions and 217 deletions

View file

@ -3,9 +3,9 @@ import { render } from '@testing-library/svelte';
describe('ImageThumbnail component', () => {
beforeAll(() => {
Object.defineProperty(HTMLImageElement.prototype, 'complete', {
value: true,
});
Element.prototype.animate = vi.fn().mockImplementation(() => ({
cancel: () => {},
}));
});
it('shows thumbhash while image is loading', () => {

View file

@ -96,5 +96,5 @@
class:rounded-full={circle}
draggable="false"
out:fade={{ duration: THUMBHASH_FADE_DURATION }}
/>
></canvas>
{/if}

View file

@ -218,6 +218,7 @@
href={currentUrlReplaceAssetId(asset.id)}
on:click={(evt) => evt.preventDefault()}
tabindex={0}
aria-label="Thumbnail URL"
>
</a>
{/if}
@ -255,12 +256,12 @@
<div
class="absolute z-10 h-full w-full bg-gradient-to-b from-black/25 via-[transparent_25%] opacity-0 transition-opacity group-hover:opacity-100"
class:rounded-xl={selected}
/>
></div>
<!-- Outline on focus -->
<div
class="absolute size-full group-focus-visible:outline outline-4 -outline-offset-4 outline-immich-primary"
/>
></div>
<!-- Favorite asset star -->
{#if !isSharedLink() && asset.isFavorite}
@ -339,7 +340,7 @@
class="absolute top-0 h-full w-full bg-immich-primary opacity-40"
in:fade={{ duration: 100 }}
out:fade={{ duration: 100 }}
/>
></div>
{/if}
</div>
{/if}

View file

@ -113,7 +113,10 @@
}}
on:timeupdate={({ currentTarget }) => {
const remaining = currentTarget.duration - currentTarget.currentTime;
remainingSeconds = Math.min(Math.ceil(remaining), durationInSeconds);
remainingSeconds = Math.min(
Math.ceil(Number.isNaN(remaining) ? Number.POSITIVE_INFINITY : remaining),
durationInSeconds,
);
}}
/>
></video>
{/if}