mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-11 16:07:15 +02:00
ff213d249ffe82c89f9af3420267799650907083
Add reusable PostComposer component with proper event builders for creating kind 1 (short text notes) and kind 11 (threads) with full NIP-10 threading support. ## Event Builders (src/lib/event-builders.ts) - buildKind1Event: Creates kind 1 notes with NIP-10 reply tags - Proper root/reply markers for threading - Deduplicates p-tags - Supports emoji tags (NIP-30) and imeta tags (NIP-92) - buildKind11Event: Creates kind 11 threads with title tag - Flat reply structure (per NIP-7D) - Full metadata support ## PostComposer Component (src/components/editor/PostComposer.tsx) - Two variants: inline (chat-style) and card (timeline posts) - Features: - @ mention autocomplete with NIP-19 npub encoding - : emoji autocomplete (unicode + custom emoji) - / slash commands (optional) - Blob attachments (NIP-92 imeta tags) - Reply context with full event object (not just ID) - Title input for kind 11 threads - Mobile-aware keyboard behavior ## Key Changes - Pass replyTo as NostrEvent (full object) instead of string ID - Enables proper NIP-10 tag construction - Provides access to parent tags and metadata - Card variant CSS (.editor-card) for multi-row editing - Min height 6rem, max height 24rem - Scrollable with proper padding - Comprehensive tests for event builders (14 tests passing) - Example usage components for integration guidance ## Technical Notes - Uses UnsignedEvent type (includes pubkey) instead of EventTemplate - Integrates with applesauce v5 ActionRunner via hub.exec() - All emoji, mention, and blob metadata properly serialized - Maintains backward compatibility with existing MentionEditor
…
Grimoire
A Nostr protocol explorer and developer tool with a tiling window manager interface.
Features
- Tiling Windows - Each window is a Nostr "app" (profile viewer, event feed, NIP docs, etc.)
- Command Palette - Unix-style commands via
Cmd+Kto open apps and navigate - Multi-workspace - Virtual desktops with independent layouts
- Real-time - Reactive event subscriptions with automatic updates
Stack
React 19, TypeScript, Vite, TailwindCSS, Jotai, Dexie, Applesauce
Getting Started
npm install
npm run dev
Scripts
| Command | Description |
|---|---|
npm run dev |
Start dev server |
npm run build |
Build for production |
npm test |
Run tests in watch mode |
npm run lint |
Lint code |
npm run format |
Format code |
License
MIT
Languages
TypeScript
98.9%
CSS
0.8%
JavaScript
0.3%