|
|
|
|
@ -9,7 +9,11 @@
@@ -9,7 +9,11 @@
|
|
|
|
|
import { onMount } from "svelte"; |
|
|
|
|
import { getMatchingTags } from "$lib/utils/nostrUtils"; |
|
|
|
|
import { getEventKindName } from "$lib/utils/eventColors"; |
|
|
|
|
import { getDisplayNameSync, replacePubkeysWithDisplayNames } from "$lib/utils/profileCache"; |
|
|
|
|
import { |
|
|
|
|
getDisplayNameSync, |
|
|
|
|
replacePubkeysWithDisplayNames, |
|
|
|
|
} from "$lib/utils/profileCache"; |
|
|
|
|
import {indexKind, zettelKinds } from "$lib/consts"; |
|
|
|
|
|
|
|
|
|
// Component props |
|
|
|
|
let { |
|
|
|
|
@ -37,7 +41,7 @@
@@ -37,7 +41,7 @@
|
|
|
|
|
const MAX_CONTENT_LENGTH = 200; |
|
|
|
|
|
|
|
|
|
// Publication event kinds (text/article based) |
|
|
|
|
const PUBLICATION_KINDS = [30040, 30041, 30818, 30023]; // Added 30023 (long-form content) |
|
|
|
|
const PUBLICATION_KINDS = [wikiKind, indexKind, ...zettelKinds]; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Gets the author name from the event tags |
|
|
|
|
@ -238,7 +242,9 @@
@@ -238,7 +242,9 @@
|
|
|
|
|
{#if node.event?.content} |
|
|
|
|
<div class="tooltip-content-preview"> |
|
|
|
|
<span class="font-semibold">Content:</span> |
|
|
|
|
<pre class="whitespace-pre-wrap">{truncateContent(node.event.content)}</pre> |
|
|
|
|
<pre class="whitespace-pre-wrap">{truncateContent( |
|
|
|
|
node.event.content, |
|
|
|
|
)}</pre> |
|
|
|
|
</div> |
|
|
|
|
{/if} |
|
|
|
|
|
|
|
|
|
@ -248,7 +254,11 @@
@@ -248,7 +254,11 @@
|
|
|
|
|
Tags: {node.event.tags.length} |
|
|
|
|
{#if node.event.tags.length <= 3} |
|
|
|
|
{#each node.event.tags as tag} |
|
|
|
|
<span class="text-xs">· {tag[0]}{tag[1] ? `: ${tag[0] === 'p' ? getDisplayNameSync(tag[1]) : tag[1].substring(0, 20)}${tag[1].length > 20 && tag[0] !== 'p' ? '...' : ''}` : ''}</span> |
|
|
|
|
<span class="text-xs" |
|
|
|
|
>· {tag[0]}{tag[1] |
|
|
|
|
? `: ${tag[0] === "p" ? getDisplayNameSync(tag[1]) : tag[1].substring(0, 20)}${tag[1].length > 20 && tag[0] !== "p" ? "..." : ""}` |
|
|
|
|
: ""}</span |
|
|
|
|
> |
|
|
|
|
{/each} |
|
|
|
|
{/if} |
|
|
|
|
</div> |
|
|
|
|
|