@tanstack/vue-hotkeys-devtools 0.11.1 → 0.12.0

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.
@@ -1,12 +1,16 @@
1
- import { DevtoolsPanelProps } from "@tanstack/devtools-utils/vue";
2
- //#region src/VueHotkeysDevtools.d.ts
3
- export interface HotkeysDevtoolsVueInit extends DevtoolsPanelProps {}
4
- declare const HotkeysDevtoolsPanel: import("vue").DefineComponent<{
5
- theme?: DevtoolsPanelProps["theme"];
6
- devtoolsProps: DevtoolsPanelProps;
7
- }>, HotkeysDevtoolsPanelNoOp: import("vue").DefineComponent<{
8
- theme?: DevtoolsPanelProps["theme"];
9
- devtoolsProps: DevtoolsPanelProps;
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 { HotkeysDevtoolsPanel };
16
+ export { VueHotkeysDevtools_d_exports };
@@ -1,8 +1,59 @@
1
- import { createVuePanel } from "@tanstack/devtools-utils/vue";
1
+ import { defineComponent, h, onMounted, onUnmounted, ref, watch } from "vue";
2
2
  import { HotkeysDevtoolsCore } from "@tanstack/hotkeys-devtools";
3
3
 
4
- //#region src/VueHotkeysDevtools.tsx
5
- const [HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp] = createVuePanel(HotkeysDevtoolsCore);
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: import("vue").DefineComponent<{
4
- theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
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
- //#region src/plugin.d.ts
2
- declare const hotkeysDevtoolsPlugin: (props: {
3
- theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
4
- devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
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: import("vue").DefineComponent<{
8
- theme?: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps["theme"];
9
- devtoolsProps: import("@tanstack/devtools-utils/vue").DevtoolsPanelProps;
10
- }, {}, unknown>;
11
- props: {
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 { hotkeysDevtoolsPlugin };
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 [hotkeysDevtoolsPlugin, hotkeysDevtoolsNoOpPlugin] = createVuePlugin("TanStack Hotkeys", HotkeysDevtoolsPanel);
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 };
@@ -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.1",
3
+ "version": "0.12.0",
4
4
  "description": "Vue devtools for TanStack Hotkeys",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -38,11 +38,16 @@
38
38
  "dist"
39
39
  ],
40
40
  "peerDependencies": {
41
- "vue": ">=3.0.0"
41
+ "@tanstack/vue-devtools": ">=0.2.28",
42
+ "vue": ">=3.3.0"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@tanstack/vue-devtools": {
46
+ "optional": true
47
+ }
42
48
  },
43
49
  "dependencies": {
44
- "@tanstack/devtools-utils": "^0.7.0",
45
- "@tanstack/hotkeys-devtools": "1.6.0"
50
+ "@tanstack/hotkeys-devtools": "1.7.0"
46
51
  },
47
52
  "devDependencies": {
48
53
  "@vitejs/plugin-vue": "^6.0.9",