@vue/devtools-kit 7.0.20 → 7.0.22

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/dist/index.cjs CHANGED
@@ -11,9 +11,9 @@ var __esm = (fn, res) => function __init() {
11
11
  var __commonJS = (cb, mod) => function __require() {
12
12
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
13
  };
14
- var __export = (target9, all) => {
14
+ var __export = (target10, all) => {
15
15
  for (var name in all)
16
- __defProp(target9, name, { get: all[name], enumerable: true });
16
+ __defProp(target10, name, { get: all[name], enumerable: true });
17
17
  };
18
18
  var __copyProps = (to, from, except, desc) => {
19
19
  if (from && typeof from === "object" || typeof from === "function") {
@@ -23,19 +23,19 @@ var __copyProps = (to, from, except, desc) => {
23
23
  }
24
24
  return to;
25
25
  };
26
- var __toESM = (mod, isNodeMode, target9) => (target9 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ var __toESM = (mod, isNodeMode, target10) => (target10 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
27
  // If the importer is in node compatibility mode or this is not an ESM
28
28
  // file that has been converted to a CommonJS file using a Babel-
29
29
  // compatible transform (i.e. "__esModule" has not been set), then set
30
30
  // "default" to the CommonJS "module.exports" for node compatibility.
31
- isNodeMode || !mod || !mod.__esModule ? __defProp(target9, "default", { value: mod, enumerable: true }) : target9,
31
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target10, "default", { value: mod, enumerable: true }) : target10,
32
32
  mod
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.4.2/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.38_typescript@5.4.3/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.4.2/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.38_typescript@5.4.3/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -1605,7 +1605,7 @@ init_cjs_shims();
1605
1605
 
1606
1606
  // src/core/index.ts
1607
1607
  init_cjs_shims();
1608
- var import_devtools_shared15 = require("@vue/devtools-shared");
1608
+ var import_devtools_shared16 = require("@vue/devtools-shared");
1609
1609
 
1610
1610
  // src/hook/index.ts
1611
1611
  init_cjs_shims();
@@ -1659,9 +1659,10 @@ var on = {
1659
1659
  function createDevToolsHook() {
1660
1660
  return {
1661
1661
  id: "vue-devtools-next",
1662
+ devtoolsVersion: "7.0",
1662
1663
  enabled: false,
1663
1664
  appRecords: [],
1664
- apps: {},
1665
+ apps: [],
1665
1666
  events: /* @__PURE__ */ new Map(),
1666
1667
  on(event, fn) {
1667
1668
  var _a10;
@@ -1718,7 +1719,9 @@ function subscribeDevToolsHook() {
1718
1719
  return;
1719
1720
  devtoolsHooks.callHook("component:removed" /* COMPONENT_REMOVED */, app, uid, parentUid, component);
1720
1721
  });
1721
- hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn) => {
1722
+ hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn, options) => {
1723
+ if ((options == null ? void 0 : options.target) === "legacy")
1724
+ return;
1722
1725
  devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
1723
1726
  });
1724
1727
  }
@@ -2301,8 +2304,10 @@ var ComponentWalker = class {
2301
2304
  */
2302
2305
  mark(instance, force = false) {
2303
2306
  const instanceMap = getAppRecord(instance).instanceMap;
2304
- if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_UID__))
2307
+ if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_UID__)) {
2305
2308
  instanceMap.set(instance.__VUE_DEVTOOLS_UID__, instance);
2309
+ devtoolsAppRecords.active.instanceMap = instanceMap;
2310
+ }
2306
2311
  }
2307
2312
  isKeepAlive(instance) {
2308
2313
  return instance.type.__isKeepAlive && instance.__v_cache;
@@ -2386,9 +2391,9 @@ var StateEditor = class {
2386
2391
  Reflect.deleteProperty(object, field);
2387
2392
  }
2388
2393
  if (!state.remove) {
2389
- const target9 = object[state.newKey || field];
2390
- if (this.refEditor.isRef(target9))
2391
- this.refEditor.set(target9, value);
2394
+ const target10 = object[state.newKey || field];
2395
+ if (this.refEditor.isRef(target10))
2396
+ this.refEditor.set(target10, value);
2392
2397
  else if ((0, import_vue2.toRaw)(object) instanceof Map)
2393
2398
  object.set(state.newKey || field, value);
2394
2399
  else if ((0, import_vue2.toRaw)(object) instanceof Set)
@@ -2440,14 +2445,14 @@ async function editComponentState(payload, stateEditor2) {
2440
2445
  if (!instance)
2441
2446
  return;
2442
2447
  const targetPath = path.slice();
2443
- let target9;
2448
+ let target10;
2444
2449
  if (instance.devtoolsRawSetupState && Object.keys(instance.devtoolsRawSetupState).includes(path[0])) {
2445
- target9 = instance.devtoolsRawSetupState;
2450
+ target10 = instance.devtoolsRawSetupState;
2446
2451
  }
2447
- if (target9 && targetPath) {
2452
+ if (target10 && targetPath) {
2448
2453
  if (state.type === "object" && type === "reactive") {
2449
2454
  }
2450
- stateEditor2.set(target9, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
2455
+ stateEditor2.set(target10, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
2451
2456
  }
2452
2457
  }
2453
2458
  var stateEditor = new StateEditor();
@@ -2959,8 +2964,10 @@ function registerComponentDevToolsPlugin(app) {
2959
2964
  if (component) {
2960
2965
  if (component.__VUE_DEVTOOLS_UID__ == null)
2961
2966
  component.__VUE_DEVTOOLS_UID__ = id;
2962
- if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id)))
2967
+ if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id))) {
2963
2968
  appRecord == null ? void 0 : appRecord.instanceMap.set(id, component);
2969
+ devtoolsAppRecords.active.instanceMap = appRecord.instanceMap;
2970
+ }
2964
2971
  }
2965
2972
  if (!appRecord)
2966
2973
  return;
@@ -2983,8 +2990,10 @@ function registerComponentDevToolsPlugin(app) {
2983
2990
  if (component) {
2984
2991
  if (component.__VUE_DEVTOOLS_UID__ == null)
2985
2992
  component.__VUE_DEVTOOLS_UID__ = id;
2986
- if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id)))
2993
+ if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id))) {
2987
2994
  appRecord == null ? void 0 : appRecord.instanceMap.set(id, component);
2995
+ devtoolsAppRecords.active.instanceMap = appRecord.instanceMap;
2996
+ }
2988
2997
  }
2989
2998
  if (!appRecord)
2990
2999
  return;
@@ -3008,6 +3017,7 @@ function registerComponentDevToolsPlugin(app) {
3008
3017
  instance: component
3009
3018
  });
3010
3019
  appRecord == null ? void 0 : appRecord.instanceMap.delete(id);
3020
+ devtoolsAppRecords.active.instanceMap = appRecord.instanceMap;
3011
3021
  debounceSendInspectorTree();
3012
3022
  });
3013
3023
  devtoolsContext.componentPluginHookBuffer = [
@@ -3213,9 +3223,9 @@ function unhighlight() {
3213
3223
  }
3214
3224
  var inspectInstance = null;
3215
3225
  function inspectFn(e) {
3216
- const target9 = e.target;
3217
- if (target9) {
3218
- const instance = target9.__vueParentComponent;
3226
+ const target10 = e.target;
3227
+ if (target10) {
3228
+ const instance = target10.__vueParentComponent;
3219
3229
  if (instance) {
3220
3230
  inspectInstance = instance;
3221
3231
  const el = instance.vnode.el;
@@ -4214,16 +4224,16 @@ var callConnectedUpdatedHook = (0, import_perfect_debounce3.debounce)((state, ol
4214
4224
  apiHooks.callHook("devtools:connected-updated" /* DEVTOOLS_CONNECTED_UPDATED */, state, oldState);
4215
4225
  }, 80);
4216
4226
  var devtoolsState = new Proxy(import_devtools_shared10.target[STATE_KEY], {
4217
- get(target9, property) {
4227
+ get(target10, property) {
4218
4228
  return import_devtools_shared10.target[STATE_KEY][property];
4219
4229
  },
4220
- deleteProperty(target9, property) {
4221
- delete target9[property];
4230
+ deleteProperty(target10, property) {
4231
+ delete target10[property];
4222
4232
  return true;
4223
4233
  },
4224
- set(target9, property, value) {
4234
+ set(target10, property, value) {
4225
4235
  const oldState = { ...import_devtools_shared10.target[STATE_KEY] };
4226
- target9[property] = value;
4236
+ target10[property] = value;
4227
4237
  import_devtools_shared10.target[STATE_KEY][property] = value;
4228
4238
  callStateUpdatedHook(import_devtools_shared10.target[STATE_KEY], oldState);
4229
4239
  if (["connected", "clientConnected"].includes(property.toString()) && oldState[property] !== value)
@@ -4269,7 +4279,7 @@ var _a5, _b5;
4269
4279
  var _a6, _b6;
4270
4280
  (_b6 = (_a6 = import_devtools_shared11.target)[ROUTER_KEY]) != null ? _b6 : _a6[ROUTER_KEY] = null;
4271
4281
  var devtoolsRouterInfo = new Proxy(import_devtools_shared11.target[ROUTER_INFO_KEY], {
4272
- get(target9, property) {
4282
+ get(target10, property) {
4273
4283
  return import_devtools_shared11.target[ROUTER_INFO_KEY][property];
4274
4284
  }
4275
4285
  });
@@ -4296,14 +4306,14 @@ function resetDevToolsContext() {
4296
4306
  import_devtools_shared12.target[CONTEXT_KEY] = initContextFactory();
4297
4307
  }
4298
4308
  var devtoolsContext = new Proxy(import_devtools_shared12.target[CONTEXT_KEY], {
4299
- get(target9, property) {
4309
+ get(target10, property) {
4300
4310
  if (property === "router")
4301
4311
  return import_devtools_shared12.target[ROUTER_KEY];
4302
4312
  else if (property === "clear")
4303
4313
  return resetDevToolsContext;
4304
4314
  return import_devtools_shared12.target[CONTEXT_KEY][property];
4305
4315
  },
4306
- set(target9, property, value) {
4316
+ set(target10, property, value) {
4307
4317
  import_devtools_shared12.target[CONTEXT_KEY][property] = value;
4308
4318
  return true;
4309
4319
  }
@@ -4319,7 +4329,7 @@ var devtoolsAppRecords = new Proxy(devtoolsState.appRecords, {
4319
4329
  else if (property === "activeId")
4320
4330
  return devtoolsState.activeAppRecordId;
4321
4331
  },
4322
- set(target9, property, value) {
4332
+ set(target10, property, value) {
4323
4333
  var _a10;
4324
4334
  const oldState = { ...devtoolsState };
4325
4335
  if (property === "value") {
@@ -4364,17 +4374,37 @@ function setDevToolsEnv(env) {
4364
4374
  };
4365
4375
  }
4366
4376
 
4377
+ // src/compat/index.ts
4378
+ init_cjs_shims();
4379
+ var import_devtools_shared15 = require("@vue/devtools-shared");
4380
+ function onLegacyDevToolsPluginApiAvailabled(cb) {
4381
+ if (import_devtools_shared15.target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) {
4382
+ cb();
4383
+ return;
4384
+ }
4385
+ Object.defineProperty(import_devtools_shared15.target, "__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__", {
4386
+ set(value) {
4387
+ if (value)
4388
+ cb();
4389
+ },
4390
+ configurable: true
4391
+ });
4392
+ }
4393
+
4367
4394
  // src/core/index.ts
4368
4395
  function initDevTools() {
4369
4396
  var _a10;
4370
4397
  devtoolsState.vitePluginDetected = getDevToolsEnv().vitePluginDetected;
4371
- const isDevToolsNext = ((_a10 = import_devtools_shared15.target.__VUE_DEVTOOLS_GLOBAL_HOOK__) == null ? void 0 : _a10.id) === "vue-devtools-next";
4372
- if (import_devtools_shared15.target.__VUE_DEVTOOLS_GLOBAL_HOOK__ && isDevToolsNext)
4398
+ const isDevToolsNext = ((_a10 = import_devtools_shared16.target.__VUE_DEVTOOLS_GLOBAL_HOOK__) == null ? void 0 : _a10.id) === "vue-devtools-next";
4399
+ if (import_devtools_shared16.target.__VUE_DEVTOOLS_GLOBAL_HOOK__ && isDevToolsNext)
4373
4400
  return;
4374
- if (import_devtools_shared15.target.__VUE_DEVTOOLS_GLOBAL_HOOK__)
4375
- Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, createDevToolsHook());
4376
- else
4377
- import_devtools_shared15.target.__VUE_DEVTOOLS_GLOBAL_HOOK__ = createDevToolsHook();
4401
+ if (!import_devtools_shared16.target.__VUE_DEVTOOLS_GLOBAL_HOOK__) {
4402
+ import_devtools_shared16.target.__VUE_DEVTOOLS_GLOBAL_HOOK__ = createDevToolsHook();
4403
+ } else {
4404
+ if (!import_devtools_shared16.isNuxtApp) {
4405
+ Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, createDevToolsHook());
4406
+ }
4407
+ }
4378
4408
  hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4379
4409
  collectDevToolsPlugin(pluginDescriptor, setupFn);
4380
4410
  const { app, api } = devtoolsAppRecords.active || {};
@@ -4382,6 +4412,12 @@ function initDevTools() {
4382
4412
  return;
4383
4413
  setupExternalPlugin([pluginDescriptor, setupFn], app, api);
4384
4414
  });
4415
+ onLegacyDevToolsPluginApiAvailabled(() => {
4416
+ const normalizedPluginBuffer = devtoolsState.pluginBuffer.filter(([item]) => item.id !== "components");
4417
+ normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => {
4418
+ import_devtools_shared16.target.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn, { target: "legacy" });
4419
+ });
4420
+ });
4385
4421
  hook.on.vueAppInit(async (app, version) => {
4386
4422
  const record = createAppRecord(app);
4387
4423
  const api = new DevToolsPluginApi();
package/dist/index.d.cts CHANGED
@@ -452,11 +452,14 @@ interface DevToolsEvent {
452
452
  [DevToolsHooks.COMPONENT_ADDED]: (app: HookAppInstance, uid: number, parentUid: number, component: VueAppInstance) => void;
453
453
  [DevToolsHooks.COMPONENT_UPDATED]: DevToolsEvent['component:added'];
454
454
  [DevToolsHooks.COMPONENT_REMOVED]: DevToolsEvent['component:added'];
455
- [DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction) => void;
455
+ [DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction, options?: {
456
+ target?: string;
457
+ }) => void;
456
458
  }
457
459
  interface DevToolsHook {
458
460
  id: string;
459
461
  enabled?: boolean;
462
+ devtoolsVersion: string;
460
463
  events: Map<DevToolsHooks, Function[]>;
461
464
  emit: (event: DevToolsHooks, ...payload: any[]) => void;
462
465
  on: <T extends Function>(event: DevToolsHooks, handler: T) => () => void;
package/dist/index.d.ts CHANGED
@@ -452,11 +452,14 @@ interface DevToolsEvent {
452
452
  [DevToolsHooks.COMPONENT_ADDED]: (app: HookAppInstance, uid: number, parentUid: number, component: VueAppInstance) => void;
453
453
  [DevToolsHooks.COMPONENT_UPDATED]: DevToolsEvent['component:added'];
454
454
  [DevToolsHooks.COMPONENT_REMOVED]: DevToolsEvent['component:added'];
455
- [DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction) => void;
455
+ [DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction, options?: {
456
+ target?: string;
457
+ }) => void;
456
458
  }
457
459
  interface DevToolsHook {
458
460
  id: string;
459
461
  enabled?: boolean;
462
+ devtoolsVersion: string;
460
463
  events: Map<DevToolsHooks, Function[]>;
461
464
  emit: (event: DevToolsHooks, ...payload: any[]) => void;
462
465
  on: <T extends Function>(event: DevToolsHooks, handler: T) => () => void;
package/dist/index.js CHANGED
@@ -18,18 +18,18 @@ var __copyProps = (to, from, except, desc) => {
18
18
  }
19
19
  return to;
20
20
  };
21
- var __toESM = (mod, isNodeMode, target9) => (target9 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ var __toESM = (mod, isNodeMode, target10) => (target10 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
22
  // If the importer is in node compatibility mode or this is not an ESM
23
23
  // file that has been converted to a CommonJS file using a Babel-
24
24
  // compatible transform (i.e. "__esModule" has not been set), then set
25
25
  // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target9, "default", { value: mod, enumerable: true }) : target9,
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target10, "default", { value: mod, enumerable: true }) : target10,
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.4.2/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.38_typescript@5.4.3/node_modules/tsup/assets/esm_shims.js
31
31
  var init_esm_shims = __esm({
32
- "../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.4.2/node_modules/tsup/assets/esm_shims.js"() {
32
+ "../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.38_typescript@5.4.3/node_modules/tsup/assets/esm_shims.js"() {
33
33
  "use strict";
34
34
  }
35
35
  });
@@ -1577,7 +1577,7 @@ init_esm_shims();
1577
1577
 
1578
1578
  // src/core/index.ts
1579
1579
  init_esm_shims();
1580
- import { target as target8 } from "@vue/devtools-shared";
1580
+ import { isNuxtApp, target as target9 } from "@vue/devtools-shared";
1581
1581
 
1582
1582
  // src/hook/index.ts
1583
1583
  init_esm_shims();
@@ -1631,9 +1631,10 @@ var on = {
1631
1631
  function createDevToolsHook() {
1632
1632
  return {
1633
1633
  id: "vue-devtools-next",
1634
+ devtoolsVersion: "7.0",
1634
1635
  enabled: false,
1635
1636
  appRecords: [],
1636
- apps: {},
1637
+ apps: [],
1637
1638
  events: /* @__PURE__ */ new Map(),
1638
1639
  on(event, fn) {
1639
1640
  var _a10;
@@ -1690,7 +1691,9 @@ function subscribeDevToolsHook() {
1690
1691
  return;
1691
1692
  devtoolsHooks.callHook("component:removed" /* COMPONENT_REMOVED */, app, uid, parentUid, component);
1692
1693
  });
1693
- hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn) => {
1694
+ hook2.on("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn, options) => {
1695
+ if ((options == null ? void 0 : options.target) === "legacy")
1696
+ return;
1694
1697
  devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
1695
1698
  });
1696
1699
  }
@@ -2273,8 +2276,10 @@ var ComponentWalker = class {
2273
2276
  */
2274
2277
  mark(instance, force = false) {
2275
2278
  const instanceMap = getAppRecord(instance).instanceMap;
2276
- if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_UID__))
2279
+ if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_UID__)) {
2277
2280
  instanceMap.set(instance.__VUE_DEVTOOLS_UID__, instance);
2281
+ devtoolsAppRecords.active.instanceMap = instanceMap;
2282
+ }
2278
2283
  }
2279
2284
  isKeepAlive(instance) {
2280
2285
  return instance.type.__isKeepAlive && instance.__v_cache;
@@ -2358,9 +2363,9 @@ var StateEditor = class {
2358
2363
  Reflect.deleteProperty(object, field);
2359
2364
  }
2360
2365
  if (!state.remove) {
2361
- const target9 = object[state.newKey || field];
2362
- if (this.refEditor.isRef(target9))
2363
- this.refEditor.set(target9, value);
2366
+ const target10 = object[state.newKey || field];
2367
+ if (this.refEditor.isRef(target10))
2368
+ this.refEditor.set(target10, value);
2364
2369
  else if (toRaw(object) instanceof Map)
2365
2370
  object.set(state.newKey || field, value);
2366
2371
  else if (toRaw(object) instanceof Set)
@@ -2412,14 +2417,14 @@ async function editComponentState(payload, stateEditor2) {
2412
2417
  if (!instance)
2413
2418
  return;
2414
2419
  const targetPath = path.slice();
2415
- let target9;
2420
+ let target10;
2416
2421
  if (instance.devtoolsRawSetupState && Object.keys(instance.devtoolsRawSetupState).includes(path[0])) {
2417
- target9 = instance.devtoolsRawSetupState;
2422
+ target10 = instance.devtoolsRawSetupState;
2418
2423
  }
2419
- if (target9 && targetPath) {
2424
+ if (target10 && targetPath) {
2420
2425
  if (state.type === "object" && type === "reactive") {
2421
2426
  }
2422
- stateEditor2.set(target9, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
2427
+ stateEditor2.set(target10, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));
2423
2428
  }
2424
2429
  }
2425
2430
  var stateEditor = new StateEditor();
@@ -2931,8 +2936,10 @@ function registerComponentDevToolsPlugin(app) {
2931
2936
  if (component) {
2932
2937
  if (component.__VUE_DEVTOOLS_UID__ == null)
2933
2938
  component.__VUE_DEVTOOLS_UID__ = id;
2934
- if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id)))
2939
+ if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id))) {
2935
2940
  appRecord == null ? void 0 : appRecord.instanceMap.set(id, component);
2941
+ devtoolsAppRecords.active.instanceMap = appRecord.instanceMap;
2942
+ }
2936
2943
  }
2937
2944
  if (!appRecord)
2938
2945
  return;
@@ -2955,8 +2962,10 @@ function registerComponentDevToolsPlugin(app) {
2955
2962
  if (component) {
2956
2963
  if (component.__VUE_DEVTOOLS_UID__ == null)
2957
2964
  component.__VUE_DEVTOOLS_UID__ = id;
2958
- if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id)))
2965
+ if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id))) {
2959
2966
  appRecord == null ? void 0 : appRecord.instanceMap.set(id, component);
2967
+ devtoolsAppRecords.active.instanceMap = appRecord.instanceMap;
2968
+ }
2960
2969
  }
2961
2970
  if (!appRecord)
2962
2971
  return;
@@ -2980,6 +2989,7 @@ function registerComponentDevToolsPlugin(app) {
2980
2989
  instance: component
2981
2990
  });
2982
2991
  appRecord == null ? void 0 : appRecord.instanceMap.delete(id);
2992
+ devtoolsAppRecords.active.instanceMap = appRecord.instanceMap;
2983
2993
  debounceSendInspectorTree();
2984
2994
  });
2985
2995
  devtoolsContext.componentPluginHookBuffer = [
@@ -3185,9 +3195,9 @@ function unhighlight() {
3185
3195
  }
3186
3196
  var inspectInstance = null;
3187
3197
  function inspectFn(e) {
3188
- const target9 = e.target;
3189
- if (target9) {
3190
- const instance = target9.__vueParentComponent;
3198
+ const target10 = e.target;
3199
+ if (target10) {
3200
+ const instance = target10.__vueParentComponent;
3191
3201
  if (instance) {
3192
3202
  inspectInstance = instance;
3193
3203
  const el = instance.vnode.el;
@@ -4186,16 +4196,16 @@ var callConnectedUpdatedHook = debounce3((state, oldState) => {
4186
4196
  apiHooks.callHook("devtools:connected-updated" /* DEVTOOLS_CONNECTED_UPDATED */, state, oldState);
4187
4197
  }, 80);
4188
4198
  var devtoolsState = new Proxy(global2[STATE_KEY], {
4189
- get(target9, property) {
4199
+ get(target10, property) {
4190
4200
  return global2[STATE_KEY][property];
4191
4201
  },
4192
- deleteProperty(target9, property) {
4193
- delete target9[property];
4202
+ deleteProperty(target10, property) {
4203
+ delete target10[property];
4194
4204
  return true;
4195
4205
  },
4196
- set(target9, property, value) {
4206
+ set(target10, property, value) {
4197
4207
  const oldState = { ...global2[STATE_KEY] };
4198
- target9[property] = value;
4208
+ target10[property] = value;
4199
4209
  global2[STATE_KEY][property] = value;
4200
4210
  callStateUpdatedHook(global2[STATE_KEY], oldState);
4201
4211
  if (["connected", "clientConnected"].includes(property.toString()) && oldState[property] !== value)
@@ -4241,7 +4251,7 @@ var _a5, _b5;
4241
4251
  var _a6, _b6;
4242
4252
  (_b6 = (_a6 = global3)[ROUTER_KEY]) != null ? _b6 : _a6[ROUTER_KEY] = null;
4243
4253
  var devtoolsRouterInfo = new Proxy(global3[ROUTER_INFO_KEY], {
4244
- get(target9, property) {
4254
+ get(target10, property) {
4245
4255
  return global3[ROUTER_INFO_KEY][property];
4246
4256
  }
4247
4257
  });
@@ -4268,14 +4278,14 @@ function resetDevToolsContext() {
4268
4278
  global4[CONTEXT_KEY] = initContextFactory();
4269
4279
  }
4270
4280
  var devtoolsContext = new Proxy(global4[CONTEXT_KEY], {
4271
- get(target9, property) {
4281
+ get(target10, property) {
4272
4282
  if (property === "router")
4273
4283
  return global4[ROUTER_KEY];
4274
4284
  else if (property === "clear")
4275
4285
  return resetDevToolsContext;
4276
4286
  return global4[CONTEXT_KEY][property];
4277
4287
  },
4278
- set(target9, property, value) {
4288
+ set(target10, property, value) {
4279
4289
  global4[CONTEXT_KEY][property] = value;
4280
4290
  return true;
4281
4291
  }
@@ -4291,7 +4301,7 @@ var devtoolsAppRecords = new Proxy(devtoolsState.appRecords, {
4291
4301
  else if (property === "activeId")
4292
4302
  return devtoolsState.activeAppRecordId;
4293
4303
  },
4294
- set(target9, property, value) {
4304
+ set(target10, property, value) {
4295
4305
  var _a10;
4296
4306
  const oldState = { ...devtoolsState };
4297
4307
  if (property === "value") {
@@ -4336,17 +4346,37 @@ function setDevToolsEnv(env) {
4336
4346
  };
4337
4347
  }
4338
4348
 
4349
+ // src/compat/index.ts
4350
+ init_esm_shims();
4351
+ import { target as target8 } from "@vue/devtools-shared";
4352
+ function onLegacyDevToolsPluginApiAvailabled(cb) {
4353
+ if (target8.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) {
4354
+ cb();
4355
+ return;
4356
+ }
4357
+ Object.defineProperty(target8, "__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__", {
4358
+ set(value) {
4359
+ if (value)
4360
+ cb();
4361
+ },
4362
+ configurable: true
4363
+ });
4364
+ }
4365
+
4339
4366
  // src/core/index.ts
4340
4367
  function initDevTools() {
4341
4368
  var _a10;
4342
4369
  devtoolsState.vitePluginDetected = getDevToolsEnv().vitePluginDetected;
4343
- const isDevToolsNext = ((_a10 = target8.__VUE_DEVTOOLS_GLOBAL_HOOK__) == null ? void 0 : _a10.id) === "vue-devtools-next";
4344
- if (target8.__VUE_DEVTOOLS_GLOBAL_HOOK__ && isDevToolsNext)
4370
+ const isDevToolsNext = ((_a10 = target9.__VUE_DEVTOOLS_GLOBAL_HOOK__) == null ? void 0 : _a10.id) === "vue-devtools-next";
4371
+ if (target9.__VUE_DEVTOOLS_GLOBAL_HOOK__ && isDevToolsNext)
4345
4372
  return;
4346
- if (target8.__VUE_DEVTOOLS_GLOBAL_HOOK__)
4347
- Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, createDevToolsHook());
4348
- else
4349
- target8.__VUE_DEVTOOLS_GLOBAL_HOOK__ = createDevToolsHook();
4373
+ if (!target9.__VUE_DEVTOOLS_GLOBAL_HOOK__) {
4374
+ target9.__VUE_DEVTOOLS_GLOBAL_HOOK__ = createDevToolsHook();
4375
+ } else {
4376
+ if (!isNuxtApp) {
4377
+ Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, createDevToolsHook());
4378
+ }
4379
+ }
4350
4380
  hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4351
4381
  collectDevToolsPlugin(pluginDescriptor, setupFn);
4352
4382
  const { app, api } = devtoolsAppRecords.active || {};
@@ -4354,6 +4384,12 @@ function initDevTools() {
4354
4384
  return;
4355
4385
  setupExternalPlugin([pluginDescriptor, setupFn], app, api);
4356
4386
  });
4387
+ onLegacyDevToolsPluginApiAvailabled(() => {
4388
+ const normalizedPluginBuffer = devtoolsState.pluginBuffer.filter(([item]) => item.id !== "components");
4389
+ normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => {
4390
+ target9.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn, { target: "legacy" });
4391
+ });
4392
+ });
4357
4393
  hook.on.vueAppInit(async (app, version) => {
4358
4394
  const record = createAppRecord(app);
4359
4395
  const api = new DevToolsPluginApi();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue/devtools-kit",
3
3
  "type": "module",
4
- "version": "7.0.20",
4
+ "version": "7.0.22",
5
5
  "author": "webfansplz",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -25,7 +25,7 @@
25
25
  "mitt": "^3.0.1",
26
26
  "perfect-debounce": "^1.0.0",
27
27
  "speakingurl": "^14.0.1",
28
- "@vue/devtools-shared": "^7.0.20"
28
+ "@vue/devtools-shared": "^7.0.22"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/speakingurl": "^13.0.6",