diff --git a/src/lib/components/publications/Publication.svelte b/src/lib/components/publications/Publication.svelte index fdfc7b1..82824e4 100644 --- a/src/lib/components/publications/Publication.svelte +++ b/src/lib/components/publications/Publication.svelte @@ -8,7 +8,6 @@ SidebarWrapper, Heading, CloseButton, - uiHelpers, } from "flowbite-svelte"; import { getContext, onDestroy, onMount } from "svelte"; import { @@ -227,9 +226,6 @@ let currentBlogEvent: null | NDKEvent = $state(null); const isLeaf = $derived(indexEvent.kind === 30041); - const tocSidebarUi = uiHelpers(); - const closeTocSidebar = tocSidebarUi.close; - const isTocOpen = $state($publicationColumnVisibility.toc); function isInnerActive() { return currentBlog !== null && $publicationColumnVisibility.inner; @@ -472,7 +468,7 @@
@@ -494,46 +490,7 @@ />
- -
- {#if publicationType !== "blog" && !isLeaf} - {#if $publicationColumnVisibility.toc} - - - - - publicationTree.setBookmark(address)} - onLoadMore={() => { - if (!isLoading && !isDone && publicationTree) { - loadMore(4); - } - }} - /> - - - {/if} - {/if} -
+
{#if $publicationColumnVisibility.main} @@ -799,6 +756,56 @@
+ +{#if publicationType !== "blog" && !isLeaf} + +
{ + if (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ') { + closeToc(); + } + }} + >
+ + +
+
+
+ +
+
+ + publicationTree.setBookmark(address)} + onLoadMore={() => { + if (!isLoading && !isDone && publicationTree) { + loadMore(4); + } + }} + onClose={closeToc} + /> +
+
+
+{/if} + void; onLoadMore?: () => void; + onClose?: () => void; }>(); let entries = $derived.by(() => { @@ -59,6 +60,9 @@ onSectionFocused?.(address); + // Close the drawer after navigation + onClose?.(); + // Check if this is the last entry and trigger loading more events const currentEntries = entries; const lastEntry = currentEntries[currentEntries.length - 1]; @@ -172,10 +176,11 @@ {@const childDepth = depth + 1} expanded, (open) => setEntryExpanded(address, open)} > - + {/if} {/each} diff --git a/src/lib/components/util/ArticleNav.svelte b/src/lib/components/util/ArticleNav.svelte index 3b2f9de..aa56b3f 100644 --- a/src/lib/components/util/ArticleNav.svelte +++ b/src/lib/components/util/ArticleNav.svelte @@ -152,7 +152,7 @@