diff --git a/src/routes/journals/ae_comp__journal_entry_obj_li.svelte b/src/routes/journals/ae_comp__journal_entry_obj_li.svelte
index 20d55dd8..7b40739c 100644
--- a/src/routes/journals/ae_comp__journal_entry_obj_li.svelte
+++ b/src/routes/journals/ae_comp__journal_entry_obj_li.svelte
@@ -8,8 +8,7 @@
let { log_lvl = $bindable(0), lq__journal_obj, lq__journal_entry_obj_li }: Props = $props();
// *** Import Svelte specific
- import { goto, invalidate, pushState, replaceState } from '$app/navigation';
- import { Modal } from 'flowbite-svelte';
+ import { goto } from '$app/navigation';
import {
CalendarClock,
Check,
@@ -17,11 +16,9 @@
Copy,
Eye,
EyeOff,
- FileLock,
Files,
Fingerprint,
Flag,
- FlagOff,
Group,
ListPlus,
Lock,
@@ -39,50 +36,45 @@
// *** Import Aether specific variables and functions
import type { key_val } from '$lib/stores/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
- import { api } from '$lib/api/api';
import {
- ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
- slct,
- slct_trigger
+ slct
} from '$lib/stores/ae_stores';
import {
- journals_loc,
journals_sess,
journals_slct,
- journals_trig
+ journals_trig,
+ journals_loc
} from '$lib/ae_journals/ae_journals_stores';
import { journals_func } from '$lib/ae_journals/ae_journals_functions';
-
- let ae_promises: key_val = $state({});
- // let ae_tmp: key_val = {};
- // let ae_triggers: key_val = {};
+ import AeCompModalJournalEntryAppend from './ae_comp__modal_journal_entry_append.svelte';
let tmp_entry_obj: key_val = $state({});
- let tmp_entry_obj_add_timestamp_header: boolean = $state(true);
- let tmp_entry_obj_add_timestamp_header_w_day_of_week: boolean = $state(true);
- let tmp_entry_obj_add_text_header: string = $state('');
- let tmp_entry_obj_add_text: string = $state('');
- let tmp_entry_obj_changed: boolean = $state(false);
+
+ // Derived state for modal visibility
+ // We cast to boolean for the prop, but we need to handle the close event to clear the store ID
+ let show_append_modal = $state(false);
$effect(() => {
- if (tmp_entry_obj_add_text_header.length || tmp_entry_obj_add_text) {
- tmp_entry_obj_changed = true;
- } else {
- tmp_entry_obj_changed = false;
- }
+ // Sync local boolean with store ID presence
+ show_append_modal = !!$journals_sess.show__modal_append__journal_entry_id;
});
+
+ function handle_modal_close() {
+ $journals_sess.show__modal_append__journal_entry_id = null;
+ show_append_modal = false;
+ }
+
+ function handle_modal_update() {
+ handle_modal_close();
+ }
{#if $lq__journal_entry_obj_li && $lq__journal_entry_obj_li.length}
-
-
{#each $lq__journal_entry_obj_li as journals_journal_entry_obj, index}
-
-
Copy Plaintext Markdown
@@ -176,8 +166,6 @@
@@ -221,10 +207,7 @@
}
try {
- // Get the rendered HTML content
const htmlContent = element.innerHTML;
-
- // Use the Clipboard API to write the HTML content as rich text
await navigator.clipboard.write([
new ClipboardItem({
'text/html': new Blob([htmlContent], {
@@ -241,10 +224,9 @@
}}
class:hidden={journals_journal_entry_obj.template ||
$lq__journal_obj?.cfg_json?.hide_copy_rich}
- class="btn btn-sm p-1 preset-tonal-secondary *:hover:inline lg:text-xs"
+ class="btn btn-sm p-1 preset-tonal-surface hover:preset-filled-secondary-500 *:hover:inline lg:text-xs"
title="Copy the rich text (rendered HTML) content"
>
-
Copy Rich Text
@@ -253,8 +235,6 @@
-
-
{:else}
-
-
Private
@@ -323,16 +297,12 @@
});
}}
class:hidden={$lq__journal_obj?.cfg_json?.hide_copy_encrypted}
- class="btn btn-sm p-1 preset-tonal-secondary hover:preset-filled-secondary-500 *:hover:inline text-xs lg:text-sm"
+ class="btn btn-sm p-1 preset-tonal-surface hover:preset-filled-secondary-500 *:hover:inline text-xs lg:text-sm"
title="Copy the encrypted content"
>
-
-
Copy Encrypted
-
-
{/if}
@@ -344,8 +314,7 @@
class:hidden={!journals_journal_entry_obj?.data_json?.hosted_file_kv}
>
- Linked files:
+ Linked files:
{journals_journal_entry_obj?.data_json?.hosted_file_kv
? Object.keys(
@@ -376,11 +345,9 @@
{#if journals_journal_entry_obj.category_code}
-
{#if journals_journal_entry_obj.content}
-
-
-
-
-
-
-
{
- // Optionally, you can provide feedback to the user
- // alert('Journal entry updated successfully!');
})
.catch((error) => {
console.error('Error updating journal entry:', error);
@@ -622,298 +548,17 @@
{/each}
-
{#if $journals_sess.show__modal_append__journal_entry_id}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
{/if}
{:else}
No journal entry available to show.
{/if}
-
-
+
\ No newline at end of file
diff --git a/src/routes/journals/ae_comp__journal_entry_quick_add.svelte b/src/routes/journals/ae_comp__journal_entry_quick_add.svelte
new file mode 100644
index 00000000..bf86f016
--- /dev/null
+++ b/src/routes/journals/ae_comp__journal_entry_quick_add.svelte
@@ -0,0 +1,106 @@
+
+
+
+
+ Quick Add
+ {#if !target_journal_id}
+ No Journal Selected
+ {/if}
+
+
+
+
+
+
+
+
+
diff --git a/src/routes/journals/ae_comp__modal_journal_entry_append.svelte b/src/routes/journals/ae_comp__modal_journal_entry_append.svelte
new file mode 100644
index 00000000..8d0cf161
--- /dev/null
+++ b/src/routes/journals/ae_comp__modal_journal_entry_append.svelte
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file