diff --git a/src/lib/components/EventSearch.svelte b/src/lib/components/EventSearch.svelte index 298ba7d..e4faf0e 100644 --- a/src/lib/components/EventSearch.svelte +++ b/src/lib/components/EventSearch.svelte @@ -1,5 +1,5 @@
-
+
-
+
Events @@ -480,22 +503,37 @@

Search and explore Nostr events across the network. Find events by:

-
    -
  • Event identifiers: nevent, note, naddr, npub, nprofile, pubkey, or event ID
  • +
      +
    • + Event identifiers: nevent, note, naddr, npub, nprofile, + pubkey, or event ID +
    • NIP-05 addresses: username@domain.com
    • -
    • Profile names: Search by display name or username (use "n:" prefix for exact matches)
    • -
    • D-tags: Find events with specific d-tags using "d:tag-name"
    • -
    • T-tags: Find events tagged with specific topics using "t:topic"
    • +
    • + Profile names: Search by display name or username (use + "n:" prefix for exact matches) +
    • +
    • + D-tags: Find events with specific d-tags using "d:tag-name" +
    • +
    • + T-tags: Find events tagged with specific topics using + "t:topic" +

    - The page shows primary search results, second-order references (replies, quotes, mentions), and related tagged events. Click any event to view details, comments, and relay information. + The page shows primary search results, second-order references + (replies, quotes, mentions), and related tagged events. Click any + event to view details, comments, and relay information.

    0}
    -
    +
    {#if searchType === "n"} - Search Results for name: "{searchTerm && searchTerm.length > 50 ? searchTerm.slice(0, 50) + '...' : searchTerm || ''}" ({searchResults.length} profiles) + Search Results for name: "{searchTerm && + searchTerm.length > 50 + ? searchTerm.slice(0, 50) + "..." + : searchTerm || ""}" ({searchResults.length} profiles) {:else if searchType === "t"} - Search Results for t-tag: "{searchTerm && searchTerm.length > 50 ? searchTerm.slice(0, 50) + '...' : searchTerm || ''}" ({searchResults.length} + Search Results for t-tag: "{searchTerm && + searchTerm.length > 50 + ? searchTerm.slice(0, 50) + "..." + : searchTerm || ""}" ({searchResults.length} events) {:else} Search Results for d-tag: "{(() => { - const term = searchTerm || dTagValue?.toLowerCase() || ''; - return term.length > 50 ? term.slice(0, 50) + '...' : term; + const term = + searchTerm || + (searchType === "d" ? searchValue : "") || + ""; + return term.length > 50 ? term.slice(0, 50) + "..." : term; })()}" ({searchResults.length} events) {/if} -
    - {#each searchResults as result, index} - {@const profileData = (result as any).profileData || parseProfileContent(result)} - - {/each} -
    +
    + + {/each} +
{/if} {#if secondOrderResults.length > 0}
-
+
Second-Order Events (References, Replies, Quotes) ({secondOrderResults.length} events) - {#if (searchType === "n" || searchType === "d") && secondOrderResults.length === 100} + {#if (searchType === "n" || searchType === "d") && secondOrderResults.length === 100} +

+ Showing the 100 newest events. More results may be available. +

+ {/if}

- Showing the 100 newest events. More results may be available. + Events that reference, reply to, highlight, or quote the + original events.

- {/if} -

- Events that reference, reply to, highlight, or quote the original - events. -

-
- {#each secondOrderResults as result, index} - {@const profileData = (result as any).profileData || parseProfileContent(result)} -
-
- {getReferenceType( - result, - originalEventIds, - originalAddresses, - )} -
- {#if result.kind === 0 && profileData} -
- {#if profileData.picture} - Profile { - (e.target as HTMLImageElement).style.display = 'none'; - }} - /> - {:else} -
- - {(profileData.display_name || profileData.name || result.pubkey.slice(0, 1)).toUpperCase()} - + {#if getSummary(result)} +
+ {getSummary(result)}
{/if} -
- {#if profileData.display_name || profileData.name} - - {profileData.display_name || profileData.name} - - {/if} - {#if profileData.about} - - {profileData.about} - - {/if} -
-
- {:else} - {#if getSummary(result)} -
- {getSummary(result)} -
- {/if} - {#if getDeferralNaddr(result)} -
- Read - { - e.stopPropagation(); - navigateToPublication( - getDeferralNaddr(result) || "", - ); - }} - onkeydown={(e) => { - if (e.key === "Enter" || e.key === " ") { - e.preventDefault(); + {#if getDeferralNaddr(result)} +
+ Read + { e.stopPropagation(); navigateToPublication( getDeferralNaddr(result) || "", ); - } - }} - tabindex="0" - role="button" + }} + onkeydown={(e) => { + if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + e.stopPropagation(); + navigateToPublication( + getDeferralNaddr(result) || "", + ); + } + }} + tabindex="0" + role="button" + > + {getDeferralNaddr(result)} + +
+ {/if} + {#if isAddressableEvent(result)} +
- {getDeferralNaddr(result)} - -
- {/if} - {#if isAddressableEvent(result)} -
- -
- {/if} - {#if result.content} -
- -
+ +
+ {/if} + {#if result.content} +
+ +
+ {/if} {/if} - {/if} -
- - {/each} -
+
+ + {/each} +
{/if} {#if tTagResults.length > 0}
-
+
Search Results for t-tag: "{searchTerm || - dTagValue?.toLowerCase()}" ({tTagResults.length} events) + (searchType === "t" ? searchValue : "")}" ({tTagResults.length} + events) -

- Events that are tagged with the t-tag. -

-
- {#each tTagResults as result, index} - {@const profileData = (result as any).profileData || parseProfileContent(result)} -
- {#if result.kind === 0 && profileData} -
- {#if profileData.picture} - Profile { - (e.target as HTMLImageElement).style.display = 'none'; - }} - /> - {:else} -
- - {(profileData.display_name || profileData.name || result.pubkey.slice(0, 1)).toUpperCase()} - + {#if getSummary(result)} +
+ {getSummary(result)}
{/if} -
- {#if profileData.display_name || profileData.name} - - {profileData.display_name || profileData.name} - - {/if} - {#if profileData.about} - - {profileData.about} - - {/if} -
-
- {:else} - {#if getSummary(result)} -
- {getSummary(result)} -
- {/if} - {#if getDeferralNaddr(result)} -
- Read - { - e.stopPropagation(); - navigateToPublication( - getDeferralNaddr(result) || "", - ); - }} - onkeydown={(e) => { - if (e.key === "Enter" || e.key === " ") { - e.preventDefault(); + {#if getDeferralNaddr(result)} +
+ Read + { e.stopPropagation(); navigateToPublication( getDeferralNaddr(result) || "", ); - } - }} - tabindex="0" - role="button" + }} + onkeydown={(e) => { + if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + e.stopPropagation(); + navigateToPublication( + getDeferralNaddr(result) || "", + ); + } + }} + tabindex="0" + role="button" + > + {getDeferralNaddr(result)} + +
+ {/if} + {#if isAddressableEvent(result)} +
- {getDeferralNaddr(result)} - -
- {/if} - {#if isAddressableEvent(result)} -
- -
- {/if} - {#if result.content} -
- -
+ +
+ {/if} + {#if result.content} +
+ +
+ {/if} {/if} - {/if} -
- - {/each} -
+
+ + {/each} +
{/if} - {#if !event && searchResults.length === 0 && secondOrderResults.length === 0 && tTagResults.length === 0 && !searchValue && !dTagValue && !searchInProgress} + {#if !event && searchResults.length === 0 && secondOrderResults.length === 0 && tTagResults.length === 0 && !searchValue && !searchInProgress}
- Publish Nostr Event + Publish Nostr Event

- Create and publish new Nostr events to the network. This form supports various event kinds including: + Create and publish new Nostr events to the network. This form + supports various event kinds including:

-
    -
  • Kind 30040: Publication indexes that organize AsciiDoc content into structured publications
  • -
  • Kind 30041: Individual section content for publications
  • -
  • Other kinds: Standard Nostr events with custom tags and content
  • +
      +
    • + Kind 30040: Publication indexes that organize AsciiDoc + content into structured publications +
    • +
    • + Kind 30041: Individual section content for publications +
    • +
    • + Other kinds: Standard Nostr events with custom tags + and content +
@@ -1017,9 +1150,13 @@ {#if showSidePanel && event} -
+
- Event Details + Event Details
- + {#if user?.signedIn}
- Add Comment + Add Comment
{:else}