diff --git a/src/lib/components/ResizablePanel.svelte b/src/lib/components/ResizablePanel.svelte index 0f428449..a7af2989 100644 --- a/src/lib/components/ResizablePanel.svelte +++ b/src/lib/components/ResizablePanel.svelte @@ -26,6 +26,17 @@ toolbar?: import('svelte').Snippet; footer?: import('svelte').Snippet; children?: import('svelte').Snippet; + /** Optional second column rendered next to the main content. When set + * AND `rightColumnActive` is true, the panel body splits into two + * columns; otherwise the panel layout is unchanged. */ + rightColumn?: import('svelte').Snippet; + /** Controls whether the right column is currently rendered. Lets the + * parent define the snippet up front but defer the layout split until + * there's something to show (so the column doesn't eat panel width + * while empty). Defaults to true when a `rightColumn` is supplied. */ + rightColumnActive?: boolean; + /** Width of the right column in px. */ + rightColumnWidth?: number; } let { @@ -46,9 +57,14 @@ actions, toolbar, footer, - children + children, + rightColumn, + rightColumnActive = true, + rightColumnWidth = 320 }: Props = $props(); + const showRightColumn = $derived(!!rightColumn && rightColumnActive); + // Calculate dynamic max height for bottom panels (viewport - nav bar - gaps) function getEffectiveMaxHeight(): number { if (maxHeight !== undefined) { @@ -228,8 +244,15 @@ {@render toolbar()} {/if} -