@vue/devtools-kit 8.0.0 → 8.0.2

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
@@ -24,10 +24,14 @@ var __toESM = (mod, isNodeMode, target$21) => (target$21 = mod != null ? __creat
24
24
  }) : target$21, mod));
25
25
 
26
26
  //#endregion
27
- const __vue_devtools_shared = __toESM(require("@vue/devtools-shared"));
28
- const perfect_debounce = __toESM(require("perfect-debounce"));
29
- const hookable = __toESM(require("hookable"));
30
- const birpc = __toESM(require("birpc"));
27
+ let __vue_devtools_shared = require("@vue/devtools-shared");
28
+ __vue_devtools_shared = __toESM(__vue_devtools_shared);
29
+ let perfect_debounce = require("perfect-debounce");
30
+ perfect_debounce = __toESM(perfect_debounce);
31
+ let hookable = require("hookable");
32
+ hookable = __toESM(hookable);
33
+ let birpc = require("birpc");
34
+ birpc = __toESM(birpc);
31
35
 
32
36
  //#region src/compat/index.ts
33
37
  function onLegacyDevToolsPluginApiAvailable(cb) {
@@ -127,8 +131,7 @@ function returnError(cb) {
127
131
  }
128
132
  function getComponentInstance(appRecord, instanceId) {
129
133
  instanceId = instanceId || `${appRecord.id}:root`;
130
- const instance = appRecord.instanceMap.get(instanceId);
131
- return instance || appRecord.instanceMap.get(":root");
134
+ return appRecord.instanceMap.get(instanceId) || appRecord.instanceMap.get(":root");
132
135
  }
133
136
  function ensurePropertyExists(obj, key, skipObjCheck = false) {
134
137
  return skipObjCheck ? key in obj : typeof obj === "object" && obj !== null ? key in obj : false;
@@ -317,8 +320,7 @@ function highlight(instance) {
317
320
  const bounds = getComponentBoundingRect(instance);
318
321
  if (!bounds.width && !bounds.height) return;
319
322
  const name = getInstanceName(instance);
320
- const container = getContainerElement();
321
- container ? update({
323
+ getContainerElement() ? update({
322
324
  bounds,
323
325
  name
324
326
  }) : create({
@@ -337,12 +339,10 @@ function inspectFn(e) {
337
339
  const instance = target$21.__vueParentComponent;
338
340
  if (instance) {
339
341
  inspectInstance = instance;
340
- const el = instance.vnode.el;
341
- if (el) {
342
+ if (instance.vnode.el) {
342
343
  const bounds = getComponentBoundingRect(instance);
343
344
  const name = getInstanceName(instance);
344
- const container = getContainerElement();
345
- container ? update({
345
+ getContainerElement() ? update({
346
346
  bounds,
347
347
  name
348
348
  }) : create({
@@ -515,10 +515,11 @@ const Fragment = Symbol.for("v-fgt");
515
515
  //#endregion
516
516
  //#region src/core/component/state/editor.ts
517
517
  var StateEditor = class {
518
- refEditor = new RefStateEditor();
518
+ constructor() {
519
+ this.refEditor = new RefStateEditor();
520
+ }
519
521
  set(object, path, value, cb) {
520
522
  const sections = Array.isArray(path) ? path : path.split(".");
521
- const markRef = false;
522
523
  while (sections.length > 1) {
523
524
  const section = sections.shift();
524
525
  if (object instanceof Map) object = object.get(section);
@@ -734,12 +735,10 @@ function getInspector(id, app) {
734
735
  return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
735
736
  }
736
737
  function getInspectorActions(id) {
737
- const inspector = getInspector(id);
738
- return inspector?.options.actions;
738
+ return getInspector(id)?.options.actions;
739
739
  }
740
740
  function getInspectorNodeActions(id) {
741
- const inspector = getInspector(id);
742
- return inspector?.options.nodeActions;
741
+ return getInspector(id)?.options.nodeActions;
743
742
  }
744
743
 
745
744
  //#endregion
@@ -843,13 +842,12 @@ function createDevToolsCtxHooks() {
843
842
  addTimelineLayer(options, plugin.descriptor);
844
843
  });
845
844
  hooks$1.hook(DevToolsContextHookKeys.TIMELINE_EVENT_ADDED, ({ options, plugin }) => {
846
- const internalLayerIds = [
845
+ if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && ![
847
846
  "performance",
848
847
  "component-event",
849
848
  "keyboard",
850
849
  "mouse"
851
- ];
852
- if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && !internalLayerIds.includes(options.layerId)) return;
850
+ ].includes(options.layerId)) return;
853
851
  hooks$1.callHookWith(async (callbacks) => {
854
852
  await Promise.all(callbacks.map((cb) => cb(options)));
855
853
  }, DevToolsMessagingHookKeys.SEND_TIMELINE_EVENT_TO_CLIENT);
@@ -858,16 +856,13 @@ function createDevToolsCtxHooks() {
858
856
  const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
859
857
  if (!appRecord) return null;
860
858
  const appId = appRecord.id.toString();
861
- const instances = [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
862
- return instances;
859
+ return [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
863
860
  });
864
861
  hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_BOUNDS, async ({ instance }) => {
865
- const bounds = getComponentBoundingRect(instance);
866
- return bounds;
862
+ return getComponentBoundingRect(instance);
867
863
  });
868
864
  hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_NAME, ({ instance }) => {
869
- const name = getInstanceName(instance);
870
- return name;
865
+ return getInstanceName(instance);
871
866
  });
872
867
  hooks$1.hook(DevToolsContextHookKeys.COMPONENT_HIGHLIGHT, ({ uid }) => {
873
868
  const instance = activeAppRecord.value.instanceMap.get(uid);
@@ -957,7 +952,7 @@ const devtoolsState = new Proxy(__vue_devtools_shared.target[STATE_KEY], {
957
952
  return true;
958
953
  },
959
954
  set(target$21, property, value) {
960
- const oldState = { ...__vue_devtools_shared.target[STATE_KEY] };
955
+ ({ ...__vue_devtools_shared.target[STATE_KEY] });
961
956
  target$21[property] = value;
962
957
  __vue_devtools_shared.target[STATE_KEY][property] = value;
963
958
  return true;
@@ -1076,8 +1071,7 @@ function getPluginLocalKey(pluginId) {
1076
1071
  return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
1077
1072
  }
1078
1073
  function getPluginSettingsOptions(pluginId) {
1079
- const item = devtoolsPluginBuffer.find((item$1) => item$1[0].id === pluginId && !!item$1[0]?.settings)?.[0] ?? null;
1080
- return item?.settings ?? null;
1074
+ return (devtoolsPluginBuffer.find((item) => item[0].id === pluginId && !!item[0]?.settings)?.[0] ?? null)?.settings ?? null;
1081
1075
  }
1082
1076
  function getPluginSettings(pluginId, fallbackValue) {
1083
1077
  const localKey = getPluginLocalKey(pluginId);
@@ -1093,8 +1087,7 @@ function getPluginSettings(pluginId, fallbackValue) {
1093
1087
  }
1094
1088
  function initPluginSettings(pluginId, settings) {
1095
1089
  const localKey = getPluginLocalKey(pluginId);
1096
- const localSettings = localStorage.getItem(localKey);
1097
- if (!localSettings) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1090
+ if (!localStorage.getItem(localKey)) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1098
1091
  }
1099
1092
  function setPluginSettings(pluginId, key, value) {
1100
1093
  const localKey = getPluginLocalKey(pluginId);
@@ -1252,8 +1245,6 @@ const hook = {
1252
1245
  //#endregion
1253
1246
  //#region src/api/v6/index.ts
1254
1247
  var DevToolsV6PluginAPI = class {
1255
- plugin;
1256
- hooks;
1257
1248
  constructor({ plugin, ctx }) {
1258
1249
  this.hooks = ctx.hooks;
1259
1250
  this.plugin = plugin;
@@ -1654,11 +1645,10 @@ function processSetupState(instance) {
1654
1645
  editable: isState && !info.readonly
1655
1646
  };
1656
1647
  }
1657
- const type = isOtherType ? "setup (other)" : "setup";
1658
1648
  return {
1659
1649
  key,
1660
1650
  value,
1661
- type,
1651
+ type: isOtherType ? "setup (other)" : "setup",
1662
1652
  ...result
1663
1653
  };
1664
1654
  });
@@ -1779,7 +1769,6 @@ function getInstanceState(params) {
1779
1769
  //#endregion
1780
1770
  //#region src/core/component/tree/filter.ts
1781
1771
  var ComponentFilter = class {
1782
- filter;
1783
1772
  constructor(filter) {
1784
1773
  this.filter = filter || "";
1785
1774
  }
@@ -1801,12 +1790,8 @@ function createComponentFilter(filterText) {
1801
1790
  //#endregion
1802
1791
  //#region src/core/component/tree/walker.ts
1803
1792
  var ComponentWalker = class {
1804
- maxDepth;
1805
- recursively;
1806
- componentFilter;
1807
- api;
1808
- captureIds = /* @__PURE__ */ new Map();
1809
1793
  constructor(options) {
1794
+ this.captureIds = /* @__PURE__ */ new Map();
1810
1795
  const { filterText = "", maxDepth, recursively, api } = options;
1811
1796
  this.componentFilter = createComponentFilter(filterText);
1812
1797
  this.maxDepth = maxDepth;
@@ -1878,8 +1863,7 @@ var ComponentWalker = class {
1878
1863
  if (node) treeNode.children.push(node);
1879
1864
  }
1880
1865
  }
1881
- const rootElements = getRootElementsFromComponentInstance(instance);
1882
- const firstElement = rootElements[0];
1866
+ const firstElement = getRootElementsFromComponentInstance(instance)[0];
1883
1867
  if (firstElement?.parentElement) {
1884
1868
  const parentInstance = instance.parent;
1885
1869
  const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
@@ -2200,15 +2184,12 @@ function createComponentsDevToolsPlugin(app) {
2200
2184
  api.on.getInspectorTree(async (payload) => {
2201
2185
  if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
2202
2186
  const instance = getComponentInstance(activeAppRecord.value, payload.instanceId);
2203
- if (instance) {
2204
- const walker$1 = new ComponentWalker({
2205
- filterText: payload.filter,
2206
- maxDepth: 100,
2207
- recursively: false,
2208
- api
2209
- });
2210
- payload.rootNodes = await walker$1.getComponentTree(instance);
2211
- }
2187
+ if (instance) payload.rootNodes = await new ComponentWalker({
2188
+ filterText: payload.filter,
2189
+ maxDepth: 100,
2190
+ recursively: false,
2191
+ api
2192
+ }).getComponentTree(instance);
2212
2193
  }
2213
2194
  });
2214
2195
  api.on.getInspectorState(async (payload) => {
@@ -2240,7 +2221,7 @@ function createComponentsDevToolsPlugin(app) {
2240
2221
  const debounceSendInspectorState = (0, perfect_debounce.debounce)(() => {
2241
2222
  api.sendInspectorState(INSPECTOR_ID);
2242
2223
  }, 120);
2243
- const componentAddedCleanup = hook.on.componentAdded(async (app$1, uid, parentUid, component) => {
2224
+ hook.on.componentAdded(async (app$1, uid, parentUid, component) => {
2244
2225
  if (devtoolsState.highPerfModeEnabled) return;
2245
2226
  if (app$1?._instance?.type?.devtools?.hide) return;
2246
2227
  if (!app$1 || typeof uid !== "number" && !uid || !component) return;
@@ -2260,7 +2241,7 @@ function createComponentsDevToolsPlugin(app) {
2260
2241
  if (!appRecord) return;
2261
2242
  debounceSendInspectorTree();
2262
2243
  });
2263
- const componentUpdatedCleanup = hook.on.componentUpdated(async (app$1, uid, parentUid, component) => {
2244
+ hook.on.componentUpdated(async (app$1, uid, parentUid, component) => {
2264
2245
  if (devtoolsState.highPerfModeEnabled) return;
2265
2246
  if (app$1?._instance?.type?.devtools?.hide) return;
2266
2247
  if (!app$1 || typeof uid !== "number" && !uid || !component) return;
@@ -2281,7 +2262,7 @@ function createComponentsDevToolsPlugin(app) {
2281
2262
  debounceSendInspectorTree();
2282
2263
  debounceSendInspectorState();
2283
2264
  });
2284
- const componentRemovedCleanup = hook.on.componentRemoved(async (app$1, uid, parentUid, component) => {
2265
+ hook.on.componentRemoved(async (app$1, uid, parentUid, component) => {
2285
2266
  if (devtoolsState.highPerfModeEnabled) return;
2286
2267
  if (app$1?._instance?.type?.devtools?.hide) return;
2287
2268
  if (!app$1 || typeof uid !== "number" && !uid || !component) return;
@@ -2538,9 +2519,8 @@ const devtoolsContext = __vue_devtools_shared.target.__VUE_DEVTOOLS_KIT_CONTEXT_
2538
2519
 
2539
2520
  //#endregion
2540
2521
  //#region ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js
2541
- var require_speakingurl$1 = __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(exports, module) {
2522
+ var require_speakingurl$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js": ((exports, module) => {
2542
2523
  (function(root) {
2543
- "use strict";
2544
2524
  /**
2545
2525
  * charMap
2546
2526
  * @type {Object}
@@ -4001,17 +3981,17 @@ var require_speakingurl$1 = __commonJS({ "../../node_modules/.pnpm/speakingurl@1
4001
3981
  }
4002
3982
  } catch (e) {}
4003
3983
  })(exports);
4004
- } });
3984
+ }) });
4005
3985
 
4006
3986
  //#endregion
4007
3987
  //#region ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js
4008
- var require_speakingurl = __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(exports, module) {
3988
+ var require_speakingurl = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js": ((exports, module) => {
4009
3989
  module.exports = require_speakingurl$1();
4010
- } });
3990
+ }) });
4011
3991
 
4012
3992
  //#endregion
4013
3993
  //#region src/core/app/index.ts
4014
- var import_speakingurl = __toESM(require_speakingurl(), 1);
3994
+ var import_speakingurl = /* @__PURE__ */ __toESM(require_speakingurl(), 1);
4015
3995
  const appRecordInfo = __vue_devtools_shared.target.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ ??= {
4016
3996
  id: 0,
4017
3997
  appIds: /* @__PURE__ */ new Set()
@@ -4171,15 +4151,13 @@ function initDevTools() {
4171
4151
  callDevToolsPluginSetupFn([pluginDescriptor, setupFn], app);
4172
4152
  });
4173
4153
  onLegacyDevToolsPluginApiAvailable(() => {
4174
- const normalizedPluginBuffer = devtoolsPluginBuffer.filter(([item]) => item.id !== "components");
4175
- normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => {
4154
+ devtoolsPluginBuffer.filter(([item]) => item.id !== "components").forEach(([pluginDescriptor, setupFn]) => {
4176
4155
  _devtoolsHook.emit(DevToolsHooks.SETUP_DEVTOOLS_PLUGIN, pluginDescriptor, setupFn, { target: "legacy" });
4177
4156
  });
4178
4157
  });
4179
4158
  hook.on.vueAppInit(async (app, version, types) => {
4180
- const appRecord = createAppRecord(app, types);
4181
4159
  const normalizedAppRecord = {
4182
- ...appRecord,
4160
+ ...createAppRecord(app, types),
4183
4161
  app,
4184
4162
  version
4185
4163
  };
@@ -4259,7 +4237,7 @@ function reviveMap(val) {
4259
4237
  return result;
4260
4238
  }
4261
4239
  function revive(val) {
4262
- if (val === UNDEFINED) return void 0;
4240
+ if (val === UNDEFINED) return;
4263
4241
  else if (val === INFINITY) return Number.POSITIVE_INFINITY;
4264
4242
  else if (val === NEGATIVE_INFINITY) return Number.NEGATIVE_INFINITY;
4265
4243
  else if (val === NAN) return NaN;
@@ -4308,10 +4286,8 @@ function formatInspectorStateValue(value, quotes = false, options) {
4308
4286
  const type = getInspectorStateValueType(value, false);
4309
4287
  if (type !== "custom" && value?._custom) value = value._custom.value;
4310
4288
  if (result = internalStateTokenToString(value)) return result;
4311
- else if (type === "custom") {
4312
- const nestedName = value._custom.value?._custom && formatInspectorStateValue(value._custom.value, quotes, options);
4313
- return nestedName || value._custom.displayText || value._custom.display;
4314
- } else if (type === "array") return `Array[${value.length}]`;
4289
+ else if (type === "custom") return value._custom.value?._custom && formatInspectorStateValue(value._custom.value, quotes, options) || value._custom.displayText || value._custom.display;
4290
+ else if (type === "array") return `Array[${value.length}]`;
4315
4291
  else if (type === "plain-object") return `Object${Object.keys(value).length ? "" : " (empty)"}`;
4316
4292
  else if (type?.includes("native")) return escape(specialTypeRE.exec(value)?.[2]);
4317
4293
  else if (typeof value === "string") {
@@ -4452,7 +4428,6 @@ function find(record, predicate) {
4452
4428
  const value = valuesNotNever[i];
4453
4429
  if (predicate(value)) return value;
4454
4430
  }
4455
- return void 0;
4456
4431
  }
4457
4432
  function forEach(record, run) {
4458
4433
  Object.entries(record).forEach(([key, value]) => run(value, key));
@@ -4465,7 +4440,6 @@ function findArr(record, predicate) {
4465
4440
  const value = record[i];
4466
4441
  if (predicate(value)) return value;
4467
4442
  }
4468
- return void 0;
4469
4443
  }
4470
4444
 
4471
4445
  //#endregion
@@ -4523,14 +4497,12 @@ const parsePath = (string) => {
4523
4497
  let segment = "";
4524
4498
  for (let i = 0; i < string.length; i++) {
4525
4499
  let char = string.charAt(i);
4526
- const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
4527
- if (isEscapedDot) {
4500
+ if (char === "\\" && string.charAt(i + 1) === ".") {
4528
4501
  segment += ".";
4529
4502
  i++;
4530
4503
  continue;
4531
4504
  }
4532
- const isEndOfSegment = char === ".";
4533
- if (isEndOfSegment) {
4505
+ if (char === ".") {
4534
4506
  result.push(segment);
4535
4507
  segment = "";
4536
4508
  continue;
@@ -4604,14 +4576,10 @@ function compositeTransformation(isApplicable, annotation, transform, untransfor
4604
4576
  };
4605
4577
  }
4606
4578
  const symbolRule = compositeTransformation((s, superJson) => {
4607
- if (isSymbol(s)) {
4608
- const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
4609
- return isRegistered;
4610
- }
4579
+ if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
4611
4580
  return false;
4612
4581
  }, (s, superJson) => {
4613
- const identifier = superJson.symbolRegistry.getIdentifier(s);
4614
- return ["symbol", identifier];
4582
+ return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
4615
4583
  }, (v) => v.description, (_, a, superJson) => {
4616
4584
  const value = superJson.symbolRegistry.getValue(a[1]);
4617
4585
  if (!value) throw new Error("Trying to deserialize unknown symbol");
@@ -4637,15 +4605,11 @@ const typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-arra
4637
4605
  return new ctor(v);
4638
4606
  });
4639
4607
  function isInstanceOfRegisteredClass(potentialClass, superJson) {
4640
- if (potentialClass?.constructor) {
4641
- const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4642
- return isRegistered;
4643
- }
4608
+ if (potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4644
4609
  return false;
4645
4610
  }
4646
4611
  const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
4647
- const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
4648
- return ["class", identifier];
4612
+ return ["class", superJson.classRegistry.getIdentifier(clazz.constructor)];
4649
4613
  }, (clazz, superJson) => {
4650
4614
  const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
4651
4615
  if (!allowedProps) return { ...clazz };
@@ -4662,11 +4626,9 @@ const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, s
4662
4626
  const customRule = compositeTransformation((value, superJson) => {
4663
4627
  return !!superJson.customTransformerRegistry.findApplicable(value);
4664
4628
  }, (value, superJson) => {
4665
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
4666
- return ["custom", transformer.name];
4629
+ return ["custom", superJson.customTransformerRegistry.findApplicable(value).name];
4667
4630
  }, (value, superJson) => {
4668
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
4669
- return transformer.serialize(value);
4631
+ return superJson.customTransformerRegistry.findApplicable(value).serialize(value);
4670
4632
  }, (v, a, superJson) => {
4671
4633
  const transformer = superJson.customTransformerRegistry.findByName(a[1]);
4672
4634
  if (!transformer) throw new Error("Trying to deserialize unknown custom value");
@@ -4689,7 +4651,6 @@ const transformValue = (value, superJson) => {
4689
4651
  value: applicableSimpleRule.transform(value, superJson),
4690
4652
  type: applicableSimpleRule.annotation
4691
4653
  };
4692
- return void 0;
4693
4654
  };
4694
4655
  const simpleRulesByAnnotation = {};
4695
4656
  simpleRules.forEach((rule) => {
@@ -4761,8 +4722,7 @@ const setDeep = (object, path, mapper) => {
4761
4722
  const row = +key;
4762
4723
  parent = getNthKey(parent, row);
4763
4724
  } else if (isMap(parent)) {
4764
- const isEnd = i === path.length - 2;
4765
- if (isEnd) break;
4725
+ if (i === path.length - 2) break;
4766
4726
  const row = +key;
4767
4727
  const type = +path[++i] === 0 ? "key" : "value";
4768
4728
  const keyOfRow = getNthKey(parent, row);
@@ -4790,18 +4750,16 @@ const setDeep = (object, path, mapper) => {
4790
4750
  if (isMap(parent)) {
4791
4751
  const row = +path[path.length - 2];
4792
4752
  const keyToRow = getNthKey(parent, row);
4793
- const type = +lastKey === 0 ? "key" : "value";
4794
- switch (type) {
4753
+ switch (+lastKey === 0 ? "key" : "value") {
4795
4754
  case "key": {
4796
4755
  const newKey = mapper(keyToRow);
4797
4756
  parent.set(newKey, parent.get(keyToRow));
4798
4757
  if (newKey !== keyToRow) parent.delete(keyToRow);
4799
4758
  break;
4800
4759
  }
4801
- case "value": {
4760
+ case "value":
4802
4761
  parent.set(keyToRow, mapper(parent.get(keyToRow)));
4803
4762
  break;
4804
- }
4805
4763
  }
4806
4764
  }
4807
4765
  return object;
@@ -5279,8 +5237,7 @@ function createIframeServerChannel() {
5279
5237
  };
5280
5238
  return {
5281
5239
  post: (data) => {
5282
- const iframe = getIframeServerContext();
5283
- iframe?.contentWindow?.postMessage(SuperJSON.stringify({
5240
+ getIframeServerContext()?.contentWindow?.postMessage(SuperJSON.stringify({
5284
5241
  event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5285
5242
  data
5286
5243
  }), "*");
@@ -5482,11 +5439,10 @@ function getDateDetails(val) {
5482
5439
  } };
5483
5440
  }
5484
5441
  function getMapDetails(val) {
5485
- const list = Object.fromEntries(val);
5486
5442
  return { _custom: {
5487
5443
  type: "map",
5488
5444
  displayText: "Map",
5489
- value: list,
5445
+ value: Object.fromEntries(val),
5490
5446
  readOnly: true,
5491
5447
  fields: { abstract: true }
5492
5448
  } };
@@ -5608,8 +5564,7 @@ function tryGetRefValue(ref) {
5608
5564
  }
5609
5565
  function getObjectDetails(object) {
5610
5566
  const info = getSetupStateType(object);
5611
- const isState = info.ref || info.computed || info.reactive;
5612
- if (isState) {
5567
+ if (info.ref || info.computed || info.reactive) {
5613
5568
  const stateTypeName = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
5614
5569
  const value = toRaw(info.reactive ? object : tryGetRefValue(object));
5615
5570
  const raw = ensurePropertyExists(object, "effect") ? object.effect?.raw?.toString() || object.effect?.fn?.toString() : null;
@@ -5791,8 +5746,7 @@ function stringifyStrictCircularAutoChunks(data, replacer = null, space = null)
5791
5746
  }
5792
5747
  function parseCircularAutoChunks(data, reviver$1 = null) {
5793
5748
  if (Array.isArray(data)) data = data.join("");
5794
- const hasCircular = /^\s/.test(data);
5795
- if (!hasCircular) return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver$1);
5749
+ if (!/^\s/.test(data)) return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver$1);
5796
5750
  else {
5797
5751
  const list = JSON.parse(data);
5798
5752
  decode(list, reviver$1);
package/dist/index.d.cts CHANGED
@@ -244,8 +244,16 @@ interface DevToolsState {
244
244
  perfUniqueGroupId: number;
245
245
  timelineLayersState: Record<string, boolean>;
246
246
  }
247
- declare const callStateUpdatedHook: (state: DevToolsState) => Promise<void>;
248
- declare const callConnectedUpdatedHook: (state: DevToolsState, oldState: DevToolsState) => Promise<void>;
247
+ declare const callStateUpdatedHook: ((state: DevToolsState) => Promise<void>) & {
248
+ cancel: () => void;
249
+ flush: () => Promise<void> | undefined;
250
+ isPending: () => boolean;
251
+ };
252
+ declare const callConnectedUpdatedHook: ((state: DevToolsState, oldState: DevToolsState) => Promise<void>) & {
253
+ cancel: () => void;
254
+ flush: () => Promise<void> | undefined;
255
+ isPending: () => boolean;
256
+ };
249
257
  declare const devtoolsAppRecords: DevToolsAppRecords[] & {
250
258
  value: DevToolsAppRecords[];
251
259
  };
@@ -554,7 +562,11 @@ interface DevToolsKitInspector {
554
562
  appRecord: unknown;
555
563
  }
556
564
  declare const devtoolsInspector: DevToolsKitInspector[];
557
- declare const callInspectorUpdatedHook: () => Promise<void>;
565
+ declare const callInspectorUpdatedHook: (() => Promise<void>) & {
566
+ cancel: () => void;
567
+ flush: () => Promise<void> | undefined;
568
+ isPending: () => boolean;
569
+ };
558
570
  declare function addInspector(inspector: CustomInspectorOptions, descriptor: PluginDescriptor): void;
559
571
  declare function getActiveInspectors(): {
560
572
  id: string;
package/dist/index.d.ts CHANGED
@@ -244,8 +244,16 @@ interface DevToolsState {
244
244
  perfUniqueGroupId: number;
245
245
  timelineLayersState: Record<string, boolean>;
246
246
  }
247
- declare const callStateUpdatedHook: (state: DevToolsState) => Promise<void>;
248
- declare const callConnectedUpdatedHook: (state: DevToolsState, oldState: DevToolsState) => Promise<void>;
247
+ declare const callStateUpdatedHook: ((state: DevToolsState) => Promise<void>) & {
248
+ cancel: () => void;
249
+ flush: () => Promise<void> | undefined;
250
+ isPending: () => boolean;
251
+ };
252
+ declare const callConnectedUpdatedHook: ((state: DevToolsState, oldState: DevToolsState) => Promise<void>) & {
253
+ cancel: () => void;
254
+ flush: () => Promise<void> | undefined;
255
+ isPending: () => boolean;
256
+ };
249
257
  declare const devtoolsAppRecords: DevToolsAppRecords[] & {
250
258
  value: DevToolsAppRecords[];
251
259
  };
@@ -554,7 +562,11 @@ interface DevToolsKitInspector {
554
562
  appRecord: unknown;
555
563
  }
556
564
  declare const devtoolsInspector: DevToolsKitInspector[];
557
- declare const callInspectorUpdatedHook: () => Promise<void>;
565
+ declare const callInspectorUpdatedHook: (() => Promise<void>) & {
566
+ cancel: () => void;
567
+ flush: () => Promise<void> | undefined;
568
+ isPending: () => boolean;
569
+ };
558
570
  declare function addInspector(inspector: CustomInspectorOptions, descriptor: PluginDescriptor): void;
559
571
  declare function getActiveInspectors(): {
560
572
  id: string;
package/dist/index.js CHANGED
@@ -127,8 +127,7 @@ function returnError(cb) {
127
127
  }
128
128
  function getComponentInstance(appRecord, instanceId) {
129
129
  instanceId = instanceId || `${appRecord.id}:root`;
130
- const instance = appRecord.instanceMap.get(instanceId);
131
- return instance || appRecord.instanceMap.get(":root");
130
+ return appRecord.instanceMap.get(instanceId) || appRecord.instanceMap.get(":root");
132
131
  }
133
132
  function ensurePropertyExists(obj, key, skipObjCheck = false) {
134
133
  return skipObjCheck ? key in obj : typeof obj === "object" && obj !== null ? key in obj : false;
@@ -317,8 +316,7 @@ function highlight(instance) {
317
316
  const bounds = getComponentBoundingRect(instance);
318
317
  if (!bounds.width && !bounds.height) return;
319
318
  const name = getInstanceName(instance);
320
- const container = getContainerElement();
321
- container ? update({
319
+ getContainerElement() ? update({
322
320
  bounds,
323
321
  name
324
322
  }) : create({
@@ -337,12 +335,10 @@ function inspectFn(e) {
337
335
  const instance = target$1.__vueParentComponent;
338
336
  if (instance) {
339
337
  inspectInstance = instance;
340
- const el = instance.vnode.el;
341
- if (el) {
338
+ if (instance.vnode.el) {
342
339
  const bounds = getComponentBoundingRect(instance);
343
340
  const name = getInstanceName(instance);
344
- const container = getContainerElement();
345
- container ? update({
341
+ getContainerElement() ? update({
346
342
  bounds,
347
343
  name
348
344
  }) : create({
@@ -515,10 +511,11 @@ const Fragment = Symbol.for("v-fgt");
515
511
  //#endregion
516
512
  //#region src/core/component/state/editor.ts
517
513
  var StateEditor = class {
518
- refEditor = new RefStateEditor();
514
+ constructor() {
515
+ this.refEditor = new RefStateEditor();
516
+ }
519
517
  set(object, path, value, cb) {
520
518
  const sections = Array.isArray(path) ? path : path.split(".");
521
- const markRef = false;
522
519
  while (sections.length > 1) {
523
520
  const section = sections.shift();
524
521
  if (object instanceof Map) object = object.get(section);
@@ -734,12 +731,10 @@ function getInspector(id, app) {
734
731
  return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
735
732
  }
736
733
  function getInspectorActions(id) {
737
- const inspector = getInspector(id);
738
- return inspector?.options.actions;
734
+ return getInspector(id)?.options.actions;
739
735
  }
740
736
  function getInspectorNodeActions(id) {
741
- const inspector = getInspector(id);
742
- return inspector?.options.nodeActions;
737
+ return getInspector(id)?.options.nodeActions;
743
738
  }
744
739
 
745
740
  //#endregion
@@ -843,13 +838,12 @@ function createDevToolsCtxHooks() {
843
838
  addTimelineLayer(options, plugin.descriptor);
844
839
  });
845
840
  hooks$1.hook(DevToolsContextHookKeys.TIMELINE_EVENT_ADDED, ({ options, plugin }) => {
846
- const internalLayerIds = [
841
+ if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && ![
847
842
  "performance",
848
843
  "component-event",
849
844
  "keyboard",
850
845
  "mouse"
851
- ];
852
- if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && !internalLayerIds.includes(options.layerId)) return;
846
+ ].includes(options.layerId)) return;
853
847
  hooks$1.callHookWith(async (callbacks) => {
854
848
  await Promise.all(callbacks.map((cb) => cb(options)));
855
849
  }, DevToolsMessagingHookKeys.SEND_TIMELINE_EVENT_TO_CLIENT);
@@ -858,16 +852,13 @@ function createDevToolsCtxHooks() {
858
852
  const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
859
853
  if (!appRecord) return null;
860
854
  const appId = appRecord.id.toString();
861
- const instances = [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
862
- return instances;
855
+ return [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
863
856
  });
864
857
  hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_BOUNDS, async ({ instance }) => {
865
- const bounds = getComponentBoundingRect(instance);
866
- return bounds;
858
+ return getComponentBoundingRect(instance);
867
859
  });
868
860
  hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_NAME, ({ instance }) => {
869
- const name = getInstanceName(instance);
870
- return name;
861
+ return getInstanceName(instance);
871
862
  });
872
863
  hooks$1.hook(DevToolsContextHookKeys.COMPONENT_HIGHLIGHT, ({ uid }) => {
873
864
  const instance = activeAppRecord.value.instanceMap.get(uid);
@@ -957,7 +948,7 @@ const devtoolsState = new Proxy(target[STATE_KEY], {
957
948
  return true;
958
949
  },
959
950
  set(target$1, property, value) {
960
- const oldState = { ...target[STATE_KEY] };
951
+ ({ ...target[STATE_KEY] });
961
952
  target$1[property] = value;
962
953
  target[STATE_KEY][property] = value;
963
954
  return true;
@@ -1076,8 +1067,7 @@ function getPluginLocalKey(pluginId) {
1076
1067
  return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
1077
1068
  }
1078
1069
  function getPluginSettingsOptions(pluginId) {
1079
- const item = devtoolsPluginBuffer.find((item$1) => item$1[0].id === pluginId && !!item$1[0]?.settings)?.[0] ?? null;
1080
- return item?.settings ?? null;
1070
+ return (devtoolsPluginBuffer.find((item) => item[0].id === pluginId && !!item[0]?.settings)?.[0] ?? null)?.settings ?? null;
1081
1071
  }
1082
1072
  function getPluginSettings(pluginId, fallbackValue) {
1083
1073
  const localKey = getPluginLocalKey(pluginId);
@@ -1093,8 +1083,7 @@ function getPluginSettings(pluginId, fallbackValue) {
1093
1083
  }
1094
1084
  function initPluginSettings(pluginId, settings) {
1095
1085
  const localKey = getPluginLocalKey(pluginId);
1096
- const localSettings = localStorage.getItem(localKey);
1097
- if (!localSettings) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1086
+ if (!localStorage.getItem(localKey)) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1098
1087
  }
1099
1088
  function setPluginSettings(pluginId, key, value) {
1100
1089
  const localKey = getPluginLocalKey(pluginId);
@@ -1252,8 +1241,6 @@ const hook = {
1252
1241
  //#endregion
1253
1242
  //#region src/api/v6/index.ts
1254
1243
  var DevToolsV6PluginAPI = class {
1255
- plugin;
1256
- hooks;
1257
1244
  constructor({ plugin, ctx }) {
1258
1245
  this.hooks = ctx.hooks;
1259
1246
  this.plugin = plugin;
@@ -1654,11 +1641,10 @@ function processSetupState(instance) {
1654
1641
  editable: isState && !info.readonly
1655
1642
  };
1656
1643
  }
1657
- const type = isOtherType ? "setup (other)" : "setup";
1658
1644
  return {
1659
1645
  key,
1660
1646
  value,
1661
- type,
1647
+ type: isOtherType ? "setup (other)" : "setup",
1662
1648
  ...result
1663
1649
  };
1664
1650
  });
@@ -1779,7 +1765,6 @@ function getInstanceState(params) {
1779
1765
  //#endregion
1780
1766
  //#region src/core/component/tree/filter.ts
1781
1767
  var ComponentFilter = class {
1782
- filter;
1783
1768
  constructor(filter) {
1784
1769
  this.filter = filter || "";
1785
1770
  }
@@ -1801,12 +1786,8 @@ function createComponentFilter(filterText) {
1801
1786
  //#endregion
1802
1787
  //#region src/core/component/tree/walker.ts
1803
1788
  var ComponentWalker = class {
1804
- maxDepth;
1805
- recursively;
1806
- componentFilter;
1807
- api;
1808
- captureIds = /* @__PURE__ */ new Map();
1809
1789
  constructor(options) {
1790
+ this.captureIds = /* @__PURE__ */ new Map();
1810
1791
  const { filterText = "", maxDepth, recursively, api } = options;
1811
1792
  this.componentFilter = createComponentFilter(filterText);
1812
1793
  this.maxDepth = maxDepth;
@@ -1878,8 +1859,7 @@ var ComponentWalker = class {
1878
1859
  if (node) treeNode.children.push(node);
1879
1860
  }
1880
1861
  }
1881
- const rootElements = getRootElementsFromComponentInstance(instance);
1882
- const firstElement = rootElements[0];
1862
+ const firstElement = getRootElementsFromComponentInstance(instance)[0];
1883
1863
  if (firstElement?.parentElement) {
1884
1864
  const parentInstance = instance.parent;
1885
1865
  const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
@@ -2200,15 +2180,12 @@ function createComponentsDevToolsPlugin(app) {
2200
2180
  api.on.getInspectorTree(async (payload) => {
2201
2181
  if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
2202
2182
  const instance = getComponentInstance(activeAppRecord.value, payload.instanceId);
2203
- if (instance) {
2204
- const walker$1 = new ComponentWalker({
2205
- filterText: payload.filter,
2206
- maxDepth: 100,
2207
- recursively: false,
2208
- api
2209
- });
2210
- payload.rootNodes = await walker$1.getComponentTree(instance);
2211
- }
2183
+ if (instance) payload.rootNodes = await new ComponentWalker({
2184
+ filterText: payload.filter,
2185
+ maxDepth: 100,
2186
+ recursively: false,
2187
+ api
2188
+ }).getComponentTree(instance);
2212
2189
  }
2213
2190
  });
2214
2191
  api.on.getInspectorState(async (payload) => {
@@ -2240,7 +2217,7 @@ function createComponentsDevToolsPlugin(app) {
2240
2217
  const debounceSendInspectorState = debounce(() => {
2241
2218
  api.sendInspectorState(INSPECTOR_ID);
2242
2219
  }, 120);
2243
- const componentAddedCleanup = hook.on.componentAdded(async (app$1, uid, parentUid, component) => {
2220
+ hook.on.componentAdded(async (app$1, uid, parentUid, component) => {
2244
2221
  if (devtoolsState.highPerfModeEnabled) return;
2245
2222
  if (app$1?._instance?.type?.devtools?.hide) return;
2246
2223
  if (!app$1 || typeof uid !== "number" && !uid || !component) return;
@@ -2260,7 +2237,7 @@ function createComponentsDevToolsPlugin(app) {
2260
2237
  if (!appRecord) return;
2261
2238
  debounceSendInspectorTree();
2262
2239
  });
2263
- const componentUpdatedCleanup = hook.on.componentUpdated(async (app$1, uid, parentUid, component) => {
2240
+ hook.on.componentUpdated(async (app$1, uid, parentUid, component) => {
2264
2241
  if (devtoolsState.highPerfModeEnabled) return;
2265
2242
  if (app$1?._instance?.type?.devtools?.hide) return;
2266
2243
  if (!app$1 || typeof uid !== "number" && !uid || !component) return;
@@ -2281,7 +2258,7 @@ function createComponentsDevToolsPlugin(app) {
2281
2258
  debounceSendInspectorTree();
2282
2259
  debounceSendInspectorState();
2283
2260
  });
2284
- const componentRemovedCleanup = hook.on.componentRemoved(async (app$1, uid, parentUid, component) => {
2261
+ hook.on.componentRemoved(async (app$1, uid, parentUid, component) => {
2285
2262
  if (devtoolsState.highPerfModeEnabled) return;
2286
2263
  if (app$1?._instance?.type?.devtools?.hide) return;
2287
2264
  if (!app$1 || typeof uid !== "number" && !uid || !component) return;
@@ -2538,9 +2515,8 @@ const devtoolsContext = target.__VUE_DEVTOOLS_KIT_CONTEXT__;
2538
2515
 
2539
2516
  //#endregion
2540
2517
  //#region ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js
2541
- var require_speakingurl$1 = __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(exports, module) {
2518
+ var require_speakingurl$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js": ((exports, module) => {
2542
2519
  (function(root) {
2543
- "use strict";
2544
2520
  /**
2545
2521
  * charMap
2546
2522
  * @type {Object}
@@ -4001,17 +3977,17 @@ var require_speakingurl$1 = __commonJS({ "../../node_modules/.pnpm/speakingurl@1
4001
3977
  }
4002
3978
  } catch (e) {}
4003
3979
  })(exports);
4004
- } });
3980
+ }) });
4005
3981
 
4006
3982
  //#endregion
4007
3983
  //#region ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js
4008
- var require_speakingurl = __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(exports, module) {
3984
+ var require_speakingurl = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js": ((exports, module) => {
4009
3985
  module.exports = require_speakingurl$1();
4010
- } });
3986
+ }) });
4011
3987
 
4012
3988
  //#endregion
4013
3989
  //#region src/core/app/index.ts
4014
- var import_speakingurl = __toESM(require_speakingurl(), 1);
3990
+ var import_speakingurl = /* @__PURE__ */ __toESM(require_speakingurl(), 1);
4015
3991
  const appRecordInfo = target.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ ??= {
4016
3992
  id: 0,
4017
3993
  appIds: /* @__PURE__ */ new Set()
@@ -4171,15 +4147,13 @@ function initDevTools() {
4171
4147
  callDevToolsPluginSetupFn([pluginDescriptor, setupFn], app);
4172
4148
  });
4173
4149
  onLegacyDevToolsPluginApiAvailable(() => {
4174
- const normalizedPluginBuffer = devtoolsPluginBuffer.filter(([item]) => item.id !== "components");
4175
- normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => {
4150
+ devtoolsPluginBuffer.filter(([item]) => item.id !== "components").forEach(([pluginDescriptor, setupFn]) => {
4176
4151
  _devtoolsHook.emit(DevToolsHooks.SETUP_DEVTOOLS_PLUGIN, pluginDescriptor, setupFn, { target: "legacy" });
4177
4152
  });
4178
4153
  });
4179
4154
  hook.on.vueAppInit(async (app, version, types) => {
4180
- const appRecord = createAppRecord(app, types);
4181
4155
  const normalizedAppRecord = {
4182
- ...appRecord,
4156
+ ...createAppRecord(app, types),
4183
4157
  app,
4184
4158
  version
4185
4159
  };
@@ -4259,7 +4233,7 @@ function reviveMap(val) {
4259
4233
  return result;
4260
4234
  }
4261
4235
  function revive(val) {
4262
- if (val === UNDEFINED) return void 0;
4236
+ if (val === UNDEFINED) return;
4263
4237
  else if (val === INFINITY) return Number.POSITIVE_INFINITY;
4264
4238
  else if (val === NEGATIVE_INFINITY) return Number.NEGATIVE_INFINITY;
4265
4239
  else if (val === NAN) return NaN;
@@ -4308,10 +4282,8 @@ function formatInspectorStateValue(value, quotes = false, options) {
4308
4282
  const type = getInspectorStateValueType(value, false);
4309
4283
  if (type !== "custom" && value?._custom) value = value._custom.value;
4310
4284
  if (result = internalStateTokenToString(value)) return result;
4311
- else if (type === "custom") {
4312
- const nestedName = value._custom.value?._custom && formatInspectorStateValue(value._custom.value, quotes, options);
4313
- return nestedName || value._custom.displayText || value._custom.display;
4314
- } else if (type === "array") return `Array[${value.length}]`;
4285
+ else if (type === "custom") return value._custom.value?._custom && formatInspectorStateValue(value._custom.value, quotes, options) || value._custom.displayText || value._custom.display;
4286
+ else if (type === "array") return `Array[${value.length}]`;
4315
4287
  else if (type === "plain-object") return `Object${Object.keys(value).length ? "" : " (empty)"}`;
4316
4288
  else if (type?.includes("native")) return escape(specialTypeRE.exec(value)?.[2]);
4317
4289
  else if (typeof value === "string") {
@@ -4452,7 +4424,6 @@ function find(record, predicate) {
4452
4424
  const value = valuesNotNever[i];
4453
4425
  if (predicate(value)) return value;
4454
4426
  }
4455
- return void 0;
4456
4427
  }
4457
4428
  function forEach(record, run) {
4458
4429
  Object.entries(record).forEach(([key, value]) => run(value, key));
@@ -4465,7 +4436,6 @@ function findArr(record, predicate) {
4465
4436
  const value = record[i];
4466
4437
  if (predicate(value)) return value;
4467
4438
  }
4468
- return void 0;
4469
4439
  }
4470
4440
 
4471
4441
  //#endregion
@@ -4523,14 +4493,12 @@ const parsePath = (string) => {
4523
4493
  let segment = "";
4524
4494
  for (let i = 0; i < string.length; i++) {
4525
4495
  let char = string.charAt(i);
4526
- const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
4527
- if (isEscapedDot) {
4496
+ if (char === "\\" && string.charAt(i + 1) === ".") {
4528
4497
  segment += ".";
4529
4498
  i++;
4530
4499
  continue;
4531
4500
  }
4532
- const isEndOfSegment = char === ".";
4533
- if (isEndOfSegment) {
4501
+ if (char === ".") {
4534
4502
  result.push(segment);
4535
4503
  segment = "";
4536
4504
  continue;
@@ -4604,14 +4572,10 @@ function compositeTransformation(isApplicable, annotation, transform, untransfor
4604
4572
  };
4605
4573
  }
4606
4574
  const symbolRule = compositeTransformation((s, superJson) => {
4607
- if (isSymbol(s)) {
4608
- const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
4609
- return isRegistered;
4610
- }
4575
+ if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
4611
4576
  return false;
4612
4577
  }, (s, superJson) => {
4613
- const identifier = superJson.symbolRegistry.getIdentifier(s);
4614
- return ["symbol", identifier];
4578
+ return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
4615
4579
  }, (v) => v.description, (_, a, superJson) => {
4616
4580
  const value = superJson.symbolRegistry.getValue(a[1]);
4617
4581
  if (!value) throw new Error("Trying to deserialize unknown symbol");
@@ -4637,15 +4601,11 @@ const typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-arra
4637
4601
  return new ctor(v);
4638
4602
  });
4639
4603
  function isInstanceOfRegisteredClass(potentialClass, superJson) {
4640
- if (potentialClass?.constructor) {
4641
- const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4642
- return isRegistered;
4643
- }
4604
+ if (potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4644
4605
  return false;
4645
4606
  }
4646
4607
  const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
4647
- const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
4648
- return ["class", identifier];
4608
+ return ["class", superJson.classRegistry.getIdentifier(clazz.constructor)];
4649
4609
  }, (clazz, superJson) => {
4650
4610
  const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
4651
4611
  if (!allowedProps) return { ...clazz };
@@ -4662,11 +4622,9 @@ const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, s
4662
4622
  const customRule = compositeTransformation((value, superJson) => {
4663
4623
  return !!superJson.customTransformerRegistry.findApplicable(value);
4664
4624
  }, (value, superJson) => {
4665
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
4666
- return ["custom", transformer.name];
4625
+ return ["custom", superJson.customTransformerRegistry.findApplicable(value).name];
4667
4626
  }, (value, superJson) => {
4668
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
4669
- return transformer.serialize(value);
4627
+ return superJson.customTransformerRegistry.findApplicable(value).serialize(value);
4670
4628
  }, (v, a, superJson) => {
4671
4629
  const transformer = superJson.customTransformerRegistry.findByName(a[1]);
4672
4630
  if (!transformer) throw new Error("Trying to deserialize unknown custom value");
@@ -4689,7 +4647,6 @@ const transformValue = (value, superJson) => {
4689
4647
  value: applicableSimpleRule.transform(value, superJson),
4690
4648
  type: applicableSimpleRule.annotation
4691
4649
  };
4692
- return void 0;
4693
4650
  };
4694
4651
  const simpleRulesByAnnotation = {};
4695
4652
  simpleRules.forEach((rule) => {
@@ -4761,8 +4718,7 @@ const setDeep = (object, path, mapper) => {
4761
4718
  const row = +key;
4762
4719
  parent = getNthKey(parent, row);
4763
4720
  } else if (isMap(parent)) {
4764
- const isEnd = i === path.length - 2;
4765
- if (isEnd) break;
4721
+ if (i === path.length - 2) break;
4766
4722
  const row = +key;
4767
4723
  const type = +path[++i] === 0 ? "key" : "value";
4768
4724
  const keyOfRow = getNthKey(parent, row);
@@ -4790,18 +4746,16 @@ const setDeep = (object, path, mapper) => {
4790
4746
  if (isMap(parent)) {
4791
4747
  const row = +path[path.length - 2];
4792
4748
  const keyToRow = getNthKey(parent, row);
4793
- const type = +lastKey === 0 ? "key" : "value";
4794
- switch (type) {
4749
+ switch (+lastKey === 0 ? "key" : "value") {
4795
4750
  case "key": {
4796
4751
  const newKey = mapper(keyToRow);
4797
4752
  parent.set(newKey, parent.get(keyToRow));
4798
4753
  if (newKey !== keyToRow) parent.delete(keyToRow);
4799
4754
  break;
4800
4755
  }
4801
- case "value": {
4756
+ case "value":
4802
4757
  parent.set(keyToRow, mapper(parent.get(keyToRow)));
4803
4758
  break;
4804
- }
4805
4759
  }
4806
4760
  }
4807
4761
  return object;
@@ -5279,8 +5233,7 @@ function createIframeServerChannel() {
5279
5233
  };
5280
5234
  return {
5281
5235
  post: (data) => {
5282
- const iframe = getIframeServerContext();
5283
- iframe?.contentWindow?.postMessage(SuperJSON.stringify({
5236
+ getIframeServerContext()?.contentWindow?.postMessage(SuperJSON.stringify({
5284
5237
  event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5285
5238
  data
5286
5239
  }), "*");
@@ -5482,11 +5435,10 @@ function getDateDetails(val) {
5482
5435
  } };
5483
5436
  }
5484
5437
  function getMapDetails(val) {
5485
- const list = Object.fromEntries(val);
5486
5438
  return { _custom: {
5487
5439
  type: "map",
5488
5440
  displayText: "Map",
5489
- value: list,
5441
+ value: Object.fromEntries(val),
5490
5442
  readOnly: true,
5491
5443
  fields: { abstract: true }
5492
5444
  } };
@@ -5608,8 +5560,7 @@ function tryGetRefValue(ref) {
5608
5560
  }
5609
5561
  function getObjectDetails(object) {
5610
5562
  const info = getSetupStateType(object);
5611
- const isState = info.ref || info.computed || info.reactive;
5612
- if (isState) {
5563
+ if (info.ref || info.computed || info.reactive) {
5613
5564
  const stateTypeName = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
5614
5565
  const value = toRaw(info.reactive ? object : tryGetRefValue(object));
5615
5566
  const raw = ensurePropertyExists(object, "effect") ? object.effect?.raw?.toString() || object.effect?.fn?.toString() : null;
@@ -5791,8 +5742,7 @@ function stringifyStrictCircularAutoChunks(data, replacer = null, space = null)
5791
5742
  }
5792
5743
  function parseCircularAutoChunks(data, reviver$1 = null) {
5793
5744
  if (Array.isArray(data)) data = data.join("");
5794
- const hasCircular = /^\s/.test(data);
5795
- if (!hasCircular) return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver$1);
5745
+ if (!/^\s/.test(data)) return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver$1);
5796
5746
  else {
5797
5747
  const list = JSON.parse(data);
5798
5748
  decode(list, reviver$1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue/devtools-kit",
3
3
  "type": "module",
4
- "version": "8.0.0",
4
+ "version": "8.0.2",
5
5
  "author": "webfansplz",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -26,14 +26,14 @@
26
26
  "birpc": "^2.5.0",
27
27
  "hookable": "^5.5.3",
28
28
  "mitt": "^3.0.1",
29
- "perfect-debounce": "^1.0.0",
29
+ "perfect-debounce": "^2.0.0",
30
30
  "speakingurl": "^14.0.1",
31
31
  "superjson": "^2.2.2",
32
- "@vue/devtools-shared": "^8.0.0"
32
+ "@vue/devtools-shared": "^8.0.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/speakingurl": "^13.0.6",
36
- "vue": "^3.5.18",
36
+ "vue": "^3.5.21",
37
37
  "vue-router": "^4.5.1"
38
38
  },
39
39
  "scripts": {