fix(core): resolve 68 compiler errors and stabilize Svelte 5 reactivity
- Fixed 'Captured initial value' warnings in 65+ components by implementing proper sync effects with 'untrack' and derived states. - Hardened Event Settings JSON editors using a temporary string-buffer pattern to safely decouple object-based data from CodeMirror's string requirements. - Resolved strict TypeScript mismatches across core routes (Accounts, Sites, etc.) and improved property indexing safety in views. - Patched Flowbite-Svelte Drawer transitions for Svelte 5 compatibility using prop spreading. - Added comprehensive safety comments to high-risk reactivity blocks. - Synchronized 'ae_types.ts' with V3 backend models.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { Save, Trash2, ArrowLeft, Building, Settings, Activity, Info } from 'lucide-svelte';
|
||||
|
||||
let account_id = $page.params.account_id;
|
||||
let account_id = $derived($page.params.account_id ?? '');
|
||||
let account: any = $state(null);
|
||||
let loading = $state(true);
|
||||
let saving = $state(false);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import { Save, Trash2, ArrowLeft, MapPin, Edit, Eye, Globe, Building2, MapPinned, Info, ShieldCheck, Activity, Clock, User } from 'lucide-svelte';
|
||||
import Address_form from '../ae_comp__address_form.svelte';
|
||||
|
||||
let address_id = $page.params.address_id;
|
||||
let address_id = $derived($page.params.address_id ?? '');
|
||||
let address: any = $state(null);
|
||||
let loading = $state(true);
|
||||
let is_editing = $state(false);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import { Save, Trash2, ArrowLeft, UserRound, Edit, Eye, Mail, Phone, Globe, Linkedin, Info, ShieldCheck, Activity, Link2, Contact } from 'lucide-svelte';
|
||||
import Contact_form from '../ae_comp__contact_form.svelte';
|
||||
|
||||
let contact_id = $page.params.contact_id;
|
||||
let contact_id = $derived($page.params.contact_id ?? '');
|
||||
let contact: any = $state(null);
|
||||
let loading = $state(true);
|
||||
let is_editing = $state(false);
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
interface Props {
|
||||
person_id: string;
|
||||
display_mode?: string; // 'default', 'compact', 'minimal', 'launcher'
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
let { person_id, display_mode = 'default' }: Props = $props();
|
||||
let { person_id, display_mode = 'default', log_lvl = 0 }: Props = $props();
|
||||
|
||||
console.log(`ae_core person_view.svelte`);
|
||||
|
||||
@@ -36,7 +37,12 @@
|
||||
|
||||
let ae_triggers: key_val = $state({});
|
||||
|
||||
console.log(`person_id:`, person_id);
|
||||
$effect(() => {
|
||||
if (log_lvl) {
|
||||
console.log(`person_id:`, person_id);
|
||||
}
|
||||
});
|
||||
|
||||
let lq__person_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
let results = await db_core.person.get(person_id);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { Save, Trash2, ArrowLeft, Globe, Plus, ExternalLink, Key, Settings, Activity, Info, Database } from 'lucide-svelte';
|
||||
import AE_Comp_Site_Config_Editor from '$lib/ae_core/ae_comp__site_config_editor.svelte';
|
||||
|
||||
let site_id = $page.params.site_id;
|
||||
let site_id = $derived($page.params.site_id ?? '');
|
||||
let site: any = $state(null);
|
||||
let domain_li: any[] = $state([]);
|
||||
let loading = $state(true);
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
let user = $state(data.user);
|
||||
let saving = $state(false);
|
||||
|
||||
$effect(() => {
|
||||
user = data.user;
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
if (!$ae_loc.manager_access) {
|
||||
goto('/core');
|
||||
|
||||
Reference in New Issue
Block a user