vite-plugin-vue-devtools 0.0.4 → 0.0.6
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 +1 -1
- package/dist/client/assets/{VCard-d5dce5dc.js → VCard-365cd722.js} +1 -1
- package/dist/client/assets/{VIcon.vue_vue_type_script_setup_true_lang-86e98dd0.js → VIcon.vue_vue_type_script_setup_true_lang-d879f03a.js} +1 -1
- package/dist/client/assets/{VIconTitle.vue_vue_type_script_setup_true_lang-6bf4d2c5.js → VIconTitle.vue_vue_type_script_setup_true_lang-7e3b636a.js} +1 -1
- package/dist/client/assets/{VPanelGrids-01802272.js → VPanelGrids-e269e398.js} +1 -1
- package/dist/client/assets/{VTextInput.vue_vue_type_script_setup_true_lang-2730be3e.js → VTextInput.vue_vue_type_script_setup_true_lang-fd84d253.js} +3 -3
- package/dist/client/assets/{__inspecting-1d8af17f.js → __inspecting-dcdfea86.js} +2 -2
- package/dist/client/assets/{assets-bdd87b4e.js → assets-43c4f03a.js} +7 -7
- package/dist/client/assets/{components-f3ebd9fc.js → components-a684c153.js} +96 -5
- package/dist/client/assets/{graph-298bd1af.js → graph-b4acfb90.js} +2 -5
- package/dist/client/assets/{index-0fe3b68e.js → index-2a1677bb.js} +38 -198
- package/dist/client/assets/index-56f266d3.js +45 -0
- package/dist/client/assets/{index-f0fa9f81.css → index-62a10721.css} +1 -1
- package/dist/client/assets/{inspect-fc04f168.js → inspect-83db2b32.js} +2 -2
- package/dist/client/assets/{overview-4c38bb9d.js → overview-bd834aea.js} +10 -8
- package/dist/client/assets/{pages-332f4308.js → pages-b9188b20.js} +4 -4
- package/dist/client/assets/{pinia-c92015f4.js → pinia-9d62859f.js} +4 -4
- package/dist/client/assets/{routes-42ec2b9a.js → routes-71c9bb6b.js} +6 -5
- package/dist/client/assets/{rpc-a3180d73.js → rpc-8cf8610c.js} +1 -1
- package/dist/client/assets/{settings-b9471d84.js → settings-a29fd3d3.js} +8 -9
- package/dist/client/assets/{splitpanes.es-dcbb9776.js → splitpanes.es-c6654cbc.js} +3 -40
- package/dist/client/assets/{timeline-9e30477c.js → timeline-6ffbb5a9.js} +6 -5
- package/dist/client/index.html +2 -2
- package/package.json +2 -2
- package/src/node/Container.vue +127 -13
- package/src/node/app.js +4 -4
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { g, M, _ as _sfc_main$2 } from './splitpanes.es-
|
|
2
|
-
import { _ as __unplugin_components_0 } from './VPanelGrids-
|
|
3
|
-
import { _ as __unplugin_components_7 } from './VCard-
|
|
4
|
-
import { p as pushScopeId, a as popScopeId, n as nextTick, o as openBlock, c as createBlock, w as withScopeId, m as markRaw, s as shallowReactive, r as resolveComponent, b as resolveDirective, d as withDirectives, e as createElementBlock, f as renderSlot, g as createCommentVNode, h as withCtx, F as Fragment, i as renderList, j as resolveDynamicComponent, k as mergeProps, t as toHandlers, l as normalizeStyle, q as normalizeClass, u as createVNode, v as defineComponent, x as createBaseVNode, y as toDisplayString, z as unref, A as onMounted, B as onUnmounted, C as timelineLayer, D as activeTimelineEvents, E as activeTimelineEventIndex, G as toggleTimelineEventIndex, H as timelineEventDetails, I as activeLayerId, J as toggleTimelineLayer } from './index-
|
|
5
|
-
import './VIcon.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { g, M, _ as _sfc_main$2 } from './splitpanes.es-c6654cbc.js';
|
|
2
|
+
import { _ as __unplugin_components_0 } from './VPanelGrids-e269e398.js';
|
|
3
|
+
import { _ as __unplugin_components_7 } from './VCard-365cd722.js';
|
|
4
|
+
import { p as pushScopeId, a as popScopeId, n as nextTick, o as openBlock, c as createBlock, w as withScopeId, m as markRaw, s as shallowReactive, r as resolveComponent, b as resolveDirective, d as withDirectives, e as createElementBlock, f as renderSlot, g as createCommentVNode, h as withCtx, F as Fragment, i as renderList, j as resolveDynamicComponent, k as mergeProps, t as toHandlers, l as normalizeStyle, q as normalizeClass, u as createVNode, v as defineComponent, x as createBaseVNode, y as toDisplayString, z as unref, A as onMounted, B as onUnmounted, C as timelineLayer, D as activeTimelineEvents, E as activeTimelineEventIndex, G as toggleTimelineEventIndex, H as timelineEventDetails, I as activeLayerId, J as toggleTimelineLayer } from './index-2a1677bb.js';
|
|
5
|
+
import './VIcon.vue_vue_type_script_setup_true_lang-d879f03a.js';
|
|
6
|
+
import './index-56f266d3.js';
|
|
6
7
|
|
|
7
8
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
8
9
|
|
package/dist/client/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
7
7
|
<title>Vue Devtools</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
9
|
-
<link rel="stylesheet" href="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-2a1677bb.js"></script>
|
|
9
|
+
<link rel="stylesheet" href="./assets/index-62a10721.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-vue-devtools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"packageManager": "pnpm@8.4.0",
|
|
5
5
|
"description": "A vite plugin for Vue Devtools",
|
|
6
6
|
"author": "webfansplz",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dev:client": "vite build src/client --watch",
|
|
48
48
|
"play": "nr -C playground dev",
|
|
49
49
|
"stub": "unbuild --stub",
|
|
50
|
-
"lint": "eslint .
|
|
50
|
+
"lint": "eslint .",
|
|
51
51
|
"prepublishOnly": "npm run build",
|
|
52
52
|
"release": "bumpp && npm publish"
|
|
53
53
|
},
|
package/src/node/Container.vue
CHANGED
|
@@ -12,6 +12,20 @@ window.__VUE_DEVTOOLS_GLOBAL_HOOKS__ = function () {
|
|
|
12
12
|
return props.hook
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
const isDragging = ref(false)
|
|
16
|
+
|
|
17
|
+
document.addEventListener('mouseup', () => {
|
|
18
|
+
isDragging.value = false
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
document.addEventListener('mouseleave', () => {
|
|
22
|
+
isDragging.value = false
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const PANEL_MIN = 15
|
|
26
|
+
const PANEL_MAX = 100
|
|
27
|
+
const PANEL_PADDING = 10
|
|
28
|
+
|
|
15
29
|
const clientUrl = `${vueDevtoolsOptions.base || '/'}__devtools/`
|
|
16
30
|
const iframe = ref()
|
|
17
31
|
const panelState = ref({
|
|
@@ -21,10 +35,16 @@ const panelState = ref({
|
|
|
21
35
|
const panelVisible = ref(false)
|
|
22
36
|
const hookBuffer = []
|
|
23
37
|
let isAppCreated = false
|
|
38
|
+
|
|
39
|
+
const panelHight = ref(60)
|
|
40
|
+
const panelWidth = ref(80)
|
|
41
|
+
|
|
24
42
|
const panelStyle = computed(() => {
|
|
43
|
+
const height = `calc(${panelHight.value}vh - ${PANEL_PADDING}px)`
|
|
44
|
+
const width = `calc(${panelWidth.value}vw - ${PANEL_PADDING}px)`
|
|
25
45
|
if (panelState.value.viewMode === 'component-inspector') {
|
|
26
46
|
return {
|
|
27
|
-
bottom:
|
|
47
|
+
bottom: `${PANEL_PADDING}px`,
|
|
28
48
|
left: '50%',
|
|
29
49
|
transform: 'translateX(-50%)',
|
|
30
50
|
height: '80px',
|
|
@@ -35,29 +55,37 @@ const panelStyle = computed(() => {
|
|
|
35
55
|
if (panelState.value.position === 'bottom') {
|
|
36
56
|
return {
|
|
37
57
|
transform: 'translateX(-50%)',
|
|
38
|
-
bottom:
|
|
58
|
+
bottom: `${PANEL_PADDING}px`,
|
|
39
59
|
left: '50%',
|
|
60
|
+
height,
|
|
61
|
+
width,
|
|
40
62
|
}
|
|
41
63
|
}
|
|
42
64
|
else if (panelState.value.position === 'top') {
|
|
43
65
|
return {
|
|
44
66
|
transform: 'translateX(-50%)',
|
|
45
|
-
top:
|
|
67
|
+
top: `${PANEL_PADDING}px`,
|
|
46
68
|
left: '50%',
|
|
69
|
+
height,
|
|
70
|
+
width,
|
|
47
71
|
}
|
|
48
72
|
}
|
|
49
73
|
else if (panelState.value.position === 'left') {
|
|
50
74
|
return {
|
|
51
75
|
transform: 'translateY(-50%)',
|
|
52
76
|
top: '50%',
|
|
53
|
-
left:
|
|
77
|
+
left: `${PANEL_PADDING}px`,
|
|
78
|
+
height,
|
|
79
|
+
width,
|
|
54
80
|
}
|
|
55
81
|
}
|
|
56
82
|
else {
|
|
57
83
|
return {
|
|
58
84
|
transform: 'translateY(-50%)',
|
|
59
85
|
top: '50%',
|
|
60
|
-
right:
|
|
86
|
+
right: `${PANEL_PADDING}px`,
|
|
87
|
+
height,
|
|
88
|
+
width,
|
|
61
89
|
}
|
|
62
90
|
}
|
|
63
91
|
})
|
|
@@ -101,7 +129,40 @@ const toggleButtonPosition = computed(() => {
|
|
|
101
129
|
'--hover-translate': 'translate(0, -3px)',
|
|
102
130
|
}
|
|
103
131
|
})
|
|
104
|
-
const panelPosition = computed(() =>
|
|
132
|
+
const panelPosition = computed(() =>
|
|
133
|
+
panelVisible.value
|
|
134
|
+
? panelStyle.value
|
|
135
|
+
: { zIndex: -100000, left: '-9999px', top: '-9999px' },
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
document.addEventListener('mousemove', (e) => {
|
|
139
|
+
if (!isDragging.value)
|
|
140
|
+
return
|
|
141
|
+
|
|
142
|
+
const alignSide = panelState.value.position === 'left' || panelState.value.position === 'right'
|
|
143
|
+
|
|
144
|
+
if (isDragging.value === 'horizontal' || isDragging.value === 'both') {
|
|
145
|
+
const y = panelState.value.position === 'top'
|
|
146
|
+
? window.innerHeight - e.clientY
|
|
147
|
+
: e.clientY
|
|
148
|
+
const boxHeight = window.innerHeight
|
|
149
|
+
const value = alignSide
|
|
150
|
+
? (Math.abs(y - (window.innerHeight / 2))) / boxHeight * 100 * 2
|
|
151
|
+
: (window.innerHeight - y) / boxHeight * 100
|
|
152
|
+
panelHight.value = Math.min(PANEL_MAX, Math.max(PANEL_MIN, value))
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (isDragging.value === 'vertical' || isDragging.value === 'both') {
|
|
156
|
+
const x = panelState.value.position === 'left'
|
|
157
|
+
? window.innerWidth - e.clientX
|
|
158
|
+
: e.clientX
|
|
159
|
+
const boxWidth = window.innerWidth
|
|
160
|
+
const value = alignSide
|
|
161
|
+
? (window.innerWidth - x) / boxWidth * 100
|
|
162
|
+
: (Math.abs(x - (window.innerWidth / 2))) / boxWidth * 100 * 2
|
|
163
|
+
panelWidth.value = Math.min(PANEL_MAX, Math.max(PANEL_MIN, value))
|
|
164
|
+
}
|
|
165
|
+
})
|
|
105
166
|
|
|
106
167
|
function togglePanel() {
|
|
107
168
|
panelVisible.value = !panelVisible.value
|
|
@@ -163,7 +224,8 @@ function setupClient() {
|
|
|
163
224
|
disable: disableComponentInspector,
|
|
164
225
|
},
|
|
165
226
|
panel: {
|
|
166
|
-
toggle
|
|
227
|
+
toggle: togglePanel,
|
|
228
|
+
togglePosition(position) {
|
|
167
229
|
panelState.value.position = position
|
|
168
230
|
},
|
|
169
231
|
},
|
|
@@ -264,9 +326,29 @@ initPanelPosition()
|
|
|
264
326
|
|
|
265
327
|
<template>
|
|
266
328
|
<div class="vue-devtools-panel" :style="panelPosition">
|
|
267
|
-
<iframe
|
|
329
|
+
<iframe
|
|
330
|
+
ref="iframe"
|
|
331
|
+
:src="clientUrl"
|
|
332
|
+
:style="{
|
|
333
|
+
'pointer-events': isDragging ? 'none' : 'auto',
|
|
334
|
+
}"
|
|
335
|
+
@load="onLoad"
|
|
336
|
+
/>
|
|
337
|
+
<template v-if="panelState.viewMode === 'default'">
|
|
338
|
+
<div v-if="panelState.position !== 'top'" class="vue-devtools-resize-handle vue-devtools-resize-handle-horizontal" :style="{ top: 0 }" @mousedown.prevent="() => isDragging = 'horizontal'" />
|
|
339
|
+
<div v-if="panelState.position !== 'bottom'" class="vue-devtools-resize-handle vue-devtools-resize-handle-horizontal" :style="{ bottom: 0 }" @mousedown.prevent="() => isDragging = 'horizontal'" />
|
|
340
|
+
<div v-if="panelState.position !== 'left'" class="vue-devtools-resize-handle vue-devtools-resize-handle-vertical" :style="{ left: 0 }" @mousedown.prevent="() => isDragging = 'vertical'" />
|
|
341
|
+
<div v-if="panelState.position !== 'right'" class="vue-devtools-resize-handle vue-devtools-resize-handle-vertical" :style="{ right: 0 }" @mousedown.prevent="() => isDragging = 'vertical'" />
|
|
342
|
+
<div v-if="panelState.position !== 'top' && panelState.position !== 'left'" class="vue-devtools-resize-handle vue-devtools-resize-handle-corner" :style="{ top: 0, left: 0, cursor: 'nwse-resize' }" @mousedown.prevent="() => isDragging = 'both'" />
|
|
343
|
+
<div v-if="panelState.position !== 'top' && panelState.position !== 'right'" class="vue-devtools-resize-handle vue-devtools-resize-handle-corner" :style="{ top: 0, right: 0, cursor: 'nesw-resize' }" @mousedown.prevent="() => isDragging = 'both'" />
|
|
344
|
+
<div v-if="panelState.position !== 'bottom' && panelState.position !== 'right'" class="vue-devtools-resize-handle vue-devtools-resize-handle-corner" :style="{ bottom: 0, right: 0, cursor: 'nwse-resize' }" @mousedown.prevent="() => isDragging = 'both'" />
|
|
345
|
+
<div v-if="panelState.position !== 'bottom' && panelState.position !== 'left'" class="vue-devtools-resize-handle vue-devtools-resize-handle-corner" :style="{ bottom: 0, left: 0, cursor: 'nesw-resize' }" @mousedown.prevent="() => isDragging = 'both'" />
|
|
346
|
+
</template>
|
|
268
347
|
</div>
|
|
269
|
-
<button
|
|
348
|
+
<button
|
|
349
|
+
class="vue-devtools-toggle" aria-label="Toggle devtools panel" :style="toggleButtonPosition"
|
|
350
|
+
@click.prevent="togglePanel"
|
|
351
|
+
>
|
|
270
352
|
<svg viewBox="0 0 256 198" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
271
353
|
<path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z" />
|
|
272
354
|
<path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z" />
|
|
@@ -287,15 +369,15 @@ initPanelPosition()
|
|
|
287
369
|
width: 100%;
|
|
288
370
|
height: 100%;
|
|
289
371
|
outline: 0;
|
|
290
|
-
border:1px solid rgba(125,125,125,0.2);
|
|
372
|
+
border: 1px solid rgba(125, 125, 125, 0.2);
|
|
291
373
|
border-radius: 8px;
|
|
292
374
|
}
|
|
293
375
|
|
|
294
376
|
.vue-devtools-toggle {
|
|
295
377
|
position: fixed;
|
|
296
378
|
background: #0C0C0C;
|
|
297
|
-
border: 1px solid rgba(125,125,125,0.2);
|
|
298
|
-
box-shadow: 3px 5px 10px rgba(0,0,0,0.1);
|
|
379
|
+
border: 1px solid rgba(125, 125, 125, 0.2);
|
|
380
|
+
box-shadow: 3px 5px 10px rgba(0, 0, 0, 0.1);
|
|
299
381
|
z-index: 2147483647;
|
|
300
382
|
cursor: pointer;
|
|
301
383
|
opacity: 0.8;
|
|
@@ -314,6 +396,38 @@ initPanelPosition()
|
|
|
314
396
|
width: 16px;
|
|
315
397
|
height: 16px;
|
|
316
398
|
margin: auto;
|
|
317
|
-
margin-top:3px;
|
|
399
|
+
margin-top: 3px;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.vue-devtools-resize-handle:hover {
|
|
403
|
+
background: rgba(125,125,125,0.1);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.vue-devtools-resize-handle-horizontal {
|
|
407
|
+
position: absolute;
|
|
408
|
+
left: 6px;
|
|
409
|
+
right: 6px;
|
|
410
|
+
height: 10px;
|
|
411
|
+
margin: -5px 0;
|
|
412
|
+
cursor: ns-resize;
|
|
413
|
+
border-radius: 5px;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.vue-devtools-resize-handle-corner {
|
|
417
|
+
position: absolute;
|
|
418
|
+
width: 14px;
|
|
419
|
+
height: 14px;
|
|
420
|
+
margin: -6px;
|
|
421
|
+
border-radius: 6px;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.vue-devtools-resize-handle-vertical{
|
|
425
|
+
position: absolute;
|
|
426
|
+
top: 6px;
|
|
427
|
+
bottom: 0;
|
|
428
|
+
width: 10px;
|
|
429
|
+
margin: 0 -5px;
|
|
430
|
+
cursor: ew-resize;
|
|
431
|
+
border-radius: 5px;
|
|
318
432
|
}
|
|
319
433
|
</style>
|
package/src/node/app.js
CHANGED
|
@@ -27,7 +27,7 @@ function load() {
|
|
|
27
27
|
devtools: {
|
|
28
28
|
hide: true,
|
|
29
29
|
},
|
|
30
|
-
}).mount(
|
|
30
|
+
}).mount(el)
|
|
31
31
|
}
|
|
32
32
|
load()
|
|
33
33
|
|
|
@@ -36,6 +36,6 @@ window.print = (...s) => {
|
|
|
36
36
|
console.log('print', ...s)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
hook.on('app:init', (app) => {
|
|
40
|
-
|
|
41
|
-
})
|
|
39
|
+
// hook.on('app:init', (app) => {
|
|
40
|
+
// console.log('init', app)
|
|
41
|
+
// })
|