@vue/devtools-kit 7.0.16 → 7.0.18

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
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target9) => (target9 = mod != null ? __create(__
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.4.2/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.4.2/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -1597,7 +1597,8 @@ __export(src_exports, {
1597
1597
  stringify: () => stringify,
1598
1598
  toEdit: () => toEdit,
1599
1599
  toSubmit: () => toSubmit,
1600
- toggleComponentInspectorEnabled: () => toggleComponentInspectorEnabled
1600
+ toggleComponentInspectorEnabled: () => toggleComponentInspectorEnabled,
1601
+ toggleHighPerfMode: () => toggleHighPerfMode
1601
1602
  });
1602
1603
  module.exports = __toCommonJS(src_exports);
1603
1604
  init_cjs_shims();
@@ -2325,6 +2326,8 @@ var StateEditor = class {
2325
2326
  const section = sections.shift();
2326
2327
  if (object instanceof Map)
2327
2328
  object = object.get(section);
2329
+ if (object instanceof Set)
2330
+ object = Array.from(object.values())[section];
2328
2331
  else
2329
2332
  object = object[section];
2330
2333
  if (this.refEditor.isRef(object))
@@ -2378,7 +2381,7 @@ var StateEditor = class {
2378
2381
  else if ((0, import_vue2.toRaw)(object) instanceof Map)
2379
2382
  object.delete(field);
2380
2383
  else if ((0, import_vue2.toRaw)(object) instanceof Set)
2381
- object.delete(value);
2384
+ object.delete(Array.from(object.values())[field]);
2382
2385
  else
2383
2386
  Reflect.deleteProperty(object, field);
2384
2387
  }
@@ -2388,6 +2391,8 @@ var StateEditor = class {
2388
2391
  this.refEditor.set(target9, value);
2389
2392
  else if ((0, import_vue2.toRaw)(object) instanceof Map)
2390
2393
  object.set(state.newKey || field, value);
2394
+ else if ((0, import_vue2.toRaw)(object) instanceof Set)
2395
+ object.add(value);
2391
2396
  else
2392
2397
  object[state.newKey || field] = value;
2393
2398
  }
@@ -2939,6 +2944,8 @@ function registerComponentDevToolsPlugin(app) {
2939
2944
  }, 120);
2940
2945
  const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
2941
2946
  var _a10, _b10, _c;
2947
+ if (devtoolsState.highPerfModeEnabled)
2948
+ return;
2942
2949
  if ((_c = (_b10 = (_a10 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a10.type) == null ? void 0 : _b10.devtools) == null ? void 0 : _c.hide)
2943
2950
  return;
2944
2951
  if (!app2 || typeof uid !== "number" && !uid || !component)
@@ -2961,6 +2968,8 @@ function registerComponentDevToolsPlugin(app) {
2961
2968
  });
2962
2969
  const componentUpdatedCleanup = hook.on.componentUpdated(async (app2, uid, parentUid, component) => {
2963
2970
  var _a10, _b10, _c;
2971
+ if (devtoolsState.highPerfModeEnabled)
2972
+ return;
2964
2973
  if ((_c = (_b10 = (_a10 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a10.type) == null ? void 0 : _b10.devtools) == null ? void 0 : _c.hide)
2965
2974
  return;
2966
2975
  if (!app2 || typeof uid !== "number" && !uid || !component)
@@ -2984,6 +2993,8 @@ function registerComponentDevToolsPlugin(app) {
2984
2993
  });
2985
2994
  const componentRemovedCleanup = hook.on.componentRemoved(async (app2, uid, parentUid, component) => {
2986
2995
  var _a10, _b10, _c;
2996
+ if (devtoolsState.highPerfModeEnabled)
2997
+ return;
2987
2998
  if ((_c = (_b10 = (_a10 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a10.type) == null ? void 0 : _b10.devtools) == null ? void 0 : _c.hide)
2988
2999
  return;
2989
3000
  if (!app2 || typeof uid !== "number" && !uid || !component)
@@ -3329,6 +3340,17 @@ function getBigIntDetails(val) {
3329
3340
  }
3330
3341
  };
3331
3342
  }
3343
+ function getDateDetails(val) {
3344
+ const date = new Date(val.getTime());
3345
+ date.setMinutes(date.getMinutes() - date.getTimezoneOffset());
3346
+ return {
3347
+ _custom: {
3348
+ type: "date",
3349
+ displayText: Date.prototype.toString.call(val),
3350
+ value: date.toISOString().slice(0, -1)
3351
+ }
3352
+ };
3353
+ }
3332
3354
  function getMapDetails(val) {
3333
3355
  const list = Object.fromEntries(val);
3334
3356
  return {
@@ -3546,7 +3568,7 @@ function stringifyReplacer(key) {
3546
3568
  } else if (proto === "[object RegExp]") {
3547
3569
  return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;
3548
3570
  } else if (proto === "[object Date]") {
3549
- return `[native Date ${Date.prototype.toString.call(val)}]`;
3571
+ return getDateDetails(val);
3550
3572
  } else if (proto === "[object Error]") {
3551
3573
  return `[native Error ${val.message}<>${val.stack}]`;
3552
3574
  } else if (val.state && val._vm) {
@@ -3820,11 +3842,15 @@ function getRaw(value) {
3820
3842
  function toEdit(value, customType) {
3821
3843
  if (customType === "bigint")
3822
3844
  return value;
3845
+ if (customType === "date")
3846
+ return value;
3823
3847
  return replaceTokenToString(JSON.stringify(value));
3824
3848
  }
3825
3849
  function toSubmit(value, customType) {
3826
3850
  if (customType === "bigint")
3827
3851
  return BigInt(value);
3852
+ if (customType === "date")
3853
+ return new Date(value);
3828
3854
  return JSON.parse(replaceStringToToken(value), reviver);
3829
3855
  }
3830
3856
 
@@ -3918,9 +3944,8 @@ function getComponentInspector() {
3918
3944
  init_cjs_shims();
3919
3945
  var import_devtools_shared9 = require("@vue/devtools-shared");
3920
3946
  function openInEditor(options = {}) {
3921
- const { file, line = 0, column = 0 } = options;
3947
+ const { file, baseUrl = window.location.origin, line = 0, column = 0 } = options;
3922
3948
  if (file) {
3923
- const baseUrl = window.location.origin;
3924
3949
  if (devtoolsState.vitePluginDetected) {
3925
3950
  import_devtools_shared9.target.__VUE_INSPECTOR__.openInEditor(baseUrl, file, line, column);
3926
3951
  } else {
@@ -4039,7 +4064,7 @@ var DevToolsPluginApi = class {
4039
4064
  resolve();
4040
4065
  }, "inspector-tree:get" /* GET_INSPECTOR_TREE */);
4041
4066
  });
4042
- return stringify(_payload.rootNodes);
4067
+ return _payload.rootNodes;
4043
4068
  }
4044
4069
  getInspectorState(payload = {}) {
4045
4070
  var _a10;
@@ -4057,7 +4082,7 @@ var DevToolsPluginApi = class {
4057
4082
  }, "inspector-state:get" /* GET_INSPECTOR_STATE */);
4058
4083
  const state = _payload.state;
4059
4084
  delete state.instance;
4060
- return stringify(state);
4085
+ return state;
4061
4086
  }
4062
4087
  async editInspectorState(payload) {
4063
4088
  var _a10;
@@ -4076,10 +4101,10 @@ var DevToolsPluginApi = class {
4076
4101
  const res = await this.getInspectorTree({
4077
4102
  inspectorId
4078
4103
  });
4079
- apiHooks.callHook("inspector-tree:send" /* SEND_INSPECTOR_TREE */, stringify({
4104
+ apiHooks.callHook("inspector-tree:send" /* SEND_INSPECTOR_TREE */, {
4080
4105
  inspectorId,
4081
- data: parse(res)
4082
- }));
4106
+ data: res
4107
+ });
4083
4108
  }
4084
4109
  }
4085
4110
  async sendInspectorState(inspectorId) {
@@ -4089,7 +4114,7 @@ var DevToolsPluginApi = class {
4089
4114
  inspectorId,
4090
4115
  nodeId: inspector.nodeId
4091
4116
  });
4092
- apiHooks.callHook("inspector-state:send" /* SEND_INSPECTOR_STATE */, stringify({ ...parse(res), inspectorId }));
4117
+ apiHooks.callHook("inspector-state:send" /* SEND_INSPECTOR_STATE */, { ...res, inspectorId });
4093
4118
  }
4094
4119
  }
4095
4120
  async getComponentInstances(app) {
@@ -4176,7 +4201,8 @@ function initStateFactory() {
4176
4201
  tabs: [],
4177
4202
  commands: [],
4178
4203
  vitePluginDetected: false,
4179
- activeAppRecordId: null
4204
+ activeAppRecordId: null,
4205
+ highPerfModeEnabled: false
4180
4206
  };
4181
4207
  }
4182
4208
  var _a4, _b4;
@@ -4407,6 +4433,12 @@ function onDevToolsClientConnected(fn) {
4407
4433
  });
4408
4434
  }
4409
4435
 
4436
+ // src/core/high-perf-mode/index.ts
4437
+ init_cjs_shims();
4438
+ function toggleHighPerfMode(state) {
4439
+ devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;
4440
+ }
4441
+
4410
4442
  // src/index.ts
4411
4443
  var devtools = {
4412
4444
  state: devtoolsState,
@@ -4435,5 +4467,6 @@ var devtools = {
4435
4467
  stringify,
4436
4468
  toEdit,
4437
4469
  toSubmit,
4438
- toggleComponentInspectorEnabled
4470
+ toggleComponentInspectorEnabled,
4471
+ toggleHighPerfMode
4439
4472
  });