diff --git a/README.md b/README.md index 8c1a7e8..a64df7b 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ Properties you can pass to the console element | ---- | ---- | ---- | log | (...messages: any)=>void | Log messages to the console. If string, print the value, otherwise, print the JSON value of the message. | logX | (type: string, ...messages: any)=>void | Log messages of a particular type to the console. The messages will be given the class `react-console-message-{type}`. +| logTable | (tableObject: Object)=>void | Log tabular data to the console. `tableObject` has the format `{ headers: ['header 1', 'header 2'], rows: [['row 1, col 1', 'row 1, col 2'], ['row 2, col 1', 'row 2, col 2']]}`. `headers` is optional. | return | ()=>void | Signal the current command has finished and a new prompt should be displayed. | clearScreen | ()=>void | Clear the visible log in the console. Does not clear command history. diff --git a/dist/dist-min.tar.gz b/dist/dist-min.tar.gz index 1faf5e9..46b3c50 100644 Binary files a/dist/dist-min.tar.gz and b/dist/dist-min.tar.gz differ diff --git a/dist/dist-min.zip b/dist/dist-min.zip index eeb6e40..19311d2 100644 Binary files a/dist/dist-min.zip and b/dist/dist-min.zip differ diff --git a/dist/dist-min/react-console.min.js b/dist/dist-min/react-console.min.js index 627cd64..031ccf6 100644 --- a/dist/dist-min/react-console.min.js +++ b/dist/dist-min/react-console.min.js @@ -1,2 +1,2 @@ -var Console=function(t){function e(r){if(o[r])return o[r].exports;var s=o[r]={exports:{},id:r,loaded:!1};return t[r].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){"use strict";var r=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},s=o(2);o(1);var n=function(t){function e(){t.apply(this,arguments),this.child={},this.updateSemaphore=0}return r(e,t),e.prototype.componentDidMount=function(){this.idle()},e.prototype.componentDidUpdate=function(){this.idle()},e.prototype.idle=function(){var t=this;this.child.cursor&&(0==this.updateSemaphore&&(this.child.cursor.className="react-console-cursor"),this.updateSemaphore++,window.setTimeout(function(){t.updateSemaphore--,0==t.updateSemaphore&&t.child.cursor&&(t.child.cursor.className="react-console-cursor react-console-cursor-idle")},1e3))},e.prototype.renderValue=function(){var t=this;return this.props.point<0?[this.props.value]:this.props.point==this.props.value.length?[this.props.value,s.createElement("span",{ref:function(e){return t.child.cursor=e},key:"cursor",className:"react-console-cursor"}," ")]:[this.props.value.substring(0,this.props.point),s.createElement("span",{ref:function(e){return t.child.cursor=e},key:"cursor",className:"react-console-cursor"},this.props.value.substring(this.props.point,this.props.point+1)),this.props.value.substring(this.props.point+1)]},e.prototype.render=function(){var t=this.props.label;if(this.props.argument){var e=t.lastIndexOf("\n");t=e>=0?t.substring(0,e+1):""}return s.createElement("div",{className:"react-console-prompt-box"},s.createElement("span",{className:"react-console-prompt-label"},t),s.createElement("span",{className:"react-console-prompt-argument"},this.props.argument),s.createElement("span",{className:"react-console-prompt"},this.renderValue()))},e.defaultProps={point:-1,value:"",label:"> ",argument:null},e}(s.Component),a=function(t){return s.createElement("div",{className:"react-console-message"+(t.type?" react-console-message-"+t.type:"")},t.value.map(function(t){return"string"==typeof t?t:JSON.stringify(t)}).join("\n"))};a.defaultProps={type:null,value:[]};var i=function(t){function e(e){var o=this;t.call(this,e),this.child={},this.log=function(){for(var t=[],e=0;e0&&o.setState({point:o.movePoint(-1),promptText:o.state.promptText.substring(0,o.state.point-1)+o.state.promptText.substring(o.state.point),argument:null,lastCommand:0},o.scrollToBottom)},this.killLine=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=t[0]+o.state.promptText.substring(o.state.point):t.unshift(o.state.promptText.substring(o.state.point)),o.setState({promptText:o.state.promptText.substring(0,o.state.point),kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.backwardKillLine=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=o.state.promptText.substring(0,o.state.point)+t[0]:t.unshift(o.state.promptText.substring(0,o.state.point)),o.setState({point:0,promptText:o.state.promptText.substring(o.state.point),kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.killWholeLine=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=o.state.promptText.substring(0,o.state.point)+t[0]+o.state.promptText.substring(o.state.point):t.unshift(o.state.promptText),o.setState({point:0,promptText:"",kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.killWord=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=t[0]+o.state.promptText.substring(o.state.point,o.nextWord()):t.unshift(o.state.promptText.substring(o.state.point,o.nextWord())),o.setState({promptText:o.state.promptText.substring(0,o.state.point)+o.state.promptText.substring(o.nextWord()),kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.backwardKillWord=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=o.state.promptText.substring(o.previousWord(),o.state.point)+t[0]:t.unshift(o.state.promptText.substring(o.previousWord(),o.state.point)),o.setState({point:o.previousWord(),promptText:o.state.promptText.substring(0,o.previousWord())+o.state.promptText.substring(o.state.point),kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.yank=function(){o.setState(Object.assign(o.consoleInsert(o.state.kill[o.state.killn]),{lastCommand:3}),o.scrollToBottom)},this.yankPop=function(){if(3==o.state.lastCommand){var t=o.rotateRing(1,o.state.killn,o.state.kill.length);o.setState(Object.assign(o.consoleInsert(o.state.kill[t],o.state.kill[o.state.killn].length),{killn:t,lastCommand:3}),o.scrollToBottom)}},this.complete=function(){if(o.props.complete){for(var t=o.state.promptText.split(" "),e=0,r=t[0].length;r1){var i=o.state.log;i.push({label:o.state.currLabel,command:o.state.promptText,message:[{type:"completion",value:[s.join("\t")]}]}),o.setState({currLabel:o.nextLabel(),log:i,argument:null,lastCommand:0},o.scrollToBottom)}}},this.prefixMeta=function(){1==o.state.lastCommand&&o.setState({argument:null,lastCommand:0})},this.cancelCommand=function(){if(o.state.acceptInput){o.child.typer.value="";var t=o.state.log;t.push({label:o.state.currLabel,command:o.state.promptText,message:[]}),o.setState({typer:"",point:0,promptText:"",restoreText:"",log:t,historyn:0,argument:null,lastCommand:0},o.scrollToBottom)}else o.props.cancel()},this.textInsert=function(t,e,o,r){return void 0===o&&(o=0),void 0===r&&(r=e.length),e.substring(0,r-o)+t+e.substring(r)},this.consoleInsert=function(t,e){void 0===e&&(e=0);var r=o.textInsert(t,o.state.promptText,e,o.state.point);return{point:o.movePoint(t.length-e,t.length-e+o.state.promptText.length),promptText:r,restoreText:r,argument:null,lastCommand:0}},this.movePoint=function(t,e){void 0===e&&(e=o.state.promptText.length);var r=o.state.point+t;return r<0?0:r>e?e:r},this.rotateRing=function(t,e,o,r){return void 0===r&&(r=!0),0==o?0:r?(o+(e+t)%o)%o:(e-=t,e<0?0:e>=o?o:e)},this.rotateHistory=function(t){var e=o.rotateRing(t,o.state.historyn,o.state.history.length,!1);if(0==e)o.setState({point:o.state.restoreText.length,promptText:o.state.restoreText,historyn:e,argument:null,lastCommand:0},o.scrollToBottom);else{var r=o.state.history[o.state.history.length-e];o.setState({point:r.length,promptText:r,historyn:e,argument:null,lastCommand:0},o.scrollToBottom)}},this.searchHistory=function(t,e){void 0===t&&(t=o.state.searchDirection),void 0===e&&(e=!1);var r=o.state.historyn,s=0==t?1:-1;for(e&&(r+=s);r>0&&r<=o.state.history.length;r+=s){var n=o.state.history[o.state.history.length-r],a=n.indexOf(o.state.searchText);if(a>-1)return{point:a,promptText:n,searchDirection:t,searchInit:!1,historyn:r}}return{searchDirection:t,searchInit:!1}},this.scrollSemaphore=0,this.scrollIfBottom=function(){return o.scrollSemaphore>0||o.child.container.scrollTop==o.child.container.scrollHeight-o.child.container.offsetHeight?(o.scrollSemaphore++,o.scrollIfBottomTrue):null},this.scrollIfBottomTrue=function(){o.scrollToBottom(),o.scrollSemaphore--},this.scrollToBottom=function(){o.child.container.scrollTop=o.child.container.scrollHeight;var t=o.child.focus.getBoundingClientRect();(t.top<0||t.left<0||t.bottom>(window.innerHeight||document.documentElement.clientHeight)||t.right>(window.innerWidth||document.documentElement.clientWidth))&&o.child.typer.scrollIntoView(!1)},this.nextLabel=function(){return"string"==typeof o.props.promptLabel?o.props.promptLabel:o.props.promptLabel()},this.state={focus:!1,acceptInput:!0,typer:"",point:0,currLabel:this.nextLabel(),promptText:"",restoreText:"",searchText:"",searchDirection:null,searchInit:!1,log:[],history:[],historyn:0,kill:[],killn:0,argument:null,lastCommand:0}}return r(e,t),e.prototype.componentDidMount=function(){this.props.autofocus&&this.focus()},e.prototype.nextWord=function(){var t=/\W\w/.exec(this.state.promptText.substring(this.state.point));return t?t.index+this.state.point+1:this.state.promptText.length},e.prototype.previousWord=function(){var t=/\W\w(?!.*\W\w)/.exec(this.state.promptText.substring(0,this.state.point-1));return t?t.index+1:0},e.prototype.render=function(){var t=this;return s.createElement("div",{ref:function(e){return t.child.container=e},className:"react-console-container "+(this.state.focus?"react-console-focus":"react-console-nofocus"),onClick:this.focus},this.props.welcomeMessage?s.createElement("div",{className:"react-console-message react-console-welcome"},this.props.welcomeMessage):null,this.state.log.map(function(t){return[s.createElement(n,{label:t.label,value:t.command})].concat(t.message.map(function(t,e){return s.createElement(a,{key:e,type:t.type,value:t.value})}))}),this.state.acceptInput?s.createElement(n,{label:this.state.currLabel,value:this.state.promptText,point:this.state.point,argument:this.state.argument}):null,s.createElement("div",{style:{overflow:"hidden",height:1,width:1}},s.createElement("textarea",{ref:function(e){return t.child.typer=e},className:"react-console-typer",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",style:{outline:"none",color:"transparent",backgroundColor:"transparent",border:"none",resize:"none",overflow:"hidden"},onBlur:this.blur,onKeyDown:this.keyDown,onChange:this.change,onPaste:this.paste})),s.createElement("div",{ref:function(e){return t.child.focus=e}}," "))},e.defaultProps={promptLabel:"> ",continue:function(){return!1},cancel:function(){}},e}(s.Component);Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e){},function(t,e){t.exports=React}]); +var Console=function(t){function e(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return t[r].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){"use strict";var r=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},n=o(2);o(1);var s=function(t){function e(){t.apply(this,arguments),this.child={},this.updateSemaphore=0}return r(e,t),e.prototype.componentDidMount=function(){this.idle()},e.prototype.componentDidUpdate=function(){this.idle()},e.prototype.idle=function(){var t=this;this.child.cursor&&(0==this.updateSemaphore&&(this.child.cursor.className="react-console-cursor"),this.updateSemaphore++,window.setTimeout(function(){t.updateSemaphore--,0==t.updateSemaphore&&t.child.cursor&&(t.child.cursor.className="react-console-cursor react-console-cursor-idle")},1e3))},e.prototype.renderValue=function(){var t=this;return this.props.point<0?[this.props.value]:this.props.point==this.props.value.length?[this.props.value,n.createElement("span",{ref:function(e){return t.child.cursor=e},key:"cursor",className:"react-console-cursor"}," ")]:[this.props.value.substring(0,this.props.point),n.createElement("span",{ref:function(e){return t.child.cursor=e},key:"cursor",className:"react-console-cursor"},this.props.value.substring(this.props.point,this.props.point+1)),this.props.value.substring(this.props.point+1)]},e.prototype.render=function(){var t=this.props.label;if(this.props.argument){var e=t.lastIndexOf("\n");t=e>=0?t.substring(0,e+1):""}return n.createElement("div",{className:"react-console-prompt-box"},n.createElement("span",{className:"react-console-prompt-label"},t),n.createElement("span",{className:"react-console-prompt-argument"},this.props.argument),n.createElement("span",{className:"react-console-prompt"},this.renderValue()))},e.defaultProps={point:-1,value:"",label:"> ",argument:null},e}(n.Component),a=function(t){return t.headers?n.createElement("thead",null,n.createElement("tr",null,t.headers.map(function(t){return n.createElement("th",{scope:"col",key:t},t)}))):null},i=function(t){if(t.isTable){var e=t.value[0];return n.createElement("div",{className:"react-console-message react-console-table"},n.createElement("table",null,n.createElement(a,{headers:e.headers}),n.createElement("tbody",null,e.rows&&e.rows.map(function(t,e){return n.createElement("tr",{key:e},t.map(function(t,e){return n.createElement("td",{key:e},t)}))}))))}return n.createElement("div",{className:"react-console-message"+(t.type?" react-console-message-"+t.type:"")},t.value.map(function(t){return"string"==typeof t?t:JSON.stringify(t)}).join("\n"))};i.defaultProps={type:null,value:[],isTable:!1};var l=function(t){function e(e){var o=this;t.call(this,e),this.child={},this.log=function(){for(var t=[],e=0;e0&&o.setState({point:o.movePoint(-1),promptText:o.state.promptText.substring(0,o.state.point-1)+o.state.promptText.substring(o.state.point),argument:null,lastCommand:0},o.scrollToBottom)},this.killLine=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=t[0]+o.state.promptText.substring(o.state.point):t.unshift(o.state.promptText.substring(o.state.point)),o.setState({promptText:o.state.promptText.substring(0,o.state.point),kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.backwardKillLine=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=o.state.promptText.substring(0,o.state.point)+t[0]:t.unshift(o.state.promptText.substring(0,o.state.point)),o.setState({point:0,promptText:o.state.promptText.substring(o.state.point),kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.killWholeLine=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=o.state.promptText.substring(0,o.state.point)+t[0]+o.state.promptText.substring(o.state.point):t.unshift(o.state.promptText),o.setState({point:0,promptText:"",kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.killWord=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=t[0]+o.state.promptText.substring(o.state.point,o.nextWord()):t.unshift(o.state.promptText.substring(o.state.point,o.nextWord())),o.setState({promptText:o.state.promptText.substring(0,o.state.point)+o.state.promptText.substring(o.nextWord()),kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.backwardKillWord=function(){var t=o.state.kill;2==o.state.lastCommand?t[0]=o.state.promptText.substring(o.previousWord(),o.state.point)+t[0]:t.unshift(o.state.promptText.substring(o.previousWord(),o.state.point)),o.setState({point:o.previousWord(),promptText:o.state.promptText.substring(0,o.previousWord())+o.state.promptText.substring(o.state.point),kill:t,killn:0,argument:null,lastCommand:2},o.scrollToBottom)},this.yank=function(){o.setState(Object.assign(o.consoleInsert(o.state.kill[o.state.killn]),{lastCommand:3}),o.scrollToBottom)},this.yankPop=function(){if(3==o.state.lastCommand){var t=o.rotateRing(1,o.state.killn,o.state.kill.length);o.setState(Object.assign(o.consoleInsert(o.state.kill[t],o.state.kill[o.state.killn].length),{killn:t,lastCommand:3}),o.scrollToBottom)}},this.complete=function(){if(o.props.complete){for(var t=o.state.promptText.split(" "),e=0,r=t[0].length;r1){var i=o.state.log;i.push({label:o.state.currLabel,command:o.state.promptText,message:[{type:"completion",value:[n.join("\t")]}]}),o.setState({currLabel:o.nextLabel(),log:i,argument:null,lastCommand:0},o.scrollToBottom)}}},this.prefixMeta=function(){1==o.state.lastCommand&&o.setState({argument:null,lastCommand:0})},this.cancelCommand=function(){if(o.state.acceptInput){o.child.typer.value="";var t=o.state.log;t.push({label:o.state.currLabel,command:o.state.promptText,message:[]}),o.setState({typer:"",point:0,promptText:"",restoreText:"",log:t,historyn:0,argument:null,lastCommand:0},o.scrollToBottom)}else o.props.cancel()},this.textInsert=function(t,e,o,r){return void 0===o&&(o=0),void 0===r&&(r=e.length),e.substring(0,r-o)+t+e.substring(r)},this.consoleInsert=function(t,e){void 0===e&&(e=0);var r=o.textInsert(t,o.state.promptText,e,o.state.point);return{point:o.movePoint(t.length-e,t.length-e+o.state.promptText.length),promptText:r,restoreText:r,argument:null,lastCommand:0}},this.movePoint=function(t,e){void 0===e&&(e=o.state.promptText.length);var r=o.state.point+t;return r<0?0:r>e?e:r},this.rotateRing=function(t,e,o,r){return void 0===r&&(r=!0),0==o?0:r?(o+(e+t)%o)%o:(e-=t,e<0?0:e>=o?o:e)},this.rotateHistory=function(t){var e=o.rotateRing(t,o.state.historyn,o.state.history.length,!1);if(0==e)o.setState({point:o.state.restoreText.length,promptText:o.state.restoreText,historyn:e,argument:null,lastCommand:0},o.scrollToBottom);else{var r=o.state.history[o.state.history.length-e];o.setState({point:r.length,promptText:r,historyn:e,argument:null,lastCommand:0},o.scrollToBottom)}},this.searchHistory=function(t,e){void 0===t&&(t=o.state.searchDirection),void 0===e&&(e=!1);var r=o.state.historyn,n=0==t?1:-1;for(e&&(r+=n);r>0&&r<=o.state.history.length;r+=n){var s=o.state.history[o.state.history.length-r],a=s.indexOf(o.state.searchText);if(a>-1)return{point:a,promptText:s,searchDirection:t,searchInit:!1,historyn:r}}return{searchDirection:t,searchInit:!1}},this.scrollSemaphore=0,this.scrollIfBottom=function(){return o.scrollSemaphore>0||o.child.container.scrollTop==o.child.container.scrollHeight-o.child.container.offsetHeight?(o.scrollSemaphore++,o.scrollIfBottomTrue):null},this.scrollIfBottomTrue=function(){o.scrollToBottom(),o.scrollSemaphore--},this.scrollToBottom=function(){o.child.container.scrollTop=o.child.container.scrollHeight;var t=o.child.focus.getBoundingClientRect();(t.top<0||t.left<0||t.bottom>(window.innerHeight||document.documentElement.clientHeight)||t.right>(window.innerWidth||document.documentElement.clientWidth))&&o.child.typer.scrollIntoView(!1)},this.nextLabel=function(){return"string"==typeof o.props.promptLabel?o.props.promptLabel:o.props.promptLabel()},this.state={focus:!1,acceptInput:!0,typer:"",point:0,currLabel:this.nextLabel(),promptText:"",restoreText:"",searchText:"",searchDirection:null,searchInit:!1,log:[],history:[],historyn:0,kill:[],killn:0,argument:null,lastCommand:0}}return r(e,t),e.prototype.componentDidMount=function(){this.props.autofocus&&this.focus()},e.prototype.nextWord=function(){var t=/\W\w/.exec(this.state.promptText.substring(this.state.point));return t?t.index+this.state.point+1:this.state.promptText.length},e.prototype.previousWord=function(){var t=/\W\w(?!.*\W\w)/.exec(this.state.promptText.substring(0,this.state.point-1));return t?t.index+1:0},e.prototype.render=function(){var t=this;return n.createElement("div",{ref:function(e){return t.child.container=e},className:"react-console-container "+(this.state.focus?"react-console-focus":"react-console-nofocus"),onClick:this.focus},this.props.welcomeMessage?n.createElement("div",{className:"react-console-message react-console-welcome"},this.props.welcomeMessage):null,this.state.log.map(function(t){return[n.createElement(s,{label:t.label,value:t.command})].concat(t.message.map(function(t,e){return n.createElement(i,{key:e,type:t.type,value:t.value,isTable:t.isTable})}))}),this.state.acceptInput?n.createElement(s,{label:this.state.currLabel,value:this.state.promptText,point:this.state.point,argument:this.state.argument}):null,n.createElement("div",{style:{overflow:"hidden",height:1,width:1}},n.createElement("textarea",{ref:function(e){return t.child.typer=e},className:"react-console-typer",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",style:{outline:"none",color:"transparent",backgroundColor:"transparent",border:"none",resize:"none",overflow:"hidden"},onBlur:this.blur,onKeyDown:this.keyDown,onChange:this.change,onPaste:this.paste})),n.createElement("div",{ref:function(e){return t.child.focus=e}}," "))},e.defaultProps={promptLabel:"> ",continue:function(){return!1},cancel:function(){}},e}(n.Component);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e){},function(t,e){t.exports=React}]); //# sourceMappingURL=react-console.min.js.map \ No newline at end of file diff --git a/dist/dist-min/react-console.min.js.map b/dist/dist-min/react-console.min.js.map index 200497a..d50cc8d 100644 --- a/dist/dist-min/react-console.min.js.map +++ b/dist/dist-min/react-console.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///react-console.min.js","webpack:///webpack/bootstrap f59adf676ff7a2cc770a","webpack:///./react-console.tsx","webpack:///external \"React\""],"names":["Console","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","__extends","this","d","b","__","constructor","hasOwnProperty","prototype","Object","create","React","ConsolePrompt","_super","apply","arguments","child","updateSemaphore","componentDidMount","idle","componentDidUpdate","_this","cursor","className","window","setTimeout","renderValue","props","point","value","length","createElement","ref","key","substring","render","label","argument","idx","lastIndexOf","defaultProps","Component","ConsoleMessage","type","map","val","JSON","stringify","join","default_1","log","messages","_i","state","message","push","setState","scrollIfBottom","logX","return","acceptInput","currLabel","nextLabel","focus","getSelection","toString","typer","scrollToBottom","blur","keyDown","e","keyCodes","13","acceptLine","37","backwardChar","39","forwardChar","38","previousHistory","40","nextHistory","8","backwardDeleteChar","46","deleteChar","35","endOfLine","36","beginningOfLine","9","complete","27","prefixMeta","ctrlCodes","65","69","70","66","76","clearScreen","80","78","82","reverseSearchHistory","83","forwardSearchHistory","68","75","killLine","85","backwardKillLine","89","yank","67","cancelCommand","metaCodes","forwardWord","backwardWord","nonIncrementalReverseSearchHistory","nonIncrementalForwardSearchHistory","190","yankLastArg","killWord","backwardKillWord","yankPop","metaShiftCodes","188","beginningOfHistory","endOfHistory","189","metaCtrlCodes","yankNthArg","altKey","ctrlKey","keyCode","preventDefault","shiftKey","change","insert","replace","lastCommand","searchText","searchInit","textInsert","triggerSearch","assign","consoleInsert","paste","clipboardData","getData","promptText","movePoint","nextWord","previousWord","continue","command_1","history_1","history","command","restoreText","historyn","handler","rotateHistory","searchDirection","searchHistory","historySearchBackward","historySearchForward","historySubstringSearchBackward","historySubstringSearchForward","kill","unshift","killn","killWholeLine","rotateRing","words","split","curr","completions","i","cancel","text","n","max","pos","ringn","ring","circular","direction","next","inc","entry","indexOf","scrollSemaphore","container","scrollTop","scrollHeight","offsetHeight","scrollIfBottomTrue","rect","getBoundingClientRect","top","left","bottom","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","scrollIntoView","promptLabel","autofocus","search","exec","index","onClick","welcomeMessage","concat","style","overflow","height","width","autoComplete","autoCorrect","autoCapitalize","spellCheck","outline","color","backgroundColor","border","resize","onBlur","onKeyDown","onChange","onPaste","defineProperty","default"],"mappings":"AAAA,GAAIA,SACK,SAAUC,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,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AACnB,GACAwB,MAAOlC,KAAKmD,MAAMQ,UAClBhC,MAAO3B,KAAKmD,MAAMkG,WAClB3H,MAAO1B,KAAKmD,MAAMzB,MAClBS,SAAUnC,KAAKmD,MAAMhB,WAEpB,KAEH1B,EAAAoB,cAAA,OAAK6L,OAASC,SAAU,SAAUC,OAAQ,EAAGC,MAAO,IACnDpN,EAAAoB,cAAA,YACCC,IAAK,SAAAA,GAAO,MAAAX,GAAKL,MAAMkD,MAAQlC,GAC/BT,UAAU,sBACVyM,aAAa,MACbC,YAAY,MACZC,eAAe,MACfC,WAAW,QACXP,OAASQ,QAAS,OACjBC,MAAO,cACPC,gBAAiB,cACjBC,OAAQ,OACRC,OAAQ,OACRX,SAAU,UAEXY,OAAQvO,KAAKkE,KACbsK,UAAWxO,KAAKmE,QAChBsK,SAAUzO,KAAKwI,OACfkG,QAAS1O,KAAKkJ,SAGhBzI,EAAAoB,cAAA,OAAKC,IAAK,SAAAA,GAAO,MAAAX,GAAKL,MAAM+C,MAAQ/B,IAAI,OAt0BnCiB,EAAAT,cACN4K,YAAa,KACbzD,SAAU,WAAa,OAAO,GAC9ByB,OAAQ,cAs0BVnI,GAh2B6BtC,EAAM8B,UAAnChC,QAAAoO,eAAApP,EAAA,cAAAoC,OAAA,IF8xBCpC,EAAQqP,QAAU7L,GAKb,SAAUvD,EAAQD,KAMlB,SAAUC,EAAQD,GGx7BxBC,EAAAD,QAAAkB","file":"react-console.min.js","sourcesContent":["var Console =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar React = __webpack_require__(2);\n\t__webpack_require__(1);\n\tvar ConsolePrompt = (function (_super) {\n\t __extends(ConsolePrompt, _super);\n\t function ConsolePrompt() {\n\t _super.apply(this, arguments);\n\t this.child = {};\n\t // DOM Management\n\t this.updateSemaphore = 0;\n\t }\n\t // Component Lifecycle\n\t ConsolePrompt.prototype.componentDidMount = function () {\n\t this.idle();\n\t };\n\t ConsolePrompt.prototype.componentDidUpdate = function () {\n\t this.idle();\n\t };\n\t ConsolePrompt.prototype.idle = function () {\n\t var _this = this;\n\t // Blink cursor when idle\n\t if (this.child.cursor) {\n\t if (this.updateSemaphore == 0) {\n\t this.child.cursor.className = \"react-console-cursor\";\n\t }\n\t this.updateSemaphore++;\n\t window.setTimeout(function () {\n\t _this.updateSemaphore--;\n\t if (_this.updateSemaphore == 0 && _this.child.cursor) {\n\t _this.child.cursor.className = \"react-console-cursor react-console-cursor-idle\";\n\t }\n\t }, 1000);\n\t }\n\t };\n\t ConsolePrompt.prototype.renderValue = function () {\n\t var _this = this;\n\t if (this.props.point < 0) {\n\t return [this.props.value];\n\t }\n\t else if (this.props.point == this.props.value.length) {\n\t return [this.props.value, React.createElement(\"span\", {ref: function (ref) { return _this.child.cursor = ref; }, key: \"cursor\", className: \"react-console-cursor\"}, \" \")];\n\t }\n\t else {\n\t return [this.props.value.substring(0, this.props.point),\n\t React.createElement(\"span\", {ref: function (ref) { return _this.child.cursor = ref; }, key: \"cursor\", className: \"react-console-cursor\"}, this.props.value.substring(this.props.point, this.props.point + 1)),\n\t this.props.value.substring(this.props.point + 1)];\n\t }\n\t };\n\t ConsolePrompt.prototype.render = function () {\n\t var label = this.props.label;\n\t if (this.props.argument) {\n\t var idx = label.lastIndexOf(\"\\n\");\n\t if (idx >= 0) {\n\t label = label.substring(0, idx + 1);\n\t }\n\t else {\n\t label = '';\n\t }\n\t }\n\t return React.createElement(\"div\", {className: \"react-console-prompt-box\"}, React.createElement(\"span\", {className: \"react-console-prompt-label\"}, label), React.createElement(\"span\", {className: \"react-console-prompt-argument\"}, this.props.argument), React.createElement(\"span\", {className: \"react-console-prompt\"}, this.renderValue()));\n\t };\n\t ConsolePrompt.defaultProps = {\n\t point: -1,\n\t value: \"\",\n\t label: \"> \",\n\t argument: null,\n\t };\n\t return ConsolePrompt;\n\t}(React.Component));\n\tvar ConsoleMessage = function (props) {\n\t return React.createElement(\"div\", {className: \"react-console-message\" + (props.type ? \" react-console-message-\" + props.type : \"\")}, props.value.map(function (val) {\n\t if (typeof val == 'string') {\n\t return val;\n\t }\n\t else {\n\t return JSON.stringify(val);\n\t }\n\t }).join(\"\\n\"));\n\t};\n\tConsoleMessage.defaultProps = {\n\t type: null,\n\t value: [],\n\t};\n\t;\n\t;\n\tvar default_1 = (function (_super) {\n\t __extends(default_1, _super);\n\t function default_1(props) {\n\t var _this = this;\n\t _super.call(this, props);\n\t this.child = {};\n\t // Command API\n\t this.log = function () {\n\t var messages = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t messages[_i - 0] = arguments[_i];\n\t }\n\t var log = _this.state.log;\n\t log[_this.state.log.length - 1].message.push({ value: messages });\n\t _this.setState({\n\t log: log,\n\t }, _this.scrollIfBottom());\n\t };\n\t this.logX = function (type) {\n\t var messages = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t messages[_i - 1] = arguments[_i];\n\t }\n\t var log = _this.state.log;\n\t log[_this.state.log.length - 1].message.push({ type: type, value: messages });\n\t _this.setState({\n\t log: log,\n\t }, _this.scrollIfBottom());\n\t };\n\t this.return = function () {\n\t _this.setState({\n\t acceptInput: true,\n\t currLabel: _this.nextLabel(),\n\t }, _this.scrollIfBottom());\n\t };\n\t // Event Handlers\n\t this.focus = function () {\n\t if (!window.getSelection().toString()) {\n\t _this.child.typer.focus();\n\t _this.setState({ focus: true }, _this.scrollToBottom);\n\t }\n\t };\n\t this.blur = function () {\n\t _this.setState({ focus: false });\n\t };\n\t this.keyDown = function (e) {\n\t var keyCodes = {\n\t // return\n\t 13: _this.acceptLine,\n\t // left\n\t 37: _this.backwardChar,\n\t // right\n\t 39: _this.forwardChar,\n\t // up\n\t 38: _this.previousHistory,\n\t // down\n\t 40: _this.nextHistory,\n\t // backspace\n\t 8: _this.backwardDeleteChar,\n\t // delete\n\t 46: _this.deleteChar,\n\t // end\n\t 35: _this.endOfLine,\n\t // start\n\t 36: _this.beginningOfLine,\n\t // tab\n\t 9: _this.complete,\n\t // esc\n\t 27: _this.prefixMeta,\n\t };\n\t var ctrlCodes = {\n\t // C-a\n\t 65: _this.beginningOfLine,\n\t // C-e\n\t 69: _this.endOfLine,\n\t // C-f\n\t 70: _this.forwardChar,\n\t // C-b\n\t 66: _this.backwardChar,\n\t // C-l\n\t 76: _this.clearScreen,\n\t // C-p\n\t 80: _this.previousHistory,\n\t // C-n\n\t 78: _this.nextHistory,\n\t // C-r\n\t 82: _this.reverseSearchHistory,\n\t // C-s\n\t 83: _this.forwardSearchHistory,\n\t // C-d\n\t 68: _this.deleteChar,\n\t // C-q TODO\n\t //81: this.quotedInsert,\n\t // C-v TODO\n\t //86: this.quotedInsert,\n\t // C-t TODO\n\t //84: this.transposeChars,\n\t // C-k\n\t 75: _this.killLine,\n\t // C-u\n\t 85: _this.backwardKillLine,\n\t // C-y TODO\n\t 89: _this.yank,\n\t // C-c\n\t 67: _this.cancelCommand,\n\t };\n\t var ctrlXCodes = {\n\t // C-x Rubout\n\t 8: _this.backwardKillLine,\n\t };\n\t var ctrlShiftCodes = {};\n\t var metaCodes = {\n\t // M-f\n\t 70: _this.forwardWord,\n\t // M-b\n\t 66: _this.backwardWord,\n\t // M-p\n\t 80: _this.nonIncrementalReverseSearchHistory,\n\t // M-n\n\t 78: _this.nonIncrementalForwardSearchHistory,\n\t // M-.\n\t 190: _this.yankLastArg,\n\t // M-TAB TODO\n\t //9: this.tabInsert,\n\t // M-t TODO\n\t //84: this.transposeWords,\n\t // M-u TODO\n\t //85: this.upcaseWord,\n\t // M-l TODO\n\t //76: this.downcaseWord,\n\t // M-c TODO\n\t //67: this.capitalizeWord,\n\t // M-d\n\t 68: _this.killWord,\n\t // M-backspace\n\t 8: _this.backwardKillWord,\n\t // M-w TODO\n\t //87: this.unixWordRubout,\n\t // M-\\ TODO\n\t //220: this.deleteHorizontalSpace,\n\t // M-y\n\t 89: _this.yankPop,\n\t };\n\t var metaShiftCodes = {\n\t // M-<\n\t 188: _this.beginningOfHistory,\n\t // M->\n\t 190: _this.endOfHistory,\n\t // M-_\n\t 189: _this.yankLastArg,\n\t };\n\t var metaCtrlCodes = {\n\t // M-C-y\n\t 89: _this.yankNthArg,\n\t };\n\t if (_this.state.acceptInput) {\n\t if (e.altKey) {\n\t if (e.ctrlKey) {\n\t if (e.keyCode in metaCtrlCodes) {\n\t metaCtrlCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t }\n\t else if (e.shiftKey) {\n\t if (e.keyCode in metaShiftCodes) {\n\t metaShiftCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t }\n\t else if (e.keyCode in metaCodes) {\n\t metaCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t e.preventDefault();\n\t }\n\t else if (e.ctrlKey) {\n\t if (e.keyCode in ctrlCodes) {\n\t ctrlCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t e.preventDefault();\n\t }\n\t else if (e.keyCode in keyCodes) {\n\t keyCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t }\n\t };\n\t this.change = function () {\n\t var idx = 0;\n\t for (; idx < _this.state.typer.length && idx < _this.child.typer.value.length; idx++) {\n\t if (_this.state.typer[idx] != _this.child.typer.value[idx]) {\n\t break;\n\t }\n\t }\n\t var insert = _this.child.typer.value.substring(idx);\n\t var replace = _this.state.typer.length - idx;\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState({\n\t searchText: _this.state.searchInit ? insert : _this.textInsert(insert, _this.state.searchText, replace),\n\t typer: _this.child.typer.value,\n\t }, _this.triggerSearch);\n\t }\n\t else {\n\t _this.setState(Object.assign(_this.consoleInsert(insert, replace), {\n\t typer: _this.child.typer.value,\n\t lastCommand: 0 /* Default */,\n\t }), _this.scrollToBottom);\n\t }\n\t };\n\t this.paste = function (e) {\n\t var insert = e.clipboardData.getData('text');\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState({\n\t searchText: _this.state.searchInit ? insert : _this.textInsert(insert, _this.state.searchText),\n\t typer: _this.child.typer.value,\n\t }, _this.triggerSearch);\n\t }\n\t else {\n\t _this.setState(Object.assign(_this.consoleInsert(insert), {\n\t lastCommand: 0 /* Default */,\n\t }), _this.scrollToBottom);\n\t }\n\t e.preventDefault();\n\t };\n\t // Commands for Moving\n\t this.beginningOfLine = function () {\n\t _this.setState({\n\t point: 0,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.endOfLine = function () {\n\t _this.setState({\n\t point: _this.state.promptText.length,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.forwardChar = function () {\n\t _this.setState({\n\t point: _this.movePoint(1),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.backwardChar = function () {\n\t _this.setState({\n\t point: _this.movePoint(-1),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.forwardWord = function () {\n\t _this.setState({\n\t point: _this.nextWord(),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.backwardWord = function () {\n\t _this.setState({\n\t point: _this.previousWord(),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t // Commands for Manipulating the History\n\t this.acceptLine = function () {\n\t _this.child.typer.value = \"\";\n\t if (_this.props.continue(_this.state.promptText)) {\n\t _this.setState(Object.assign(_this.consoleInsert(\"\\n\"), {\n\t typer: \"\",\n\t lastCommand: 0 /* Default */,\n\t }), _this.scrollToBottom);\n\t }\n\t else {\n\t var command_1 = _this.state.promptText;\n\t var history_1 = _this.state.history;\n\t var log = _this.state.log;\n\t if (!history_1 || history_1[history_1.length - 1] != command_1) {\n\t history_1.push(command_1);\n\t }\n\t log.push({\n\t label: _this.state.currLabel,\n\t command: command_1,\n\t message: []\n\t });\n\t _this.setState({\n\t acceptInput: false,\n\t typer: \"\",\n\t point: 0,\n\t promptText: \"\",\n\t restoreText: \"\",\n\t log: log,\n\t history: history_1,\n\t historyn: 0,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, function () {\n\t _this.scrollToBottom();\n\t if (_this.props.handler) {\n\t _this.props.handler(command_1);\n\t }\n\t else {\n\t _this.return();\n\t }\n\t });\n\t }\n\t };\n\t this.previousHistory = function () {\n\t _this.rotateHistory(-1);\n\t };\n\t this.nextHistory = function () {\n\t _this.rotateHistory(1);\n\t };\n\t this.beginningOfHistory = function () {\n\t _this.rotateHistory(-_this.state.history.length);\n\t };\n\t this.endOfHistory = function () {\n\t _this.rotateHistory(_this.state.history.length);\n\t };\n\t this.triggerSearch = function () {\n\t if (_this.state.searchDirection == 0 /* Reverse */) {\n\t _this.reverseSearchHistory();\n\t }\n\t else {\n\t _this.forwardSearchHistory();\n\t }\n\t };\n\t this.reverseSearchHistory = function () {\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState(Object.assign(_this.searchHistory(0 /* Reverse */, true), {\n\t argument: \"(reverse-i-search)`\" + _this.state.searchText + \"': \",\n\t lastCommand: 1 /* Search */,\n\t }), _this.scrollToBottom);\n\t }\n\t else {\n\t _this.setState({\n\t searchDirection: 0 /* Reverse */,\n\t searchInit: true,\n\t argument: \"(reverse-i-search)`': \",\n\t lastCommand: 1 /* Search */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t this.forwardSearchHistory = function () {\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState(Object.assign(_this.searchHistory(1 /* Forward */, true), {\n\t argument: \"(forward-i-search)`\" + _this.state.searchText + \"': \",\n\t lastCommand: 1 /* Search */,\n\t }), _this.scrollToBottom);\n\t }\n\t else {\n\t _this.setState({\n\t searchDirection: 1 /* Forward */,\n\t searchInit: true,\n\t argument: \"(forward-i-search)`': \",\n\t lastCommand: 1 /* Search */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t this.clearScreen = function () {\n\t _this.setState({ log: [] });\n\t };\n\t this.nonIncrementalReverseSearchHistory = function () {\n\t // TODO\n\t };\n\t this.nonIncrementalForwardSearchHistory = function () {\n\t // TODO\n\t };\n\t this.historySearchBackward = function () {\n\t // TODO\n\t };\n\t this.historySearchForward = function () {\n\t // TODO\n\t };\n\t this.historySubstringSearchBackward = function () {\n\t // TODO\n\t };\n\t this.historySubstringSearchForward = function () {\n\t // TODO\n\t };\n\t this.yankNthArg = function () {\n\t // TODO\n\t };\n\t this.yankLastArg = function () {\n\t // TODO\n\t };\n\t // Commands for Changing Text\n\t this.deleteChar = function () {\n\t if (_this.state.point < _this.state.promptText.length) {\n\t _this.setState({\n\t promptText: _this.state.promptText.substring(0, _this.state.point)\n\t + _this.state.promptText.substring(_this.state.point + 1),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t this.backwardDeleteChar = function () {\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState({\n\t searchText: _this.state.searchText.substring(0, _this.state.searchText.length - 1),\n\t typer: _this.child.typer.value,\n\t }, _this.triggerSearch);\n\t }\n\t else if (_this.state.point > 0) {\n\t _this.setState({\n\t point: _this.movePoint(-1),\n\t promptText: _this.state.promptText.substring(0, _this.state.point - 1)\n\t + _this.state.promptText.substring(_this.state.point),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t // Killing and Yanking\n\t this.killLine = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = kill[0] + _this.state.promptText.substring(_this.state.point);\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText.substring(_this.state.point));\n\t }\n\t _this.setState({\n\t promptText: _this.state.promptText.substring(0, _this.state.point),\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.backwardKillLine = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = _this.state.promptText.substring(0, _this.state.point) + kill[0];\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText.substring(0, _this.state.point));\n\t }\n\t _this.setState({\n\t point: 0,\n\t promptText: _this.state.promptText.substring(_this.state.point),\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.killWholeLine = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = _this.state.promptText.substring(0, _this.state.point)\n\t + kill[0] + _this.state.promptText.substring(_this.state.point);\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText);\n\t }\n\t _this.setState({\n\t point: 0,\n\t promptText: '',\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.killWord = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = kill[0] + _this.state.promptText.substring(_this.state.point, _this.nextWord());\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText.substring(_this.state.point, _this.nextWord()));\n\t }\n\t _this.setState({\n\t promptText: _this.state.promptText.substring(0, _this.state.point)\n\t + _this.state.promptText.substring(_this.nextWord()),\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.backwardKillWord = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = _this.state.promptText.substring(_this.previousWord(), _this.state.point) + kill[0];\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText.substring(_this.previousWord(), _this.state.point));\n\t }\n\t _this.setState({\n\t point: _this.previousWord(),\n\t promptText: _this.state.promptText.substring(0, _this.previousWord())\n\t + _this.state.promptText.substring(_this.state.point),\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.yank = function () {\n\t _this.setState(Object.assign(_this.consoleInsert(_this.state.kill[_this.state.killn]), {\n\t lastCommand: 3 /* Yank */,\n\t }), _this.scrollToBottom);\n\t };\n\t this.yankPop = function () {\n\t if (_this.state.lastCommand == 3 /* Yank */) {\n\t var killn = _this.rotateRing(1, _this.state.killn, _this.state.kill.length);\n\t _this.setState(Object.assign(_this.consoleInsert(_this.state.kill[killn], _this.state.kill[_this.state.killn].length), {\n\t killn: killn,\n\t lastCommand: 3 /* Yank */,\n\t }), _this.scrollToBottom);\n\t }\n\t };\n\t // Numeric Arguments\n\t // Completing\n\t this.complete = function () {\n\t if (_this.props.complete) {\n\t // Split text and find current word\n\t var words = _this.state.promptText.split(\" \");\n\t var curr = 0;\n\t var idx = words[0].length;\n\t while (idx < _this.state.point && curr + 1 < words.length) {\n\t idx += words[++curr].length + 1;\n\t }\n\t var completions = _this.props.complete(words, curr, _this.state.promptText);\n\t if (completions.length == 1) {\n\t // Perform completion\n\t words[curr] = completions[0];\n\t var point = -1;\n\t for (var i = 0; i <= curr; i++) {\n\t point += words[i].length + 1;\n\t }\n\t _this.setState({\n\t point: point,\n\t promptText: words.join(\" \"),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t else if (completions.length > 1) {\n\t // show completions\n\t var log = _this.state.log;\n\t log.push({\n\t label: _this.state.currLabel,\n\t command: _this.state.promptText,\n\t message: [{\n\t type: \"completion\",\n\t value: [completions.join(\"\\t\")],\n\t }]\n\t });\n\t _this.setState({\n\t currLabel: _this.nextLabel(),\n\t log: log,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t }\n\t };\n\t // Keyboard Macros\n\t // Miscellaneous\n\t this.prefixMeta = function () {\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState({\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t });\n\t }\n\t // TODO Meta prefixed state\n\t };\n\t this.cancelCommand = function () {\n\t if (_this.state.acceptInput) {\n\t _this.child.typer.value = \"\";\n\t var log = _this.state.log;\n\t log.push({\n\t label: _this.state.currLabel,\n\t command: _this.state.promptText,\n\t message: []\n\t });\n\t _this.setState({\n\t typer: \"\",\n\t point: 0,\n\t promptText: \"\",\n\t restoreText: \"\",\n\t log: log,\n\t historyn: 0,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t else {\n\t _this.props.cancel();\n\t }\n\t };\n\t // Helper functions\n\t this.textInsert = function (insert, text, replace, point) {\n\t if (replace === void 0) { replace = 0; }\n\t if (point === void 0) { point = text.length; }\n\t return text.substring(0, point - replace) + insert + text.substring(point);\n\t };\n\t this.consoleInsert = function (insert, replace) {\n\t if (replace === void 0) { replace = 0; }\n\t var promptText = _this.textInsert(insert, _this.state.promptText, replace, _this.state.point);\n\t return {\n\t point: _this.movePoint(insert.length - replace, insert.length - replace + _this.state.promptText.length),\n\t promptText: promptText,\n\t restoreText: promptText,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t };\n\t };\n\t this.movePoint = function (n, max) {\n\t if (max === void 0) { max = _this.state.promptText.length; }\n\t var pos = _this.state.point + n;\n\t if (pos < 0) {\n\t return 0;\n\t }\n\t if (pos > max) {\n\t return max;\n\t }\n\t else {\n\t return pos;\n\t }\n\t };\n\t this.rotateRing = function (n, ringn, ring, circular) {\n\t if (circular === void 0) { circular = true; }\n\t if (ring == 0)\n\t return 0;\n\t if (circular) {\n\t return (ring + (ringn + n) % ring) % ring;\n\t }\n\t else {\n\t ringn = ringn - n;\n\t if (ringn < 0) {\n\t return 0;\n\t }\n\t else if (ringn >= ring) {\n\t return ring;\n\t }\n\t else {\n\t return ringn;\n\t }\n\t }\n\t };\n\t this.rotateHistory = function (n) {\n\t var historyn = _this.rotateRing(n, _this.state.historyn, _this.state.history.length, false);\n\t if (historyn == 0) {\n\t _this.setState({\n\t point: _this.state.restoreText.length,\n\t promptText: _this.state.restoreText,\n\t historyn: historyn,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t else {\n\t var promptText = _this.state.history[_this.state.history.length - historyn];\n\t _this.setState({\n\t point: promptText.length,\n\t promptText: promptText,\n\t historyn: historyn,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t this.searchHistory = function (direction, next) {\n\t if (direction === void 0) { direction = _this.state.searchDirection; }\n\t if (next === void 0) { next = false; }\n\t var idx = _this.state.historyn;\n\t var inc = (direction == 0 /* Reverse */) ? 1 : -1;\n\t if (next) {\n\t idx = idx + inc;\n\t }\n\t for (; idx > 0 && idx <= _this.state.history.length; idx = idx + inc) {\n\t var entry = _this.state.history[_this.state.history.length - idx];\n\t var point = entry.indexOf(_this.state.searchText);\n\t if (point > -1) {\n\t return {\n\t point: point,\n\t promptText: entry,\n\t searchDirection: direction,\n\t searchInit: false,\n\t historyn: idx,\n\t };\n\t }\n\t }\n\t return {\n\t searchDirection: direction,\n\t searchInit: false,\n\t };\n\t };\n\t // DOM management\n\t this.scrollSemaphore = 0;\n\t this.scrollIfBottom = function () {\n\t if (_this.scrollSemaphore > 0 || _this.child.container.scrollTop == _this.child.container.scrollHeight - _this.child.container.offsetHeight) {\n\t _this.scrollSemaphore++;\n\t return _this.scrollIfBottomTrue;\n\t }\n\t else {\n\t return null;\n\t }\n\t };\n\t this.scrollIfBottomTrue = function () {\n\t _this.scrollToBottom();\n\t _this.scrollSemaphore--;\n\t };\n\t this.scrollToBottom = function () {\n\t _this.child.container.scrollTop = _this.child.container.scrollHeight;\n\t var rect = _this.child.focus.getBoundingClientRect();\n\t if (rect.top < 0 || rect.left < 0 ||\n\t rect.bottom > (window.innerHeight || document.documentElement.clientHeight) ||\n\t rect.right > (window.innerWidth || document.documentElement.clientWidth)) {\n\t _this.child.typer.scrollIntoView(false);\n\t }\n\t };\n\t this.nextLabel = function () {\n\t if (typeof _this.props.promptLabel === \"string\") {\n\t return _this.props.promptLabel;\n\t }\n\t else {\n\t return _this.props.promptLabel();\n\t }\n\t };\n\t this.state = {\n\t focus: false,\n\t acceptInput: true,\n\t typer: '',\n\t point: 0,\n\t currLabel: this.nextLabel(),\n\t promptText: '',\n\t restoreText: '',\n\t searchText: '',\n\t searchDirection: null,\n\t searchInit: false,\n\t log: [],\n\t history: [],\n\t historyn: 0,\n\t kill: [],\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t };\n\t }\n\t // Component Lifecycle\n\t default_1.prototype.componentDidMount = function () {\n\t if (this.props.autofocus) {\n\t this.focus();\n\t }\n\t };\n\t default_1.prototype.nextWord = function () {\n\t // Find first alphanumeric char after first non-alphanumeric char\n\t var search = /\\W\\w/.exec(this.state.promptText.substring(this.state.point));\n\t if (search) {\n\t return search.index + this.state.point + 1;\n\t }\n\t else {\n\t return this.state.promptText.length;\n\t }\n\t };\n\t default_1.prototype.previousWord = function () {\n\t // Find first non-alphanumeric char after first alphanumeric char in reverse\n\t var search = /\\W\\w(?!.*\\W\\w)/.exec(this.state.promptText.substring(0, this.state.point - 1));\n\t if (search) {\n\t return search.index + 1;\n\t }\n\t else {\n\t return 0;\n\t }\n\t };\n\t default_1.prototype.render = function () {\n\t var _this = this;\n\t return React.createElement(\"div\", {ref: function (ref) { return _this.child.container = ref; }, className: \"react-console-container \" + (this.state.focus ? \"react-console-focus\" : \"react-console-nofocus\"), onClick: this.focus}, this.props.welcomeMessage ?\n\t React.createElement(\"div\", {className: \"react-console-message react-console-welcome\"}, this.props.welcomeMessage)\n\t : null, this.state.log.map(function (val) {\n\t return [\n\t React.createElement(ConsolePrompt, {label: val.label, value: val.command})\n\t ].concat(val.message.map(function (val, idx) {\n\t return React.createElement(ConsoleMessage, {key: idx, type: val.type, value: val.value});\n\t }));\n\t }), this.state.acceptInput ?\n\t React.createElement(ConsolePrompt, {label: this.state.currLabel, value: this.state.promptText, point: this.state.point, argument: this.state.argument})\n\t : null, React.createElement(\"div\", {style: { overflow: \"hidden\", height: 1, width: 1 }}, React.createElement(\"textarea\", {ref: function (ref) { return _this.child.typer = ref; }, className: \"react-console-typer\", autoComplete: \"off\", autoCorrect: \"off\", autoCapitalize: \"off\", spellCheck: \"false\", style: { outline: \"none\",\n\t color: \"transparent\",\n\t backgroundColor: \"transparent\",\n\t border: \"none\",\n\t resize: \"none\",\n\t overflow: \"hidden\",\n\t }, onBlur: this.blur, onKeyDown: this.keyDown, onChange: this.change, onPaste: this.paste})), React.createElement(\"div\", {ref: function (ref) { return _this.child.focus = ref; }}, \" \"));\n\t };\n\t default_1.defaultProps = {\n\t promptLabel: '> ',\n\t continue: function () { return false; },\n\t cancel: function () { },\n\t };\n\t return default_1;\n\t}(React.Component));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = default_1;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = React;\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// react-console.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f59adf676ff7a2cc770a","\"use strict\";\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport './react-console.scss';\n\ninterface ConsolePromptProps {\n\tpoint?: number;\n\tvalue: string;\n\tlabel: string;\n\targument?: string;\n}\nclass ConsolePrompt extends React.Component {\n\tstatic defaultProps: ConsolePromptProps = {\n\t\tpoint: -1,\n\t\tvalue: \"\",\n\t\tlabel: \"> \",\n\t\targument: null,\n\t}\n\tchild: {\n\t\tcursor?: Element;\n\t} = {};\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tthis.idle();\n\t}\n\tcomponentDidUpdate() {\n\t\tthis.idle();\n\t}\n\t// DOM Management\n\tupdateSemaphore: number = 0;\n\tidle() {\n\t\t// Blink cursor when idle\n\t\tif(this.child.cursor) {\n\t\t\tif(this.updateSemaphore == 0) {\n\t\t\t\tthis.child.cursor.className = \"react-console-cursor\";\n\t\t\t}\n\t\t\tthis.updateSemaphore++;\n\t\t\twindow.setTimeout( () => {\n\t\t\t\tthis.updateSemaphore--;\n\t\t\t\tif(this.updateSemaphore == 0 && this.child.cursor) {\n\t\t\t\t\tthis.child.cursor.className = \"react-console-cursor react-console-cursor-idle\";\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\trenderValue() {\n\t\tif(this.props.point < 0) {\n\t\t\treturn [this.props.value];\n\t\t} else if (this.props.point == this.props.value.length) {\n\t\t\treturn [this.props.value, this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\"> ];\n\t\t} else {\n\t\t\treturn [this.props.value.substring(0,this.props.point),\n\t\t\t\t this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\">{this.props.value.substring(this.props.point,this.props.point+1)},\n\t\t\t\tthis.props.value.substring(this.props.point+1)];\n\t\t}\n\t}\n\trender() {\n\t\tlet label = this.props.label;\n\t\tif(this.props.argument) {\n\t\t\tlet idx = label.lastIndexOf(\"\\n\");\n\t\t\tif(idx >= 0) {\n\t\t\t\tlabel = label.substring(0, idx+1);\n\t\t\t} else {\n\t\t\t\tlabel = '';\n\t\t\t}\n\t\t}\n\t\treturn
\n\t\t\t{ label }\n\t\t\t{ this.props.argument }\n\t\t\t{ this.renderValue() }\n\t\t
;\n\t}\n}\n\ninterface ConsoleMessageProps {\n\ttype?: string;\n\tvalue: any[];\n}\nlet ConsoleMessage: React.SFC = function(props: ConsoleMessageProps) {\n\treturn
\n\t\t{props.value.map((val: any)=>{\n\t\t\tif(typeof val == 'string') {\n\t\t\t\treturn val;\n\t\t\t} else {\n\t\t\t\treturn JSON.stringify(val);\n\t\t\t}\n\t\t}).join(\"\\n\")}\n\t
;\n}\nConsoleMessage.defaultProps = {\n\ttype: null,\n\tvalue: [],\n}\n\nexport interface LogMessage {\n\ttype?: string;\n\tvalue: any[];\n}\nexport interface LogEntry {\n\tlabel: string;\n\tcommand: string;\n\tmessage: LogMessage[];\n}\n\nexport interface ConsoleProps{\n\thandler: (command: string)=>any;\n\tcancel?: ()=>any;\n\tcomplete?: (words: string[], curr: number, promptText: string)=>string[];\n\tcontinue?: (promptText: string)=>boolean;\n\tautofocus?: boolean;\n\tpromptLabel?: string | (()=>string);\n\twelcomeMessage?: string;\n}\nexport const enum ConsoleCommand {\n\tDefault,\n\tSearch,\n\tKill,\n\tYank,\n};\nexport const enum SearchDirection {\n\tReverse,\n\tForward,\n}\nexport interface ConsoleState{\n\tfocus?: boolean;\n\tacceptInput?: boolean;\n\ttyper?: string;\n\tpoint?: number;\n\tcurrLabel?: string;\n\tpromptText?: string;\n\trestoreText?: string;\n\tsearchText?: string;\n\tsearchDirection?: SearchDirection;\n\tsearchInit?: boolean;\n\tlog?: LogEntry[];\n\thistory?: string[];\n\thistoryn?: number;\n\tkill?: string[];\n\tkilln?: number;\n\targument?: string;\n\tlastCommand?: ConsoleCommand;\n};\nexport default class extends React.Component {\n\tconstructor(props: ConsoleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tfocus: false,\n\t\t\tacceptInput: true,\n\t\t\ttyper: '',\n\t\t\tpoint: 0,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t\tpromptText: '',\n\t\t\trestoreText: '',\n\t\t\tsearchText: '',\n\t\t\tsearchDirection: null,\n\t\t\tsearchInit: false,\n\t\t\tlog: [],\n\t\t\thistory: [],\n\t\t\thistoryn: 0,\n\t\t\tkill: [],\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tstatic defaultProps = {\n\t\tpromptLabel: '> ',\n\t\tcontinue: function() { return false; },\n\t\tcancel: function() {},\n\t};\n\tchild: {\n\t\ttyper?: HTMLTextAreaElement;\n\t\tcontainer?: HTMLElement;\n\t\tfocus?: HTMLElement;\n\t} = {};\n\t// Command API\n\tlog = (...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogX = (type: string, ...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({type: type, value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\treturn = () => {\n\t\tthis.setState({\n\t\t\tacceptInput: true,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t}, this.scrollIfBottom() );\n\t}\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tif(this.props.autofocus) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\t// Event Handlers\n\tfocus = () => {\n\t\tif(!window.getSelection().toString()) {\n\t\t\tthis.child.typer.focus();\n\t\t\tthis.setState({ focus: true }, this.scrollToBottom );\n\t\t}\n\t}\n\tblur = () => {\n\t\tthis.setState({ focus: false });\n\t}\n\tkeyDown = (e: KeyboardEvent) => {\n\t\tinterface keyMap {\n\t\t\t[key: number]: ()=>void\n\t\t}\n\t\tlet keyCodes: keyMap = {\n\t\t\t// return\n\t\t\t13: this.acceptLine,\n\t\t\t// left\n\t\t\t37: this.backwardChar,\n\t\t\t// right\n\t\t\t39: this.forwardChar,\n\t\t\t// up\n\t\t\t38: this.previousHistory,\n\t\t\t// down\n\t\t\t40: this.nextHistory,\n\t\t\t// backspace\n\t\t\t8: this.backwardDeleteChar,\n\t\t\t// delete\n\t\t\t46: this.deleteChar,\n\t\t\t// end\n\t\t\t35: this.endOfLine,\n\t\t\t// start\n\t\t\t36: this.beginningOfLine,\n\t\t\t// tab\n\t\t\t9: this.complete,\n\t\t\t// esc\n\t\t\t27: this.prefixMeta,\n\t\t};\n\t\tvar ctrlCodes: keyMap = {\n\t\t\t// C-a\n\t\t\t65: this.beginningOfLine,\n\t\t\t// C-e\n\t\t\t69: this.endOfLine,\n\t\t\t// C-f\n\t\t\t70: this.forwardChar,\n\t\t\t// C-b\n\t\t\t66: this.backwardChar,\n\t\t\t// C-l\n\t\t\t76: this.clearScreen,\n\t\t\t// C-p\n\t\t\t80: this.previousHistory,\n\t\t\t// C-n\n\t\t\t78: this.nextHistory,\n\t\t\t// C-r\n\t\t\t82: this.reverseSearchHistory,\n\t\t\t// C-s\n\t\t\t83: this.forwardSearchHistory,\n\t\t\t// C-d\n\t\t\t68: this.deleteChar, // TODO EOF\n\t\t\t// C-q TODO\n\t\t\t//81: this.quotedInsert,\n\t\t\t// C-v TODO\n\t\t\t//86: this.quotedInsert,\n\t\t\t// C-t TODO\n\t\t\t//84: this.transposeChars,\n\t\t\t// C-k\n\t\t\t75: this.killLine,\n\t\t\t// C-u\n\t\t\t85: this.backwardKillLine,\n\t\t\t// C-y TODO\n\t\t\t89: this.yank,\n\t\t\t// C-c\n\t\t\t67: this.cancelCommand,\n\t\t\t// C-w TODO\n\t\t\t//87: this.killPreviousWhitespace,\n\t\t\t// C-] TODO\n\t\t\t//221: this.characterSearch,\n\t\t\t// C-x TODO\n\t\t\t//88: this.prefixCtrlX,\n\t\t};\n\t\tvar ctrlXCodes: keyMap = { // TODO state\n\t\t\t// C-x Rubout\n\t\t\t8: this.backwardKillLine,\n\t\t\t// C-x ( TODO\n\t\t\t//57: this.startKbdMacro,\n\t\t\t// C-x ) TODO\n\t\t\t//48: this.endKbdMacro,\n\t\t\t// C-x e TODO\n\t\t\t//69: this.callLastKbdMacro,\n\t\t\t// C-x C-u TODO\n\t\t\t//85: this.undo,\n\t\t\t// C-x C-x TODO\n\t\t\t//88: this.exchangePointAndMark,\n\t\t};\n\t\tvar ctrlShiftCodes: keyMap = {\n\t\t\t// C-_ TODO\n\t\t\t//189: this.undo,\n\t\t\t// C-@ TODO\n\t\t\t//50: this.setMark,\n\t\t};\n\t\tvar metaCodes: keyMap = {\n\t\t\t// M-f\n\t\t\t70: this.forwardWord,\n\t\t\t// M-b\n\t\t\t66: this.backwardWord,\n\t\t\t// M-p\n\t\t\t80: this.nonIncrementalReverseSearchHistory,\n\t\t\t// M-n\n\t\t\t78: this.nonIncrementalForwardSearchHistory,\n\t\t\t// M-.\n\t\t\t190: this.yankLastArg,\n\t\t\t// M-TAB TODO\n\t\t\t//9: this.tabInsert,\n\t\t\t// M-t TODO\n\t\t\t//84: this.transposeWords,\n\t\t\t// M-u TODO\n\t\t\t//85: this.upcaseWord,\n\t\t\t// M-l TODO\n\t\t\t//76: this.downcaseWord,\n\t\t\t// M-c TODO\n\t\t\t//67: this.capitalizeWord,\n\t\t\t// M-d\n\t\t\t68: this.killWord,\n\t\t\t// M-backspace\n\t\t\t8: this.backwardKillWord,\n\t\t\t// M-w TODO\n\t\t\t//87: this.unixWordRubout,\n\t\t\t// M-\\ TODO\n\t\t\t//220: this.deleteHorizontalSpace,\n\t\t\t// M-y\n\t\t\t89: this.yankPop,\n\t\t\t// M-0 TODO\n\t\t\t//48: () => this.digitArgument(0),\n\t\t\t// M-1 TODO\n\t\t\t//49: () => this.digitArgument(1),\n\t\t\t// M-2 TODO\n\t\t\t//50: () => this.digitArgument(2),\n\t\t\t// M-3 TODO\n\t\t\t//51: () => this.digitArgument(3),\n\t\t\t// M-4 TODO\n\t\t\t//52: () => this.digitArgument(4),\n\t\t\t// M-5 TODO\n\t\t\t//53: () => this.digitArgument(5),\n\t\t\t// M-6 TODO\n\t\t\t//54: () => this.digitArgument(6),\n\t\t\t// M-7 TODO\n\t\t\t//55: () => this.digitArgument(7),\n\t\t\t// M-8 TODO\n\t\t\t//56: () => this.digitArgument(8),\n\t\t\t// M-9 TODO\n\t\t\t//57: () => this.digitArgument(9),\n\t\t\t// M-- TODO\n\t\t\t//189: () => this.digitArgument('-'),\n\t\t\t// M-f TODO\n\t\t\t//71: () => this.abort,\n\t\t\t// M-r TODO\n\t\t\t//82: this.revertLine,\n\t\t\t// M-SPACE TODO\n\t\t\t//32: this.setMark,\n\t\t};\n\t\tvar metaShiftCodes: keyMap = { // TODO hook in\n\t\t\t// M-<\n\t\t\t188: this.beginningOfHistory,\n\t\t\t// M->\n\t\t\t190: this.endOfHistory,\n\t\t\t// M-_\n\t\t\t189: this.yankLastArg,\n\t\t\t// M-? TODO\n\t\t\t//191: this.possibleCompletions,\n\t\t\t// M-* TODO\n\t\t\t//56: this.insertCompletions,\n\t\t}\n\t\tvar metaCtrlCodes: keyMap = {\n\t\t\t// M-C-y\n\t\t\t89: this.yankNthArg,\n\t\t\t// M-C-] TODO\n\t\t\t//221: this.characterSearchBackward,\n\t\t\t// M-C-j TODO !!!\n\t\t\t//74: this.viEditingMode,\n\t\t};\n\t\tif(this.state.acceptInput) {\n\t\t\tif (e.altKey) {\n\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\tif (e.keyCode in metaCtrlCodes) {\n\t\t\t\t\t\tmetaCtrlCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.shiftKey) {\n\t\t\t\t\tif (e.keyCode in metaShiftCodes) {\n\t\t\t\t\t\tmetaShiftCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.keyCode in metaCodes) {\n\t\t\t\t\tmetaCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.ctrlKey) {\n\t\t\t\tif (e.keyCode in ctrlCodes) {\n\t\t\t\t\tctrlCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.keyCode in keyCodes) {\n\t\t\t\tkeyCodes[e.keyCode]();\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\tchange = () => {\n\t\tlet idx = 0;\n\t\tfor(;idx < this.state.typer.length && idx < this.child.typer.value.length; idx++) {\n\t\t\tif(this.state.typer[idx] != this.child.typer.value[idx]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlet insert = this.child.typer.value.substring(idx);\n\t\tlet replace = this.state.typer.length - idx;\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText, replace),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert, replace),{\n\t\t\t\t\ttyper: this.child.typer.value,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\tpaste = (e: ClipboardEvent) => {\n\t\tlet insert = e.clipboardData.getData('text');\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert),{\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t\te.preventDefault();\n\t}\n\t// Commands for Moving\n\tbeginningOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tendOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.state.promptText.length,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(-1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.nextWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\t// Commands for Manipulating the History\n\tacceptLine = () => {\n\t\tthis.child.typer.value = \"\";\n\t\tif(this.props.continue(this.state.promptText)) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(\"\\n\"),{\n\t\t\t\t\ttyper: \"\",\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tlet command = this.state.promptText;\n\t\t\tlet history = this.state.history;\n\t\t\tlet log = this.state.log;\n\t\t\tif(!history || history[history.length-1] != command) {\n\t\t\t\thistory.push(command);\n\t\t\t}\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: command,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\tacceptInput: false,\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistory: history,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, () => {\n\t\t\t\tthis.scrollToBottom();\n\t\t\t\tif(this.props.handler) {\n\t\t\t\t\tthis.props.handler(command)\n\t\t\t\t} else {\n\t\t\t\t\tthis.return();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tpreviousHistory = () => {\n\t\tthis.rotateHistory(-1);\n\t}\n\tnextHistory = () => {\n\t\tthis.rotateHistory(1);\n\t}\n\tbeginningOfHistory = () => {\n\t\tthis.rotateHistory(-this.state.history.length);\n\t}\n\tendOfHistory = () => {\n\t\tthis.rotateHistory(this.state.history.length);\n\t}\n\ttriggerSearch = () => {\n\t\tif(this.state.searchDirection == SearchDirection.Reverse) {\n\t\t\tthis.reverseSearchHistory();\n\t\t} else {\n\t\t\tthis.forwardSearchHistory();\n\t\t}\n\t}\n\treverseSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Reverse, true),{\n\t\t\t\t\targument: `(reverse-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Reverse,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(reverse-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tforwardSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Forward, true),{\n\t\t\t\t\targument: `(forward-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Forward,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(forward-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tclearScreen = () => {\n\t\tthis.setState({ log: [] });\n\t}\n\tnonIncrementalReverseSearchHistory = () => {\n\t\t// TODO\n\t}\n\tnonIncrementalForwardSearchHistory = () => {\n\t\t// TODO\n\t}\n\thistorySearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySearchForward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchForward = () => {\n\t\t// TODO\n\t}\n\tyankNthArg = () => {\n\t\t// TODO\n\t}\n\tyankLastArg = () => {\n\t\t// TODO\n\t}\n\t// Commands for Changing Text\n\tdeleteChar = () => {\n\t\tif(this.state.point < this.state.promptText.length) {\n\t\t\tthis.setState({\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point+1),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tbackwardDeleteChar = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchText.substring(0,this.state.searchText.length-1),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else if(this.state.point > 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.movePoint(-1),\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point-1)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\t// Killing and Yanking\n\tkillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(0,this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWholeLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText);\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: '',\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point,this.nextWord());\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point,this.nextWord()));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ this.state.promptText.substring(this.nextWord()),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(this.previousWord(),this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.previousWord(),this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\tpromptText: this.state.promptText.substring(0,this.previousWord())\n\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tyank = () => {\n\t\tthis.setState(Object.assign(\n\t\t\tthis.consoleInsert(this.state.kill[this.state.killn]),{\n\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t}), this.scrollToBottom\n\t\t);\n\t}\n\tyankPop = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Yank) {\n\t\t\tlet killn = this.rotateRing(1, this.state.killn, this.state.kill.length);\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(this.state.kill[killn], this.state.kill[this.state.killn].length),{\n\t\t\t\t\tkilln: killn,\n\t\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\t// Numeric Arguments\n\t// Completing\n\tcomplete = () => {\n\t\tif(this.props.complete) {\n\t\t\t// Split text and find current word\n\t\t\tlet words = this.state.promptText.split(\" \");\n\t\t\tlet curr = 0;\n\t\t\tlet idx = words[0].length;\n\t\t\twhile(idx < this.state.point && curr + 1 < words.length) {\n\t\t\t\tidx += words[++curr].length + 1;\n\t\t\t}\n\n\t\t\tlet completions = this.props.complete(words, curr, this.state.promptText);\n\t\t\tif(completions.length == 1) {\n\t\t\t\t// Perform completion\n\t\t\t\twords[curr] = completions[0];\n\t\t\t\tlet point = -1;\n\t\t\t\tfor(let i = 0; i <= curr; i++) {\n\t\t\t\t\tpoint += words[i].length + 1;\n\t\t\t\t}\n\t\t\t\tthis.setState({\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: words.join(\" \"),\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t} else if (completions.length > 1) {\n\t\t\t\t// show completions\n\t\t\t\tlet log = this.state.log;\n\t\t\t\tlog.push({\n\t\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\t\tcommand: this.state.promptText,\n\t\t\t\t\tmessage: [{\n\t\t\t\t\t\ttype: \"completion\",\n\t\t\t\t\t\tvalue: [completions.join(\"\\t\")],\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tthis.setState({\n\t\t\t\t\tcurrLabel: this.nextLabel(),\n\t\t\t\t\tlog: log,\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t}\n\t\t}\n\t}\n\t// Keyboard Macros\n\t// Miscellaneous\n\tprefixMeta = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t});\n\t\t}\n\t\t// TODO Meta prefixed state\n\t}\n\tcancelCommand = () => {\n\t\tif(this.state.acceptInput) { // Typing command\n\t\t\tthis.child.typer.value = \"\";\n\t\t\tlet log = this.state.log;\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: this.state.promptText,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t} else { // command is executing, call handler\n\t\t\tthis.props.cancel();\n\t\t}\n\t}\n\t// Helper functions\n\ttextInsert = (insert: string, text: string, replace: number = 0, point: number = text.length): string => {\n\t\treturn text.substring(0, point - replace) + insert + text.substring(point);\n\t}\n\tconsoleInsert = (insert: string, replace: number = 0): ConsoleState => {\n\t\tlet promptText = this.textInsert(insert, this.state.promptText, replace, this.state.point);\n\t\treturn {\n\t\t\tpoint: this.movePoint(insert.length - replace, insert.length - replace + this.state.promptText.length),\n\t\t\tpromptText: promptText,\n\t\t\trestoreText: promptText,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tmovePoint = (n: number, max: number = this.state.promptText.length) => {\n\t\tlet pos = this.state.point + n;\n\t\tif (pos < 0) {\n\t\t\treturn 0;\n\t\t} if (pos > max) {\n\t\t\treturn max;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}\n\tnextWord(): number {\n\t\t// Find first alphanumeric char after first non-alphanumeric char\n\t\tlet search = /\\W\\w/.exec(this.state.promptText.substring(this.state.point));\n\t\tif(search) {\n\t\t\treturn search.index + this.state.point + 1;\n\t\t} else {\n\t\t\treturn this.state.promptText.length;\n\t\t}\n\t}\n\tpreviousWord(): number {\n\t\t// Find first non-alphanumeric char after first alphanumeric char in reverse\n\t\tlet search = /\\W\\w(?!.*\\W\\w)/.exec(this.state.promptText.substring(0,this.state.point-1));\n\t\tif(search) {\n\t\t\treturn search.index + 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\trotateRing = (n: number, ringn: number, ring: number, circular: boolean = true): number => {\n\t\tif(ring == 0) return 0;\n\t\tif(circular) {\n\t\t\treturn (ring + (ringn + n) % ring) % ring;\n\t\t} else {\n\t\t\tringn = ringn - n;\n\t\t\tif(ringn < 0) {\n\t\t\t\treturn 0;\n\t\t\t} else if (ringn >= ring) {\n\t\t\t\treturn ring;\n\t\t\t} else {\n\t\t\t\treturn ringn;\n\t\t\t}\n\t\t}\n\t}\n\trotateHistory = (n: number) => {\n\t\tlet historyn = this.rotateRing(n, this.state.historyn, this.state.history.length, false);\n\t\tif(historyn == 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.state.restoreText.length,\n\t\t\t\tpromptText: this.state.restoreText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t} else {\n\t\t\tlet promptText = this.state.history[this.state.history.length-historyn];\n\t\t\tthis.setState({\n\t\t\t\tpoint: promptText.length,\n\t\t\t\tpromptText: promptText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t}\n\t}\n\tsearchHistory = (direction: SearchDirection = this.state.searchDirection, next: boolean = false): ConsoleState => {\n\t\tlet idx = this.state.historyn;\n\t\tlet inc = (direction == SearchDirection.Reverse)?1:-1;\n\t\tif(next) {\n\t\t\tidx = idx + inc;\n\t\t}\n\t\tfor(;idx > 0 && idx <= this.state.history.length; idx = idx + inc) {\n\t\t\tlet entry = this.state.history[this.state.history.length-idx];\n\t\t\tlet point = entry.indexOf(this.state.searchText);\n\t\t\tif(point > -1) {\n\t\t\t\treturn {\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: entry,\n\t\t\t\t\tsearchDirection: direction,\n\t\t\t\t\tsearchInit: false,\n\t\t\t\t\thistoryn: idx,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tsearchDirection: direction,\n\t\t\tsearchInit: false,\n\t\t};\n\t}\n\t// DOM management\n\tscrollSemaphore = 0;\n\tscrollIfBottom = () => {\n\t\tif(this.scrollSemaphore > 0 || this.child.container.scrollTop == this.child.container.scrollHeight - this.child.container.offsetHeight) {\n\t\t\tthis.scrollSemaphore++;\n\t\t\treturn this.scrollIfBottomTrue;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tscrollIfBottomTrue = () => {\n\t\tthis.scrollToBottom();\n\t\tthis.scrollSemaphore--;\n\t}\n\tscrollToBottom = () => {\n\t\tthis.child.container.scrollTop = this.child.container.scrollHeight;\n\t\tlet rect = this.child.focus.getBoundingClientRect();\n\t\tif(rect.top < 0 || rect.left < 0 ||\n\t\t\trect.bottom > (window.innerHeight || document.documentElement.clientHeight) ||\n\t\t\trect.right > (window.innerWidth || document.documentElement.clientWidth)\n\t\t) { this.child.typer.scrollIntoView(false); }\n\t}\n\tnextLabel = () => {\n\t\tif(typeof this.props.promptLabel === \"string\") {\n\t\t\treturn this.props.promptLabel as string;\n\t\t} else {\n\t\t\treturn (this.props.promptLabel as ()=>string)();\n\t\t}\n\t}\n\trender() {\n\t\treturn
this.child.container = ref}\n\t\t\t\tclassName={\"react-console-container \" + (this.state.focus?\"react-console-focus\":\"react-console-nofocus\")}\n\t\t\t\tonClick={this.focus}\n\t\t\t>\n\t\t\t{this.props.welcomeMessage?\n\t\t\t\t
\n\t\t\t\t\t{this.props.welcomeMessage}\n\t\t\t\t
\n\t\t\t\t: null\n\t\t\t}\n\t\t\t{this.state.log.map( (val: LogEntry) => {\n\t\t\t\treturn [\n\t\t\t\t\t,\n\t\t\t\t\t...val.message.map( (val: LogMessage, idx: number) => {\n\t\t\t\t\t\treturn ;\n\t\t\t\t\t})\n\t\t\t\t];\n\t\t\t})}\n\t\t\t{this.state.acceptInput?\n\t\t\t\t\n\t\t\t\t: null\n\t\t\t}\n\t\t\t
\n\t\t\t\t this.child.typer = ref}\n\t\t\t\t\tclassName=\"react-console-typer\"\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tautoCorrect=\"off\"\n\t\t\t\t\tautoCapitalize=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\tstyle={{ outline: \"none\",\n\t\t\t\t\t\tcolor: \"transparent\",\n\t\t\t\t\t\tbackgroundColor: \"transparent\",\n\t\t\t\t\t\tborder: \"none\",\n\t\t\t\t\t\tresize: \"none\",\n\t\t\t\t\t\toverflow: \"hidden\",\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={this.blur}\n\t\t\t\t\tonKeyDown={this.keyDown}\n\t\t\t\t\tonChange={this.change}\n\t\t\t\t\tonPaste={this.paste}\n\t\t\t\t>\n\t\t\t
\n\t\t\t
this.child.focus = ref}> 
\n\t\t
;\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react-console.tsx","module.exports = React;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"React\"\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///react-console.min.js","webpack:///webpack/bootstrap 051c9faad82129278752","webpack:///./react-console.tsx","webpack:///external \"React\""],"names":["Console","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","__extends","this","d","b","__","constructor","hasOwnProperty","prototype","Object","create","React","ConsolePrompt","_super","apply","arguments","child","updateSemaphore","componentDidMount","idle","componentDidUpdate","_this","cursor","className","window","setTimeout","renderValue","props","point","value","length","createElement","ref","key","substring","render","label","argument","idx","lastIndexOf","defaultProps","Component","ConsoleTableHeader","headers","map","header","scope","ConsoleMessage","isTable","data","rows","row","index","cell","cellIndex","type","val","JSON","stringify","join","default_1","log","messages","_i","state","message","push","setState","scrollIfBottom","logX","logTable","tableData","return","acceptInput","currLabel","nextLabel","focus","getSelection","toString","typer","scrollToBottom","blur","keyDown","e","keyCodes","13","acceptLine","37","backwardChar","39","forwardChar","38","previousHistory","40","nextHistory","8","backwardDeleteChar","46","deleteChar","35","endOfLine","36","beginningOfLine","9","complete","27","prefixMeta","ctrlCodes","65","69","70","66","76","clearScreen","80","78","82","reverseSearchHistory","83","forwardSearchHistory","68","75","killLine","85","backwardKillLine","89","yank","67","cancelCommand","metaCodes","forwardWord","backwardWord","nonIncrementalReverseSearchHistory","nonIncrementalForwardSearchHistory","190","yankLastArg","killWord","backwardKillWord","yankPop","metaShiftCodes","188","beginningOfHistory","endOfHistory","189","metaCtrlCodes","yankNthArg","altKey","ctrlKey","keyCode","preventDefault","shiftKey","change","insert","replace","lastCommand","searchText","searchInit","textInsert","triggerSearch","assign","consoleInsert","paste","clipboardData","getData","promptText","movePoint","nextWord","previousWord","continue","command_1","history_1","history","command","restoreText","historyn","handler","rotateHistory","searchDirection","searchHistory","historySearchBackward","historySearchForward","historySubstringSearchBackward","historySubstringSearchForward","kill","unshift","killn","killWholeLine","rotateRing","words","split","curr","completions","i","cancel","text","n","max","pos","ringn","ring","circular","direction","next","inc","entry","indexOf","scrollSemaphore","container","scrollTop","scrollHeight","offsetHeight","scrollIfBottomTrue","rect","getBoundingClientRect","top","left","bottom","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","scrollIntoView","promptLabel","autofocus","search","exec","onClick","welcomeMessage","concat","style","overflow","height","width","autoComplete","autoCorrect","autoCapitalize","spellCheck","outline","color","backgroundColor","border","resize","onBlur","onKeyDown","onChange","onPaste","defineProperty","default"],"mappings":"AAAA,GAAIA,SACK,SAAUC,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,G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QAAS,OACjBC,MAAO,cACPC,gBAAiB,cACjBC,OAAQ,OACRC,OAAQ,OACRX,SAAU,UAEXY,OAAQnP,KAAK+E,KACbqK,UAAWpP,KAAKgF,QAChBqK,SAAUrP,KAAKqJ,OACfiG,QAAStP,KAAK+J,SAGhBtJ,EAAAoB,cAAA,OAAKC,IAAK,SAAAA,GAAO,MAAAX,GAAKL,MAAM4D,MAAQ5C,IAAI,OA70BnC4B,EAAApB,cACNyL,YAAa,KACbzD,SAAU,WAAa,OAAO,GAC9ByB,OAAQ,cA60BVrI,GAv2B6BjD,EAAM8B,UAAnChC,QAAAgP,eAAAhQ,EAAA,cAAAoC,OAAA,IFgxBCpC,EAAQiQ,QAAU9L,GAKb,SAAUlE,EAAQD,KAMlB,SAAUC,EAAQD,GGl9BxBC,EAAAD,QAAAkB","file":"react-console.min.js","sourcesContent":["var Console =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar React = __webpack_require__(2);\n\t__webpack_require__(1);\n\tvar ConsolePrompt = (function (_super) {\n\t __extends(ConsolePrompt, _super);\n\t function ConsolePrompt() {\n\t _super.apply(this, arguments);\n\t this.child = {};\n\t // DOM Management\n\t this.updateSemaphore = 0;\n\t }\n\t // Component Lifecycle\n\t ConsolePrompt.prototype.componentDidMount = function () {\n\t this.idle();\n\t };\n\t ConsolePrompt.prototype.componentDidUpdate = function () {\n\t this.idle();\n\t };\n\t ConsolePrompt.prototype.idle = function () {\n\t var _this = this;\n\t // Blink cursor when idle\n\t if (this.child.cursor) {\n\t if (this.updateSemaphore == 0) {\n\t this.child.cursor.className = \"react-console-cursor\";\n\t }\n\t this.updateSemaphore++;\n\t window.setTimeout(function () {\n\t _this.updateSemaphore--;\n\t if (_this.updateSemaphore == 0 && _this.child.cursor) {\n\t _this.child.cursor.className = \"react-console-cursor react-console-cursor-idle\";\n\t }\n\t }, 1000);\n\t }\n\t };\n\t ConsolePrompt.prototype.renderValue = function () {\n\t var _this = this;\n\t if (this.props.point < 0) {\n\t return [this.props.value];\n\t }\n\t else if (this.props.point == this.props.value.length) {\n\t return [this.props.value, React.createElement(\"span\", {ref: function (ref) { return _this.child.cursor = ref; }, key: \"cursor\", className: \"react-console-cursor\"}, \" \")];\n\t }\n\t else {\n\t return [this.props.value.substring(0, this.props.point),\n\t React.createElement(\"span\", {ref: function (ref) { return _this.child.cursor = ref; }, key: \"cursor\", className: \"react-console-cursor\"}, this.props.value.substring(this.props.point, this.props.point + 1)),\n\t this.props.value.substring(this.props.point + 1)];\n\t }\n\t };\n\t ConsolePrompt.prototype.render = function () {\n\t var label = this.props.label;\n\t if (this.props.argument) {\n\t var idx = label.lastIndexOf(\"\\n\");\n\t if (idx >= 0) {\n\t label = label.substring(0, idx + 1);\n\t }\n\t else {\n\t label = '';\n\t }\n\t }\n\t return React.createElement(\"div\", {className: \"react-console-prompt-box\"}, React.createElement(\"span\", {className: \"react-console-prompt-label\"}, label), React.createElement(\"span\", {className: \"react-console-prompt-argument\"}, this.props.argument), React.createElement(\"span\", {className: \"react-console-prompt\"}, this.renderValue()));\n\t };\n\t ConsolePrompt.defaultProps = {\n\t point: -1,\n\t value: \"\",\n\t label: \"> \",\n\t argument: null,\n\t };\n\t return ConsolePrompt;\n\t}(React.Component));\n\tvar ConsoleTableHeader = function (props) {\n\t if (props.headers) {\n\t return React.createElement(\"thead\", null, React.createElement(\"tr\", null, props.headers.map(function (header) {\n\t return React.createElement(\"th\", {scope: \"col\", key: header}, header);\n\t })));\n\t }\n\t return null;\n\t};\n\tvar ConsoleMessage = function (props) {\n\t if (props.isTable) {\n\t var data = props.value[0];\n\t return React.createElement(\"div\", {className: \"react-console-message react-console-table\"}, React.createElement(\"table\", null, React.createElement(ConsoleTableHeader, {headers: data.headers}), React.createElement(\"tbody\", null, data.rows && data.rows.map(function (row, index) {\n\t return React.createElement(\"tr\", {key: index}, row.map(function (cell, cellIndex) {\n\t return React.createElement(\"td\", {key: cellIndex}, cell);\n\t }));\n\t }))));\n\t }\n\t else {\n\t return React.createElement(\"div\", {className: \"react-console-message\" + (props.type ? \" react-console-message-\" + props.type : \"\")}, props.value.map(function (val) {\n\t if (typeof val == 'string') {\n\t return val;\n\t }\n\t else {\n\t return JSON.stringify(val);\n\t }\n\t }).join(\"\\n\"));\n\t }\n\t};\n\tConsoleMessage.defaultProps = {\n\t type: null,\n\t value: [],\n\t isTable: false\n\t};\n\t;\n\t;\n\tvar default_1 = (function (_super) {\n\t __extends(default_1, _super);\n\t function default_1(props) {\n\t var _this = this;\n\t _super.call(this, props);\n\t this.child = {};\n\t // Command API\n\t this.log = function () {\n\t var messages = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t messages[_i - 0] = arguments[_i];\n\t }\n\t var log = _this.state.log;\n\t log[_this.state.log.length - 1].message.push({ value: messages });\n\t _this.setState({\n\t log: log,\n\t }, _this.scrollIfBottom());\n\t };\n\t this.logX = function (type) {\n\t var messages = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t messages[_i - 1] = arguments[_i];\n\t }\n\t var log = _this.state.log;\n\t log[_this.state.log.length - 1].message.push({ type: type, value: messages });\n\t _this.setState({\n\t log: log,\n\t }, _this.scrollIfBottom());\n\t };\n\t this.logTable = function (tableData) {\n\t var log = _this.state.log;\n\t log[_this.state.log.length - 1].message.push({ isTable: true, value: [tableData] });\n\t _this.setState({\n\t log: log,\n\t }, _this.scrollIfBottom());\n\t };\n\t this.return = function () {\n\t _this.setState({\n\t acceptInput: true,\n\t currLabel: _this.nextLabel(),\n\t }, _this.scrollIfBottom());\n\t };\n\t // Event Handlers\n\t this.focus = function () {\n\t if (!window.getSelection().toString()) {\n\t _this.child.typer.focus();\n\t _this.setState({ focus: true }, _this.scrollToBottom);\n\t }\n\t };\n\t this.blur = function () {\n\t _this.setState({ focus: false });\n\t };\n\t this.keyDown = function (e) {\n\t var keyCodes = {\n\t // return\n\t 13: _this.acceptLine,\n\t // left\n\t 37: _this.backwardChar,\n\t // right\n\t 39: _this.forwardChar,\n\t // up\n\t 38: _this.previousHistory,\n\t // down\n\t 40: _this.nextHistory,\n\t // backspace\n\t 8: _this.backwardDeleteChar,\n\t // delete\n\t 46: _this.deleteChar,\n\t // end\n\t 35: _this.endOfLine,\n\t // start\n\t 36: _this.beginningOfLine,\n\t // tab\n\t 9: _this.complete,\n\t // esc\n\t 27: _this.prefixMeta,\n\t };\n\t var ctrlCodes = {\n\t // C-a\n\t 65: _this.beginningOfLine,\n\t // C-e\n\t 69: _this.endOfLine,\n\t // C-f\n\t 70: _this.forwardChar,\n\t // C-b\n\t 66: _this.backwardChar,\n\t // C-l\n\t 76: _this.clearScreen,\n\t // C-p\n\t 80: _this.previousHistory,\n\t // C-n\n\t 78: _this.nextHistory,\n\t // C-r\n\t 82: _this.reverseSearchHistory,\n\t // C-s\n\t 83: _this.forwardSearchHistory,\n\t // C-d\n\t 68: _this.deleteChar,\n\t // C-q TODO\n\t //81: this.quotedInsert,\n\t // C-v TODO\n\t //86: this.quotedInsert,\n\t // C-t TODO\n\t //84: this.transposeChars,\n\t // C-k\n\t 75: _this.killLine,\n\t // C-u\n\t 85: _this.backwardKillLine,\n\t // C-y TODO\n\t 89: _this.yank,\n\t // C-c\n\t 67: _this.cancelCommand,\n\t };\n\t var ctrlXCodes = {\n\t // C-x Rubout\n\t 8: _this.backwardKillLine,\n\t };\n\t var ctrlShiftCodes = {};\n\t var metaCodes = {\n\t // M-f\n\t 70: _this.forwardWord,\n\t // M-b\n\t 66: _this.backwardWord,\n\t // M-p\n\t 80: _this.nonIncrementalReverseSearchHistory,\n\t // M-n\n\t 78: _this.nonIncrementalForwardSearchHistory,\n\t // M-.\n\t 190: _this.yankLastArg,\n\t // M-TAB TODO\n\t //9: this.tabInsert,\n\t // M-t TODO\n\t //84: this.transposeWords,\n\t // M-u TODO\n\t //85: this.upcaseWord,\n\t // M-l TODO\n\t //76: this.downcaseWord,\n\t // M-c TODO\n\t //67: this.capitalizeWord,\n\t // M-d\n\t 68: _this.killWord,\n\t // M-backspace\n\t 8: _this.backwardKillWord,\n\t // M-w TODO\n\t //87: this.unixWordRubout,\n\t // M-\\ TODO\n\t //220: this.deleteHorizontalSpace,\n\t // M-y\n\t 89: _this.yankPop,\n\t };\n\t var metaShiftCodes = {\n\t // M-<\n\t 188: _this.beginningOfHistory,\n\t // M->\n\t 190: _this.endOfHistory,\n\t // M-_\n\t 189: _this.yankLastArg,\n\t };\n\t var metaCtrlCodes = {\n\t // M-C-y\n\t 89: _this.yankNthArg,\n\t };\n\t if (_this.state.acceptInput) {\n\t if (e.altKey) {\n\t if (e.ctrlKey) {\n\t if (e.keyCode in metaCtrlCodes) {\n\t metaCtrlCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t }\n\t else if (e.shiftKey) {\n\t if (e.keyCode in metaShiftCodes) {\n\t metaShiftCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t }\n\t else if (e.keyCode in metaCodes) {\n\t metaCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t e.preventDefault();\n\t }\n\t else if (e.ctrlKey) {\n\t if (e.keyCode in ctrlCodes) {\n\t ctrlCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t e.preventDefault();\n\t }\n\t else if (e.keyCode in keyCodes) {\n\t keyCodes[e.keyCode]();\n\t e.preventDefault();\n\t }\n\t }\n\t };\n\t this.change = function () {\n\t var idx = 0;\n\t for (; idx < _this.state.typer.length && idx < _this.child.typer.value.length; idx++) {\n\t if (_this.state.typer[idx] != _this.child.typer.value[idx]) {\n\t break;\n\t }\n\t }\n\t var insert = _this.child.typer.value.substring(idx);\n\t var replace = _this.state.typer.length - idx;\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState({\n\t searchText: _this.state.searchInit ? insert : _this.textInsert(insert, _this.state.searchText, replace),\n\t typer: _this.child.typer.value,\n\t }, _this.triggerSearch);\n\t }\n\t else {\n\t _this.setState(Object.assign(_this.consoleInsert(insert, replace), {\n\t typer: _this.child.typer.value,\n\t lastCommand: 0 /* Default */,\n\t }), _this.scrollToBottom);\n\t }\n\t };\n\t this.paste = function (e) {\n\t var insert = e.clipboardData.getData('text');\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState({\n\t searchText: _this.state.searchInit ? insert : _this.textInsert(insert, _this.state.searchText),\n\t typer: _this.child.typer.value,\n\t }, _this.triggerSearch);\n\t }\n\t else {\n\t _this.setState(Object.assign(_this.consoleInsert(insert), {\n\t lastCommand: 0 /* Default */,\n\t }), _this.scrollToBottom);\n\t }\n\t e.preventDefault();\n\t };\n\t // Commands for Moving\n\t this.beginningOfLine = function () {\n\t _this.setState({\n\t point: 0,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.endOfLine = function () {\n\t _this.setState({\n\t point: _this.state.promptText.length,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.forwardChar = function () {\n\t _this.setState({\n\t point: _this.movePoint(1),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.backwardChar = function () {\n\t _this.setState({\n\t point: _this.movePoint(-1),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.forwardWord = function () {\n\t _this.setState({\n\t point: _this.nextWord(),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.backwardWord = function () {\n\t _this.setState({\n\t point: _this.previousWord(),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t };\n\t // Commands for Manipulating the History\n\t this.acceptLine = function () {\n\t _this.child.typer.value = \"\";\n\t if (_this.props.continue(_this.state.promptText)) {\n\t _this.setState(Object.assign(_this.consoleInsert(\"\\n\"), {\n\t typer: \"\",\n\t lastCommand: 0 /* Default */,\n\t }), _this.scrollToBottom);\n\t }\n\t else {\n\t var command_1 = _this.state.promptText;\n\t var history_1 = _this.state.history;\n\t var log = _this.state.log;\n\t if (!history_1 || history_1[history_1.length - 1] != command_1) {\n\t history_1.push(command_1);\n\t }\n\t log.push({\n\t label: _this.state.currLabel,\n\t command: command_1,\n\t message: []\n\t });\n\t _this.setState({\n\t acceptInput: false,\n\t typer: \"\",\n\t point: 0,\n\t promptText: \"\",\n\t restoreText: \"\",\n\t log: log,\n\t history: history_1,\n\t historyn: 0,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, function () {\n\t _this.scrollToBottom();\n\t if (_this.props.handler) {\n\t _this.props.handler(command_1);\n\t }\n\t else {\n\t _this.return();\n\t }\n\t });\n\t }\n\t };\n\t this.previousHistory = function () {\n\t _this.rotateHistory(-1);\n\t };\n\t this.nextHistory = function () {\n\t _this.rotateHistory(1);\n\t };\n\t this.beginningOfHistory = function () {\n\t _this.rotateHistory(-_this.state.history.length);\n\t };\n\t this.endOfHistory = function () {\n\t _this.rotateHistory(_this.state.history.length);\n\t };\n\t this.triggerSearch = function () {\n\t if (_this.state.searchDirection == 0 /* Reverse */) {\n\t _this.reverseSearchHistory();\n\t }\n\t else {\n\t _this.forwardSearchHistory();\n\t }\n\t };\n\t this.reverseSearchHistory = function () {\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState(Object.assign(_this.searchHistory(0 /* Reverse */, true), {\n\t argument: \"(reverse-i-search)`\" + _this.state.searchText + \"': \",\n\t lastCommand: 1 /* Search */,\n\t }), _this.scrollToBottom);\n\t }\n\t else {\n\t _this.setState({\n\t searchDirection: 0 /* Reverse */,\n\t searchInit: true,\n\t argument: \"(reverse-i-search)`': \",\n\t lastCommand: 1 /* Search */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t this.forwardSearchHistory = function () {\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState(Object.assign(_this.searchHistory(1 /* Forward */, true), {\n\t argument: \"(forward-i-search)`\" + _this.state.searchText + \"': \",\n\t lastCommand: 1 /* Search */,\n\t }), _this.scrollToBottom);\n\t }\n\t else {\n\t _this.setState({\n\t searchDirection: 1 /* Forward */,\n\t searchInit: true,\n\t argument: \"(forward-i-search)`': \",\n\t lastCommand: 1 /* Search */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t this.clearScreen = function () {\n\t _this.setState({ log: [] });\n\t };\n\t this.nonIncrementalReverseSearchHistory = function () {\n\t // TODO\n\t };\n\t this.nonIncrementalForwardSearchHistory = function () {\n\t // TODO\n\t };\n\t this.historySearchBackward = function () {\n\t // TODO\n\t };\n\t this.historySearchForward = function () {\n\t // TODO\n\t };\n\t this.historySubstringSearchBackward = function () {\n\t // TODO\n\t };\n\t this.historySubstringSearchForward = function () {\n\t // TODO\n\t };\n\t this.yankNthArg = function () {\n\t // TODO\n\t };\n\t this.yankLastArg = function () {\n\t // TODO\n\t };\n\t // Commands for Changing Text\n\t this.deleteChar = function () {\n\t if (_this.state.point < _this.state.promptText.length) {\n\t _this.setState({\n\t promptText: _this.state.promptText.substring(0, _this.state.point)\n\t + _this.state.promptText.substring(_this.state.point + 1),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t this.backwardDeleteChar = function () {\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState({\n\t searchText: _this.state.searchText.substring(0, _this.state.searchText.length - 1),\n\t typer: _this.child.typer.value,\n\t }, _this.triggerSearch);\n\t }\n\t else if (_this.state.point > 0) {\n\t _this.setState({\n\t point: _this.movePoint(-1),\n\t promptText: _this.state.promptText.substring(0, _this.state.point - 1)\n\t + _this.state.promptText.substring(_this.state.point),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t // Killing and Yanking\n\t this.killLine = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = kill[0] + _this.state.promptText.substring(_this.state.point);\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText.substring(_this.state.point));\n\t }\n\t _this.setState({\n\t promptText: _this.state.promptText.substring(0, _this.state.point),\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.backwardKillLine = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = _this.state.promptText.substring(0, _this.state.point) + kill[0];\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText.substring(0, _this.state.point));\n\t }\n\t _this.setState({\n\t point: 0,\n\t promptText: _this.state.promptText.substring(_this.state.point),\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.killWholeLine = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = _this.state.promptText.substring(0, _this.state.point)\n\t + kill[0] + _this.state.promptText.substring(_this.state.point);\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText);\n\t }\n\t _this.setState({\n\t point: 0,\n\t promptText: '',\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.killWord = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = kill[0] + _this.state.promptText.substring(_this.state.point, _this.nextWord());\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText.substring(_this.state.point, _this.nextWord()));\n\t }\n\t _this.setState({\n\t promptText: _this.state.promptText.substring(0, _this.state.point)\n\t + _this.state.promptText.substring(_this.nextWord()),\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.backwardKillWord = function () {\n\t var kill = _this.state.kill;\n\t if (_this.state.lastCommand == 2 /* Kill */) {\n\t kill[0] = _this.state.promptText.substring(_this.previousWord(), _this.state.point) + kill[0];\n\t }\n\t else {\n\t kill.unshift(_this.state.promptText.substring(_this.previousWord(), _this.state.point));\n\t }\n\t _this.setState({\n\t point: _this.previousWord(),\n\t promptText: _this.state.promptText.substring(0, _this.previousWord())\n\t + _this.state.promptText.substring(_this.state.point),\n\t kill: kill,\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 2 /* Kill */,\n\t }, _this.scrollToBottom);\n\t };\n\t this.yank = function () {\n\t _this.setState(Object.assign(_this.consoleInsert(_this.state.kill[_this.state.killn]), {\n\t lastCommand: 3 /* Yank */,\n\t }), _this.scrollToBottom);\n\t };\n\t this.yankPop = function () {\n\t if (_this.state.lastCommand == 3 /* Yank */) {\n\t var killn = _this.rotateRing(1, _this.state.killn, _this.state.kill.length);\n\t _this.setState(Object.assign(_this.consoleInsert(_this.state.kill[killn], _this.state.kill[_this.state.killn].length), {\n\t killn: killn,\n\t lastCommand: 3 /* Yank */,\n\t }), _this.scrollToBottom);\n\t }\n\t };\n\t // Numeric Arguments\n\t // Completing\n\t this.complete = function () {\n\t if (_this.props.complete) {\n\t // Split text and find current word\n\t var words = _this.state.promptText.split(\" \");\n\t var curr = 0;\n\t var idx = words[0].length;\n\t while (idx < _this.state.point && curr + 1 < words.length) {\n\t idx += words[++curr].length + 1;\n\t }\n\t var completions = _this.props.complete(words, curr, _this.state.promptText);\n\t if (completions.length == 1) {\n\t // Perform completion\n\t words[curr] = completions[0];\n\t var point = -1;\n\t for (var i = 0; i <= curr; i++) {\n\t point += words[i].length + 1;\n\t }\n\t _this.setState({\n\t point: point,\n\t promptText: words.join(\" \"),\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t else if (completions.length > 1) {\n\t // show completions\n\t var log = _this.state.log;\n\t log.push({\n\t label: _this.state.currLabel,\n\t command: _this.state.promptText,\n\t message: [{\n\t type: \"completion\",\n\t value: [completions.join(\"\\t\")],\n\t }]\n\t });\n\t _this.setState({\n\t currLabel: _this.nextLabel(),\n\t log: log,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t }\n\t };\n\t // Keyboard Macros\n\t // Miscellaneous\n\t this.prefixMeta = function () {\n\t if (_this.state.lastCommand == 1 /* Search */) {\n\t _this.setState({\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t });\n\t }\n\t // TODO Meta prefixed state\n\t };\n\t this.cancelCommand = function () {\n\t if (_this.state.acceptInput) {\n\t _this.child.typer.value = \"\";\n\t var log = _this.state.log;\n\t log.push({\n\t label: _this.state.currLabel,\n\t command: _this.state.promptText,\n\t message: []\n\t });\n\t _this.setState({\n\t typer: \"\",\n\t point: 0,\n\t promptText: \"\",\n\t restoreText: \"\",\n\t log: log,\n\t historyn: 0,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t else {\n\t _this.props.cancel();\n\t }\n\t };\n\t // Helper functions\n\t this.textInsert = function (insert, text, replace, point) {\n\t if (replace === void 0) { replace = 0; }\n\t if (point === void 0) { point = text.length; }\n\t return text.substring(0, point - replace) + insert + text.substring(point);\n\t };\n\t this.consoleInsert = function (insert, replace) {\n\t if (replace === void 0) { replace = 0; }\n\t var promptText = _this.textInsert(insert, _this.state.promptText, replace, _this.state.point);\n\t return {\n\t point: _this.movePoint(insert.length - replace, insert.length - replace + _this.state.promptText.length),\n\t promptText: promptText,\n\t restoreText: promptText,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t };\n\t };\n\t this.movePoint = function (n, max) {\n\t if (max === void 0) { max = _this.state.promptText.length; }\n\t var pos = _this.state.point + n;\n\t if (pos < 0) {\n\t return 0;\n\t }\n\t if (pos > max) {\n\t return max;\n\t }\n\t else {\n\t return pos;\n\t }\n\t };\n\t this.rotateRing = function (n, ringn, ring, circular) {\n\t if (circular === void 0) { circular = true; }\n\t if (ring == 0)\n\t return 0;\n\t if (circular) {\n\t return (ring + (ringn + n) % ring) % ring;\n\t }\n\t else {\n\t ringn = ringn - n;\n\t if (ringn < 0) {\n\t return 0;\n\t }\n\t else if (ringn >= ring) {\n\t return ring;\n\t }\n\t else {\n\t return ringn;\n\t }\n\t }\n\t };\n\t this.rotateHistory = function (n) {\n\t var historyn = _this.rotateRing(n, _this.state.historyn, _this.state.history.length, false);\n\t if (historyn == 0) {\n\t _this.setState({\n\t point: _this.state.restoreText.length,\n\t promptText: _this.state.restoreText,\n\t historyn: historyn,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t else {\n\t var promptText = _this.state.history[_this.state.history.length - historyn];\n\t _this.setState({\n\t point: promptText.length,\n\t promptText: promptText,\n\t historyn: historyn,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t }, _this.scrollToBottom);\n\t }\n\t };\n\t this.searchHistory = function (direction, next) {\n\t if (direction === void 0) { direction = _this.state.searchDirection; }\n\t if (next === void 0) { next = false; }\n\t var idx = _this.state.historyn;\n\t var inc = (direction == 0 /* Reverse */) ? 1 : -1;\n\t if (next) {\n\t idx = idx + inc;\n\t }\n\t for (; idx > 0 && idx <= _this.state.history.length; idx = idx + inc) {\n\t var entry = _this.state.history[_this.state.history.length - idx];\n\t var point = entry.indexOf(_this.state.searchText);\n\t if (point > -1) {\n\t return {\n\t point: point,\n\t promptText: entry,\n\t searchDirection: direction,\n\t searchInit: false,\n\t historyn: idx,\n\t };\n\t }\n\t }\n\t return {\n\t searchDirection: direction,\n\t searchInit: false,\n\t };\n\t };\n\t // DOM management\n\t this.scrollSemaphore = 0;\n\t this.scrollIfBottom = function () {\n\t if (_this.scrollSemaphore > 0 || _this.child.container.scrollTop == _this.child.container.scrollHeight - _this.child.container.offsetHeight) {\n\t _this.scrollSemaphore++;\n\t return _this.scrollIfBottomTrue;\n\t }\n\t else {\n\t return null;\n\t }\n\t };\n\t this.scrollIfBottomTrue = function () {\n\t _this.scrollToBottom();\n\t _this.scrollSemaphore--;\n\t };\n\t this.scrollToBottom = function () {\n\t _this.child.container.scrollTop = _this.child.container.scrollHeight;\n\t var rect = _this.child.focus.getBoundingClientRect();\n\t if (rect.top < 0 || rect.left < 0 ||\n\t rect.bottom > (window.innerHeight || document.documentElement.clientHeight) ||\n\t rect.right > (window.innerWidth || document.documentElement.clientWidth)) {\n\t _this.child.typer.scrollIntoView(false);\n\t }\n\t };\n\t this.nextLabel = function () {\n\t if (typeof _this.props.promptLabel === \"string\") {\n\t return _this.props.promptLabel;\n\t }\n\t else {\n\t return _this.props.promptLabel();\n\t }\n\t };\n\t this.state = {\n\t focus: false,\n\t acceptInput: true,\n\t typer: '',\n\t point: 0,\n\t currLabel: this.nextLabel(),\n\t promptText: '',\n\t restoreText: '',\n\t searchText: '',\n\t searchDirection: null,\n\t searchInit: false,\n\t log: [],\n\t history: [],\n\t historyn: 0,\n\t kill: [],\n\t killn: 0,\n\t argument: null,\n\t lastCommand: 0 /* Default */,\n\t };\n\t }\n\t // Component Lifecycle\n\t default_1.prototype.componentDidMount = function () {\n\t if (this.props.autofocus) {\n\t this.focus();\n\t }\n\t };\n\t default_1.prototype.nextWord = function () {\n\t // Find first alphanumeric char after first non-alphanumeric char\n\t var search = /\\W\\w/.exec(this.state.promptText.substring(this.state.point));\n\t if (search) {\n\t return search.index + this.state.point + 1;\n\t }\n\t else {\n\t return this.state.promptText.length;\n\t }\n\t };\n\t default_1.prototype.previousWord = function () {\n\t // Find first non-alphanumeric char after first alphanumeric char in reverse\n\t var search = /\\W\\w(?!.*\\W\\w)/.exec(this.state.promptText.substring(0, this.state.point - 1));\n\t if (search) {\n\t return search.index + 1;\n\t }\n\t else {\n\t return 0;\n\t }\n\t };\n\t default_1.prototype.render = function () {\n\t var _this = this;\n\t return React.createElement(\"div\", {ref: function (ref) { return _this.child.container = ref; }, className: \"react-console-container \" + (this.state.focus ? \"react-console-focus\" : \"react-console-nofocus\"), onClick: this.focus}, this.props.welcomeMessage ?\n\t React.createElement(\"div\", {className: \"react-console-message react-console-welcome\"}, this.props.welcomeMessage)\n\t : null, this.state.log.map(function (val) {\n\t return [\n\t React.createElement(ConsolePrompt, {label: val.label, value: val.command})\n\t ].concat(val.message.map(function (val, idx) {\n\t return React.createElement(ConsoleMessage, {key: idx, type: val.type, value: val.value, isTable: val.isTable});\n\t }));\n\t }), this.state.acceptInput ?\n\t React.createElement(ConsolePrompt, {label: this.state.currLabel, value: this.state.promptText, point: this.state.point, argument: this.state.argument})\n\t : null, React.createElement(\"div\", {style: { overflow: \"hidden\", height: 1, width: 1 }}, React.createElement(\"textarea\", {ref: function (ref) { return _this.child.typer = ref; }, className: \"react-console-typer\", autoComplete: \"off\", autoCorrect: \"off\", autoCapitalize: \"off\", spellCheck: \"false\", style: { outline: \"none\",\n\t color: \"transparent\",\n\t backgroundColor: \"transparent\",\n\t border: \"none\",\n\t resize: \"none\",\n\t overflow: \"hidden\",\n\t }, onBlur: this.blur, onKeyDown: this.keyDown, onChange: this.change, onPaste: this.paste})), React.createElement(\"div\", {ref: function (ref) { return _this.child.focus = ref; }}, \" \"));\n\t };\n\t default_1.defaultProps = {\n\t promptLabel: '> ',\n\t continue: function () { return false; },\n\t cancel: function () { },\n\t };\n\t return default_1;\n\t}(React.Component));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = default_1;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = React;\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// react-console.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 051c9faad82129278752","\"use strict\";\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport './react-console.scss';\n\ninterface ConsolePromptProps {\n\tpoint?: number;\n\tvalue: string;\n\tlabel: string;\n\targument?: string;\n}\nclass ConsolePrompt extends React.Component {\n\tstatic defaultProps: ConsolePromptProps = {\n\t\tpoint: -1,\n\t\tvalue: \"\",\n\t\tlabel: \"> \",\n\t\targument: null,\n\t}\n\tchild: {\n\t\tcursor?: Element;\n\t} = {};\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tthis.idle();\n\t}\n\tcomponentDidUpdate() {\n\t\tthis.idle();\n\t}\n\t// DOM Management\n\tupdateSemaphore: number = 0;\n\tidle() {\n\t\t// Blink cursor when idle\n\t\tif(this.child.cursor) {\n\t\t\tif(this.updateSemaphore == 0) {\n\t\t\t\tthis.child.cursor.className = \"react-console-cursor\";\n\t\t\t}\n\t\t\tthis.updateSemaphore++;\n\t\t\twindow.setTimeout( () => {\n\t\t\t\tthis.updateSemaphore--;\n\t\t\t\tif(this.updateSemaphore == 0 && this.child.cursor) {\n\t\t\t\t\tthis.child.cursor.className = \"react-console-cursor react-console-cursor-idle\";\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\trenderValue() {\n\t\tif(this.props.point < 0) {\n\t\t\treturn [this.props.value];\n\t\t} else if (this.props.point == this.props.value.length) {\n\t\t\treturn [this.props.value, this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\"> ];\n\t\t} else {\n\t\t\treturn [this.props.value.substring(0,this.props.point),\n\t\t\t\t this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\">{this.props.value.substring(this.props.point,this.props.point+1)},\n\t\t\t\tthis.props.value.substring(this.props.point+1)];\n\t\t}\n\t}\n\trender() {\n\t\tlet label = this.props.label;\n\t\tif(this.props.argument) {\n\t\t\tlet idx = label.lastIndexOf(\"\\n\");\n\t\t\tif(idx >= 0) {\n\t\t\t\tlabel = label.substring(0, idx+1);\n\t\t\t} else {\n\t\t\t\tlabel = '';\n\t\t\t}\n\t\t}\n\t\treturn
\n\t\t\t{ label }\n\t\t\t{ this.props.argument }\n\t\t\t{ this.renderValue() }\n\t\t
;\n\t}\n}\n\ninterface ConsoleTableHeaderProps {\n\theaders?: string[];\n}\nlet ConsoleTableHeader: React.SFC = function(props: ConsoleTableHeaderProps){\t\n\tif(props.headers){\n\t\treturn \n\t\t\t\t\t\n\t\t\t\t\t\t{props.headers.map((header: string) => {\n\t\t\t\t\t\t\treturn { header };\n\t\t\t\t\t\t})}\n\t\t\t\t\t\n\t\t\t\t\n\t}\n\treturn null;\n}\n\ninterface ConsoleMessageProps {\n\ttype?: string;\n\tisTable?: boolean;\n\tvalue: any[];\n}\nlet ConsoleMessage: React.SFC = function(props: ConsoleMessageProps) {\n\tif(props.isTable){\n\t\tconst data = props.value[0];\n\t\treturn
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{data.rows && data.rows.map((row: string[], index: number) => {\n\t\t\t\t\t\treturn {row.map((cell: string, cellIndex: number) => { \n\t\t\t\t\t\t\t\treturn ; })\n\t\t\t\t\t\t\t};\n\t\t\t\t\t})}\n\t\t\t\t\n\t\t\t
{cell}
\n\t\t
;\n\t}else{\n\t\treturn
\n\t\t\t{props.value.map((val: any)=>{\n\t\t\t\tif(typeof val == 'string') {\n\t\t\t\t\treturn val;\n\t\t\t\t} else {\n\t\t\t\t\treturn JSON.stringify(val);\n\t\t\t\t}\n\t\t\t}).join(\"\\n\")}\n\t\t
;\n\t}\n}\nConsoleMessage.defaultProps = {\n\ttype: null,\n\tvalue: [],\n\tisTable: false\n}\n\nexport interface ConsoleTableObject {\n\trows: Array;\n\theaders?: Array;\n}\n\nexport interface LogMessage {\n\ttype?: string;\n\tisTable?: boolean;\n\tvalue: any[];\n}\nexport interface LogEntry {\n\tlabel: string;\n\tcommand: string;\n\tmessage: LogMessage[];\n}\n\nexport interface ConsoleProps{\n\thandler: (command: string)=>any;\n\tcancel?: ()=>any;\n\tcomplete?: (words: string[], curr: number, promptText: string)=>string[];\n\tcontinue?: (promptText: string)=>boolean;\n\tautofocus?: boolean;\n\tpromptLabel?: string | (()=>string);\n\twelcomeMessage?: string;\n}\nexport const enum ConsoleCommand {\n\tDefault,\n\tSearch,\n\tKill,\n\tYank,\n};\nexport const enum SearchDirection {\n\tReverse,\n\tForward,\n}\nexport interface ConsoleState{\n\tfocus?: boolean;\n\tacceptInput?: boolean;\n\ttyper?: string;\n\tpoint?: number;\n\tcurrLabel?: string;\n\tpromptText?: string;\n\trestoreText?: string;\n\tsearchText?: string;\n\tsearchDirection?: SearchDirection;\n\tsearchInit?: boolean;\n\tlog?: LogEntry[];\n\thistory?: string[];\n\thistoryn?: number;\n\tkill?: string[];\n\tkilln?: number;\n\targument?: string;\n\tlastCommand?: ConsoleCommand;\n};\nexport default class extends React.Component {\n\tconstructor(props: ConsoleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tfocus: false,\n\t\t\tacceptInput: true,\n\t\t\ttyper: '',\n\t\t\tpoint: 0,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t\tpromptText: '',\n\t\t\trestoreText: '',\n\t\t\tsearchText: '',\n\t\t\tsearchDirection: null,\n\t\t\tsearchInit: false,\n\t\t\tlog: [],\n\t\t\thistory: [],\n\t\t\thistoryn: 0,\n\t\t\tkill: [],\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tstatic defaultProps = {\n\t\tpromptLabel: '> ',\n\t\tcontinue: function() { return false; },\n\t\tcancel: function() {},\n\t};\n\tchild: {\n\t\ttyper?: HTMLTextAreaElement;\n\t\tcontainer?: HTMLElement;\n\t\tfocus?: HTMLElement;\n\t} = {};\n\t// Command API\n\tlog = (...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogX = (type: string, ...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({type: type, value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogTable = (tableData: ConsoleTableObject) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({isTable: true, value: [tableData]});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\treturn = () => {\n\t\tthis.setState({\n\t\t\tacceptInput: true,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t}, this.scrollIfBottom() );\n\t}\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tif(this.props.autofocus) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\t// Event Handlers\n\tfocus = () => {\n\t\tif(!window.getSelection().toString()) {\n\t\t\tthis.child.typer.focus();\n\t\t\tthis.setState({ focus: true }, this.scrollToBottom );\n\t\t}\n\t}\n\tblur = () => {\n\t\tthis.setState({ focus: false });\n\t}\n\tkeyDown = (e: KeyboardEvent) => {\n\t\tinterface keyMap {\n\t\t\t[key: number]: ()=>void\n\t\t}\n\t\tlet keyCodes: keyMap = {\n\t\t\t// return\n\t\t\t13: this.acceptLine,\n\t\t\t// left\n\t\t\t37: this.backwardChar,\n\t\t\t// right\n\t\t\t39: this.forwardChar,\n\t\t\t// up\n\t\t\t38: this.previousHistory,\n\t\t\t// down\n\t\t\t40: this.nextHistory,\n\t\t\t// backspace\n\t\t\t8: this.backwardDeleteChar,\n\t\t\t// delete\n\t\t\t46: this.deleteChar,\n\t\t\t// end\n\t\t\t35: this.endOfLine,\n\t\t\t// start\n\t\t\t36: this.beginningOfLine,\n\t\t\t// tab\n\t\t\t9: this.complete,\n\t\t\t// esc\n\t\t\t27: this.prefixMeta,\n\t\t};\n\t\tvar ctrlCodes: keyMap = {\n\t\t\t// C-a\n\t\t\t65: this.beginningOfLine,\n\t\t\t// C-e\n\t\t\t69: this.endOfLine,\n\t\t\t// C-f\n\t\t\t70: this.forwardChar,\n\t\t\t// C-b\n\t\t\t66: this.backwardChar,\n\t\t\t// C-l\n\t\t\t76: this.clearScreen,\n\t\t\t// C-p\n\t\t\t80: this.previousHistory,\n\t\t\t// C-n\n\t\t\t78: this.nextHistory,\n\t\t\t// C-r\n\t\t\t82: this.reverseSearchHistory,\n\t\t\t// C-s\n\t\t\t83: this.forwardSearchHistory,\n\t\t\t// C-d\n\t\t\t68: this.deleteChar, // TODO EOF\n\t\t\t// C-q TODO\n\t\t\t//81: this.quotedInsert,\n\t\t\t// C-v TODO\n\t\t\t//86: this.quotedInsert,\n\t\t\t// C-t TODO\n\t\t\t//84: this.transposeChars,\n\t\t\t// C-k\n\t\t\t75: this.killLine,\n\t\t\t// C-u\n\t\t\t85: this.backwardKillLine,\n\t\t\t// C-y TODO\n\t\t\t89: this.yank,\n\t\t\t// C-c\n\t\t\t67: this.cancelCommand,\n\t\t\t// C-w TODO\n\t\t\t//87: this.killPreviousWhitespace,\n\t\t\t// C-] TODO\n\t\t\t//221: this.characterSearch,\n\t\t\t// C-x TODO\n\t\t\t//88: this.prefixCtrlX,\n\t\t};\n\t\tvar ctrlXCodes: keyMap = { // TODO state\n\t\t\t// C-x Rubout\n\t\t\t8: this.backwardKillLine,\n\t\t\t// C-x ( TODO\n\t\t\t//57: this.startKbdMacro,\n\t\t\t// C-x ) TODO\n\t\t\t//48: this.endKbdMacro,\n\t\t\t// C-x e TODO\n\t\t\t//69: this.callLastKbdMacro,\n\t\t\t// C-x C-u TODO\n\t\t\t//85: this.undo,\n\t\t\t// C-x C-x TODO\n\t\t\t//88: this.exchangePointAndMark,\n\t\t};\n\t\tvar ctrlShiftCodes: keyMap = {\n\t\t\t// C-_ TODO\n\t\t\t//189: this.undo,\n\t\t\t// C-@ TODO\n\t\t\t//50: this.setMark,\n\t\t};\n\t\tvar metaCodes: keyMap = {\n\t\t\t// M-f\n\t\t\t70: this.forwardWord,\n\t\t\t// M-b\n\t\t\t66: this.backwardWord,\n\t\t\t// M-p\n\t\t\t80: this.nonIncrementalReverseSearchHistory,\n\t\t\t// M-n\n\t\t\t78: this.nonIncrementalForwardSearchHistory,\n\t\t\t// M-.\n\t\t\t190: this.yankLastArg,\n\t\t\t// M-TAB TODO\n\t\t\t//9: this.tabInsert,\n\t\t\t// M-t TODO\n\t\t\t//84: this.transposeWords,\n\t\t\t// M-u TODO\n\t\t\t//85: this.upcaseWord,\n\t\t\t// M-l TODO\n\t\t\t//76: this.downcaseWord,\n\t\t\t// M-c TODO\n\t\t\t//67: this.capitalizeWord,\n\t\t\t// M-d\n\t\t\t68: this.killWord,\n\t\t\t// M-backspace\n\t\t\t8: this.backwardKillWord,\n\t\t\t// M-w TODO\n\t\t\t//87: this.unixWordRubout,\n\t\t\t// M-\\ TODO\n\t\t\t//220: this.deleteHorizontalSpace,\n\t\t\t// M-y\n\t\t\t89: this.yankPop,\n\t\t\t// M-0 TODO\n\t\t\t//48: () => this.digitArgument(0),\n\t\t\t// M-1 TODO\n\t\t\t//49: () => this.digitArgument(1),\n\t\t\t// M-2 TODO\n\t\t\t//50: () => this.digitArgument(2),\n\t\t\t// M-3 TODO\n\t\t\t//51: () => this.digitArgument(3),\n\t\t\t// M-4 TODO\n\t\t\t//52: () => this.digitArgument(4),\n\t\t\t// M-5 TODO\n\t\t\t//53: () => this.digitArgument(5),\n\t\t\t// M-6 TODO\n\t\t\t//54: () => this.digitArgument(6),\n\t\t\t// M-7 TODO\n\t\t\t//55: () => this.digitArgument(7),\n\t\t\t// M-8 TODO\n\t\t\t//56: () => this.digitArgument(8),\n\t\t\t// M-9 TODO\n\t\t\t//57: () => this.digitArgument(9),\n\t\t\t// M-- TODO\n\t\t\t//189: () => this.digitArgument('-'),\n\t\t\t// M-f TODO\n\t\t\t//71: () => this.abort,\n\t\t\t// M-r TODO\n\t\t\t//82: this.revertLine,\n\t\t\t// M-SPACE TODO\n\t\t\t//32: this.setMark,\n\t\t};\n\t\tvar metaShiftCodes: keyMap = { // TODO hook in\n\t\t\t// M-<\n\t\t\t188: this.beginningOfHistory,\n\t\t\t// M->\n\t\t\t190: this.endOfHistory,\n\t\t\t// M-_\n\t\t\t189: this.yankLastArg,\n\t\t\t// M-? TODO\n\t\t\t//191: this.possibleCompletions,\n\t\t\t// M-* TODO\n\t\t\t//56: this.insertCompletions,\n\t\t}\n\t\tvar metaCtrlCodes: keyMap = {\n\t\t\t// M-C-y\n\t\t\t89: this.yankNthArg,\n\t\t\t// M-C-] TODO\n\t\t\t//221: this.characterSearchBackward,\n\t\t\t// M-C-j TODO !!!\n\t\t\t//74: this.viEditingMode,\n\t\t};\n\t\tif(this.state.acceptInput) {\n\t\t\tif (e.altKey) {\n\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\tif (e.keyCode in metaCtrlCodes) {\n\t\t\t\t\t\tmetaCtrlCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.shiftKey) {\n\t\t\t\t\tif (e.keyCode in metaShiftCodes) {\n\t\t\t\t\t\tmetaShiftCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.keyCode in metaCodes) {\n\t\t\t\t\tmetaCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.ctrlKey) {\n\t\t\t\tif (e.keyCode in ctrlCodes) {\n\t\t\t\t\tctrlCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.keyCode in keyCodes) {\n\t\t\t\tkeyCodes[e.keyCode]();\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\tchange = () => {\n\t\tlet idx = 0;\n\t\tfor(;idx < this.state.typer.length && idx < this.child.typer.value.length; idx++) {\n\t\t\tif(this.state.typer[idx] != this.child.typer.value[idx]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlet insert = this.child.typer.value.substring(idx);\n\t\tlet replace = this.state.typer.length - idx;\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText, replace),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert, replace),{\n\t\t\t\t\ttyper: this.child.typer.value,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\tpaste = (e: ClipboardEvent) => {\n\t\tlet insert = e.clipboardData.getData('text');\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert),{\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t\te.preventDefault();\n\t}\n\t// Commands for Moving\n\tbeginningOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tendOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.state.promptText.length,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(-1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.nextWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\t// Commands for Manipulating the History\n\tacceptLine = () => {\n\t\tthis.child.typer.value = \"\";\n\t\tif(this.props.continue(this.state.promptText)) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(\"\\n\"),{\n\t\t\t\t\ttyper: \"\",\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tlet command = this.state.promptText;\n\t\t\tlet history = this.state.history;\n\t\t\tlet log = this.state.log;\n\t\t\tif(!history || history[history.length-1] != command) {\n\t\t\t\thistory.push(command);\n\t\t\t}\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: command,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\tacceptInput: false,\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistory: history,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, () => {\n\t\t\t\tthis.scrollToBottom();\n\t\t\t\tif(this.props.handler) {\n\t\t\t\t\tthis.props.handler(command)\n\t\t\t\t} else {\n\t\t\t\t\tthis.return();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tpreviousHistory = () => {\n\t\tthis.rotateHistory(-1);\n\t}\n\tnextHistory = () => {\n\t\tthis.rotateHistory(1);\n\t}\n\tbeginningOfHistory = () => {\n\t\tthis.rotateHistory(-this.state.history.length);\n\t}\n\tendOfHistory = () => {\n\t\tthis.rotateHistory(this.state.history.length);\n\t}\n\ttriggerSearch = () => {\n\t\tif(this.state.searchDirection == SearchDirection.Reverse) {\n\t\t\tthis.reverseSearchHistory();\n\t\t} else {\n\t\t\tthis.forwardSearchHistory();\n\t\t}\n\t}\n\treverseSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Reverse, true),{\n\t\t\t\t\targument: `(reverse-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Reverse,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(reverse-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tforwardSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Forward, true),{\n\t\t\t\t\targument: `(forward-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Forward,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(forward-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tclearScreen = () => {\n\t\tthis.setState({ log: [] });\n\t}\n\tnonIncrementalReverseSearchHistory = () => {\n\t\t// TODO\n\t}\n\tnonIncrementalForwardSearchHistory = () => {\n\t\t// TODO\n\t}\n\thistorySearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySearchForward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchForward = () => {\n\t\t// TODO\n\t}\n\tyankNthArg = () => {\n\t\t// TODO\n\t}\n\tyankLastArg = () => {\n\t\t// TODO\n\t}\n\t// Commands for Changing Text\n\tdeleteChar = () => {\n\t\tif(this.state.point < this.state.promptText.length) {\n\t\t\tthis.setState({\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point+1),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tbackwardDeleteChar = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchText.substring(0,this.state.searchText.length-1),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else if(this.state.point > 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.movePoint(-1),\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point-1)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\t// Killing and Yanking\n\tkillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(0,this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWholeLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText);\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: '',\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point,this.nextWord());\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point,this.nextWord()));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ this.state.promptText.substring(this.nextWord()),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(this.previousWord(),this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.previousWord(),this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\tpromptText: this.state.promptText.substring(0,this.previousWord())\n\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tyank = () => {\n\t\tthis.setState(Object.assign(\n\t\t\tthis.consoleInsert(this.state.kill[this.state.killn]),{\n\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t}), this.scrollToBottom\n\t\t);\n\t}\n\tyankPop = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Yank) {\n\t\t\tlet killn = this.rotateRing(1, this.state.killn, this.state.kill.length);\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(this.state.kill[killn], this.state.kill[this.state.killn].length),{\n\t\t\t\t\tkilln: killn,\n\t\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\t// Numeric Arguments\n\t// Completing\n\tcomplete = () => {\n\t\tif(this.props.complete) {\n\t\t\t// Split text and find current word\n\t\t\tlet words = this.state.promptText.split(\" \");\n\t\t\tlet curr = 0;\n\t\t\tlet idx = words[0].length;\n\t\t\twhile(idx < this.state.point && curr + 1 < words.length) {\n\t\t\t\tidx += words[++curr].length + 1;\n\t\t\t}\n\n\t\t\tlet completions = this.props.complete(words, curr, this.state.promptText);\n\t\t\tif(completions.length == 1) {\n\t\t\t\t// Perform completion\n\t\t\t\twords[curr] = completions[0];\n\t\t\t\tlet point = -1;\n\t\t\t\tfor(let i = 0; i <= curr; i++) {\n\t\t\t\t\tpoint += words[i].length + 1;\n\t\t\t\t}\n\t\t\t\tthis.setState({\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: words.join(\" \"),\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t} else if (completions.length > 1) {\n\t\t\t\t// show completions\n\t\t\t\tlet log = this.state.log;\n\t\t\t\tlog.push({\n\t\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\t\tcommand: this.state.promptText,\n\t\t\t\t\tmessage: [{\n\t\t\t\t\t\ttype: \"completion\",\n\t\t\t\t\t\tvalue: [completions.join(\"\\t\")],\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tthis.setState({\n\t\t\t\t\tcurrLabel: this.nextLabel(),\n\t\t\t\t\tlog: log,\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t}\n\t\t}\n\t}\n\t// Keyboard Macros\n\t// Miscellaneous\n\tprefixMeta = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t});\n\t\t}\n\t\t// TODO Meta prefixed state\n\t}\n\tcancelCommand = () => {\n\t\tif(this.state.acceptInput) { // Typing command\n\t\t\tthis.child.typer.value = \"\";\n\t\t\tlet log = this.state.log;\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: this.state.promptText,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t} else { // command is executing, call handler\n\t\t\tthis.props.cancel();\n\t\t}\n\t}\n\t// Helper functions\n\ttextInsert = (insert: string, text: string, replace: number = 0, point: number = text.length): string => {\n\t\treturn text.substring(0, point - replace) + insert + text.substring(point);\n\t}\n\tconsoleInsert = (insert: string, replace: number = 0): ConsoleState => {\n\t\tlet promptText = this.textInsert(insert, this.state.promptText, replace, this.state.point);\n\t\treturn {\n\t\t\tpoint: this.movePoint(insert.length - replace, insert.length - replace + this.state.promptText.length),\n\t\t\tpromptText: promptText,\n\t\t\trestoreText: promptText,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tmovePoint = (n: number, max: number = this.state.promptText.length) => {\n\t\tlet pos = this.state.point + n;\n\t\tif (pos < 0) {\n\t\t\treturn 0;\n\t\t} if (pos > max) {\n\t\t\treturn max;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}\n\tnextWord(): number {\n\t\t// Find first alphanumeric char after first non-alphanumeric char\n\t\tlet search = /\\W\\w/.exec(this.state.promptText.substring(this.state.point));\n\t\tif(search) {\n\t\t\treturn search.index + this.state.point + 1;\n\t\t} else {\n\t\t\treturn this.state.promptText.length;\n\t\t}\n\t}\n\tpreviousWord(): number {\n\t\t// Find first non-alphanumeric char after first alphanumeric char in reverse\n\t\tlet search = /\\W\\w(?!.*\\W\\w)/.exec(this.state.promptText.substring(0,this.state.point-1));\n\t\tif(search) {\n\t\t\treturn search.index + 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\trotateRing = (n: number, ringn: number, ring: number, circular: boolean = true): number => {\n\t\tif(ring == 0) return 0;\n\t\tif(circular) {\n\t\t\treturn (ring + (ringn + n) % ring) % ring;\n\t\t} else {\n\t\t\tringn = ringn - n;\n\t\t\tif(ringn < 0) {\n\t\t\t\treturn 0;\n\t\t\t} else if (ringn >= ring) {\n\t\t\t\treturn ring;\n\t\t\t} else {\n\t\t\t\treturn ringn;\n\t\t\t}\n\t\t}\n\t}\n\trotateHistory = (n: number) => {\n\t\tlet historyn = this.rotateRing(n, this.state.historyn, this.state.history.length, false);\n\t\tif(historyn == 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.state.restoreText.length,\n\t\t\t\tpromptText: this.state.restoreText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t} else {\n\t\t\tlet promptText = this.state.history[this.state.history.length-historyn];\n\t\t\tthis.setState({\n\t\t\t\tpoint: promptText.length,\n\t\t\t\tpromptText: promptText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t}\n\t}\n\tsearchHistory = (direction: SearchDirection = this.state.searchDirection, next: boolean = false): ConsoleState => {\n\t\tlet idx = this.state.historyn;\n\t\tlet inc = (direction == SearchDirection.Reverse)?1:-1;\n\t\tif(next) {\n\t\t\tidx = idx + inc;\n\t\t}\n\t\tfor(;idx > 0 && idx <= this.state.history.length; idx = idx + inc) {\n\t\t\tlet entry = this.state.history[this.state.history.length-idx];\n\t\t\tlet point = entry.indexOf(this.state.searchText);\n\t\t\tif(point > -1) {\n\t\t\t\treturn {\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: entry,\n\t\t\t\t\tsearchDirection: direction,\n\t\t\t\t\tsearchInit: false,\n\t\t\t\t\thistoryn: idx,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tsearchDirection: direction,\n\t\t\tsearchInit: false,\n\t\t};\n\t}\n\t// DOM management\n\tscrollSemaphore = 0;\n\tscrollIfBottom = () => {\n\t\tif(this.scrollSemaphore > 0 || this.child.container.scrollTop == this.child.container.scrollHeight - this.child.container.offsetHeight) {\n\t\t\tthis.scrollSemaphore++;\n\t\t\treturn this.scrollIfBottomTrue;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tscrollIfBottomTrue = () => {\n\t\tthis.scrollToBottom();\n\t\tthis.scrollSemaphore--;\n\t}\n\tscrollToBottom = () => {\n\t\tthis.child.container.scrollTop = this.child.container.scrollHeight;\n\t\tlet rect = this.child.focus.getBoundingClientRect();\n\t\tif(rect.top < 0 || rect.left < 0 ||\n\t\t\trect.bottom > (window.innerHeight || document.documentElement.clientHeight) ||\n\t\t\trect.right > (window.innerWidth || document.documentElement.clientWidth)\n\t\t) { this.child.typer.scrollIntoView(false); }\n\t}\n\tnextLabel = () => {\n\t\tif(typeof this.props.promptLabel === \"string\") {\n\t\t\treturn this.props.promptLabel as string;\n\t\t} else {\n\t\t\treturn (this.props.promptLabel as ()=>string)();\n\t\t}\n\t}\n\trender() {\n\t\treturn
this.child.container = ref}\n\t\t\t\tclassName={\"react-console-container \" + (this.state.focus?\"react-console-focus\":\"react-console-nofocus\")}\n\t\t\t\tonClick={this.focus}\n\t\t\t>\n\t\t\t{this.props.welcomeMessage?\n\t\t\t\t
\n\t\t\t\t\t{this.props.welcomeMessage}\n\t\t\t\t
\n\t\t\t\t: null\n\t\t\t}\n\t\t\t{this.state.log.map( (val: LogEntry) => {\n\t\t\t\treturn [\n\t\t\t\t\t,\n\t\t\t\t\t...val.message.map( (val: LogMessage, idx: number) => {\n\t\t\t\t\t\treturn ;\n\t\t\t\t\t})\n\t\t\t\t];\n\t\t\t})}\n\t\t\t{this.state.acceptInput?\n\t\t\t\t\n\t\t\t\t: null\n\t\t\t}\n\t\t\t
\n\t\t\t\t this.child.typer = ref}\n\t\t\t\t\tclassName=\"react-console-typer\"\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tautoCorrect=\"off\"\n\t\t\t\t\tautoCapitalize=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\tstyle={{ outline: \"none\",\n\t\t\t\t\t\tcolor: \"transparent\",\n\t\t\t\t\t\tbackgroundColor: \"transparent\",\n\t\t\t\t\t\tborder: \"none\",\n\t\t\t\t\t\tresize: \"none\",\n\t\t\t\t\t\toverflow: \"hidden\",\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={this.blur}\n\t\t\t\t\tonKeyDown={this.keyDown}\n\t\t\t\t\tonChange={this.change}\n\t\t\t\t\tonPaste={this.paste}\n\t\t\t\t>\n\t\t\t
\n\t\t\t
this.child.focus = ref}> 
\n\t\t
;\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react-console.tsx","module.exports = React;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"React\"\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/dist.tar.gz b/dist/dist.tar.gz index 6e2496a..7b32ba4 100644 Binary files a/dist/dist.tar.gz and b/dist/dist.tar.gz differ diff --git a/dist/dist.zip b/dist/dist.zip index d965605..40492df 100644 Binary files a/dist/dist.zip and b/dist/dist.zip differ diff --git a/dist/dist/react-console.js b/dist/dist/react-console.js index eadd933..4971fa3 100644 --- a/dist/dist/react-console.js +++ b/dist/dist/react-console.js @@ -119,19 +119,38 @@ var Console = }; return ConsolePrompt; }(React.Component)); + var ConsoleTableHeader = function (props) { + if (props.headers) { + return React.createElement("thead", null, React.createElement("tr", null, props.headers.map(function (header) { + return React.createElement("th", {scope: "col", key: header}, header); + }))); + } + return null; + }; var ConsoleMessage = function (props) { - return React.createElement("div", {className: "react-console-message" + (props.type ? " react-console-message-" + props.type : "")}, props.value.map(function (val) { - if (typeof val == 'string') { - return val; - } - else { - return JSON.stringify(val); - } - }).join("\n")); + if (props.isTable) { + var data = props.value[0]; + return React.createElement("div", {className: "react-console-message react-console-table"}, React.createElement("table", null, React.createElement(ConsoleTableHeader, {headers: data.headers}), React.createElement("tbody", null, data.rows && data.rows.map(function (row, index) { + return React.createElement("tr", {key: index}, row.map(function (cell, cellIndex) { + return React.createElement("td", {key: cellIndex}, cell); + })); + })))); + } + else { + return React.createElement("div", {className: "react-console-message" + (props.type ? " react-console-message-" + props.type : "")}, props.value.map(function (val) { + if (typeof val == 'string') { + return val; + } + else { + return JSON.stringify(val); + } + }).join("\n")); + } }; ConsoleMessage.defaultProps = { type: null, value: [], + isTable: false }; ; ; @@ -164,6 +183,13 @@ var Console = log: log, }, _this.scrollIfBottom()); }; + this.logTable = function (tableData) { + var log = _this.state.log; + log[_this.state.log.length - 1].message.push({ isTable: true, value: [tableData] }); + _this.setState({ + log: log, + }, _this.scrollIfBottom()); + }; this.return = function () { _this.setState({ acceptInput: true, @@ -919,7 +945,7 @@ var Console = return [ React.createElement(ConsolePrompt, {label: val.label, value: val.command}) ].concat(val.message.map(function (val, idx) { - return React.createElement(ConsoleMessage, {key: idx, type: val.type, value: val.value}); + return React.createElement(ConsoleMessage, {key: idx, type: val.type, value: val.value, isTable: val.isTable}); })); }), this.state.acceptInput ? React.createElement(ConsolePrompt, {label: this.state.currLabel, value: this.state.promptText, point: this.state.point, argument: this.state.argument}) diff --git a/dist/dist/react-console.js.map b/dist/dist/react-console.js.map index 562f39e..b530995 100644 --- a/dist/dist/react-console.js.map +++ b/dist/dist/react-console.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap dbe28ddacabc3ba712cc","webpack:///./react-console.tsx","webpack:///external \"React\"","webpack:///./react-console.scss"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,aAAY,CAAC;;;;;;AAEb,KAAY,KAAK,uBAAM,CAAO,CAAC;AAE/B,qBAAO,CAAsB,CA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G,EAAtB,CAAuB,OAAa,CAChD,CAAC;KACR,CAAC;KAx0BM,sBAAY,GAAG;SACrB,WAAW,EAAE,IAAI;SACjB,QAAQ,EAAE,cAAa,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SACtC,MAAM,EAAE,cAAY,CAAC;MACrB,CAAC;KAq0BH,gBAAC;AAAD,EAAC,CAh2B4B,KAAK,CAAC,SAAS,GAg2B3C;AAh2BD;4BAg2BC;;;;;;;AC/+BD,wB;;;;;;ACAA,0C","file":"react-console.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap dbe28ddacabc3ba712cc","\"use strict\";\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport './react-console.scss';\n\ninterface ConsolePromptProps {\n\tpoint?: number;\n\tvalue: string;\n\tlabel: string;\n\targument?: string;\n}\nclass ConsolePrompt extends React.Component {\n\tstatic defaultProps: ConsolePromptProps = {\n\t\tpoint: -1,\n\t\tvalue: \"\",\n\t\tlabel: \"> \",\n\t\targument: null,\n\t}\n\tchild: {\n\t\tcursor?: Element;\n\t} = {};\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tthis.idle();\n\t}\n\tcomponentDidUpdate() {\n\t\tthis.idle();\n\t}\n\t// DOM Management\n\tupdateSemaphore: number = 0;\n\tidle() {\n\t\t// Blink cursor when idle\n\t\tif(this.child.cursor) {\n\t\t\tif(this.updateSemaphore == 0) {\n\t\t\t\tthis.child.cursor.className = \"react-console-cursor\";\n\t\t\t}\n\t\t\tthis.updateSemaphore++;\n\t\t\twindow.setTimeout( () => {\n\t\t\t\tthis.updateSemaphore--;\n\t\t\t\tif(this.updateSemaphore == 0 && this.child.cursor) {\n\t\t\t\t\tthis.child.cursor.className = \"react-console-cursor react-console-cursor-idle\";\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\trenderValue() {\n\t\tif(this.props.point < 0) {\n\t\t\treturn [this.props.value];\n\t\t} else if (this.props.point == this.props.value.length) {\n\t\t\treturn [this.props.value, this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\"> ];\n\t\t} else {\n\t\t\treturn [this.props.value.substring(0,this.props.point),\n\t\t\t\t this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\">{this.props.value.substring(this.props.point,this.props.point+1)},\n\t\t\t\tthis.props.value.substring(this.props.point+1)];\n\t\t}\n\t}\n\trender() {\n\t\tlet label = this.props.label;\n\t\tif(this.props.argument) {\n\t\t\tlet idx = label.lastIndexOf(\"\\n\");\n\t\t\tif(idx >= 0) {\n\t\t\t\tlabel = label.substring(0, idx+1);\n\t\t\t} else {\n\t\t\t\tlabel = '';\n\t\t\t}\n\t\t}\n\t\treturn
\n\t\t\t{ label }\n\t\t\t{ this.props.argument }\n\t\t\t{ this.renderValue() }\n\t\t
;\n\t}\n}\n\ninterface ConsoleMessageProps {\n\ttype?: string;\n\tvalue: any[];\n}\nlet ConsoleMessage: React.SFC = function(props: ConsoleMessageProps) {\n\treturn
\n\t\t{props.value.map((val: any)=>{\n\t\t\tif(typeof val == 'string') {\n\t\t\t\treturn val;\n\t\t\t} else {\n\t\t\t\treturn JSON.stringify(val);\n\t\t\t}\n\t\t}).join(\"\\n\")}\n\t
;\n}\nConsoleMessage.defaultProps = {\n\ttype: null,\n\tvalue: [],\n}\n\nexport interface LogMessage {\n\ttype?: string;\n\tvalue: any[];\n}\nexport interface LogEntry {\n\tlabel: string;\n\tcommand: string;\n\tmessage: LogMessage[];\n}\n\nexport interface ConsoleProps{\n\thandler: (command: string)=>any;\n\tcancel?: ()=>any;\n\tcomplete?: (words: string[], curr: number, promptText: string)=>string[];\n\tcontinue?: (promptText: string)=>boolean;\n\tautofocus?: boolean;\n\tpromptLabel?: string | (()=>string);\n\twelcomeMessage?: string;\n}\nexport const enum ConsoleCommand {\n\tDefault,\n\tSearch,\n\tKill,\n\tYank,\n};\nexport const enum SearchDirection {\n\tReverse,\n\tForward,\n}\nexport interface ConsoleState{\n\tfocus?: boolean;\n\tacceptInput?: boolean;\n\ttyper?: string;\n\tpoint?: number;\n\tcurrLabel?: string;\n\tpromptText?: string;\n\trestoreText?: string;\n\tsearchText?: string;\n\tsearchDirection?: SearchDirection;\n\tsearchInit?: boolean;\n\tlog?: LogEntry[];\n\thistory?: string[];\n\thistoryn?: number;\n\tkill?: string[];\n\tkilln?: number;\n\targument?: string;\n\tlastCommand?: ConsoleCommand;\n};\nexport default class extends React.Component {\n\tconstructor(props: ConsoleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tfocus: false,\n\t\t\tacceptInput: true,\n\t\t\ttyper: '',\n\t\t\tpoint: 0,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t\tpromptText: '',\n\t\t\trestoreText: '',\n\t\t\tsearchText: '',\n\t\t\tsearchDirection: null,\n\t\t\tsearchInit: false,\n\t\t\tlog: [],\n\t\t\thistory: [],\n\t\t\thistoryn: 0,\n\t\t\tkill: [],\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tstatic defaultProps = {\n\t\tpromptLabel: '> ',\n\t\tcontinue: function() { return false; },\n\t\tcancel: function() {},\n\t};\n\tchild: {\n\t\ttyper?: HTMLTextAreaElement;\n\t\tcontainer?: HTMLElement;\n\t\tfocus?: HTMLElement;\n\t} = {};\n\t// Command API\n\tlog = (...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogX = (type: string, ...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({type: type, value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\treturn = () => {\n\t\tthis.setState({\n\t\t\tacceptInput: true,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t}, this.scrollIfBottom() );\n\t}\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tif(this.props.autofocus) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\t// Event Handlers\n\tfocus = () => {\n\t\tif(!window.getSelection().toString()) {\n\t\t\tthis.child.typer.focus();\n\t\t\tthis.setState({ focus: true }, this.scrollToBottom );\n\t\t}\n\t}\n\tblur = () => {\n\t\tthis.setState({ focus: false });\n\t}\n\tkeyDown = (e: KeyboardEvent) => {\n\t\tinterface keyMap {\n\t\t\t[key: number]: ()=>void\n\t\t}\n\t\tlet keyCodes: keyMap = {\n\t\t\t// return\n\t\t\t13: this.acceptLine,\n\t\t\t// left\n\t\t\t37: this.backwardChar,\n\t\t\t// right\n\t\t\t39: this.forwardChar,\n\t\t\t// up\n\t\t\t38: this.previousHistory,\n\t\t\t// down\n\t\t\t40: this.nextHistory,\n\t\t\t// backspace\n\t\t\t8: this.backwardDeleteChar,\n\t\t\t// delete\n\t\t\t46: this.deleteChar,\n\t\t\t// end\n\t\t\t35: this.endOfLine,\n\t\t\t// start\n\t\t\t36: this.beginningOfLine,\n\t\t\t// tab\n\t\t\t9: this.complete,\n\t\t\t// esc\n\t\t\t27: this.prefixMeta,\n\t\t};\n\t\tvar ctrlCodes: keyMap = {\n\t\t\t// C-a\n\t\t\t65: this.beginningOfLine,\n\t\t\t// C-e\n\t\t\t69: this.endOfLine,\n\t\t\t// C-f\n\t\t\t70: this.forwardChar,\n\t\t\t// C-b\n\t\t\t66: this.backwardChar,\n\t\t\t// C-l\n\t\t\t76: this.clearScreen,\n\t\t\t// C-p\n\t\t\t80: this.previousHistory,\n\t\t\t// C-n\n\t\t\t78: this.nextHistory,\n\t\t\t// C-r\n\t\t\t82: this.reverseSearchHistory,\n\t\t\t// C-s\n\t\t\t83: this.forwardSearchHistory,\n\t\t\t// C-d\n\t\t\t68: this.deleteChar, // TODO EOF\n\t\t\t// C-q TODO\n\t\t\t//81: this.quotedInsert,\n\t\t\t// C-v TODO\n\t\t\t//86: this.quotedInsert,\n\t\t\t// C-t TODO\n\t\t\t//84: this.transposeChars,\n\t\t\t// C-k\n\t\t\t75: this.killLine,\n\t\t\t// C-u\n\t\t\t85: this.backwardKillLine,\n\t\t\t// C-y TODO\n\t\t\t89: this.yank,\n\t\t\t// C-c\n\t\t\t67: this.cancelCommand,\n\t\t\t// C-w TODO\n\t\t\t//87: this.killPreviousWhitespace,\n\t\t\t// C-] TODO\n\t\t\t//221: this.characterSearch,\n\t\t\t// C-x TODO\n\t\t\t//88: this.prefixCtrlX,\n\t\t};\n\t\tvar ctrlXCodes: keyMap = { // TODO state\n\t\t\t// C-x Rubout\n\t\t\t8: this.backwardKillLine,\n\t\t\t// C-x ( TODO\n\t\t\t//57: this.startKbdMacro,\n\t\t\t// C-x ) TODO\n\t\t\t//48: this.endKbdMacro,\n\t\t\t// C-x e TODO\n\t\t\t//69: this.callLastKbdMacro,\n\t\t\t// C-x C-u TODO\n\t\t\t//85: this.undo,\n\t\t\t// C-x C-x TODO\n\t\t\t//88: this.exchangePointAndMark,\n\t\t};\n\t\tvar ctrlShiftCodes: keyMap = {\n\t\t\t// C-_ TODO\n\t\t\t//189: this.undo,\n\t\t\t// C-@ TODO\n\t\t\t//50: this.setMark,\n\t\t};\n\t\tvar metaCodes: keyMap = {\n\t\t\t// M-f\n\t\t\t70: this.forwardWord,\n\t\t\t// M-b\n\t\t\t66: this.backwardWord,\n\t\t\t// M-p\n\t\t\t80: this.nonIncrementalReverseSearchHistory,\n\t\t\t// M-n\n\t\t\t78: this.nonIncrementalForwardSearchHistory,\n\t\t\t// M-.\n\t\t\t190: this.yankLastArg,\n\t\t\t// M-TAB TODO\n\t\t\t//9: this.tabInsert,\n\t\t\t// M-t TODO\n\t\t\t//84: this.transposeWords,\n\t\t\t// M-u TODO\n\t\t\t//85: this.upcaseWord,\n\t\t\t// M-l TODO\n\t\t\t//76: this.downcaseWord,\n\t\t\t// M-c TODO\n\t\t\t//67: this.capitalizeWord,\n\t\t\t// M-d\n\t\t\t68: this.killWord,\n\t\t\t// M-backspace\n\t\t\t8: this.backwardKillWord,\n\t\t\t// M-w TODO\n\t\t\t//87: this.unixWordRubout,\n\t\t\t// M-\\ TODO\n\t\t\t//220: this.deleteHorizontalSpace,\n\t\t\t// M-y\n\t\t\t89: this.yankPop,\n\t\t\t// M-0 TODO\n\t\t\t//48: () => this.digitArgument(0),\n\t\t\t// M-1 TODO\n\t\t\t//49: () => this.digitArgument(1),\n\t\t\t// M-2 TODO\n\t\t\t//50: () => this.digitArgument(2),\n\t\t\t// M-3 TODO\n\t\t\t//51: () => this.digitArgument(3),\n\t\t\t// M-4 TODO\n\t\t\t//52: () => this.digitArgument(4),\n\t\t\t// M-5 TODO\n\t\t\t//53: () => this.digitArgument(5),\n\t\t\t// M-6 TODO\n\t\t\t//54: () => this.digitArgument(6),\n\t\t\t// M-7 TODO\n\t\t\t//55: () => this.digitArgument(7),\n\t\t\t// M-8 TODO\n\t\t\t//56: () => this.digitArgument(8),\n\t\t\t// M-9 TODO\n\t\t\t//57: () => this.digitArgument(9),\n\t\t\t// M-- TODO\n\t\t\t//189: () => this.digitArgument('-'),\n\t\t\t// M-f TODO\n\t\t\t//71: () => this.abort,\n\t\t\t// M-r TODO\n\t\t\t//82: this.revertLine,\n\t\t\t// M-SPACE TODO\n\t\t\t//32: this.setMark,\n\t\t};\n\t\tvar metaShiftCodes: keyMap = { // TODO hook in\n\t\t\t// M-<\n\t\t\t188: this.beginningOfHistory,\n\t\t\t// M->\n\t\t\t190: this.endOfHistory,\n\t\t\t// M-_\n\t\t\t189: this.yankLastArg,\n\t\t\t// M-? TODO\n\t\t\t//191: this.possibleCompletions,\n\t\t\t// M-* TODO\n\t\t\t//56: this.insertCompletions,\n\t\t}\n\t\tvar metaCtrlCodes: keyMap = {\n\t\t\t// M-C-y\n\t\t\t89: this.yankNthArg,\n\t\t\t// M-C-] TODO\n\t\t\t//221: this.characterSearchBackward,\n\t\t\t// M-C-j TODO !!!\n\t\t\t//74: this.viEditingMode,\n\t\t};\n\t\tif(this.state.acceptInput) {\n\t\t\tif (e.altKey) {\n\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\tif (e.keyCode in metaCtrlCodes) {\n\t\t\t\t\t\tmetaCtrlCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.shiftKey) {\n\t\t\t\t\tif (e.keyCode in metaShiftCodes) {\n\t\t\t\t\t\tmetaShiftCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.keyCode in metaCodes) {\n\t\t\t\t\tmetaCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.ctrlKey) {\n\t\t\t\tif (e.keyCode in ctrlCodes) {\n\t\t\t\t\tctrlCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.keyCode in keyCodes) {\n\t\t\t\tkeyCodes[e.keyCode]();\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\tchange = () => {\n\t\tlet idx = 0;\n\t\tfor(;idx < this.state.typer.length && idx < this.child.typer.value.length; idx++) {\n\t\t\tif(this.state.typer[idx] != this.child.typer.value[idx]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlet insert = this.child.typer.value.substring(idx);\n\t\tlet replace = this.state.typer.length - idx;\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText, replace),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert, replace),{\n\t\t\t\t\ttyper: this.child.typer.value,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\tpaste = (e: ClipboardEvent) => {\n\t\tlet insert = e.clipboardData.getData('text');\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert),{\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t\te.preventDefault();\n\t}\n\t// Commands for Moving\n\tbeginningOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tendOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.state.promptText.length,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(-1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.nextWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\t// Commands for Manipulating the History\n\tacceptLine = () => {\n\t\tthis.child.typer.value = \"\";\n\t\tif(this.props.continue(this.state.promptText)) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(\"\\n\"),{\n\t\t\t\t\ttyper: \"\",\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tlet command = this.state.promptText;\n\t\t\tlet history = this.state.history;\n\t\t\tlet log = this.state.log;\n\t\t\tif(!history || history[history.length-1] != command) {\n\t\t\t\thistory.push(command);\n\t\t\t}\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: command,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\tacceptInput: false,\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistory: history,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, () => {\n\t\t\t\tthis.scrollToBottom();\n\t\t\t\tif(this.props.handler) {\n\t\t\t\t\tthis.props.handler(command)\n\t\t\t\t} else {\n\t\t\t\t\tthis.return();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tpreviousHistory = () => {\n\t\tthis.rotateHistory(-1);\n\t}\n\tnextHistory = () => {\n\t\tthis.rotateHistory(1);\n\t}\n\tbeginningOfHistory = () => {\n\t\tthis.rotateHistory(-this.state.history.length);\n\t}\n\tendOfHistory = () => {\n\t\tthis.rotateHistory(this.state.history.length);\n\t}\n\ttriggerSearch = () => {\n\t\tif(this.state.searchDirection == SearchDirection.Reverse) {\n\t\t\tthis.reverseSearchHistory();\n\t\t} else {\n\t\t\tthis.forwardSearchHistory();\n\t\t}\n\t}\n\treverseSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Reverse, true),{\n\t\t\t\t\targument: `(reverse-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Reverse,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(reverse-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tforwardSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Forward, true),{\n\t\t\t\t\targument: `(forward-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Forward,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(forward-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tclearScreen = () => {\n\t\tthis.setState({ log: [] });\n\t}\n\tnonIncrementalReverseSearchHistory = () => {\n\t\t// TODO\n\t}\n\tnonIncrementalForwardSearchHistory = () => {\n\t\t// TODO\n\t}\n\thistorySearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySearchForward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchForward = () => {\n\t\t// TODO\n\t}\n\tyankNthArg = () => {\n\t\t// TODO\n\t}\n\tyankLastArg = () => {\n\t\t// TODO\n\t}\n\t// Commands for Changing Text\n\tdeleteChar = () => {\n\t\tif(this.state.point < this.state.promptText.length) {\n\t\t\tthis.setState({\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point+1),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tbackwardDeleteChar = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchText.substring(0,this.state.searchText.length-1),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else if(this.state.point > 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.movePoint(-1),\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point-1)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\t// Killing and Yanking\n\tkillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(0,this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWholeLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText);\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: '',\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point,this.nextWord());\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point,this.nextWord()));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ this.state.promptText.substring(this.nextWord()),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(this.previousWord(),this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.previousWord(),this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\tpromptText: this.state.promptText.substring(0,this.previousWord())\n\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tyank = () => {\n\t\tthis.setState(Object.assign(\n\t\t\tthis.consoleInsert(this.state.kill[this.state.killn]),{\n\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t}), this.scrollToBottom\n\t\t);\n\t}\n\tyankPop = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Yank) {\n\t\t\tlet killn = this.rotateRing(1, this.state.killn, this.state.kill.length);\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(this.state.kill[killn], this.state.kill[this.state.killn].length),{\n\t\t\t\t\tkilln: killn,\n\t\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\t// Numeric Arguments\n\t// Completing\n\tcomplete = () => {\n\t\tif(this.props.complete) {\n\t\t\t// Split text and find current word\n\t\t\tlet words = this.state.promptText.split(\" \");\n\t\t\tlet curr = 0;\n\t\t\tlet idx = words[0].length;\n\t\t\twhile(idx < this.state.point && curr + 1 < words.length) {\n\t\t\t\tidx += words[++curr].length + 1;\n\t\t\t}\n\n\t\t\tlet completions = this.props.complete(words, curr, this.state.promptText);\n\t\t\tif(completions.length == 1) {\n\t\t\t\t// Perform completion\n\t\t\t\twords[curr] = completions[0];\n\t\t\t\tlet point = -1;\n\t\t\t\tfor(let i = 0; i <= curr; i++) {\n\t\t\t\t\tpoint += words[i].length + 1;\n\t\t\t\t}\n\t\t\t\tthis.setState({\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: words.join(\" \"),\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t} else if (completions.length > 1) {\n\t\t\t\t// show completions\n\t\t\t\tlet log = this.state.log;\n\t\t\t\tlog.push({\n\t\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\t\tcommand: this.state.promptText,\n\t\t\t\t\tmessage: [{\n\t\t\t\t\t\ttype: \"completion\",\n\t\t\t\t\t\tvalue: [completions.join(\"\\t\")],\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tthis.setState({\n\t\t\t\t\tcurrLabel: this.nextLabel(),\n\t\t\t\t\tlog: log,\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t}\n\t\t}\n\t}\n\t// Keyboard Macros\n\t// Miscellaneous\n\tprefixMeta = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t});\n\t\t}\n\t\t// TODO Meta prefixed state\n\t}\n\tcancelCommand = () => {\n\t\tif(this.state.acceptInput) { // Typing command\n\t\t\tthis.child.typer.value = \"\";\n\t\t\tlet log = this.state.log;\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: this.state.promptText,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t} else { // command is executing, call handler\n\t\t\tthis.props.cancel();\n\t\t}\n\t}\n\t// Helper functions\n\ttextInsert = (insert: string, text: string, replace: number = 0, point: number = text.length): string => {\n\t\treturn text.substring(0, point - replace) + insert + text.substring(point);\n\t}\n\tconsoleInsert = (insert: string, replace: number = 0): ConsoleState => {\n\t\tlet promptText = this.textInsert(insert, this.state.promptText, replace, this.state.point);\n\t\treturn {\n\t\t\tpoint: this.movePoint(insert.length - replace, insert.length - replace + this.state.promptText.length),\n\t\t\tpromptText: promptText,\n\t\t\trestoreText: promptText,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tmovePoint = (n: number, max: number = this.state.promptText.length) => {\n\t\tlet pos = this.state.point + n;\n\t\tif (pos < 0) {\n\t\t\treturn 0;\n\t\t} if (pos > max) {\n\t\t\treturn max;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}\n\tnextWord(): number {\n\t\t// Find first alphanumeric char after first non-alphanumeric char\n\t\tlet search = /\\W\\w/.exec(this.state.promptText.substring(this.state.point));\n\t\tif(search) {\n\t\t\treturn search.index + this.state.point + 1;\n\t\t} else {\n\t\t\treturn this.state.promptText.length;\n\t\t}\n\t}\n\tpreviousWord(): number {\n\t\t// Find first non-alphanumeric char after first alphanumeric char in reverse\n\t\tlet search = /\\W\\w(?!.*\\W\\w)/.exec(this.state.promptText.substring(0,this.state.point-1));\n\t\tif(search) {\n\t\t\treturn search.index + 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\trotateRing = (n: number, ringn: number, ring: number, circular: boolean = true): number => {\n\t\tif(ring == 0) return 0;\n\t\tif(circular) {\n\t\t\treturn (ring + (ringn + n) % ring) % ring;\n\t\t} else {\n\t\t\tringn = ringn - n;\n\t\t\tif(ringn < 0) {\n\t\t\t\treturn 0;\n\t\t\t} else if (ringn >= ring) {\n\t\t\t\treturn ring;\n\t\t\t} else {\n\t\t\t\treturn ringn;\n\t\t\t}\n\t\t}\n\t}\n\trotateHistory = (n: number) => {\n\t\tlet historyn = this.rotateRing(n, this.state.historyn, this.state.history.length, false);\n\t\tif(historyn == 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.state.restoreText.length,\n\t\t\t\tpromptText: this.state.restoreText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t} else {\n\t\t\tlet promptText = this.state.history[this.state.history.length-historyn];\n\t\t\tthis.setState({\n\t\t\t\tpoint: promptText.length,\n\t\t\t\tpromptText: promptText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t}\n\t}\n\tsearchHistory = (direction: SearchDirection = this.state.searchDirection, next: boolean = false): ConsoleState => {\n\t\tlet idx = this.state.historyn;\n\t\tlet inc = (direction == SearchDirection.Reverse)?1:-1;\n\t\tif(next) {\n\t\t\tidx = idx + inc;\n\t\t}\n\t\tfor(;idx > 0 && idx <= this.state.history.length; idx = idx + inc) {\n\t\t\tlet entry = this.state.history[this.state.history.length-idx];\n\t\t\tlet point = entry.indexOf(this.state.searchText);\n\t\t\tif(point > -1) {\n\t\t\t\treturn {\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: entry,\n\t\t\t\t\tsearchDirection: direction,\n\t\t\t\t\tsearchInit: false,\n\t\t\t\t\thistoryn: idx,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tsearchDirection: direction,\n\t\t\tsearchInit: false,\n\t\t};\n\t}\n\t// DOM management\n\tscrollSemaphore = 0;\n\tscrollIfBottom = () => {\n\t\tif(this.scrollSemaphore > 0 || this.child.container.scrollTop == this.child.container.scrollHeight - this.child.container.offsetHeight) {\n\t\t\tthis.scrollSemaphore++;\n\t\t\treturn this.scrollIfBottomTrue;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tscrollIfBottomTrue = () => {\n\t\tthis.scrollToBottom();\n\t\tthis.scrollSemaphore--;\n\t}\n\tscrollToBottom = () => {\n\t\tthis.child.container.scrollTop = this.child.container.scrollHeight;\n\t\tlet rect = this.child.focus.getBoundingClientRect();\n\t\tif(rect.top < 0 || rect.left < 0 ||\n\t\t\trect.bottom > (window.innerHeight || document.documentElement.clientHeight) ||\n\t\t\trect.right > (window.innerWidth || document.documentElement.clientWidth)\n\t\t) { this.child.typer.scrollIntoView(false); }\n\t}\n\tnextLabel = () => {\n\t\tif(typeof this.props.promptLabel === \"string\") {\n\t\t\treturn this.props.promptLabel as string;\n\t\t} else {\n\t\t\treturn (this.props.promptLabel as ()=>string)();\n\t\t}\n\t}\n\trender() {\n\t\treturn
this.child.container = ref}\n\t\t\t\tclassName={\"react-console-container \" + (this.state.focus?\"react-console-focus\":\"react-console-nofocus\")}\n\t\t\t\tonClick={this.focus}\n\t\t\t>\n\t\t\t{this.props.welcomeMessage?\n\t\t\t\t
\n\t\t\t\t\t{this.props.welcomeMessage}\n\t\t\t\t
\n\t\t\t\t: null\n\t\t\t}\n\t\t\t{this.state.log.map( (val: LogEntry) => {\n\t\t\t\treturn [\n\t\t\t\t\t,\n\t\t\t\t\t...val.message.map( (val: LogMessage, idx: number) => {\n\t\t\t\t\t\treturn ;\n\t\t\t\t\t})\n\t\t\t\t];\n\t\t\t})}\n\t\t\t{this.state.acceptInput?\n\t\t\t\t\n\t\t\t\t: null\n\t\t\t}\n\t\t\t
\n\t\t\t\t this.child.typer = ref}\n\t\t\t\t\tclassName=\"react-console-typer\"\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tautoCorrect=\"off\"\n\t\t\t\t\tautoCapitalize=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\tstyle={{ outline: \"none\",\n\t\t\t\t\t\tcolor: \"transparent\",\n\t\t\t\t\t\tbackgroundColor: \"transparent\",\n\t\t\t\t\t\tborder: \"none\",\n\t\t\t\t\t\tresize: \"none\",\n\t\t\t\t\t\toverflow: \"hidden\",\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={this.blur}\n\t\t\t\t\tonKeyDown={this.keyDown}\n\t\t\t\t\tonChange={this.change}\n\t\t\t\t\tonPaste={this.paste}\n\t\t\t\t>\n\t\t\t
\n\t\t\t
this.child.focus = ref}> 
\n\t\t
;\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react-console.tsx","module.exports = React;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"React\"\n// module id = 1\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./react-console.scss\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap 9bfb7587d8ab92c74a5a","webpack:///./react-console.tsx","webpack:///external \"React\"","webpack:///./react-console.scss"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,aAAY,CAAC;;;;;;AAEb,KAAY,KAAK,uBAAM,CAAO,CAAC;AAE/B,qBAAO,CAAsB,CAAC;AAQ9B;KAA4B,iCAAsC;KAAlE;SAA4B,8BAAsC;SAOjE,UAAK,GAED,EAAE,CAAC;SAQP,iBAAiB;SACjB,oBAAe,GAAW,CAAC,CAAC;KA2C7B,CAAC;KA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AO,EAAE,IAAI,CAAC,KAAM,EACT,CACP,EACN,qBAAC,GAAG,IAAC,GAAG,EAAE,aAAG,IAAI,YAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,EAAtB,CAAuB,OAAa,CAChD,CAAC;KACR,CAAC;KA/0BM,sBAAY,GAAG;SACrB,WAAW,EAAE,IAAI;SACjB,QAAQ,EAAE,cAAa,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SACtC,MAAM,EAAE,cAAY,CAAC;MACrB,CAAC;KA40BH,gBAAC;AAAD,EAAC,CAv2B4B,KAAK,CAAC,SAAS,GAu2B3C;AAv2BD;4BAu2BC;;;;;;;AC9hCD,wB;;;;;;ACAA,0C","file":"react-console.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9bfb7587d8ab92c74a5a","\"use strict\";\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport './react-console.scss';\n\ninterface ConsolePromptProps {\n\tpoint?: number;\n\tvalue: string;\n\tlabel: string;\n\targument?: string;\n}\nclass ConsolePrompt extends React.Component {\n\tstatic defaultProps: ConsolePromptProps = {\n\t\tpoint: -1,\n\t\tvalue: \"\",\n\t\tlabel: \"> \",\n\t\targument: null,\n\t}\n\tchild: {\n\t\tcursor?: Element;\n\t} = {};\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tthis.idle();\n\t}\n\tcomponentDidUpdate() {\n\t\tthis.idle();\n\t}\n\t// DOM Management\n\tupdateSemaphore: number = 0;\n\tidle() {\n\t\t// Blink cursor when idle\n\t\tif(this.child.cursor) {\n\t\t\tif(this.updateSemaphore == 0) {\n\t\t\t\tthis.child.cursor.className = \"react-console-cursor\";\n\t\t\t}\n\t\t\tthis.updateSemaphore++;\n\t\t\twindow.setTimeout( () => {\n\t\t\t\tthis.updateSemaphore--;\n\t\t\t\tif(this.updateSemaphore == 0 && this.child.cursor) {\n\t\t\t\t\tthis.child.cursor.className = \"react-console-cursor react-console-cursor-idle\";\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\trenderValue() {\n\t\tif(this.props.point < 0) {\n\t\t\treturn [this.props.value];\n\t\t} else if (this.props.point == this.props.value.length) {\n\t\t\treturn [this.props.value, this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\"> ];\n\t\t} else {\n\t\t\treturn [this.props.value.substring(0,this.props.point),\n\t\t\t\t this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\">{this.props.value.substring(this.props.point,this.props.point+1)},\n\t\t\t\tthis.props.value.substring(this.props.point+1)];\n\t\t}\n\t}\n\trender() {\n\t\tlet label = this.props.label;\n\t\tif(this.props.argument) {\n\t\t\tlet idx = label.lastIndexOf(\"\\n\");\n\t\t\tif(idx >= 0) {\n\t\t\t\tlabel = label.substring(0, idx+1);\n\t\t\t} else {\n\t\t\t\tlabel = '';\n\t\t\t}\n\t\t}\n\t\treturn
\n\t\t\t{ label }\n\t\t\t{ this.props.argument }\n\t\t\t{ this.renderValue() }\n\t\t
;\n\t}\n}\n\ninterface ConsoleTableHeaderProps {\n\theaders?: string[];\n}\nlet ConsoleTableHeader: React.SFC = function(props: ConsoleTableHeaderProps){\t\n\tif(props.headers){\n\t\treturn \n\t\t\t\t\t\n\t\t\t\t\t\t{props.headers.map((header: string) => {\n\t\t\t\t\t\t\treturn { header };\n\t\t\t\t\t\t})}\n\t\t\t\t\t\n\t\t\t\t\n\t}\n\treturn null;\n}\n\ninterface ConsoleMessageProps {\n\ttype?: string;\n\tisTable?: boolean;\n\tvalue: any[];\n}\nlet ConsoleMessage: React.SFC = function(props: ConsoleMessageProps) {\n\tif(props.isTable){\n\t\tconst data = props.value[0];\n\t\treturn
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{data.rows && data.rows.map((row: string[], index: number) => {\n\t\t\t\t\t\treturn {row.map((cell: string, cellIndex: number) => { \n\t\t\t\t\t\t\t\treturn ; })\n\t\t\t\t\t\t\t};\n\t\t\t\t\t})}\n\t\t\t\t\n\t\t\t
{cell}
\n\t\t
;\n\t}else{\n\t\treturn
\n\t\t\t{props.value.map((val: any)=>{\n\t\t\t\tif(typeof val == 'string') {\n\t\t\t\t\treturn val;\n\t\t\t\t} else {\n\t\t\t\t\treturn JSON.stringify(val);\n\t\t\t\t}\n\t\t\t}).join(\"\\n\")}\n\t\t
;\n\t}\n}\nConsoleMessage.defaultProps = {\n\ttype: null,\n\tvalue: [],\n\tisTable: false\n}\n\nexport interface ConsoleTableObject {\n\trows: Array;\n\theaders?: Array;\n}\n\nexport interface LogMessage {\n\ttype?: string;\n\tisTable?: boolean;\n\tvalue: any[];\n}\nexport interface LogEntry {\n\tlabel: string;\n\tcommand: string;\n\tmessage: LogMessage[];\n}\n\nexport interface ConsoleProps{\n\thandler: (command: string)=>any;\n\tcancel?: ()=>any;\n\tcomplete?: (words: string[], curr: number, promptText: string)=>string[];\n\tcontinue?: (promptText: string)=>boolean;\n\tautofocus?: boolean;\n\tpromptLabel?: string | (()=>string);\n\twelcomeMessage?: string;\n}\nexport const enum ConsoleCommand {\n\tDefault,\n\tSearch,\n\tKill,\n\tYank,\n};\nexport const enum SearchDirection {\n\tReverse,\n\tForward,\n}\nexport interface ConsoleState{\n\tfocus?: boolean;\n\tacceptInput?: boolean;\n\ttyper?: string;\n\tpoint?: number;\n\tcurrLabel?: string;\n\tpromptText?: string;\n\trestoreText?: string;\n\tsearchText?: string;\n\tsearchDirection?: SearchDirection;\n\tsearchInit?: boolean;\n\tlog?: LogEntry[];\n\thistory?: string[];\n\thistoryn?: number;\n\tkill?: string[];\n\tkilln?: number;\n\targument?: string;\n\tlastCommand?: ConsoleCommand;\n};\nexport default class extends React.Component {\n\tconstructor(props: ConsoleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tfocus: false,\n\t\t\tacceptInput: true,\n\t\t\ttyper: '',\n\t\t\tpoint: 0,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t\tpromptText: '',\n\t\t\trestoreText: '',\n\t\t\tsearchText: '',\n\t\t\tsearchDirection: null,\n\t\t\tsearchInit: false,\n\t\t\tlog: [],\n\t\t\thistory: [],\n\t\t\thistoryn: 0,\n\t\t\tkill: [],\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tstatic defaultProps = {\n\t\tpromptLabel: '> ',\n\t\tcontinue: function() { return false; },\n\t\tcancel: function() {},\n\t};\n\tchild: {\n\t\ttyper?: HTMLTextAreaElement;\n\t\tcontainer?: HTMLElement;\n\t\tfocus?: HTMLElement;\n\t} = {};\n\t// Command API\n\tlog = (...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogX = (type: string, ...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({type: type, value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogTable = (tableData: ConsoleTableObject) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({isTable: true, value: [tableData]});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\treturn = () => {\n\t\tthis.setState({\n\t\t\tacceptInput: true,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t}, this.scrollIfBottom() );\n\t}\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tif(this.props.autofocus) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\t// Event Handlers\n\tfocus = () => {\n\t\tif(!window.getSelection().toString()) {\n\t\t\tthis.child.typer.focus();\n\t\t\tthis.setState({ focus: true }, this.scrollToBottom );\n\t\t}\n\t}\n\tblur = () => {\n\t\tthis.setState({ focus: false });\n\t}\n\tkeyDown = (e: KeyboardEvent) => {\n\t\tinterface keyMap {\n\t\t\t[key: number]: ()=>void\n\t\t}\n\t\tlet keyCodes: keyMap = {\n\t\t\t// return\n\t\t\t13: this.acceptLine,\n\t\t\t// left\n\t\t\t37: this.backwardChar,\n\t\t\t// right\n\t\t\t39: this.forwardChar,\n\t\t\t// up\n\t\t\t38: this.previousHistory,\n\t\t\t// down\n\t\t\t40: this.nextHistory,\n\t\t\t// backspace\n\t\t\t8: this.backwardDeleteChar,\n\t\t\t// delete\n\t\t\t46: this.deleteChar,\n\t\t\t// end\n\t\t\t35: this.endOfLine,\n\t\t\t// start\n\t\t\t36: this.beginningOfLine,\n\t\t\t// tab\n\t\t\t9: this.complete,\n\t\t\t// esc\n\t\t\t27: this.prefixMeta,\n\t\t};\n\t\tvar ctrlCodes: keyMap = {\n\t\t\t// C-a\n\t\t\t65: this.beginningOfLine,\n\t\t\t// C-e\n\t\t\t69: this.endOfLine,\n\t\t\t// C-f\n\t\t\t70: this.forwardChar,\n\t\t\t// C-b\n\t\t\t66: this.backwardChar,\n\t\t\t// C-l\n\t\t\t76: this.clearScreen,\n\t\t\t// C-p\n\t\t\t80: this.previousHistory,\n\t\t\t// C-n\n\t\t\t78: this.nextHistory,\n\t\t\t// C-r\n\t\t\t82: this.reverseSearchHistory,\n\t\t\t// C-s\n\t\t\t83: this.forwardSearchHistory,\n\t\t\t// C-d\n\t\t\t68: this.deleteChar, // TODO EOF\n\t\t\t// C-q TODO\n\t\t\t//81: this.quotedInsert,\n\t\t\t// C-v TODO\n\t\t\t//86: this.quotedInsert,\n\t\t\t// C-t TODO\n\t\t\t//84: this.transposeChars,\n\t\t\t// C-k\n\t\t\t75: this.killLine,\n\t\t\t// C-u\n\t\t\t85: this.backwardKillLine,\n\t\t\t// C-y TODO\n\t\t\t89: this.yank,\n\t\t\t// C-c\n\t\t\t67: this.cancelCommand,\n\t\t\t// C-w TODO\n\t\t\t//87: this.killPreviousWhitespace,\n\t\t\t// C-] TODO\n\t\t\t//221: this.characterSearch,\n\t\t\t// C-x TODO\n\t\t\t//88: this.prefixCtrlX,\n\t\t};\n\t\tvar ctrlXCodes: keyMap = { // TODO state\n\t\t\t// C-x Rubout\n\t\t\t8: this.backwardKillLine,\n\t\t\t// C-x ( TODO\n\t\t\t//57: this.startKbdMacro,\n\t\t\t// C-x ) TODO\n\t\t\t//48: this.endKbdMacro,\n\t\t\t// C-x e TODO\n\t\t\t//69: this.callLastKbdMacro,\n\t\t\t// C-x C-u TODO\n\t\t\t//85: this.undo,\n\t\t\t// C-x C-x TODO\n\t\t\t//88: this.exchangePointAndMark,\n\t\t};\n\t\tvar ctrlShiftCodes: keyMap = {\n\t\t\t// C-_ TODO\n\t\t\t//189: this.undo,\n\t\t\t// C-@ TODO\n\t\t\t//50: this.setMark,\n\t\t};\n\t\tvar metaCodes: keyMap = {\n\t\t\t// M-f\n\t\t\t70: this.forwardWord,\n\t\t\t// M-b\n\t\t\t66: this.backwardWord,\n\t\t\t// M-p\n\t\t\t80: this.nonIncrementalReverseSearchHistory,\n\t\t\t// M-n\n\t\t\t78: this.nonIncrementalForwardSearchHistory,\n\t\t\t// M-.\n\t\t\t190: this.yankLastArg,\n\t\t\t// M-TAB TODO\n\t\t\t//9: this.tabInsert,\n\t\t\t// M-t TODO\n\t\t\t//84: this.transposeWords,\n\t\t\t// M-u TODO\n\t\t\t//85: this.upcaseWord,\n\t\t\t// M-l TODO\n\t\t\t//76: this.downcaseWord,\n\t\t\t// M-c TODO\n\t\t\t//67: this.capitalizeWord,\n\t\t\t// M-d\n\t\t\t68: this.killWord,\n\t\t\t// M-backspace\n\t\t\t8: this.backwardKillWord,\n\t\t\t// M-w TODO\n\t\t\t//87: this.unixWordRubout,\n\t\t\t// M-\\ TODO\n\t\t\t//220: this.deleteHorizontalSpace,\n\t\t\t// M-y\n\t\t\t89: this.yankPop,\n\t\t\t// M-0 TODO\n\t\t\t//48: () => this.digitArgument(0),\n\t\t\t// M-1 TODO\n\t\t\t//49: () => this.digitArgument(1),\n\t\t\t// M-2 TODO\n\t\t\t//50: () => this.digitArgument(2),\n\t\t\t// M-3 TODO\n\t\t\t//51: () => this.digitArgument(3),\n\t\t\t// M-4 TODO\n\t\t\t//52: () => this.digitArgument(4),\n\t\t\t// M-5 TODO\n\t\t\t//53: () => this.digitArgument(5),\n\t\t\t// M-6 TODO\n\t\t\t//54: () => this.digitArgument(6),\n\t\t\t// M-7 TODO\n\t\t\t//55: () => this.digitArgument(7),\n\t\t\t// M-8 TODO\n\t\t\t//56: () => this.digitArgument(8),\n\t\t\t// M-9 TODO\n\t\t\t//57: () => this.digitArgument(9),\n\t\t\t// M-- TODO\n\t\t\t//189: () => this.digitArgument('-'),\n\t\t\t// M-f TODO\n\t\t\t//71: () => this.abort,\n\t\t\t// M-r TODO\n\t\t\t//82: this.revertLine,\n\t\t\t// M-SPACE TODO\n\t\t\t//32: this.setMark,\n\t\t};\n\t\tvar metaShiftCodes: keyMap = { // TODO hook in\n\t\t\t// M-<\n\t\t\t188: this.beginningOfHistory,\n\t\t\t// M->\n\t\t\t190: this.endOfHistory,\n\t\t\t// M-_\n\t\t\t189: this.yankLastArg,\n\t\t\t// M-? TODO\n\t\t\t//191: this.possibleCompletions,\n\t\t\t// M-* TODO\n\t\t\t//56: this.insertCompletions,\n\t\t}\n\t\tvar metaCtrlCodes: keyMap = {\n\t\t\t// M-C-y\n\t\t\t89: this.yankNthArg,\n\t\t\t// M-C-] TODO\n\t\t\t//221: this.characterSearchBackward,\n\t\t\t// M-C-j TODO !!!\n\t\t\t//74: this.viEditingMode,\n\t\t};\n\t\tif(this.state.acceptInput) {\n\t\t\tif (e.altKey) {\n\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\tif (e.keyCode in metaCtrlCodes) {\n\t\t\t\t\t\tmetaCtrlCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.shiftKey) {\n\t\t\t\t\tif (e.keyCode in metaShiftCodes) {\n\t\t\t\t\t\tmetaShiftCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.keyCode in metaCodes) {\n\t\t\t\t\tmetaCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.ctrlKey) {\n\t\t\t\tif (e.keyCode in ctrlCodes) {\n\t\t\t\t\tctrlCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.keyCode in keyCodes) {\n\t\t\t\tkeyCodes[e.keyCode]();\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\tchange = () => {\n\t\tlet idx = 0;\n\t\tfor(;idx < this.state.typer.length && idx < this.child.typer.value.length; idx++) {\n\t\t\tif(this.state.typer[idx] != this.child.typer.value[idx]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlet insert = this.child.typer.value.substring(idx);\n\t\tlet replace = this.state.typer.length - idx;\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText, replace),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert, replace),{\n\t\t\t\t\ttyper: this.child.typer.value,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\tpaste = (e: ClipboardEvent) => {\n\t\tlet insert = e.clipboardData.getData('text');\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert),{\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t\te.preventDefault();\n\t}\n\t// Commands for Moving\n\tbeginningOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tendOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.state.promptText.length,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(-1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.nextWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\t// Commands for Manipulating the History\n\tacceptLine = () => {\n\t\tthis.child.typer.value = \"\";\n\t\tif(this.props.continue(this.state.promptText)) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(\"\\n\"),{\n\t\t\t\t\ttyper: \"\",\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tlet command = this.state.promptText;\n\t\t\tlet history = this.state.history;\n\t\t\tlet log = this.state.log;\n\t\t\tif(!history || history[history.length-1] != command) {\n\t\t\t\thistory.push(command);\n\t\t\t}\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: command,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\tacceptInput: false,\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistory: history,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, () => {\n\t\t\t\tthis.scrollToBottom();\n\t\t\t\tif(this.props.handler) {\n\t\t\t\t\tthis.props.handler(command)\n\t\t\t\t} else {\n\t\t\t\t\tthis.return();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tpreviousHistory = () => {\n\t\tthis.rotateHistory(-1);\n\t}\n\tnextHistory = () => {\n\t\tthis.rotateHistory(1);\n\t}\n\tbeginningOfHistory = () => {\n\t\tthis.rotateHistory(-this.state.history.length);\n\t}\n\tendOfHistory = () => {\n\t\tthis.rotateHistory(this.state.history.length);\n\t}\n\ttriggerSearch = () => {\n\t\tif(this.state.searchDirection == SearchDirection.Reverse) {\n\t\t\tthis.reverseSearchHistory();\n\t\t} else {\n\t\t\tthis.forwardSearchHistory();\n\t\t}\n\t}\n\treverseSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Reverse, true),{\n\t\t\t\t\targument: `(reverse-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Reverse,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(reverse-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tforwardSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Forward, true),{\n\t\t\t\t\targument: `(forward-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Forward,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(forward-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tclearScreen = () => {\n\t\tthis.setState({ log: [] });\n\t}\n\tnonIncrementalReverseSearchHistory = () => {\n\t\t// TODO\n\t}\n\tnonIncrementalForwardSearchHistory = () => {\n\t\t// TODO\n\t}\n\thistorySearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySearchForward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchForward = () => {\n\t\t// TODO\n\t}\n\tyankNthArg = () => {\n\t\t// TODO\n\t}\n\tyankLastArg = () => {\n\t\t// TODO\n\t}\n\t// Commands for Changing Text\n\tdeleteChar = () => {\n\t\tif(this.state.point < this.state.promptText.length) {\n\t\t\tthis.setState({\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point+1),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tbackwardDeleteChar = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchText.substring(0,this.state.searchText.length-1),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else if(this.state.point > 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.movePoint(-1),\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point-1)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\t// Killing and Yanking\n\tkillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(0,this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWholeLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText);\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: '',\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point,this.nextWord());\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point,this.nextWord()));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ this.state.promptText.substring(this.nextWord()),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(this.previousWord(),this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.previousWord(),this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\tpromptText: this.state.promptText.substring(0,this.previousWord())\n\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tyank = () => {\n\t\tthis.setState(Object.assign(\n\t\t\tthis.consoleInsert(this.state.kill[this.state.killn]),{\n\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t}), this.scrollToBottom\n\t\t);\n\t}\n\tyankPop = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Yank) {\n\t\t\tlet killn = this.rotateRing(1, this.state.killn, this.state.kill.length);\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(this.state.kill[killn], this.state.kill[this.state.killn].length),{\n\t\t\t\t\tkilln: killn,\n\t\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\t// Numeric Arguments\n\t// Completing\n\tcomplete = () => {\n\t\tif(this.props.complete) {\n\t\t\t// Split text and find current word\n\t\t\tlet words = this.state.promptText.split(\" \");\n\t\t\tlet curr = 0;\n\t\t\tlet idx = words[0].length;\n\t\t\twhile(idx < this.state.point && curr + 1 < words.length) {\n\t\t\t\tidx += words[++curr].length + 1;\n\t\t\t}\n\n\t\t\tlet completions = this.props.complete(words, curr, this.state.promptText);\n\t\t\tif(completions.length == 1) {\n\t\t\t\t// Perform completion\n\t\t\t\twords[curr] = completions[0];\n\t\t\t\tlet point = -1;\n\t\t\t\tfor(let i = 0; i <= curr; i++) {\n\t\t\t\t\tpoint += words[i].length + 1;\n\t\t\t\t}\n\t\t\t\tthis.setState({\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: words.join(\" \"),\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t} else if (completions.length > 1) {\n\t\t\t\t// show completions\n\t\t\t\tlet log = this.state.log;\n\t\t\t\tlog.push({\n\t\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\t\tcommand: this.state.promptText,\n\t\t\t\t\tmessage: [{\n\t\t\t\t\t\ttype: \"completion\",\n\t\t\t\t\t\tvalue: [completions.join(\"\\t\")],\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tthis.setState({\n\t\t\t\t\tcurrLabel: this.nextLabel(),\n\t\t\t\t\tlog: log,\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t}\n\t\t}\n\t}\n\t// Keyboard Macros\n\t// Miscellaneous\n\tprefixMeta = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t});\n\t\t}\n\t\t// TODO Meta prefixed state\n\t}\n\tcancelCommand = () => {\n\t\tif(this.state.acceptInput) { // Typing command\n\t\t\tthis.child.typer.value = \"\";\n\t\t\tlet log = this.state.log;\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: this.state.promptText,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t} else { // command is executing, call handler\n\t\t\tthis.props.cancel();\n\t\t}\n\t}\n\t// Helper functions\n\ttextInsert = (insert: string, text: string, replace: number = 0, point: number = text.length): string => {\n\t\treturn text.substring(0, point - replace) + insert + text.substring(point);\n\t}\n\tconsoleInsert = (insert: string, replace: number = 0): ConsoleState => {\n\t\tlet promptText = this.textInsert(insert, this.state.promptText, replace, this.state.point);\n\t\treturn {\n\t\t\tpoint: this.movePoint(insert.length - replace, insert.length - replace + this.state.promptText.length),\n\t\t\tpromptText: promptText,\n\t\t\trestoreText: promptText,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tmovePoint = (n: number, max: number = this.state.promptText.length) => {\n\t\tlet pos = this.state.point + n;\n\t\tif (pos < 0) {\n\t\t\treturn 0;\n\t\t} if (pos > max) {\n\t\t\treturn max;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}\n\tnextWord(): number {\n\t\t// Find first alphanumeric char after first non-alphanumeric char\n\t\tlet search = /\\W\\w/.exec(this.state.promptText.substring(this.state.point));\n\t\tif(search) {\n\t\t\treturn search.index + this.state.point + 1;\n\t\t} else {\n\t\t\treturn this.state.promptText.length;\n\t\t}\n\t}\n\tpreviousWord(): number {\n\t\t// Find first non-alphanumeric char after first alphanumeric char in reverse\n\t\tlet search = /\\W\\w(?!.*\\W\\w)/.exec(this.state.promptText.substring(0,this.state.point-1));\n\t\tif(search) {\n\t\t\treturn search.index + 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\trotateRing = (n: number, ringn: number, ring: number, circular: boolean = true): number => {\n\t\tif(ring == 0) return 0;\n\t\tif(circular) {\n\t\t\treturn (ring + (ringn + n) % ring) % ring;\n\t\t} else {\n\t\t\tringn = ringn - n;\n\t\t\tif(ringn < 0) {\n\t\t\t\treturn 0;\n\t\t\t} else if (ringn >= ring) {\n\t\t\t\treturn ring;\n\t\t\t} else {\n\t\t\t\treturn ringn;\n\t\t\t}\n\t\t}\n\t}\n\trotateHistory = (n: number) => {\n\t\tlet historyn = this.rotateRing(n, this.state.historyn, this.state.history.length, false);\n\t\tif(historyn == 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.state.restoreText.length,\n\t\t\t\tpromptText: this.state.restoreText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t} else {\n\t\t\tlet promptText = this.state.history[this.state.history.length-historyn];\n\t\t\tthis.setState({\n\t\t\t\tpoint: promptText.length,\n\t\t\t\tpromptText: promptText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t}\n\t}\n\tsearchHistory = (direction: SearchDirection = this.state.searchDirection, next: boolean = false): ConsoleState => {\n\t\tlet idx = this.state.historyn;\n\t\tlet inc = (direction == SearchDirection.Reverse)?1:-1;\n\t\tif(next) {\n\t\t\tidx = idx + inc;\n\t\t}\n\t\tfor(;idx > 0 && idx <= this.state.history.length; idx = idx + inc) {\n\t\t\tlet entry = this.state.history[this.state.history.length-idx];\n\t\t\tlet point = entry.indexOf(this.state.searchText);\n\t\t\tif(point > -1) {\n\t\t\t\treturn {\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: entry,\n\t\t\t\t\tsearchDirection: direction,\n\t\t\t\t\tsearchInit: false,\n\t\t\t\t\thistoryn: idx,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tsearchDirection: direction,\n\t\t\tsearchInit: false,\n\t\t};\n\t}\n\t// DOM management\n\tscrollSemaphore = 0;\n\tscrollIfBottom = () => {\n\t\tif(this.scrollSemaphore > 0 || this.child.container.scrollTop == this.child.container.scrollHeight - this.child.container.offsetHeight) {\n\t\t\tthis.scrollSemaphore++;\n\t\t\treturn this.scrollIfBottomTrue;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tscrollIfBottomTrue = () => {\n\t\tthis.scrollToBottom();\n\t\tthis.scrollSemaphore--;\n\t}\n\tscrollToBottom = () => {\n\t\tthis.child.container.scrollTop = this.child.container.scrollHeight;\n\t\tlet rect = this.child.focus.getBoundingClientRect();\n\t\tif(rect.top < 0 || rect.left < 0 ||\n\t\t\trect.bottom > (window.innerHeight || document.documentElement.clientHeight) ||\n\t\t\trect.right > (window.innerWidth || document.documentElement.clientWidth)\n\t\t) { this.child.typer.scrollIntoView(false); }\n\t}\n\tnextLabel = () => {\n\t\tif(typeof this.props.promptLabel === \"string\") {\n\t\t\treturn this.props.promptLabel as string;\n\t\t} else {\n\t\t\treturn (this.props.promptLabel as ()=>string)();\n\t\t}\n\t}\n\trender() {\n\t\treturn
this.child.container = ref}\n\t\t\t\tclassName={\"react-console-container \" + (this.state.focus?\"react-console-focus\":\"react-console-nofocus\")}\n\t\t\t\tonClick={this.focus}\n\t\t\t>\n\t\t\t{this.props.welcomeMessage?\n\t\t\t\t
\n\t\t\t\t\t{this.props.welcomeMessage}\n\t\t\t\t
\n\t\t\t\t: null\n\t\t\t}\n\t\t\t{this.state.log.map( (val: LogEntry) => {\n\t\t\t\treturn [\n\t\t\t\t\t,\n\t\t\t\t\t...val.message.map( (val: LogMessage, idx: number) => {\n\t\t\t\t\t\treturn ;\n\t\t\t\t\t})\n\t\t\t\t];\n\t\t\t})}\n\t\t\t{this.state.acceptInput?\n\t\t\t\t\n\t\t\t\t: null\n\t\t\t}\n\t\t\t
\n\t\t\t\t this.child.typer = ref}\n\t\t\t\t\tclassName=\"react-console-typer\"\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tautoCorrect=\"off\"\n\t\t\t\t\tautoCapitalize=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\tstyle={{ outline: \"none\",\n\t\t\t\t\t\tcolor: \"transparent\",\n\t\t\t\t\t\tbackgroundColor: \"transparent\",\n\t\t\t\t\t\tborder: \"none\",\n\t\t\t\t\t\tresize: \"none\",\n\t\t\t\t\t\toverflow: \"hidden\",\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={this.blur}\n\t\t\t\t\tonKeyDown={this.keyDown}\n\t\t\t\t\tonChange={this.change}\n\t\t\t\t\tonPaste={this.paste}\n\t\t\t\t>\n\t\t\t
\n\t\t\t
this.child.focus = ref}> 
\n\t\t
;\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react-console.tsx","module.exports = React;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"React\"\n// module id = 1\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./react-console.scss\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/react-console.js b/lib/react-console.js index f1f3db5..31933cb 100644 --- a/lib/react-console.js +++ b/lib/react-console.js @@ -119,19 +119,38 @@ module.exports = }; return ConsolePrompt; }(React.Component)); + var ConsoleTableHeader = function (props) { + if (props.headers) { + return React.createElement("thead", null, React.createElement("tr", null, props.headers.map(function (header) { + return React.createElement("th", {scope: "col", key: header}, header); + }))); + } + return null; + }; var ConsoleMessage = function (props) { - return React.createElement("div", {className: "react-console-message" + (props.type ? " react-console-message-" + props.type : "")}, props.value.map(function (val) { - if (typeof val == 'string') { - return val; - } - else { - return JSON.stringify(val); - } - }).join("\n")); + if (props.isTable) { + var data = props.value[0]; + return React.createElement("div", {className: "react-console-message react-console-table"}, React.createElement("table", null, React.createElement(ConsoleTableHeader, {headers: data.headers}), React.createElement("tbody", null, data.rows && data.rows.map(function (row, index) { + return React.createElement("tr", {key: index}, row.map(function (cell, cellIndex) { + return React.createElement("td", {key: cellIndex}, cell); + })); + })))); + } + else { + return React.createElement("div", {className: "react-console-message" + (props.type ? " react-console-message-" + props.type : "")}, props.value.map(function (val) { + if (typeof val == 'string') { + return val; + } + else { + return JSON.stringify(val); + } + }).join("\n")); + } }; ConsoleMessage.defaultProps = { type: null, value: [], + isTable: false }; ; ; @@ -164,6 +183,13 @@ module.exports = log: log, }, _this.scrollIfBottom()); }; + this.logTable = function (tableData) { + var log = _this.state.log; + log[_this.state.log.length - 1].message.push({ isTable: true, value: [tableData] }); + _this.setState({ + log: log, + }, _this.scrollIfBottom()); + }; this.return = function () { _this.setState({ acceptInput: true, @@ -919,7 +945,7 @@ module.exports = return [ React.createElement(ConsolePrompt, {label: val.label, value: val.command}) ].concat(val.message.map(function (val, idx) { - return React.createElement(ConsoleMessage, {key: idx, type: val.type, value: val.value}); + return React.createElement(ConsoleMessage, {key: idx, type: val.type, value: val.value, isTable: val.isTable}); })); }), this.state.acceptInput ? React.createElement(ConsolePrompt, {label: this.state.currLabel, value: this.state.promptText, point: this.state.point, argument: this.state.argument}) diff --git a/lib/react-console.js.map b/lib/react-console.js.map index f48895b..f902420 100644 --- a/lib/react-console.js.map +++ b/lib/react-console.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 2ee6f46c4382e9843e73","webpack:///./react-console.tsx","webpack:///external \"react\"","webpack:///./react-console.scss"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,aAAY,CAAC;;;;;;AAEb,KAAY,KAAK,uBAAM,CAAO,CAAC;AAE/B,qBAAO,CAAsB,CAAC;AAQ9B;KAA4B,iCAAsC;KAAlE;SAA4B,8BAAsC;SAOjE,UAAK,GAED,EAAE,CAAC;SAQP,iBAAiB;SACjB,oBAAe,GAAW,CAAC,CAAC;KA2C7B,CAAC;KAnDA,sBAAsB;KACtB,yCAAiB,GAAjB;SACC,IAAI,CAAC,IAAI,EAAE,CAAC;KACb,CAAC;KACD,0CAAkB,GAAlB;SACC,IAAI,CAAC,IAAI,EAAE,CAAC;KACb,CAAC;KAGD,4BAAI,GAAJ;SAAA,iBAcC;SAbA,yBAAyB;SACzB,EA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tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2ee6f46c4382e9843e73","\"use strict\";\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport './react-console.scss';\n\ninterface ConsolePromptProps {\n\tpoint?: number;\n\tvalue: string;\n\tlabel: string;\n\targument?: string;\n}\nclass ConsolePrompt extends React.Component {\n\tstatic defaultProps: ConsolePromptProps = {\n\t\tpoint: -1,\n\t\tvalue: \"\",\n\t\tlabel: \"> \",\n\t\targument: null,\n\t}\n\tchild: {\n\t\tcursor?: Element;\n\t} = {};\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tthis.idle();\n\t}\n\tcomponentDidUpdate() {\n\t\tthis.idle();\n\t}\n\t// DOM Management\n\tupdateSemaphore: number = 0;\n\tidle() {\n\t\t// Blink cursor when idle\n\t\tif(this.child.cursor) {\n\t\t\tif(this.updateSemaphore == 0) {\n\t\t\t\tthis.child.cursor.className = \"react-console-cursor\";\n\t\t\t}\n\t\t\tthis.updateSemaphore++;\n\t\t\twindow.setTimeout( () => {\n\t\t\t\tthis.updateSemaphore--;\n\t\t\t\tif(this.updateSemaphore == 0 && this.child.cursor) {\n\t\t\t\t\tthis.child.cursor.className = \"react-console-cursor react-console-cursor-idle\";\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\trenderValue() {\n\t\tif(this.props.point < 0) {\n\t\t\treturn [this.props.value];\n\t\t} else if (this.props.point == this.props.value.length) {\n\t\t\treturn [this.props.value, this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\"> ];\n\t\t} else {\n\t\t\treturn [this.props.value.substring(0,this.props.point),\n\t\t\t\t this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\">{this.props.value.substring(this.props.point,this.props.point+1)},\n\t\t\t\tthis.props.value.substring(this.props.point+1)];\n\t\t}\n\t}\n\trender() {\n\t\tlet label = this.props.label;\n\t\tif(this.props.argument) {\n\t\t\tlet idx = label.lastIndexOf(\"\\n\");\n\t\t\tif(idx >= 0) {\n\t\t\t\tlabel = label.substring(0, idx+1);\n\t\t\t} else {\n\t\t\t\tlabel = '';\n\t\t\t}\n\t\t}\n\t\treturn
\n\t\t\t{ label }\n\t\t\t{ this.props.argument }\n\t\t\t{ this.renderValue() }\n\t\t
;\n\t}\n}\n\ninterface ConsoleMessageProps {\n\ttype?: string;\n\tvalue: any[];\n}\nlet ConsoleMessage: React.SFC = function(props: ConsoleMessageProps) {\n\treturn
\n\t\t{props.value.map((val: any)=>{\n\t\t\tif(typeof val == 'string') {\n\t\t\t\treturn val;\n\t\t\t} else {\n\t\t\t\treturn JSON.stringify(val);\n\t\t\t}\n\t\t}).join(\"\\n\")}\n\t
;\n}\nConsoleMessage.defaultProps = {\n\ttype: null,\n\tvalue: [],\n}\n\nexport interface LogMessage {\n\ttype?: string;\n\tvalue: any[];\n}\nexport interface LogEntry {\n\tlabel: string;\n\tcommand: string;\n\tmessage: LogMessage[];\n}\n\nexport interface ConsoleProps{\n\thandler: (command: string)=>any;\n\tcancel?: ()=>any;\n\tcomplete?: (words: string[], curr: number, promptText: string)=>string[];\n\tcontinue?: (promptText: string)=>boolean;\n\tautofocus?: boolean;\n\tpromptLabel?: string | (()=>string);\n\twelcomeMessage?: string;\n}\nexport const enum ConsoleCommand {\n\tDefault,\n\tSearch,\n\tKill,\n\tYank,\n};\nexport const enum SearchDirection {\n\tReverse,\n\tForward,\n}\nexport interface ConsoleState{\n\tfocus?: boolean;\n\tacceptInput?: boolean;\n\ttyper?: string;\n\tpoint?: number;\n\tcurrLabel?: string;\n\tpromptText?: string;\n\trestoreText?: string;\n\tsearchText?: string;\n\tsearchDirection?: SearchDirection;\n\tsearchInit?: boolean;\n\tlog?: LogEntry[];\n\thistory?: string[];\n\thistoryn?: number;\n\tkill?: string[];\n\tkilln?: number;\n\targument?: string;\n\tlastCommand?: ConsoleCommand;\n};\nexport default class extends React.Component {\n\tconstructor(props: ConsoleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tfocus: false,\n\t\t\tacceptInput: true,\n\t\t\ttyper: '',\n\t\t\tpoint: 0,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t\tpromptText: '',\n\t\t\trestoreText: '',\n\t\t\tsearchText: '',\n\t\t\tsearchDirection: null,\n\t\t\tsearchInit: false,\n\t\t\tlog: [],\n\t\t\thistory: [],\n\t\t\thistoryn: 0,\n\t\t\tkill: [],\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tstatic defaultProps = {\n\t\tpromptLabel: '> ',\n\t\tcontinue: function() { return false; },\n\t\tcancel: function() {},\n\t};\n\tchild: {\n\t\ttyper?: HTMLTextAreaElement;\n\t\tcontainer?: HTMLElement;\n\t\tfocus?: HTMLElement;\n\t} = {};\n\t// Command API\n\tlog = (...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogX = (type: string, ...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({type: type, value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\treturn = () => {\n\t\tthis.setState({\n\t\t\tacceptInput: true,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t}, this.scrollIfBottom() );\n\t}\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tif(this.props.autofocus) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\t// Event Handlers\n\tfocus = () => {\n\t\tif(!window.getSelection().toString()) {\n\t\t\tthis.child.typer.focus();\n\t\t\tthis.setState({ focus: true }, this.scrollToBottom );\n\t\t}\n\t}\n\tblur = () => {\n\t\tthis.setState({ focus: false });\n\t}\n\tkeyDown = (e: KeyboardEvent) => {\n\t\tinterface keyMap {\n\t\t\t[key: number]: ()=>void\n\t\t}\n\t\tlet keyCodes: keyMap = {\n\t\t\t// return\n\t\t\t13: this.acceptLine,\n\t\t\t// left\n\t\t\t37: this.backwardChar,\n\t\t\t// right\n\t\t\t39: this.forwardChar,\n\t\t\t// up\n\t\t\t38: this.previousHistory,\n\t\t\t// down\n\t\t\t40: this.nextHistory,\n\t\t\t// backspace\n\t\t\t8: this.backwardDeleteChar,\n\t\t\t// delete\n\t\t\t46: this.deleteChar,\n\t\t\t// end\n\t\t\t35: this.endOfLine,\n\t\t\t// start\n\t\t\t36: this.beginningOfLine,\n\t\t\t// tab\n\t\t\t9: this.complete,\n\t\t\t// esc\n\t\t\t27: this.prefixMeta,\n\t\t};\n\t\tvar ctrlCodes: keyMap = {\n\t\t\t// C-a\n\t\t\t65: this.beginningOfLine,\n\t\t\t// C-e\n\t\t\t69: this.endOfLine,\n\t\t\t// C-f\n\t\t\t70: this.forwardChar,\n\t\t\t// C-b\n\t\t\t66: this.backwardChar,\n\t\t\t// C-l\n\t\t\t76: this.clearScreen,\n\t\t\t// C-p\n\t\t\t80: this.previousHistory,\n\t\t\t// C-n\n\t\t\t78: this.nextHistory,\n\t\t\t// C-r\n\t\t\t82: this.reverseSearchHistory,\n\t\t\t// C-s\n\t\t\t83: this.forwardSearchHistory,\n\t\t\t// C-d\n\t\t\t68: this.deleteChar, // TODO EOF\n\t\t\t// C-q TODO\n\t\t\t//81: this.quotedInsert,\n\t\t\t// C-v TODO\n\t\t\t//86: this.quotedInsert,\n\t\t\t// C-t TODO\n\t\t\t//84: this.transposeChars,\n\t\t\t// C-k\n\t\t\t75: this.killLine,\n\t\t\t// C-u\n\t\t\t85: this.backwardKillLine,\n\t\t\t// C-y TODO\n\t\t\t89: this.yank,\n\t\t\t// C-c\n\t\t\t67: this.cancelCommand,\n\t\t\t// C-w TODO\n\t\t\t//87: this.killPreviousWhitespace,\n\t\t\t// C-] TODO\n\t\t\t//221: this.characterSearch,\n\t\t\t// C-x TODO\n\t\t\t//88: this.prefixCtrlX,\n\t\t};\n\t\tvar ctrlXCodes: keyMap = { // TODO state\n\t\t\t// C-x Rubout\n\t\t\t8: this.backwardKillLine,\n\t\t\t// C-x ( TODO\n\t\t\t//57: this.startKbdMacro,\n\t\t\t// C-x ) TODO\n\t\t\t//48: this.endKbdMacro,\n\t\t\t// C-x e TODO\n\t\t\t//69: this.callLastKbdMacro,\n\t\t\t// C-x C-u TODO\n\t\t\t//85: this.undo,\n\t\t\t// C-x C-x TODO\n\t\t\t//88: this.exchangePointAndMark,\n\t\t};\n\t\tvar ctrlShiftCodes: keyMap = {\n\t\t\t// C-_ TODO\n\t\t\t//189: this.undo,\n\t\t\t// C-@ TODO\n\t\t\t//50: this.setMark,\n\t\t};\n\t\tvar metaCodes: keyMap = {\n\t\t\t// M-f\n\t\t\t70: this.forwardWord,\n\t\t\t// M-b\n\t\t\t66: this.backwardWord,\n\t\t\t// M-p\n\t\t\t80: this.nonIncrementalReverseSearchHistory,\n\t\t\t// M-n\n\t\t\t78: this.nonIncrementalForwardSearchHistory,\n\t\t\t// M-.\n\t\t\t190: this.yankLastArg,\n\t\t\t// M-TAB TODO\n\t\t\t//9: this.tabInsert,\n\t\t\t// M-t TODO\n\t\t\t//84: this.transposeWords,\n\t\t\t// M-u TODO\n\t\t\t//85: this.upcaseWord,\n\t\t\t// M-l TODO\n\t\t\t//76: this.downcaseWord,\n\t\t\t// M-c TODO\n\t\t\t//67: this.capitalizeWord,\n\t\t\t// M-d\n\t\t\t68: this.killWord,\n\t\t\t// M-backspace\n\t\t\t8: this.backwardKillWord,\n\t\t\t// M-w TODO\n\t\t\t//87: this.unixWordRubout,\n\t\t\t// M-\\ TODO\n\t\t\t//220: this.deleteHorizontalSpace,\n\t\t\t// M-y\n\t\t\t89: this.yankPop,\n\t\t\t// M-0 TODO\n\t\t\t//48: () => this.digitArgument(0),\n\t\t\t// M-1 TODO\n\t\t\t//49: () => this.digitArgument(1),\n\t\t\t// M-2 TODO\n\t\t\t//50: () => this.digitArgument(2),\n\t\t\t// M-3 TODO\n\t\t\t//51: () => this.digitArgument(3),\n\t\t\t// M-4 TODO\n\t\t\t//52: () => this.digitArgument(4),\n\t\t\t// M-5 TODO\n\t\t\t//53: () => this.digitArgument(5),\n\t\t\t// M-6 TODO\n\t\t\t//54: () => this.digitArgument(6),\n\t\t\t// M-7 TODO\n\t\t\t//55: () => this.digitArgument(7),\n\t\t\t// M-8 TODO\n\t\t\t//56: () => this.digitArgument(8),\n\t\t\t// M-9 TODO\n\t\t\t//57: () => this.digitArgument(9),\n\t\t\t// M-- TODO\n\t\t\t//189: () => this.digitArgument('-'),\n\t\t\t// M-f TODO\n\t\t\t//71: () => this.abort,\n\t\t\t// M-r TODO\n\t\t\t//82: this.revertLine,\n\t\t\t// M-SPACE TODO\n\t\t\t//32: this.setMark,\n\t\t};\n\t\tvar metaShiftCodes: keyMap = { // TODO hook in\n\t\t\t// M-<\n\t\t\t188: this.beginningOfHistory,\n\t\t\t// M->\n\t\t\t190: this.endOfHistory,\n\t\t\t// M-_\n\t\t\t189: this.yankLastArg,\n\t\t\t// M-? TODO\n\t\t\t//191: this.possibleCompletions,\n\t\t\t// M-* TODO\n\t\t\t//56: this.insertCompletions,\n\t\t}\n\t\tvar metaCtrlCodes: keyMap = {\n\t\t\t// M-C-y\n\t\t\t89: this.yankNthArg,\n\t\t\t// M-C-] TODO\n\t\t\t//221: this.characterSearchBackward,\n\t\t\t// M-C-j TODO !!!\n\t\t\t//74: this.viEditingMode,\n\t\t};\n\t\tif(this.state.acceptInput) {\n\t\t\tif (e.altKey) {\n\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\tif (e.keyCode in metaCtrlCodes) {\n\t\t\t\t\t\tmetaCtrlCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.shiftKey) {\n\t\t\t\t\tif (e.keyCode in metaShiftCodes) {\n\t\t\t\t\t\tmetaShiftCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.keyCode in metaCodes) {\n\t\t\t\t\tmetaCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.ctrlKey) {\n\t\t\t\tif (e.keyCode in ctrlCodes) {\n\t\t\t\t\tctrlCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.keyCode in keyCodes) {\n\t\t\t\tkeyCodes[e.keyCode]();\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\tchange = () => {\n\t\tlet idx = 0;\n\t\tfor(;idx < this.state.typer.length && idx < this.child.typer.value.length; idx++) {\n\t\t\tif(this.state.typer[idx] != this.child.typer.value[idx]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlet insert = this.child.typer.value.substring(idx);\n\t\tlet replace = this.state.typer.length - idx;\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText, replace),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert, replace),{\n\t\t\t\t\ttyper: this.child.typer.value,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\tpaste = (e: ClipboardEvent) => {\n\t\tlet insert = e.clipboardData.getData('text');\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert),{\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t\te.preventDefault();\n\t}\n\t// Commands for Moving\n\tbeginningOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tendOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.state.promptText.length,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(-1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.nextWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\t// Commands for Manipulating the History\n\tacceptLine = () => {\n\t\tthis.child.typer.value = \"\";\n\t\tif(this.props.continue(this.state.promptText)) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(\"\\n\"),{\n\t\t\t\t\ttyper: \"\",\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tlet command = this.state.promptText;\n\t\t\tlet history = this.state.history;\n\t\t\tlet log = this.state.log;\n\t\t\tif(!history || history[history.length-1] != command) {\n\t\t\t\thistory.push(command);\n\t\t\t}\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: command,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\tacceptInput: false,\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistory: history,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, () => {\n\t\t\t\tthis.scrollToBottom();\n\t\t\t\tif(this.props.handler) {\n\t\t\t\t\tthis.props.handler(command)\n\t\t\t\t} else {\n\t\t\t\t\tthis.return();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tpreviousHistory = () => {\n\t\tthis.rotateHistory(-1);\n\t}\n\tnextHistory = () => {\n\t\tthis.rotateHistory(1);\n\t}\n\tbeginningOfHistory = () => {\n\t\tthis.rotateHistory(-this.state.history.length);\n\t}\n\tendOfHistory = () => {\n\t\tthis.rotateHistory(this.state.history.length);\n\t}\n\ttriggerSearch = () => {\n\t\tif(this.state.searchDirection == SearchDirection.Reverse) {\n\t\t\tthis.reverseSearchHistory();\n\t\t} else {\n\t\t\tthis.forwardSearchHistory();\n\t\t}\n\t}\n\treverseSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Reverse, true),{\n\t\t\t\t\targument: `(reverse-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Reverse,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(reverse-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tforwardSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Forward, true),{\n\t\t\t\t\targument: `(forward-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Forward,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(forward-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tclearScreen = () => {\n\t\tthis.setState({ log: [] });\n\t}\n\tnonIncrementalReverseSearchHistory = () => {\n\t\t// TODO\n\t}\n\tnonIncrementalForwardSearchHistory = () => {\n\t\t// TODO\n\t}\n\thistorySearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySearchForward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchForward = () => {\n\t\t// TODO\n\t}\n\tyankNthArg = () => {\n\t\t// TODO\n\t}\n\tyankLastArg = () => {\n\t\t// TODO\n\t}\n\t// Commands for Changing Text\n\tdeleteChar = () => {\n\t\tif(this.state.point < this.state.promptText.length) {\n\t\t\tthis.setState({\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point+1),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tbackwardDeleteChar = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchText.substring(0,this.state.searchText.length-1),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else if(this.state.point > 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.movePoint(-1),\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point-1)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\t// Killing and Yanking\n\tkillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(0,this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWholeLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText);\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: '',\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point,this.nextWord());\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point,this.nextWord()));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ this.state.promptText.substring(this.nextWord()),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(this.previousWord(),this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.previousWord(),this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\tpromptText: this.state.promptText.substring(0,this.previousWord())\n\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tyank = () => {\n\t\tthis.setState(Object.assign(\n\t\t\tthis.consoleInsert(this.state.kill[this.state.killn]),{\n\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t}), this.scrollToBottom\n\t\t);\n\t}\n\tyankPop = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Yank) {\n\t\t\tlet killn = this.rotateRing(1, this.state.killn, this.state.kill.length);\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(this.state.kill[killn], this.state.kill[this.state.killn].length),{\n\t\t\t\t\tkilln: killn,\n\t\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\t// Numeric Arguments\n\t// Completing\n\tcomplete = () => {\n\t\tif(this.props.complete) {\n\t\t\t// Split text and find current word\n\t\t\tlet words = this.state.promptText.split(\" \");\n\t\t\tlet curr = 0;\n\t\t\tlet idx = words[0].length;\n\t\t\twhile(idx < this.state.point && curr + 1 < words.length) {\n\t\t\t\tidx += words[++curr].length + 1;\n\t\t\t}\n\n\t\t\tlet completions = this.props.complete(words, curr, this.state.promptText);\n\t\t\tif(completions.length == 1) {\n\t\t\t\t// Perform completion\n\t\t\t\twords[curr] = completions[0];\n\t\t\t\tlet point = -1;\n\t\t\t\tfor(let i = 0; i <= curr; i++) {\n\t\t\t\t\tpoint += words[i].length + 1;\n\t\t\t\t}\n\t\t\t\tthis.setState({\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: words.join(\" \"),\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t} else if (completions.length > 1) {\n\t\t\t\t// show completions\n\t\t\t\tlet log = this.state.log;\n\t\t\t\tlog.push({\n\t\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\t\tcommand: this.state.promptText,\n\t\t\t\t\tmessage: [{\n\t\t\t\t\t\ttype: \"completion\",\n\t\t\t\t\t\tvalue: [completions.join(\"\\t\")],\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tthis.setState({\n\t\t\t\t\tcurrLabel: this.nextLabel(),\n\t\t\t\t\tlog: log,\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t}\n\t\t}\n\t}\n\t// Keyboard Macros\n\t// Miscellaneous\n\tprefixMeta = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t});\n\t\t}\n\t\t// TODO Meta prefixed state\n\t}\n\tcancelCommand = () => {\n\t\tif(this.state.acceptInput) { // Typing command\n\t\t\tthis.child.typer.value = \"\";\n\t\t\tlet log = this.state.log;\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: this.state.promptText,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t} else { // command is executing, call handler\n\t\t\tthis.props.cancel();\n\t\t}\n\t}\n\t// Helper functions\n\ttextInsert = (insert: string, text: string, replace: number = 0, point: number = text.length): string => {\n\t\treturn text.substring(0, point - replace) + insert + text.substring(point);\n\t}\n\tconsoleInsert = (insert: string, replace: number = 0): ConsoleState => {\n\t\tlet promptText = this.textInsert(insert, this.state.promptText, replace, this.state.point);\n\t\treturn {\n\t\t\tpoint: this.movePoint(insert.length - replace, insert.length - replace + this.state.promptText.length),\n\t\t\tpromptText: promptText,\n\t\t\trestoreText: promptText,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tmovePoint = (n: number, max: number = this.state.promptText.length) => {\n\t\tlet pos = this.state.point + n;\n\t\tif (pos < 0) {\n\t\t\treturn 0;\n\t\t} if (pos > max) {\n\t\t\treturn max;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}\n\tnextWord(): number {\n\t\t// Find first alphanumeric char after first non-alphanumeric char\n\t\tlet search = /\\W\\w/.exec(this.state.promptText.substring(this.state.point));\n\t\tif(search) {\n\t\t\treturn search.index + this.state.point + 1;\n\t\t} else {\n\t\t\treturn this.state.promptText.length;\n\t\t}\n\t}\n\tpreviousWord(): number {\n\t\t// Find first non-alphanumeric char after first alphanumeric char in reverse\n\t\tlet search = /\\W\\w(?!.*\\W\\w)/.exec(this.state.promptText.substring(0,this.state.point-1));\n\t\tif(search) {\n\t\t\treturn search.index + 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\trotateRing = (n: number, ringn: number, ring: number, circular: boolean = true): number => {\n\t\tif(ring == 0) return 0;\n\t\tif(circular) {\n\t\t\treturn (ring + (ringn + n) % ring) % ring;\n\t\t} else {\n\t\t\tringn = ringn - n;\n\t\t\tif(ringn < 0) {\n\t\t\t\treturn 0;\n\t\t\t} else if (ringn >= ring) {\n\t\t\t\treturn ring;\n\t\t\t} else {\n\t\t\t\treturn ringn;\n\t\t\t}\n\t\t}\n\t}\n\trotateHistory = (n: number) => {\n\t\tlet historyn = this.rotateRing(n, this.state.historyn, this.state.history.length, false);\n\t\tif(historyn == 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.state.restoreText.length,\n\t\t\t\tpromptText: this.state.restoreText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t} else {\n\t\t\tlet promptText = this.state.history[this.state.history.length-historyn];\n\t\t\tthis.setState({\n\t\t\t\tpoint: promptText.length,\n\t\t\t\tpromptText: promptText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t}\n\t}\n\tsearchHistory = (direction: SearchDirection = this.state.searchDirection, next: boolean = false): ConsoleState => {\n\t\tlet idx = this.state.historyn;\n\t\tlet inc = (direction == SearchDirection.Reverse)?1:-1;\n\t\tif(next) {\n\t\t\tidx = idx + inc;\n\t\t}\n\t\tfor(;idx > 0 && idx <= this.state.history.length; idx = idx + inc) {\n\t\t\tlet entry = this.state.history[this.state.history.length-idx];\n\t\t\tlet point = entry.indexOf(this.state.searchText);\n\t\t\tif(point > -1) {\n\t\t\t\treturn {\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: entry,\n\t\t\t\t\tsearchDirection: direction,\n\t\t\t\t\tsearchInit: false,\n\t\t\t\t\thistoryn: idx,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tsearchDirection: direction,\n\t\t\tsearchInit: false,\n\t\t};\n\t}\n\t// DOM management\n\tscrollSemaphore = 0;\n\tscrollIfBottom = () => {\n\t\tif(this.scrollSemaphore > 0 || this.child.container.scrollTop == this.child.container.scrollHeight - this.child.container.offsetHeight) {\n\t\t\tthis.scrollSemaphore++;\n\t\t\treturn this.scrollIfBottomTrue;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tscrollIfBottomTrue = () => {\n\t\tthis.scrollToBottom();\n\t\tthis.scrollSemaphore--;\n\t}\n\tscrollToBottom = () => {\n\t\tthis.child.container.scrollTop = this.child.container.scrollHeight;\n\t\tlet rect = this.child.focus.getBoundingClientRect();\n\t\tif(rect.top < 0 || rect.left < 0 ||\n\t\t\trect.bottom > (window.innerHeight || document.documentElement.clientHeight) ||\n\t\t\trect.right > (window.innerWidth || document.documentElement.clientWidth)\n\t\t) { this.child.typer.scrollIntoView(false); }\n\t}\n\tnextLabel = () => {\n\t\tif(typeof this.props.promptLabel === \"string\") {\n\t\t\treturn this.props.promptLabel as string;\n\t\t} else {\n\t\t\treturn (this.props.promptLabel as ()=>string)();\n\t\t}\n\t}\n\trender() {\n\t\treturn
this.child.container = ref}\n\t\t\t\tclassName={\"react-console-container \" + (this.state.focus?\"react-console-focus\":\"react-console-nofocus\")}\n\t\t\t\tonClick={this.focus}\n\t\t\t>\n\t\t\t{this.props.welcomeMessage?\n\t\t\t\t
\n\t\t\t\t\t{this.props.welcomeMessage}\n\t\t\t\t
\n\t\t\t\t: null\n\t\t\t}\n\t\t\t{this.state.log.map( (val: LogEntry) => {\n\t\t\t\treturn [\n\t\t\t\t\t,\n\t\t\t\t\t...val.message.map( (val: LogMessage, idx: number) => {\n\t\t\t\t\t\treturn ;\n\t\t\t\t\t})\n\t\t\t\t];\n\t\t\t})}\n\t\t\t{this.state.acceptInput?\n\t\t\t\t\n\t\t\t\t: null\n\t\t\t}\n\t\t\t
\n\t\t\t\t this.child.typer = ref}\n\t\t\t\t\tclassName=\"react-console-typer\"\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tautoCorrect=\"off\"\n\t\t\t\t\tautoCapitalize=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\tstyle={{ outline: \"none\",\n\t\t\t\t\t\tcolor: \"transparent\",\n\t\t\t\t\t\tbackgroundColor: \"transparent\",\n\t\t\t\t\t\tborder: \"none\",\n\t\t\t\t\t\tresize: \"none\",\n\t\t\t\t\t\toverflow: \"hidden\",\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={this.blur}\n\t\t\t\t\tonKeyDown={this.keyDown}\n\t\t\t\t\tonChange={this.change}\n\t\t\t\t\tonPaste={this.paste}\n\t\t\t\t>\n\t\t\t
\n\t\t\t
this.child.focus = ref}> 
\n\t\t
;\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react-console.tsx","module.exports = require(\"react\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 1\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./react-console.scss\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap d7c7dadb9edc7a5b0668","webpack:///./react-console.tsx","webpack:///external \"react\"","webpack:///./react-console.scss"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,aAAY,CAAC;;;;;;AAEb,KAAY,KAAK,uBAAM,CAAO,CAAC;AAE/B,qBAAO,CAAsB,CAAC;AAQ9B;KAA4B,iCAAsC;KAAlE;SAA4B,8BAAsC;SAOjE,UAAK,GAED,EAAE,CAAC;SAQP,iBAAiB;SACjB,oBAAe,GAAW,CAAC,CAAC;KA2C7B,CAAC;KAnDA,sBAAsB;KACtB,yCAAiB,GAAjB;SACC,IAAI,CAAC,IAAI,EAAE,CAAC;KACb,CAAC;KACD,0CAAkB,GAAlB;SACC,IAAI,CAAC,IAAI,EAAE,CAAC;KACb,CAAC;KAGD,4BAAI,GAAJ;SAAA,iBAcC;SAbA,yBAAyB;SACzB,EAAE,EAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;aACtB,EAAE,EAAC,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC,CAAC;iBAC9B,IAAI,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AAC,CAv2B4B,KAAK,CAAC,SAAS,GAu2B3C;AAv2BD;4BAu2BC;;;;;;;AC9hCD,mC;;;;;;ACAA,0C","file":"react-console.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d7c7dadb9edc7a5b0668","\"use strict\";\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport './react-console.scss';\n\ninterface ConsolePromptProps {\n\tpoint?: number;\n\tvalue: string;\n\tlabel: string;\n\targument?: string;\n}\nclass ConsolePrompt extends React.Component {\n\tstatic defaultProps: ConsolePromptProps = {\n\t\tpoint: -1,\n\t\tvalue: \"\",\n\t\tlabel: \"> \",\n\t\targument: null,\n\t}\n\tchild: {\n\t\tcursor?: Element;\n\t} = {};\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tthis.idle();\n\t}\n\tcomponentDidUpdate() {\n\t\tthis.idle();\n\t}\n\t// DOM Management\n\tupdateSemaphore: number = 0;\n\tidle() {\n\t\t// Blink cursor when idle\n\t\tif(this.child.cursor) {\n\t\t\tif(this.updateSemaphore == 0) {\n\t\t\t\tthis.child.cursor.className = \"react-console-cursor\";\n\t\t\t}\n\t\t\tthis.updateSemaphore++;\n\t\t\twindow.setTimeout( () => {\n\t\t\t\tthis.updateSemaphore--;\n\t\t\t\tif(this.updateSemaphore == 0 && this.child.cursor) {\n\t\t\t\t\tthis.child.cursor.className = \"react-console-cursor react-console-cursor-idle\";\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\trenderValue() {\n\t\tif(this.props.point < 0) {\n\t\t\treturn [this.props.value];\n\t\t} else if (this.props.point == this.props.value.length) {\n\t\t\treturn [this.props.value, this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\"> ];\n\t\t} else {\n\t\t\treturn [this.props.value.substring(0,this.props.point),\n\t\t\t\t this.child.cursor = ref} key=\"cursor\" className=\"react-console-cursor\">{this.props.value.substring(this.props.point,this.props.point+1)},\n\t\t\t\tthis.props.value.substring(this.props.point+1)];\n\t\t}\n\t}\n\trender() {\n\t\tlet label = this.props.label;\n\t\tif(this.props.argument) {\n\t\t\tlet idx = label.lastIndexOf(\"\\n\");\n\t\t\tif(idx >= 0) {\n\t\t\t\tlabel = label.substring(0, idx+1);\n\t\t\t} else {\n\t\t\t\tlabel = '';\n\t\t\t}\n\t\t}\n\t\treturn
\n\t\t\t{ label }\n\t\t\t{ this.props.argument }\n\t\t\t{ this.renderValue() }\n\t\t
;\n\t}\n}\n\ninterface ConsoleTableHeaderProps {\n\theaders?: string[];\n}\nlet ConsoleTableHeader: React.SFC = function(props: ConsoleTableHeaderProps){\t\n\tif(props.headers){\n\t\treturn \n\t\t\t\t\t\n\t\t\t\t\t\t{props.headers.map((header: string) => {\n\t\t\t\t\t\t\treturn { header };\n\t\t\t\t\t\t})}\n\t\t\t\t\t\n\t\t\t\t\n\t}\n\treturn null;\n}\n\ninterface ConsoleMessageProps {\n\ttype?: string;\n\tisTable?: boolean;\n\tvalue: any[];\n}\nlet ConsoleMessage: React.SFC = function(props: ConsoleMessageProps) {\n\tif(props.isTable){\n\t\tconst data = props.value[0];\n\t\treturn
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{data.rows && data.rows.map((row: string[], index: number) => {\n\t\t\t\t\t\treturn {row.map((cell: string, cellIndex: number) => { \n\t\t\t\t\t\t\t\treturn ; })\n\t\t\t\t\t\t\t};\n\t\t\t\t\t})}\n\t\t\t\t\n\t\t\t
{cell}
\n\t\t
;\n\t}else{\n\t\treturn
\n\t\t\t{props.value.map((val: any)=>{\n\t\t\t\tif(typeof val == 'string') {\n\t\t\t\t\treturn val;\n\t\t\t\t} else {\n\t\t\t\t\treturn JSON.stringify(val);\n\t\t\t\t}\n\t\t\t}).join(\"\\n\")}\n\t\t
;\n\t}\n}\nConsoleMessage.defaultProps = {\n\ttype: null,\n\tvalue: [],\n\tisTable: false\n}\n\nexport interface ConsoleTableObject {\n\trows: Array;\n\theaders?: Array;\n}\n\nexport interface LogMessage {\n\ttype?: string;\n\tisTable?: boolean;\n\tvalue: any[];\n}\nexport interface LogEntry {\n\tlabel: string;\n\tcommand: string;\n\tmessage: LogMessage[];\n}\n\nexport interface ConsoleProps{\n\thandler: (command: string)=>any;\n\tcancel?: ()=>any;\n\tcomplete?: (words: string[], curr: number, promptText: string)=>string[];\n\tcontinue?: (promptText: string)=>boolean;\n\tautofocus?: boolean;\n\tpromptLabel?: string | (()=>string);\n\twelcomeMessage?: string;\n}\nexport const enum ConsoleCommand {\n\tDefault,\n\tSearch,\n\tKill,\n\tYank,\n};\nexport const enum SearchDirection {\n\tReverse,\n\tForward,\n}\nexport interface ConsoleState{\n\tfocus?: boolean;\n\tacceptInput?: boolean;\n\ttyper?: string;\n\tpoint?: number;\n\tcurrLabel?: string;\n\tpromptText?: string;\n\trestoreText?: string;\n\tsearchText?: string;\n\tsearchDirection?: SearchDirection;\n\tsearchInit?: boolean;\n\tlog?: LogEntry[];\n\thistory?: string[];\n\thistoryn?: number;\n\tkill?: string[];\n\tkilln?: number;\n\targument?: string;\n\tlastCommand?: ConsoleCommand;\n};\nexport default class extends React.Component {\n\tconstructor(props: ConsoleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tfocus: false,\n\t\t\tacceptInput: true,\n\t\t\ttyper: '',\n\t\t\tpoint: 0,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t\tpromptText: '',\n\t\t\trestoreText: '',\n\t\t\tsearchText: '',\n\t\t\tsearchDirection: null,\n\t\t\tsearchInit: false,\n\t\t\tlog: [],\n\t\t\thistory: [],\n\t\t\thistoryn: 0,\n\t\t\tkill: [],\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tstatic defaultProps = {\n\t\tpromptLabel: '> ',\n\t\tcontinue: function() { return false; },\n\t\tcancel: function() {},\n\t};\n\tchild: {\n\t\ttyper?: HTMLTextAreaElement;\n\t\tcontainer?: HTMLElement;\n\t\tfocus?: HTMLElement;\n\t} = {};\n\t// Command API\n\tlog = (...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogX = (type: string, ...messages: any[]) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({type: type, value: messages});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\tlogTable = (tableData: ConsoleTableObject) => {\n\t\tlet log = this.state.log;\n\t\tlog[this.state.log.length-1].message.push({isTable: true, value: [tableData]});\n\t\tthis.setState({\n\t\t\tlog: log,\n\t\t}, this.scrollIfBottom() );\n\t}\n\treturn = () => {\n\t\tthis.setState({\n\t\t\tacceptInput: true,\n\t\t\tcurrLabel: this.nextLabel(),\n\t\t}, this.scrollIfBottom() );\n\t}\n\t// Component Lifecycle\n\tcomponentDidMount() {\n\t\tif(this.props.autofocus) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\t// Event Handlers\n\tfocus = () => {\n\t\tif(!window.getSelection().toString()) {\n\t\t\tthis.child.typer.focus();\n\t\t\tthis.setState({ focus: true }, this.scrollToBottom );\n\t\t}\n\t}\n\tblur = () => {\n\t\tthis.setState({ focus: false });\n\t}\n\tkeyDown = (e: KeyboardEvent) => {\n\t\tinterface keyMap {\n\t\t\t[key: number]: ()=>void\n\t\t}\n\t\tlet keyCodes: keyMap = {\n\t\t\t// return\n\t\t\t13: this.acceptLine,\n\t\t\t// left\n\t\t\t37: this.backwardChar,\n\t\t\t// right\n\t\t\t39: this.forwardChar,\n\t\t\t// up\n\t\t\t38: this.previousHistory,\n\t\t\t// down\n\t\t\t40: this.nextHistory,\n\t\t\t// backspace\n\t\t\t8: this.backwardDeleteChar,\n\t\t\t// delete\n\t\t\t46: this.deleteChar,\n\t\t\t// end\n\t\t\t35: this.endOfLine,\n\t\t\t// start\n\t\t\t36: this.beginningOfLine,\n\t\t\t// tab\n\t\t\t9: this.complete,\n\t\t\t// esc\n\t\t\t27: this.prefixMeta,\n\t\t};\n\t\tvar ctrlCodes: keyMap = {\n\t\t\t// C-a\n\t\t\t65: this.beginningOfLine,\n\t\t\t// C-e\n\t\t\t69: this.endOfLine,\n\t\t\t// C-f\n\t\t\t70: this.forwardChar,\n\t\t\t// C-b\n\t\t\t66: this.backwardChar,\n\t\t\t// C-l\n\t\t\t76: this.clearScreen,\n\t\t\t// C-p\n\t\t\t80: this.previousHistory,\n\t\t\t// C-n\n\t\t\t78: this.nextHistory,\n\t\t\t// C-r\n\t\t\t82: this.reverseSearchHistory,\n\t\t\t// C-s\n\t\t\t83: this.forwardSearchHistory,\n\t\t\t// C-d\n\t\t\t68: this.deleteChar, // TODO EOF\n\t\t\t// C-q TODO\n\t\t\t//81: this.quotedInsert,\n\t\t\t// C-v TODO\n\t\t\t//86: this.quotedInsert,\n\t\t\t// C-t TODO\n\t\t\t//84: this.transposeChars,\n\t\t\t// C-k\n\t\t\t75: this.killLine,\n\t\t\t// C-u\n\t\t\t85: this.backwardKillLine,\n\t\t\t// C-y TODO\n\t\t\t89: this.yank,\n\t\t\t// C-c\n\t\t\t67: this.cancelCommand,\n\t\t\t// C-w TODO\n\t\t\t//87: this.killPreviousWhitespace,\n\t\t\t// C-] TODO\n\t\t\t//221: this.characterSearch,\n\t\t\t// C-x TODO\n\t\t\t//88: this.prefixCtrlX,\n\t\t};\n\t\tvar ctrlXCodes: keyMap = { // TODO state\n\t\t\t// C-x Rubout\n\t\t\t8: this.backwardKillLine,\n\t\t\t// C-x ( TODO\n\t\t\t//57: this.startKbdMacro,\n\t\t\t// C-x ) TODO\n\t\t\t//48: this.endKbdMacro,\n\t\t\t// C-x e TODO\n\t\t\t//69: this.callLastKbdMacro,\n\t\t\t// C-x C-u TODO\n\t\t\t//85: this.undo,\n\t\t\t// C-x C-x TODO\n\t\t\t//88: this.exchangePointAndMark,\n\t\t};\n\t\tvar ctrlShiftCodes: keyMap = {\n\t\t\t// C-_ TODO\n\t\t\t//189: this.undo,\n\t\t\t// C-@ TODO\n\t\t\t//50: this.setMark,\n\t\t};\n\t\tvar metaCodes: keyMap = {\n\t\t\t// M-f\n\t\t\t70: this.forwardWord,\n\t\t\t// M-b\n\t\t\t66: this.backwardWord,\n\t\t\t// M-p\n\t\t\t80: this.nonIncrementalReverseSearchHistory,\n\t\t\t// M-n\n\t\t\t78: this.nonIncrementalForwardSearchHistory,\n\t\t\t// M-.\n\t\t\t190: this.yankLastArg,\n\t\t\t// M-TAB TODO\n\t\t\t//9: this.tabInsert,\n\t\t\t// M-t TODO\n\t\t\t//84: this.transposeWords,\n\t\t\t// M-u TODO\n\t\t\t//85: this.upcaseWord,\n\t\t\t// M-l TODO\n\t\t\t//76: this.downcaseWord,\n\t\t\t// M-c TODO\n\t\t\t//67: this.capitalizeWord,\n\t\t\t// M-d\n\t\t\t68: this.killWord,\n\t\t\t// M-backspace\n\t\t\t8: this.backwardKillWord,\n\t\t\t// M-w TODO\n\t\t\t//87: this.unixWordRubout,\n\t\t\t// M-\\ TODO\n\t\t\t//220: this.deleteHorizontalSpace,\n\t\t\t// M-y\n\t\t\t89: this.yankPop,\n\t\t\t// M-0 TODO\n\t\t\t//48: () => this.digitArgument(0),\n\t\t\t// M-1 TODO\n\t\t\t//49: () => this.digitArgument(1),\n\t\t\t// M-2 TODO\n\t\t\t//50: () => this.digitArgument(2),\n\t\t\t// M-3 TODO\n\t\t\t//51: () => this.digitArgument(3),\n\t\t\t// M-4 TODO\n\t\t\t//52: () => this.digitArgument(4),\n\t\t\t// M-5 TODO\n\t\t\t//53: () => this.digitArgument(5),\n\t\t\t// M-6 TODO\n\t\t\t//54: () => this.digitArgument(6),\n\t\t\t// M-7 TODO\n\t\t\t//55: () => this.digitArgument(7),\n\t\t\t// M-8 TODO\n\t\t\t//56: () => this.digitArgument(8),\n\t\t\t// M-9 TODO\n\t\t\t//57: () => this.digitArgument(9),\n\t\t\t// M-- TODO\n\t\t\t//189: () => this.digitArgument('-'),\n\t\t\t// M-f TODO\n\t\t\t//71: () => this.abort,\n\t\t\t// M-r TODO\n\t\t\t//82: this.revertLine,\n\t\t\t// M-SPACE TODO\n\t\t\t//32: this.setMark,\n\t\t};\n\t\tvar metaShiftCodes: keyMap = { // TODO hook in\n\t\t\t// M-<\n\t\t\t188: this.beginningOfHistory,\n\t\t\t// M->\n\t\t\t190: this.endOfHistory,\n\t\t\t// M-_\n\t\t\t189: this.yankLastArg,\n\t\t\t// M-? TODO\n\t\t\t//191: this.possibleCompletions,\n\t\t\t// M-* TODO\n\t\t\t//56: this.insertCompletions,\n\t\t}\n\t\tvar metaCtrlCodes: keyMap = {\n\t\t\t// M-C-y\n\t\t\t89: this.yankNthArg,\n\t\t\t// M-C-] TODO\n\t\t\t//221: this.characterSearchBackward,\n\t\t\t// M-C-j TODO !!!\n\t\t\t//74: this.viEditingMode,\n\t\t};\n\t\tif(this.state.acceptInput) {\n\t\t\tif (e.altKey) {\n\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\tif (e.keyCode in metaCtrlCodes) {\n\t\t\t\t\t\tmetaCtrlCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.shiftKey) {\n\t\t\t\t\tif (e.keyCode in metaShiftCodes) {\n\t\t\t\t\t\tmetaShiftCodes[e.keyCode]();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else if (e.keyCode in metaCodes) {\n\t\t\t\t\tmetaCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.ctrlKey) {\n\t\t\t\tif (e.keyCode in ctrlCodes) {\n\t\t\t\t\tctrlCodes[e.keyCode]();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t} else if (e.keyCode in keyCodes) {\n\t\t\t\tkeyCodes[e.keyCode]();\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\tchange = () => {\n\t\tlet idx = 0;\n\t\tfor(;idx < this.state.typer.length && idx < this.child.typer.value.length; idx++) {\n\t\t\tif(this.state.typer[idx] != this.child.typer.value[idx]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlet insert = this.child.typer.value.substring(idx);\n\t\tlet replace = this.state.typer.length - idx;\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText, replace),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert, replace),{\n\t\t\t\t\ttyper: this.child.typer.value,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\tpaste = (e: ClipboardEvent) => {\n\t\tlet insert = e.clipboardData.getData('text');\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchInit?insert:this.textInsert(insert, this.state.searchText),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(insert),{\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t\te.preventDefault();\n\t}\n\t// Commands for Moving\n\tbeginningOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tendOfLine = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.state.promptText.length,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardChar = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.movePoint(-1),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tforwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.nextWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardWord = () => {\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t}, this.scrollToBottom);\n\t}\n\t// Commands for Manipulating the History\n\tacceptLine = () => {\n\t\tthis.child.typer.value = \"\";\n\t\tif(this.props.continue(this.state.promptText)) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(\"\\n\"),{\n\t\t\t\t\ttyper: \"\",\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tlet command = this.state.promptText;\n\t\t\tlet history = this.state.history;\n\t\t\tlet log = this.state.log;\n\t\t\tif(!history || history[history.length-1] != command) {\n\t\t\t\thistory.push(command);\n\t\t\t}\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: command,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\tacceptInput: false,\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistory: history,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, () => {\n\t\t\t\tthis.scrollToBottom();\n\t\t\t\tif(this.props.handler) {\n\t\t\t\t\tthis.props.handler(command)\n\t\t\t\t} else {\n\t\t\t\t\tthis.return();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tpreviousHistory = () => {\n\t\tthis.rotateHistory(-1);\n\t}\n\tnextHistory = () => {\n\t\tthis.rotateHistory(1);\n\t}\n\tbeginningOfHistory = () => {\n\t\tthis.rotateHistory(-this.state.history.length);\n\t}\n\tendOfHistory = () => {\n\t\tthis.rotateHistory(this.state.history.length);\n\t}\n\ttriggerSearch = () => {\n\t\tif(this.state.searchDirection == SearchDirection.Reverse) {\n\t\t\tthis.reverseSearchHistory();\n\t\t} else {\n\t\t\tthis.forwardSearchHistory();\n\t\t}\n\t}\n\treverseSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Reverse, true),{\n\t\t\t\t\targument: `(reverse-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Reverse,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(reverse-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tforwardSearchHistory = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.searchHistory(SearchDirection.Forward, true),{\n\t\t\t\t\targument: `(forward-i-search)\\`${this.state.searchText}': `,\n\t\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tsearchDirection: SearchDirection.Forward,\n\t\t\t\tsearchInit: true,\n\t\t\t\targument: `(forward-i-search)\\`': `,\n\t\t\t\tlastCommand: ConsoleCommand.Search,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tclearScreen = () => {\n\t\tthis.setState({ log: [] });\n\t}\n\tnonIncrementalReverseSearchHistory = () => {\n\t\t// TODO\n\t}\n\tnonIncrementalForwardSearchHistory = () => {\n\t\t// TODO\n\t}\n\thistorySearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySearchForward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchBackward = () => {\n\t\t// TODO\n\t}\n\thistorySubstringSearchForward = () => {\n\t\t// TODO\n\t}\n\tyankNthArg = () => {\n\t\t// TODO\n\t}\n\tyankLastArg = () => {\n\t\t// TODO\n\t}\n\t// Commands for Changing Text\n\tdeleteChar = () => {\n\t\tif(this.state.point < this.state.promptText.length) {\n\t\t\tthis.setState({\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point+1),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\tbackwardDeleteChar = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\tsearchText: this.state.searchText.substring(0,this.state.searchText.length-1),\n\t\t\t\ttyper: this.child.typer.value,\n\t\t\t}, this.triggerSearch );\n\t\t} else if(this.state.point > 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.movePoint(-1),\n\t\t\t\tpromptText: this.state.promptText.substring(0,this.state.point-1)\n\t\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t}\n\t}\n\t// Killing and Yanking\n\tkillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(0,this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWholeLine = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ kill[0] + this.state.promptText.substring(this.state.point);\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText);\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: 0,\n\t\t\tpromptText: '',\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tkillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = kill[0] + this.state.promptText.substring(this.state.point,this.nextWord());\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.state.point,this.nextWord()));\n\t\t}\n\t\tthis.setState({\n\t\t\tpromptText: this.state.promptText.substring(0,this.state.point)\n\t\t\t\t+ this.state.promptText.substring(this.nextWord()),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tbackwardKillWord = () => {\n\t\tlet kill = this.state.kill;\n\t\tif(this.state.lastCommand == ConsoleCommand.Kill) {\n\t\t\tkill[0] = this.state.promptText.substring(this.previousWord(),this.state.point) + kill[0];\n\t\t} else {\n\t\t\tkill.unshift(this.state.promptText.substring(this.previousWord(),this.state.point));\n\t\t}\n\t\tthis.setState({\n\t\t\tpoint: this.previousWord(),\n\t\t\tpromptText: this.state.promptText.substring(0,this.previousWord())\n\t\t\t\t+ this.state.promptText.substring(this.state.point),\n\t\t\tkill: kill,\n\t\t\tkilln: 0,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Kill,\n\t\t}, this.scrollToBottom);\n\t}\n\tyank = () => {\n\t\tthis.setState(Object.assign(\n\t\t\tthis.consoleInsert(this.state.kill[this.state.killn]),{\n\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t}), this.scrollToBottom\n\t\t);\n\t}\n\tyankPop = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Yank) {\n\t\t\tlet killn = this.rotateRing(1, this.state.killn, this.state.kill.length);\n\t\t\tthis.setState(Object.assign(\n\t\t\t\tthis.consoleInsert(this.state.kill[killn], this.state.kill[this.state.killn].length),{\n\t\t\t\t\tkilln: killn,\n\t\t\t\t\tlastCommand: ConsoleCommand.Yank,\n\t\t\t\t}), this.scrollToBottom\n\t\t\t);\n\t\t}\n\t}\n\t// Numeric Arguments\n\t// Completing\n\tcomplete = () => {\n\t\tif(this.props.complete) {\n\t\t\t// Split text and find current word\n\t\t\tlet words = this.state.promptText.split(\" \");\n\t\t\tlet curr = 0;\n\t\t\tlet idx = words[0].length;\n\t\t\twhile(idx < this.state.point && curr + 1 < words.length) {\n\t\t\t\tidx += words[++curr].length + 1;\n\t\t\t}\n\n\t\t\tlet completions = this.props.complete(words, curr, this.state.promptText);\n\t\t\tif(completions.length == 1) {\n\t\t\t\t// Perform completion\n\t\t\t\twords[curr] = completions[0];\n\t\t\t\tlet point = -1;\n\t\t\t\tfor(let i = 0; i <= curr; i++) {\n\t\t\t\t\tpoint += words[i].length + 1;\n\t\t\t\t}\n\t\t\t\tthis.setState({\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: words.join(\" \"),\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t} else if (completions.length > 1) {\n\t\t\t\t// show completions\n\t\t\t\tlet log = this.state.log;\n\t\t\t\tlog.push({\n\t\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\t\tcommand: this.state.promptText,\n\t\t\t\t\tmessage: [{\n\t\t\t\t\t\ttype: \"completion\",\n\t\t\t\t\t\tvalue: [completions.join(\"\\t\")],\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tthis.setState({\n\t\t\t\t\tcurrLabel: this.nextLabel(),\n\t\t\t\t\tlog: log,\n\t\t\t\t\targument: null,\n\t\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t\t}, this.scrollToBottom );\n\t\t\t}\n\t\t}\n\t}\n\t// Keyboard Macros\n\t// Miscellaneous\n\tprefixMeta = () => {\n\t\tif(this.state.lastCommand == ConsoleCommand.Search) {\n\t\t\tthis.setState({\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t});\n\t\t}\n\t\t// TODO Meta prefixed state\n\t}\n\tcancelCommand = () => {\n\t\tif(this.state.acceptInput) { // Typing command\n\t\t\tthis.child.typer.value = \"\";\n\t\t\tlet log = this.state.log;\n\t\t\tlog.push({\n\t\t\t\tlabel: this.state.currLabel,\n\t\t\t\tcommand: this.state.promptText,\n\t\t\t\tmessage: []\n\t\t\t});\n\t\t\tthis.setState({\n\t\t\t\ttyper: \"\",\n\t\t\t\tpoint: 0,\n\t\t\t\tpromptText: \"\",\n\t\t\t\trestoreText: \"\",\n\t\t\t\tlog: log,\n\t\t\t\thistoryn: 0,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom);\n\t\t} else { // command is executing, call handler\n\t\t\tthis.props.cancel();\n\t\t}\n\t}\n\t// Helper functions\n\ttextInsert = (insert: string, text: string, replace: number = 0, point: number = text.length): string => {\n\t\treturn text.substring(0, point - replace) + insert + text.substring(point);\n\t}\n\tconsoleInsert = (insert: string, replace: number = 0): ConsoleState => {\n\t\tlet promptText = this.textInsert(insert, this.state.promptText, replace, this.state.point);\n\t\treturn {\n\t\t\tpoint: this.movePoint(insert.length - replace, insert.length - replace + this.state.promptText.length),\n\t\t\tpromptText: promptText,\n\t\t\trestoreText: promptText,\n\t\t\targument: null,\n\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t};\n\t}\n\tmovePoint = (n: number, max: number = this.state.promptText.length) => {\n\t\tlet pos = this.state.point + n;\n\t\tif (pos < 0) {\n\t\t\treturn 0;\n\t\t} if (pos > max) {\n\t\t\treturn max;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}\n\tnextWord(): number {\n\t\t// Find first alphanumeric char after first non-alphanumeric char\n\t\tlet search = /\\W\\w/.exec(this.state.promptText.substring(this.state.point));\n\t\tif(search) {\n\t\t\treturn search.index + this.state.point + 1;\n\t\t} else {\n\t\t\treturn this.state.promptText.length;\n\t\t}\n\t}\n\tpreviousWord(): number {\n\t\t// Find first non-alphanumeric char after first alphanumeric char in reverse\n\t\tlet search = /\\W\\w(?!.*\\W\\w)/.exec(this.state.promptText.substring(0,this.state.point-1));\n\t\tif(search) {\n\t\t\treturn search.index + 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\trotateRing = (n: number, ringn: number, ring: number, circular: boolean = true): number => {\n\t\tif(ring == 0) return 0;\n\t\tif(circular) {\n\t\t\treturn (ring + (ringn + n) % ring) % ring;\n\t\t} else {\n\t\t\tringn = ringn - n;\n\t\t\tif(ringn < 0) {\n\t\t\t\treturn 0;\n\t\t\t} else if (ringn >= ring) {\n\t\t\t\treturn ring;\n\t\t\t} else {\n\t\t\t\treturn ringn;\n\t\t\t}\n\t\t}\n\t}\n\trotateHistory = (n: number) => {\n\t\tlet historyn = this.rotateRing(n, this.state.historyn, this.state.history.length, false);\n\t\tif(historyn == 0) {\n\t\t\tthis.setState({\n\t\t\t\tpoint: this.state.restoreText.length,\n\t\t\t\tpromptText: this.state.restoreText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t} else {\n\t\t\tlet promptText = this.state.history[this.state.history.length-historyn];\n\t\t\tthis.setState({\n\t\t\t\tpoint: promptText.length,\n\t\t\t\tpromptText: promptText,\n\t\t\t\thistoryn: historyn,\n\t\t\t\targument: null,\n\t\t\t\tlastCommand: ConsoleCommand.Default,\n\t\t\t}, this.scrollToBottom );\n\t\t}\n\t}\n\tsearchHistory = (direction: SearchDirection = this.state.searchDirection, next: boolean = false): ConsoleState => {\n\t\tlet idx = this.state.historyn;\n\t\tlet inc = (direction == SearchDirection.Reverse)?1:-1;\n\t\tif(next) {\n\t\t\tidx = idx + inc;\n\t\t}\n\t\tfor(;idx > 0 && idx <= this.state.history.length; idx = idx + inc) {\n\t\t\tlet entry = this.state.history[this.state.history.length-idx];\n\t\t\tlet point = entry.indexOf(this.state.searchText);\n\t\t\tif(point > -1) {\n\t\t\t\treturn {\n\t\t\t\t\tpoint: point,\n\t\t\t\t\tpromptText: entry,\n\t\t\t\t\tsearchDirection: direction,\n\t\t\t\t\tsearchInit: false,\n\t\t\t\t\thistoryn: idx,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tsearchDirection: direction,\n\t\t\tsearchInit: false,\n\t\t};\n\t}\n\t// DOM management\n\tscrollSemaphore = 0;\n\tscrollIfBottom = () => {\n\t\tif(this.scrollSemaphore > 0 || this.child.container.scrollTop == this.child.container.scrollHeight - this.child.container.offsetHeight) {\n\t\t\tthis.scrollSemaphore++;\n\t\t\treturn this.scrollIfBottomTrue;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tscrollIfBottomTrue = () => {\n\t\tthis.scrollToBottom();\n\t\tthis.scrollSemaphore--;\n\t}\n\tscrollToBottom = () => {\n\t\tthis.child.container.scrollTop = this.child.container.scrollHeight;\n\t\tlet rect = this.child.focus.getBoundingClientRect();\n\t\tif(rect.top < 0 || rect.left < 0 ||\n\t\t\trect.bottom > (window.innerHeight || document.documentElement.clientHeight) ||\n\t\t\trect.right > (window.innerWidth || document.documentElement.clientWidth)\n\t\t) { this.child.typer.scrollIntoView(false); }\n\t}\n\tnextLabel = () => {\n\t\tif(typeof this.props.promptLabel === \"string\") {\n\t\t\treturn this.props.promptLabel as string;\n\t\t} else {\n\t\t\treturn (this.props.promptLabel as ()=>string)();\n\t\t}\n\t}\n\trender() {\n\t\treturn
this.child.container = ref}\n\t\t\t\tclassName={\"react-console-container \" + (this.state.focus?\"react-console-focus\":\"react-console-nofocus\")}\n\t\t\t\tonClick={this.focus}\n\t\t\t>\n\t\t\t{this.props.welcomeMessage?\n\t\t\t\t
\n\t\t\t\t\t{this.props.welcomeMessage}\n\t\t\t\t
\n\t\t\t\t: null\n\t\t\t}\n\t\t\t{this.state.log.map( (val: LogEntry) => {\n\t\t\t\treturn [\n\t\t\t\t\t,\n\t\t\t\t\t...val.message.map( (val: LogMessage, idx: number) => {\n\t\t\t\t\t\treturn ;\n\t\t\t\t\t})\n\t\t\t\t];\n\t\t\t})}\n\t\t\t{this.state.acceptInput?\n\t\t\t\t\n\t\t\t\t: null\n\t\t\t}\n\t\t\t
\n\t\t\t\t this.child.typer = ref}\n\t\t\t\t\tclassName=\"react-console-typer\"\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tautoCorrect=\"off\"\n\t\t\t\t\tautoCapitalize=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\tstyle={{ outline: \"none\",\n\t\t\t\t\t\tcolor: \"transparent\",\n\t\t\t\t\t\tbackgroundColor: \"transparent\",\n\t\t\t\t\t\tborder: \"none\",\n\t\t\t\t\t\tresize: \"none\",\n\t\t\t\t\t\toverflow: \"hidden\",\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={this.blur}\n\t\t\t\t\tonKeyDown={this.keyDown}\n\t\t\t\t\tonChange={this.change}\n\t\t\t\t\tonPaste={this.paste}\n\t\t\t\t>\n\t\t\t
\n\t\t\t
this.child.focus = ref}> 
\n\t\t
;\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react-console.tsx","module.exports = require(\"react\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 1\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./react-console.scss\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/server.js b/server.js index fda9663..aed3e51 100755 --- a/server.js +++ b/server.js @@ -55,6 +55,7 @@ compiler.watch({},function(err,stats) { }); // Karma test server +/* let karmaServer = new karma.Server({ configFile: `${__dirname}/karma.conf.js`, singleRun: false, @@ -66,3 +67,4 @@ karmaServer.on('run_complete', function() { logEnd(); }); karmaServer.start(); +*/ \ No newline at end of file diff --git a/src/react-console.tsx b/src/react-console.tsx index d2bb870..5a62008 100644 --- a/src/react-console.tsx +++ b/src/react-console.tsx @@ -73,28 +73,68 @@ class ConsolePrompt extends React.Component { } } +interface ConsoleTableHeaderProps { + headers?: string[]; +} +let ConsoleTableHeader: React.SFC = function(props: ConsoleTableHeaderProps){ + if(props.headers){ + return + + {props.headers.map((header: string) => { + return { header }; + })} + + + } + return null; +} + interface ConsoleMessageProps { type?: string; + isTable?: boolean; value: any[]; } let ConsoleMessage: React.SFC = function(props: ConsoleMessageProps) { - return
- {props.value.map((val: any)=>{ - if(typeof val == 'string') { - return val; - } else { - return JSON.stringify(val); - } - }).join("\n")} -
; + if(props.isTable){ + const data = props.value[0]; + return
+ + + + {data.rows && data.rows.map((row: string[], index: number) => { + return {row.map((cell: string, cellIndex: number) => { + return ; }) + }; + })} + +
{cell}
+
; + }else{ + return
+ {props.value.map((val: any)=>{ + if(typeof val == 'string') { + return val; + } else { + return JSON.stringify(val); + } + }).join("\n")} +
; + } } ConsoleMessage.defaultProps = { type: null, value: [], + isTable: false +} + +export interface ConsoleTableObject { + rows: Array; + headers?: Array; } export interface LogMessage { type?: string; + isTable?: boolean; value: any[]; } export interface LogEntry { @@ -189,6 +229,13 @@ export default class extends React.Component { log: log, }, this.scrollIfBottom() ); } + logTable = (tableData: ConsoleTableObject) => { + let log = this.state.log; + log[this.state.log.length-1].message.push({isTable: true, value: [tableData]}); + this.setState({ + log: log, + }, this.scrollIfBottom() ); + } return = () => { this.setState({ acceptInput: true, @@ -968,7 +1015,7 @@ export default class extends React.Component { return [ , ...val.message.map( (val: LogMessage, idx: number) => { - return ; + return ; }) ]; })}