mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-09-12 07:56:18 +00:00

* Hook up layer tree structure with frontend (decoding and Vue are WIP) * Fix off by one error * Avoid leaking memory * Parse layer structure into list of layers * Fix thumbnail updates * Correctly popagate deletions * Fix selection state in layer tree * Respect expansion during root serialization * Allow expanding of subfolders * Fix arrow direction Co-authored-by: Dennis Kobert <dennis@kobert.dev>
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { createApp } from "vue";
|
|
|
|
import { fullscreenModeChanged } from "@/utilities/fullscreen";
|
|
import { onKeyUp, onKeyDown, onMouseMove, onMouseDown, onMouseUp, onMouseScroll, onWindowResize } from "@/utilities/input";
|
|
import "@/utilities/errors";
|
|
import App from "@/App.vue";
|
|
import { panicProxy } from "@/utilities/panic-proxy";
|
|
|
|
const wasm = import("@/../wasm/pkg").then(panicProxy);
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
(window as any).wasmMemory = undefined;
|
|
|
|
(async () => {
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
(window as any).wasmMemory = (await wasm).wasm_memory;
|
|
|
|
// Initialize the Vue application
|
|
createApp(App).mount("#app");
|
|
|
|
// Bind global browser events
|
|
window.addEventListener("resize", onWindowResize);
|
|
onWindowResize();
|
|
|
|
document.addEventListener("contextmenu", (e) => e.preventDefault());
|
|
document.addEventListener("fullscreenchange", () => fullscreenModeChanged());
|
|
|
|
window.addEventListener("keyup", onKeyUp);
|
|
window.addEventListener("keydown", onKeyDown);
|
|
|
|
window.addEventListener("mousemove", onMouseMove);
|
|
window.addEventListener("mousedown", onMouseDown);
|
|
window.addEventListener("mouseup", onMouseUp);
|
|
|
|
window.addEventListener("wheel", onMouseScroll, { passive: false });
|
|
})();
|