mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: utils leaking Scene state (#6461
* fix: utils leaking Scene state * remove debug * doc * add tests for group duplicating * tweaks
This commit is contained in:
parent
b0b23353cf
commit
399c92d882
5 changed files with 604 additions and 116 deletions
|
@ -90,6 +90,9 @@ export const exportToSvg = async (
|
|||
exportEmbedScene?: boolean;
|
||||
},
|
||||
files: BinaryFiles | null,
|
||||
opts?: {
|
||||
serializeAsJSON?: () => string;
|
||||
},
|
||||
): Promise<SVGSVGElement> => {
|
||||
const {
|
||||
exportPadding = DEFAULT_EXPORT_PADDING,
|
||||
|
@ -103,7 +106,9 @@ export const exportToSvg = async (
|
|||
metadata = await (
|
||||
await import(/* webpackChunkName: "image" */ "../../src/data/image")
|
||||
).encodeSvgMetadata({
|
||||
text: serializeAsJSON(elements, appState, files || {}, "local"),
|
||||
text: opts?.serializeAsJSON
|
||||
? opts?.serializeAsJSON?.()
|
||||
: serializeAsJSON(elements, appState, files || {}, "local"),
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue