UNPKG

plot-plan-designer

Version:

Design Editor Tools with React.js + ant.design + fabric.js

50 lines (49 loc) 3.17 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = __importDefault(require("react")); const i18next_1 = __importDefault(require("i18next")); const shortcuts = [ [ { key: ['esc'], description: i18next_1.default.t('shortcut.escape') }, { key: ['h'], description: i18next_1.default.t('shortcut.h') }, { key: ['q'], description: i18next_1.default.t('shortcut.q') }, { key: ['w'], description: i18next_1.default.t('shortcut.w') }, { key: ['o'], description: i18next_1.default.t('shortcut.o') }, { key: ['p'], description: i18next_1.default.t('shortcut.p') }, { key: ['+'], description: i18next_1.default.t('shortcut.plus') }, { key: ['-'], description: i18next_1.default.t('shortcut.minus') }, { key: ['↑'], description: i18next_1.default.t('shortcut.arrow-up') }, { key: ['↓'], description: i18next_1.default.t('shortcut.arrow-down') }, { key: ['←'], description: i18next_1.default.t('shortcut.arrow-left') }, { key: ['→'], description: i18next_1.default.t('shortcut.arrow-right') }, ], [ { key: ['delete | backspace'], description: i18next_1.default.t('shortcut.delete') }, { key: ['ctrl | cmd', 'a'], description: i18next_1.default.t('shortcut.ctrl-a') }, { key: ['ctrl | cmd', 'c'], description: i18next_1.default.t('shortcut.ctrl-c') }, { key: ['ctrl | cmd', 'v'], description: i18next_1.default.t('shortcut.ctrl-v') }, { key: ['ctrl | cmd', 'x'], description: i18next_1.default.t('shortcut.ctrl-x') }, { key: ['ctrl | cmd', 'z'], description: i18next_1.default.t('shortcut.ctrl-z') }, { key: ['ctrl | cmd', 'y'], description: i18next_1.default.t('shortcut.ctrl-y') }, { key: ['alt', 'mouse left'], description: i18next_1.default.t('shortcut.alt-mouse-left') }, { key: ['shift', 'mouse left'], description: i18next_1.default.t('shortcut.shfit-mouse-left') }, { key: ['mouse left'], description: i18next_1.default.t('shortcut.mouse-left') }, { key: ['mouse right'], description: i18next_1.default.t('shortcut.mouse-right') }, ], ]; const ShortcutHelp = () => { return (react_1.default.createElement("div", { className: "rde-shortcut-help" }, shortcuts.map((column, idx) => { return (react_1.default.createElement("ul", { className: "rde-shortcut-help-list", key: idx }, column.map((shortcut) => { return (react_1.default.createElement("li", { key: shortcut.key.toString(), className: "rde-shortcut-help-key" }, shortcut.key.map((key) => { return (react_1.default.createElement("kbd", { key: key, className: "rde-shortcut-help-key-unit" }, react_1.default.createElement("span", null, key))); }), react_1.default.createElement("span", { className: "rde-shortcut-help-key-def" }, shortcut.description))); }))); }))); }; exports.default = ShortcutHelp;