@vue/devtools-kit 7.0.3 → 7.0.5

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
@@ -1594,6 +1594,7 @@ __export(src_exports, {
1594
1594
  fnTypeRE: () => fnTypeRE,
1595
1595
  formatInspectorStateValue: () => formatInspectorStateValue,
1596
1596
  getInspectorStateValueType: () => getInspectorStateValueType,
1597
+ getRawValue: () => getRawValue,
1597
1598
  now: () => now,
1598
1599
  onDevToolsClientConnected: () => onDevToolsClientConnected,
1599
1600
  onDevToolsConnected: () => onDevToolsConnected,
@@ -1886,7 +1887,7 @@ init_cjs_shims();
1886
1887
 
1887
1888
  // src/core/component/state/constants.ts
1888
1889
  init_cjs_shims();
1889
- var vueBuiltins = [
1890
+ var vueBuiltins = /* @__PURE__ */ new Set([
1890
1891
  "nextTick",
1891
1892
  "defineComponent",
1892
1893
  "defineAsyncComponent",
@@ -1938,7 +1939,7 @@ var vueBuiltins = [
1938
1939
  "resolveDirective",
1939
1940
  "withDirectives",
1940
1941
  "withModifiers"
1941
- ];
1942
+ ]);
1942
1943
  var symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/;
1943
1944
  var rawTypeRE = /^\[object (\w+)]$/;
1944
1945
  var specialTypeRE = /^\[native (\w+) (.*?)(<>((.|\s)*))?\]$/;
@@ -2088,6 +2089,19 @@ function formatInspectorStateValue(value, quotes = false) {
2088
2089
  }
2089
2090
  return value;
2090
2091
  }
2092
+ function getRawValue(value) {
2093
+ var _a8, _b8;
2094
+ const isCustom = getInspectorStateValueType(value) === "custom";
2095
+ let inherit = {};
2096
+ if (isCustom) {
2097
+ const data = value;
2098
+ inherit = ((_a8 = data._custom) == null ? void 0 : _a8.fields) || {};
2099
+ value = (_b8 = data._custom) == null ? void 0 : _b8.value;
2100
+ }
2101
+ if (value && value._isArray)
2102
+ value = value.items;
2103
+ return { value, inherit };
2104
+ }
2091
2105
 
2092
2106
  // src/core/component/state/replacer.ts
2093
2107
  init_cjs_shims();
@@ -2276,7 +2290,7 @@ function getStateTypeAndName(info) {
2276
2290
  }
2277
2291
  function processSetupState(instance) {
2278
2292
  const raw = instance.devtoolsRawSetupState || {};
2279
- return Object.keys(instance.setupState).filter((key) => !vueBuiltins.includes(key) && key.split(/(?=[A-Z])/)[0] !== "use").map((key) => {
2293
+ return Object.keys(instance.setupState).filter((key) => !vueBuiltins.has(key) && key.split(/(?=[A-Z])/)[0] !== "use").map((key) => {
2280
2294
  var _a8, _b8, _c, _d;
2281
2295
  const value = returnError(() => toRaw(instance.setupState[key]));
2282
2296
  const rawData = raw[key];
@@ -3048,6 +3062,7 @@ init_cjs_shims();
3048
3062
 
3049
3063
  // src/core/plugins/components.ts
3050
3064
  init_cjs_shims();
3065
+ var import_perfect_debounce3 = require("perfect-debounce");
3051
3066
 
3052
3067
  // src/api/plugin.ts
3053
3068
  init_cjs_shims();
@@ -3059,6 +3074,9 @@ async function registerPlugin(options) {
3059
3074
  const { app, api } = options;
3060
3075
  const plugins = devtoolsState.pluginBuffer.filter(([plugin]) => plugin.app === app);
3061
3076
  plugins.forEach(async ([plugin, setupFn]) => {
3077
+ if (plugin.packageName === "vue-query") {
3078
+ return;
3079
+ }
3062
3080
  const appRecord = await getAppRecord(plugin.app);
3063
3081
  if (plugin.packageName === "vue-router") {
3064
3082
  const id = getRouterDevToolsId(`${plugin.id}`);
@@ -3551,6 +3569,12 @@ function registerComponentsDevTools(app) {
3551
3569
  await api.sendInspectorState("components");
3552
3570
  }
3553
3571
  });
3572
+ const debounceSendInspectorTree = (0, import_perfect_debounce3.debounce)(() => {
3573
+ api.sendInspectorTree(INSPECTOR_ID);
3574
+ }, 120);
3575
+ const debounceSendInspectorState = (0, import_perfect_debounce3.debounce)(() => {
3576
+ api.sendInspectorState(INSPECTOR_ID);
3577
+ }, 120);
3554
3578
  const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
3555
3579
  var _a8, _b8, _c;
3556
3580
  if ((_c = (_b8 = (_a8 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a8.type) == null ? void 0 : _b8.devtools) == null ? void 0 : _c.hide)
@@ -3571,7 +3595,7 @@ function registerComponentsDevTools(app) {
3571
3595
  }
3572
3596
  if (!appRecord)
3573
3597
  return;
3574
- api.sendInspectorTree(INSPECTOR_ID);
3598
+ debounceSendInspectorTree();
3575
3599
  });
3576
3600
  const componentUpdatedCleanup = hook.on.componentUpdated(async (app2, uid, parentUid, component) => {
3577
3601
  var _a8, _b8, _c;
@@ -3593,8 +3617,8 @@ function registerComponentsDevTools(app) {
3593
3617
  }
3594
3618
  if (!appRecord)
3595
3619
  return;
3596
- api.sendInspectorTree(INSPECTOR_ID);
3597
- api.sendInspectorState(INSPECTOR_ID);
3620
+ debounceSendInspectorTree();
3621
+ debounceSendInspectorState();
3598
3622
  });
3599
3623
  const componentRemovedCleanup = hook.on.componentRemoved(async (app2, uid, parentUid, component) => {
3600
3624
  var _a8, _b8, _c;
@@ -3611,7 +3635,7 @@ function registerComponentsDevTools(app) {
3611
3635
  instance: component
3612
3636
  });
3613
3637
  appRecord == null ? void 0 : appRecord.instanceMap.delete(id);
3614
- api.sendInspectorTree(INSPECTOR_ID);
3638
+ debounceSendInspectorTree();
3615
3639
  });
3616
3640
  devtoolsContext.componentPluginHookBuffer = [
3617
3641
  componentAddedCleanup,
@@ -4218,6 +4242,7 @@ var devtools = {
4218
4242
  fnTypeRE,
4219
4243
  formatInspectorStateValue,
4220
4244
  getInspectorStateValueType,
4245
+ getRawValue,
4221
4246
  now,
4222
4247
  onDevToolsClientConnected,
4223
4248
  onDevToolsConnected,
package/dist/index.d.cts CHANGED
@@ -377,13 +377,17 @@ declare function addCustomTab(tab: CustomTab): void;
377
377
 
378
378
  declare function getInspectorStateValueType(value: any, raw?: boolean): string;
379
379
  declare function formatInspectorStateValue(value: any, quotes?: boolean): any;
380
+ declare function getRawValue(value: InspectorState['value']): {
381
+ value: string | number | Record<string, unknown> | unknown[] | InspectorCustomState;
382
+ inherit: {};
383
+ };
380
384
 
381
385
  declare function stringify<T extends object = Record<string, unknown>>(data: T): string | string[];
382
386
  declare function parse(data: string, revive?: boolean): any;
383
387
 
384
388
  declare function now(): number;
385
389
 
386
- declare const vueBuiltins: string[];
390
+ declare const vueBuiltins: Set<string>;
387
391
  declare const symbolRE: RegExp;
388
392
  declare const rawTypeRE: RegExp;
389
393
  declare const specialTypeRE: RegExp;
@@ -616,4 +620,4 @@ declare const devtools: {
616
620
  readonly api: DevToolsPluginApi;
617
621
  };
618
622
 
619
- export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, vueBuiltins };
623
+ export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRawValue, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, vueBuiltins };
package/dist/index.d.ts CHANGED
@@ -377,13 +377,17 @@ declare function addCustomTab(tab: CustomTab): void;
377
377
 
378
378
  declare function getInspectorStateValueType(value: any, raw?: boolean): string;
379
379
  declare function formatInspectorStateValue(value: any, quotes?: boolean): any;
380
+ declare function getRawValue(value: InspectorState['value']): {
381
+ value: string | number | Record<string, unknown> | unknown[] | InspectorCustomState;
382
+ inherit: {};
383
+ };
380
384
 
381
385
  declare function stringify<T extends object = Record<string, unknown>>(data: T): string | string[];
382
386
  declare function parse(data: string, revive?: boolean): any;
383
387
 
384
388
  declare function now(): number;
385
389
 
386
- declare const vueBuiltins: string[];
390
+ declare const vueBuiltins: Set<string>;
387
391
  declare const symbolRE: RegExp;
388
392
  declare const rawTypeRE: RegExp;
389
393
  declare const specialTypeRE: RegExp;
@@ -616,4 +620,4 @@ declare const devtools: {
616
620
  readonly api: DevToolsPluginApi;
617
621
  };
618
622
 
619
- export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, vueBuiltins };
623
+ export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRawValue, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, vueBuiltins };
package/dist/index.mjs CHANGED
@@ -1852,7 +1852,7 @@ init_esm_shims();
1852
1852
 
1853
1853
  // src/core/component/state/constants.ts
1854
1854
  init_esm_shims();
1855
- var vueBuiltins = [
1855
+ var vueBuiltins = /* @__PURE__ */ new Set([
1856
1856
  "nextTick",
1857
1857
  "defineComponent",
1858
1858
  "defineAsyncComponent",
@@ -1904,7 +1904,7 @@ var vueBuiltins = [
1904
1904
  "resolveDirective",
1905
1905
  "withDirectives",
1906
1906
  "withModifiers"
1907
- ];
1907
+ ]);
1908
1908
  var symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/;
1909
1909
  var rawTypeRE = /^\[object (\w+)]$/;
1910
1910
  var specialTypeRE = /^\[native (\w+) (.*?)(<>((.|\s)*))?\]$/;
@@ -2054,6 +2054,19 @@ function formatInspectorStateValue(value, quotes = false) {
2054
2054
  }
2055
2055
  return value;
2056
2056
  }
2057
+ function getRawValue(value) {
2058
+ var _a8, _b8;
2059
+ const isCustom = getInspectorStateValueType(value) === "custom";
2060
+ let inherit = {};
2061
+ if (isCustom) {
2062
+ const data = value;
2063
+ inherit = ((_a8 = data._custom) == null ? void 0 : _a8.fields) || {};
2064
+ value = (_b8 = data._custom) == null ? void 0 : _b8.value;
2065
+ }
2066
+ if (value && value._isArray)
2067
+ value = value.items;
2068
+ return { value, inherit };
2069
+ }
2057
2070
 
2058
2071
  // src/core/component/state/replacer.ts
2059
2072
  init_esm_shims();
@@ -2242,7 +2255,7 @@ function getStateTypeAndName(info) {
2242
2255
  }
2243
2256
  function processSetupState(instance) {
2244
2257
  const raw = instance.devtoolsRawSetupState || {};
2245
- return Object.keys(instance.setupState).filter((key) => !vueBuiltins.includes(key) && key.split(/(?=[A-Z])/)[0] !== "use").map((key) => {
2258
+ return Object.keys(instance.setupState).filter((key) => !vueBuiltins.has(key) && key.split(/(?=[A-Z])/)[0] !== "use").map((key) => {
2246
2259
  var _a8, _b8, _c, _d;
2247
2260
  const value = returnError(() => toRaw(instance.setupState[key]));
2248
2261
  const rawData = raw[key];
@@ -3014,6 +3027,7 @@ init_esm_shims();
3014
3027
 
3015
3028
  // src/core/plugins/components.ts
3016
3029
  init_esm_shims();
3030
+ import { debounce as debounce3 } from "perfect-debounce";
3017
3031
 
3018
3032
  // src/api/plugin.ts
3019
3033
  init_esm_shims();
@@ -3025,6 +3039,9 @@ async function registerPlugin(options) {
3025
3039
  const { app, api } = options;
3026
3040
  const plugins = devtoolsState.pluginBuffer.filter(([plugin]) => plugin.app === app);
3027
3041
  plugins.forEach(async ([plugin, setupFn]) => {
3042
+ if (plugin.packageName === "vue-query") {
3043
+ return;
3044
+ }
3028
3045
  const appRecord = await getAppRecord(plugin.app);
3029
3046
  if (plugin.packageName === "vue-router") {
3030
3047
  const id = getRouterDevToolsId(`${plugin.id}`);
@@ -3517,6 +3534,12 @@ function registerComponentsDevTools(app) {
3517
3534
  await api.sendInspectorState("components");
3518
3535
  }
3519
3536
  });
3537
+ const debounceSendInspectorTree = debounce3(() => {
3538
+ api.sendInspectorTree(INSPECTOR_ID);
3539
+ }, 120);
3540
+ const debounceSendInspectorState = debounce3(() => {
3541
+ api.sendInspectorState(INSPECTOR_ID);
3542
+ }, 120);
3520
3543
  const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
3521
3544
  var _a8, _b8, _c;
3522
3545
  if ((_c = (_b8 = (_a8 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a8.type) == null ? void 0 : _b8.devtools) == null ? void 0 : _c.hide)
@@ -3537,7 +3560,7 @@ function registerComponentsDevTools(app) {
3537
3560
  }
3538
3561
  if (!appRecord)
3539
3562
  return;
3540
- api.sendInspectorTree(INSPECTOR_ID);
3563
+ debounceSendInspectorTree();
3541
3564
  });
3542
3565
  const componentUpdatedCleanup = hook.on.componentUpdated(async (app2, uid, parentUid, component) => {
3543
3566
  var _a8, _b8, _c;
@@ -3559,8 +3582,8 @@ function registerComponentsDevTools(app) {
3559
3582
  }
3560
3583
  if (!appRecord)
3561
3584
  return;
3562
- api.sendInspectorTree(INSPECTOR_ID);
3563
- api.sendInspectorState(INSPECTOR_ID);
3585
+ debounceSendInspectorTree();
3586
+ debounceSendInspectorState();
3564
3587
  });
3565
3588
  const componentRemovedCleanup = hook.on.componentRemoved(async (app2, uid, parentUid, component) => {
3566
3589
  var _a8, _b8, _c;
@@ -3577,7 +3600,7 @@ function registerComponentsDevTools(app) {
3577
3600
  instance: component
3578
3601
  });
3579
3602
  appRecord == null ? void 0 : appRecord.instanceMap.delete(id);
3580
- api.sendInspectorTree(INSPECTOR_ID);
3603
+ debounceSendInspectorTree();
3581
3604
  });
3582
3605
  devtoolsContext.componentPluginHookBuffer = [
3583
3606
  componentAddedCleanup,
@@ -4183,6 +4206,7 @@ export {
4183
4206
  fnTypeRE,
4184
4207
  formatInspectorStateValue,
4185
4208
  getInspectorStateValueType,
4209
+ getRawValue,
4186
4210
  now,
4187
4211
  onDevToolsClientConnected,
4188
4212
  onDevToolsConnected,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue/devtools-kit",
3
3
  "type": "module",
4
- "version": "7.0.3",
4
+ "version": "7.0.5",
5
5
  "author": "webfansplz",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -21,11 +21,11 @@
21
21
  "mitt": "^3.0.1",
22
22
  "perfect-debounce": "^1.0.0",
23
23
  "speakingurl": "^14.0.1",
24
- "@vue/devtools-schema": "^7.0.3",
25
- "@vue/devtools-shared": "^7.0.3"
24
+ "@vue/devtools-schema": "^7.0.5",
25
+ "@vue/devtools-shared": "^7.0.5"
26
26
  },
27
27
  "devDependencies": {
28
- "vue": "^3.4.0",
28
+ "vue": "^3.4.4",
29
29
  "vue-router": "^4.2.5"
30
30
  },
31
31
  "scripts": {