d45f48e60f
Also makes "Clear canvas" reset the entire app state
23 lines
569 B
TypeScript
23 lines
569 B
TypeScript
import { AppState } from "./types";
|
|
import { getDateTime } from "./utils";
|
|
|
|
const DEFAULT_PROJECT_NAME = `excalidraw-${getDateTime()}`;
|
|
|
|
export function getDefaultAppState(): AppState {
|
|
return {
|
|
draggingElement: null,
|
|
resizingElement: null,
|
|
elementType: "selection",
|
|
exportBackground: true,
|
|
currentItemStrokeColor: "#000000",
|
|
currentItemBackgroundColor: "transparent",
|
|
currentItemFont: "20px Virgil",
|
|
viewBackgroundColor: "#ffffff",
|
|
scrollX: 0,
|
|
scrollY: 0,
|
|
cursorX: 0,
|
|
cursorY: 0,
|
|
name: DEFAULT_PROJECT_NAME
|
|
};
|
|
}
|