Skip to content

Commit 4fb4585

Browse files
committed
build(deps-dev): bump @vue/devtools-api
1 parent f51a066 commit 4fb4585

File tree

5 files changed

+99
-28
lines changed

5 files changed

+99
-28
lines changed

docs/api/vue-composable.api.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ export interface CancellablePromiseResult<TCancel = any> {
8787
cancelled: Ref<boolean>;
8888
}
8989

90+
// @public (undocumented)
91+
export interface ClipboardItem {
92+
// (undocumented)
93+
new (input: {
94+
[contentType: string]: Blob;
95+
}): ClipboardItem;
96+
}
97+
9098
// @public (undocumented)
9199
export const COMMIT: string;
92100

@@ -857,9 +865,7 @@ export function useBreakpointTailwindCSS<T extends TailwindConfigEmpty>(): Break
857865
// Warning: (ae-forgotten-export) The symbol "DefaultTailwindBreakpoints" needs to be exported by the entry point index.d.ts
858866
//
859867
// @public (undocumented)
860-
export function useBreakpointTailwindCSS(): BreakpointReturn<
861-
DefaultTailwindBreakpoints
862-
>;
868+
export function useBreakpointTailwindCSS(): BreakpointReturn<DefaultTailwindBreakpoints>;
863869

864870
// @public (undocumented)
865871
export function useBreakpointTailwindCSS<T extends BreakpointObject>(): BreakpointReturn<T>;
@@ -906,6 +912,27 @@ export function useCancellablePromise<T = any>(fn: () => T, options: Cancellable
906912
// @public (undocumented)
907913
export function useCancellablePromise<T extends Promise<TR>, TR>(fn: () => T): PromiseResultFactory<T> & CancellablePromiseResult;
908914

915+
// @public (undocumented)
916+
export interface UseClipboard {
917+
// (undocumented)
918+
data: Ref<DataTransfer | undefined>;
919+
// (undocumented)
920+
read(): Promise<DataTransfer | undefined>;
921+
// (undocumented)
922+
readText(): Promise<string | undefined>;
923+
// (undocumented)
924+
supported: boolean;
925+
// (undocumented)
926+
text: Ref<string | undefined>;
927+
// (undocumented)
928+
write(items: ClipboardItem[]): Promise<void>;
929+
// (undocumented)
930+
writeText(text: string): Promise<void>;
931+
}
932+
933+
// @public (undocumented)
934+
export function useClipboard(): UseClipboard;
935+
909936
// @public
910937
export type UseCssVariables<T> = CssVariableObject<T> & CssVariablesMethods;
911938

@@ -993,6 +1020,9 @@ export function useEvent<T extends {
9931020
// @public (undocumented)
9941021
export function useEvent<K extends keyof WindowEventMap>(el: RefTyped<Window>, name: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction;
9951022

1023+
// @public (undocumented)
1024+
export function useEvent(el: Window, name: string, listener: (this: Document, ev: Event) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction;
1025+
9961026
// @public (undocumented)
9971027
export function useEvent<K extends keyof DocumentEventMap>(el: Element | Ref<Element | undefined>, name: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): RemoveEventFunction;
9981028

packages/vue-composable/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"vue-composable-fix": "./scripts/postinstall.js"
4545
},
4646
"dependencies": {
47-
"@vue/devtools-api": "^6.0.0-beta.2"
47+
"@vue/devtools-api": "^6.0.0-beta.3"
4848
},
4949
"peerDependencies3": {
5050
"@vue/runtime-core": "^3.0.0"

packages/vue-composable/src/devtools/app.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { App } from "../api";
22
import ProxyApi from "./proxy";
33
import { setDevtools } from "./api";
44
import { NO_OP } from "../utils";
5+
import { DevtoolsPluginApi } from "@vue/devtools-api";
56

67
let setupDevtoolsPlugin: Function = NO_OP;
78
// NOTE maybe change this to other flag
@@ -16,12 +17,12 @@ export const UseDevtoolsApp = (
1617
id = "vue-composable",
1718
label = "Vue-composable devtools plugin"
1819
) => {
19-
const promise: any = new Promise((res) => {
20+
const promise = new Promise<DevtoolsPluginApi>(res => {
2021
setupDevtoolsPlugin(
2122
{
2223
id,
2324
label,
24-
app,
25+
app
2526
},
2627
res
2728
);

packages/vue-composable/src/devtools/proxy.ts

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,33 @@ async function pushEventsToApi(
1919
"addInspector",
2020
"sendInspectorTree",
2121
"sendInspectorState",
22-
"addTimelineEvent",
22+
"addTimelineEvent"
2323
];
2424

2525
for (const k of priority) {
26-
for (const it of ApiQueue.filter((x) => x.type === k)) {
26+
for (const it of ApiQueue.filter(x => x.type === k)) {
2727
// @ts-ignore
2828
api[k](...it.args);
2929
}
3030
await promisedTimeout(20);
3131
}
3232

3333
new Set(
34-
ApiQueue.filter((x) => x.type === "notifyComponentUpdate").map(
35-
(x) => x.args[0]
34+
ApiQueue.filter(x => x.type === "notifyComponentUpdate").map(
35+
x => x.args[0]
3636
)
37-
).forEach((x) => api.notifyComponentUpdate(x));
37+
).forEach(x => api.notifyComponentUpdate(x));
3838

3939
// @ts-ignore
40-
EventQueue.forEach((x) => api.on[x.type](...x.args));
40+
EventQueue.forEach(x => api.on[x.type](...x.args));
4141

4242
EventQueue.length = 0;
4343
ApiQueue.length = 0;
4444
}, 100);
4545
}
4646

4747
if (__VUE_2__) {
48-
apiProxyFactory = (promiseApi) => {
48+
apiProxyFactory = promiseApi => {
4949
const EventQueue: OnEvent[] = [];
5050
const ApiQueue: ApiEvent[] = [];
5151
let api: DevtoolsPluginApi;
@@ -59,7 +59,7 @@ if (__VUE_2__) {
5959
}
6060
}
6161

62-
promiseApi.then((x) => {
62+
promiseApi.then(x => {
6363
api = x;
6464
pushEventsToApi(api, EventQueue, ApiQueue);
6565
});
@@ -85,12 +85,19 @@ if (__VUE_2__) {
8585
queueEvent("sendInspectorState", arguments);
8686
},
8787

88+
getComponentBounds(_): any {
89+
queueEvent("getComponentBounds", arguments);
90+
},
91+
getComponentName(_): any {
92+
queueEvent("getComponentName", arguments);
93+
},
94+
8895
on: {
8996
transformCall(handler): any {
9097
if (api) {
9198
api.on.transformCall(handler);
9299
} else {
93-
//@ts-ignore2
100+
//@ts-ignore
94101
EventQueue.push({ type: "transformCall", args: arguments });
95102
}
96103
},
@@ -166,7 +173,32 @@ if (__VUE_2__) {
166173
EventQueue.push({ type: "getElementComponent", args: arguments });
167174
}
168175
},
169-
176+
getComponentRootElements(handler): any {
177+
if (api) {
178+
api.on.getComponentRootElements(handler);
179+
} else {
180+
EventQueue.push({
181+
type: "getComponentRootElements",
182+
args: arguments
183+
} as any);
184+
}
185+
},
186+
editComponentState(handler): any {
187+
if (api) {
188+
api.on.editComponentState(handler);
189+
} else {
190+
//@ts-ignore
191+
EventQueue.push({ type: "editComponentState", args: arguments });
192+
}
193+
},
194+
inspectTimelineEvent(handler): any {
195+
if (api) {
196+
api.on.inspectTimelineEvent(handler);
197+
} else {
198+
//@ts-ignore
199+
EventQueue.push({ type: "inspectTimelineEvent", args: arguments });
200+
}
201+
},
170202
getInspectorTree(handler): any {
171203
if (api) {
172204
api.on.getInspectorTree(handler);
@@ -183,13 +215,21 @@ if (__VUE_2__) {
183215
EventQueue.push({ type: "getInspectorState", args: arguments });
184216
}
185217
},
186-
},
218+
editInspectorState(handler): any {
219+
if (api) {
220+
api.on.editInspectorState(handler);
221+
} else {
222+
//@ts-ignore
223+
EventQueue.push({ type: "editInspectorState", args: arguments });
224+
}
225+
}
226+
}
187227
};
188228

189229
return proxyApi;
190230
};
191231
} else {
192-
apiProxyFactory = (promiseApi) => {
232+
apiProxyFactory = promiseApi => {
193233
let api: DevtoolsPluginApi;
194234
const EventQueue: OnEvent[] = [];
195235
const ApiQueue: ApiEvent[] = [];
@@ -208,16 +248,16 @@ if (__VUE_2__) {
208248
return (target[prop] = (...args) => {
209249
EventQueue.push({
210250
type: prop,
211-
args,
251+
args
212252
});
213253
});
214254
}
215-
},
255+
}
216256
}
217257
);
218258
const proxy = new Proxy(
219259
{
220-
on: onProxy,
260+
on: onProxy
221261
},
222262
{
223263
get: (target, prop: keyof DevtoolsPluginApi) => {
@@ -237,14 +277,14 @@ if (__VUE_2__) {
237277
return (target[prop] = (...args) => {
238278
ApiQueue.push({
239279
type: prop,
240-
args,
280+
args
241281
});
242282
});
243-
},
283+
}
244284
}
245285
);
246286

247-
promiseApi.then((x) => {
287+
promiseApi.then(x => {
248288
api = x;
249289
pushEventsToApi(api, EventQueue, ApiQueue);
250290
});

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,10 +1628,10 @@
16281628
dependencies:
16291629
tslib "^2.0.1"
16301630

1631-
"@vue/devtools-api@^6.0.0-beta.2":
1632-
version "6.0.0-beta.2"
1633-
resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.0.0-beta.2.tgz#833ad3335f97ae9439e26247d97f9baf7b5a6116"
1634-
integrity sha512-5k0A8ffjNNukOiceImBdx1e3W5Jbpwqsu7xYHiZVu9mn4rYxFztIt+Q25mOHm7nwvDnMHrE7u5KtY2zmd+81GA==
1631+
"@vue/devtools-api@^6.0.0-beta.3":
1632+
version "6.0.0-beta.3"
1633+
resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.0.0-beta.3.tgz#5a66cc8beed688fe18c272ee7a8bd8ed7e35a54c"
1634+
integrity sha512-iJQhVyWzWIJxYIMjbZpljZQfU4gL2IMD5YQm3HXO8tQRU7RqqnD3f1WHn+vrqvrSvM8Qw2BeNugwdBBmbK8Oxg==
16351635

16361636
"@vue/reactivity@3.0.5", "@vue/reactivity@^3.0.5":
16371637
version "3.0.5"

0 commit comments

Comments
 (0)