@vue/devtools-kit 7.3.0-beta.1 → 7.3.0-beta.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
@@ -2430,12 +2430,14 @@ function addInspector(inspector, descriptor) {
2430
2430
  }
2431
2431
  function getActiveInspectors() {
2432
2432
  return devtoolsInspector.filter((inspector) => inspector.descriptor.app === activeAppRecord.value.app).filter((inspector) => inspector.descriptor.id !== "components").map((inspector) => {
2433
+ var _a23;
2433
2434
  const descriptor = inspector.descriptor;
2434
2435
  const options = inspector.options;
2435
2436
  return {
2436
2437
  id: options.id,
2437
2438
  label: options.label,
2438
- logo: `i-ic-baseline-${options.icon}`,
2439
+ logo: descriptor.logo,
2440
+ icon: `i-ic-baseline-${(_a23 = options == null ? void 0 : options.icon) == null ? void 0 : _a23.replace(/_/g, "-")}`,
2439
2441
  packageName: descriptor.packageName,
2440
2442
  homepage: descriptor.homepage
2441
2443
  };
@@ -2959,6 +2961,14 @@ function createDevToolsApi(hooks2) {
2959
2961
  callbacks.forEach((cb) => cb(_payload));
2960
2962
  }, "editInspectorState" /* EDIT_INSPECTOR_STATE */);
2961
2963
  },
2964
+ // send inspector state
2965
+ sendInspectorState(inspectorId) {
2966
+ const inspector = getInspector(inspectorId);
2967
+ hooks2.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId, plugin: {
2968
+ descriptor: inspector.descriptor,
2969
+ setupFn: () => ({})
2970
+ } });
2971
+ },
2962
2972
  // inspect component inspector
2963
2973
  inspectComponentInspector() {
2964
2974
  return inspectComponentHighLighter();
@@ -3173,16 +3183,20 @@ var DevToolsV6PluginAPI = class {
3173
3183
  // component inspector
3174
3184
  notifyComponentUpdate(instance) {
3175
3185
  var _a23;
3176
- if (instance) {
3177
- const args = [
3178
- instance.appContext.app,
3179
- instance.uid,
3180
- (_a23 = instance.parent) == null ? void 0 : _a23.uid,
3181
- instance
3182
- ];
3183
- devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, ...args);
3184
- } else {
3185
- devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */);
3186
+ const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
3187
+ if (inspector == null ? void 0 : inspector.id) {
3188
+ if (instance) {
3189
+ const args = [
3190
+ instance.appContext.app,
3191
+ instance.uid,
3192
+ (_a23 = instance.parent) == null ? void 0 : _a23.uid,
3193
+ instance
3194
+ ];
3195
+ devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, ...args);
3196
+ } else {
3197
+ devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */);
3198
+ }
3199
+ this.hooks.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId: inspector.id, plugin: this.plugin });
3186
3200
  }
3187
3201
  }
3188
3202
  // custom inspector
package/dist/index.d.cts CHANGED
@@ -352,6 +352,7 @@ interface DevToolsMessagingHookPayloads {
352
352
  id: string;
353
353
  label: string;
354
354
  logo: string;
355
+ icon: string;
355
356
  packageName: string | undefined;
356
357
  homepage: string | undefined;
357
358
  }[];
@@ -395,6 +396,7 @@ declare function createDevToolsApi(hooks: Hookable<DevToolsContextHooks & DevToo
395
396
  getInspectorTree(payload: Pick<DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE], 'inspectorId' | 'filter'>): Promise<never[]>;
396
397
  getInspectorState(payload: Pick<DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE], 'inspectorId' | 'nodeId'>): Promise<CustomInspectorState>;
397
398
  editInspectorState(payload: DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE]): void;
399
+ sendInspectorState(inspectorId: string): void;
398
400
  inspectComponentInspector(): Promise<string>;
399
401
  cancelInspectComponentInspector(): void;
400
402
  getComponentRenderCode(id: string): any;
@@ -423,6 +425,7 @@ declare function getActiveInspectors(): {
423
425
  id: string;
424
426
  label: string;
425
427
  logo: string;
428
+ icon: string;
426
429
  packageName: string | undefined;
427
430
  homepage: string | undefined;
428
431
  }[];
@@ -1030,6 +1033,7 @@ declare const devtools: {
1030
1033
  state: EditStatePayload;
1031
1034
  set: (object: any, path?: string | string[] | undefined, value?: any, cb?: ((object: any, field: string, value: any) => void) | undefined) => void;
1032
1035
  }): void;
1036
+ sendInspectorState(inspectorId: string): void;
1033
1037
  inspectComponentInspector(): Promise<string>;
1034
1038
  cancelInspectComponentInspector(): void;
1035
1039
  getComponentRenderCode(id: string): any;
package/dist/index.d.ts CHANGED
@@ -352,6 +352,7 @@ interface DevToolsMessagingHookPayloads {
352
352
  id: string;
353
353
  label: string;
354
354
  logo: string;
355
+ icon: string;
355
356
  packageName: string | undefined;
356
357
  homepage: string | undefined;
357
358
  }[];
@@ -395,6 +396,7 @@ declare function createDevToolsApi(hooks: Hookable<DevToolsContextHooks & DevToo
395
396
  getInspectorTree(payload: Pick<DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE], 'inspectorId' | 'filter'>): Promise<never[]>;
396
397
  getInspectorState(payload: Pick<DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE], 'inspectorId' | 'nodeId'>): Promise<CustomInspectorState>;
397
398
  editInspectorState(payload: DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE]): void;
399
+ sendInspectorState(inspectorId: string): void;
398
400
  inspectComponentInspector(): Promise<string>;
399
401
  cancelInspectComponentInspector(): void;
400
402
  getComponentRenderCode(id: string): any;
@@ -423,6 +425,7 @@ declare function getActiveInspectors(): {
423
425
  id: string;
424
426
  label: string;
425
427
  logo: string;
428
+ icon: string;
426
429
  packageName: string | undefined;
427
430
  homepage: string | undefined;
428
431
  }[];
@@ -1030,6 +1033,7 @@ declare const devtools: {
1030
1033
  state: EditStatePayload;
1031
1034
  set: (object: any, path?: string | string[] | undefined, value?: any, cb?: ((object: any, field: string, value: any) => void) | undefined) => void;
1032
1035
  }): void;
1036
+ sendInspectorState(inspectorId: string): void;
1033
1037
  inspectComponentInspector(): Promise<string>;
1034
1038
  cancelInspectComponentInspector(): void;
1035
1039
  getComponentRenderCode(id: string): any;
package/dist/index.js CHANGED
@@ -2342,12 +2342,14 @@ function addInspector(inspector, descriptor) {
2342
2342
  }
2343
2343
  function getActiveInspectors() {
2344
2344
  return devtoolsInspector.filter((inspector) => inspector.descriptor.app === activeAppRecord.value.app).filter((inspector) => inspector.descriptor.id !== "components").map((inspector) => {
2345
+ var _a23;
2345
2346
  const descriptor = inspector.descriptor;
2346
2347
  const options = inspector.options;
2347
2348
  return {
2348
2349
  id: options.id,
2349
2350
  label: options.label,
2350
- logo: `i-ic-baseline-${options.icon}`,
2351
+ logo: descriptor.logo,
2352
+ icon: `i-ic-baseline-${(_a23 = options == null ? void 0 : options.icon) == null ? void 0 : _a23.replace(/_/g, "-")}`,
2351
2353
  packageName: descriptor.packageName,
2352
2354
  homepage: descriptor.homepage
2353
2355
  };
@@ -2871,6 +2873,14 @@ function createDevToolsApi(hooks2) {
2871
2873
  callbacks.forEach((cb) => cb(_payload));
2872
2874
  }, "editInspectorState" /* EDIT_INSPECTOR_STATE */);
2873
2875
  },
2876
+ // send inspector state
2877
+ sendInspectorState(inspectorId) {
2878
+ const inspector = getInspector(inspectorId);
2879
+ hooks2.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId, plugin: {
2880
+ descriptor: inspector.descriptor,
2881
+ setupFn: () => ({})
2882
+ } });
2883
+ },
2874
2884
  // inspect component inspector
2875
2885
  inspectComponentInspector() {
2876
2886
  return inspectComponentHighLighter();
@@ -3085,16 +3095,20 @@ var DevToolsV6PluginAPI = class {
3085
3095
  // component inspector
3086
3096
  notifyComponentUpdate(instance) {
3087
3097
  var _a23;
3088
- if (instance) {
3089
- const args = [
3090
- instance.appContext.app,
3091
- instance.uid,
3092
- (_a23 = instance.parent) == null ? void 0 : _a23.uid,
3093
- instance
3094
- ];
3095
- devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, ...args);
3096
- } else {
3097
- devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */);
3098
+ const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
3099
+ if (inspector == null ? void 0 : inspector.id) {
3100
+ if (instance) {
3101
+ const args = [
3102
+ instance.appContext.app,
3103
+ instance.uid,
3104
+ (_a23 = instance.parent) == null ? void 0 : _a23.uid,
3105
+ instance
3106
+ ];
3107
+ devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, ...args);
3108
+ } else {
3109
+ devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */);
3110
+ }
3111
+ this.hooks.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId: inspector.id, plugin: this.plugin });
3098
3112
  }
3099
3113
  }
3100
3114
  // custom inspector
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue/devtools-kit",
3
3
  "type": "module",
4
- "version": "7.3.0-beta.1",
4
+ "version": "7.3.0-beta.2",
5
5
  "author": "webfansplz",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "perfect-debounce": "^1.0.0",
33
33
  "speakingurl": "^14.0.1",
34
34
  "superjson": "^2.2.1",
35
- "@vue/devtools-shared": "^7.3.0-beta.1"
35
+ "@vue/devtools-shared": "^7.3.0-beta.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/speakingurl": "^13.0.6",