Moving more pages to Runes mode.

This commit is contained in:
Scott Idem
2024-12-03 16:22:21 -05:00
parent 747e9fdb26
commit 1bdd2aec65
2 changed files with 35 additions and 31 deletions

View File

@@ -1,12 +1,13 @@
<script lang="ts">
/** @type {import('./$types').LayoutData} */
export let data: any;
let log_lvl: number = 0;
// console.log(`ae_ Svelte root +layout data:`, data);
// *** Import Svelte specific
import { onMount } from 'svelte';
import '../app.postcss';
// *** Import other supporting libraries
import { AppShell, AppBar, initializeStores } from '@skeletonlabs/skeleton';
// Initialize the stores for Drawer, Modal, and Toast so they work throughout the app.
initializeStores();
@@ -26,7 +27,6 @@ const modalRegistry: Record<string, ModalComponent> = {
// ...
};
// Highlight JS
import hljs from 'highlight.js/lib/core';
import 'highlight.js/styles/github-dark.css';
@@ -52,17 +52,20 @@ import { computePosition, autoUpdate, flip, shift, offset, arrow } from '@floati
import { storePopup } from '@skeletonlabs/skeleton';
storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow });
// *** Import Aether specific variables and functions
import Analytics from '$lib/analytics.svelte'
// import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
import { events_loc, events_slct } from '$lib/ae_events_stores';
import type { key_val } from '$lib/ae_stores';
// import type { key_val } from '$lib/ae_stores';
import Element_access_type from '$lib/element_access_type.svelte';
import Element_app_cfg from '$lib/element_app_cfg.svelte';
import Element_data_store from '$lib/element_data_store_v2.svelte';
export let data: any;
// let account_id = localStorage.getItem('ae_account_id');
// console.log(`account_id = `, account_id);

View File

@@ -1,21 +1,29 @@
<script lang="ts">
/** @type {import('./$types').LayoutData} */
export let data: any;
let log_lvl: number = 0;
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
// *** Import Svelte specific
// import { goto } from '$app/navigation';
// import type { Writable } from 'svelte/store';
// import { localStorageStore } from '@skeletonlabs/skeleton';
import type { key_val } from '$lib/ae_stores';
// *** Import Aether specific variables and functions
// import type { key_val } from '$lib/ae_stores';
// import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct } from '$lib/ae_stores';
import { events_loc, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
import { events_func } from '$lib/ae_events_functions';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
interface Props {
data: any;
children?: import('svelte').Snippet;
}
let { data, children }: Props = $props();
$events_loc.qry__enabled = 'enabled';
$events_loc.qry__hidden = 'not_hidden';
$events_loc.qry__limit = 15;
@@ -23,23 +31,19 @@ $events_loc.qry__offset = 0;
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
$slct.account_id = data.account_id;
console.log(`$slct.account_id = `, $slct.account_id);
if (log_lvl) {
console.log(`$slct.account_id = `, $slct.account_id);
}
let ae_acct = data[$slct.account_id];
// console.log(`ae_acct = `, ae_acct);
if (log_lvl) {
console.log(`ae_acct = `, ae_acct);
}
$events_slct.event_id = ae_acct.slct.event_id;
$events_slct.event_obj = ae_acct.slct.event_obj;
$events_slct.event_obj_li = ae_acct.slct.event_obj_li;
let ae_promises: key_val = {};
onMount(() => {
console.log('Core - Root: +layout.svelte');
console.log($events_slct.event_obj_li);
});
// let ae_promises: key_val = {};
// Updated 2024-06-25
// $: if ($events_trigger == 'load__event_session_obj_id' && $events_trig_kv['event_session_id']) {
@@ -64,11 +68,11 @@ onMount(() => {
<svelte:head>
<title>Core - {$events_loc.title ?? 'Æ loading...'}</title>
<title>Core - {$ae_loc.title ?? 'Æ loading...'}</title>
</svelte:head>
{#if $ae_loc.manager_access && 1==3}
{#if $ae_loc?.manager_access === 'test-new-submenu'}
<section
class="submenu flex flex-row justify-center"
class:hidden={$ae_loc.iframe}
@@ -79,23 +83,20 @@ onMount(() => {
<!-- <a href="/settings/{item.slug}">{item.title}</a> -->
<!-- class:hidden={!$ae_loc.trusted_access && item.access} -->
{#if item.disable}
<button
<!-- <button
title={item.title}
class="hover:variant-ghost-secondary"
class:hidden={(!$ae_loc.trusted_access && item.access === 'trusted') || (!$ae_loc.administrator_access && item.access === 'administrator' || item.hide)}
disabled={item.disable}
on:click={() => {
// window.location(item.href);
// href={item.href}
// invalidateAll
goto(item.href, { });
// goto(item.href, { });
}}
>
{item.name}
</button>
</button> -->
{:else}
<a
<!-- <a
href={item.href}
title={item.title}
class="hover:variant-ghost-secondary"
@@ -103,7 +104,7 @@ onMount(() => {
class:disabled={item.disable}
>
{item.name}
</a>
</a> -->
{/if}
{/each}
</span>
@@ -113,5 +114,5 @@ onMount(() => {
<!-- <div class="container m-auto"> -->
<slot></slot>
{@render children?.()}
<!-- </div> -->