Initial commit

This commit is contained in:
hiperman
2025-12-04 00:33:37 -05:00
commit 7ca0a21283
798 changed files with 190424 additions and 0 deletions
@@ -0,0 +1,37 @@
<script lang="ts">
import BookDelete from '$lib/components/forms/book-delete.svelte';
import { BookEdit } from '$lib/components/forms/edit-book';
import { getBookOperationsState, setBookOperationsState } from '$lib/state/bookOperations.svelte';
import { getLibraryState } from '$lib/state/library.svelte';
import { setBookSelectionState } from '$lib/state/bookSelection.svelte';
import type { Snippet } from 'svelte';
let { children }: { children: Snippet } = $props();
const libraryState = getLibraryState();
const bookOps = getBookOperationsState();
const bookSelection = setBookSelectionState();
// Deselect all when active library changes
$effect(() => {
libraryState.activeLibrary; // Track this
bookSelection.deselectAll();
});
// Exit selection mode the ESC key
function handleKeyDown(event: KeyboardEvent) {
if (event.key === 'Escape' && bookSelection.selectionModeActive) bookSelection.deselectAll();
}
</script>
<svelte:window onkeydown={handleKeyDown} />
{@render children?.()}
<BookDelete
bind:open={bookOps.deleteDialogOpen}
deleteFn={bookOps.deleteFn}
title={bookOps.deleteDialogTitle}
/>
<BookEdit book={bookOps.bookToEdit} bind:open={bookOps.editDialogOpen} />