1
0
This commit is contained in:
2026-06-22 15:57:57 +04:00
parent b04209650e
commit c500318676
2 changed files with 59 additions and 61 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@syncraft/svelte-ui", "name": "@syncraft/svelte-ui",
"version": "1.0.4", "version": "1.0.5",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "vite build && npm run prepack", "build": "vite build && npm run prepack",

View File

@@ -1,8 +1,14 @@
<script>
import Image from "$lib/components/Image.svelte";
let { src, ...others } = $props();
</script>
{#if src} {#if src}
<picture> <picture>
{#if src?.sources} {#if src?.sources}
{#each Object.entries(src.sources) as [ format, srcset ]} {#each Object.entries(src.sources) as [format, srcset]}
<source {srcset} type={`image/${format}`}/> <source {srcset} type={`image/${format}`} />
{/each} {/each}
{/if} {/if}
@@ -10,20 +16,12 @@
src={src?.img?.src || src} src={src?.img?.src || src}
width={src?.img?.w} width={src?.img?.w}
height={src?.img?.h} height={src?.img?.h}
sizes="auto"
{...others} {...others}
/> />
</picture> </picture>
{/if} {/if}
<script>
import Image from '$lib/components/Image.svelte'
let {
src,
...others
} = $props()
</script>
<style lang="scss"> <style lang="scss">
picture { picture {
display: flex; display: flex;