Skip to content

Commit

Permalink
Rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus-87 committed Apr 17, 2023
1 parent 0fc7bc2 commit cfc31eb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# mirador-keyboardnavigation
# mirador-keyboardshortcuts

[![npm package][npm-badge]][npm]
[![required Mirador version][mirador-badge]][mirador]
Expand All @@ -17,28 +17,28 @@ A Mirador 3 plugin which adds keyboard shortcuts for the following events:

Currently the plugin can only be used if you build your own Mirador JavaScript bundle.
To include the plugin in your Mirador installation, you need to install it
from npm with `npm install mirador-keyboardnavigation`, import it into your project
from npm with `npm install mirador-keyboardshortcuts`, import it into your project
and pass it to Mirador when you instantiate the viewer:

```javascript
import Mirador from 'mirador/dist/es/src/index';
import keyboardNavigationPlugin from 'mirador-keyboardnavigation/es';
import keyboardShortcutsPlugin from 'mirador-keyboardshortcuts/es';

const miradorConfig = {
// Your Mirador configuration
}
Mirador.viewer(config, [...keyboardNavigationPlugin]);
Mirador.viewer(config, [...keyboardShortcutsPlugin]);
```

## Configuration

You can configure the plugin globally by adding the `keyboardNavigation` entry to
You can configure the plugin globally by adding the `keyboardShortcuts` entry to
the top-level configuration:

```javascript
const miradorConfig = {
// ...
keyboardNavigation: {
keyboardShortcuts: {
// Global config, see available settings below
shortcutMapping: {
"navigate-to-first-canvas": "home",
Expand Down Expand Up @@ -73,10 +73,10 @@ starting the work, so we can discuss if it's a fit.

**Note**: The package requires Node.js `16` and npm in major version `8`.

[demo-cfg]: https://github.com/dbmdz/mirador-keyboardnavigation/blob/main/demo/src/index.js#L5-L40
[event-types]: https://github.com/dbmdz/mirador-keyboardnavigation/blob/main/src/state/events.js#L5-L9
[demo-cfg]: https://github.com/dbmdz/mirador-keyboardshortcuts/blob/main/demo/src/index.js#L5-L40
[event-types]: https://github.com/dbmdz/mirador-keyboardshortcuts/blob/main/src/state/events.js#L5-L9
[hotkeys-js]: https://wangchujiang.com/hotkeys/#defining-shortcuts
[mirador]: https://github.com/ProjectMirador/mirador/releases/tag/v3.3.0
[mirador-badge]: https://img.shields.io/badge/Mirador-%E2%89%A53.3.0-blueviolet
[npm]: https://www.npmjs.org/package/mirador-keyboardnavigation
[npm-badge]: https://img.shields.io/npm/v/mirador-keyboardnavigation.png?style=flat-square
[npm]: https://www.npmjs.org/package/mirador-keyboardshortcuts
[npm-badge]: https://img.shields.io/npm/v/mirador-keyboardshortcuts.png?style=flat-square
6 changes: 3 additions & 3 deletions demo/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Mirador from "mirador/dist/es/src/index";

import keyboardNavigationPlugin from "../../src";
import keyboardShortcutsPlugin from "../../src";

const config = {
catalog: [
Expand Down Expand Up @@ -32,11 +32,11 @@ const config = {
view: "single",
},
],
keyboardNavigation: {
keyboardShortcuts: {
shortcutMapping: {
"toggle-fullscreen": "f",
},
},
};

Mirador.viewer(config, [...keyboardNavigationPlugin]);
Mirador.viewer(config, [...keyboardShortcutsPlugin]);
2 changes: 1 addition & 1 deletion nwb.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
npm: {
esModules: true,
umd: {
global: 'MiradorKeyboardNavigation',
global: 'MiradorKeyboardShortcuts',
externals: {
react: 'React'
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mirador-keyboardnavigation",
"name": "mirador-keyboardshortcuts",
"version": "0.1.0",
"description": "Mirador 3 plugin to add keyboard shortcuts",
"keywords": [
Expand All @@ -10,7 +10,7 @@
"react-component"
],
"homepage": "",
"repository": "https://github.com/dbmdz/mirador-keyboardnavigation",
"repository": "https://github.com/dbmdz/mirador-keyboardshortcuts",
"license": "MIT",
"author": "Matthias Lindinger <[email protected]>",
"main": "lib/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { KeyboardEventTypes } from "./state/events";
import keyboardNavigationSaga from "./state/sagas";
import keyboardShortcutsSaga from "./state/sagas";

export default [
{
saga: keyboardNavigationSaga,
saga: keyboardShortcutsSaga,
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/state/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getFocusedWindowId = createSelector(
/** Selector to get the plugin config for a given window */
const getPluginConfig = createSelector(
[getConfig],
({ keyboardNavigation = {} }) => keyboardNavigation
({ keyboardShortcuts = {} }) => keyboardShortcuts
);

export { getFocusedWindowId, getPluginConfig };

0 comments on commit cfc31eb

Please sign in to comment.