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:
@@ -44,10 +44,7 @@
|
||||
import { untrack } from 'svelte';
|
||||
|
||||
// *** Import Aether specific variables and functions
|
||||
import {
|
||||
ae_loc,
|
||||
ae_api
|
||||
} from '$lib/stores/ae_stores';
|
||||
import { ae_loc, ae_api } from '$lib/stores/ae_stores';
|
||||
import {
|
||||
journals_loc,
|
||||
journals_sess,
|
||||
@@ -75,7 +72,8 @@
|
||||
}: Props = $props();
|
||||
|
||||
// *** Internal State
|
||||
let tab: 'actions' | 'general' | 'security' | 'ui' | 'json' = $state('actions');
|
||||
let tab: 'actions' | 'general' | 'security' | 'ui' | 'json' =
|
||||
$state('actions');
|
||||
let tmp__journal_obj: any = $state({});
|
||||
|
||||
// Deep copy on mount or when lq changes to ensure we have a working copy
|
||||
@@ -83,10 +81,16 @@
|
||||
if (show && $lq__journal_obj) {
|
||||
const source_id = $lq__journal_obj.journal_id;
|
||||
untrack(() => {
|
||||
if (!tmp__journal_obj.journal_id || tmp__journal_obj.journal_id !== source_id) {
|
||||
tmp__journal_obj = JSON.parse(JSON.stringify($lq__journal_obj));
|
||||
if (
|
||||
!tmp__journal_obj.journal_id ||
|
||||
tmp__journal_obj.journal_id !== source_id
|
||||
) {
|
||||
tmp__journal_obj = JSON.parse(
|
||||
JSON.stringify($lq__journal_obj)
|
||||
);
|
||||
// Ensure cfg_json exists
|
||||
if (!tmp__journal_obj.cfg_json) tmp__journal_obj.cfg_json = {};
|
||||
if (!tmp__journal_obj.cfg_json)
|
||||
tmp__journal_obj.cfg_json = {};
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -136,7 +140,7 @@
|
||||
data_kv: data_kv,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
|
||||
|
||||
if (close_modal) show = false;
|
||||
} catch (error) {
|
||||
console.error('Error updating journal:', error);
|
||||
@@ -145,7 +149,11 @@
|
||||
}
|
||||
|
||||
async function delete_journal() {
|
||||
if (confirm(`CRITICAL WARNING: Are you sure you want to delete the journal "${$lq__journal_obj.name}"? This will delete all entries associated with it.`)) {
|
||||
if (
|
||||
confirm(
|
||||
`CRITICAL WARNING: Are you sure you want to delete the journal "${$lq__journal_obj.name}"? This will delete all entries associated with it.`
|
||||
)
|
||||
) {
|
||||
try {
|
||||
await journals_func.delete_ae_obj_id__journal({
|
||||
api_cfg: $ae_api,
|
||||
@@ -180,20 +188,52 @@
|
||||
|
||||
<div class="space-y-6 py-2 h-[75vh] overflow-y-auto px-4">
|
||||
<!-- Navigation Tabs -->
|
||||
<div class="flex justify-center gap-1 mb-4 p-1 bg-surface-500/10 rounded-lg max-w-fit mx-auto sticky top-0 z-10 backdrop-blur-sm">
|
||||
<button type="button" class="btn btn-sm transition-all {tab === 'actions' ? 'variant-filled-primary' : 'variant-soft-surface'}" onclick={() => (tab = 'actions')}>
|
||||
<div
|
||||
class="flex justify-center gap-1 mb-4 p-1 bg-surface-500/10 rounded-lg max-w-fit mx-auto sticky top-0 z-10 backdrop-blur-sm"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm transition-all {tab === 'actions'
|
||||
? 'variant-filled-primary'
|
||||
: 'variant-soft-surface'}"
|
||||
onclick={() => (tab = 'actions')}
|
||||
>
|
||||
<Zap size="1.1em" class="mr-1" /> Quick Actions
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm transition-all {tab === 'general' ? 'variant-filled-primary' : 'variant-soft-surface'}" onclick={() => (tab = 'general')}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm transition-all {tab === 'general'
|
||||
? 'variant-filled-primary'
|
||||
: 'variant-soft-surface'}"
|
||||
onclick={() => (tab = 'general')}
|
||||
>
|
||||
<Layout size="1.1em" class="mr-1" /> General
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm transition-all {tab === 'security' ? 'variant-filled-primary' : 'variant-soft-surface'}" onclick={() => (tab = 'security')}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm transition-all {tab === 'security'
|
||||
? 'variant-filled-primary'
|
||||
: 'variant-soft-surface'}"
|
||||
onclick={() => (tab = 'security')}
|
||||
>
|
||||
<ShieldCheck size="1.1em" class="mr-1" /> Status & Security
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm transition-all {tab === 'ui' ? 'variant-filled-primary' : 'variant-soft-surface'}" onclick={() => (tab = 'ui')}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm transition-all {tab === 'ui'
|
||||
? 'variant-filled-primary'
|
||||
: 'variant-soft-surface'}"
|
||||
onclick={() => (tab = 'ui')}
|
||||
>
|
||||
<Palette size="1.1em" class="mr-1" /> UI/Visuals
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm transition-all {tab === 'json' ? 'variant-filled-primary' : 'variant-soft-surface'}" onclick={() => (tab = 'json')}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm transition-all {tab === 'json'
|
||||
? 'variant-filled-primary'
|
||||
: 'variant-soft-surface'}"
|
||||
onclick={() => (tab = 'json')}
|
||||
>
|
||||
<CodeXml size="1.1em" class="mr-1" /> JSON
|
||||
</button>
|
||||
</div>
|
||||
@@ -201,111 +241,241 @@
|
||||
{#if tab === 'actions'}
|
||||
<div class="space-y-6 animate-in fade-in duration-300">
|
||||
<section class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<button type="button" class="btn variant-soft-secondary w-full py-4 text-lg font-bold" onclick={() => { show = false; on_new_entry?.(); }}>
|
||||
<FilePlus size="1.5em" class="mr-2"/> New Journal Entry
|
||||
<button
|
||||
type="button"
|
||||
class="btn variant-soft-secondary w-full py-4 text-lg font-bold"
|
||||
onclick={() => {
|
||||
show = false;
|
||||
on_new_entry?.();
|
||||
}}
|
||||
>
|
||||
<FilePlus size="1.5em" class="mr-2" /> New Journal Entry
|
||||
</button>
|
||||
<button type="button" class="btn variant-soft-surface w-full py-4" onclick={() => { show = false; on_show_export?.(); }}>
|
||||
<FileDown size="1.5em" class="mr-2"/> Export Entries
|
||||
<button
|
||||
type="button"
|
||||
class="btn variant-soft-surface w-full py-4"
|
||||
onclick={() => {
|
||||
show = false;
|
||||
on_show_export?.();
|
||||
}}
|
||||
>
|
||||
<FileDown size="1.5em" class="mr-2" /> Export Entries
|
||||
</button>
|
||||
<button type="button" class="btn variant-soft-surface w-full py-4" onclick={() => { show = false; on_show_import?.(); }}>
|
||||
<FileUp size="1.5em" class="mr-2"/> Import Entries
|
||||
<button
|
||||
type="button"
|
||||
class="btn variant-soft-surface w-full py-4"
|
||||
onclick={() => {
|
||||
show = false;
|
||||
on_show_import?.();
|
||||
}}
|
||||
>
|
||||
<FileUp size="1.5em" class="mr-2" /> Import Entries
|
||||
</button>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{:else if tab === 'general'}
|
||||
<div class="space-y-6 animate-in fade-in duration-300">
|
||||
<!-- Core Meta -->
|
||||
<section class="grid grid-cols-1 gap-4 p-2">
|
||||
<label class="label">
|
||||
<span class="text-sm font-bold opacity-70">Journal Name</span>
|
||||
<input type="text" bind:value={tmp__journal_obj.name} class="input variant-form-material" placeholder="e.g. Personal Log" />
|
||||
<span class="text-sm font-bold opacity-70"
|
||||
>Journal Name</span
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
bind:value={tmp__journal_obj.name}
|
||||
class="input variant-form-material"
|
||||
placeholder="e.g. Personal Log"
|
||||
/>
|
||||
</label>
|
||||
<label class="label">
|
||||
<span class="text-sm font-bold opacity-70">Description (Markdown)</span>
|
||||
<textarea bind:value={tmp__journal_obj.description} class="textarea variant-form-material h-32" placeholder="Describe the purpose of this journal..."></textarea>
|
||||
<span class="text-sm font-bold opacity-70"
|
||||
>Description (Markdown)</span
|
||||
>
|
||||
<textarea
|
||||
bind:value={tmp__journal_obj.description}
|
||||
class="textarea variant-form-material h-32"
|
||||
placeholder="Describe the purpose of this journal..."
|
||||
></textarea>
|
||||
</label>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<label class="label">
|
||||
<span class="text-sm font-bold opacity-70">Type</span>
|
||||
<select bind:value={tmp__journal_obj.type_code} class="select variant-form-material">
|
||||
<span class="text-sm font-bold opacity-70"
|
||||
>Type</span
|
||||
>
|
||||
<select
|
||||
bind:value={tmp__journal_obj.type_code}
|
||||
class="select variant-form-material"
|
||||
>
|
||||
{#each $journals_loc.journal.type_code_li as type}
|
||||
<option value={type.code}>{type.name}</option>
|
||||
<option value={type.code}
|
||||
>{type.name}</option
|
||||
>
|
||||
{/each}
|
||||
</select>
|
||||
</label>
|
||||
<label class="label">
|
||||
<span class="text-sm font-bold opacity-70">Sort Group</span>
|
||||
<input type="text" bind:value={tmp__journal_obj.group} class="input variant-form-material" placeholder="Standard" />
|
||||
<span class="text-sm font-bold opacity-70"
|
||||
>Sort Group</span
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
bind:value={tmp__journal_obj.group}
|
||||
class="input variant-form-material"
|
||||
placeholder="Standard"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Categories -->
|
||||
<section class="space-y-4 p-2">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2">
|
||||
<h2
|
||||
class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2"
|
||||
>
|
||||
<MonitorPlay size="1em" class="text-primary-500" />
|
||||
Journal Categories
|
||||
</h2>
|
||||
<div class="space-y-2 bg-surface-500/5 p-4 rounded-lg border border-surface-500/10">
|
||||
<div
|
||||
class="space-y-2 bg-surface-500/5 p-4 rounded-lg border border-surface-500/10"
|
||||
>
|
||||
{#each tmp__journal_obj?.cfg_json?.category_li ?? [] as category, i}
|
||||
<div class="flex gap-2 items-center">
|
||||
<input type="text" bind:value={category.code} class="input input-sm w-32" placeholder="Code" />
|
||||
<input type="text" bind:value={category.name} class="input input-sm grow" placeholder="Display Name" />
|
||||
<button type="button" class="btn-icon btn-icon-sm variant-soft-error" onclick={() => { tmp__journal_obj.cfg_json.category_li.splice(i, 1); }}>
|
||||
<input
|
||||
type="text"
|
||||
bind:value={category.code}
|
||||
class="input input-sm w-32"
|
||||
placeholder="Code"
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
bind:value={category.name}
|
||||
class="input input-sm grow"
|
||||
placeholder="Display Name"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-icon btn-icon-sm variant-soft-error"
|
||||
onclick={() => {
|
||||
tmp__journal_obj.cfg_json.category_li.splice(
|
||||
i,
|
||||
1
|
||||
);
|
||||
}}
|
||||
>
|
||||
<Minus size="1em" />
|
||||
</button>
|
||||
</div>
|
||||
{/each}
|
||||
<button type="button" class="btn btn-sm variant-soft-primary w-full mt-2" onclick={() => {
|
||||
if(!tmp__journal_obj.cfg_json.category_li) tmp__journal_obj.cfg_json.category_li = [];
|
||||
tmp__journal_obj.cfg_json.category_li.push({code: '', name: ''});
|
||||
}}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-soft-primary w-full mt-2"
|
||||
onclick={() => {
|
||||
if (!tmp__journal_obj.cfg_json.category_li)
|
||||
tmp__journal_obj.cfg_json.category_li = [];
|
||||
tmp__journal_obj.cfg_json.category_li.push({
|
||||
code: '',
|
||||
name: ''
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Plus size="1em" class="mr-1" /> Add Category
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{:else if tab === 'security'}
|
||||
<div class="space-y-6 animate-in fade-in duration-300">
|
||||
<!-- Status & Lifecycle -->
|
||||
<section class="space-y-4 p-2">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2">
|
||||
<h2
|
||||
class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2"
|
||||
>
|
||||
<Fingerprint size="1.2em" class="text-primary-500" />
|
||||
Status & Lifecycle
|
||||
</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<label class="flex items-center space-x-3 cursor-pointer p-3 rounded-lg bg-surface-500/5 border border-surface-500/10 transition-colors hover:bg-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.enable} onchange={() => handle_update_journal(false)} class="checkbox checkbox-primary" />
|
||||
<label
|
||||
class="flex items-center space-x-3 cursor-pointer p-3 rounded-lg bg-surface-500/5 border border-surface-500/10 transition-colors hover:bg-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={tmp__journal_obj.enable}
|
||||
onchange={() => handle_update_journal(false)}
|
||||
class="checkbox checkbox-primary"
|
||||
/>
|
||||
<div class="flex flex-col">
|
||||
<span class="font-bold">Enabled</span>
|
||||
<span class="text-xs opacity-60">Allow access to this journal</span>
|
||||
<span class="text-xs opacity-60"
|
||||
>Allow access to this journal</span
|
||||
>
|
||||
</div>
|
||||
</label>
|
||||
<label class="flex items-center space-x-3 cursor-pointer p-3 rounded-lg bg-surface-500/5 border border-surface-500/10 transition-colors hover:bg-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.hide} onchange={() => handle_update_journal(false)} class="checkbox checkbox-primary" />
|
||||
<label
|
||||
class="flex items-center space-x-3 cursor-pointer p-3 rounded-lg bg-surface-500/5 border border-surface-500/10 transition-colors hover:bg-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={tmp__journal_obj.hide}
|
||||
onchange={() => handle_update_journal(false)}
|
||||
class="checkbox checkbox-primary"
|
||||
/>
|
||||
<div class="flex flex-col">
|
||||
<span class="font-bold">Hidden</span>
|
||||
<span class="text-xs opacity-60">Hide from standard lists</span>
|
||||
<span class="text-xs opacity-60"
|
||||
>Hide from standard lists</span
|
||||
>
|
||||
</div>
|
||||
</label>
|
||||
<label class="flex items-center space-x-3 cursor-pointer p-3 rounded-lg bg-surface-500/5 border border-surface-500/10 transition-colors hover:bg-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.priority} onchange={() => handle_update_journal(false)} class="checkbox checkbox-primary" />
|
||||
<label
|
||||
class="flex items-center space-x-3 cursor-pointer p-3 rounded-lg bg-surface-500/5 border border-surface-500/10 transition-colors hover:bg-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={tmp__journal_obj.priority}
|
||||
onchange={() => handle_update_journal(false)}
|
||||
class="checkbox checkbox-primary"
|
||||
/>
|
||||
<div class="flex flex-col">
|
||||
<span class="font-bold">Priority Journal</span>
|
||||
<span class="text-xs opacity-60">Star or pin to top</span>
|
||||
<span class="text-xs opacity-60"
|
||||
>Star or pin to top</span
|
||||
>
|
||||
</div>
|
||||
</label>
|
||||
<div class="flex items-center justify-between p-3 rounded-lg bg-surface-500/5 border border-surface-500/10">
|
||||
<div
|
||||
class="flex items-center justify-between p-3 rounded-lg bg-surface-500/5 border border-surface-500/10"
|
||||
>
|
||||
<div class="flex flex-col">
|
||||
<span class="font-bold text-sm">Sort Order</span>
|
||||
<span class="text-xs opacity-60">Manual list position</span>
|
||||
<span class="font-bold text-sm">Sort Order</span
|
||||
>
|
||||
<span class="text-xs opacity-60"
|
||||
>Manual list position</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<button type="button" class="btn-icon btn-icon-sm variant-soft-surface" onclick={() => { tmp__journal_obj.sort = (tmp__journal_obj.sort ?? 0) - 1; handle_update_journal(false); }}><Minus size="1em"/></button>
|
||||
<span class="font-mono font-bold w-8 text-center text-lg">{tmp__journal_obj.sort ?? 0}</span>
|
||||
<button type="button" class="btn-icon btn-icon-sm variant-soft-surface" onclick={() => { tmp__journal_obj.sort = (tmp__journal_obj.sort ?? 0) + 1; handle_update_journal(false); }}><Plus size="1em"/></button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-icon btn-icon-sm variant-soft-surface"
|
||||
onclick={() => {
|
||||
tmp__journal_obj.sort =
|
||||
(tmp__journal_obj.sort ?? 0) - 1;
|
||||
handle_update_journal(false);
|
||||
}}><Minus size="1em" /></button
|
||||
>
|
||||
<span
|
||||
class="font-mono font-bold w-8 text-center text-lg"
|
||||
>{tmp__journal_obj.sort ?? 0}</span
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-icon btn-icon-sm variant-soft-surface"
|
||||
onclick={() => {
|
||||
tmp__journal_obj.sort =
|
||||
(tmp__journal_obj.sort ?? 0) + 1;
|
||||
handle_update_journal(false);
|
||||
}}><Plus size="1em" /></button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -313,64 +483,126 @@
|
||||
|
||||
<!-- Encryption Passcodes -->
|
||||
<section class="space-y-4 p-2">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2">
|
||||
<h2
|
||||
class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2"
|
||||
>
|
||||
<LockKeyhole size="1.2em" class="text-primary-500" />
|
||||
Encryption Passcodes
|
||||
</h2>
|
||||
<div class="bg-warning-500/10 border border-warning-500/30 p-4 rounded-lg space-y-4 shadow-inner">
|
||||
<div
|
||||
class="bg-warning-500/10 border border-warning-500/30 p-4 rounded-lg space-y-4 shadow-inner"
|
||||
>
|
||||
<label class="label">
|
||||
<span class="text-xs font-bold uppercase tracking-wider opacity-70">Primary Passcode (Stored)</span>
|
||||
<span
|
||||
class="text-xs font-bold uppercase tracking-wider opacity-70"
|
||||
>Primary Passcode (Stored)</span
|
||||
>
|
||||
<div class="flex gap-2">
|
||||
<input type="password" bind:value={tmp__journal_obj.passcode} class="input variant-form-material grow" placeholder="Module-level passcode" />
|
||||
<input
|
||||
type="password"
|
||||
bind:value={tmp__journal_obj.passcode}
|
||||
class="input variant-form-material grow"
|
||||
placeholder="Module-level passcode"
|
||||
/>
|
||||
<Fingerprint class="opacity-30" />
|
||||
</div>
|
||||
</label>
|
||||
<label class="label">
|
||||
<span class="text-xs font-bold uppercase tracking-wider opacity-70">Private Passcode (Double Encryption)</span>
|
||||
<span
|
||||
class="text-xs font-bold uppercase tracking-wider opacity-70"
|
||||
>Private Passcode (Double Encryption)</span
|
||||
>
|
||||
<div class="flex gap-2">
|
||||
<input type="password" bind:value={tmp__journal_obj.private_passcode} class="input variant-form-material grow" placeholder="User-level secret" />
|
||||
<input
|
||||
type="password"
|
||||
bind:value={
|
||||
tmp__journal_obj.private_passcode
|
||||
}
|
||||
class="input variant-form-material grow"
|
||||
placeholder="User-level secret"
|
||||
/>
|
||||
<ShieldCheck class="opacity-30" />
|
||||
</div>
|
||||
</label>
|
||||
<div class="text-[10px] text-warning-700 dark:text-warning-300 italic">
|
||||
* Note: Passcodes are used locally for E2EE. Primary is often stored in the DB, while Private should remain known only to you.
|
||||
<div
|
||||
class="text-[10px] text-warning-700 dark:text-warning-300 italic"
|
||||
>
|
||||
* Note: Passcodes are used locally for E2EE. Primary
|
||||
is often stored in the DB, while Private should
|
||||
remain known only to you.
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="pt-8">
|
||||
<button type="button" class="btn btn-sm variant-filled-error w-full shadow-lg" onclick={delete_journal}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-filled-error w-full shadow-lg"
|
||||
onclick={delete_journal}
|
||||
>
|
||||
<Trash2 size="1.1em" class="mr-2" /> Delete Entire Journal
|
||||
</button>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{:else if tab === 'ui'}
|
||||
<div class="space-y-8 animate-in fade-in duration-300">
|
||||
<section class="space-y-4 p-2">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2">
|
||||
<h2
|
||||
class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2"
|
||||
>
|
||||
<MonitorPlay size="1.2em" class="text-primary-500" />
|
||||
Default View Modes
|
||||
</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 bg-surface-500/5 p-4 rounded-lg border border-surface-500/10">
|
||||
<div
|
||||
class="grid grid-cols-1 md:grid-cols-2 gap-6 bg-surface-500/5 p-4 rounded-lg border border-surface-500/10"
|
||||
>
|
||||
<label class="label">
|
||||
<span class="text-sm font-bold opacity-70">Preferred Viewer</span>
|
||||
<select bind:value={tmp__journal_obj.cfg_json.pref_viewer} class="select variant-form-material">
|
||||
<option value="rendered">Rendered HTML (Default)</option>
|
||||
<span class="text-sm font-bold opacity-70"
|
||||
>Preferred Viewer</span
|
||||
>
|
||||
<select
|
||||
bind:value={
|
||||
tmp__journal_obj.cfg_json.pref_viewer
|
||||
}
|
||||
class="select variant-form-material"
|
||||
>
|
||||
<option value="rendered"
|
||||
>Rendered HTML (Default)</option
|
||||
>
|
||||
<option value="plain">Plain Text</option>
|
||||
<option value="codemirror">CodeMirror (Syntax)</option>
|
||||
<option value="codemirror"
|
||||
>CodeMirror (Syntax)</option
|
||||
>
|
||||
</select>
|
||||
</label>
|
||||
<label class="label">
|
||||
<span class="text-sm font-bold opacity-70">Preferred Editor</span>
|
||||
<select bind:value={tmp__journal_obj.cfg_json.pref_editor} class="select variant-form-material">
|
||||
<option value="textarea">Standard Textarea</option>
|
||||
<option value="codemirror">CodeMirror (Advanced)</option>
|
||||
<span class="text-sm font-bold opacity-70"
|
||||
>Preferred Editor</span
|
||||
>
|
||||
<select
|
||||
bind:value={
|
||||
tmp__journal_obj.cfg_json.pref_editor
|
||||
}
|
||||
class="select variant-form-material"
|
||||
>
|
||||
<option value="textarea"
|
||||
>Standard Textarea</option
|
||||
>
|
||||
<option value="codemirror"
|
||||
>CodeMirror (Advanced)</option
|
||||
>
|
||||
</select>
|
||||
</label>
|
||||
<label class="label">
|
||||
<span class="text-sm font-bold opacity-70">Color Scheme</span>
|
||||
<select bind:value={tmp__journal_obj.cfg_json.color_scheme} class="select variant-form-material">
|
||||
<span class="text-sm font-bold opacity-70"
|
||||
>Color Scheme</span
|
||||
>
|
||||
<select
|
||||
bind:value={
|
||||
tmp__journal_obj.cfg_json.color_scheme
|
||||
}
|
||||
class="select variant-form-material"
|
||||
>
|
||||
<option value="">Default (Slate)</option>
|
||||
<option value="blue">Deep Blue</option>
|
||||
<option value="green">Nature Green</option>
|
||||
@@ -380,10 +612,20 @@
|
||||
</select>
|
||||
</label>
|
||||
<label class="label">
|
||||
<span class="text-sm font-bold opacity-70">Quick Add Placement</span>
|
||||
<select bind:value={tmp__journal_obj.cfg_json.entry_add_text} class="select variant-form-material">
|
||||
<option value="append">Append to End (Default)</option>
|
||||
<option value="prepend">Prepend to Start</option>
|
||||
<span class="text-sm font-bold opacity-70"
|
||||
>Quick Add Placement</span
|
||||
>
|
||||
<select
|
||||
bind:value={
|
||||
tmp__journal_obj.cfg_json.entry_add_text
|
||||
}
|
||||
class="select variant-form-material"
|
||||
>
|
||||
<option value="append"
|
||||
>Append to End (Default)</option
|
||||
>
|
||||
<option value="prepend">Prepend to Start</option
|
||||
>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
@@ -391,106 +633,252 @@
|
||||
|
||||
<!-- Visibility Toggles (Restored) -->
|
||||
<section class="space-y-4 p-2">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2">
|
||||
<h2
|
||||
class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2"
|
||||
>
|
||||
<Eye size="1.2em" class="text-primary-500" />
|
||||
Entry Visibility (Global)
|
||||
</h2>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2">
|
||||
<label class="flex items-center space-x-2 cursor-pointer p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_private} class="checkbox checkbox-sm" />
|
||||
<div
|
||||
class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2"
|
||||
>
|
||||
<label
|
||||
class="flex items-center space-x-2 cursor-pointer p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_private
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-xs font-bold">Hide Private</span>
|
||||
</label>
|
||||
<label class="flex items-center space-x-2 cursor-pointer p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_personal} class="checkbox checkbox-sm" />
|
||||
<label
|
||||
class="flex items-center space-x-2 cursor-pointer p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_personal
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-xs font-bold">Hide Personal</span>
|
||||
</label>
|
||||
<label class="flex items-center space-x-2 cursor-pointer p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_professional} class="checkbox checkbox-sm" />
|
||||
<span class="text-xs font-bold">Hide Professional</span>
|
||||
<label
|
||||
class="flex items-center space-x-2 cursor-pointer p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_professional
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-xs font-bold"
|
||||
>Hide Professional</span
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Button Toggles (Restored) -->
|
||||
<section class="space-y-4 p-2">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2">
|
||||
<h2
|
||||
class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2"
|
||||
>
|
||||
<Settings size="1.2em" class="text-primary-500" />
|
||||
Entry Feature Buttons
|
||||
</h2>
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-2">
|
||||
<label class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_btn_alert} class="checkbox checkbox-sm" />
|
||||
<span class="text-[10px] uppercase font-bold">Hide Alert</span>
|
||||
<div
|
||||
class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-2"
|
||||
>
|
||||
<label
|
||||
class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_btn_alert
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-[10px] uppercase font-bold"
|
||||
>Hide Alert</span
|
||||
>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_btn_private} class="checkbox checkbox-sm" />
|
||||
<span class="text-[10px] uppercase font-bold">Hide Private</span>
|
||||
<label
|
||||
class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_btn_private
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-[10px] uppercase font-bold"
|
||||
>Hide Private</span
|
||||
>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_btn_public} class="checkbox checkbox-sm" />
|
||||
<span class="text-[10px] uppercase font-bold">Hide Public</span>
|
||||
<label
|
||||
class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_btn_public
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-[10px] uppercase font-bold"
|
||||
>Hide Public</span
|
||||
>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_btn_personal} class="checkbox checkbox-sm" />
|
||||
<span class="text-[10px] uppercase font-bold">Hide Pers.</span>
|
||||
<label
|
||||
class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_btn_personal
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-[10px] uppercase font-bold"
|
||||
>Hide Pers.</span
|
||||
>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_btn_professional} class="checkbox checkbox-sm" />
|
||||
<span class="text-[10px] uppercase font-bold">Hide Prof.</span>
|
||||
<label
|
||||
class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json
|
||||
.hide_btn_professional
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-[10px] uppercase font-bold"
|
||||
>Hide Prof.</span
|
||||
>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_btn_template} class="checkbox checkbox-sm" />
|
||||
<span class="text-[10px] uppercase font-bold">Hide Templ.</span>
|
||||
<label
|
||||
class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_btn_template
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-[10px] uppercase font-bold"
|
||||
>Hide Templ.</span
|
||||
>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_copy_plain_md} class="checkbox checkbox-sm" />
|
||||
<span class="text-[10px] uppercase font-bold">Hide Copy MD</span>
|
||||
<label
|
||||
class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_copy_plain_md
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-[10px] uppercase font-bold"
|
||||
>Hide Copy MD</span
|
||||
>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10">
|
||||
<input type="checkbox" bind:checked={tmp__journal_obj.cfg_json.hide_clone} class="checkbox checkbox-sm" />
|
||||
<span class="text-[10px] uppercase font-bold">Hide Clone</span>
|
||||
<label
|
||||
class="flex items-center gap-2 p-2 bg-surface-500/5 rounded border border-surface-500/10"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={
|
||||
tmp__journal_obj.cfg_json.hide_clone
|
||||
}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-[10px] uppercase font-bold"
|
||||
>Hide Clone</span
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="space-y-4 p-2">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2">
|
||||
<h2
|
||||
class="text-lg font-bold flex items-center gap-2 border-b border-surface-500/30 pb-2"
|
||||
>
|
||||
<Layout size="1.2em" class="text-primary-500" />
|
||||
List Interactions
|
||||
</h2>
|
||||
<div class="bg-surface-500/5 p-4 rounded-lg space-y-4">
|
||||
<label class="label">
|
||||
<span class="text-xs font-bold opacity-70">Expansion Trigger</span>
|
||||
<select bind:value={tmp__journal_obj.cfg_json.expand_li_content} class="select select-sm variant-form-material">
|
||||
<span class="text-xs font-bold opacity-70"
|
||||
>Expansion Trigger</span
|
||||
>
|
||||
<select
|
||||
bind:value={
|
||||
tmp__journal_obj.cfg_json.expand_li_content
|
||||
}
|
||||
class="select select-sm variant-form-material"
|
||||
>
|
||||
<option value="click">Click to Expand</option>
|
||||
<option value="hover">Hover to Expand</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<label class="label">
|
||||
<span class="text-xs font-bold opacity-70">List Max Height</span>
|
||||
<select bind:value={tmp__journal_obj.cfg_json.entry_li_max_height} class="select select-sm variant-form-material">
|
||||
<span class="text-xs font-bold opacity-70"
|
||||
>List Max Height</span
|
||||
>
|
||||
<select
|
||||
bind:value={
|
||||
tmp__journal_obj.cfg_json
|
||||
.entry_li_max_height
|
||||
}
|
||||
class="select select-sm variant-form-material"
|
||||
>
|
||||
<option value="">Default</option>
|
||||
<option value="max-h-16">Small (16)</option>
|
||||
<option value="max-h-32">Medium (32)</option>
|
||||
<option value="max-h-32">Medium (32)</option
|
||||
>
|
||||
<option value="max-h-64">Large (64)</option>
|
||||
<option value="max-h-full">Full</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="label">
|
||||
<span class="text-xs font-bold opacity-70">Active Max Height</span>
|
||||
<select bind:value={tmp__journal_obj.cfg_json.entry_li_click_max_height} class="select select-sm variant-form-material">
|
||||
<span class="text-xs font-bold opacity-70"
|
||||
>Active Max Height</span
|
||||
>
|
||||
<select
|
||||
bind:value={
|
||||
tmp__journal_obj.cfg_json
|
||||
.entry_li_click_max_height
|
||||
}
|
||||
class="select select-sm variant-form-material"
|
||||
>
|
||||
<option value="">Default</option>
|
||||
<option value="active:max-h-64">Large (64)</option>
|
||||
<option value="active:max-h-96">X-Large (96)</option>
|
||||
<option value="active:max-h-full">Full</option>
|
||||
<option value="active:max-h-64"
|
||||
>Large (64)</option
|
||||
>
|
||||
<option value="active:max-h-96"
|
||||
>X-Large (96)</option
|
||||
>
|
||||
<option value="active:max-h-full"
|
||||
>Full</option
|
||||
>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{:else if tab === 'json'}
|
||||
<div class="h-full min-h-[400px]">
|
||||
<AE_Comp_Editor_CodeMirror
|
||||
@@ -505,12 +893,20 @@
|
||||
|
||||
{#snippet footer()}
|
||||
<div class="flex gap-4">
|
||||
<button type="button" class="btn variant-ghost-surface font-bold min-w-[100px]" onclick={() => (show = false)}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn variant-ghost-surface font-bold min-w-[100px]"
|
||||
onclick={() => (show = false)}
|
||||
>
|
||||
<X size="1.2em" class="mr-2" /> Cancel
|
||||
</button>
|
||||
<button type="button" class="btn variant-filled-primary font-bold shadow-lg min-w-[120px]" onclick={() => handle_update_journal(true)}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn variant-filled-primary font-bold shadow-lg min-w-[120px]"
|
||||
onclick={() => handle_update_journal(true)}
|
||||
>
|
||||
<Check size="1.2em" class="mr-2" /> Save Changes
|
||||
</button>
|
||||
</div>
|
||||
{/snippet}
|
||||
</Modal>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user