diff --git a/web/src/lib/EventHelper.ts b/web/src/lib/EventHelper.ts index a077243c3..f8fcd400c 100644 --- a/web/src/lib/EventHelper.ts +++ b/web/src/lib/EventHelper.ts @@ -178,3 +178,7 @@ export function getZapperPubkey(event: Event): string | undefined { export function isNostrHex(hex: string): boolean { return /[0-9a-f]{64}/.test(hex); } + +export function getTitle(tags: string[][]): string | undefined { + return filterTags('title', tags).at(0); +} diff --git a/web/src/lib/List.ts b/web/src/lib/List.ts index 6c4f346bc..89d3ebdb7 100644 --- a/web/src/lib/List.ts +++ b/web/src/lib/List.ts @@ -3,7 +3,7 @@ import { createRxOneshotReq, latest } from 'rx-nostr'; import { lastValueFrom } from 'rxjs'; import type { Event } from 'nostr-typedef'; import { rxNostr } from './timelines/MainTimeline'; -import { filterTags, findIdentifier } from './EventHelper'; +import { filterTags, findIdentifier, getTitle } from './EventHelper'; import { parsePrivateTags } from './Encryption'; import { pubkey } from './stores/Author'; import { Signer } from './Signer'; @@ -26,7 +26,7 @@ export async function fetchListEvent( } export function getListTitle(tags: string[][]): string { - return filterTags('title', tags).at(0) ?? findIdentifier(tags) ?? '-'; + return getTitle(tags) ?? findIdentifier(tags) ?? '-'; } export async function getListPubkeys(event: Event): Promise { diff --git a/web/src/lib/components/actions/ActionMenu.svelte b/web/src/lib/components/actions/ActionMenu.svelte new file mode 100644 index 000000000..4e2e26f99 --- /dev/null +++ b/web/src/lib/components/actions/ActionMenu.svelte @@ -0,0 +1,155 @@ + + +
+ + + + + emojiReaction(item.event, detail)} /> + + + + +
+{#if jsonDisplay} +
+
Event ID
+
{nip19.noteEncode(item.event.id)}
+
+
{nip19.neventEncode({ id: item.event.id })}
+
Event JSON
+ {JSON.stringify(item.event, null, 2)} +
User ID
+
{nip19.npubEncode(item.event.pubkey)}
+
User JSON
+ {JSON.stringify(metadata?.content, null, 2)} +
Code Points
+
display name
+

+ {getCodePoints(metadata?.content?.display_name ?? '') + .map((codePoint) => `0x${codePoint.toString(16)}`) + .join(' ')} +

+
@name
+

+ {getCodePoints(metadata?.content?.name ?? '') + .map((codePoint) => `0x${codePoint.toString(16)}`) + .join(' ')} +

+
content
+

+ {getCodePoints(item.event.content) + .map((codePoint) => `0x${codePoint.toString(16)}`) + .join(' ')} +

+
+ Open in + nostr-post-checker + +
+
+{/if} + + diff --git a/web/src/lib/components/content/Imeta.svelte b/web/src/lib/components/content/Imeta.svelte new file mode 100644 index 000000000..6a3be40ee --- /dev/null +++ b/web/src/lib/components/content/Imeta.svelte @@ -0,0 +1,11 @@ + + +{#if URL.canParse(url)} + +{/if} diff --git a/web/src/lib/components/items/EventComponent.svelte b/web/src/lib/components/items/EventComponent.svelte index 824af1111..823662f50 100644 --- a/web/src/lib/components/items/EventComponent.svelte +++ b/web/src/lib/components/items/EventComponent.svelte @@ -15,6 +15,7 @@ import BadgeDefinition from './BadgeDefinition.svelte'; import List from './List.svelte'; import LegacyDirectMessage from './LegacyDirectMessage.svelte'; + import Picture from './Picture.svelte'; export let item: Item; export let readonly: boolean; @@ -32,6 +33,8 @@ {:else if item.event.kind === Kind.BadgeAward} +{:else if Number(item.event.kind) === 20} + {:else if item.event.kind === Kind.ChannelCreation || item.event.kind === Kind.ChannelMetadata} {:else if item.event.kind === Kind.Article} diff --git a/web/src/lib/components/items/Note.svelte b/web/src/lib/components/items/Note.svelte index 5a40edbbf..71d07adf5 100644 --- a/web/src/lib/components/items/Note.svelte +++ b/web/src/lib/components/items/Note.svelte @@ -1,32 +1,22 @@ + + +
+ {#if title} +

{title}

+ {/if} + + {#each pictures as picture} + + {/each} + {#if !readonly} + + {/if} +
+