Last round of prettier: npx prettier --write src/

This commit is contained in:
Scott Idem
2026-03-24 13:27:40 -04:00
parent 23d25bf65a
commit a8f3c29b9f
146 changed files with 13201 additions and 9277 deletions

View File

@@ -1,80 +1,87 @@
<script lang="ts">
interface Props {
log_lvl?: number;
additional_kv?: key_val;
e_success?: boolean;
e_class?: string;
e_title?: string;
e_text?: string;
e_class_h1?: string;
e_class_h2?: string;
e_class_form_hidden?: string;
e_class_form_showing?: string;
btn_text?: string;
btn_title?: string;
btn_class?: string;
show_btn_class?: string;
hide_icon?: boolean;
}
interface Props {
log_lvl?: number;
additional_kv?: key_val;
e_success?: boolean;
e_class?: string;
e_title?: string;
e_text?: string;
e_class_h1?: string;
e_class_h2?: string;
e_class_form_hidden?: string;
e_class_form_showing?: string;
btn_text?: string;
btn_title?: string;
btn_class?: string;
show_btn_class?: string;
hide_icon?: boolean;
}
let {
log_lvl = $bindable(0),
additional_kv = $bindable({}),
e_success = $bindable(false),
e_class = '',
// e_title = 'Technical Help',
// e_text = 'Request technical help for this application.',
e_class_h1 = $bindable(''),
e_class_h2 = $bindable(''),
e_class_form_hidden = $bindable(''),
e_class_form_showing = $bindable(''),
btn_text = 'Technical Help',
btn_title = 'Technical support help',
btn_class = '',
show_btn_class = '',
hide_icon = false
}: Props = $props();
let {
log_lvl = $bindable(0),
additional_kv = $bindable({}),
e_success = $bindable(false),
e_class = '',
// e_title = 'Technical Help',
// e_text = 'Request technical help for this application.',
e_class_h1 = $bindable(''),
e_class_h2 = $bindable(''),
e_class_form_hidden = $bindable(''),
e_class_form_showing = $bindable(''),
btn_text = 'Technical Help',
btn_title = 'Technical support help',
btn_class = '',
show_btn_class = '',
hide_icon = false
}: Props = $props();
// *** Import Svelte specific
import { goto } from '$app/navigation';
// *** Import Svelte specific
import { goto } from '$app/navigation';
// *** Import other supporting libraries
import { BadgeQuestionMark, ChevronDown, ChevronRight, LifeBuoy, RefreshCw, SquareX } from '@lucide/svelte';
// *** Import Aether specific variables and functions
import {
ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
slct,
slct_trigger,
type key_val
} from '$lib/stores/ae_stores';
import { api } from '$lib/api/api';
// *** Import other supporting libraries
import {
BadgeQuestionMark,
ChevronDown,
ChevronRight,
LifeBuoy,
RefreshCw,
SquareX
} from '@lucide/svelte';
// *** Import Aether specific variables and functions
import {
ae_snip,
ae_loc,
ae_sess,
ae_api,
ae_trig,
slct,
slct_trigger,
type key_val
} from '$lib/stores/ae_stores';
import { api } from '$lib/api/api';
if (log_lvl) {
console.log(`Help - technical support component loaded`);
}
let help_tech_text: string = $state('');
let hide_additional_info: boolean = $state(true);
function prevent_default<T extends Event>(fn: (event: T) => void) {
return function (event: T) {
event.preventDefault();
fn(event);
};
}
function send_help_tech_email() {
if (log_lvl) {
console.log(`Help - technical support component loaded`);
console.log(`*** send_help_tech_email() ***`);
}
let help_tech_text: string = $state('');
let hide_additional_info: boolean = $state(true);
let subject = `Technical Notification - ${$ae_loc.name}`;
function prevent_default<T extends Event>(fn: (event: T) => void) {
return function (event: T) {
event.preventDefault();
fn(event);
};
}
function send_help_tech_email() {
if (log_lvl) {
console.log(`*** send_help_tech_email() ***`);
}
let subject = `Technical Notification - ${$ae_loc.name}`;
let body_html = `
let body_html = `
<div>
Technical Notification,\n\n
<ul>
@@ -102,25 +109,24 @@
</div>
`;
api.send_email({
api_cfg: $ae_api,
from_email:
$ae_loc.site_cfg_json?.noreply_email ??
'noreply+tech@oneskyit.com',
from_name: $ae_loc.site_cfg_json?.noreply_name ?? 'IT NoReply',
// to_email: $ae_loc.site_cfg_json?.admin_email ?? 'admin+tech@oneskyit.com', // 'scott+idaabb@oneskyit.com',
to_email: 'it+tech@oneskyit.com',
// to_email: $idaa_slct.post_obj.email,
// to_email: 'scott+idaabb@oneskyit.com',
// to_name: $ae_loc.site_cfg_json?.admin_name ?? 'IT Tech',
to_name: 'IT Tech',
// to_name: $idaa_slct.post_obj.full_name ?? 'IDAA BB Poster',
subject: subject,
body_html: body_html
});
api.send_email({
api_cfg: $ae_api,
from_email:
$ae_loc.site_cfg_json?.noreply_email ?? 'noreply+tech@oneskyit.com',
from_name: $ae_loc.site_cfg_json?.noreply_name ?? 'IT NoReply',
// to_email: $ae_loc.site_cfg_json?.admin_email ?? 'admin+tech@oneskyit.com', // 'scott+idaabb@oneskyit.com',
to_email: 'it+tech@oneskyit.com',
// to_email: $idaa_slct.post_obj.email,
// to_email: 'scott+idaabb@oneskyit.com',
// to_name: $ae_loc.site_cfg_json?.admin_name ?? 'IT Tech',
to_name: 'IT Tech',
// to_name: $idaa_slct.post_obj.full_name ?? 'IDAA BB Poster',
subject: subject,
body_html: body_html
});
help_tech_text = ''; // Clear the text area after sending
}
help_tech_text = ''; // Clear the text area after sending
}
</script>
<!-- class:bg-radial-[at_55%_50%]={$ae_sess.show_help_tech}
@@ -131,8 +137,8 @@ class:to-90%={$ae_sess.show_help_tech} -->
class="
flex flex-row
items-center justify-center
rounded-lg shadow-2xl
border border-transparent
rounded-lg border
border-transparent shadow-2xl
transition-all
{e_class}
{!$ae_sess.show_help_tech ? e_class_form_hidden : e_class_form_showing}
@@ -148,48 +154,42 @@ class:to-90%={$ae_sess.show_help_tech} -->
class:hover:shadow-blue-200={$ae_sess.show_help_tech}
class:hover:dark:shadow-blue-800={$ae_sess.show_help_tech}
class:bg-blue-100={$ae_sess.show_help_tech}
class:dark:bg-blue-900={$ae_sess.show_help_tech}
>
class:dark:bg-blue-900={$ae_sess.show_help_tech}>
{#if $ae_sess.show_help_tech}
<div
class="
w-xl
flex flex-col gap-1
items-center justify-center
flex
w-xl flex-col items-center
justify-center gap-1
rounded-xl
border border-gray-500/20 bg-blue-200
p-2
border rounded-xl border-gray-500/20
bg-blue-200
dark:bg-blue-800
transition-all
"
>
dark:bg-blue-800
">
<div
class="
d-flex align-items-center justify-content-between
flex flex-row gap-1 items-center justify-between
w-full
"
>
flex w-full flex-row items-center justify-between
gap-1
">
<h1
class="
h1
text-base font-semibold text-gray-800 dark:text-gray-200
w-fit
w-fit text-base font-semibold text-gray-800
dark:text-gray-200
{e_class_h1}
"
>
">
{#if e_success}
<span
class="text-lg text-green-800 dark:text-green-200 font-semibold"
>
<BadgeQuestionMark class="inline-block mr-2" />
class="text-lg font-semibold text-green-800 dark:text-green-200">
<BadgeQuestionMark class="mr-2 inline-block" />
Help Requested
</span>
{:else}
<span
class="text-lg text-gray-800 dark:text-gray-200 font-semibold"
>
<BadgeQuestionMark class="inline-block mr-2" />
class="text-lg font-semibold text-gray-800 dark:text-gray-200">
<BadgeQuestionMark class="mr-2 inline-block" />
<!-- Request Technical Help -->
Notify Technical Support
</span>
@@ -211,8 +211,7 @@ class:to-90%={$ae_sess.show_help_tech} -->
transition-all
{btn_class}
"
title="Close Help Request Form"
>
title="Close Help Request Form">
<!-- <span class="fas fa-times"></span> -->
<SquareX size="1em" />
<span class="sr-only">Close</span>
@@ -222,9 +221,9 @@ class:to-90%={$ae_sess.show_help_tech} -->
<form
class="
m-1
flex flex-col gap-1
items-center justify-center
w-md max-w-lg
flex w-md max-w-lg
flex-col items-center
justify-center gap-1
"
onsubmit={prevent_default(() => {
// Do stuff...
@@ -234,40 +233,37 @@ class:to-90%={$ae_sess.show_help_tech} -->
$ae_sess.show_help_tech = false;
alert('Notification sent to the IT team.');
})}
>
})}>
<textarea
class="
form-control
w-full max-w-lg h-24 p-2
border border-gray-300 rounded
text-gray-950 dark:text-gray-50
bg-white dark:bg-gray-500
h-24 w-full max-w-lg rounded
border border-gray-300 bg-white
p-2 text-gray-950
dark:bg-gray-500 dark:text-gray-50
hover:dark:bg-gray-50
hover:dark:text-gray-950
"
placeholder="Send with or without a description...."
bind:value={help_tech_text}
></textarea>
bind:value={help_tech_text}></textarea>
<button
type="submit"
class="
btn btn-lg
m-1
preset-tonal-warning
preset-outlined-warning-100-900
hover:preset-filled-warning-200-800
m-1
transition-all
{btn_class}
"
title={btn_title}
>
title={btn_title}>
{#if !hide_icon}
<!-- <BadgeQuestionMark class="inline-block mr-2" /> -->
<LifeBuoy class="inline-block m-1" />
<LifeBuoy class="m-1 inline-block" />
{/if}
{#if !help_tech_text}
@@ -280,9 +276,8 @@ class:to-90%={$ae_sess.show_help_tech} -->
<div
class="
text-sm text-gray-700 dark:text-gray-300 text-center italic
"
>
text-center text-sm text-gray-700 italic dark:text-gray-300
">
This is intended for technical issues only. Please contact your
organization's staff if you have a question about your
membership, recorded content, meetings, or posts.
@@ -290,29 +285,25 @@ class:to-90%={$ae_sess.show_help_tech} -->
<div
class="
border border-gray-300 rounded p-2
w-full
max-w-2xl
overflow-scroll
"
>
w-full max-w-2xl overflow-scroll rounded
border
border-gray-300
p-2
">
<div
class="
d-flex align-items-center justify-content-between
flex flex-row gap-1 items-center justify-between
w-full
"
>
flex w-full flex-row items-center justify-between
gap-1
">
<h2
class="
h2
text-base font-semibold text-gray-800 dark:text-gray-200
{e_class_h2}
"
>
">
<span
class="text-base font-semibold text-gray-800 dark:text-gray-200"
>
class="text-base font-semibold text-gray-800 dark:text-gray-200">
Additional Information Included
</span>
</h2>
@@ -325,8 +316,7 @@ class:to-90%={$ae_sess.show_help_tech} -->
"
onclick={() =>
(hide_additional_info = !hide_additional_info)}
title="Toggle additional information"
>
title="Toggle additional information">
<span>
{#if hide_additional_info}
<!-- <span class="fas fa-caret-right"></span> -->
@@ -341,89 +331,75 @@ class:to-90%={$ae_sess.show_help_tech} -->
</button>
</div>
<ul
class="list-disc list-inside text-sm text-gray-800 dark:text-gray-200"
class:hidden={hide_additional_info}
>
class="list-inside list-disc text-sm text-gray-800 dark:text-gray-200"
class:hidden={hide_additional_info}>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Datetime =</span
>
>Datetime =</span>
{new Date().toISOString()}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>URL =</span
>
>URL =</span>
{window.location.href}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Browser =</span
>
>Browser =</span>
{navigator.userAgent}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Viewport Size =</span
>
>Viewport Size =</span>
{window.innerWidth} x {window.innerHeight}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Screen Resolution =</span
>
>Screen Resolution =</span>
{window.screen.width} x {window.screen.height}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Dark mode =</span
>
>Dark mode =</span>
{window?.matchMedia?.('(prefers-color-scheme:dark)')
?.matches ?? false}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>In iframe =</span
>
>In iframe =</span>
{$ae_loc?.iframe}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Theme Mode =</span
>
>Theme Mode =</span>
{$ae_loc?.theme_mode}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Theme Name =</span
>
>Theme Name =</span>
{$ae_loc?.theme_name}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Account ID =</span
>
>Account ID =</span>
{$slct.account_id}
</li>
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>Access Type =</span
>
>Access Type =</span>
{$ae_loc?.access_type}
</li>
{#if $ae_loc?.person_id}
<li>
<span
class="text-sm text-gray-500 dark:text-gray-400"
>person_id =</span
>
>person_id =</span>
{$ae_loc?.person_id}
</li>
<li>
<span
class="text-sm text-gray-500 dark:text-gray-400"
>full_name =</span
>
>full_name =</span>
{$ae_loc?.full_name}
</li>
{/if}
@@ -431,29 +407,25 @@ class:to-90%={$ae_sess.show_help_tech} -->
<li>
<span
class="text-sm text-gray-500 dark:text-gray-400"
>user_id =</span
>
>user_id =</span>
{$ae_loc?.user_id}
</li>
<li>
<span
class="text-sm text-gray-500 dark:text-gray-400"
>username =</span
>
>username =</span>
{$ae_loc?.username}
</li>
<li>
<span
class="text-sm text-gray-500 dark:text-gray-400"
>email =</span
>
>email =</span>
{$ae_loc?.email}
</li>
{/if}
<li>
<span class="text-sm text-gray-500 dark:text-gray-400"
>API Base URL =</span
>
>API Base URL =</span>
{$ae_api.base_url}
</li>
@@ -461,13 +433,12 @@ class:to-90%={$ae_sess.show_help_tech} -->
<h2 class="text-base font-semibold text-gray-800">
Component Info:
</h2>
<ul class="list-disc list-inside text-gray-800 text-sm">
<ul class="list-inside list-disc text-sm text-gray-800">
{#each Object.entries(additional_kv) as [key, value] (key)}
<li>
<span
class="text-sm text-gray-500 dark:text-gray-400"
>{key} =</span
>
>{key} =</span>
{value ?? '-- not set --'}
</li>
{/each}
@@ -475,8 +446,7 @@ class:to-90%={$ae_sess.show_help_tech} -->
{/if}
</ul>
<div
class="text-sm text-gray-700 dark:text-gray-300 text-center italic"
>
class="text-center text-sm text-gray-700 italic dark:text-gray-300">
This information will be included in the help request to
assist technical support in diagnosing the issue.
</div>
@@ -484,11 +454,10 @@ class:to-90%={$ae_sess.show_help_tech} -->
<div
class="
flex flex-row gap-2 items-center justify-around
w-full
mt-2
"
>
mt-2 flex w-full flex-row items-center
justify-around
gap-2
">
<button
type="button"
onclick={() => {
@@ -562,8 +531,7 @@ class:to-90%={$ae_sess.show_help_tech} -->
transition-all
{btn_class}
"
title="Clear App Data & Settings: Clear IndexedDB and reload. If in edit mode localStorage and sessionStorage will also be cleared."
>
title="Clear App Data & Settings: Clear IndexedDB and reload. If in edit mode localStorage and sessionStorage will also be cleared.">
<!-- <span class="fas fa-eraser mx-1"></span> -->
<!-- <span class="fas fa-sync mx-1"></span> -->
<RefreshCw size="1em" class="inline-block" />
@@ -582,8 +550,7 @@ class:to-90%={$ae_sess.show_help_tech} -->
transition-all
{btn_class}
"
title="Close Help Request Form"
>
title="Close Help Request Form">
<!-- <span class="fas fa-times"></span> -->
<SquareX size="1em" class="inline-block" />
<span class="">Cancel</span>
@@ -603,10 +570,9 @@ class:to-90%={$ae_sess.show_help_tech} -->
{btn_class}
{show_btn_class}
"
title={btn_title}
>
title={btn_title}>
{#if !hide_icon}
<BadgeQuestionMark class="inline-block m-0.5" />
<BadgeQuestionMark class="m-0.5 inline-block" />
{/if}
<span class="hidden">
{btn_text}