editor styling

This commit is contained in:
Martin McKeaveney 2021-05-10 12:06:31 +01:00
parent 062d8323f4
commit 11ce48e1ff
4 changed files with 23 additions and 6 deletions

View File

@ -9,12 +9,16 @@
<p
class:noPadding
class="spectrum-Body spectrum-Body--size{size}"
class:spectrum-Body--serif={serif}
>
class:spectrum-Body--serif={serif}>
<slot />
</p>
<style>
p {
margin-top: 0.75em;
margin-bottom: 0.75em;
}
.noPadding {
padding: 0;
margin: 0;

View File

@ -117,7 +117,7 @@
readOnly,
autoCloseBrackets: true,
autoCloseTags: true,
theme: $themeStore.darkMode ? THEMES.DARK : THEMES.LIGHT,
theme: THEMES.DARK,
}
if (!tab)
@ -132,7 +132,7 @@
if (destroyed) return
CodeMirror.commands.autocomplete = function (cm) {
CodeMirror.commands.autocomplete = function(cm) {
CodeMirror.showHint(cm, CodeMirror.hint.javascript)
}

View File

@ -89,7 +89,7 @@
<MenuItem icon="LogOut" on:click={auth.logout}>Log out</MenuItem>
</ActionMenu>
</div>
<div>
<div class="content">
<slot />
</div>
</div>
@ -156,4 +156,9 @@
text-overflow: ellipsis;
font-weight: 500;
}
.content {
height: 100vh;
overflow-y: auto;
}
</style>

View File

@ -13,6 +13,7 @@
Select,
} from "@budibase/bbui"
import { onMount } from "svelte"
import Editor from "components/integration/QueryEditor.svelte"
import api from "builderStore/api"
const ConfigTypes = {
@ -156,7 +157,14 @@
<Button cta on:click={saveTemplate}>Save</Button>
</div>
{#if selectedTemplate}
<TextArea bind:value={selectedTemplate.contents} />
{#key templateIdx}
<Editor
mode="handlebars"
on:change={e => {
selectedTemplate.contents = e.detail.value
}}
value={selectedTemplate.contents} />
{/key}
{/if}
</div>
{/if}