@vue/devtools-api 6.0.0-beta.18 → 6.0.0-beta.20.1
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/lib/cjs/index.js +1 -1
- package/lib/cjs/proxy.js +6 -6
- package/lib/esm/api/api.d.ts +1 -1
- package/lib/esm/api/app.d.ts +3 -1
- package/lib/esm/api/component.d.ts +3 -1
- package/lib/esm/api/hooks.d.ts +12 -2
- package/lib/esm/index.js +1 -1
- package/lib/esm/plugin.d.ts +1 -0
- package/lib/esm/proxy.js +6 -6
- package/package.json +1 -1
package/lib/cjs/index.js
CHANGED
package/lib/cjs/proxy.js
CHANGED
|
@@ -38,7 +38,7 @@ class ApiProxy {
|
|
|
38
38
|
// noop
|
|
39
39
|
}
|
|
40
40
|
currentSettings = value;
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
42
|
};
|
|
43
43
|
hook.on(const_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
|
|
44
44
|
if (pluginId === this.plugin.id) {
|
|
@@ -54,11 +54,11 @@ class ApiProxy {
|
|
|
54
54
|
return (...args) => {
|
|
55
55
|
this.onQueue.push({
|
|
56
56
|
method: prop,
|
|
57
|
-
args
|
|
57
|
+
args,
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
},
|
|
62
62
|
});
|
|
63
63
|
this.proxiedTarget = new Proxy({}, {
|
|
64
64
|
get: (_target, prop) => {
|
|
@@ -73,7 +73,7 @@ class ApiProxy {
|
|
|
73
73
|
this.targetQueue.push({
|
|
74
74
|
method: prop,
|
|
75
75
|
args,
|
|
76
|
-
resolve: () => { }
|
|
76
|
+
resolve: () => { },
|
|
77
77
|
});
|
|
78
78
|
return this.fallbacks[prop](...args);
|
|
79
79
|
};
|
|
@@ -84,12 +84,12 @@ class ApiProxy {
|
|
|
84
84
|
this.targetQueue.push({
|
|
85
85
|
method: prop,
|
|
86
86
|
args,
|
|
87
|
-
resolve
|
|
87
|
+
resolve,
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
}
|
|
92
|
+
},
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
async setRealTarget(target) {
|
package/lib/esm/api/api.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface DevtoolsPluginApi<TSettings> {
|
|
|
17
17
|
getComponentInstances(app: App): Promise<ComponentInstance[]>;
|
|
18
18
|
highlightElement(instance: ComponentInstance): void;
|
|
19
19
|
unhighlightElement(): void;
|
|
20
|
-
getSettings(): TSettings;
|
|
20
|
+
getSettings(pluginId?: string): TSettings;
|
|
21
21
|
/**
|
|
22
22
|
* @private Not implemented yet
|
|
23
23
|
*/
|
package/lib/esm/api/app.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { InspectorNodeTag } from './api';
|
|
2
2
|
import { ID } from './util';
|
|
3
|
-
export declare type ComponentInstance = any
|
|
3
|
+
export declare type ComponentInstance = Record<string, any> & {
|
|
4
|
+
__component: true;
|
|
5
|
+
};
|
|
4
6
|
export interface ComponentTreeNode {
|
|
5
7
|
uid: ID;
|
|
6
8
|
id: string;
|
package/lib/esm/api/hooks.d.ts
CHANGED
|
@@ -22,7 +22,8 @@ export declare const enum Hooks {
|
|
|
22
22
|
TIMELINE_CLEARED = "timelineCleared",
|
|
23
23
|
GET_INSPECTOR_TREE = "getInspectorTree",
|
|
24
24
|
GET_INSPECTOR_STATE = "getInspectorState",
|
|
25
|
-
EDIT_INSPECTOR_STATE = "editInspectorState"
|
|
25
|
+
EDIT_INSPECTOR_STATE = "editInspectorState",
|
|
26
|
+
SET_PLUGIN_SETTINGS = "setPluginSettings"
|
|
26
27
|
}
|
|
27
28
|
export interface ComponentBounds {
|
|
28
29
|
left: number;
|
|
@@ -94,7 +95,7 @@ export declare type HookPayloads = {
|
|
|
94
95
|
path: string[];
|
|
95
96
|
type: string;
|
|
96
97
|
state: EditStatePayload;
|
|
97
|
-
set: (object: any, path
|
|
98
|
+
set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void;
|
|
98
99
|
};
|
|
99
100
|
[Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS]: {
|
|
100
101
|
componentInstance: ComponentInstance;
|
|
@@ -133,6 +134,14 @@ export declare type HookPayloads = {
|
|
|
133
134
|
state: EditStatePayload;
|
|
134
135
|
set: (object: any, path: string | (string[]), value: any, cb?: (object: any, field: string, value: any) => void) => void;
|
|
135
136
|
};
|
|
137
|
+
[Hooks.SET_PLUGIN_SETTINGS]: {
|
|
138
|
+
app: App;
|
|
139
|
+
pluginId: string;
|
|
140
|
+
key: string;
|
|
141
|
+
newValue: any;
|
|
142
|
+
oldValue: any;
|
|
143
|
+
settings: any;
|
|
144
|
+
};
|
|
136
145
|
};
|
|
137
146
|
export declare type EditStatePayload = {
|
|
138
147
|
value: any;
|
|
@@ -166,4 +175,5 @@ export interface Hookable<TContext> {
|
|
|
166
175
|
getInspectorTree(handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_TREE], TContext>): any;
|
|
167
176
|
getInspectorState(handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_STATE], TContext>): any;
|
|
168
177
|
editInspectorState(handler: HookHandler<HookPayloads[Hooks.EDIT_INSPECTOR_STATE], TContext>): any;
|
|
178
|
+
setPluginSettings(handler: HookHandler<HookPayloads[Hooks.SET_PLUGIN_SETTINGS], TContext>): any;
|
|
169
179
|
}
|
package/lib/esm/index.js
CHANGED
package/lib/esm/plugin.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface PluginDescriptor {
|
|
|
8
8
|
componentStateTypes?: string[];
|
|
9
9
|
logo?: string;
|
|
10
10
|
disableAppScope?: boolean;
|
|
11
|
+
disablePluginScope?: boolean;
|
|
11
12
|
/**
|
|
12
13
|
* Run the plugin setup and expose the api even if the devtools is not opened yet.
|
|
13
14
|
* Useful to record timeline events early.
|
package/lib/esm/proxy.js
CHANGED
|
@@ -35,7 +35,7 @@ export class ApiProxy {
|
|
|
35
35
|
// noop
|
|
36
36
|
}
|
|
37
37
|
currentSettings = value;
|
|
38
|
-
}
|
|
38
|
+
},
|
|
39
39
|
};
|
|
40
40
|
hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
|
|
41
41
|
if (pluginId === this.plugin.id) {
|
|
@@ -51,11 +51,11 @@ export class ApiProxy {
|
|
|
51
51
|
return (...args) => {
|
|
52
52
|
this.onQueue.push({
|
|
53
53
|
method: prop,
|
|
54
|
-
args
|
|
54
|
+
args,
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
}
|
|
58
|
+
},
|
|
59
59
|
});
|
|
60
60
|
this.proxiedTarget = new Proxy({}, {
|
|
61
61
|
get: (_target, prop) => {
|
|
@@ -70,7 +70,7 @@ export class ApiProxy {
|
|
|
70
70
|
this.targetQueue.push({
|
|
71
71
|
method: prop,
|
|
72
72
|
args,
|
|
73
|
-
resolve: () => { }
|
|
73
|
+
resolve: () => { },
|
|
74
74
|
});
|
|
75
75
|
return this.fallbacks[prop](...args);
|
|
76
76
|
};
|
|
@@ -81,12 +81,12 @@ export class ApiProxy {
|
|
|
81
81
|
this.targetQueue.push({
|
|
82
82
|
method: prop,
|
|
83
83
|
args,
|
|
84
|
-
resolve
|
|
84
|
+
resolve,
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
}
|
|
89
|
+
},
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
async setRealTarget(target) {
|