Saving my work beforeI rename the notes module to journals module. Finally.

This commit is contained in:
Scott Idem
2025-03-15 23:21:06 -04:00
parent 183d431e1d
commit d8020b3d77
13 changed files with 471 additions and 230 deletions

View File

@@ -1,9 +1,18 @@
<script lang="ts">
/** @type {import('./$types').LayoutData} */
export let data: any;
import { run } from 'svelte/legacy';
import { browser } from '$app/environment';
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
interface Props {
/** @type {import('./$types').LayoutData} */
data: any;
children?: import('svelte').Snippet;
}
let { data, children }: Props = $props();
let log_lvl: number = 0;
@@ -106,39 +115,41 @@ if (browser && iframe == 'true') {
$: if ($ae_loc.iframe && $ae_loc.iframe_height && $ae_loc.iframe_height_modal_body) {
if (log_lvl > 1) {
console.log('Getting new dimensions for iframe with modal:', $ae_loc.iframe_height, $ae_loc.iframe_height_modal_body);
}
let iframe_height = 0;
if ($ae_loc.iframe_height > $ae_loc.iframe_height_modal_body) {
iframe_height = $ae_loc.iframe_height;
} else {
iframe_height = $ae_loc.iframe_height_modal_body;
// console.log($ae_loc.modal_dimensions);
if ($ae_loc.modal_dimensions && $ae_loc.modal_dimensions.header_height) {
iframe_height = iframe_height + $ae_loc.modal_dimensions.header_height;
run(() => {
if ($ae_loc.iframe && $ae_loc.iframe_height && $ae_loc.iframe_height_modal_body) {
if (log_lvl > 1) {
console.log('Getting new dimensions for iframe with modal:', $ae_loc.iframe_height, $ae_loc.iframe_height_modal_body);
}
if ($ae_loc.modal_dimensions && $ae_loc.modal_dimensions.footer_height) {
iframe_height = iframe_height + $ae_loc.modal_dimensions.footer_height;
}
// iframe_height = iframe_height + 50; // Just in case
}
if (log_lvl > 1) {
console.log(`Suggested new iframe_height with modal: ${iframe_height}`);
let iframe_height = 0;
if ($ae_loc.iframe_height > $ae_loc.iframe_height_modal_body) {
iframe_height = $ae_loc.iframe_height;
} else {
iframe_height = $ae_loc.iframe_height_modal_body;
// console.log($ae_loc.modal_dimensions);
if ($ae_loc.modal_dimensions && $ae_loc.modal_dimensions.header_height) {
iframe_height = iframe_height + $ae_loc.modal_dimensions.header_height;
}
if ($ae_loc.modal_dimensions && $ae_loc.modal_dimensions.footer_height) {
iframe_height = iframe_height + $ae_loc.modal_dimensions.footer_height;
}
// iframe_height = iframe_height + 50; // Just in case
}
if (log_lvl > 1) {
console.log(`Suggested new iframe_height with modal: ${iframe_height}`);
}
window.parent.postMessage({'iframe_height': iframe_height}, "*"); // This should be in pixels
} else if ($ae_loc.iframe && $ae_loc.iframe_height) {
if (log_lvl > 1) {
console.log('Suggested new iframe_height:', $ae_loc.iframe_height);
}
window.parent.postMessage({'iframe_height': $ae_loc.iframe_height}, "*"); // This should be in pixels
}
window.parent.postMessage({'iframe_height': iframe_height}, "*"); // This should be in pixels
} else if ($ae_loc.iframe && $ae_loc.iframe_height) {
if (log_lvl > 1) {
console.log('Suggested new iframe_height:', $ae_loc.iframe_height);
}
window.parent.postMessage({'iframe_height': $ae_loc.iframe_height}, "*"); // This should be in pixels
}
});
</script>
@@ -158,7 +169,7 @@ $: if ($ae_loc.iframe && $ae_loc.iframe_height && $ae_loc.iframe_height_modal_bo
<div
bind:clientHeight={$ae_loc.iframe_height}
>
<slot />
{@render children?.()}
</div>
{#if $idaa_loc.novi_uuid}
<span class="text-sm text-gray-500">

View File

@@ -0,0 +1,119 @@
<script lang="ts">
/** @type {import('./$types').LayoutData} */
// Imports
// *** Import Svelte specific
import { browser } from '$app/environment';
// *** Import other supporting libraries
import { AppShell, AppBar, initializeStores } from '@skeletonlabs/skeleton';
import { Modal } from '@skeletonlabs/skeleton';
import type {
ModalComponent
} from '@skeletonlabs/skeleton';
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
import Element_data_store from '$lib/element_data_store_v2.svelte';
const modalRegistry: Record<string, ModalComponent> = {
// Set a unique modal ID, then pass the component reference
// modalComponentEditSponsorshipObj: { ref: ModalComponentEditSponsorshipObj },
// modalComponentTwo: { ref: ModalComponentTwo },
// ...
};
let { data, children }: Props = $props();
</script>
<svelte:head>
<title>IDAA - {$idaa_loc.title ?? 'Æ loading...'}</title>
</svelte:head>
<Modal components={modalRegistry}
regionBackdrop=''
regionBody=''
regionHeader='modal-header card-header text-2xl font-bold'
regionFooter='modal-footer flex justify-between space-x-2'
/>
<!-- App Shell -->
<AppShell
regionPage={($ae_loc.iframe ? 'iframe' : '')}
slotHeader={($ae_loc.iframe ? 'iframe' : '')}
slotFooter={($ae_loc.iframe ? 'iframe' : '')}
>
{#snippet header()}
<!-- App Bar -->
<AppBar
gridColumns="grid-cols-3"
slotDefault="place-self-center"
slotTrail="place-content-end"
padding="px-4"
>
{#snippet lead()}
<Element_data_store
ds_code="hub__page__appshell_header_lead"
ds_type="html"
/>
{/snippet}
<!-- OSIT's Aether App -->
<!-- {@html (browser ? JSON.parse(localStorage.getItem('ae_ds__hub__site__appshell_header')).html : '-- not found --')} -->
<!-- {@html $ae_sess.site_appshell_header} -->
<Element_data_store
ds_code="hub__site__appshell_header"
ds_type="html"
/>
{#snippet trail()}
<Element_data_store
ds_code="hub__page__appshell_header_trail"
ds_type="html"
/>
{/snippet}
</AppBar>
{/snippet}
<!-- !($ae_loc.site_access_key && $ae_loc.site_domain_access_key)
|| ($ae_loc.site_access_key == access_key || $ae_loc.site_domain_access_key == access_key)} -->
<!-- {$ae_loc?.site_access_key ?? '-- site access key not set --'} -->
<!-- {$ae_loc?.site_domain_access_key ?? '-- site domain access key not set --'} -->
<!-- {access_key ?? '-- param key not set --'} -->
<!-- Page Route Content -->
{@render children?.()}
{#snippet footer()}
<div
class="flex text-sm sm:text-sm md:text-md lg:text-md xl:text-md 2xl:text-lg text-slate-400 hover:text-slate-800 transition px-1"
class:ae_debug={$ae_loc.debug}
>
<Element_data_store
ds_code="hub__site__appshell_footer"
ds_type="html"
class_li="grow flex flex-row justify-between"
/>
</div>
{/snippet}
</AppShell>

View File

@@ -1,6 +0,0 @@
<script lang="ts">
/** @type {import('./$types').LayoutData} */
</script>
<slot />