@nuxt/devtools-nightly 4.0.0-29893186.47ed265 → 4.0.0-29893186.f4652fe

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.
@@ -26,7 +26,7 @@ import { DEVTOOLS_TERMINALS_DOCK_ID, DEVTOOLS_MOUNT_PATH } from '@vitejs/devtool
26
26
  import { debounce } from 'perfect-debounce';
27
27
  import { Server } from 'node:tls';
28
28
 
29
- const version = "4.0.0-29893186.47ed265";
29
+ const version = "4.0.0-29893186.f4652fe";
30
30
  const peerDependencies = {
31
31
  "@nuxt/kit": "^4.0.0-0 || ^5.0.0-0",
32
32
  nitro: "*",
@@ -6,7 +6,9 @@ function setup({ nuxt, options }) {
6
6
  return;
7
7
  if (!options.componentInspector)
8
8
  return;
9
- const plugin = VueTracer();
9
+ const plugin = VueTracer({
10
+ viteDevtools: { onPick: "none" }
11
+ });
10
12
  if (plugin)
11
13
  addVitePlugin(plugin);
12
14
  }
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/devtools",
3
3
  "configKey": "devtools",
4
- "version": "4.0.0-29893186.47ed265",
4
+ "version": "4.0.0-29893186.f4652fe",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "3.6.1"
@@ -7,6 +7,7 @@ import { computed, effect, isRef, markRaw, nextTick, reactive, ref, shallowReact
7
7
  import { useAppConfig } from "#imports";
8
8
  import { initTimelineMetrics } from "../../function-metrics-helpers.js";
9
9
  const NUXT_DOCK_ANCHOR_ID = "nuxt:devtools";
10
+ const VUE_TRACER_DOCK_ID = "vue-tracer";
10
11
  function getDevframeContext() {
11
12
  return getDevframeClientContext();
12
13
  }
@@ -34,7 +35,7 @@ export async function setupDevToolsClient({
34
35
  close() {
35
36
  const ctx = getDevframeContext();
36
37
  if (ctx)
37
- ctx.panel.session.open = false;
38
+ closePanel(ctx);
38
39
  },
39
40
  open() {
40
41
  const ctx = getDevframeContext();
@@ -94,10 +95,46 @@ export async function setupDevToolsClient({
94
95
  left: "0",
95
96
  top: "0"
96
97
  });
98
+ const supportsTopLayer = typeof component.showPopover === "function";
99
+ function raiseToTopLayer() {
100
+ if (!supportsTopLayer)
101
+ return;
102
+ if (component.matches(":popover-open"))
103
+ component.hidePopover();
104
+ component.showPopover();
105
+ }
106
+ if (supportsTopLayer) {
107
+ component.popover = "manual";
108
+ Object.assign(component.style, {
109
+ inset: "auto",
110
+ margin: "0",
111
+ padding: "0",
112
+ border: "none",
113
+ background: "transparent",
114
+ overflow: "visible"
115
+ });
116
+ raiseToTopLayer();
117
+ }
118
+ let reopenPanelOnClose = false;
119
+ function holdPanelWhileInspecting() {
120
+ queueMicrotask(() => {
121
+ const ctx = getDevframeContext();
122
+ if (!props.matched || !ctx?.panel.session.open)
123
+ return;
124
+ ctx.panel.session.open = false;
125
+ reopenPanelOnClose = true;
126
+ });
127
+ }
97
128
  component.addEventListener("close", () => {
98
129
  props.matched = void 0;
99
130
  inspectorState.isEnabled = false;
100
131
  inspectorState.isVisible = false;
132
+ if (reopenPanelOnClose) {
133
+ reopenPanelOnClose = false;
134
+ const ctx = getDevframeContext();
135
+ if (ctx)
136
+ ctx.panel.session.open = true;
137
+ }
101
138
  });
102
139
  component.addEventListener("selectParent", () => {
103
140
  const parent = inspectorState.main?.getParent();
@@ -132,6 +169,8 @@ export async function setupDevToolsClient({
132
169
  inspectorState.isVisible = true;
133
170
  props.matched = info;
134
171
  props.mouse = { x: e.clientX, y: e.clientY };
172
+ raiseToTopLayer();
173
+ holdPanelWhileInspecting();
135
174
  });
136
175
  const isAvailable = ref(inspectorHasData());
137
176
  if (!isAvailable.value) {
@@ -139,21 +178,21 @@ export async function setupDevToolsClient({
139
178
  isAvailable.value = inspectorHasData();
140
179
  });
141
180
  }
181
+ function setActive(active) {
182
+ const ctx = getDevframeContext();
183
+ if (ctx?.docks.getStateById(VUE_TRACER_DOCK_ID)) {
184
+ ctx.docks.setActionActive(VUE_TRACER_DOCK_ID, active);
185
+ return;
186
+ }
187
+ inspectorState.isVisible = active;
188
+ inspectorState.isEnabled = active;
189
+ }
142
190
  return inspector = markRaw({
143
191
  isAvailable,
144
192
  isEnabled: toRef(inspectorState, "isVisible"),
145
- enable: () => {
146
- inspectorState.isVisible = true;
147
- inspectorState.isEnabled = true;
148
- },
149
- disable: () => {
150
- inspectorState.isVisible = false;
151
- inspectorState.isEnabled = false;
152
- },
153
- toggle: () => {
154
- inspectorState.isEnabled = !inspectorState.isEnabled;
155
- inspectorState.isVisible = inspectorState.isEnabled;
156
- }
193
+ enable: () => setActive(true),
194
+ disable: () => setActive(false),
195
+ toggle: () => setActive(!inspectorState.isEnabled)
157
196
  });
158
197
  }
159
198
  setupRouteTracking(timeline, router);
@@ -164,6 +203,10 @@ export async function setupDevToolsClient({
164
203
  client.devtools.toggle();
165
204
  });
166
205
  }
206
+ function closePanel(ctx) {
207
+ ctx.docks.switchEntry(null);
208
+ ctx.panel.session.open = false;
209
+ }
167
210
  export function useClientColorMode() {
168
211
  const explicitColor = ref();
169
212
  const systemColor = ref();
@@ -190,6 +190,43 @@ function onClickOutside(target, handler, options = {}) {
190
190
  return stop;
191
191
  }
192
192
  //#endregion
193
+ //#region onKeyStroke/index.ts
194
+ function createKeyPredicate(keyFilter) {
195
+ if (typeof keyFilter === "function") return keyFilter;
196
+ else if (typeof keyFilter === "string") return (event) => event.key === keyFilter;
197
+ else if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);
198
+ return () => true;
199
+ }
200
+ function onKeyStroke(...args) {
201
+ let key;
202
+ let handler;
203
+ let options = {};
204
+ if (args.length === 3) {
205
+ key = args[0];
206
+ handler = args[1];
207
+ options = args[2];
208
+ } else if (args.length === 2) {
209
+ if (typeof args[1] === "object") {
210
+ key = true;
211
+ handler = args[0];
212
+ options = args[1];
213
+ } else {
214
+ key = args[0];
215
+ handler = args[1];
216
+ }
217
+ } else {
218
+ key = true;
219
+ handler = args[0];
220
+ }
221
+ const { target = defaultWindow, eventName = "keydown", passive = false, dedupe = false } = options;
222
+ const predicate = createKeyPredicate(key);
223
+ const listener = (e) => {
224
+ if (e.repeat && toValue(dedupe)) return;
225
+ if (predicate(e)) handler(e);
226
+ };
227
+ return useEventListener(target, eventName, listener, passive);
228
+ }
229
+ //#endregion
193
230
  //#region useDraggable/index.ts
194
231
  const defaultScrollConfig = {
195
232
  speed: 2,
@@ -441,6 +478,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
441
478
  close();
442
479
  });
443
480
  });
481
+ onKeyStroke("Escape", () => {
482
+ if (__props.props.matched)
483
+ close();
484
+ });
444
485
  function close() {
445
486
  emit("close");
446
487
  }
@@ -452,6 +493,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
452
493
  return;
453
494
  const file = `${__props.props.matched.pos[0]}:${__props.props.matched.pos[1]}:${__props.props.matched.pos[2]}`;
454
495
  emit("openInEditor", file);
496
+ close();
455
497
  }
456
498
  function generateUniqueSelector(element) {
457
499
  if (!element)
@@ -545,6 +587,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
545
587
  toastTimer = setTimeout(() => {
546
588
  showToast.value = false;
547
589
  }, 6e3);
590
+ close();
548
591
  } catch (error) {
549
592
  console.error("Failed to copy agent info:", error);
550
593
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/devtools-nightly",
3
3
  "type": "module",
4
- "version": "4.0.0-29893186.47ed265",
4
+ "version": "4.0.0-29893186.f4652fe",
5
5
  "description": "The Nuxt DevTools gives you insights and transparency about your Nuxt App.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://nuxt.com/modules/devtools",
@@ -43,18 +43,18 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@devframes/hub": "^1.2.6",
47
- "@devframes/plugin-assets": "^1.2.6",
48
- "@devframes/plugin-code-server": "^1.2.6",
49
- "@devframes/plugin-data-inspector": "^1.2.6",
50
- "@devframes/plugin-og": "^1.2.6",
51
- "@nuxt/devtools-assets": "npm:@nuxt/devtools-assets-nightly@4.0.0-29893186.47ed265",
52
- "@nuxt/devtools-kit": "npm:@nuxt/devtools-kit-nightly@4.0.0-29893186.47ed265",
46
+ "@devframes/hub": "^1.3.1",
47
+ "@devframes/plugin-assets": "^1.3.1",
48
+ "@devframes/plugin-code-server": "^1.3.1",
49
+ "@devframes/plugin-data-inspector": "^1.3.1",
50
+ "@devframes/plugin-og": "^1.3.1",
51
+ "@nuxt/devtools-assets": "npm:@nuxt/devtools-assets-nightly@4.0.0-29893186.f4652fe",
52
+ "@nuxt/devtools-kit": "npm:@nuxt/devtools-kit-nightly@4.0.0-29893186.f4652fe",
53
53
  "@vitejs/devtools": "^0.8.0",
54
54
  "@vitejs/devtools-kit": "^0.8.0",
55
55
  "consola": "^3.4.2",
56
56
  "destr": "^2.0.5",
57
- "devframe": "^1.2.6",
57
+ "devframe": "^1.3.1",
58
58
  "error-stack-parser-es": "^2.0.1",
59
59
  "escape-string-regexp": "^5.0.0",
60
60
  "fast-npm-meta": "^2.2.0",
@@ -69,7 +69,7 @@
69
69
  "unplugin": "^3.5.0",
70
70
  "verkit": "^0.5.0",
71
71
  "vite-plugin-vue-devtools": "^9.0.0-beta.1",
72
- "vite-plugin-vue-tracer": "^1.6.0"
72
+ "vite-plugin-vue-tracer": "^1.7.0"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@antfu/utils": "^9.3.0",