mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add sidebar for libraries panel (#5274)
Co-authored-by: dwelle <luzar.david@gmail.com> Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
4712393b62
commit
cdf352d4c3
39 changed files with 782 additions and 241 deletions
38
src/types.ts
38
src/types.ts
|
@ -162,6 +162,7 @@ export type AppState = {
|
|||
offsetLeft: number;
|
||||
|
||||
isLibraryOpen: boolean;
|
||||
isLibraryMenuDocked: boolean;
|
||||
fileHandle: FileSystemHandle | null;
|
||||
collaborators: Map<string, Collaborator>;
|
||||
showStats: boolean;
|
||||
|
@ -291,7 +292,10 @@ export interface ExcalidrawProps {
|
|||
elements: readonly NonDeletedExcalidrawElement[],
|
||||
appState: AppState,
|
||||
) => JSX.Element;
|
||||
UIOptions?: UIOptions;
|
||||
UIOptions?: {
|
||||
dockedSidebarBreakpoint?: number;
|
||||
canvasActions?: CanvasActions;
|
||||
};
|
||||
detectScroll?: boolean;
|
||||
handleKeyboardGlobally?: boolean;
|
||||
onLibraryChange?: (libraryItems: LibraryItems) => void | Promise<any>;
|
||||
|
@ -349,18 +353,18 @@ type CanvasActions = {
|
|||
saveAsImage?: boolean;
|
||||
};
|
||||
|
||||
export type UIOptions = {
|
||||
canvasActions?: CanvasActions;
|
||||
};
|
||||
|
||||
export type AppProps = ExcalidrawProps & {
|
||||
UIOptions: {
|
||||
canvasActions: Required<CanvasActions> & { export: ExportOpts };
|
||||
};
|
||||
detectScroll: boolean;
|
||||
handleKeyboardGlobally: boolean;
|
||||
isCollaborating: boolean;
|
||||
};
|
||||
export type AppProps = Merge<
|
||||
ExcalidrawProps,
|
||||
{
|
||||
UIOptions: {
|
||||
canvasActions: Required<CanvasActions> & { export: ExportOpts };
|
||||
dockedSidebarBreakpoint?: number;
|
||||
};
|
||||
detectScroll: boolean;
|
||||
handleKeyboardGlobally: boolean;
|
||||
isCollaborating: boolean;
|
||||
}
|
||||
>;
|
||||
|
||||
/** A subset of App class properties that we need to use elsewhere
|
||||
* in the app, eg Manager. Factored out into a separate type to keep DRY. */
|
||||
|
@ -377,7 +381,7 @@ export type AppClassProperties = {
|
|||
}
|
||||
>;
|
||||
files: BinaryFiles;
|
||||
deviceType: App["deviceType"];
|
||||
device: App["device"];
|
||||
scene: App["scene"];
|
||||
};
|
||||
|
||||
|
@ -473,7 +477,9 @@ export type ExcalidrawImperativeAPI = {
|
|||
resetCursor: InstanceType<typeof App>["resetCursor"];
|
||||
};
|
||||
|
||||
export type DeviceType = {
|
||||
export type Device = Readonly<{
|
||||
isSmScreen: boolean;
|
||||
isMobile: boolean;
|
||||
isTouchScreen: boolean;
|
||||
};
|
||||
canDeviceFitSidebar: boolean;
|
||||
}>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue