|
|
@ -129,12 +129,12 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { |
|
|
|
if (output) scriptRunnerDispatch({ type: 'script', payload: { message: '5' } }) |
|
|
|
if (output) scriptRunnerDispatch({ type: 'script', payload: { message: '5' } }) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, { activate: true }, dispatch) |
|
|
|
}, { activate: true }, dispatch) |
|
|
|
}, [props.thisState.autoCompletePopup, autoCompletState.text, props.logHtml]) |
|
|
|
}, [props.thisState.autoCompletePopup, autoCompletState.text]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
scrollToBottom() |
|
|
|
scrollToBottom() |
|
|
|
console.log({ messagesEndRef: messagesEndRef.current }, ' onScroll') |
|
|
|
console.log({ messagesEndRef: messagesEndRef.current }, ' onScroll') |
|
|
|
}, [newstate.journalBlocks.length]) |
|
|
|
}, [newstate.journalBlocks.length, props.logHtml.length]) |
|
|
|
|
|
|
|
|
|
|
|
function execute (file, cb) { |
|
|
|
function execute (file, cb) { |
|
|
|
console.log('called execute scriptRunner') |
|
|
|
console.log('called execute scriptRunner') |
|
|
@ -261,8 +261,9 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { |
|
|
|
setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[0]).toString() })) |
|
|
|
setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[0]).toString() })) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
console.log(autoCompletState.activeSuggestion, 'autoCompletState.userInput.length') |
|
|
|
console.log(autoCompletState.activeSuggestion, 'autoCompletState.userInput.length') |
|
|
|
setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[autoCompletState.activeSuggestion]).toString() })) |
|
|
|
setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: inputEl.current.value })) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log({ autoCompletState }, 'autoCompletState') |
|
|
|
} |
|
|
|
} |
|
|
|
if (event.which === 13 && !autoCompletState.showSuggestions) { |
|
|
|
if (event.which === 13 && !autoCompletState.showSuggestions) { |
|
|
|
if (event.ctrlKey) { // <ctrl+enter>
|
|
|
|
if (event.ctrlKey) { // <ctrl+enter>
|
|
|
@ -883,11 +884,11 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { |
|
|
|
return (<div className='px-4 block' data-id={`block_tx${trans.tx.hash}`} key={index}> {renderKnownTransactions(trans.tx, trans.receipt, trans.resolvedData, trans.logs, index)} </div>) |
|
|
|
return (<div className='px-4 block' data-id={`block_tx${trans.tx.hash}`} key={index}> {renderKnownTransactions(trans.tx, trans.receipt, trans.resolvedData, trans.logs, index)} </div>) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
return x.message.map((x, i) => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="px-4 block" data-id="block_null" key={index}> |
|
|
|
<div className="px-4 block" data-id="block_null" key={i}>{ x }</div> |
|
|
|
<span className={x.style}>{x.message}</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
})} |
|
|
|
})} |
|
|
|
<div ref={messagesEndRef} /> |
|
|
|
<div ref={messagesEndRef} /> |
|
|
|