fix: exporting labelled arrows via export utils (#6443)

* fix: exporting labelled arrows via export utils

* add comments

* lint

* update changelog

* fix lint

* initialize scene in the utils so it can be availabe in the helper functions

* fix library rendering

* add comments
This commit is contained in:
Aakansha Doshi 2023-04-13 17:19:46 +05:30 committed by GitHub
parent 13b27afe0f
commit ca3be2c678
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 12 deletions

View file

@ -2,7 +2,7 @@ import clsx from "clsx";
import oc from "open-color";
import { useEffect, useRef, useState } from "react";
import { useDevice } from "../components/App";
import { exportToSvg } from "../scene/export";
import { exportToSvg } from "../packages/utils";
import { LibraryItem } from "../types";
import "./LibraryUnit.scss";
import { CheckboxItem } from "./CheckboxItem";
@ -36,14 +36,14 @@ export const LibraryUnit = ({
if (!elements) {
return;
}
const svg = await exportToSvg(
const svg = await exportToSvg({
elements,
{
appState: {
exportBackground: false,
viewBackgroundColor: oc.white,
},
null,
);
files: null,
});
svg.querySelector(".style-fonts")?.remove();
node.innerHTML = svg.outerHTML;
})();