minin sidepanel embed

pull/1857/head
bunsenstraat 3 years ago
parent 93a3a41c55
commit 66a2a38398
  1. 1
      apps/remix-ide/src/app.js
  2. 30
      apps/remix-ide/src/framingService.js
  3. 7
      libs/remix-ui/app/src/lib/remix-app/remix-app.tsx
  4. 5
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx

@ -221,7 +221,6 @@ class AppComponent {
// LAYOUT & SYSTEM VIEWS // LAYOUT & SYSTEM VIEWS
const appPanel = new MainPanel() const appPanel = new MainPanel()
Registry.getInstance().put({ api: self.mainview, name: 'mainview' }) Registry.getInstance().put({ api: self.mainview, name: 'mainview' })
const tabProxy = new TabProxy(fileManager, editor) const tabProxy = new TabProxy(fileManager, editor)
self.engine.register([appPanel, tabProxy]) self.engine.register([appPanel, tabProxy])

@ -1,30 +0,0 @@
export class FramingService {
constructor (verticalIcons, layout) {
this.verticalIcons = verticalIcons
}
start (params) {
this.verticalIcons.select('filePanel')
document.addEventListener('keypress', (e) => {
if (e.shiftKey && e.ctrlKey) {
if (e.code === 'KeyF') { // Ctrl+Shift+F
this.verticalIcons.select('filePanel')
} else if (e.code === 'KeyA') { // Ctrl+Shift+A
this.verticalIcons.select('pluginManager')
} else if (e.code === 'KeyS') { // Ctrl+Shift+S
this.verticalIcons.select('settings')
}
e.preventDefault()
}
})
if (params.minimizeterminal) this.mainView.minimizeTerminal()
if (params.minimizesidepanel) this.resizeFeature.hidePanel()
}
embed () {
this.mainView.minimizeTerminal()
this.resizeFeature.hidePanel()
}
}

@ -60,6 +60,13 @@ const RemixApp = (props: IRemixAppUi) => {
props.app.sidePanel.events.on('showing', () => { props.app.sidePanel.events.on('showing', () => {
setHideSidePanel(false) setHideSidePanel(false)
}) })
props.app.layout.event.on('minimizesidepanel', () => {
// the 'showing' event always fires from sidepanel, so delay this a bit
setTimeout(() => {
setHideSidePanel(true)
}, 1000)
})
} }
const components = { const components = {

@ -87,15 +87,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
props.onReady({ props.onReady({
logHtml: (html) => { logHtml: (html) => {
scriptRunnerDispatch({ type: 'html', payload: { message: [html.innerText] } }) scriptRunnerDispatch({ type: 'html', payload: { message: [html.innerText] } })
setTimeout(() => {
}, 100)
}, },
log: (message) => { log: (message) => {
setTimeout(() => {
scriptRunnerDispatch({ type: 'log', payload: { message: [message] } }) scriptRunnerDispatch({ type: 'log', payload: { message: [message] } })
}, 100)
} }
}) })
}, []) }, [])

Loading…
Cancel
Save