@vue/devtools-kit 8.0.1 → 8.0.3

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) {
@@ -107,9 +111,7 @@ function getInstanceName(instance) {
107
111
  * @param {Vue} instance
108
112
  */
109
113
  function getUniqueComponentId(instance) {
110
- const appId = instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0;
111
- const instanceId = instance === instance?.root ? "root" : instance.uid;
112
- return `${appId}:${instanceId}`;
114
+ return `${instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0}:${instance === instance?.root ? "root" : instance.uid}`;
113
115
  }
114
116
  function getRenderKey(value) {
115
117
  if (value == null) return "";
@@ -127,8 +129,7 @@ function returnError(cb) {
127
129
  }
128
130
  function getComponentInstance(appRecord, instanceId) {
129
131
  instanceId = instanceId || `${appRecord.id}:root`;
130
- const instance = appRecord.instanceMap.get(instanceId);
131
- return instance || appRecord.instanceMap.get(":root");
132
+ return appRecord.instanceMap.get(instanceId) || appRecord.instanceMap.get(":root");
132
133
  }
133
134
  function ensurePropertyExists(obj, key, skipObjCheck = false) {
134
135
  return skipObjCheck ? key in obj : typeof obj === "object" && obj !== null ? key in obj : false;
@@ -317,8 +318,7 @@ function highlight(instance) {
317
318
  const bounds = getComponentBoundingRect(instance);
318
319
  if (!bounds.width && !bounds.height) return;
319
320
  const name = getInstanceName(instance);
320
- const container = getContainerElement();
321
- container ? update({
321
+ getContainerElement() ? update({
322
322
  bounds,
323
323
  name
324
324
  }) : create({
@@ -337,12 +337,10 @@ function inspectFn(e) {
337
337
  const instance = target$21.__vueParentComponent;
338
338
  if (instance) {
339
339
  inspectInstance = instance;
340
- const el = instance.vnode.el;
341
- if (el) {
340
+ if (instance.vnode.el) {
342
341
  const bounds = getComponentBoundingRect(instance);
343
342
  const name = getInstanceName(instance);
344
- const container = getContainerElement();
345
- container ? update({
343
+ getContainerElement() ? update({
346
344
  bounds,
347
345
  name
348
346
  }) : create({
@@ -356,10 +354,7 @@ function inspectFn(e) {
356
354
  function selectComponentFn(e, cb) {
357
355
  e.preventDefault();
358
356
  e.stopPropagation();
359
- if (inspectInstance) {
360
- const uniqueComponentId = getUniqueComponentId(inspectInstance);
361
- cb(uniqueComponentId);
362
- }
357
+ if (inspectInstance) cb(getUniqueComponentId(inspectInstance));
363
358
  }
364
359
  let inspectComponentHighLighterSelectFn = null;
365
360
  function cancelInspectComponentHighLighter() {
@@ -515,7 +510,9 @@ const Fragment = Symbol.for("v-fgt");
515
510
  //#endregion
516
511
  //#region src/core/component/state/editor.ts
517
512
  var StateEditor = class {
518
- refEditor = new RefStateEditor();
513
+ constructor() {
514
+ this.refEditor = new RefStateEditor();
515
+ }
519
516
  set(object, path, value, cb) {
520
517
  const sections = Array.isArray(path) ? path : path.split(".");
521
518
  while (sections.length > 1) {
@@ -638,7 +635,7 @@ function getTimelineLayersStateFromStorage() {
638
635
  performanceEventEnabled: false,
639
636
  selected: ""
640
637
  };
641
- const state = localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID);
638
+ const state = typeof localStorage.getItem !== "undefined" ? localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID) : null;
642
639
  return state ? JSON.parse(state) : {
643
640
  recordingState: false,
644
641
  mouseEventEnabled: false,
@@ -733,12 +730,10 @@ function getInspector(id, app) {
733
730
  return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
734
731
  }
735
732
  function getInspectorActions(id) {
736
- const inspector = getInspector(id);
737
- return inspector?.options.actions;
733
+ return getInspector(id)?.options.actions;
738
734
  }
739
735
  function getInspectorNodeActions(id) {
740
- const inspector = getInspector(id);
741
- return inspector?.options.nodeActions;
736
+ return getInspector(id)?.options.nodeActions;
742
737
  }
743
738
 
744
739
  //#endregion
@@ -842,13 +837,12 @@ function createDevToolsCtxHooks() {
842
837
  addTimelineLayer(options, plugin.descriptor);
843
838
  });
844
839
  hooks$1.hook(DevToolsContextHookKeys.TIMELINE_EVENT_ADDED, ({ options, plugin }) => {
845
- const internalLayerIds = [
840
+ if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && ![
846
841
  "performance",
847
842
  "component-event",
848
843
  "keyboard",
849
844
  "mouse"
850
- ];
851
- if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && !internalLayerIds.includes(options.layerId)) return;
845
+ ].includes(options.layerId)) return;
852
846
  hooks$1.callHookWith(async (callbacks) => {
853
847
  await Promise.all(callbacks.map((cb) => cb(options)));
854
848
  }, DevToolsMessagingHookKeys.SEND_TIMELINE_EVENT_TO_CLIENT);
@@ -857,16 +851,13 @@ function createDevToolsCtxHooks() {
857
851
  const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
858
852
  if (!appRecord) return null;
859
853
  const appId = appRecord.id.toString();
860
- const instances = [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
861
- return instances;
854
+ return [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
862
855
  });
863
856
  hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_BOUNDS, async ({ instance }) => {
864
- const bounds = getComponentBoundingRect(instance);
865
- return bounds;
857
+ return getComponentBoundingRect(instance);
866
858
  });
867
859
  hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_NAME, ({ instance }) => {
868
- const name = getInstanceName(instance);
869
- return name;
860
+ return getInstanceName(instance);
870
861
  });
871
862
  hooks$1.hook(DevToolsContextHookKeys.COMPONENT_HIGHLIGHT, ({ uid }) => {
872
863
  const instance = activeAppRecord.value.instanceMap.get(uid);
@@ -1075,8 +1066,7 @@ function getPluginLocalKey(pluginId) {
1075
1066
  return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
1076
1067
  }
1077
1068
  function getPluginSettingsOptions(pluginId) {
1078
- const item = devtoolsPluginBuffer.find((item$1) => item$1[0].id === pluginId && !!item$1[0]?.settings)?.[0] ?? null;
1079
- return item?.settings ?? null;
1069
+ return (devtoolsPluginBuffer.find((item) => item[0].id === pluginId && !!item[0]?.settings)?.[0] ?? null)?.settings ?? null;
1080
1070
  }
1081
1071
  function getPluginSettings(pluginId, fallbackValue) {
1082
1072
  const localKey = getPluginLocalKey(pluginId);
@@ -1084,16 +1074,12 @@ function getPluginSettings(pluginId, fallbackValue) {
1084
1074
  const localSettings = localStorage.getItem(localKey);
1085
1075
  if (localSettings) return JSON.parse(localSettings);
1086
1076
  }
1087
- if (pluginId) {
1088
- const item = devtoolsPluginBuffer.find((item$1) => item$1[0].id === pluginId)?.[0] ?? null;
1089
- return _getSettings(item?.settings ?? {});
1090
- }
1077
+ if (pluginId) return _getSettings((devtoolsPluginBuffer.find((item) => item[0].id === pluginId)?.[0] ?? null)?.settings ?? {});
1091
1078
  return _getSettings(fallbackValue);
1092
1079
  }
1093
1080
  function initPluginSettings(pluginId, settings) {
1094
1081
  const localKey = getPluginLocalKey(pluginId);
1095
- const localSettings = localStorage.getItem(localKey);
1096
- if (!localSettings) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1082
+ if (!localStorage.getItem(localKey)) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1097
1083
  }
1098
1084
  function setPluginSettings(pluginId, key, value) {
1099
1085
  const localKey = getPluginLocalKey(pluginId);
@@ -1251,8 +1237,6 @@ const hook = {
1251
1237
  //#endregion
1252
1238
  //#region src/api/v6/index.ts
1253
1239
  var DevToolsV6PluginAPI = class {
1254
- plugin;
1255
- hooks;
1256
1240
  constructor({ plugin, ctx }) {
1257
1241
  this.hooks = ctx.hooks;
1258
1242
  this.plugin = plugin;
@@ -1624,10 +1608,9 @@ function processState(instance) {
1624
1608
  }
1625
1609
  function getStateTypeAndName(info) {
1626
1610
  const stateType = info.computed ? "computed" : info.ref ? "ref" : info.reactive ? "reactive" : null;
1627
- const stateTypeName = stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null;
1628
1611
  return {
1629
1612
  stateType,
1630
- stateTypeName
1613
+ stateTypeName: stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null
1631
1614
  };
1632
1615
  }
1633
1616
  function processSetupState(instance) {
@@ -1653,11 +1636,10 @@ function processSetupState(instance) {
1653
1636
  editable: isState && !info.readonly
1654
1637
  };
1655
1638
  }
1656
- const type = isOtherType ? "setup (other)" : "setup";
1657
1639
  return {
1658
1640
  key,
1659
1641
  value,
1660
- type,
1642
+ type: isOtherType ? "setup (other)" : "setup",
1661
1643
  ...result
1662
1644
  };
1663
1645
  });
@@ -1762,15 +1744,11 @@ function processInstanceState(instance) {
1762
1744
  //#region src/core/component/state/index.ts
1763
1745
  function getInstanceState(params) {
1764
1746
  const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
1765
- const id = getUniqueComponentId(instance);
1766
- const name = getInstanceName(instance);
1767
- const file = instance?.type?.__file;
1768
- const state = processInstanceState(instance);
1769
1747
  return {
1770
- id,
1771
- name,
1772
- file,
1773
- state,
1748
+ id: getUniqueComponentId(instance),
1749
+ name: getInstanceName(instance),
1750
+ file: instance?.type?.__file,
1751
+ state: processInstanceState(instance),
1774
1752
  instance
1775
1753
  };
1776
1754
  }
@@ -1778,7 +1756,6 @@ function getInstanceState(params) {
1778
1756
  //#endregion
1779
1757
  //#region src/core/component/tree/filter.ts
1780
1758
  var ComponentFilter = class {
1781
- filter;
1782
1759
  constructor(filter) {
1783
1760
  this.filter = filter || "";
1784
1761
  }
@@ -1800,12 +1777,8 @@ function createComponentFilter(filterText) {
1800
1777
  //#endregion
1801
1778
  //#region src/core/component/tree/walker.ts
1802
1779
  var ComponentWalker = class {
1803
- maxDepth;
1804
- recursively;
1805
- componentFilter;
1806
- api;
1807
- captureIds = /* @__PURE__ */ new Map();
1808
1780
  constructor(options) {
1781
+ this.captureIds = /* @__PURE__ */ new Map();
1809
1782
  const { filterText = "", maxDepth, recursively, api } = options;
1810
1783
  this.componentFilter = createComponentFilter(filterText);
1811
1784
  this.maxDepth = maxDepth;
@@ -1877,8 +1850,7 @@ var ComponentWalker = class {
1877
1850
  if (node) treeNode.children.push(node);
1878
1851
  }
1879
1852
  }
1880
- const rootElements = getRootElementsFromComponentInstance(instance);
1881
- const firstElement = rootElements[0];
1853
+ const firstElement = getRootElementsFromComponentInstance(instance)[0];
1882
1854
  if (firstElement?.parentElement) {
1883
1855
  const parentInstance = instance.parent;
1884
1856
  const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
@@ -2023,8 +1995,7 @@ function performanceMarkEnd(api, app, uid, vm, type, time) {
2023
1995
  const groupInfo = appRecord.perfGroupIds.get(groupKey);
2024
1996
  if (groupInfo) {
2025
1997
  const groupId = groupInfo.groupId;
2026
- const startTime = groupInfo.time;
2027
- const duration = time - startTime;
1998
+ const duration = time - groupInfo.time;
2028
1999
  api.addTimelineEvent({
2029
2000
  layerId: PERFORMANCE_EVENT_LAYER_ID,
2030
2001
  event: {
@@ -2199,25 +2170,21 @@ function createComponentsDevToolsPlugin(app) {
2199
2170
  api.on.getInspectorTree(async (payload) => {
2200
2171
  if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
2201
2172
  const instance = getComponentInstance(activeAppRecord.value, payload.instanceId);
2202
- if (instance) {
2203
- const walker$1 = new ComponentWalker({
2204
- filterText: payload.filter,
2205
- maxDepth: 100,
2206
- recursively: false,
2207
- api
2208
- });
2209
- payload.rootNodes = await walker$1.getComponentTree(instance);
2210
- }
2173
+ if (instance) payload.rootNodes = await new ComponentWalker({
2174
+ filterText: payload.filter,
2175
+ maxDepth: 100,
2176
+ recursively: false,
2177
+ api
2178
+ }).getComponentTree(instance);
2211
2179
  }
2212
2180
  });
2213
2181
  api.on.getInspectorState(async (payload) => {
2214
2182
  if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
2215
2183
  const result = getInstanceState({ instanceId: payload.nodeId });
2216
2184
  const componentInstance = result.instance;
2217
- const app$1 = result.instance?.appContext.app;
2218
2185
  const _payload = {
2219
2186
  componentInstance,
2220
- app: app$1,
2187
+ app: result.instance?.appContext.app,
2221
2188
  instanceData: result
2222
2189
  };
2223
2190
  devtoolsContext.hooks.callHookWith((callbacks) => {
@@ -4169,15 +4136,13 @@ function initDevTools() {
4169
4136
  callDevToolsPluginSetupFn([pluginDescriptor, setupFn], app);
4170
4137
  });
4171
4138
  onLegacyDevToolsPluginApiAvailable(() => {
4172
- const normalizedPluginBuffer = devtoolsPluginBuffer.filter(([item]) => item.id !== "components");
4173
- normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => {
4139
+ devtoolsPluginBuffer.filter(([item]) => item.id !== "components").forEach(([pluginDescriptor, setupFn]) => {
4174
4140
  _devtoolsHook.emit(DevToolsHooks.SETUP_DEVTOOLS_PLUGIN, pluginDescriptor, setupFn, { target: "legacy" });
4175
4141
  });
4176
4142
  });
4177
4143
  hook.on.vueAppInit(async (app, version, types) => {
4178
- const appRecord = createAppRecord(app, types);
4179
4144
  const normalizedAppRecord = {
4180
- ...appRecord,
4145
+ ...createAppRecord(app, types),
4181
4146
  app,
4182
4147
  version
4183
4148
  };
@@ -4257,7 +4222,7 @@ function reviveMap(val) {
4257
4222
  return result;
4258
4223
  }
4259
4224
  function revive(val) {
4260
- if (val === UNDEFINED) return void 0;
4225
+ if (val === UNDEFINED) return;
4261
4226
  else if (val === INFINITY) return Number.POSITIVE_INFINITY;
4262
4227
  else if (val === NEGATIVE_INFINITY) return Number.NEGATIVE_INFINITY;
4263
4228
  else if (val === NAN) return NaN;
@@ -4306,10 +4271,8 @@ function formatInspectorStateValue(value, quotes = false, options) {
4306
4271
  const type = getInspectorStateValueType(value, false);
4307
4272
  if (type !== "custom" && value?._custom) value = value._custom.value;
4308
4273
  if (result = internalStateTokenToString(value)) return result;
4309
- else if (type === "custom") {
4310
- const nestedName = value._custom.value?._custom && formatInspectorStateValue(value._custom.value, quotes, options);
4311
- return nestedName || value._custom.displayText || value._custom.display;
4312
- } else if (type === "array") return `Array[${value.length}]`;
4274
+ else if (type === "custom") return value._custom.value?._custom && formatInspectorStateValue(value._custom.value, quotes, options) || value._custom.displayText || value._custom.display;
4275
+ else if (type === "array") return `Array[${value.length}]`;
4313
4276
  else if (type === "plain-object") return `Object${Object.keys(value).length ? "" : " (empty)"}`;
4314
4277
  else if (type?.includes("native")) return escape(specialTypeRE.exec(value)?.[2]);
4315
4278
  else if (typeof value === "string") {
@@ -4365,8 +4328,7 @@ function updateDevToolsClientDetected(params) {
4365
4328
  ...devtoolsState.devtoolsClientDetected,
4366
4329
  ...params
4367
4330
  };
4368
- const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
4369
- toggleHighPerfMode(!devtoolsClientVisible);
4331
+ toggleHighPerfMode(!Object.values(devtoolsState.devtoolsClientDetected).some(Boolean));
4370
4332
  }
4371
4333
  __vue_devtools_shared.target.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ ??= updateDevToolsClientDetected;
4372
4334
 
@@ -4450,7 +4412,6 @@ function find(record, predicate) {
4450
4412
  const value = valuesNotNever[i];
4451
4413
  if (predicate(value)) return value;
4452
4414
  }
4453
- return void 0;
4454
4415
  }
4455
4416
  function forEach(record, run) {
4456
4417
  Object.entries(record).forEach(([key, value]) => run(value, key));
@@ -4463,7 +4424,6 @@ function findArr(record, predicate) {
4463
4424
  const value = record[i];
4464
4425
  if (predicate(value)) return value;
4465
4426
  }
4466
- return void 0;
4467
4427
  }
4468
4428
 
4469
4429
  //#endregion
@@ -4521,14 +4481,12 @@ const parsePath = (string) => {
4521
4481
  let segment = "";
4522
4482
  for (let i = 0; i < string.length; i++) {
4523
4483
  let char = string.charAt(i);
4524
- const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
4525
- if (isEscapedDot) {
4484
+ if (char === "\\" && string.charAt(i + 1) === ".") {
4526
4485
  segment += ".";
4527
4486
  i++;
4528
4487
  continue;
4529
4488
  }
4530
- const isEndOfSegment = char === ".";
4531
- if (isEndOfSegment) {
4489
+ if (char === ".") {
4532
4490
  result.push(segment);
4533
4491
  segment = "";
4534
4492
  continue;
@@ -4602,14 +4560,10 @@ function compositeTransformation(isApplicable, annotation, transform, untransfor
4602
4560
  };
4603
4561
  }
4604
4562
  const symbolRule = compositeTransformation((s, superJson) => {
4605
- if (isSymbol(s)) {
4606
- const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
4607
- return isRegistered;
4608
- }
4563
+ if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
4609
4564
  return false;
4610
4565
  }, (s, superJson) => {
4611
- const identifier = superJson.symbolRegistry.getIdentifier(s);
4612
- return ["symbol", identifier];
4566
+ return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
4613
4567
  }, (v) => v.description, (_, a, superJson) => {
4614
4568
  const value = superJson.symbolRegistry.getValue(a[1]);
4615
4569
  if (!value) throw new Error("Trying to deserialize unknown symbol");
@@ -4635,15 +4589,11 @@ const typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-arra
4635
4589
  return new ctor(v);
4636
4590
  });
4637
4591
  function isInstanceOfRegisteredClass(potentialClass, superJson) {
4638
- if (potentialClass?.constructor) {
4639
- const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4640
- return isRegistered;
4641
- }
4592
+ if (potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4642
4593
  return false;
4643
4594
  }
4644
4595
  const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
4645
- const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
4646
- return ["class", identifier];
4596
+ return ["class", superJson.classRegistry.getIdentifier(clazz.constructor)];
4647
4597
  }, (clazz, superJson) => {
4648
4598
  const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
4649
4599
  if (!allowedProps) return { ...clazz };
@@ -4660,11 +4610,9 @@ const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, s
4660
4610
  const customRule = compositeTransformation((value, superJson) => {
4661
4611
  return !!superJson.customTransformerRegistry.findApplicable(value);
4662
4612
  }, (value, superJson) => {
4663
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
4664
- return ["custom", transformer.name];
4613
+ return ["custom", superJson.customTransformerRegistry.findApplicable(value).name];
4665
4614
  }, (value, superJson) => {
4666
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
4667
- return transformer.serialize(value);
4615
+ return superJson.customTransformerRegistry.findApplicable(value).serialize(value);
4668
4616
  }, (v, a, superJson) => {
4669
4617
  const transformer = superJson.customTransformerRegistry.findByName(a[1]);
4670
4618
  if (!transformer) throw new Error("Trying to deserialize unknown custom value");
@@ -4687,7 +4635,6 @@ const transformValue = (value, superJson) => {
4687
4635
  value: applicableSimpleRule.transform(value, superJson),
4688
4636
  type: applicableSimpleRule.annotation
4689
4637
  };
4690
- return void 0;
4691
4638
  };
4692
4639
  const simpleRulesByAnnotation = {};
4693
4640
  simpleRules.forEach((rule) => {
@@ -4759,8 +4706,7 @@ const setDeep = (object, path, mapper) => {
4759
4706
  const row = +key;
4760
4707
  parent = getNthKey(parent, row);
4761
4708
  } else if (isMap(parent)) {
4762
- const isEnd = i === path.length - 2;
4763
- if (isEnd) break;
4709
+ if (i === path.length - 2) break;
4764
4710
  const row = +key;
4765
4711
  const type = +path[++i] === 0 ? "key" : "value";
4766
4712
  const keyOfRow = getNthKey(parent, row);
@@ -4788,8 +4734,7 @@ const setDeep = (object, path, mapper) => {
4788
4734
  if (isMap(parent)) {
4789
4735
  const row = +path[path.length - 2];
4790
4736
  const keyToRow = getNthKey(parent, row);
4791
- const type = +lastKey === 0 ? "key" : "value";
4792
- switch (type) {
4737
+ switch (+lastKey === 0 ? "key" : "value") {
4793
4738
  case "key": {
4794
4739
  const newKey = mapper(keyToRow);
4795
4740
  parent.set(newKey, parent.get(keyToRow));
@@ -4945,8 +4890,7 @@ function copy(target$21, options = {}) {
4945
4890
  return [...props, ...symbols].reduce((carry, key) => {
4946
4891
  if (isArray$1(options.props) && !options.props.includes(key)) return carry;
4947
4892
  const val = target$21[key];
4948
- const newVal = copy(val, options);
4949
- assignProp(carry, key, newVal, target$21, options.nonenumerable);
4893
+ assignProp(carry, key, copy(val, options), target$21, options.nonenumerable);
4950
4894
  return carry;
4951
4895
  }, {});
4952
4896
  }
@@ -5276,8 +5220,7 @@ function createIframeServerChannel() {
5276
5220
  };
5277
5221
  return {
5278
5222
  post: (data) => {
5279
- const iframe = getIframeServerContext();
5280
- iframe?.contentWindow?.postMessage(SuperJSON.stringify({
5223
+ getIframeServerContext()?.contentWindow?.postMessage(SuperJSON.stringify({
5281
5224
  event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5282
5225
  data
5283
5226
  }), "*");
@@ -5454,10 +5397,9 @@ function getFunctionDetails(func) {
5454
5397
  } catch (e) {}
5455
5398
  const match = matches && matches[0];
5456
5399
  const args = typeof match === "string" ? match : "(?)";
5457
- const name = typeof func.name === "string" ? func.name : "";
5458
5400
  return { _custom: {
5459
5401
  type: "function",
5460
- displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(name)}${args}</span>`,
5402
+ displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(typeof func.name === "string" ? func.name : "")}${args}</span>`,
5461
5403
  tooltipText: string.trim() ? `<pre>${string}</pre>` : null
5462
5404
  } };
5463
5405
  }
@@ -5479,11 +5421,10 @@ function getDateDetails(val) {
5479
5421
  } };
5480
5422
  }
5481
5423
  function getMapDetails(val) {
5482
- const list = Object.fromEntries(val);
5483
5424
  return { _custom: {
5484
5425
  type: "map",
5485
5426
  displayText: "Map",
5486
- value: list,
5427
+ value: Object.fromEntries(val),
5487
5428
  readOnly: true,
5488
5429
  fields: { abstract: true }
5489
5430
  } };
@@ -5605,8 +5546,7 @@ function tryGetRefValue(ref) {
5605
5546
  }
5606
5547
  function getObjectDetails(object) {
5607
5548
  const info = getSetupStateType(object);
5608
- const isState = info.ref || info.computed || info.reactive;
5609
- if (isState) {
5549
+ if (info.ref || info.computed || info.reactive) {
5610
5550
  const stateTypeName = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
5611
5551
  const value = toRaw(info.reactive ? object : tryGetRefValue(object));
5612
5552
  const raw = ensurePropertyExists(object, "effect") ? object.effect?.raw?.toString() || object.effect?.fn?.toString() : null;
@@ -5788,8 +5728,7 @@ function stringifyStrictCircularAutoChunks(data, replacer = null, space = null)
5788
5728
  }
5789
5729
  function parseCircularAutoChunks(data, reviver$1 = null) {
5790
5730
  if (Array.isArray(data)) data = data.join("");
5791
- const hasCircular = /^\s/.test(data);
5792
- if (!hasCircular) return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver$1);
5731
+ if (!/^\s/.test(data)) return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver$1);
5793
5732
  else {
5794
5733
  const list = JSON.parse(data);
5795
5734
  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
@@ -107,9 +107,7 @@ function getInstanceName(instance) {
107
107
  * @param {Vue} instance
108
108
  */
109
109
  function getUniqueComponentId(instance) {
110
- const appId = instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0;
111
- const instanceId = instance === instance?.root ? "root" : instance.uid;
112
- return `${appId}:${instanceId}`;
110
+ return `${instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0}:${instance === instance?.root ? "root" : instance.uid}`;
113
111
  }
114
112
  function getRenderKey(value) {
115
113
  if (value == null) return "";
@@ -127,8 +125,7 @@ function returnError(cb) {
127
125
  }
128
126
  function getComponentInstance(appRecord, instanceId) {
129
127
  instanceId = instanceId || `${appRecord.id}:root`;
130
- const instance = appRecord.instanceMap.get(instanceId);
131
- return instance || appRecord.instanceMap.get(":root");
128
+ return appRecord.instanceMap.get(instanceId) || appRecord.instanceMap.get(":root");
132
129
  }
133
130
  function ensurePropertyExists(obj, key, skipObjCheck = false) {
134
131
  return skipObjCheck ? key in obj : typeof obj === "object" && obj !== null ? key in obj : false;
@@ -317,8 +314,7 @@ function highlight(instance) {
317
314
  const bounds = getComponentBoundingRect(instance);
318
315
  if (!bounds.width && !bounds.height) return;
319
316
  const name = getInstanceName(instance);
320
- const container = getContainerElement();
321
- container ? update({
317
+ getContainerElement() ? update({
322
318
  bounds,
323
319
  name
324
320
  }) : create({
@@ -337,12 +333,10 @@ function inspectFn(e) {
337
333
  const instance = target$1.__vueParentComponent;
338
334
  if (instance) {
339
335
  inspectInstance = instance;
340
- const el = instance.vnode.el;
341
- if (el) {
336
+ if (instance.vnode.el) {
342
337
  const bounds = getComponentBoundingRect(instance);
343
338
  const name = getInstanceName(instance);
344
- const container = getContainerElement();
345
- container ? update({
339
+ getContainerElement() ? update({
346
340
  bounds,
347
341
  name
348
342
  }) : create({
@@ -356,10 +350,7 @@ function inspectFn(e) {
356
350
  function selectComponentFn(e, cb) {
357
351
  e.preventDefault();
358
352
  e.stopPropagation();
359
- if (inspectInstance) {
360
- const uniqueComponentId = getUniqueComponentId(inspectInstance);
361
- cb(uniqueComponentId);
362
- }
353
+ if (inspectInstance) cb(getUniqueComponentId(inspectInstance));
363
354
  }
364
355
  let inspectComponentHighLighterSelectFn = null;
365
356
  function cancelInspectComponentHighLighter() {
@@ -515,7 +506,9 @@ const Fragment = Symbol.for("v-fgt");
515
506
  //#endregion
516
507
  //#region src/core/component/state/editor.ts
517
508
  var StateEditor = class {
518
- refEditor = new RefStateEditor();
509
+ constructor() {
510
+ this.refEditor = new RefStateEditor();
511
+ }
519
512
  set(object, path, value, cb) {
520
513
  const sections = Array.isArray(path) ? path : path.split(".");
521
514
  while (sections.length > 1) {
@@ -638,7 +631,7 @@ function getTimelineLayersStateFromStorage() {
638
631
  performanceEventEnabled: false,
639
632
  selected: ""
640
633
  };
641
- const state = localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID);
634
+ const state = typeof localStorage.getItem !== "undefined" ? localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID) : null;
642
635
  return state ? JSON.parse(state) : {
643
636
  recordingState: false,
644
637
  mouseEventEnabled: false,
@@ -733,12 +726,10 @@ function getInspector(id, app) {
733
726
  return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
734
727
  }
735
728
  function getInspectorActions(id) {
736
- const inspector = getInspector(id);
737
- return inspector?.options.actions;
729
+ return getInspector(id)?.options.actions;
738
730
  }
739
731
  function getInspectorNodeActions(id) {
740
- const inspector = getInspector(id);
741
- return inspector?.options.nodeActions;
732
+ return getInspector(id)?.options.nodeActions;
742
733
  }
743
734
 
744
735
  //#endregion
@@ -842,13 +833,12 @@ function createDevToolsCtxHooks() {
842
833
  addTimelineLayer(options, plugin.descriptor);
843
834
  });
844
835
  hooks$1.hook(DevToolsContextHookKeys.TIMELINE_EVENT_ADDED, ({ options, plugin }) => {
845
- const internalLayerIds = [
836
+ if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && ![
846
837
  "performance",
847
838
  "component-event",
848
839
  "keyboard",
849
840
  "mouse"
850
- ];
851
- if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && !internalLayerIds.includes(options.layerId)) return;
841
+ ].includes(options.layerId)) return;
852
842
  hooks$1.callHookWith(async (callbacks) => {
853
843
  await Promise.all(callbacks.map((cb) => cb(options)));
854
844
  }, DevToolsMessagingHookKeys.SEND_TIMELINE_EVENT_TO_CLIENT);
@@ -857,16 +847,13 @@ function createDevToolsCtxHooks() {
857
847
  const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
858
848
  if (!appRecord) return null;
859
849
  const appId = appRecord.id.toString();
860
- const instances = [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
861
- return instances;
850
+ return [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
862
851
  });
863
852
  hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_BOUNDS, async ({ instance }) => {
864
- const bounds = getComponentBoundingRect(instance);
865
- return bounds;
853
+ return getComponentBoundingRect(instance);
866
854
  });
867
855
  hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_NAME, ({ instance }) => {
868
- const name = getInstanceName(instance);
869
- return name;
856
+ return getInstanceName(instance);
870
857
  });
871
858
  hooks$1.hook(DevToolsContextHookKeys.COMPONENT_HIGHLIGHT, ({ uid }) => {
872
859
  const instance = activeAppRecord.value.instanceMap.get(uid);
@@ -1075,8 +1062,7 @@ function getPluginLocalKey(pluginId) {
1075
1062
  return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
1076
1063
  }
1077
1064
  function getPluginSettingsOptions(pluginId) {
1078
- const item = devtoolsPluginBuffer.find((item$1) => item$1[0].id === pluginId && !!item$1[0]?.settings)?.[0] ?? null;
1079
- return item?.settings ?? null;
1065
+ return (devtoolsPluginBuffer.find((item) => item[0].id === pluginId && !!item[0]?.settings)?.[0] ?? null)?.settings ?? null;
1080
1066
  }
1081
1067
  function getPluginSettings(pluginId, fallbackValue) {
1082
1068
  const localKey = getPluginLocalKey(pluginId);
@@ -1084,16 +1070,12 @@ function getPluginSettings(pluginId, fallbackValue) {
1084
1070
  const localSettings = localStorage.getItem(localKey);
1085
1071
  if (localSettings) return JSON.parse(localSettings);
1086
1072
  }
1087
- if (pluginId) {
1088
- const item = devtoolsPluginBuffer.find((item$1) => item$1[0].id === pluginId)?.[0] ?? null;
1089
- return _getSettings(item?.settings ?? {});
1090
- }
1073
+ if (pluginId) return _getSettings((devtoolsPluginBuffer.find((item) => item[0].id === pluginId)?.[0] ?? null)?.settings ?? {});
1091
1074
  return _getSettings(fallbackValue);
1092
1075
  }
1093
1076
  function initPluginSettings(pluginId, settings) {
1094
1077
  const localKey = getPluginLocalKey(pluginId);
1095
- const localSettings = localStorage.getItem(localKey);
1096
- if (!localSettings) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1078
+ if (!localStorage.getItem(localKey)) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1097
1079
  }
1098
1080
  function setPluginSettings(pluginId, key, value) {
1099
1081
  const localKey = getPluginLocalKey(pluginId);
@@ -1251,8 +1233,6 @@ const hook = {
1251
1233
  //#endregion
1252
1234
  //#region src/api/v6/index.ts
1253
1235
  var DevToolsV6PluginAPI = class {
1254
- plugin;
1255
- hooks;
1256
1236
  constructor({ plugin, ctx }) {
1257
1237
  this.hooks = ctx.hooks;
1258
1238
  this.plugin = plugin;
@@ -1624,10 +1604,9 @@ function processState(instance) {
1624
1604
  }
1625
1605
  function getStateTypeAndName(info) {
1626
1606
  const stateType = info.computed ? "computed" : info.ref ? "ref" : info.reactive ? "reactive" : null;
1627
- const stateTypeName = stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null;
1628
1607
  return {
1629
1608
  stateType,
1630
- stateTypeName
1609
+ stateTypeName: stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null
1631
1610
  };
1632
1611
  }
1633
1612
  function processSetupState(instance) {
@@ -1653,11 +1632,10 @@ function processSetupState(instance) {
1653
1632
  editable: isState && !info.readonly
1654
1633
  };
1655
1634
  }
1656
- const type = isOtherType ? "setup (other)" : "setup";
1657
1635
  return {
1658
1636
  key,
1659
1637
  value,
1660
- type,
1638
+ type: isOtherType ? "setup (other)" : "setup",
1661
1639
  ...result
1662
1640
  };
1663
1641
  });
@@ -1762,15 +1740,11 @@ function processInstanceState(instance) {
1762
1740
  //#region src/core/component/state/index.ts
1763
1741
  function getInstanceState(params) {
1764
1742
  const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
1765
- const id = getUniqueComponentId(instance);
1766
- const name = getInstanceName(instance);
1767
- const file = instance?.type?.__file;
1768
- const state = processInstanceState(instance);
1769
1743
  return {
1770
- id,
1771
- name,
1772
- file,
1773
- state,
1744
+ id: getUniqueComponentId(instance),
1745
+ name: getInstanceName(instance),
1746
+ file: instance?.type?.__file,
1747
+ state: processInstanceState(instance),
1774
1748
  instance
1775
1749
  };
1776
1750
  }
@@ -1778,7 +1752,6 @@ function getInstanceState(params) {
1778
1752
  //#endregion
1779
1753
  //#region src/core/component/tree/filter.ts
1780
1754
  var ComponentFilter = class {
1781
- filter;
1782
1755
  constructor(filter) {
1783
1756
  this.filter = filter || "";
1784
1757
  }
@@ -1800,12 +1773,8 @@ function createComponentFilter(filterText) {
1800
1773
  //#endregion
1801
1774
  //#region src/core/component/tree/walker.ts
1802
1775
  var ComponentWalker = class {
1803
- maxDepth;
1804
- recursively;
1805
- componentFilter;
1806
- api;
1807
- captureIds = /* @__PURE__ */ new Map();
1808
1776
  constructor(options) {
1777
+ this.captureIds = /* @__PURE__ */ new Map();
1809
1778
  const { filterText = "", maxDepth, recursively, api } = options;
1810
1779
  this.componentFilter = createComponentFilter(filterText);
1811
1780
  this.maxDepth = maxDepth;
@@ -1877,8 +1846,7 @@ var ComponentWalker = class {
1877
1846
  if (node) treeNode.children.push(node);
1878
1847
  }
1879
1848
  }
1880
- const rootElements = getRootElementsFromComponentInstance(instance);
1881
- const firstElement = rootElements[0];
1849
+ const firstElement = getRootElementsFromComponentInstance(instance)[0];
1882
1850
  if (firstElement?.parentElement) {
1883
1851
  const parentInstance = instance.parent;
1884
1852
  const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];
@@ -2023,8 +1991,7 @@ function performanceMarkEnd(api, app, uid, vm, type, time) {
2023
1991
  const groupInfo = appRecord.perfGroupIds.get(groupKey);
2024
1992
  if (groupInfo) {
2025
1993
  const groupId = groupInfo.groupId;
2026
- const startTime = groupInfo.time;
2027
- const duration = time - startTime;
1994
+ const duration = time - groupInfo.time;
2028
1995
  api.addTimelineEvent({
2029
1996
  layerId: PERFORMANCE_EVENT_LAYER_ID,
2030
1997
  event: {
@@ -2199,25 +2166,21 @@ function createComponentsDevToolsPlugin(app) {
2199
2166
  api.on.getInspectorTree(async (payload) => {
2200
2167
  if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
2201
2168
  const instance = getComponentInstance(activeAppRecord.value, payload.instanceId);
2202
- if (instance) {
2203
- const walker$1 = new ComponentWalker({
2204
- filterText: payload.filter,
2205
- maxDepth: 100,
2206
- recursively: false,
2207
- api
2208
- });
2209
- payload.rootNodes = await walker$1.getComponentTree(instance);
2210
- }
2169
+ if (instance) payload.rootNodes = await new ComponentWalker({
2170
+ filterText: payload.filter,
2171
+ maxDepth: 100,
2172
+ recursively: false,
2173
+ api
2174
+ }).getComponentTree(instance);
2211
2175
  }
2212
2176
  });
2213
2177
  api.on.getInspectorState(async (payload) => {
2214
2178
  if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
2215
2179
  const result = getInstanceState({ instanceId: payload.nodeId });
2216
2180
  const componentInstance = result.instance;
2217
- const app$1 = result.instance?.appContext.app;
2218
2181
  const _payload = {
2219
2182
  componentInstance,
2220
- app: app$1,
2183
+ app: result.instance?.appContext.app,
2221
2184
  instanceData: result
2222
2185
  };
2223
2186
  devtoolsContext.hooks.callHookWith((callbacks) => {
@@ -4169,15 +4132,13 @@ function initDevTools() {
4169
4132
  callDevToolsPluginSetupFn([pluginDescriptor, setupFn], app);
4170
4133
  });
4171
4134
  onLegacyDevToolsPluginApiAvailable(() => {
4172
- const normalizedPluginBuffer = devtoolsPluginBuffer.filter(([item]) => item.id !== "components");
4173
- normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => {
4135
+ devtoolsPluginBuffer.filter(([item]) => item.id !== "components").forEach(([pluginDescriptor, setupFn]) => {
4174
4136
  _devtoolsHook.emit(DevToolsHooks.SETUP_DEVTOOLS_PLUGIN, pluginDescriptor, setupFn, { target: "legacy" });
4175
4137
  });
4176
4138
  });
4177
4139
  hook.on.vueAppInit(async (app, version, types) => {
4178
- const appRecord = createAppRecord(app, types);
4179
4140
  const normalizedAppRecord = {
4180
- ...appRecord,
4141
+ ...createAppRecord(app, types),
4181
4142
  app,
4182
4143
  version
4183
4144
  };
@@ -4257,7 +4218,7 @@ function reviveMap(val) {
4257
4218
  return result;
4258
4219
  }
4259
4220
  function revive(val) {
4260
- if (val === UNDEFINED) return void 0;
4221
+ if (val === UNDEFINED) return;
4261
4222
  else if (val === INFINITY) return Number.POSITIVE_INFINITY;
4262
4223
  else if (val === NEGATIVE_INFINITY) return Number.NEGATIVE_INFINITY;
4263
4224
  else if (val === NAN) return NaN;
@@ -4306,10 +4267,8 @@ function formatInspectorStateValue(value, quotes = false, options) {
4306
4267
  const type = getInspectorStateValueType(value, false);
4307
4268
  if (type !== "custom" && value?._custom) value = value._custom.value;
4308
4269
  if (result = internalStateTokenToString(value)) return result;
4309
- else if (type === "custom") {
4310
- const nestedName = value._custom.value?._custom && formatInspectorStateValue(value._custom.value, quotes, options);
4311
- return nestedName || value._custom.displayText || value._custom.display;
4312
- } else if (type === "array") return `Array[${value.length}]`;
4270
+ else if (type === "custom") return value._custom.value?._custom && formatInspectorStateValue(value._custom.value, quotes, options) || value._custom.displayText || value._custom.display;
4271
+ else if (type === "array") return `Array[${value.length}]`;
4313
4272
  else if (type === "plain-object") return `Object${Object.keys(value).length ? "" : " (empty)"}`;
4314
4273
  else if (type?.includes("native")) return escape(specialTypeRE.exec(value)?.[2]);
4315
4274
  else if (typeof value === "string") {
@@ -4365,8 +4324,7 @@ function updateDevToolsClientDetected(params) {
4365
4324
  ...devtoolsState.devtoolsClientDetected,
4366
4325
  ...params
4367
4326
  };
4368
- const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
4369
- toggleHighPerfMode(!devtoolsClientVisible);
4327
+ toggleHighPerfMode(!Object.values(devtoolsState.devtoolsClientDetected).some(Boolean));
4370
4328
  }
4371
4329
  target.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ ??= updateDevToolsClientDetected;
4372
4330
 
@@ -4450,7 +4408,6 @@ function find(record, predicate) {
4450
4408
  const value = valuesNotNever[i];
4451
4409
  if (predicate(value)) return value;
4452
4410
  }
4453
- return void 0;
4454
4411
  }
4455
4412
  function forEach(record, run) {
4456
4413
  Object.entries(record).forEach(([key, value]) => run(value, key));
@@ -4463,7 +4420,6 @@ function findArr(record, predicate) {
4463
4420
  const value = record[i];
4464
4421
  if (predicate(value)) return value;
4465
4422
  }
4466
- return void 0;
4467
4423
  }
4468
4424
 
4469
4425
  //#endregion
@@ -4521,14 +4477,12 @@ const parsePath = (string) => {
4521
4477
  let segment = "";
4522
4478
  for (let i = 0; i < string.length; i++) {
4523
4479
  let char = string.charAt(i);
4524
- const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
4525
- if (isEscapedDot) {
4480
+ if (char === "\\" && string.charAt(i + 1) === ".") {
4526
4481
  segment += ".";
4527
4482
  i++;
4528
4483
  continue;
4529
4484
  }
4530
- const isEndOfSegment = char === ".";
4531
- if (isEndOfSegment) {
4485
+ if (char === ".") {
4532
4486
  result.push(segment);
4533
4487
  segment = "";
4534
4488
  continue;
@@ -4602,14 +4556,10 @@ function compositeTransformation(isApplicable, annotation, transform, untransfor
4602
4556
  };
4603
4557
  }
4604
4558
  const symbolRule = compositeTransformation((s, superJson) => {
4605
- if (isSymbol(s)) {
4606
- const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
4607
- return isRegistered;
4608
- }
4559
+ if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
4609
4560
  return false;
4610
4561
  }, (s, superJson) => {
4611
- const identifier = superJson.symbolRegistry.getIdentifier(s);
4612
- return ["symbol", identifier];
4562
+ return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
4613
4563
  }, (v) => v.description, (_, a, superJson) => {
4614
4564
  const value = superJson.symbolRegistry.getValue(a[1]);
4615
4565
  if (!value) throw new Error("Trying to deserialize unknown symbol");
@@ -4635,15 +4585,11 @@ const typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-arra
4635
4585
  return new ctor(v);
4636
4586
  });
4637
4587
  function isInstanceOfRegisteredClass(potentialClass, superJson) {
4638
- if (potentialClass?.constructor) {
4639
- const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4640
- return isRegistered;
4641
- }
4588
+ if (potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4642
4589
  return false;
4643
4590
  }
4644
4591
  const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
4645
- const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
4646
- return ["class", identifier];
4592
+ return ["class", superJson.classRegistry.getIdentifier(clazz.constructor)];
4647
4593
  }, (clazz, superJson) => {
4648
4594
  const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
4649
4595
  if (!allowedProps) return { ...clazz };
@@ -4660,11 +4606,9 @@ const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, s
4660
4606
  const customRule = compositeTransformation((value, superJson) => {
4661
4607
  return !!superJson.customTransformerRegistry.findApplicable(value);
4662
4608
  }, (value, superJson) => {
4663
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
4664
- return ["custom", transformer.name];
4609
+ return ["custom", superJson.customTransformerRegistry.findApplicable(value).name];
4665
4610
  }, (value, superJson) => {
4666
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
4667
- return transformer.serialize(value);
4611
+ return superJson.customTransformerRegistry.findApplicable(value).serialize(value);
4668
4612
  }, (v, a, superJson) => {
4669
4613
  const transformer = superJson.customTransformerRegistry.findByName(a[1]);
4670
4614
  if (!transformer) throw new Error("Trying to deserialize unknown custom value");
@@ -4687,7 +4631,6 @@ const transformValue = (value, superJson) => {
4687
4631
  value: applicableSimpleRule.transform(value, superJson),
4688
4632
  type: applicableSimpleRule.annotation
4689
4633
  };
4690
- return void 0;
4691
4634
  };
4692
4635
  const simpleRulesByAnnotation = {};
4693
4636
  simpleRules.forEach((rule) => {
@@ -4759,8 +4702,7 @@ const setDeep = (object, path, mapper) => {
4759
4702
  const row = +key;
4760
4703
  parent = getNthKey(parent, row);
4761
4704
  } else if (isMap(parent)) {
4762
- const isEnd = i === path.length - 2;
4763
- if (isEnd) break;
4705
+ if (i === path.length - 2) break;
4764
4706
  const row = +key;
4765
4707
  const type = +path[++i] === 0 ? "key" : "value";
4766
4708
  const keyOfRow = getNthKey(parent, row);
@@ -4788,8 +4730,7 @@ const setDeep = (object, path, mapper) => {
4788
4730
  if (isMap(parent)) {
4789
4731
  const row = +path[path.length - 2];
4790
4732
  const keyToRow = getNthKey(parent, row);
4791
- const type = +lastKey === 0 ? "key" : "value";
4792
- switch (type) {
4733
+ switch (+lastKey === 0 ? "key" : "value") {
4793
4734
  case "key": {
4794
4735
  const newKey = mapper(keyToRow);
4795
4736
  parent.set(newKey, parent.get(keyToRow));
@@ -4945,8 +4886,7 @@ function copy(target$1, options = {}) {
4945
4886
  return [...props, ...symbols].reduce((carry, key) => {
4946
4887
  if (isArray$1(options.props) && !options.props.includes(key)) return carry;
4947
4888
  const val = target$1[key];
4948
- const newVal = copy(val, options);
4949
- assignProp(carry, key, newVal, target$1, options.nonenumerable);
4889
+ assignProp(carry, key, copy(val, options), target$1, options.nonenumerable);
4950
4890
  return carry;
4951
4891
  }, {});
4952
4892
  }
@@ -5276,8 +5216,7 @@ function createIframeServerChannel() {
5276
5216
  };
5277
5217
  return {
5278
5218
  post: (data) => {
5279
- const iframe = getIframeServerContext();
5280
- iframe?.contentWindow?.postMessage(SuperJSON.stringify({
5219
+ getIframeServerContext()?.contentWindow?.postMessage(SuperJSON.stringify({
5281
5220
  event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,
5282
5221
  data
5283
5222
  }), "*");
@@ -5454,10 +5393,9 @@ function getFunctionDetails(func) {
5454
5393
  } catch (e) {}
5455
5394
  const match = matches && matches[0];
5456
5395
  const args = typeof match === "string" ? match : "(?)";
5457
- const name = typeof func.name === "string" ? func.name : "";
5458
5396
  return { _custom: {
5459
5397
  type: "function",
5460
- displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(name)}${args}</span>`,
5398
+ displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(typeof func.name === "string" ? func.name : "")}${args}</span>`,
5461
5399
  tooltipText: string.trim() ? `<pre>${string}</pre>` : null
5462
5400
  } };
5463
5401
  }
@@ -5479,11 +5417,10 @@ function getDateDetails(val) {
5479
5417
  } };
5480
5418
  }
5481
5419
  function getMapDetails(val) {
5482
- const list = Object.fromEntries(val);
5483
5420
  return { _custom: {
5484
5421
  type: "map",
5485
5422
  displayText: "Map",
5486
- value: list,
5423
+ value: Object.fromEntries(val),
5487
5424
  readOnly: true,
5488
5425
  fields: { abstract: true }
5489
5426
  } };
@@ -5605,8 +5542,7 @@ function tryGetRefValue(ref) {
5605
5542
  }
5606
5543
  function getObjectDetails(object) {
5607
5544
  const info = getSetupStateType(object);
5608
- const isState = info.ref || info.computed || info.reactive;
5609
- if (isState) {
5545
+ if (info.ref || info.computed || info.reactive) {
5610
5546
  const stateTypeName = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
5611
5547
  const value = toRaw(info.reactive ? object : tryGetRefValue(object));
5612
5548
  const raw = ensurePropertyExists(object, "effect") ? object.effect?.raw?.toString() || object.effect?.fn?.toString() : null;
@@ -5788,8 +5724,7 @@ function stringifyStrictCircularAutoChunks(data, replacer = null, space = null)
5788
5724
  }
5789
5725
  function parseCircularAutoChunks(data, reviver$1 = null) {
5790
5726
  if (Array.isArray(data)) data = data.join("");
5791
- const hasCircular = /^\s/.test(data);
5792
- if (!hasCircular) return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver$1);
5727
+ if (!/^\s/.test(data)) return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver$1);
5793
5728
  else {
5794
5729
  const list = JSON.parse(data);
5795
5730
  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.1",
4
+ "version": "8.0.3",
5
5
  "author": "webfansplz",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -23,18 +23,18 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "birpc": "^2.5.0",
26
+ "birpc": "^2.6.1",
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.1"
32
+ "@vue/devtools-shared": "^8.0.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/speakingurl": "^13.0.6",
36
- "vue": "^3.5.18",
37
- "vue-router": "^4.5.1"
36
+ "vue": "^3.5.22",
37
+ "vue-router": "^4.6.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsdown --clean",