Migrate to Euro-Office and refresh the editor home experience.
Swap Document Server to Euro-Office, add blank-document creation, and restyle the app with an Office-like light/dark theme and compact editor toolbar. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
5ac6281304
commit
0800fc8571
27 files changed
+735
-394
No files matched your search
@@ -66,6 +66,39 @@ export async function uploadDocument(file: File): Promise<{
|
||||
);
|
||||
}
|
||||
|
||||
export type BlankDocumentType = 'docx' | 'xlsx' | 'pptx' | 'pdf' | 'hwpx';
|
||||
|
||||
export async function createBlankDocument(type: BlankDocumentType): Promise<{
|
||||
docId: string;
|
||||
filename: string;
|
||||
fileType: string;
|
||||
documentType: string;
|
||||
token: string;
|
||||
}> {
|
||||
return parseJson(
|
||||
await fetch('/api/documents/new', {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ type }),
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export async function fetchDocumentContent(
|
||||
docId: string,
|
||||
token: string,
|
||||
): Promise<ArrayBuffer> {
|
||||
const res = await fetch(
|
||||
`/api/documents/${docId}/content?token=${encodeURIComponent(token)}`,
|
||||
{ credentials: 'include' },
|
||||
);
|
||||
if (!res.ok) {
|
||||
throw new ApiError(res.status, 'content_failed', '문서를 불러오지 못했습니다.');
|
||||
}
|
||||
return res.arrayBuffer();
|
||||
}
|
||||
|
||||
export type EditorConfigResponse = {
|
||||
documentType: string;
|
||||
document: Record<string, unknown>;
|
||||
|
||||
Reference in new issue
Block a user