feat: draw.io (diagrams.net) integration (#215)

* draw.io init

* updates
This commit is contained in:
Philip Okugbe
2024-09-01 12:26:20 +01:00
committed by GitHub
parent 38e9eef2dc
commit 87b99f8646
14 changed files with 555 additions and 110 deletions

View File

@ -52,3 +52,12 @@ export async function svgStringToFile(
const blob = new Blob([svgString], { type: "image/svg+xml" });
return new File([blob], fileName, { type: "image/svg+xml" });
}
export function decodeBase64ToSvgString(base64Data: string): string {
const base64Prefix = 'data:image/svg+xml;base64,';
if (base64Data.startsWith(base64Prefix)) {
base64Data = base64Data.replace(base64Prefix, '');
}
return atob(base64Data);
}