Merge commit '457fe16f9c31d08fbb6f3493f17105aac2638e86' into block-notes

This commit is contained in:
Oliver Walters
2026-06-13 10:01:38 +00:00
28 changed files with 1114 additions and 910 deletions
+13 -9
View File
@@ -17,18 +17,22 @@ export type InvenTreeHotkeyItem = [
HotkeyItemOptions?
];
export function useInvenTreeHotkeys(hotkeys: InvenTreeHotkeyItem[]) {
// Register the hotkeys using the Mantine hook
useHotkeys(
hotkeys.map(([key, _, handler, options]) => [key, handler, options])
);
// register to helper state to store hotkeys
// This allows us to display the hotkeys in the UI
const keyelems: [string, string][] = hotkeys.map(([key, description]) => [
export function useInvenTreeHotkeys(_keys: InvenTreeHotkeyItem[]) {
const keyelems: [string, string][] = _keys.map(([key, description]) => [
key,
description
]);
const mappedHotkeys: [
string,
(event: KeyboardEvent) => void,
HotkeyItemOptions?
][] = _keys.map(([key, _, handler, options]) => [key, handler, options]);
// Register the hotkeys using the Mantine hook
useHotkeys(mappedHotkeys);
// register to helper state to store hotkeys
// This allows us to display the hotkeys in the UI
useEffect(() => {
useLocalLibState.getState().addHotkeys(keyelems);
return () =>
+1
View File
@@ -17,6 +17,7 @@ export type PanelType = {
disabled?: boolean;
showHeadline?: boolean;
supportsDirty?: boolean;
hotkey?: string;
};
/**