+/***/ }),
+
+/***/ "./src/help.ts":
+/*!*********************!*\
+ !*** ./src/help.ts ***!
+ \*********************/
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+
+"use strict";
+
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.showHelp = void 0;
+const keyboardjs_1 = __importDefault(__webpack_require__(/*! keyboardjs */ "./node_modules/keyboardjs/dist/keyboard.js"));
+const lodash_1 = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
+const keyboardCommands = {
+ 'h': 'Move the cursor to the Parent Element of the current node',
+ 'l': 'Move the cursor to the first Child Element of the current node',
+ 'j': 'Move the cursor to the next sibling of the current node',
+ 'k': 'Move the cursor to the previous sibling of the current node',
+ 'enter': 'Add a new node as a sibling to the current node',
+ 'tab': 'Add a new node as the child of the current node',
+ 'shift + j': 'Swap the current node with next sibling node',
+ 'shift + k': 'Swap the current node with the previous sibling node',
+ 'shift + h': 'Lift the current node to be a sibling of the parent node',
+ 'shift + l': 'Lower the current node to be a child of the previous sibling node',
+ 'shift + d': 'Delete the current node',
+ 'i': 'Enter "edit" mode, and place the cursor at the start of the editable content',
+ '$': 'Enter "edit" mode, and place the cursor at the end of the editable content',
+ 'escape': 'Exit the current mode and return to "navigation" mode',
+ '?': 'Display this help dialogue'
+};
+const modalHTML = `
+ <div class="modal">
+ <div class="modal-content">
+ <h1>Help</h1>
+ <table>
+ <thead>
+ <tr>
+ <th>Key</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ ${(0, lodash_1.map)(keyboardCommands, (text, key) => {
+ return `
+ <tr>
+ <td>
+ <kbd>${key}</kbd>
+ </td>
+ <td>
+ ${text}
+ </td>
+ </tr>
+ `;
+}).join("\n")}
+ </tbody>
+ </table>
+ </div>
+ </div>
+`;
+function showHelp() {
+ document.querySelector('body').innerHTML += modalHTML;
+ keyboardjs_1.default.setContext('help');
+}
+exports.showHelp = showHelp;
+keyboardjs_1.default.withContext('help', () => {
+ keyboardjs_1.default.bind('escape', e => {
+ document.querySelector('.modal').remove();
+ keyboardjs_1.default.setContext('navigation');
+ });
+});
+
+