From aaa33acc1c2ada8c44412e872ab42cc33497856a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 9 Aug 2024 18:04:23 +0100 Subject: [PATCH] Rework grid layouts to automatically grow as required --- .../app/container/GridContainer.svelte | 169 ++++++++++++------ .../components/preview/GridDNDHandler.svelte | 66 ++++--- packages/client/src/constants.js | 3 + packages/client/src/utils/grid.js | 24 ++- 4 files changed, 183 insertions(+), 79 deletions(-) diff --git a/packages/client/src/components/app/container/GridContainer.svelte b/packages/client/src/components/app/container/GridContainer.svelte index 8e8621c1a6..d97e7ceafb 100644 --- a/packages/client/src/components/app/container/GridContainer.svelte +++ b/packages/client/src/components/app/container/GridContainer.svelte @@ -1,50 +1,136 @@
-
- {#each { length: cols * rows } as _} -
- {/each} -
+ {#if $builderStore.inBuilder} +
+ {#each { length: GridColumns * rows } as _, idx} +
+ {/each} +
+ {/if} - {#if !empty} + {#if !empty && mounted} {/if}
@@ -52,7 +138,6 @@