@@ -134,20 +112,20 @@
>
- {#if $$slots.credit}
-
- {:else}
+ {#if credit}
+
+ {@render credit(photo)}
+ {:else if photo.credit}
{photo.credit}
{/if}
@@ -158,20 +136,20 @@
{#if photos[activeImageIndex].caption}
-
-
- {#if $$slots.caption}
-
- {:else}
+ {@const activePhoto = photos[activeImageIndex]}
+
+
+ {#if caption && activePhoto.caption}
+ {#key activeImageIndex}
+ {@render caption(activePhoto)}
+ {/key}
+ {:else if typeof activePhoto.caption}
{#key activeImageIndex}
- {photos[activeImageIndex].caption}
+ {activePhoto.caption}
{/key}
{/if}
@@ -185,10 +163,10 @@
diff --git a/src/components/PhotoCarousel/stories/photos.json b/src/components/PhotoCarousel/demo/photos.json
similarity index 100%
rename from src/components/PhotoCarousel/stories/photos.json
rename to src/components/PhotoCarousel/demo/photos.json
diff --git a/src/components/PhotoCarousel/stories/docs/component.md b/src/components/PhotoCarousel/stories/docs/component.md
deleted file mode 100644
index c85a042f..00000000
--- a/src/components/PhotoCarousel/stories/docs/component.md
+++ /dev/null
@@ -1,21 +0,0 @@
-A simple, accessible photo carousel with lazy-loading and mobile swipe built in.
-
-```svelte
-
-
-