From 12c30c1501629314748a6cca0e8429c3e677afc3 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 26 Jun 2025 16:15:17 -0400 Subject: [PATCH] feat: implement unified content insertion pane for Edra editor - Create ContentInsertionPane component with segmented controls - Update image placeholder to single-line format with icon + text - Update gallery placeholder to use unified pane - Support upload, embed link, and gallery selection for each type - Add location search placeholder for future geocoding integration --- .../components/ContentInsertionPane.svelte | 608 ++++++++++++++++++ .../EnhancedImagePlaceholder.svelte | 302 ++------- .../components/GalleryPlaceholder.svelte | 248 ++----- 3 files changed, 710 insertions(+), 448 deletions(-) create mode 100644 src/lib/components/edra/headless/components/ContentInsertionPane.svelte diff --git a/src/lib/components/edra/headless/components/ContentInsertionPane.svelte b/src/lib/components/edra/headless/components/ContentInsertionPane.svelte new file mode 100644 index 0000000..147628f --- /dev/null +++ b/src/lib/components/edra/headless/components/ContentInsertionPane.svelte @@ -0,0 +1,608 @@ + + +
+
+
+ {#each contentTypes as contentType} + + {/each} +
+ +
+ +
+ {#if selectedType === 'location' && availableActions()[0]?.type === 'search'} +
+ + +
+
or
+ {/if} + + {#if availableActions().some(a => a.type === 'embed')} +
+ + +
+ {/if} + + {#if availableActions().length > 1 && availableActions().some(a => a.type !== 'embed')} +
or
+ {/if} + +
+ {#each availableActions().filter(a => a.type !== 'embed') as action} + + {/each} +
+ + {#if isUploading} +
+
+ Uploading... +
+ {/if} +
+ + + +
+ + \ No newline at end of file diff --git a/src/lib/components/edra/headless/components/EnhancedImagePlaceholder.svelte b/src/lib/components/edra/headless/components/EnhancedImagePlaceholder.svelte index e12ec9a..00799a4 100644 --- a/src/lib/components/edra/headless/components/EnhancedImagePlaceholder.svelte +++ b/src/lib/components/edra/headless/components/EnhancedImagePlaceholder.svelte @@ -1,267 +1,91 @@ -
- {#if isUploading} -
-
- Uploading... -
- {:else if !autoOpenModal} - - - - {/if} -
- - - + + + {#if showPane} + showPane = false} + {deleteNode} + {albumId} + /> + {/if}
diff --git a/src/lib/components/edra/headless/components/GalleryPlaceholder.svelte b/src/lib/components/edra/headless/components/GalleryPlaceholder.svelte index 00b8f69..bafd55e 100644 --- a/src/lib/components/edra/headless/components/GalleryPlaceholder.svelte +++ b/src/lib/components/edra/headless/components/GalleryPlaceholder.svelte @@ -1,205 +1,91 @@ - - - - - - - + + + {#if showPane} + showPane = false} + {deleteNode} + {albumId} + /> + {/if}