Rend les liens entre notes visibles et persistants (sync NoteLink au save, auto-save, graphe réseau rafraîchi), ajoute living blocks, Memory Echo, recherche globale, consentement IA explicite et consolide les prototypes design en architectural-grid. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
935 B
TypeScript
24 lines
935 B
TypeScript
import type { Note } from '@/lib/types'
|
|
|
|
export const NOTE_CHANGE_EVENT = 'memento-note-changed'
|
|
export const NOTE_REQUEST_SAVE_EVENT = 'memento-request-note-save'
|
|
|
|
export type NoteChangeEvent =
|
|
| { type: 'updated'; note: Note }
|
|
| { type: 'deleted'; noteId: string; notebookId?: string | null }
|
|
| { type: 'created'; note: Note }
|
|
|
|
export type NoteCollectionActions = {
|
|
onTogglePin?: (note: Note) => void | Promise<void>
|
|
onDeleteNote?: (note: Note) => void | Promise<void>
|
|
onArchiveNote?: (note: Note) => void | Promise<void>
|
|
onMoveToNotebook?: (note: Note, notebookId: string | null) => void | Promise<void>
|
|
onNotePatch?: (noteId: string, patch: Partial<Note>) => void
|
|
onNoteIllustrationGenerated?: (noteId: string) => void | Promise<void>
|
|
}
|
|
|
|
export function emitNoteChange(detail: NoteChangeEvent) {
|
|
if (typeof window === 'undefined') return
|
|
window.dispatchEvent(new CustomEvent(NOTE_CHANGE_EVENT, { detail }))
|
|
}
|