From 9ea6e8b3e848986d494b045e49e13855da3a75fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Sun, 7 Sep 2025 18:39:22 +0200 Subject: [PATCH] Publications, part 2 --- .../publications/Publication.svelte | 280 +++++++++--------- src/lib/stores.ts | 2 +- .../[type]/[identifier]/+page.svelte | 2 - 3 files changed, 136 insertions(+), 148 deletions(-) diff --git a/src/lib/components/publications/Publication.svelte b/src/lib/components/publications/Publication.svelte index b7722a0..2046b34 100644 --- a/src/lib/components/publications/Publication.svelte +++ b/src/lib/components/publications/Publication.svelte @@ -251,17 +251,19 @@ // #endregion - -{#if publicationType !== "blog" && !isLeaf} + +
+ + {#if publicationType !== "blog" && !isLeaf} - publicationTree.setBookmark(address)} + onSectionFocused={(address: string) => publicationTree.setBookmark(address)} onLoadMore={() => { if (!isLoading && !isDone && publicationTree) { loadMore(4); @@ -283,145 +284,134 @@ }} /> -{/if} - - -{#if $publicationColumnVisibility.main} -
-
-
-
- - {#each leaves as leaf, i} - {#if leaf == null} - - - Error loading content. One or more events could not be loaded. - - {:else} - {@const address = leaf.tagAddress()} - onPublicationSectionMounted(el, address)} - /> - {/if} - {/each} -
- {#if isLoading} - - {:else if !isDone} - - {:else} -

- You've reached the end of the publication. -

- {/if} -
-
-{/if} - - -{#if $publicationColumnVisibility.blog} -
-
-
-
- - {#each leaves as leaf, i} - {#if leaf} - - {/if} - {/each} -
-{/if} - -{#if isInnerActive()} - {#key currentBlog} -
- {#each leaves as leaf, i} - {#if leaf && leaf.tagAddress() === currentBlog} -
-
-
- - setLastElementRef(el, i)} - /> - - - - - {/if} - {/each} -
- {/key} -{/if} - -{#if $publicationColumnVisibility.discussion} - - - -
- Discussion - + {/if} + +
+ + {#if $publicationColumnVisibility.main} + +
+
+
+
+ + {#each leaves as leaf, i} + {#if leaf == null} + + + Error loading content. One or more events could not be loaded. + + {:else} + {@const address = leaf.tagAddress()} + onPublicationSectionMounted(el, address)} + /> + {/if} + {/each} +
+ {#if isLoading} + + {:else if !isDone} + + {:else} +

+ You've reached the end of the publication. +

+ {/if} +
+
+ {/if} + + + {#if $publicationColumnVisibility.blog} + +
+
+
-
- - {#if showBlogHeader() && currentBlog && currentBlogEvent} + + {#each leaves as leaf, i} + {#if leaf} {/if} -
- -
- Unknown - 1.1.1970 -
-
- This is a very intelligent comment placeholder that applies to - all the content equally well. -
-
-
+ {/each} +
+ {/if} + + {#if isInnerActive()} + {#key currentBlog} + +
+
- - - -{/if} + {/key} + {/if} +
+ + {#if $publicationColumnVisibility.discussion} + + + + +
+ Discussion + +
+
+ + {#if showBlogHeader() && currentBlog && currentBlogEvent} + + {/if} +
+ +
+ Unknown + 1.1.1970 +
+
+ This is a very intelligent comment placeholder that applies to + all the content equally well. +
+
+
+
+
+
+
+ {/if} + +
diff --git a/src/lib/stores.ts b/src/lib/stores.ts index 3cefe7c..2b6bd13 100644 --- a/src/lib/stores.ts +++ b/src/lib/stores.ts @@ -21,7 +21,7 @@ const defaultVisibility: PublicationLayoutVisibility = { blog: true, main: true, inner: false, - discussion: false, + discussion: true, editing: false, }; diff --git a/src/routes/publication/[type]/[identifier]/+page.svelte b/src/routes/publication/[type]/[identifier]/+page.svelte index 5445364..e7bedd9 100644 --- a/src/routes/publication/[type]/[identifier]/+page.svelte +++ b/src/routes/publication/[type]/[identifier]/+page.svelte @@ -186,7 +186,6 @@ indexEvent={indexEvent} /> -
-
{:else if loading}