mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: move contextMenu into the component tree and control via appState (#6021)
This commit is contained in:
parent
b704705ed8
commit
7e135c4e22
15 changed files with 1752 additions and 398 deletions
|
@ -30,6 +30,7 @@ import { MaybeTransformHandleType } from "./element/transformHandles";
|
|||
import Library from "./data/library";
|
||||
import type { FileSystemHandle } from "./data/filesystem";
|
||||
import type { ALLOWED_IMAGE_MIME_TYPES, MIME_TYPES } from "./constants";
|
||||
import { ContextMenuItems } from "./components/ContextMenu";
|
||||
|
||||
export type Point = Readonly<RoughPoint>;
|
||||
|
||||
|
@ -92,6 +93,11 @@ export type LastActiveToolBeforeEraser =
|
|||
| null;
|
||||
|
||||
export type AppState = {
|
||||
contextMenu: {
|
||||
items: ContextMenuItems;
|
||||
top: number;
|
||||
left: number;
|
||||
} | null;
|
||||
showWelcomeScreen: boolean;
|
||||
isLoading: boolean;
|
||||
errorMessage: string | null;
|
||||
|
@ -147,6 +153,7 @@ export type AppState = {
|
|||
isResizing: boolean;
|
||||
isRotating: boolean;
|
||||
zoom: Zoom;
|
||||
// mobile-only
|
||||
openMenu: "canvas" | "shape" | null;
|
||||
openPopup:
|
||||
| "canvasColorPicker"
|
||||
|
@ -407,6 +414,7 @@ export type AppClassProperties = {
|
|||
files: BinaryFiles;
|
||||
device: App["device"];
|
||||
scene: App["scene"];
|
||||
pasteFromClipboard: App["pasteFromClipboard"];
|
||||
};
|
||||
|
||||
export type PointerDownState = Readonly<{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue