vite-plugin-vue-devtools 0.4.10 → 0.4.11

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 (40) hide show
  1. package/README.md +9 -2
  2. package/dist/client/assets/{IframeView.vue_vue_type_script_setup_true_lang-e86027e5.js → IframeView.vue_vue_type_script_setup_true_lang-fd720d18.js} +1 -1
  3. package/dist/client/assets/{StateFields.vue_vue_type_script_setup_true_lang-a78e5cb0.js → StateFields.vue_vue_type_script_setup_true_lang-0e4af331.js} +8 -8
  4. package/dist/client/assets/{VIcon.vue_vue_type_script_setup_true_lang-82a30fea.js → VIcon.vue_vue_type_script_setup_true_lang-d1646658.js} +1 -1
  5. package/dist/client/assets/{VIconButton.vue_vue_type_script_setup_true_lang-fe1578eb.js → VIconButton.vue_vue_type_script_setup_true_lang-5c7fa25b.js} +2 -2
  6. package/dist/client/assets/{VIconTitle.vue_vue_type_script_setup_true_lang-53c720d3.js → VIconTitle.vue_vue_type_script_setup_true_lang-3af9d81d.js} +1 -1
  7. package/dist/client/assets/{VPanelGrids-dc69b639.js → VPanelGrids-08ef47ce.js} +1 -1
  8. package/dist/client/assets/{VSectionBlock-57ec7b68.js → VSectionBlock-44a9204b.js} +3 -3
  9. package/dist/client/assets/VSwitch.vue_vue_type_script_setup_true_lang-b1b6daad.js +88 -0
  10. package/dist/client/assets/{VTextInput.vue_vue_type_script_setup_true_lang-c7c2878d.js → VTextInput.vue_vue_type_script_setup_true_lang-4df2a1eb.js} +2 -2
  11. package/dist/client/assets/{__eyedropper-c3a23916.js → __eyedropper-9aeb7406.js} +2 -2
  12. package/dist/client/assets/{assets-2b8518ac.js → assets-4ff4283a.js} +17 -10
  13. package/dist/client/assets/component-docs-1e5f0727.js +1748 -0
  14. package/dist/client/assets/{components-433e30b5.js → components-5011f272.js} +7 -7
  15. package/dist/client/assets/{documentations-a41234ba.js → documentations-ec90fa66.js} +3 -3
  16. package/dist/client/assets/{graph-d61217d6.js → graph-c8cae02e.js} +2422 -61
  17. package/dist/client/assets/{index-07396aec.js → index-37b80b18.js} +1 -1
  18. package/dist/client/assets/{index-b8a9099c.js → index-793e4620.js} +1019 -2617
  19. package/dist/client/assets/index-ee2ca8be.css +474 -0
  20. package/dist/client/assets/{inspect-2b7bf157.js → inspect-c464cac5.js} +3 -3
  21. package/dist/client/assets/{npm-125f4259.css → npm-832f3f2c.css} +20 -2
  22. package/dist/client/assets/npm-de038c5b.js +537 -0
  23. package/dist/client/assets/{overview-95247458.js → overview-fc79467d.js} +5 -5
  24. package/dist/client/assets/{pages-72e88bdb.js → pages-d51e51ec.js} +5 -5
  25. package/dist/client/assets/{pinia-55c3fcd8.js → pinia-e230dd12.js} +6 -6
  26. package/dist/client/assets/{routes-ab38a14f.js → routes-7d3d04cf.js} +7 -7
  27. package/dist/client/assets/{rpc-cf3bd0fc.js → rpc-d8afe028.js} +1 -1
  28. package/dist/client/assets/{settings-c390240d.js → settings-2e4656aa.js} +36 -119
  29. package/dist/client/assets/{splitpanes.es-dd27b7fe.js → splitpanes.es-8a68d356.js} +1 -1
  30. package/dist/client/assets/{timeline-5fa02442.js → timeline-202ca852.js} +8 -8
  31. package/dist/client/index.html +2 -2
  32. package/dist/index.cjs +1238 -1162
  33. package/dist/index.mjs +1235 -1159
  34. package/package.json +35 -31
  35. package/src/node/views/Main.vue +9 -2
  36. package/src/node/views/composables.ts +26 -1
  37. package/src/node/views/utils.ts +4 -0
  38. package/dist/client/assets/component-docs-e06030af.js +0 -1748
  39. package/dist/client/assets/index-5221558c.css +0 -472
  40. package/dist/client/assets/npm-62fb6b03.js +0 -537
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-vue-devtools",
3
- "version": "0.4.10",
4
- "packageManager": "pnpm@8.4.0",
3
+ "version": "0.4.11",
4
+ "packageManager": "pnpm@8.6.5",
5
5
  "description": "A vite plugin for Vue Devtools",
6
6
  "author": "webfansplz",
7
7
  "license": "MIT",
@@ -50,70 +50,74 @@
50
50
  "stub": "unbuild --stub",
51
51
  "lint": "eslint .",
52
52
  "prepublishOnly": "npm run build",
53
- "release": "bumpp && npm publish"
53
+ "release": "bumpp && npm publish",
54
+ "dep:up": "taze -I major"
54
55
  },
55
56
  "peerDependencies": {
56
57
  "vite": "^3.0.0-0 || ^4.0.0-0"
57
58
  },
58
59
  "dependencies": {
59
- "@vueuse/core": "^10.1.2",
60
- "@vueuse/integrations": "^10.2.0",
60
+ "@vueuse/core": "^10.2.1",
61
+ "@vueuse/integrations": "^10.2.1",
61
62
  "@webfansplz/vuedoc-parser": "^0.0.3",
62
- "algoliasearch": "^4.17.1",
63
+ "algoliasearch": "^4.18.0",
63
64
  "birpc": "^0.2.12",
64
65
  "execa": "^7.1.1",
65
66
  "json-editor-vue": "^0.10.6",
67
+ "minimatch": "^9.0.2",
66
68
  "nanoid": "^4.0.2",
67
69
  "sirv": "^2.0.3",
68
70
  "splitpanes": "^3.1.5",
69
- "vanilla-jsoneditor": "^0.17.5",
71
+ "vanilla-jsoneditor": "^0.17.8",
70
72
  "vite-hot-client": "^0.2.1",
71
- "vite-plugin-inspect": "^0.7.28",
73
+ "vite-plugin-inspect": "^0.7.32",
72
74
  "vite-plugin-vue-inspector": "^3.4.2",
73
75
  "vue-router": "^4.2.2",
74
76
  "vuedraggable": "^4.1.0",
75
- "xterm": "^5.1.0",
77
+ "xterm": "^5.2.1",
76
78
  "xterm-addon-fit": "^0.7.0"
77
79
  },
78
80
  "devDependencies": {
79
- "@algolia/client-search": "^4.17.1",
80
- "@antfu/eslint-config": "^0.38.5",
81
- "@antfu/ni": "^0.21.3",
82
- "@iconify/json": "^2.2.71",
83
- "@nuxt/devtools-ui-kit": "^0.5.5",
84
- "@types/codemirror": "^5.60.7",
85
- "@types/node": "^20.2.5",
81
+ "@algolia/client-search": "^4.18.0",
82
+ "@antfu/eslint-config": "^0.39.6",
83
+ "@antfu/ni": "^0.21.4",
84
+ "@iconify/json": "^2.2.85",
85
+ "@nuxt/devtools-ui-kit": "^0.6.6",
86
+ "@types/codemirror": "^5.60.8",
87
+ "@types/node": "^20.3.3",
86
88
  "@types/splitpanes": "^2.2.1",
87
- "@unocss/eslint-config": "^0.52.5",
88
- "@unocss/reset": "^0.52.5",
89
+ "@unocss/eslint-config": "^0.53.4",
90
+ "@unocss/reset": "^0.53.4",
89
91
  "@vitejs/plugin-vue": "^4.2.3",
90
- "bumpp": "^9.1.0",
92
+ "@vitejs/plugin-vue-jsx": "^3.0.1",
93
+ "bumpp": "^9.1.1",
91
94
  "codemirror": "^6.0.1",
92
95
  "codemirror-theme-vars": "^0.1.2",
93
- "dayjs": "^1.11.7",
94
- "eslint": "8.38.0",
95
- "fast-glob": "^3.2.12",
96
- "floating-vue": "2.0.0-beta.20",
96
+ "dayjs": "^1.11.9",
97
+ "eslint": "8.44.0",
98
+ "fast-glob": "^3.3.0",
99
+ "floating-vue": "2.0.0-beta.24",
97
100
  "fuse.js": "^6.6.2",
98
101
  "image-meta": "^0.1.1",
99
- "lint-staged": "^13.2.2",
102
+ "lint-staged": "^13.2.3",
100
103
  "npm-run-all": "^4.1.5",
101
104
  "ohash": "^1.1.2",
102
- "pathe": "^1.1.0",
103
- "pinia": "^2.1.3",
104
- "pnpm": "^8.6.0",
105
+ "pathe": "^1.1.1",
106
+ "pinia": "^2.1.4",
107
+ "pnpm": "^8.6.5",
105
108
  "rimraf": "^5.0.1",
106
109
  "simple-git-hooks": "^2.8.1",
107
- "typescript": "^5.0.4",
110
+ "taze": "^0.11.2",
111
+ "typescript": "^5.1.6",
108
112
  "unbuild": "^1.2.1",
109
- "unocss": "^0.52.5",
113
+ "unocss": "^0.53.4",
110
114
  "unplugin-auto-import": "^0.16.4",
111
- "unplugin-vue-components": "^0.25.0",
115
+ "unplugin-vue-components": "^0.25.1",
112
116
  "vis-data": "^7.1.6",
113
117
  "vis-network": "^9.1.6",
114
118
  "vite": "^4.3.9",
115
119
  "vite-dev-rpc": "^0.1.2",
116
- "vite-plugin-pages": "^0.30.1",
120
+ "vite-plugin-pages": "^0.31.0",
117
121
  "vue": "^3.3.4",
118
122
  "vue-virtual-scroller": "2.0.0-beta.8"
119
123
  },
@@ -5,7 +5,7 @@ import { computed, ref } from 'vue'
5
5
  import vueDevToolsOptions from 'virtual:vue-devtools-options'
6
6
  import Frame from './FrameBox.vue'
7
7
  import { useIframe, useInspector, usePanelVisible, usePiPMode, usePosition } from './composables'
8
- import { checkIsSafari, useColorScheme, usePreferredColorScheme } from './utils'
8
+ import { checkIsSafari, useColorScheme, usePreferredColorScheme, warn } from './utils'
9
9
 
10
10
  const props = defineProps({
11
11
  hook: {
@@ -76,6 +76,7 @@ function waitForClientInjection(iframe: HTMLIFrameElement, retry = 50, timeout =
76
76
  const {
77
77
  toggleInspector, inspectorLoaded,
78
78
  inspectorEnabled, disableInspector,
79
+ openInEditor, waitForInspectorInit,
79
80
  } = useInspector()
80
81
 
81
82
  const clientUrl = `${vueDevToolsOptions.base || '/'}__devtools__/`
@@ -88,8 +89,11 @@ const { iframe, getIframe } = useIframe(clientUrl, async () => {
88
89
  // Picture-in-Picture mode
89
90
  const { popup } = usePiPMode(getIframe, hook)
90
91
 
91
- function setupClient(iframe: HTMLIFrameElement) {
92
+ async function setupClient(iframe: HTMLIFrameElement) {
92
93
  const injection: any = iframe?.contentWindow?.__VUE_DEVTOOLS_VIEW__
94
+ if (!inspectorLoaded.value)
95
+ waitForInspectorInit()
96
+
93
97
  injection.setClient({
94
98
  hook,
95
99
  hookBuffer,
@@ -110,6 +114,9 @@ function setupClient(iframe: HTMLIFrameElement) {
110
114
  popup()
111
115
  },
112
116
  },
117
+ openInEditor: openInEditor.value ?? (() => {
118
+ warn('Unable to load inspector, open-in-editor is not available.')
119
+ }),
113
120
  })
114
121
  }
115
122
 
@@ -1,6 +1,7 @@
1
1
  import { computed, onMounted, reactive, ref, shallowRef, watchEffect } from 'vue'
2
2
  import type { CSSProperties, Ref } from 'vue'
3
- import { clamp, useObjectStorage, useScreenSafeArea, useWindowEventListener } from './utils'
3
+ import type { OpenInEditorFn } from '../../types'
4
+ import { clamp, useObjectStorage, useScreenSafeArea, useWindowEventListener, warn } from './utils'
4
5
 
5
6
  interface DevToolsFrameState {
6
7
  width: number
@@ -54,6 +55,8 @@ export function useIframe(clientUrl: string, onLoad: () => void) {
54
55
  }
55
56
 
56
57
  // ---- useInspector ----
58
+ type OpenInEditorFnFromPlugin = (baseUrl: string, filePath: string, line?: number, column?: number) => any
59
+
57
60
  export function useInspector() {
58
61
  const inspectorEnabled = ref(false)
59
62
  const inspectorLoaded = ref(false)
@@ -68,6 +71,19 @@ export function useInspector() {
68
71
  inspectorEnabled.value = false
69
72
  }
70
73
 
74
+ const openInEditor = ref<OpenInEditorFn>()
75
+
76
+ const getBaseUrl = () => {
77
+ const { protocol, hostname, port } = window.location
78
+ return `${protocol}//${hostname}:${port}`
79
+ }
80
+
81
+ const registerOpenInEditor = (openInEditorFn: OpenInEditorFnFromPlugin) => {
82
+ openInEditor.value = (filePath: string, line?: number, column?: number) => {
83
+ openInEditorFn(getBaseUrl(), filePath, line ?? 1, column ?? 1)
84
+ }
85
+ }
86
+
71
87
  const setupInspector = () => {
72
88
  const componentInspector = window.__VUE_INSPECTOR__
73
89
  if (componentInspector) {
@@ -76,15 +92,22 @@ export function useInspector() {
76
92
  disable()
77
93
  _openInEditor(...params)
78
94
  }
95
+ registerOpenInEditor(_openInEditor)
79
96
  }
80
97
  }
81
98
 
82
99
  const waitForInspectorInit = () => {
100
+ let total = 0
83
101
  const timer = setInterval(() => {
84
102
  if (window.__VUE_INSPECTOR__) {
85
103
  clearInterval(timer)
86
104
  inspectorLoaded.value = true
87
105
  setupInspector()
106
+ total += 30
107
+ }
108
+ if (total >=/* 2s */ 2000) {
109
+ clearInterval(timer)
110
+ warn('Unable to load inspector')
88
111
  }
89
112
  }, 30)
90
113
  }
@@ -109,6 +132,8 @@ export function useInspector() {
109
132
  disableInspector: disable,
110
133
  setupInspector,
111
134
  inspectorLoaded,
135
+ openInEditor,
136
+ waitForInspectorInit,
112
137
  }
113
138
  }
114
139
 
@@ -9,6 +9,10 @@ export function tryOnScopeDispose(fn: () => void) {
9
9
  onScopeDispose(fn)
10
10
  }
11
11
 
12
+ export function warn(message: string) {
13
+ console.warn(`[vite-plugin-vue-devtools] ${message}`)
14
+ }
15
+
12
16
  // ---- storage ----
13
17
  export function useObjectStorage<T>(key: string, initial: T, readonly = false): Ref<T> {
14
18
  const raw = localStorage.getItem(key)