From 344d96dcc31a3d4ecbcd4f22e0859df19d386339 Mon Sep 17 00:00:00 2001 From: RobotLeopard86 Date: Mon, 30 Sep 2024 14:23:50 -0700 Subject: [PATCH] Fix export template path --- {public => src}/diagram_template.svg | 0 src/exporter.ts | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename {public => src}/diagram_template.svg (100%) diff --git a/public/diagram_template.svg b/src/diagram_template.svg similarity index 100% rename from public/diagram_template.svg rename to src/diagram_template.svg diff --git a/src/exporter.ts b/src/exporter.ts index 57536c2..4c6f9c1 100644 --- a/src/exporter.ts +++ b/src/exporter.ts @@ -1,9 +1,10 @@ import type { Button, Instance, Mapping, Scheme } from "./schema"; import fileSaver from "file-saver"; +import templateURL from "./diagram_template.svg"; export const exportProject = (inst: Instance) => { inst.forEach(async(scheme: Scheme) => { - const template = await (await fetch("/diagram_template.svg")).text(); + const template = await (await fetch(templateURL)).text(); const templateDoc = new DOMParser().parseFromString(template, "image/svg+xml"); templateDoc.querySelector("#title")!.innerHTML = scheme.name;