vite-plugin-vue-devtools 0.4.12 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/client/assets/{IframeView.vue_vue_type_script_setup_true_lang-97a0e754.js → IframeView.vue_vue_type_script_setup_true_lang-c6f176d1.js} +1 -1
  2. package/dist/client/assets/{StateFields.vue_vue_type_script_setup_true_lang-dd6974e1.js → StateFields.vue_vue_type_script_setup_true_lang-617e4d70.js} +20 -5
  3. package/dist/client/assets/{VIcon.vue_vue_type_script_setup_true_lang-4dcb121c.js → VIcon.vue_vue_type_script_setup_true_lang-6cd486d4.js} +1 -1
  4. package/dist/client/assets/{VIconButton.vue_vue_type_script_setup_true_lang-4054707d.js → VIconButton.vue_vue_type_script_setup_true_lang-63abce3f.js} +2 -2
  5. package/dist/client/assets/{VIconTitle.vue_vue_type_script_setup_true_lang-4531a0e4.js → VIconTitle.vue_vue_type_script_setup_true_lang-1ad26587.js} +1 -1
  6. package/dist/client/assets/{VPanelGrids-ea9ac4bd.js → VPanelGrids-4b915e62.js} +1 -1
  7. package/dist/client/assets/{VSectionBlock-0d870ae2.js → VSectionBlock-8dcfb48d.js} +3 -3
  8. package/dist/client/assets/{VSwitch.vue_vue_type_script_setup_true_lang-dc4a336f.js → VSwitch.vue_vue_type_script_setup_true_lang-ed954339.js} +2 -2
  9. package/dist/client/assets/{VTextInput.vue_vue_type_script_setup_true_lang-cd591fdb.js → VTextInput.vue_vue_type_script_setup_true_lang-5edeb245.js} +2 -2
  10. package/dist/client/assets/{__eyedropper-41422dc8.js → __eyedropper-67c21231.js} +23 -9
  11. package/dist/client/assets/{assets-fc847d7b.js → assets-bf6dd9e4.js} +9 -9
  12. package/dist/client/assets/{component-docs-b0456b1b.js → component-docs-b2752be1.js} +5 -5
  13. package/dist/client/assets/{components-41827ea5.js → components-c9aae4bc.js} +115 -11
  14. package/dist/client/assets/{documentations-e948ad25.js → documentations-e0b483de.js} +3 -3
  15. package/dist/client/assets/{graph-ed9ec08f.js → graph-f081d3a5.js} +4 -4
  16. package/dist/client/assets/{index-d268ce4d.js → index-197edebf.js} +2832 -2625
  17. package/dist/client/assets/{index-fb7e673c.js → index-f977bcde.js} +1 -1
  18. package/dist/client/assets/index-fb18df65.css +474 -0
  19. package/dist/client/assets/{inspect-4e046378.js → inspect-8d04bb08.js} +3 -3
  20. package/dist/client/assets/{npm-81f351e2.js → npm-73c6479f.js} +9 -9
  21. package/dist/client/assets/{overview-9d7f0c3c.js → overview-edc8c0a8.js} +5 -5
  22. package/dist/client/assets/{pages-7d46ae82.js → pages-562d1ae5.js} +8 -8
  23. package/dist/client/assets/{pinia-c576b594.js → pinia-89f6b4c0.js} +12 -9
  24. package/dist/client/assets/{routes-56017e0a.js → routes-ddddc2d7.js} +14 -11
  25. package/dist/client/assets/{rpc-6c4cc8d5.js → rpc-b9c94a3a.js} +1 -1
  26. package/dist/client/assets/{settings-4e36485a.js → settings-7722ba4d.js} +24 -41
  27. package/dist/client/assets/{splitpanes.es-db7e975b.js → splitpanes.es-2f5182b4.js} +1 -1
  28. package/dist/client/assets/{timeline-0fd22aff.js → timeline-bc5ea36f.js} +8 -8
  29. package/dist/client/index.html +2 -2
  30. package/package.json +19 -18
  31. package/src/node/views/ComponentInspector.vue +67 -0
  32. package/src/node/views/Main.vue +10 -5
  33. package/src/node/views/composables.ts +40 -0
  34. package/dist/client/assets/index-8135098e.css +0 -474
@@ -4,7 +4,8 @@ import { computed, ref } from 'vue'
4
4
  // @ts-expect-error virtual module
5
5
  import vueDevToolsOptions from 'virtual:vue-devtools-options'
6
6
  import Frame from './FrameBox.vue'
7
- import { useIframe, useInspector, usePanelVisible, usePiPMode, usePosition } from './composables'
7
+ import ComponentInspector from './ComponentInspector.vue'
8
+ import { useHighlightComponent, useIframe, useInspector, usePanelVisible, usePiPMode, usePosition } from './composables'
8
9
  import { checkIsSafari, useColorScheme, usePreferredColorScheme, warn } from './utils'
9
10
 
10
11
  const props = defineProps({
@@ -88,6 +89,7 @@ const { iframe, getIframe } = useIframe(clientUrl, async () => {
88
89
 
89
90
  // Picture-in-Picture mode
90
91
  const { popup } = usePiPMode(getIframe, hook)
92
+ const { overlayVisible, name: componentName, bounds, highlight, unHighlight } = useHighlightComponent()
91
93
 
92
94
  async function setupClient(iframe: HTMLIFrameElement) {
93
95
  const injection: any = iframe?.contentWindow?.__VUE_DEVTOOLS_VIEW__
@@ -109,14 +111,15 @@ async function setupClient(iframe: HTMLIFrameElement) {
109
111
  panelState.value.viewMode = 'xs'
110
112
  },
111
113
  toggle: togglePanelVisible,
112
- togglePosition(position) {
113
- if (position === 'popup')
114
- popup()
115
- },
114
+ popup,
116
115
  },
117
116
  openInEditor: openInEditor.value ?? (() => {
118
117
  warn('Unable to load inspector, open-in-editor is not available.')
119
118
  }),
119
+ componentInspector: {
120
+ highlight,
121
+ unHighlight,
122
+ },
120
123
  })
121
124
  }
122
125
 
@@ -279,6 +282,8 @@ collectHookBuffer()
279
282
  :view-mode="panelState.viewMode"
280
283
  />
281
284
  </div>
285
+ <!-- component inspector -->
286
+ <ComponentInspector v-if="overlayVisible" :bounds="bounds" :name="componentName" />
282
287
  </template>
283
288
 
284
289
  <style scoped>
@@ -15,6 +15,13 @@ interface DevToolsFrameState {
15
15
  closeOnOutsideClick: boolean
16
16
  }
17
17
 
18
+ interface ComponentInspectorBounds {
19
+ width: number
20
+ height: number
21
+ top: number
22
+ left: number
23
+ }
24
+
18
25
  // ---- state ----
19
26
  export const PANEL_PADDING = 10
20
27
  export const PANEL_MIN = 20
@@ -435,3 +442,36 @@ export function usePosition(panelEl: Ref<HTMLElement | undefined>) {
435
442
  iframeStyle,
436
443
  }
437
444
  }
445
+
446
+ // ---- useHighlightComponent ----
447
+
448
+ export function useHighlightComponent() {
449
+ const name = ref('')
450
+ const overlayVisible = ref(false)
451
+ const initialBounds = {
452
+ width: 0,
453
+ height: 0,
454
+ left: 0,
455
+ top: 0,
456
+ }
457
+ const bounds = ref<ComponentInspectorBounds>(initialBounds)
458
+
459
+ function highlight(_name: string, _bounds: ComponentInspectorBounds) {
460
+ name.value = _name
461
+ bounds.value = _bounds
462
+ overlayVisible.value = true
463
+ }
464
+
465
+ function unHighlight() {
466
+ bounds.value = initialBounds
467
+ overlayVisible.value = false
468
+ }
469
+
470
+ return {
471
+ name,
472
+ overlayVisible,
473
+ bounds,
474
+ highlight,
475
+ unHighlight,
476
+ }
477
+ }