Skip to content

Commit 9599edf

Browse files
committed
Move keyboard shortcuts code to ra-core
1 parent 212100c commit 9599edf

File tree

8 files changed

+11
-7
lines changed

8 files changed

+11
-7
lines changed

packages/ra-core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"lodash": "^4.17.21",
6767
"query-string": "^7.1.3",
6868
"react-error-boundary": "^4.0.13",
69+
"react-hotkeys-hook": "^5.1.0",
6970
"react-is": "^18.2.0 || ^19.0.0"
7071
},
7172
"gitHead": "587df4c27bfcec4a756df4f95e5fc14728dfc0d7"
File renamed without changes.

packages/ra-ui-materialui/src/getKeyboardShortcutLabel.ts renamed to packages/ra-core/src/util/getKeyboardShortcutLabel.ts

File renamed without changes.

packages/ra-core/src/util/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ export * from './asyncDebounce';
2828
export * from './hooks';
2929
export * from './shallowEqual';
3030
export * from './useCheckForApplicationUpdate';
31+
export * from './getKeyboardShortcutLabel';
32+
export * from './KeyboardShortcut';

packages/ra-ui-materialui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
"query-string": "^7.1.3",
8080
"react-dropzone": "^14.2.3",
8181
"react-error-boundary": "^4.0.13",
82-
"react-hotkeys-hook": "^5.1.0",
8382
"react-transition-group": "^4.4.5"
8483
},
8584
"gitHead": "587df4c27bfcec4a756df4f95e5fc14728dfc0d7"

packages/ra-ui-materialui/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ export * from './list';
1212
export * from './preferences';
1313
export * from './AdminUI';
1414
export * from './AdminContext';
15-
export * from './KeyboardShortcut';
16-
export * from './getKeyboardShortcutLabel';

packages/ra-ui-materialui/src/layout/MenuItemLink.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ import {
2222
Theme,
2323
useForkRef,
2424
} from '@mui/material';
25-
import { useTranslate, useBasename, useEvent } from 'ra-core';
25+
import {
26+
getKeyboardShortcutLabel,
27+
KeyboardShortcut,
28+
useTranslate,
29+
useBasename,
30+
useEvent,
31+
} from 'ra-core';
2632
import type { Keys } from 'react-hotkeys-hook';
2733
import { useSidebarState } from './useSidebarState';
28-
import { KeyboardShortcut } from '../KeyboardShortcut';
29-
import { getKeyboardShortcutLabel } from '../getKeyboardShortcutLabel';
3034

3135
/**
3236
* Displays a menu item with a label and an icon - or only the icon with a tooltip when the sidebar is minimized.

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16050,6 +16050,7 @@ __metadata:
1605016050
react-dom: "npm:^18.3.1"
1605116051
react-error-boundary: "npm:^4.0.13"
1605216052
react-hook-form: "npm:^7.53.0"
16053+
react-hotkeys-hook: "npm:^5.1.0"
1605316054
react-is: "npm:^18.2.0 || ^19.0.0"
1605416055
react-router: "npm:^6.28.1"
1605516056
react-router-dom: "npm:^6.28.1"
@@ -16333,7 +16334,6 @@ __metadata:
1633316334
react-dropzone: "npm:^14.2.3"
1633416335
react-error-boundary: "npm:^4.0.13"
1633516336
react-hook-form: "npm:^7.53.0"
16336-
react-hotkeys-hook: "npm:^5.1.0"
1633716337
react-is: "npm:^18.2.0 || ^19.0.0"
1633816338
react-router: "npm:^6.28.1"
1633916339
react-router-dom: "npm:^6.28.1"

0 commit comments

Comments
 (0)