Feat: 프론트엔드 하이라이트 & 메모 시스템 완성

- viewer.js: 텍스트 선택 → 하이라이트 생성 기능 구현
- viewer.js: 하이라이트 클릭 시 말풍선 UI로 메모 관리
- viewer.js: 다중 메모 지원, 실시간 메모 추가/삭제
- api.js: 하이라이트, 메모, 책갈피 API 함수 추가
- main.js: 문서 업로드 후 자동 새로고침, 뷰어 페이지 이동
- HTML: 인라인 SVG 파비콘 추가, 색상 버튼 개선

 하이라이트 생성/삭제 기능 완성
 메모 추가/편집 기능 완성
 말풍선 UI 구현 완성
 Alpine.js 컴포넌트 간 안전한 통신
This commit is contained in:
Hyungi Ahn
2025-08-22 09:58:38 +09:00
parent edfabdac23
commit c0ea76dc2e
6 changed files with 478 additions and 46 deletions

View File

@@ -259,6 +259,73 @@ class API {
async changePassword(passwordData) {
return await this.put('/auth/change-password', passwordData);
}
// === 하이라이트 관련 API ===
async getDocumentHighlights(documentId) {
return await this.get(`/highlights/document/${documentId}`);
}
async createHighlight(highlightData) {
return await this.post('/highlights/', highlightData);
}
async updateHighlight(highlightId, highlightData) {
return await this.put(`/highlights/${highlightId}`, highlightData);
}
async deleteHighlight(highlightId) {
return await this.delete(`/highlights/${highlightId}`);
}
// === 메모 관련 API ===
async getDocumentNotes(documentId) {
return await this.get(`/notes/document/${documentId}`);
}
async createNote(noteData) {
return await this.post('/notes/', noteData);
}
async updateNote(noteId, noteData) {
return await this.put(`/notes/${noteId}`, noteData);
}
async deleteNote(noteId) {
return await this.delete(`/notes/${noteId}`);
}
async getNotesByHighlight(highlightId) {
return await this.get(`/notes/highlight/${highlightId}`);
}
// === 책갈피 관련 API ===
async getDocumentBookmarks(documentId) {
return await this.get(`/bookmarks/document/${documentId}`);
}
async createBookmark(bookmarkData) {
return await this.post('/bookmarks/', bookmarkData);
}
async updateBookmark(bookmarkId, bookmarkData) {
return await this.put(`/bookmarks/${bookmarkId}`, bookmarkData);
}
async deleteBookmark(bookmarkId) {
return await this.delete(`/bookmarks/${bookmarkId}`);
}
// === 검색 관련 API ===
async searchDocuments(query, filters = {}) {
const params = new URLSearchParams({ q: query, ...filters });
return await this.get(`/search/documents?${params}`);
}
async searchNotes(query, documentId = null) {
const params = new URLSearchParams({ q: query });
if (documentId) params.append('document_id', documentId);
return await this.get(`/search/notes?${params}`);
}
}
// 전역 API 인스턴스