From 639a4a2429bc07171eb7e4dac8aee9768fb327c6 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 26 Jun 2025 09:22:19 -0400 Subject: [PATCH] fix: update components to use Svelte 5 snippets and fix editor content loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Convert Button component to use snippets instead of slots - Update BaseDropdown and StatusDropdown to use new Button snippet syntax - Add effect to watch for data changes in ComposerCore and update editor content - Fix SVG component usage in Album component for Svelte 5 compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/components/Album.svelte | 4 +-- src/lib/components/admin/BaseDropdown.svelte | 35 +++++++++++-------- src/lib/components/admin/Button.svelte | 24 +++++++------ .../components/admin/StatusDropdown.svelte | 29 ++++++++------- .../admin/composer/ComposerCore.svelte | 15 ++++++++ 5 files changed, 68 insertions(+), 39 deletions(-) diff --git a/src/lib/components/Album.svelte b/src/lib/components/Album.svelte index 15d9eca..cac6695 100644 --- a/src/lib/components/Album.svelte +++ b/src/lib/components/Album.svelte @@ -165,9 +165,9 @@ class:playing={isPlaying} > {#if isPlaying} - + {:else} - + {/if} {/if} diff --git a/src/lib/components/admin/BaseDropdown.svelte b/src/lib/components/admin/BaseDropdown.svelte index 25abd9d..43cd090 100644 --- a/src/lib/components/admin/BaseDropdown.svelte +++ b/src/lib/components/admin/BaseDropdown.svelte @@ -1,4 +1,5 @@ @@ -94,21 +98,21 @@ {#if hasIcon && iconPosition === 'left' && !iconOnly} - + {@render icon()} {/if} {#if hasDefaultSlot && !iconOnly} - + {@render children()} {:else if iconOnly && hasIcon} - + {@render icon()} {/if} {#if hasIcon && iconPosition === 'right' && !iconOnly} - + {@render icon()} {/if} @@ -141,21 +145,21 @@ {#if hasIcon && iconPosition === 'left' && !iconOnly} - + {@render icon()} {/if} {#if hasDefaultSlot && !iconOnly} - + {@render children()} {:else if iconOnly && hasIcon} - + {@render icon()} {/if} {#if hasIcon && iconPosition === 'right' && !iconOnly} - + {@render icon()} {/if} diff --git a/src/lib/components/admin/StatusDropdown.svelte b/src/lib/components/admin/StatusDropdown.svelte index f69f32d..19b953f 100644 --- a/src/lib/components/admin/StatusDropdown.svelte +++ b/src/lib/components/admin/StatusDropdown.svelte @@ -55,18 +55,21 @@ {isLoading} class="status-dropdown" > - + {#snippet trigger()} + + {/snippet} - {#if hasDropdownContent} -
+ {#snippet dropdown()} + {#if hasDropdownContent} {#each availableActions as action} handleDropdownAction(action.status)}> {action.label} @@ -85,8 +88,8 @@ View on site {/if} -
- {/if} + {/if} + {/snippet}