Fix editor and consolidate file upload widget

This commit is contained in:
space-nuko
2023-05-13 23:05:54 -05:00
parent 152a1c6097
commit 28c9e6ba57
6 changed files with 341 additions and 36 deletions

View File

@@ -4,7 +4,7 @@
export let showModal; // boolean
export let closeOnClick = true; // boolean
export let showCloseButton = true; // boolean
export const closeDialog = _ => doClose();
let dialog; // HTMLDialogElement
@@ -32,19 +32,21 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<dialog
bind:this={dialog}
on:close={close}
bind:this={dialog}
on:close={close}
on:cancel={doClose}
on:click|self={close}
on:click|self={close}
>
<div on:click|stopPropagation>
<slot name="header" />
<slot />
<!-- svelte-ignore a11y-autofocus -->
{#if showCloseButton}
<Button variant="secondary" on:click={doClose}>Close</Button>
{/if}
</div>
<div on:click|stopPropagation>
<slot name="header" />
<slot />
<div class="button-row">
<slot name="buttons">
<!-- svelte-ignore a11y-autofocus -->
<Button variant="secondary" on:click={doClose}>Close</Button>
</slot>
</div>
</div>
</dialog>
<style>
@@ -53,6 +55,7 @@
border-radius: 0.2em;
border: none;
padding: 0;
overflow: hidden;
}
dialog::backdrop {
background: rgba(0, 0, 0, 0.3);
@@ -85,4 +88,10 @@
button {
display: block;
}
.button-row {
display: flex;
flex-direction: row;
gap: var(--spacing-sm);
}
</style>