Skip to content

Commit

Permalink
Merge pull request #1 from ryankeairns/canvas/help-menu
Browse files Browse the repository at this point in the history
Typography and copy changes
  • Loading branch information
cqliu1 authored Feb 20, 2019
2 parents 7f66557 + 7a4f07c commit f417d5c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
EuiHorizontalRule,
EuiCode,
EuiSpacer,
EuiTitle,
} from '@elastic/eui';
import { keymap } from '../../lib/keymap';
import { getClientPlatform } from '../../lib/get_client_platform';
Expand Down Expand Up @@ -54,19 +55,24 @@ const getDescriptionListItems = shortcuts =>
export const KeyboardShortcutsDoc = props => (
<EuiFlyout closeButtonAriaLabel="Closes keyboard shortcuts reference" size="s" {...props}>
<EuiFlyoutHeader hasBorder>
<h2>Keyboard Shortcuts</h2>
<EuiTitle size="s">
<h2>Keyboard Shortcuts</h2>
</EuiTitle>
</EuiFlyoutHeader>
<EuiFlyoutBody>
{Object.values(keymap).map(namespace => {
const { displayName, ...shortcuts } = namespace;
return (
<div key={getId('shortcuts')} className="canvasKeyboardShortcut">
<h3>{displayName}</h3>
<EuiTitle size="xs">
<h4>{displayName}</h4>
</EuiTitle>
<EuiHorizontalRule margin="s" />
<EuiDescriptionList
textStyle="reverse"
type="column"
listItems={getDescriptionListItems(shortcuts)}
compressed
/>
<EuiSpacer />
</div>
Expand Down
26 changes: 13 additions & 13 deletions x-pack/plugins/canvas/public/lib/keymap.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,46 +45,46 @@ const nextPageShortcut = { ...getAltShortcuts(']'), help: 'Go to next page' };
export const keymap = {
ELEMENT: {
displayName: 'Element controls',
COPY: { ...getCtrlShortcuts('c'), help: 'Copy elements' },
CLONE: { ...getCtrlShortcuts('d'), help: 'Clone elements' },
CUT: { ...getCtrlShortcuts('x'), help: 'Cut elements' },
COPY: { ...getCtrlShortcuts('c'), help: 'Copy' },
CLONE: { ...getCtrlShortcuts('d'), help: 'Clone' },
CUT: { ...getCtrlShortcuts('x'), help: 'Cut' },
PASTE: { ...getCtrlShortcuts('v'), help: 'Paste' },
DELETE: {
osx: ['backspace'],
windows: ['del', 'backspace'],
linux: ['del', 'backspace'],
other: ['del', 'backspace'],
help: 'Delete elements',
help: 'Delete',
},
BRING_FORWARD: {
...getCtrlShortcuts('up'),
help: 'Send element forward one layer',
},
SEND_BACKWARD: {
...getCtrlShortcuts('down'),
help: 'Send element back one layer',
help: 'Send forward',
},
BRING_TO_FRONT: {
...getCtrlShortcuts('shift+up'),
help: 'Send element to front',
help: 'Send to front',
},
SEND_BACKWARD: {
...getCtrlShortcuts('down'),
help: 'Send backward',
},
SEND_TO_BACK: {
...getCtrlShortcuts('shift+down'),
help: 'Send element to back',
help: 'Send to back',
},
GROUP: {
osx: ['g'],
windows: ['g'],
linux: ['g'],
other: ['g'],
help: 'Group elements',
help: 'Group',
},
UNGROUP: {
osx: ['u'],
windows: ['u'],
linux: ['u'],
other: ['u'],
help: 'Ungroup elements',
help: 'Ungroup',
},
},
EDITOR: {
Expand Down

0 comments on commit f417d5c

Please sign in to comment.