vite-plugin-vue-devtools 0.4.10 → 0.4.12
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.
- package/README.md +9 -2
- package/dist/client/assets/{IframeView.vue_vue_type_script_setup_true_lang-e86027e5.js → IframeView.vue_vue_type_script_setup_true_lang-97a0e754.js} +1 -1
- package/dist/client/assets/{StateFields.vue_vue_type_script_setup_true_lang-a78e5cb0.js → StateFields.vue_vue_type_script_setup_true_lang-dd6974e1.js} +8 -8
- package/dist/client/assets/{VIcon.vue_vue_type_script_setup_true_lang-82a30fea.js → VIcon.vue_vue_type_script_setup_true_lang-4dcb121c.js} +1 -1
- package/dist/client/assets/{VIconButton.vue_vue_type_script_setup_true_lang-fe1578eb.js → VIconButton.vue_vue_type_script_setup_true_lang-4054707d.js} +2 -2
- package/dist/client/assets/{VIconTitle.vue_vue_type_script_setup_true_lang-53c720d3.js → VIconTitle.vue_vue_type_script_setup_true_lang-4531a0e4.js} +1 -1
- package/dist/client/assets/{VPanelGrids-dc69b639.js → VPanelGrids-ea9ac4bd.js} +1 -1
- package/dist/client/assets/{VSectionBlock-57ec7b68.js → VSectionBlock-0d870ae2.js} +3 -3
- package/dist/client/assets/VSwitch.vue_vue_type_script_setup_true_lang-dc4a336f.js +88 -0
- package/dist/client/assets/{VTextInput.vue_vue_type_script_setup_true_lang-c7c2878d.js → VTextInput.vue_vue_type_script_setup_true_lang-cd591fdb.js} +2 -2
- package/dist/client/assets/__eyedropper-41422dc8.js +132 -0
- package/dist/client/assets/{assets-2b8518ac.js → assets-fc847d7b.js} +17 -10
- package/dist/client/assets/component-docs-b0456b1b.js +1748 -0
- package/dist/client/assets/{components-433e30b5.js → components-41827ea5.js} +7 -7
- package/dist/client/assets/{documentations-a41234ba.js → documentations-e948ad25.js} +3 -3
- package/dist/client/assets/{graph-d61217d6.js → graph-ed9ec08f.js} +2422 -61
- package/dist/client/assets/index-8135098e.css +474 -0
- package/dist/client/assets/{index-b8a9099c.js → index-d268ce4d.js} +1019 -2617
- package/dist/client/assets/{index-07396aec.js → index-fb7e673c.js} +5 -2
- package/dist/client/assets/{inspect-2b7bf157.js → inspect-4e046378.js} +3 -3
- package/dist/client/assets/npm-81f351e2.js +537 -0
- package/dist/client/assets/{npm-125f4259.css → npm-832f3f2c.css} +20 -2
- package/dist/client/assets/{overview-95247458.js → overview-9d7f0c3c.js} +5 -5
- package/dist/client/assets/{pages-72e88bdb.js → pages-7d46ae82.js} +5 -5
- package/dist/client/assets/{pinia-55c3fcd8.js → pinia-c576b594.js} +6 -6
- package/dist/client/assets/{routes-ab38a14f.js → routes-56017e0a.js} +7 -7
- package/dist/client/assets/{rpc-cf3bd0fc.js → rpc-6c4cc8d5.js} +1 -1
- package/dist/client/assets/{settings-c390240d.js → settings-4e36485a.js} +36 -119
- package/dist/client/assets/{splitpanes.es-dd27b7fe.js → splitpanes.es-db7e975b.js} +1 -1
- package/dist/client/assets/{timeline-5fa02442.js → timeline-0fd22aff.js} +8 -8
- package/dist/client/index.html +2 -2
- package/dist/index.cjs +1238 -1162
- package/dist/index.mjs +1235 -1159
- package/package.json +35 -31
- package/src/node/views/Main.vue +9 -2
- package/src/node/views/composables.ts +26 -1
- package/src/node/views/utils.ts +4 -0
- package/dist/client/assets/__eyedropper-c3a23916.js +0 -112
- package/dist/client/assets/component-docs-e06030af.js +0 -1748
- package/dist/client/assets/index-5221558c.css +0 -472
- 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.
|
|
4
|
-
"packageManager": "pnpm@8.
|
|
3
|
+
"version": "0.4.12",
|
|
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
|
|
60
|
-
"@vueuse/integrations": "^10.2.
|
|
60
|
+
"@vueuse/core": "^10.2.1",
|
|
61
|
+
"@vueuse/integrations": "^10.2.1",
|
|
61
62
|
"@webfansplz/vuedoc-parser": "^0.0.3",
|
|
62
|
-
"algoliasearch": "^4.
|
|
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.
|
|
71
|
+
"vanilla-jsoneditor": "^0.17.8",
|
|
70
72
|
"vite-hot-client": "^0.2.1",
|
|
71
|
-
"vite-plugin-inspect": "^0.7.
|
|
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
|
|
77
|
+
"xterm": "^5.2.1",
|
|
76
78
|
"xterm-addon-fit": "^0.7.0"
|
|
77
79
|
},
|
|
78
80
|
"devDependencies": {
|
|
79
|
-
"@algolia/client-search": "^4.
|
|
80
|
-
"@antfu/eslint-config": "^0.
|
|
81
|
-
"@antfu/ni": "^0.21.
|
|
82
|
-
"@iconify/json": "^2.2.
|
|
83
|
-
"@nuxt/devtools-ui-kit": "^0.
|
|
84
|
-
"@types/codemirror": "^5.60.
|
|
85
|
-
"@types/node": "^20.
|
|
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.
|
|
88
|
-
"@unocss/reset": "^0.
|
|
89
|
+
"@unocss/eslint-config": "^0.53.4",
|
|
90
|
+
"@unocss/reset": "^0.53.4",
|
|
89
91
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
90
|
-
"
|
|
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.
|
|
94
|
-
"eslint": "8.
|
|
95
|
-
"fast-glob": "^3.
|
|
96
|
-
"floating-vue": "2.0.0-beta.
|
|
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.
|
|
102
|
+
"lint-staged": "^13.2.3",
|
|
100
103
|
"npm-run-all": "^4.1.5",
|
|
101
104
|
"ohash": "^1.1.2",
|
|
102
|
-
"pathe": "^1.1.
|
|
103
|
-
"pinia": "^2.1.
|
|
104
|
-
"pnpm": "^8.6.
|
|
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
|
-
"
|
|
110
|
+
"taze": "^0.11.2",
|
|
111
|
+
"typescript": "^5.1.6",
|
|
108
112
|
"unbuild": "^1.2.1",
|
|
109
|
-
"unocss": "^0.
|
|
113
|
+
"unocss": "^0.53.4",
|
|
110
114
|
"unplugin-auto-import": "^0.16.4",
|
|
111
|
-
"unplugin-vue-components": "^0.25.
|
|
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.
|
|
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
|
},
|
package/src/node/views/Main.vue
CHANGED
|
@@ -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 {
|
|
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
|
|
package/src/node/views/utils.ts
CHANGED
|
@@ -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)
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { _ as __unplugin_components_0 } from './VPanelGrids-dc69b639.js';
|
|
2
|
-
import { v as defineComponent, cw as useRouter, a$ as ref, cd as useEventListener, aP as onMounted, o as openBlock, c as createBlock, h as withCtx, x as createBaseVNode, z as unref, e as createElementBlock, l as normalizeStyle, a9 as createTextVNode, y as toDisplayString, cx as useDevtoolsClient, bY as useFrameState } from './index-b8a9099c.js';
|
|
3
|
-
|
|
4
|
-
const _hoisted_1 = { key: 0 };
|
|
5
|
-
const _hoisted_2 = {
|
|
6
|
-
key: 1,
|
|
7
|
-
flex: "",
|
|
8
|
-
"items-center": ""
|
|
9
|
-
};
|
|
10
|
-
const _hoisted_3 = {
|
|
11
|
-
flex: "",
|
|
12
|
-
"items-center": ""
|
|
13
|
-
};
|
|
14
|
-
const _hoisted_4 = /* @__PURE__ */ createBaseVNode("i", {
|
|
15
|
-
class: "i-mdi:eyedropper",
|
|
16
|
-
"text-3": ""
|
|
17
|
-
}, null, -1);
|
|
18
|
-
const _hoisted_5 = [
|
|
19
|
-
_hoisted_4
|
|
20
|
-
];
|
|
21
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
22
|
-
__name: "__eyedropper",
|
|
23
|
-
setup(__props) {
|
|
24
|
-
const client = useDevtoolsClient();
|
|
25
|
-
const frameState = useFrameState();
|
|
26
|
-
const router = useRouter();
|
|
27
|
-
const color = ref("");
|
|
28
|
-
useEventListener("keydown", (e) => {
|
|
29
|
-
if (e.key === "Escape")
|
|
30
|
-
close();
|
|
31
|
-
});
|
|
32
|
-
function close() {
|
|
33
|
-
client.value?.panel?.toggleViewMode();
|
|
34
|
-
router.replace(frameState.route.value);
|
|
35
|
-
}
|
|
36
|
-
async function open() {
|
|
37
|
-
const eyeDropper = new EyeDropper();
|
|
38
|
-
return eyeDropper.open();
|
|
39
|
-
}
|
|
40
|
-
async function restart() {
|
|
41
|
-
color.value = "";
|
|
42
|
-
open().then((res) => {
|
|
43
|
-
color.value = res.sRGBHex;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
onMounted(() => {
|
|
47
|
-
open().then((res) => {
|
|
48
|
-
color.value = res.sRGBHex;
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
return (_ctx, _cache) => {
|
|
52
|
-
const _component_VPanelGrids = __unplugin_components_0;
|
|
53
|
-
return openBlock(), createBlock(_component_VPanelGrids, {
|
|
54
|
-
"h-screen": "",
|
|
55
|
-
"w-screen": "",
|
|
56
|
-
px5: ""
|
|
57
|
-
}, {
|
|
58
|
-
default: withCtx(() => [
|
|
59
|
-
createBaseVNode("div", {
|
|
60
|
-
absolute: "",
|
|
61
|
-
"right-0": "",
|
|
62
|
-
"top-0": "",
|
|
63
|
-
p2: ""
|
|
64
|
-
}, [
|
|
65
|
-
createBaseVNode("button", {
|
|
66
|
-
"carbon-close": "",
|
|
67
|
-
ma: "",
|
|
68
|
-
"text-xl": "",
|
|
69
|
-
op50: "",
|
|
70
|
-
"hover:op100": "",
|
|
71
|
-
onClick: close
|
|
72
|
-
})
|
|
73
|
-
]),
|
|
74
|
-
!unref(color) ? (openBlock(), createElementBlock("div", _hoisted_1, " Launching EyeDropper ")) : (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
75
|
-
createBaseVNode("span", _hoisted_3, [
|
|
76
|
-
createBaseVNode("em", {
|
|
77
|
-
"mr-2": "",
|
|
78
|
-
"inline-block": "",
|
|
79
|
-
"h-5": "",
|
|
80
|
-
"w-5": "",
|
|
81
|
-
border: "",
|
|
82
|
-
"border-base": "",
|
|
83
|
-
rounded: "",
|
|
84
|
-
style: normalizeStyle({ backgroundColor: unref(color) })
|
|
85
|
-
}, null, 4),
|
|
86
|
-
createTextVNode(" : " + toDisplayString(unref(color)), 1)
|
|
87
|
-
]),
|
|
88
|
-
createBaseVNode("span", {
|
|
89
|
-
"ml-2": "",
|
|
90
|
-
flex: "",
|
|
91
|
-
"cursor-pointer": "",
|
|
92
|
-
"items-center": "",
|
|
93
|
-
border: "",
|
|
94
|
-
"border-base": "",
|
|
95
|
-
"rounded-10": "",
|
|
96
|
-
"p-2": "",
|
|
97
|
-
hover: "bg-active",
|
|
98
|
-
onClick: restart
|
|
99
|
-
}, _hoisted_5)
|
|
100
|
-
]))
|
|
101
|
-
]),
|
|
102
|
-
_: 1
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
/* Injected with object hook! */
|
|
109
|
-
|
|
110
|
-
/* Injected with object hook! */
|
|
111
|
-
|
|
112
|
-
export { _sfc_main as default };
|