@@ -5,6 +5,7 @@ import { DEFAULT_STATE_USER_SETTINGS } from '@vitejs/devtools-kit/constants'
55import { computed } from ' vue'
66import { docksGroupByCategories } from ' ../state/dock-settings'
77import { sharedStateToRef } from ' ../state/docks'
8+ import { isDockPopupSupported , requestDockPopupOpen } from ' ../state/popup'
89import DockIcon from ' ./DockIcon.vue'
910
1011const props = defineProps <{
@@ -14,6 +15,30 @@ const props = defineProps<{
1415
1516const settingsStore = props .context .docks .settings
1617const settings = sharedStateToRef (settingsStore )
18+ const panelStore = props .context .panel .store
19+ const isEmbedded = props .context .clientType === ' embedded'
20+
21+ const dockModeOptions = computed (() => {
22+ const options = [
23+ { value: ' float' , label: ' Float' , icon: ' i-ph-cards-three-duotone' },
24+ { value: ' edge' , label: ' Edge' , icon: ' i-ph-square-half-bottom-duotone' },
25+ ]
26+ if (isDockPopupSupported ()) {
27+ options .push ({ value: ' popup' , label: ' Popup' , icon: ' i-ph-arrow-square-out-duotone' })
28+ }
29+ return options
30+ })
31+
32+ const currentDockMode = computed (() => panelStore .mode )
33+
34+ function setDockMode(mode : string ) {
35+ if (mode === ' popup' ) {
36+ requestDockPopupOpen (props .context )
37+ }
38+ else {
39+ panelStore .mode = mode as ' float' | ' edge'
40+ }
41+ }
1742
1843const categories = computed (() => {
1944 return docksGroupByCategories (props .context .docks .entries , settingsStore .value (), { includeHidden: true })
@@ -146,7 +171,29 @@ function resetSettings() {
146171 Appearance
147172 </h2 >
148173
149- <div class =" flex flex-col gap-3" >
174+ <div class =" flex flex-col gap-4" >
175+ <!-- Dock mode -->
176+ <div v-if =" isEmbedded" class =" flex flex-col gap-2" >
177+ <div class =" flex flex-col" >
178+ <span class =" text-sm" >Dock mode</span >
179+ <span class =" text-xs op50" >How the DevTools panel is displayed</span >
180+ </div >
181+ <div class =" flex items-center gap-1 bg-gray/10 rounded-lg p1 w-fit" >
182+ <button
183+ v-for =" option of dockModeOptions"
184+ :key =" option.value"
185+ class =" flex items-center gap-1.5 px3 py1.5 rounded-md text-sm transition-all"
186+ :class =" currentDockMode === option.value
187+ ? 'bg-base shadow text-primary font-medium'
188+ : 'op60 hover:op100 hover:bg-gray/10'"
189+ @click =" setDockMode(option.value)"
190+ >
191+ <div :class =" option.icon" class =" w-4 h-4" />
192+ {{ option.label }}
193+ </button >
194+ </div >
195+ </div >
196+
150197 <!-- Show iframe address bar toggle -->
151198 <label class =" flex items-center gap-3 cursor-pointer group" >
152199 <button
0 commit comments