@tanstack/react-hotkeys-devtools 0.9.0 → 0.9.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.
@@ -1,10 +1,10 @@
1
- import { DevtoolsPanelProps } from "@tanstack/devtools-utils/react";
2
1
  import { JSX } from "react";
2
+ import { DevtoolsPanelProps } from "@tanstack/devtools-utils/react";
3
3
  declare namespace ReactHotkeysDevtools_d_exports {
4
4
  export { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp, HotkeysDevtoolsReactInit };
5
5
  }
6
- export interface HotkeysDevtoolsReactInit extends DevtoolsPanelProps {}
7
- type HotkeysDevtoolsPanelComponent = (props: HotkeysDevtoolsReactInit) => JSX.Element;
6
+ export interface HotkeysDevtoolsReactInit extends Partial<DevtoolsPanelProps> {}
7
+ type HotkeysDevtoolsPanelComponent = (props?: HotkeysDevtoolsReactInit) => JSX.Element;
8
8
  export declare const HotkeysDevtoolsPanel: HotkeysDevtoolsPanelComponent;
9
9
  export declare const HotkeysDevtoolsPanelNoOp: HotkeysDevtoolsPanelComponent;
10
10
  //#endregion
@@ -1,10 +1,18 @@
1
+ import { createElement } from "react";
1
2
  import { createReactPanel } from "@tanstack/devtools-utils/react";
2
3
  import { HotkeysDevtoolsCore } from "@tanstack/hotkeys-devtools";
3
4
 
4
5
  //#region src/ReactHotkeysDevtools.tsx
5
6
  const panels = createReactPanel(HotkeysDevtoolsCore);
6
- const HotkeysDevtoolsPanel = panels[0];
7
- const HotkeysDevtoolsPanelNoOp = panels[1];
7
+ function withDefaults(Panel) {
8
+ return (props = {}) => createElement(Panel, {
9
+ ...props,
10
+ theme: props.theme ?? "dark",
11
+ devtoolsOpen: props.devtoolsOpen ?? true
12
+ });
13
+ }
14
+ const HotkeysDevtoolsPanel = withDefaults(panels[0]);
15
+ const HotkeysDevtoolsPanelNoOp = withDefaults(panels[1]);
8
16
 
9
17
  //#endregion
10
18
  export { HotkeysDevtoolsPanel, HotkeysDevtoolsPanelNoOp };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-hotkeys-devtools",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "React devtools for TanStack Hotkeys",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@tanstack/devtools-utils": "^0.7.0",
47
- "@tanstack/hotkeys-devtools": "1.1.0"
47
+ "@tanstack/hotkeys-devtools": "1.1.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@eslint-react/eslint-plugin": "^4.2.3",