diff --git a/ka-note/VERSION b/ka-note/VERSION index 2442528..bf29cfe 100644 --- a/ka-note/VERSION +++ b/ka-note/VERSION @@ -1 +1 @@ -1.1.62 \ No newline at end of file +1.1.68 \ No newline at end of file diff --git a/ka-note/client/src/lib/components/HistoryItem.svelte b/ka-note/client/src/lib/components/HistoryItem.svelte index 35facb9..b6e3915 100644 --- a/ka-note/client/src/lib/components/HistoryItem.svelte +++ b/ka-note/client/src/lib/components/HistoryItem.svelte @@ -6,8 +6,9 @@ interface Props { entry: HistoryEntry; onedit?: (id: string, text: string, date: string) => void; + onediting?: (active: boolean) => void; } - let { entry, onedit }: Props = $props(); + let { entry, onedit, onediting }: Props = $props(); let editing = $state(false); let editText = $state(''); @@ -17,15 +18,18 @@ editText = entry.text; editDate = entry.date; editing = true; + onediting?.(true); } function saveEdit() { onedit?.(entry.id, editText, editDate); editing = false; + onediting?.(false); } function cancelEdit() { editing = false; + onediting?.(false); } @@ -44,7 +48,20 @@ {#if editing} -
+ +
{ if (e.key === 'Escape') cancelEdit(); }}> +
+ +
+ + +
+
{:else} - + +
+ +
{/if}
{/if} diff --git a/ka-note/client/src/lib/components/JournalView.svelte b/ka-note/client/src/lib/components/JournalView.svelte index 8c5c995..8091ba8 100644 --- a/ka-note/client/src/lib/components/JournalView.svelte +++ b/ka-note/client/src/lib/components/JournalView.svelte @@ -236,7 +236,7 @@ {/if} -
+
{selectedDate}
{#each filteredEntries as entry (entry.id)} {#if editingId === entry.id} -
- +
{ if (e.key === 'Escape') cancelEdit(); }}> +
+ + + +
+ + +
+
+ { if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { e.preventDefault(); saveEdit(); } }} /> editBody = md} + onsave={saveEdit} />