From 2a7b90e46f65b865cf32a452375f1db29901b13d Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 17 Nov 2022 11:08:23 +0000 Subject: [PATCH 1/3] Component settings bar now on by default. Manifest config cleared of showSettingsBar properties --- packages/client/manifest.json | 11 +---------- .../client/src/components/preview/SettingsBar.svelte | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 45bb38439a..980bd4585e 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -84,7 +84,6 @@ "description": "This component contains things within itself", "icon": "Selection", "hasChildren": true, - "showSettingsBar": true, "size": { "width": 400, "height": 200 @@ -283,7 +282,6 @@ "description": "A basic html button that is ready for styling", "icon": "Button", "editable": true, - "showSettingsBar": true, "size": { "width": 105, "height": 35 @@ -420,7 +418,6 @@ "section" ], "hasChildren": true, - "showSettingsBar": true, "size": { "width": 400, "height": 100 @@ -683,7 +680,6 @@ "illegalChildren": [ "section" ], - "showSettingsBar": true, "editable": true, "size": { "width": 400, @@ -809,7 +805,6 @@ "illegalChildren": [ "section" ], - "showSettingsBar": true, "editable": true, "size": { "width": 400, @@ -931,7 +926,6 @@ "tag": { "name": "Tag", "icon": "Label", - "showSettingsBar": true, "size": { "width": 100, "height": 25 @@ -1189,7 +1183,6 @@ "name": "Link", "description": "A basic link component for internal and external links", "icon": "Link", - "showSettingsBar": true, "editable": true, "size": { "width": 200, @@ -3927,7 +3920,6 @@ "dynamicfilter": { "name": "Dynamic Filter", "icon": "Filter", - "showSettingsBar": true, "size": { "width": 100, "height": 35 @@ -4797,7 +4789,6 @@ "section" ], "hasChildren": true, - "showSettingsBar": true, "size": { "width": 400, "height": 100 @@ -5270,4 +5261,4 @@ "suffix": "repeater" } } -} +} \ No newline at end of file diff --git a/packages/client/src/components/preview/SettingsBar.svelte b/packages/client/src/components/preview/SettingsBar.svelte index 332409986a..f72994e496 100644 --- a/packages/client/src/components/preview/SettingsBar.svelte +++ b/packages/client/src/components/preview/SettingsBar.svelte @@ -16,7 +16,7 @@ let measured = false $: definition = $componentStore.selectedComponentDefinition - $: showBar = definition?.showSettingsBar && !$dndIsDragging + $: showBar = definition?.showSettingsBar !== false && !$dndIsDragging $: { if (!showBar) { measured = false From 312bc967701f69f0cb9d5756a45d4dae3f018e18 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 17 Nov 2022 14:10:55 +0000 Subject: [PATCH 2/3] Don't show delete or duplicate actions in the component settings bar --- .../src/components/preview/SettingsBar.svelte | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/packages/client/src/components/preview/SettingsBar.svelte b/packages/client/src/components/preview/SettingsBar.svelte index f72994e496..7f9b92c01d 100644 --- a/packages/client/src/components/preview/SettingsBar.svelte +++ b/packages/client/src/components/preview/SettingsBar.svelte @@ -24,6 +24,9 @@ } $: settings = getBarSettings(definition) + $: isScreen = + $builderStore.selectedComponentId === $builderStore.screen?.props?._id + const getBarSettings = definition => { let allSettings = [] definition?.settings?.forEach(setting => { @@ -152,26 +155,30 @@ {:else if setting.type === "color"} {/if} - {#if setting.barSeparator !== false} + {#if setting.barSeparator !== false && (settings.length != idx + 1 || !isScreen)}
{/if} {/each} - { - builderStore.actions.duplicateComponent( - $builderStore.selectedComponentId - ) - }} - title="Duplicate component" - /> - { - builderStore.actions.deleteComponent($builderStore.selectedComponentId) - }} - title="Delete component" - /> + {#if !isScreen} + { + builderStore.actions.duplicateComponent( + $builderStore.selectedComponentId + ) + }} + title="Duplicate component" + /> + { + builderStore.actions.deleteComponent( + $builderStore.selectedComponentId + ) + }} + title="Delete component" + /> + {/if}
{/if} From 2a990189f071b1e34c0cfe988df344bc811298ae Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 17 Nov 2022 14:40:16 +0000 Subject: [PATCH 3/3] Ensure the navigation does not show the settings bar --- packages/client/src/components/preview/SettingsBar.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/preview/SettingsBar.svelte b/packages/client/src/components/preview/SettingsBar.svelte index 7f9b92c01d..961af98d39 100644 --- a/packages/client/src/components/preview/SettingsBar.svelte +++ b/packages/client/src/components/preview/SettingsBar.svelte @@ -16,14 +16,14 @@ let measured = false $: definition = $componentStore.selectedComponentDefinition - $: showBar = definition?.showSettingsBar !== false && !$dndIsDragging + $: showBar = + definition?.showSettingsBar !== false && !$dndIsDragging && definition $: { if (!showBar) { measured = false } } $: settings = getBarSettings(definition) - $: isScreen = $builderStore.selectedComponentId === $builderStore.screen?.props?._id