|
|
|
@ -1,5 +1,5 @@ |
|
|
|
<script lang="ts"> |
|
|
|
<script lang="ts"> |
|
|
|
import { Heading, Textarea, Toolbar, ToolbarButton } from "flowbite-svelte"; |
|
|
|
import { Button, Heading, Textarea, Toolbar, ToolbarButton, Tooltip } from "flowbite-svelte"; |
|
|
|
import { CodeOutline, EyeSolid } from "flowbite-svelte-icons"; |
|
|
|
import { CodeOutline, EyeSolid } from "flowbite-svelte-icons"; |
|
|
|
import { editorText } from "$lib/stores"; |
|
|
|
import { editorText } from "$lib/stores"; |
|
|
|
import Preview from "$lib/components/Preview.svelte"; |
|
|
|
import Preview from "$lib/components/Preview.svelte"; |
|
|
|
@ -22,13 +22,14 @@ |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<main class='w-full flex justify-center'> |
|
|
|
<div class='w-full flex justify-center'> |
|
|
|
<form class='max-w-2xl w-full'> |
|
|
|
<main class='main-leather flex flex-col space-y-4 max-w-2xl w-full'> |
|
|
|
<div class='flex flex-col space-y-4'> |
|
|
|
<Heading tag='h1' class='h-leather mb-2'>New Article</Heading> |
|
|
|
<Heading tag='h1' class='mb-2'>New Article</Heading> |
|
|
|
{#if isEditing} |
|
|
|
{#if isEditing} |
|
|
|
<form> |
|
|
|
<Textarea |
|
|
|
<Textarea |
|
|
|
id='article-content' |
|
|
|
id='article-content' |
|
|
|
|
|
|
|
class='textarea-leather' |
|
|
|
rows=8 |
|
|
|
rows=8 |
|
|
|
placeholder='Write AsciiDoc content' |
|
|
|
placeholder='Write AsciiDoc content' |
|
|
|
bind:value={$editorText} |
|
|
|
bind:value={$editorText} |
|
|
|
@ -39,16 +40,18 @@ |
|
|
|
</ToolbarButton> |
|
|
|
</ToolbarButton> |
|
|
|
</Toolbar> |
|
|
|
</Toolbar> |
|
|
|
</Textarea> |
|
|
|
</Textarea> |
|
|
|
{:else} |
|
|
|
</form> |
|
|
|
<Toolbar> |
|
|
|
{:else} |
|
|
|
|
|
|
|
<form class='border border-gray-400 dark:border-gray-600 rounded-lg flex flex-col space-y-2 h-fit'> |
|
|
|
|
|
|
|
<Toolbar class='toolbar-leather rounded-b-none bg-gray-200 dark:bg-gray-800'> |
|
|
|
<ToolbarButton name='Edit' on:click={hidePreview}> |
|
|
|
<ToolbarButton name='Edit' on:click={hidePreview}> |
|
|
|
<CodeOutline class='w-6 h-6' /> |
|
|
|
<CodeOutline class='w-6 h-6' /> |
|
|
|
</ToolbarButton> |
|
|
|
</ToolbarButton> |
|
|
|
</Toolbar> |
|
|
|
</Toolbar> |
|
|
|
{#if rootIndexId} |
|
|
|
{#if rootIndexId} |
|
|
|
<Preview {parser} {rootIndexId} /> |
|
|
|
<Preview sectionClass='m-2' {parser} {rootIndexId} /> |
|
|
|
{/if} |
|
|
|
{/if} |
|
|
|
{/if} |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
{/if} |
|
|
|
</form> |
|
|
|
</main> |
|
|
|
</main> |
|
|
|
</div> |
|
|
|
|