Lexical: Finished up core drawing insert/editing

Added new options that sits on the context, for things needed but not
for the core editor, which are defined out of the editor (drawio URL,
error message text, pageId etc...)
This commit is contained in:
Dan Brown
2024-07-19 12:09:41 +01:00
parent fb87fb5750
commit c7c0df0964
13 changed files with 128 additions and 30 deletions

View File

@ -127,13 +127,13 @@ export async function show(drawioUrl: string, onInitCallback: () => Promise<stri
lastApprovedOrigin = (new URL(drawioUrl)).origin;
}
export async function upload(imageData: string, pageUploadedToId: string): Promise<{}|string> {
export async function upload(imageData: string, pageUploadedToId: string): Promise<{id: number, url: string}> {
const data = {
image: imageData,
uploaded_to: pageUploadedToId,
};
const resp = await window.$http.post(window.baseUrl('/images/drawio'), data);
return resp.data;
return resp.data as {id: number, url: string};
}
export function close() {