add status bar

pull/4774/head
Joseph Izang 7 months ago
parent f13f775c7a
commit 4b73ad2399
  1. 13
      apps/remix-ide/src/app.js
  2. 51
      apps/remix-ide/src/app/components/status-bar.tsx
  3. 19
      apps/remix-ide/src/types/index.d.ts
  4. 1
      libs/remix-ui/app/src/lib/remix-app/remix-app.tsx
  5. 11
      libs/remix-ui/app/src/lib/remix-app/style/remix-app.css
  6. 3
      libs/remix-ui/panel/src/index.ts
  7. 4
      libs/remix-ui/panel/src/lib/plugins/panel.css
  8. 14
      libs/remix-ui/panel/src/lib/statusbar/remixui-statusbar-panel.tsx
  9. 20
      libs/remix-ui/panel/src/lib/types/index.ts
  10. 8
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css
  11. 2
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx

@ -9,6 +9,7 @@ import {Web3ProviderModule} from './app/tabs/web3-provider'
import {CompileAndRun} from './app/tabs/compile-and-run' import {CompileAndRun} from './app/tabs/compile-and-run'
import {PluginStateLogger} from './app/tabs/state-logger' import {PluginStateLogger} from './app/tabs/state-logger'
import {SidePanel} from './app/components/side-panel' import {SidePanel} from './app/components/side-panel'
import {StatusBar} from './app/components/status-bar'
import {HiddenPanel} from './app/components/hidden-panel' import {HiddenPanel} from './app/components/hidden-panel'
import {PinnedPanel} from './app/components/pinned-panel' import {PinnedPanel} from './app/components/pinned-panel'
import {VerticalIcons} from './app/components/vertical-icons' import {VerticalIcons} from './app/components/vertical-icons'
@ -301,7 +302,7 @@ class AppComponent {
const permissionHandler = new PermissionHandlerPlugin() const permissionHandler = new PermissionHandlerPlugin()
// ----------------- run script after each compilation results ----------- // ----------------- run script after each compilation results -----------
const pluginStateLogger = new PluginStateLogger() const pluginStateLogger = new PluginStateLogger()
this.engine.register([ this.engine.register([
permissionHandler, permissionHandler,
this.layout, this.layout,
@ -339,7 +340,7 @@ class AppComponent {
hardhatProvider, hardhatProvider,
ganacheProvider, ganacheProvider,
foundryProvider, foundryProvider,
externalHttpProvider, externalHttpProvider,
this.walkthroughService, this.walkthroughService,
search, search,
solidityumlgen, solidityumlgen,
@ -381,6 +382,7 @@ class AppComponent {
// those views depend on app_manager // those views depend on app_manager
this.menuicons = new VerticalIcons() this.menuicons = new VerticalIcons()
this.sidePanel = new SidePanel() this.sidePanel = new SidePanel()
this.statusBar = new StatusBar()
this.hiddenPanel = new HiddenPanel() this.hiddenPanel = new HiddenPanel()
this.pinnedPanel = new PinnedPanel() this.pinnedPanel = new PinnedPanel()
@ -389,7 +391,7 @@ class AppComponent {
const landingPage = new LandingPage(appManager, this.menuicons, fileManager, filePanel, contentImport) const landingPage = new LandingPage(appManager, this.menuicons, fileManager, filePanel, contentImport)
this.settings = new SettingsTab(Registry.getInstance().get('config').api, editor, appManager) this.settings = new SettingsTab(Registry.getInstance().get('config').api, editor, appManager)
this.engine.register([this.menuicons, landingPage, this.hiddenPanel, this.sidePanel, filePanel, pluginManagerComponent, this.settings, this.pinnedPanel]) this.engine.register([this.menuicons, landingPage, this.hiddenPanel, this.sidePanel, this.statusBar, filePanel, pluginManagerComponent, this.settings, this.pinnedPanel])
// CONTENT VIEWS & DEFAULT PLUGINS // CONTENT VIEWS & DEFAULT PLUGINS
const openZeppelinProxy = new OpenZeppelinProxy(blockchain) const openZeppelinProxy = new OpenZeppelinProxy(blockchain)
@ -470,6 +472,7 @@ class AppComponent {
'offsetToLineColumnConverter', 'offsetToLineColumnConverter',
'pluginStateLogger' 'pluginStateLogger'
]) ])
await this.appManager.activatePlugin(['statusBar'])
await this.appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs']) await this.appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs'])
await this.appManager.activatePlugin(['sidePanel']) // activating host plugin separately await this.appManager.activatePlugin(['sidePanel']) // activating host plugin separately
await this.appManager.activatePlugin(['pinnedPanel']) await this.appManager.activatePlugin(['pinnedPanel'])
@ -511,9 +514,9 @@ class AppComponent {
await this.appManager.activatePlugin(['solidity-script']) await this.appManager.activatePlugin(['solidity-script'])
await this.appManager.activatePlugin(['solcoder']) await this.appManager.activatePlugin(['solcoder'])
await this.appManager.activatePlugin(['filePanel'])
await this.appManager.activatePlugin(['filePanel'])
// Set workspace after initial activation // Set workspace after initial activation
this.appManager.on('editor', 'editorMounted', () => { this.appManager.on('editor', 'editorMounted', () => {

@ -0,0 +1,51 @@
import React from 'react'
import { EventEmitter } from 'events'
import { Plugin } from '@remixproject/engine'
import packageJson from '../../../../../package.json'
import { PluginViewWrapper } from '@remix-ui/helper'
import { PluginProfile } from '../../types'
import { RemixUIStatusBar } from '@remix-ui/panel'
const statusBarProfile: PluginProfile = {
name: 'statusBar',
displayName: 'Status Bar',
description: 'Remix IDE status bar panel',
version: packageJson.version
}
export class StatusBar extends Plugin {
htmlElement: HTMLDivElement
events: EventEmitter
dispatch: React.Dispatch<any> = () => {}
constructor() {
super(statusBarProfile)
this.events = new EventEmitter()
this.htmlElement = document.createElement('div')
this.htmlElement.setAttribute('id', 'status-bar')
}
onActivation(): void {
this.renderComponent()
}
setDispatch(dispatch: React.Dispatch<any>) {
this.dispatch = dispatch
}
renderComponent() {
this.dispatch({
plugins: this
})
}
updateComponent(state: any) {
return <RemixUIStatusBar statusBarPlugin={state.plugins} />
}
render() {
<div data-id="status-bar-container">
test
<PluginViewWrapper plugin={this} />
</div>
}
}

@ -0,0 +1,19 @@
export interface PluginProfile {
name: string
displayName: string
description: string
keywords?: string[]
icon?: string
url?: string
methods?: string[]
events?: string[]
version?: string
}
export interface StatusBarInterface extends Plugin {
htmlElement: HTMLDivElement
events: EventEmitter
dispatch: React.Dispatch<any>
setDispatch(dispatch: React.Dispatch<any>): void
}

@ -218,7 +218,6 @@ const RemixApp = (props: IRemixAppUi) => {
></DragBar> ></DragBar>
} }
</div> </div>
<div>{props.app.hiddenPanel.render()}</div>
<AppDialogs></AppDialogs> <AppDialogs></AppDialogs>
<DialogViewPlugin></DialogViewPlugin> <DialogViewPlugin></DialogViewPlugin>
</AppProvider> </AppProvider>

@ -20,6 +20,7 @@ pre {
overflow : hidden; overflow : hidden;
flex : 1; flex : 1;
min-width : 320px; min-width : 320px;
padding-bottom : 1.4rem;
} }
.iconpanel { .iconpanel {
display : flex; display : flex;
@ -27,12 +28,20 @@ pre {
overflow : hidden; overflow : hidden;
width : 50px; width : 50px;
user-select : none; user-select : none;
padding-bottom : 1.4rem;
} }
.sidepanel { .sidepanel {
display : flex; display : flex;
flex-direction : row-reverse; flex-direction : row-reverse;
width : 320px; width : 320px;
transition : width 0.25s; transition : width 0.25s;
padding-bottom : 1.4rem;
}
.statusBar {
/* width : 100%; */
/* height : 1.4rem; */
/* position : fixed; */
/* overflow : hidden; */
} }
.pinnedpanel { .pinnedpanel {
width : 320px; width : 320px;
@ -77,4 +86,4 @@ pre {
width : 4rem; width : 4rem;
right : -10px; right : -10px;
filter : opacity(0.5); filter : opacity(0.5);
} }

@ -1,4 +1,5 @@
export { default as RemixPluginPanel } from './lib/plugins/remix-ui-panel' export { default as RemixPluginPanel } from './lib/plugins/remix-ui-panel'
export { default as RemixUIMainPanel } from './lib/main/main-panel' export { default as RemixUIMainPanel } from './lib/main/main-panel'
export { PluginRecord } from './lib/types' export { PluginRecord } from './lib/types'
export { default as RemixUIPanelHeader } from './lib/plugins/panel-header' export { default as RemixUIPanelHeader } from './lib/plugins/panel-header'
export { default as RemixUIStatusBar } from './lib/statusbar/remixui-statusbar-panel'

@ -110,3 +110,7 @@ iframe {
.highlight { .highlight {
animation: highlight 2s forwards; animation: highlight 2s forwards;
} }
.remixui_height {
height: 97vh;
}

@ -0,0 +1,14 @@
import React from 'react'
import { StatusBarInterface } from '../types'
export interface RemixUIStatusBarProps {
statusBarPlugin: StatusBarInterface
}
export default function RemixUIStatusBar({ statusBarPlugin }: RemixUIStatusBarProps) {
return (
<div className="d-flex flex-row bg-primary">
<h6>Statusbar</h6>
</div>
)
}

@ -1,4 +1,5 @@
import { Profile } from '@remixproject/plugin-utils' import { Profile } from '@remixproject/plugin-utils'
import EventEmitter from 'events'
export type PluginRecord = { export type PluginRecord = {
profile: Profile profile: Profile
@ -8,3 +9,22 @@ export type PluginRecord = {
class?: string class?: string
minimized?: boolean minimized?: boolean
} }
export interface PluginProfile {
name: string
displayName: string
description: string
keywords?: string[]
icon?: string
url?: string
methods?: string[]
events?: string[]
version?: string
}
export interface StatusBarInterface extends Plugin {
htmlElement: HTMLDivElement
events: EventEmitter
dispatch: React.Dispatch<any>
setDispatch(dispatch: React.Dispatch<any>): void
}

@ -84,7 +84,7 @@
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
} }
.remixui_verticalIconContextcontainer { .remixui_verticalIconContextcontainer {
display: block; display: block;
position: fixed; position: fixed;
@ -105,7 +105,7 @@
.remixui_liitem:hover { .remixui_liitem:hover {
background-color: var(--secondary); background-color: var(--secondary);
} }
.remixui_scrollbar { .remixui_scrollbar {
overflow-y: scroll; overflow-y: scroll;
scrollbar-width: none; /* Firefox hide scrollbar */ scrollbar-width: none; /* Firefox hide scrollbar */
@ -141,6 +141,10 @@
flex-basis: 50px; flex-basis: 50px;
} }
.remixui_icons_height {
height: 97vh;
}
#menuitems { #menuitems {
list-style: none; list-style: none;
margin: 0px; margin: 0px;

@ -69,7 +69,7 @@ const RemixUiVerticalIconsPanel = ({ verticalIconsPlugin, icons }: RemixUiVertic
return ( return (
<div id="iconsP" className="h-100"> <div id="iconsP" className="h-100">
<div className="remixui_icons d-flex flex-column vh-100" ref={iconPanelRef}> <div className="remixui_icons d-flex flex-column remixui_icons_height" ref={iconPanelRef}>
<Home verticalIconPlugin={verticalIconsPlugin} /> <Home verticalIconPlugin={verticalIconsPlugin} />
<div <div
className={ className={

Loading…
Cancel
Save