Merge pull request #13291 from Budibase/feature/screen-deselect

Allow component deselect in preview. Remove screen highlight.
This commit is contained in:
deanhannigan 2024-04-09 09:44:43 +01:00 committed by GitHub
commit a8bbd62a7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View File

@ -37,6 +37,7 @@
"svg", "svg",
"bmp", "bmp",
"jfif", "jfif",
"webp",
] ]
const fieldId = id || uuid() const fieldId = id || uuid()

View File

@ -10,13 +10,11 @@
const { const {
routeStore, routeStore,
roleStore, roleStore,
styleable,
linkable, linkable,
builderStore, builderStore,
sidePanelStore, sidePanelStore,
appStore, appStore,
} = sdk } = sdk
const component = getContext("component")
const context = getContext("context") const context = getContext("context")
// Legacy props which must remain unchanged for backwards compatibility // Legacy props which must remain unchanged for backwards compatibility
@ -169,15 +167,14 @@
<!-- svelte-ignore a11y-no-static-element-interactions --> <!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<div <div
class="component {screenId} layout layout--{typeClass}" class="component layout layout--{typeClass}"
use:styleable={$component.styles}
class:desktop={!mobile} class:desktop={!mobile}
class:mobile={!!mobile} class:mobile={!!mobile}
data-id={screenId} data-id={screenId}
data-name="Screen" data-name="Screen"
data-icon="WebPage" data-icon="WebPage"
> >
<div class="{screenId}-dom screen-wrapper layout-body"> <div class="screen-wrapper layout-body">
{#if typeClass !== "none"} {#if typeClass !== "none"}
<div <div
class="interactive component {navigationId}" class="interactive component {navigationId}"
@ -282,7 +279,14 @@
</div> </div>
</div> </div>
{/if} {/if}
<div class="main-wrapper"> <div
class="main-wrapper"
on:click={() => {
if ($builderStore.inBuilder) {
builderStore.actions.selectComponent(screenId)
}
}}
>
<div class="main size--{pageWidthClass}"> <div class="main size--{pageWidthClass}">
<slot /> <slot />
</div> </div>