From ab56301aced70945b4861ce2c4fdab4662ae45d5 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 22 Jun 2021 09:36:50 +0100 Subject: [PATCH] Add screen settings section, refactor more of component settings panel --- .../src/DetailSummary/DetailSummary.svelte | 2 +- ...svelte => ComponentSettingsSection.svelte} | 46 +++++------------ .../PropertiesPanel/PropertiesPanel.svelte | 38 ++++---------- .../PropertyControls/PropertyControl.svelte | 1 - .../ScreenSettingsSection.svelte | 51 +++++++++++++++++++ packages/standard-components/manifest.json | 5 -- 6 files changed, 74 insertions(+), 69 deletions(-) rename packages/builder/src/components/design/PropertiesPanel/{SettingsSection.svelte => ComponentSettingsSection.svelte} (83%) create mode 100644 packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte diff --git a/packages/bbui/src/DetailSummary/DetailSummary.svelte b/packages/bbui/src/DetailSummary/DetailSummary.svelte index f20ccc56ae..a3772cee38 100644 --- a/packages/bbui/src/DetailSummary/DetailSummary.svelte +++ b/packages/bbui/src/DetailSummary/DetailSummary.svelte @@ -72,6 +72,6 @@ flex-direction: column; justify-content: flex-start; align-items: stretch; - gap: var(--spacing-m); + gap: var(--spacing-l); } diff --git a/packages/builder/src/components/design/PropertiesPanel/SettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte similarity index 83% rename from packages/builder/src/components/design/PropertiesPanel/SettingsSection.svelte rename to packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte index 7a5d8becd1..b0f4257a8e 100644 --- a/packages/builder/src/components/design/PropertiesPanel/SettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte @@ -1,8 +1,7 @@ - - {#if assetInstance} - {#each assetDefinition as def (`${componentInstance._id}-${def.key}`)} - onScreenPropChange(def.key, val)} - /> - {/each} - {/if} - {#if showDisplayName} - updateProp("_instanceName", val)} - /> - {/if} + + updateProp("_instanceName", val)} + /> {#if settings && settings.length > 0} {#each settings as setting (`${componentInstance._id}-${setting.key}`)} {#if canRenderControl(setting)} diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertiesPanel.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertiesPanel.svelte index 34762d552d..2e350ce7bc 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertiesPanel.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertiesPanel.svelte @@ -1,13 +1,11 @@ - (openSection = "settings")} + /> + (openSection = "settings")} /> diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte index ac23e819d5..0ee5646bc4 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte @@ -127,7 +127,6 @@ .label { text-transform: capitalize; - padding-top: var(--spectrum-global-dimension-size-50); padding-bottom: var(--spectrum-global-dimension-size-65); } diff --git a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte new file mode 100644 index 0000000000..32b5b03c6c --- /dev/null +++ b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte @@ -0,0 +1,51 @@ + + +{#if $currentAsset && $store.currentFrontEndType === FrontendTypes.SCREEN} + + {#each screenSettings as def (`${componentInstance._id}-${def.key}`)} + setAssetProps(def.key, val)} + /> + {/each} + +{/if} diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json index 1f10f3ed96..450a0d823c 100644 --- a/packages/standard-components/manifest.json +++ b/packages/standard-components/manifest.json @@ -232,11 +232,6 @@ "type": "event", "label": "On Click", "key": "onClick" - }, - { - "type": "boolean", - "label": "Disabled", - "key": "disabled" } ] },