style(journals): apply expanded 80-width formatting and snake_case
- Batch formatted all Journals module files using Prettier with printWidth: 80. - Refactored preventDefault to prevent_default across all Svelte components. - Standardized line breaks for imports and long attribute lists for better readability. - Ensured consistent snake_case naming for internal identifiers.
This commit is contained in:
@@ -3,7 +3,17 @@
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
// *** Import other supporting libraries
|
||||
import { BookPlus, BookOpenText, FilePlus, Menu, Pencil, FileDown, FileUp, Settings, LoaderCircle } from 'lucide-svelte';
|
||||
import {
|
||||
BookPlus,
|
||||
BookOpenText,
|
||||
FilePlus,
|
||||
Menu,
|
||||
Pencil,
|
||||
FileDown,
|
||||
FileUp,
|
||||
Settings,
|
||||
LoaderCircle
|
||||
} from 'lucide-svelte';
|
||||
|
||||
// *** Import Aether specific variables and functions
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
@@ -34,7 +44,13 @@
|
||||
on_show_import?: () => void;
|
||||
}
|
||||
|
||||
let { log_lvl = 0, lq__journal_obj, lq__journal_entry_obj_li, on_show_export, on_show_import }: Props = $props();
|
||||
let {
|
||||
log_lvl = 0,
|
||||
lq__journal_obj,
|
||||
lq__journal_entry_obj_li,
|
||||
on_show_export,
|
||||
on_show_import
|
||||
}: Props = $props();
|
||||
|
||||
// let ae_promises: key_val = {};
|
||||
// let ae_tmp: key_val = {};
|
||||
@@ -60,7 +76,8 @@
|
||||
if (
|
||||
$lq__journal_obj?.id &&
|
||||
$journals_sess?.journal_kv[$lq__journal_obj?.id] &&
|
||||
$journals_sess?.journal_kv[$lq__journal_obj?.id]?.journal_passcode_verified
|
||||
$journals_sess?.journal_kv[$lq__journal_obj?.id]
|
||||
?.journal_passcode_verified
|
||||
) {
|
||||
if (passcode_timer) {
|
||||
if (log_lvl) {
|
||||
@@ -74,27 +91,30 @@
|
||||
const timeout_ms = 1000 * 60 * timeout_minutes;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`Setting passcode timer for ${timeout_minutes} minutes (${timeout_ms}ms)`);
|
||||
console.log(
|
||||
`Setting passcode timer for ${timeout_minutes} minutes (${timeout_ms}ms)`
|
||||
);
|
||||
}
|
||||
|
||||
passcode_timer = setTimeout(
|
||||
() => {
|
||||
if (log_lvl) {
|
||||
console.log('Passcode timer expired');
|
||||
}
|
||||
typed_journal_passcode = '';
|
||||
if (!$journals_sess?.journal_kv[$lq__journal_obj?.id]) {
|
||||
$journals_sess.journal_kv[$lq__journal_obj?.id] = {};
|
||||
}
|
||||
passcode_timer = setTimeout(() => {
|
||||
if (log_lvl) {
|
||||
console.log('Passcode timer expired');
|
||||
}
|
||||
typed_journal_passcode = '';
|
||||
if (!$journals_sess?.journal_kv[$lq__journal_obj?.id]) {
|
||||
$journals_sess.journal_kv[$lq__journal_obj?.id] = {};
|
||||
}
|
||||
|
||||
// Reset verification and decryption flags
|
||||
$journals_sess.journal_kv[$lq__journal_obj?.id].journal_passcode_verified = false;
|
||||
$journals_sess.journal_kv[$lq__journal_obj?.id].journal_passcode_decrypted = false;
|
||||
// Reset verification and decryption flags
|
||||
$journals_sess.journal_kv[
|
||||
$lq__journal_obj?.id
|
||||
].journal_passcode_verified = false;
|
||||
$journals_sess.journal_kv[
|
||||
$lq__journal_obj?.id
|
||||
].journal_passcode_decrypted = false;
|
||||
|
||||
passcode_timer = null;
|
||||
},
|
||||
timeout_ms
|
||||
);
|
||||
passcode_timer = null;
|
||||
}, timeout_ms);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -137,9 +157,13 @@
|
||||
});
|
||||
|
||||
if (results?.journal_entry_id_random) {
|
||||
$journals_slct.journal_entry_id = results.journal_entry_id_random;
|
||||
$journals_loc.entry.edit_kv[$journals_slct.journal_entry_id] = 'current';
|
||||
goto(`/journals/${$lq__journal_obj?.journal_id}/entry/${results.journal_entry_id_random}`);
|
||||
$journals_slct.journal_entry_id =
|
||||
results.journal_entry_id_random;
|
||||
$journals_loc.entry.edit_kv[$journals_slct.journal_entry_id] =
|
||||
'current';
|
||||
goto(
|
||||
`/journals/${$lq__journal_obj?.journal_id}/entry/${results.journal_entry_id_random}`
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error creating journal entry:', error);
|
||||
@@ -169,19 +193,28 @@
|
||||
class="badge preset-tonal-success font-bold text-lg px-2 ml-2"
|
||||
title="Entries matching current filters"
|
||||
>
|
||||
{$lq__journal_entry_obj_li?.length ?? '0'}<span class="text-xs opacity-50 ml-0.5">×</span>
|
||||
{$lq__journal_entry_obj_li?.length ?? '0'}<span
|
||||
class="text-xs opacity-50 ml-0.5">×</span
|
||||
>
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
{#await $journals_prom.load__journal_entry_obj_li}
|
||||
<LoaderCircle size="1em" class="inline-block animate-spin ml-1 text-primary-500" />
|
||||
<LoaderCircle
|
||||
size="1em"
|
||||
class="inline-block animate-spin ml-1 text-primary-500"
|
||||
/>
|
||||
{/await}
|
||||
</h2>
|
||||
|
||||
<div class="grow flex flex-row flex-wrap gap-2 items-center justify-end">
|
||||
<div
|
||||
class="grow flex flex-row flex-wrap gap-2 items-center justify-end"
|
||||
>
|
||||
<!-- Simplified Config Trigger -->
|
||||
<button type="button"
|
||||
onclick={() => ($journals_sess.show__modal_edit__journal_obj = true)}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() =>
|
||||
($journals_sess.show__modal_edit__journal_obj = true)}
|
||||
class="btn variant-filled-secondary py-1 px-3 shadow-md"
|
||||
title="Journal Config & Actions"
|
||||
>
|
||||
@@ -238,6 +271,6 @@
|
||||
{lq__journal_obj}
|
||||
show={$journals_sess.show__modal_edit__journal_obj}
|
||||
on_new_entry={handle_new_entry}
|
||||
on_show_export={on_show_export}
|
||||
on_show_import={on_show_import}
|
||||
{on_show_export}
|
||||
{on_show_import}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user