@@ -16,13 +16,14 @@ interface ComponentDefinition<Props extends BaseProps = BaseProps> {
1616
1717interface WindowManagerStoreState {
1818 contentRef : React . RefObject < HTMLDivElement > ;
19+ desktopRef : React . RefObject < HTMLDivElement > ;
1920 windowsMap : Map < string , Map < string , ComponentDefinition > > ;
2021 highestZIndex : number ;
2122 getWindowDefinitions : ( ) => Array < ComponentDefinition > ;
2223 addWindow : < Props extends BaseProps = BaseProps > (
2324 windowType : string ,
2425 windowId : string ,
25- definition : ComponentDefinition < Props >
26+ definition : ComponentDefinition < Props > ,
2627 ) => void ;
2728 closeWindow : ( windowType : string , windowId : string ) => void ;
2829 focusWindowsOfType : ( windowType : string ) => void ;
@@ -33,17 +34,18 @@ interface WindowManagerStoreState {
3334
3435const useWindowManagerStore = create < WindowManagerStoreState > ( ) ( ( set , get ) => ( {
3536 contentRef : React . createRef < HTMLDivElement > ( ) ,
37+ desktopRef : React . createRef < HTMLDivElement > ( ) ,
3638 windowsMap : new Map ( ) ,
3739 highestZIndex : 0 ,
3840 getWindowDefinitions ( ) {
3941 return Array . from ( get ( ) . windowsMap . values ( ) ) . flatMap ( ( map ) =>
40- Array . from ( map . values ( ) )
42+ Array . from ( map . values ( ) ) ,
4143 ) ;
4244 } ,
4345 addWindow < Props extends BaseProps = BaseProps > (
4446 windowType : string ,
4547 windowId : string ,
46- definition : ComponentDefinition < Props >
48+ definition : ComponentDefinition < Props > ,
4749 ) {
4850 const windowsMap = get ( ) . windowsMap ;
4951 const windowsOfType = windowsMap . get ( windowType ) ;
@@ -54,7 +56,7 @@ const useWindowManagerStore = create<WindowManagerStoreState>()((set, get) => ({
5456 if ( ! windowsOfType ) {
5557 windowsMap . set (
5658 windowType ,
57- new Map ( [ [ windowId , definition as unknown as ComponentDefinition ] ] )
59+ new Map ( [ [ windowId , definition as unknown as ComponentDefinition ] ] ) ,
5860 ) ;
5961 } else {
6062 windowsOfType . set ( windowId , definition as unknown as ComponentDefinition ) ;
0 commit comments