- hash |
- {opts.hash}
-
+
+
+ hash
+ |
+
+ {opts.hash}
+
|
) : null}
{opts.input ? (
-
- input |
- {helper.shortenHexData(opts.input)}
-
+
+
+ input
+ |
+
+ {helper.shortenHexData(opts.input)}
+
|
) : null}
{opts['decoded input'] ? (
-
- decoded input |
- {opts['decoded input'].trim()}
-
+ |
+
+ decoded input
+ |
+
+ {opts['decoded input'].trim()}
+
|
) : null}
{opts['decoded output'] ? (
-
- decoded output |
- {opts['decoded output']}
-
+ |
+
+ decoded output
+ |
+
+ {opts['decoded output']}
+
|
) : null}
{opts.logs ? (
-
- logs |
-
+ |
+
+ logs
+ |
+
{JSON.stringify(stringified, null, '\t')}
-
-
+
+
|
) : null}
{opts.val ? (
-
- val |
- {val} wei
-
+ |
+
+ val
+ |
+
+ {val} wei
+
|
) : null}
diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
index 8b729f07d4..3c13ed625c 100644
--- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
+++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
@@ -24,7 +24,7 @@ export interface ClipboardEvent extends SyntheticEvent {
}
export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
- const { call, _deps, on, config, event, gistHandler, logHtmlResponse, logResponse, version } = props.plugin
+ const { call, _deps, on, config, event, gistHandler, version } = props.plugin
const [toggleDownUp, setToggleDownUp] = useState('fa-angle-double-down')
const [_cmdIndex, setCmdIndex] = useState(-1)
const [_cmdTemp, setCmdTemp] = useState('')
@@ -84,12 +84,15 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
}
useEffect(() => {
- scriptRunnerDispatch({ type: 'html', payload: { message: logHtmlResponse } })
- }, [logHtmlResponse])
-
- useEffect(() => {
- scriptRunnerDispatch({ type: 'log', payload: { message: logResponse } })
- }, [logResponse])
+ props.onReady({
+ logHtml: (html) => {
+ scriptRunnerDispatch({ type: 'html', payload: { message: [html.innerText] } })
+ },
+ log: (message) => {
+ scriptRunnerDispatch({ type: 'log', payload: { message: [message] } })
+ }
+ })
+ }, [])
// events
useEffect(() => {
@@ -115,7 +118,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
useEffect(() => {
scrollToBottom()
- }, [newstate.journalBlocks.length, logHtmlResponse.length, toaster])
+ }, [newstate.journalBlocks.length, toaster])
function execute (file, cb) {
function _execute (content, cb) {
diff --git a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts
index 66eea4d655..7a77b11dab 100644
--- a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts
+++ b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts
@@ -24,5 +24,6 @@ export const LISTEN_ON_NETWORK = 'listenOnNetWork'
export const CMD_HISTORY = 'cmdHistory'
export interface RemixUiTerminalProps {
- plugin: any
+ plugin: any,
+ onReady: (api: any) => void
}
diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts
index b92d7b041e..152b283fa9 100644
--- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts
+++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts
@@ -504,11 +504,11 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...state,
browser: {
...state.browser,
- contextMenu: state.mode === 'browser' ? addContextMenuItem(state, payload) : state.browser.contextMenu
+ contextMenu: addContextMenuItem(state, payload)
},
localhost: {
...state.localhost,
- contextMenu: state.mode === 'localhost' ? addContextMenuItem(state, payload) : state.localhost.contextMenu
+ contextMenu: addContextMenuItem(state, payload)
}
}
}
@@ -520,11 +520,11 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...state,
browser: {
...state.browser,
- contextMenu: state.mode === 'browser' ? removeContextMenuItem(state, payload) : state.browser.contextMenu
+ contextMenu: removeContextMenuItem(state, payload)
},
localhost: {
...state.localhost,
- contextMenu: state.mode === 'localhost' ? removeContextMenuItem(state, payload) : state.localhost.contextMenu
+ contextMenu: removeContextMenuItem(state, payload)
}
}
}
@@ -536,11 +536,11 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...state,
browser: {
...state.browser,
- expandPath: state.mode === 'browser' ? payload : state.browser.expandPath
+ expandPath: payload
},
localhost: {
...state.localhost,
- expandPath: state.mode === 'localhost' ? payload : state.localhost.expandPath
+ expandPath: payload
}
}
}
| |