Prettier for Event Launcher
This commit is contained in:
@@ -1,160 +1,159 @@
|
||||
<script lang="ts">
|
||||
/**
|
||||
* launcher_menu.svelte — Aether Launcher: Sidebar Menu Container
|
||||
*
|
||||
* PURPOSE:
|
||||
* The main sidebar panel for the Aether Events Launcher. Composes all menu
|
||||
* sub-components into a single vertical column and passes data down from the
|
||||
* parent layout. This is intentionally a thin coordinator — business logic lives
|
||||
* in the individual sub-components and the layout's liveQuery / effect layer.
|
||||
*
|
||||
* STRUCTURE (top to bottom):
|
||||
* 1. Event-level files (lq__event_event_file_obj_li)
|
||||
* Files attached directly to the event (e.g. a shared opening slide deck).
|
||||
* Shown regardless of which room/session is selected.
|
||||
*
|
||||
* 2. Location selector (Menu_location_list_menu — edit mode only)
|
||||
* Dropdown that lets operators switch the active room. Triggers a session
|
||||
* list reload and navigates the URL to /launcher/{location_id}.
|
||||
*
|
||||
* 3. Location-level files (lq__location_event_file_obj_li)
|
||||
* Files attached to the selected room — e.g. A/V setup guides, room schedules.
|
||||
* Hidden until a room is selected.
|
||||
*
|
||||
* 4. Session list (Menu_session_list_menu)
|
||||
* Compact button list of all sessions in the selected room. Operators click
|
||||
* to switch the active session; hover pre-loads after a delay timer.
|
||||
*
|
||||
* 5. Launcher controls (Menu_launcher_controls)
|
||||
* Bottom bar for accessibility and visibility settings: font size cycler,
|
||||
* light/dark toggle, and (edit mode only) show/hide draft files/sessions.
|
||||
*
|
||||
* DATA FLOW:
|
||||
* All liveQuery stores (lq__*) are passed in from +layout.svelte and originate
|
||||
* from Dexie IndexedDB — never fetched directly here. Selection state is
|
||||
* coordinated via $events_slct / $events_loc stores.
|
||||
*/
|
||||
interface Props {
|
||||
lq__event_obj: any;
|
||||
/**
|
||||
* launcher_menu.svelte — Aether Launcher: Sidebar Menu Container
|
||||
*
|
||||
* PURPOSE:
|
||||
* The main sidebar panel for the Aether Events Launcher. Composes all menu
|
||||
* sub-components into a single vertical column and passes data down from the
|
||||
* parent layout. This is intentionally a thin coordinator — business logic lives
|
||||
* in the individual sub-components and the layout's liveQuery / effect layer.
|
||||
*
|
||||
* STRUCTURE (top to bottom):
|
||||
* 1. Event-level files (lq__event_event_file_obj_li)
|
||||
* Files attached directly to the event (e.g. a shared opening slide deck).
|
||||
* Shown regardless of which room/session is selected.
|
||||
*
|
||||
* 2. Location selector (Menu_location_list_menu — edit mode only)
|
||||
* Dropdown that lets operators switch the active room. Triggers a session
|
||||
* list reload and navigates the URL to /launcher/{location_id}.
|
||||
*
|
||||
* 3. Location-level files (lq__location_event_file_obj_li)
|
||||
* Files attached to the selected room — e.g. A/V setup guides, room schedules.
|
||||
* Hidden until a room is selected.
|
||||
*
|
||||
* 4. Session list (Menu_session_list_menu)
|
||||
* Compact button list of all sessions in the selected room. Operators click
|
||||
* to switch the active session; hover pre-loads after a delay timer.
|
||||
*
|
||||
* 5. Launcher controls (Menu_launcher_controls)
|
||||
* Bottom bar for accessibility and visibility settings: font size cycler,
|
||||
* light/dark toggle, and (edit mode only) show/hide draft files/sessions.
|
||||
*
|
||||
* DATA FLOW:
|
||||
* All liveQuery stores (lq__*) are passed in from +layout.svelte and originate
|
||||
* from Dexie IndexedDB — never fetched directly here. Selection state is
|
||||
* coordinated via $events_slct / $events_loc stores.
|
||||
*/
|
||||
interface Props {
|
||||
lq__event_obj: any;
|
||||
|
||||
lq__event_event_file_obj_li: any;
|
||||
lq__location_event_file_obj_li: any;
|
||||
slct__event_file_id?: string | null;
|
||||
lq__event_event_file_obj_li: any;
|
||||
lq__location_event_file_obj_li: any;
|
||||
slct__event_file_id?: string | null;
|
||||
|
||||
lq__event_location_obj_li: any;
|
||||
lq__event_location_obj?: any;
|
||||
slct__event_location_id?: string | null;
|
||||
lq__event_location_obj_li: any;
|
||||
lq__event_location_obj?: any;
|
||||
slct__event_location_id?: string | null;
|
||||
|
||||
loading__session_li_status?: null | boolean | string;
|
||||
lq__event_session_obj_li: any;
|
||||
loading__session_id_status?: null | boolean | string;
|
||||
lq__event_session_obj?: any;
|
||||
slct__event_session_id?: string | null;
|
||||
loading__session_li_status?: null | boolean | string;
|
||||
lq__event_session_obj_li: any;
|
||||
loading__session_id_status?: null | boolean | string;
|
||||
lq__event_session_obj?: any;
|
||||
slct__event_session_id?: string | null;
|
||||
|
||||
trigger_reload__event_obj_id?: boolean | null | string;
|
||||
trigger_reload__event_session_obj_id?: boolean | null | string;
|
||||
trigger_reload__event_session_obj_li?: boolean;
|
||||
trigger_reload__event_location_obj_id?: boolean | null | string;
|
||||
trigger_reload__event_location_obj_li?: boolean;
|
||||
trigger_reload__event_obj_id?: boolean | null | string;
|
||||
trigger_reload__event_session_obj_id?: boolean | null | string;
|
||||
trigger_reload__event_session_obj_li?: boolean;
|
||||
trigger_reload__event_location_obj_id?: boolean | null | string;
|
||||
trigger_reload__event_location_obj_li?: boolean;
|
||||
|
||||
log_lvl?: number;
|
||||
}
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
let {
|
||||
lq__event_obj,
|
||||
let {
|
||||
lq__event_obj,
|
||||
|
||||
lq__event_event_file_obj_li,
|
||||
lq__location_event_file_obj_li,
|
||||
slct__event_file_id = $bindable(null),
|
||||
lq__event_event_file_obj_li,
|
||||
lq__location_event_file_obj_li,
|
||||
slct__event_file_id = $bindable(null),
|
||||
|
||||
lq__event_location_obj_li,
|
||||
lq__event_location_obj,
|
||||
slct__event_location_id = $bindable(null),
|
||||
lq__event_location_obj_li,
|
||||
lq__event_location_obj,
|
||||
slct__event_location_id = $bindable(null),
|
||||
|
||||
loading__session_li_status = $bindable(null),
|
||||
lq__event_session_obj_li,
|
||||
loading__session_id_status = $bindable(null),
|
||||
lq__event_session_obj,
|
||||
slct__event_session_id = $bindable(null),
|
||||
loading__session_li_status = $bindable(null),
|
||||
lq__event_session_obj_li,
|
||||
loading__session_id_status = $bindable(null),
|
||||
lq__event_session_obj,
|
||||
slct__event_session_id = $bindable(null),
|
||||
|
||||
trigger_reload__event_obj_id = $bindable(false),
|
||||
trigger_reload__event_session_obj_id = $bindable(false),
|
||||
trigger_reload__event_session_obj_li = $bindable(false),
|
||||
trigger_reload__event_location_obj_id = $bindable(false),
|
||||
trigger_reload__event_location_obj_li = $bindable(false),
|
||||
trigger_reload__event_obj_id = $bindable(false),
|
||||
trigger_reload__event_session_obj_id = $bindable(false),
|
||||
trigger_reload__event_session_obj_li = $bindable(false),
|
||||
trigger_reload__event_location_obj_id = $bindable(false),
|
||||
trigger_reload__event_location_obj_li = $bindable(false),
|
||||
|
||||
log_lvl = $bindable(0)
|
||||
}: Props = $props();
|
||||
log_lvl = $bindable(0)
|
||||
}: Props = $props();
|
||||
|
||||
// *** Import Svelte specific
|
||||
// import { goto } from '$app/navigation';
|
||||
// *** Import Svelte specific
|
||||
// import { goto } from '$app/navigation';
|
||||
|
||||
// *** Import other supporting libraries
|
||||
// import { liveQuery } from "dexie";
|
||||
// *** Import other supporting libraries
|
||||
// import { liveQuery } from "dexie";
|
||||
|
||||
// *** 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 Element_data_store from '$lib/element_data_store.svelte';
|
||||
// *** 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 Element_data_store from '$lib/element_data_store.svelte';
|
||||
|
||||
import {
|
||||
ae_snip,
|
||||
ae_loc,
|
||||
ae_sess,
|
||||
ae_api,
|
||||
ae_trig,
|
||||
slct,
|
||||
slct_trigger
|
||||
} from '$lib/stores/ae_stores';
|
||||
// import { db_events } from "$lib/ae_events/db_events";
|
||||
import {
|
||||
events_loc,
|
||||
events_sess,
|
||||
events_slct,
|
||||
events_trigger
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events/ae_events_functions';
|
||||
import {
|
||||
ae_snip,
|
||||
ae_loc,
|
||||
ae_sess,
|
||||
ae_api,
|
||||
ae_trig,
|
||||
slct,
|
||||
slct_trigger
|
||||
} from '$lib/stores/ae_stores';
|
||||
// import { db_events } from "$lib/ae_events/db_events";
|
||||
import {
|
||||
events_loc,
|
||||
events_sess,
|
||||
events_slct,
|
||||
events_trigger
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events/ae_events_functions';
|
||||
|
||||
import Event_launcher_file_cont from './launcher_file_cont.svelte';
|
||||
import Menu_location_list_menu from './menu_location_list.svelte';
|
||||
import Menu_session_list_menu from './menu_session_list.svelte';
|
||||
import Menu_launcher_controls from './menu_launcher_controls.svelte';
|
||||
import Event_launcher_file_cont from './launcher_file_cont.svelte';
|
||||
import Menu_location_list_menu from './menu_location_list.svelte';
|
||||
import Menu_session_list_menu from './menu_session_list.svelte';
|
||||
import Menu_launcher_controls from './menu_launcher_controls.svelte';
|
||||
|
||||
// *** Functions and Logic
|
||||
// *** Functions and Logic
|
||||
|
||||
$events_trigger = null;
|
||||
$events_trigger = null;
|
||||
|
||||
let qry__enabled = 'enabled';
|
||||
let qry__hidden = 'not_hidden';
|
||||
if ($ae_loc.administrator_access) {
|
||||
qry__enabled = 'all';
|
||||
qry__hidden = 'all';
|
||||
} else if ($ae_loc.trusted_access) {
|
||||
qry__enabled = 'enabled';
|
||||
qry__hidden = 'all';
|
||||
} else {
|
||||
qry__enabled = 'enabled';
|
||||
qry__hidden = 'not_hidden';
|
||||
}
|
||||
let qry__enabled = 'enabled';
|
||||
let qry__hidden = 'not_hidden';
|
||||
if ($ae_loc.administrator_access) {
|
||||
qry__enabled = 'all';
|
||||
qry__hidden = 'all';
|
||||
} else if ($ae_loc.trusted_access) {
|
||||
qry__enabled = 'enabled';
|
||||
qry__hidden = 'all';
|
||||
} else {
|
||||
qry__enabled = 'enabled';
|
||||
qry__hidden = 'not_hidden';
|
||||
}
|
||||
|
||||
let ae_promises: key_val = $state({
|
||||
get_li__event_file: null
|
||||
});
|
||||
let ae_promises: key_val = $state({
|
||||
get_li__event_file: null
|
||||
});
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="
|
||||
event_launcher_menu
|
||||
shrink h-full w-full max-w-full
|
||||
flex flex-col flex-wrap gap-1 items-center justify-start
|
||||
flex h-full w-full max-w-full
|
||||
shrink flex-col flex-wrap items-center justify-start gap-1
|
||||
|
||||
"
|
||||
>
|
||||
">
|
||||
<!-- overflow-x-clip -->
|
||||
|
||||
{#if $lq__event_event_file_obj_li}
|
||||
<div class="w-full flex flex-col gap-0.5 overflow-y-auto">
|
||||
<div class="flex w-full flex-col gap-0.5 overflow-y-auto">
|
||||
<!-- <div class="text-xs text-neutral-800/80">
|
||||
<strong>
|
||||
Event Files:
|
||||
@@ -191,8 +190,7 @@
|
||||
}
|
||||
bind:modal__event_file_obj={
|
||||
$events_sess.launcher.modal__event_file_obj
|
||||
}
|
||||
/>
|
||||
} />
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -201,12 +199,11 @@
|
||||
<Menu_location_list_menu
|
||||
{lq__event_location_obj_li}
|
||||
slct_event_location_id={$events_slct.event_location_id}
|
||||
bind:loading__session_li_status
|
||||
/>
|
||||
bind:loading__session_li_status />
|
||||
{/if}
|
||||
|
||||
{#if $lq__location_event_file_obj_li}
|
||||
<div class="w-full flex flex-col gap-0.5">
|
||||
<div class="flex w-full flex-col gap-0.5">
|
||||
{#each $lq__location_event_file_obj_li as event_file_obj, index (event_file_obj.event_file_id)}
|
||||
<Event_launcher_file_cont
|
||||
event_file_id={event_file_obj.event_file_id}
|
||||
@@ -235,8 +232,7 @@
|
||||
}
|
||||
bind:modal__event_file_obj={
|
||||
$events_sess.launcher.modal__event_file_obj
|
||||
}
|
||||
/>
|
||||
} />
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -246,8 +242,7 @@
|
||||
bind:slct__event_session_id
|
||||
bind:loading__session_id_status
|
||||
{lq__event_session_obj_li}
|
||||
bind:trigger_reload__event_session_obj_id
|
||||
/>
|
||||
bind:trigger_reload__event_session_obj_id />
|
||||
{/if}
|
||||
|
||||
<Menu_launcher_controls />
|
||||
|
||||
Reference in New Issue
Block a user