* Remove width/height from the ".excalidraw" container so it will sized automatically. * updated all ref calculation to ".excalidraw" instead of parent since now ".excalidraw" will get resized * Remove props width/height as its not needed anymore. * Resize handler is also not needed anymore. * Position absolute canvas due to #3379 (comment) * move css to style and remove one extra rerendering * factor out mock logic for test * set height, width so as to avoid unnecessary updates of regression snap * better mock * better type checking and omit width,height from getDefaultAppState and also restore * revert * default to window dimensions in constructor * update docs * update * update * tweaks
27 lines
648 B
TypeScript
27 lines
648 B
TypeScript
import { ExcalidrawElement } from "../element/types";
|
|
import { AppState, LibraryItems } from "../types";
|
|
|
|
export interface DataState {
|
|
type?: string;
|
|
version?: string;
|
|
source?: string;
|
|
elements: readonly ExcalidrawElement[];
|
|
appState: Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
}
|
|
|
|
export interface ImportedDataState {
|
|
type?: string;
|
|
version?: string;
|
|
source?: string;
|
|
elements?: DataState["elements"] | null;
|
|
appState?: Partial<DataState["appState"]> | null;
|
|
scrollToContent?: boolean;
|
|
}
|
|
|
|
export interface LibraryData {
|
|
type?: string;
|
|
version?: number;
|
|
source?: string;
|
|
library?: LibraryItems;
|
|
}
|