7a7a73b78d
* Initial support for mobile devices No editing yet, but UI looks nice and you can open the canvas menu * Add support for editing shape color, etc * Allow the mobile menus to cover the shape selector * Hopefully fix test error * Fix touch on canvas * Fix safe area handling & remove unused Island
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { ExcalidrawElement } from "./element/types";
|
|
import { SHAPES } from "./shapes";
|
|
|
|
export type FlooredNumber = number & { _brand: "FlooredNumber" };
|
|
|
|
export type AppState = {
|
|
draggingElement: ExcalidrawElement | null;
|
|
resizingElement: ExcalidrawElement | null;
|
|
multiElement: ExcalidrawElement | null;
|
|
selectionElement: ExcalidrawElement | null;
|
|
// element being edited, but not necessarily added to elements array yet
|
|
// (e.g. text element when typing into the input)
|
|
editingElement: ExcalidrawElement | null;
|
|
elementType: typeof SHAPES[number]["value"];
|
|
elementLocked: boolean;
|
|
exportBackground: boolean;
|
|
currentItemStrokeColor: string;
|
|
currentItemBackgroundColor: string;
|
|
currentItemFillStyle: string;
|
|
currentItemStrokeWidth: number;
|
|
currentItemRoughness: number;
|
|
currentItemOpacity: number;
|
|
currentItemFont: string;
|
|
viewBackgroundColor: string;
|
|
scrollX: FlooredNumber;
|
|
scrollY: FlooredNumber;
|
|
cursorX: number;
|
|
cursorY: number;
|
|
scrolledOutside: boolean;
|
|
name: string;
|
|
selectedId?: string;
|
|
isResizing: boolean;
|
|
zoom: number;
|
|
openedMenu: "canvas" | "shape" | null;
|
|
};
|