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:
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;
|
||||
}>;
|
||||
|
Reference in New Issue
Block a user