1
1
import type { SystemStyleObject } from '@invoke-ai/ui-library' ;
2
- import { ContextMenu , Divider , Flex , IconButton , Menu , MenuButton , MenuList } from '@invoke-ai/ui-library' ;
2
+ import {
3
+ ContextMenu ,
4
+ Divider ,
5
+ Flex ,
6
+ IconButton ,
7
+ Menu ,
8
+ MenuButton ,
9
+ MenuList ,
10
+ Tab ,
11
+ TabList ,
12
+ TabPanel ,
13
+ TabPanels ,
14
+ Tabs ,
15
+ } from '@invoke-ai/ui-library' ;
3
16
import { useAppSelector } from 'app/store/storeHooks' ;
4
17
import { FocusRegionWrapper } from 'common/components/FocusRegionWrapper' ;
5
18
import { CanvasAlertsInvocationProgress } from 'features/controlLayers/components/CanvasAlerts/CanvasAlertsInvocationProgress' ;
@@ -13,12 +26,15 @@ import { CanvasHUD } from 'features/controlLayers/components/HUD/CanvasHUD';
13
26
import { InvokeCanvasComponent } from 'features/controlLayers/components/InvokeCanvasComponent' ;
14
27
import { SelectObject } from 'features/controlLayers/components/SelectObject/SelectObject' ;
15
28
import { CanvasSessionContextProvider } from 'features/controlLayers/components/SimpleSession/context' ;
29
+ import { InitialState } from 'features/controlLayers/components/SimpleSession/InitialState' ;
16
30
import { StagingAreaItemsList } from 'features/controlLayers/components/SimpleSession/StagingAreaItemsList' ;
17
31
import { StagingAreaToolbar } from 'features/controlLayers/components/StagingArea/StagingAreaToolbar' ;
18
32
import { CanvasToolbar } from 'features/controlLayers/components/Toolbar/CanvasToolbar' ;
19
33
import { Transform } from 'features/controlLayers/components/Transform/Transform' ;
20
34
import { CanvasManagerProviderGate } from 'features/controlLayers/contexts/CanvasManagerProviderGate' ;
21
35
import { selectDynamicGrid , selectShowHUD } from 'features/controlLayers/store/canvasSettingsSlice' ;
36
+ import { ImageViewer } from 'features/gallery/components/ImageViewer/ImageViewer' ;
37
+ import { ViewerToolbar } from 'features/gallery/components/ImageViewer/ViewerToolbar' ;
22
38
import { memo , useCallback } from 'react' ;
23
39
import { PiDotsThreeOutlineVerticalFill } from 'react-icons/pi' ;
24
40
@@ -60,87 +76,107 @@ export const AdvancedSession = memo(({ id }: { id: string | null }) => {
60
76
} , [ ] ) ;
61
77
62
78
return (
63
- < FocusRegionWrapper region = "canvas" sx = { FOCUS_REGION_STYLES } >
64
- < Flex
65
- tabIndex = { - 1 }
66
- borderRadius = "base"
67
- position = "relative"
68
- flexDirection = "column"
69
- height = "full"
70
- width = "full"
71
- gap = { 2 }
72
- alignItems = "center"
73
- justifyContent = "center"
74
- overflow = "hidden"
75
- >
76
- < CanvasManagerProviderGate >
77
- < CanvasToolbar />
78
- </ CanvasManagerProviderGate >
79
- < Divider />
80
- < ContextMenu < HTMLDivElement > renderMenu = { renderMenu } withLongPress = { false } >
81
- { ( ref ) => (
82
- < Flex ref = { ref } sx = { canvasBgSx } data-dynamic-grid = { dynamicGrid } >
83
- < InvokeCanvasComponent />
79
+ < Tabs w = "full" h = "full" >
80
+ < TabList >
81
+ < Tab > Welcome</ Tab >
82
+ < Tab > Workspace</ Tab >
83
+ < Tab > Viewer</ Tab >
84
+ </ TabList >
85
+ < TabPanels w = "full" h = "full" >
86
+ < TabPanel w = "full" h = "full" justifyContent = "center" >
87
+ < InitialState />
88
+ </ TabPanel >
89
+ < TabPanel w = "full" h = "full" >
90
+ < FocusRegionWrapper region = "canvas" sx = { FOCUS_REGION_STYLES } >
91
+ < Flex
92
+ tabIndex = { - 1 }
93
+ borderRadius = "base"
94
+ position = "relative"
95
+ flexDirection = "column"
96
+ height = "full"
97
+ width = "full"
98
+ gap = { 2 }
99
+ alignItems = "center"
100
+ justifyContent = "center"
101
+ overflow = "hidden"
102
+ >
84
103
< CanvasManagerProviderGate >
85
- < Flex
86
- position = "absolute"
87
- flexDir = "column"
88
- top = { 1 }
89
- insetInlineStart = { 1 }
90
- pointerEvents = "none"
91
- gap = { 2 }
92
- alignItems = "flex-start"
93
- >
94
- { showHUD && < CanvasHUD /> }
95
- < CanvasAlertsSelectedEntityStatus />
96
- < CanvasAlertsPreserveMask />
97
- < CanvasAlertsInvocationProgress />
98
- </ Flex >
99
- < Flex position = "absolute" top = { 1 } insetInlineEnd = { 1 } >
100
- < Menu >
101
- < MenuButton as = { IconButton } icon = { < PiDotsThreeOutlineVerticalFill /> } colorScheme = "base" />
102
- < MenuContent />
103
- </ Menu >
104
- </ Flex >
104
+ < CanvasToolbar />
105
105
</ CanvasManagerProviderGate >
106
- </ Flex >
107
- ) }
108
- </ ContextMenu >
109
- { id !== null && (
110
- < CanvasManagerProviderGate >
111
- < CanvasSessionContextProvider type = "advanced" id = { id } >
112
- < Flex
113
- position = "absolute"
114
- flexDir = "column"
115
- bottom = { 4 }
116
- gap = { 2 }
117
- align = "center"
118
- justify = "center"
119
- left = { 4 }
120
- right = { 4 }
121
- >
122
- < Flex position = "relative" maxW = "full" w = "full" h = { 108 } >
123
- < StagingAreaItemsList />
124
- </ Flex >
125
- < Flex gap = { 2 } >
126
- < StagingAreaToolbar />
127
- </ Flex >
106
+ < Divider />
107
+ < ContextMenu < HTMLDivElement > renderMenu = { renderMenu } withLongPress = { false } >
108
+ { ( ref ) => (
109
+ < Flex ref = { ref } sx = { canvasBgSx } data-dynamic-grid = { dynamicGrid } >
110
+ < InvokeCanvasComponent />
111
+ < CanvasManagerProviderGate >
112
+ < Flex
113
+ position = "absolute"
114
+ flexDir = "column"
115
+ top = { 1 }
116
+ insetInlineStart = { 1 }
117
+ pointerEvents = "none"
118
+ gap = { 2 }
119
+ alignItems = "flex-start"
120
+ >
121
+ { showHUD && < CanvasHUD /> }
122
+ < CanvasAlertsSelectedEntityStatus />
123
+ < CanvasAlertsPreserveMask />
124
+ < CanvasAlertsInvocationProgress />
125
+ </ Flex >
126
+ < Flex position = "absolute" top = { 1 } insetInlineEnd = { 1 } >
127
+ < Menu >
128
+ < MenuButton as = { IconButton } icon = { < PiDotsThreeOutlineVerticalFill /> } colorScheme = "base" />
129
+ < MenuContent />
130
+ </ Menu >
131
+ </ Flex >
132
+ </ CanvasManagerProviderGate >
133
+ </ Flex >
134
+ ) }
135
+ </ ContextMenu >
136
+ { id !== null && (
137
+ < CanvasManagerProviderGate >
138
+ < CanvasSessionContextProvider type = "advanced" id = { id } >
139
+ < Flex
140
+ position = "absolute"
141
+ flexDir = "column"
142
+ bottom = { 4 }
143
+ gap = { 2 }
144
+ align = "center"
145
+ justify = "center"
146
+ left = { 4 }
147
+ right = { 4 }
148
+ >
149
+ < Flex position = "relative" maxW = "full" w = "full" h = { 108 } >
150
+ < StagingAreaItemsList />
151
+ </ Flex >
152
+ < Flex gap = { 2 } >
153
+ < StagingAreaToolbar />
154
+ </ Flex >
155
+ </ Flex >
156
+ </ CanvasSessionContextProvider >
157
+ </ CanvasManagerProviderGate >
158
+ ) }
159
+ < Flex position = "absolute" bottom = { 4 } >
160
+ < CanvasManagerProviderGate >
161
+ < Filter />
162
+ < Transform />
163
+ < SelectObject />
164
+ </ CanvasManagerProviderGate >
128
165
</ Flex >
129
- </ CanvasSessionContextProvider >
130
- </ CanvasManagerProviderGate >
131
- ) }
132
- < Flex position = "absolute" bottom = { 4 } >
133
- < CanvasManagerProviderGate >
134
- < Filter />
135
- < Transform />
136
- < SelectObject />
137
- </ CanvasManagerProviderGate >
138
- </ Flex >
139
- < CanvasManagerProviderGate >
140
- < CanvasDropArea />
141
- </ CanvasManagerProviderGate >
142
- </ Flex >
143
- </ FocusRegionWrapper >
166
+ < CanvasManagerProviderGate >
167
+ < CanvasDropArea />
168
+ </ CanvasManagerProviderGate >
169
+ </ Flex >
170
+ </ FocusRegionWrapper >
171
+ </ TabPanel >
172
+ < TabPanel w = "full" h = "full" >
173
+ < Flex flexDir = "column" w = "full" h = "full" >
174
+ < ViewerToolbar />
175
+ < ImageViewer />
176
+ </ Flex >
177
+ </ TabPanel >
178
+ </ TabPanels >
179
+ </ Tabs >
144
180
) ;
145
181
} ) ;
146
182
AdvancedSession . displayName = 'AdvancedSession' ;
0 commit comments