@tanstack/vue-hotkeys-devtools 0.11.0 → 0.11.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/VueHotkeysDevtools.d.ts +15 -11
- package/dist/VueHotkeysDevtools.js +54 -3
- package/dist/_virtual/_rolldown/runtime.js +18 -0
- package/dist/index.d.ts +5 -35
- package/dist/plugin.d.ts +12 -30
- package/dist/plugin.js +16 -3
- package/dist/production.d.ts +2 -2
- package/package.json +3 -4
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { DefineComponent } from "vue";
|
|
2
|
+
import { HotkeysDevtoolsPanelProps, HotkeysDevtoolsTheme } from "@tanstack/hotkeys-devtools";
|
|
3
|
+
declare namespace VueHotkeysDevtools_d_exports {
|
|
4
|
+
export { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp, HotkeysDevtoolsVueInit, HotkeysDevtoolsVuePanelProps };
|
|
5
|
+
}
|
|
6
|
+
export interface HotkeysDevtoolsVueInit extends Partial<HotkeysDevtoolsPanelProps> {}
|
|
7
|
+
type ThemeProp = HotkeysDevtoolsTheme | Partial<HotkeysDevtoolsPanelProps>;
|
|
8
|
+
/** Props of `HotkeysDevtoolsPanel`. */
|
|
9
|
+
export interface HotkeysDevtoolsVuePanelProps {
|
|
10
|
+
theme?: ThemeProp;
|
|
11
|
+
devtoolsOpen?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const HotkeysDevtoolsPanel: DefineComponent<HotkeysDevtoolsVuePanelProps>;
|
|
14
|
+
export declare const HotkeysDevtoolsPanelNoOp: DefineComponent<HotkeysDevtoolsVuePanelProps>;
|
|
11
15
|
//#endregion
|
|
12
|
-
export {
|
|
16
|
+
export { VueHotkeysDevtools_d_exports };
|
|
@@ -1,8 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent, h, onMounted, onUnmounted, ref, watch } from "vue";
|
|
2
2
|
import { HotkeysDevtoolsCore } from "@tanstack/hotkeys-devtools";
|
|
3
3
|
|
|
4
|
-
//#region src/VueHotkeysDevtools.
|
|
5
|
-
|
|
4
|
+
//#region src/VueHotkeysDevtools.ts
|
|
5
|
+
function resolveProps(props) {
|
|
6
|
+
const dock = typeof props.theme === "object" ? props.theme : void 0;
|
|
7
|
+
return {
|
|
8
|
+
theme: (dock ? dock.theme : props.theme) ?? "dark",
|
|
9
|
+
devtoolsOpen: dock?.devtoolsOpen ?? props.devtoolsOpen ?? true
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function createPanel(Core) {
|
|
13
|
+
return defineComponent({
|
|
14
|
+
name: "HotkeysDevtoolsPanel",
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
props: {
|
|
17
|
+
theme: {
|
|
18
|
+
type: [String, Object],
|
|
19
|
+
default: void 0
|
|
20
|
+
},
|
|
21
|
+
devtoolsOpen: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: void 0
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(props) {
|
|
27
|
+
if (!Core) return () => null;
|
|
28
|
+
const el = ref(null);
|
|
29
|
+
let devtools = null;
|
|
30
|
+
const mount = () => {
|
|
31
|
+
if (!el.value) return;
|
|
32
|
+
devtools = new Core();
|
|
33
|
+
devtools.mount(el.value, resolveProps(props));
|
|
34
|
+
};
|
|
35
|
+
const unmount = () => {
|
|
36
|
+
devtools?.unmount();
|
|
37
|
+
devtools = null;
|
|
38
|
+
};
|
|
39
|
+
onMounted(mount);
|
|
40
|
+
watch(() => {
|
|
41
|
+
const { theme, devtoolsOpen } = resolveProps(props);
|
|
42
|
+
return `${theme}:${devtoolsOpen}`;
|
|
43
|
+
}, () => {
|
|
44
|
+
unmount();
|
|
45
|
+
mount();
|
|
46
|
+
});
|
|
47
|
+
onUnmounted(unmount);
|
|
48
|
+
return () => h("div", {
|
|
49
|
+
ref: el,
|
|
50
|
+
style: { height: "100%" }
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const HotkeysDevtoolsPanel = createPanel(HotkeysDevtoolsCore);
|
|
56
|
+
const HotkeysDevtoolsPanelNoOp = createPanel(null);
|
|
6
57
|
|
|
7
58
|
//#endregion
|
|
8
59
|
export { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) {
|
|
6
|
+
__defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!no_symbols) {
|
|
12
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { __exportAll };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,7 @@
|
|
|
1
|
-
import { HotkeysDevtoolsVueInit } from "./VueHotkeysDevtools.js";
|
|
1
|
+
import { HotkeysDevtoolsPanel as HotkeysDevtoolsPanel$1, HotkeysDevtoolsVueInit, VueHotkeysDevtools_d_exports } from "./VueHotkeysDevtools.js";
|
|
2
|
+
import { HotkeysDevtoolsVuePlugin, hotkeysDevtoolsPlugin as hotkeysDevtoolsPlugin$1, plugin_d_exports } from "./plugin.js";
|
|
2
3
|
//#region src/index.d.ts
|
|
3
|
-
export declare const HotkeysDevtoolsPanel:
|
|
4
|
-
|
|
5
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const hotkeysDevtoolsPlugin: ((props: {
|
|
8
|
-
theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
|
|
9
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
10
|
-
}) => {
|
|
11
|
-
name: string;
|
|
12
|
-
component: import("vue").DefineComponent<{
|
|
13
|
-
theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
|
|
14
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
15
|
-
}, {}, unknown>;
|
|
16
|
-
props: {
|
|
17
|
-
theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
|
|
18
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
19
|
-
};
|
|
20
|
-
}) | ((props: {
|
|
21
|
-
theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
|
|
22
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
23
|
-
}) => {
|
|
24
|
-
name: string;
|
|
25
|
-
component: {
|
|
26
|
-
new (): {
|
|
27
|
-
$props: import("vue").VNodeProps;
|
|
28
|
-
};
|
|
29
|
-
__isFragment: true;
|
|
30
|
-
};
|
|
31
|
-
props: {
|
|
32
|
-
theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
|
|
33
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
34
|
-
};
|
|
35
|
-
});
|
|
4
|
+
export declare const HotkeysDevtoolsPanel: typeof HotkeysDevtoolsPanel$1;
|
|
5
|
+
export declare const hotkeysDevtoolsPlugin: typeof hotkeysDevtoolsPlugin$1;
|
|
36
6
|
//#endregion
|
|
37
|
-
export type { HotkeysDevtoolsVueInit };
|
|
7
|
+
export type { HotkeysDevtoolsVueInit, HotkeysDevtoolsVuePlugin };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,32 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { HotkeysDevtoolsPanel, HotkeysDevtoolsVueInit } from "./VueHotkeysDevtools.js";
|
|
2
|
+
declare namespace plugin_d_exports {
|
|
3
|
+
export { HotkeysDevtoolsVuePlugin, hotkeysDevtoolsNoOpPlugin, hotkeysDevtoolsPlugin };
|
|
4
|
+
}
|
|
5
|
+
/** A plugin for `TanStackDevtools` from `@tanstack/vue-devtools`. */
|
|
6
|
+
export interface HotkeysDevtoolsVuePlugin {
|
|
6
7
|
name: string;
|
|
7
|
-
component:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
|
|
13
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
14
|
-
};
|
|
15
|
-
}, hotkeysDevtoolsNoOpPlugin: (props: {
|
|
16
|
-
theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
|
|
17
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
18
|
-
}) => {
|
|
19
|
-
name: string;
|
|
20
|
-
component: {
|
|
21
|
-
new (): {
|
|
22
|
-
$props: import("vue").VNodeProps;
|
|
23
|
-
};
|
|
24
|
-
__isFragment: true;
|
|
25
|
-
};
|
|
26
|
-
props: {
|
|
27
|
-
theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
|
|
28
|
-
devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
8
|
+
component: typeof HotkeysDevtoolsPanel;
|
|
9
|
+
props?: HotkeysDevtoolsVueInit;
|
|
10
|
+
}
|
|
11
|
+
export declare function hotkeysDevtoolsPlugin(props?: HotkeysDevtoolsVueInit): HotkeysDevtoolsVuePlugin;
|
|
12
|
+
export declare function hotkeysDevtoolsNoOpPlugin(props?: HotkeysDevtoolsVueInit): HotkeysDevtoolsVuePlugin;
|
|
31
13
|
//#endregion
|
|
32
|
-
export {
|
|
14
|
+
export { plugin_d_exports };
|
package/dist/plugin.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { HotkeysDevtoolsPanel } from "./VueHotkeysDevtools.js";
|
|
2
|
-
import { createVuePlugin } from "@tanstack/devtools-utils/vue";
|
|
1
|
+
import { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp } from "./VueHotkeysDevtools.js";
|
|
3
2
|
|
|
4
3
|
//#region src/plugin.ts
|
|
5
|
-
const
|
|
4
|
+
const name = "TanStack Hotkeys";
|
|
5
|
+
function hotkeysDevtoolsPlugin(props) {
|
|
6
|
+
return {
|
|
7
|
+
name,
|
|
8
|
+
component: HotkeysDevtoolsPanel,
|
|
9
|
+
props
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function hotkeysDevtoolsNoOpPlugin(props) {
|
|
13
|
+
return {
|
|
14
|
+
name,
|
|
15
|
+
component: HotkeysDevtoolsPanelNoOp,
|
|
16
|
+
props
|
|
17
|
+
};
|
|
18
|
+
}
|
|
6
19
|
|
|
7
20
|
//#endregion
|
|
8
21
|
export { hotkeysDevtoolsNoOpPlugin, hotkeysDevtoolsPlugin };
|
package/dist/production.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { HotkeysDevtoolsPanel, HotkeysDevtoolsVueInit } from "./VueHotkeysDevtools.js";
|
|
2
|
-
import { hotkeysDevtoolsPlugin } from "./plugin.js";
|
|
3
|
-
export { HotkeysDevtoolsPanel, type HotkeysDevtoolsVueInit, hotkeysDevtoolsPlugin };
|
|
2
|
+
import { HotkeysDevtoolsVuePlugin, hotkeysDevtoolsPlugin } from "./plugin.js";
|
|
3
|
+
export { HotkeysDevtoolsPanel, type HotkeysDevtoolsVueInit, type HotkeysDevtoolsVuePlugin, hotkeysDevtoolsPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/vue-hotkeys-devtools",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Vue devtools for TanStack Hotkeys",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,11 +38,10 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"vue": ">=3.
|
|
41
|
+
"vue": ">=3.3.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@tanstack/devtools
|
|
45
|
-
"@tanstack/hotkeys-devtools": "1.5.0"
|
|
44
|
+
"@tanstack/hotkeys-devtools": "1.6.1"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
47
|
"@vitejs/plugin-vue": "^6.0.9",
|