mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 23:38:06 +08:00
* ability to mark an open document as unsaved * unsaved detection now being triggered based on layer tree height * Changed responses to use classes instead of interfaces * - rust implementation of unsaved markers - upgraded eslint * updated eslint in package.json * - Renamed GetOpenDocumentsList -> UpdateOpenDocumentsList - is not -> was not * changed hash to current identifier to better reflect its meaning * resolve some merge conflicts * removed console.log statement leftover from debuging * - changed Response to jsMessage - split files - Array<> -> [] * -remove path from UpdateLayer * - remove unused if statements * - comment for reflect-metadata - registerJsMessageHandler -> subscribeJsMessage - readonly message properties - fixed binding filename and comment - toRgb -> toRgba * - newOpacity -> transformer - added comments * MessageMaker -> messageMaker
41 lines
1.6 KiB
TypeScript
41 lines
1.6 KiB
TypeScript
// Allows for runtime reflection of types in javascript.
|
|
// It is needed for class-transformer to work and is imported as a side effect.
|
|
// The library replaces the Reflect Api on the window to support more features.
|
|
import "reflect-metadata";
|
|
import { createApp } from "vue";
|
|
import { fullscreenModeChanged } from "@/utilities/fullscreen";
|
|
import { onKeyUp, onKeyDown, onMouseMove, onMouseDown, onMouseUp, onMouseScroll, onWindowResize, onBeforeUnload } 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();
|
|
|
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
|
|
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 });
|
|
})();
|