mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: rewrite public UI component rendering using tunnels (#6117)
* feat: rewrite public UI component rendering using tunnels * factor out into components * comments * fix variable naming * fix not hiding welcomeScreen * factor out AppFooter and memoize components * remove `UIOptions.welcomeScreen` and render only from host app * factor out tunnels into own file * update changelog. Keep `UIOptions.welcomeScreen` as deprecated * update changelog * lint --------- Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
3a141ca77a
commit
e6de1fe4a4
22 changed files with 417 additions and 372 deletions
35
src/types.ts
35
src/types.ts
|
@ -385,15 +385,16 @@ type CanvasActions = Partial<{
|
|||
|
||||
type UIOptions = Partial<{
|
||||
dockedSidebarBreakpoint: number;
|
||||
welcomeScreen: boolean;
|
||||
canvasActions: CanvasActions;
|
||||
/** @deprecated does nothing. Will be removed in 0.15 */
|
||||
welcomeScreen?: boolean;
|
||||
}>;
|
||||
|
||||
export type AppProps = Merge<
|
||||
ExcalidrawProps,
|
||||
{
|
||||
UIOptions: Merge<
|
||||
MarkRequired<UIOptions, "welcomeScreen">,
|
||||
UIOptions,
|
||||
{
|
||||
canvasActions: Required<CanvasActions> & { export: ExportOpts };
|
||||
}
|
||||
|
@ -523,33 +524,3 @@ export type Device = Readonly<{
|
|||
isTouchScreen: boolean;
|
||||
canDeviceFitSidebar: boolean;
|
||||
}>;
|
||||
|
||||
export type UIChildrenComponents = {
|
||||
[k in "FooterCenter" | "Menu" | "WelcomeScreen"]?: React.ReactElement<
|
||||
{ children?: React.ReactNode },
|
||||
React.JSXElementConstructor<any>
|
||||
>;
|
||||
};
|
||||
|
||||
export type UIWelcomeScreenComponents = {
|
||||
[k in
|
||||
| "Center"
|
||||
| "MenuHint"
|
||||
| "ToolbarHint"
|
||||
| "HelpHint"]?: React.ReactElement<
|
||||
{ children?: React.ReactNode },
|
||||
React.JSXElementConstructor<any>
|
||||
>;
|
||||
};
|
||||
|
||||
export type UIWelcomeScreenCenterComponents = {
|
||||
[k in
|
||||
| "Logo"
|
||||
| "Heading"
|
||||
| "Menu"
|
||||
| "MenuItemLoadScene"
|
||||
| "MenuItemHelp"]?: React.ReactElement<
|
||||
{ children?: React.ReactNode },
|
||||
React.JSXElementConstructor<any>
|
||||
>;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue