From 89d2aaca7587e9de9bdd923becf3b289cfa59afc Mon Sep 17 00:00:00 2001 From: June Date: Tue, 17 Feb 2026 12:35:46 +1300 Subject: [PATCH] EDITOR WORK COMPLETE --- src/lib/components/editor.svelte | 331 ++++++++++++++++-- src/lib/components/ui/input/index.ts | 2 + src/lib/components/ui/input/input.svelte | 25 ++ src/lib/components/ui/textarea/index.ts | 2 + .../components/ui/textarea/textarea.svelte | 28 ++ 5 files changed, 354 insertions(+), 34 deletions(-) create mode 100644 src/lib/components/ui/input/index.ts create mode 100644 src/lib/components/ui/input/input.svelte create mode 100644 src/lib/components/ui/textarea/index.ts create mode 100644 src/lib/components/ui/textarea/textarea.svelte diff --git a/src/lib/components/editor.svelte b/src/lib/components/editor.svelte index 1c2c6a2..4c828ea 100644 --- a/src/lib/components/editor.svelte +++ b/src/lib/components/editor.svelte @@ -1,56 +1,319 @@ -
-

{formatDate(entry.date)}

+
+ +
+

{formatDate(entry.date)}

+
+ {#if !edit} + + {:else} + + + + {/if} +
+
+ + + {#if error} +
+ {error} +
+ {/if} + + {#if !edit} - +
+ + {#if entry.image} +
+ Entry +
+ {:else} +
+ No image +
+ {/if} + + + {#if entry.content} +
+
+ {@html marked(entry.content)} +
+
+ {:else} +
+ No content yet +
+ {/if} +
+ + {:else} - - - +
+ +
+ + + {#if previewImage} +
+ Preview + +
+ {:else} +
{ + if (e.key === "Enter" || e.key === " ") { + fileInput?.click(); + } + }} + onclick={() => fileInput?.click()} + > + +

+ Click to upload or drag and drop +

+

+ PNG, JPG, GIF up to 5MB +

+
+ {/if} + + +
+ + +
+ +