11<script setup lang="ts">
22import type { DevToolsDockEntry } from ' @vitejs/devtools-kit'
33import type { CSSProperties } from ' vue'
4- import type { DevToolsDockState } from ' ./DockProps'
4+ import type { DevToolsDockState } from ' ../types /DockProps'
55import { useElementBounding , useWindowSize } from ' @vueuse/core'
6- import { computed , markRaw , onMounted , reactive , ref , toRefs , useTemplateRef , watchEffect } from ' vue'
6+ import { computed , markRaw , onMounted , reactive , ref , toRefs , useTemplateRef } from ' vue'
7+ import { PresistedDomViewsManager } from ' ../utils/PresistedDomViewsManager'
78import DockPanelResizer from ' ./DockPanelResizer.vue'
8- import { IframeManager } from ' ./IframeManager'
99import ViewEntry from ' ./ViewEntry.vue'
1010
1111const props = defineProps <{
@@ -23,13 +23,8 @@ const isDragging = defineModel<boolean>('isDragging', { default: false })
2323const mousePosition = reactive ({ x: 0 , y: 0 })
2424
2525const dockPanel = useTemplateRef <HTMLDivElement >(' dockPanel' )
26- const iframesContainer = useTemplateRef <HTMLDivElement >(' iframesContainer' )
27-
28- const iframes = markRaw (new IframeManager ())
29-
30- watchEffect (() => {
31- iframes .setContainer (iframesContainer .value ! )
32- }, { flush: ' sync' })
26+ const viewsContainer = useTemplateRef <HTMLElement >(' viewsContainer' )
27+ const presistedDoms = markRaw (new PresistedDomViewsManager (viewsContainer ))
3328
3429function clamp(value : number , min : number , max : number ) {
3530 return Math .min (Math .max (value , min ), max )
@@ -174,22 +169,22 @@ onMounted(() => {
174169 :entry
175170 />
176171 <ViewEntry
177- v-if =" entry && iframesContainer "
172+ v-if =" entry && viewsContainer "
178173 :key =" entry.id"
179174 :state =" state"
180175 :is-dragging =" isDragging"
181176 :is-resizing =" isResizing"
182177 :entry =" entry"
183- :iframes = " iframes "
178+ :presisted-doms = " presistedDoms "
184179 :iframe-style =" {
185180 border: '1px solid #8883',
186181 borderRadius: '0.5rem',
187182 }"
188183 rounded
189184 />
190185 <div
191- id =" vite-devtools-iframe -container"
192- ref =" iframesContainer "
186+ id =" vite-devtools-views -container"
187+ ref =" viewsContainer "
193188 class =" absolute inset-0"
194189 />
195190 </div >
0 commit comments