mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support appState.exportEmbedScene to embed scene data in exportToSvg util (#3777)
* feat: add embedScene attribute to exportToSvg util * fix * return promise * add docs and remove * fix * fix tests * use * fix * fix * remove metadata and use exportEmbedScene * fix * fix * fix * fix * IIFE
This commit is contained in:
parent
62303b8a22
commit
f861a9fdd0
12 changed files with 128 additions and 79 deletions
|
@ -74,15 +74,13 @@ export const exportToBlob = (
|
|||
});
|
||||
};
|
||||
|
||||
export const exportToSvg = ({
|
||||
export const exportToSvg = async ({
|
||||
elements,
|
||||
appState = getDefaultAppState(),
|
||||
exportPadding,
|
||||
metadata,
|
||||
}: Omit<ExportOpts, "getDimensions"> & {
|
||||
exportPadding?: number;
|
||||
metadata?: string;
|
||||
}): SVGSVGElement => {
|
||||
}): Promise<SVGSVGElement> => {
|
||||
const { elements: restoredElements, appState: restoredAppState } = restore(
|
||||
{ elements, appState },
|
||||
null,
|
||||
|
@ -90,7 +88,6 @@ export const exportToSvg = ({
|
|||
return _exportToSvg(getNonDeletedElements(restoredElements), {
|
||||
...restoredAppState,
|
||||
exportPadding,
|
||||
metadata,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue