remix-plugin alpha.6

pull/3094/head
yann300 6 years ago
parent 27aef76b08
commit a685fb4663
  1. 64
      src/app.js
  2. 2
      src/app/components/plugin-manager-component.js
  3. 1
      src/lib/store.js

@ -413,7 +413,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const verticalIconComponent = new VerticalIconsComponent() const verticalIconComponent = new VerticalIconsComponent()
const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent) // eslint-disable-line const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent) // eslint-disable-line
const verticalIconsApi = new VerticalIconsApi(verticalIconComponent) // eslint-disable-line const verticalIconsApi = new VerticalIconsApi(verticalIconComponent) // eslint-disable-line
let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }) let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} })
const appManager = new RemixAppManager(appStore, swapPanelApi, verticalIconsApi) const appManager = new RemixAppManager(appStore, swapPanelApi, verticalIconsApi)
registry.put({api: appManager.proxy(), name: 'pluginmanager'}) registry.put({api: appManager.proxy(), name: 'pluginmanager'})
@ -421,6 +421,13 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
pluginManagerComponent.setApp(appManager) pluginManagerComponent.setApp(appManager)
pluginManagerComponent.setStore(appStore) pluginManagerComponent.setStore(appStore)
self._components.editorpanel.init()
self._components.fileManager.init()
self._view.mainpanel.appendChild(self._components.editorpanel.render())
self._view.iconpanel.appendChild(verticalIconComponent.render())
self._view.swappanel.appendChild(swapPanelComponent.render())
let filePanel = new FilePanel() let filePanel = new FilePanel()
registry.put({api: filePanel, name: 'filepanel'}) registry.put({api: filePanel, name: 'filepanel'})
let compileTab = new CompileTab(self._components.registry) let compileTab = new CompileTab(self._components.registry)
@ -433,49 +440,34 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
let sourceHighlighters = registry.get('editor').api.sourceHighlighters let sourceHighlighters = registry.get('editor').api.sourceHighlighters
let configProvider = self._components.filesProviders['config'] let configProvider = self._components.filesProviders['config']
appStore.addEntities([ appManager.init([
{ profile: this.profile(), api: this }, { profile: this.profile(), api: this },
{ profile: udapp.profile(), api: udapp }, { profile: udapp.profile(), api: udapp },
{ profile: fileManager.profile(), api: fileManager }, { profile: fileManager.profile(), api: fileManager },
{ profile: sourceHighlighters.profile(), api: sourceHighlighters }, { profile: sourceHighlighters.profile(), api: sourceHighlighters },
{ profile: configProvider.profile(), api: configProvider }, { profile: configProvider.profile(), api: configProvider },
{ profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy }, { profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy },
{ profile: compileTab.profile(), api: compileTab }, { profile: compileTab.profile(), api: compileTab },
{ profile: filePanel.profile(), api: filePanel }, { profile: filePanel.profile(), api: filePanel },
{ profile: test.profile(), api: test }, { profile: support.profile(), api: support },
{ profile: support.profile(), api: support }, { profile: settings.profile(), api: settings },
{ profile: debug.profile(), api: debug }, { profile: run.profile(), api: run },
{ profile: analysis.profile(), api: analysis }, { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }])
{ profile: settings.profile(), api: settings },
{ profile: run.profile(), api: run }, appManager.registerMany([
{ profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) { profile: debug.profile(), api: debug },
{ profile: analysis.profile(), api: analysis },
appStore.addEntities(appManager.plugins()) { profile: test.profile(), api: test }
])
appManager.registerMany(appManager.plugins())
swapPanelApi.event.on('toggle', () => { swapPanelApi.event.on('toggle', () => {
this._components.resizeFeature.panel1.clientWidth !== 0 ? this._components.resizeFeature.minimize() : this._components.resizeFeature.maximise() this._components.resizeFeature.panel1.clientWidth !== 0 ? this._components.resizeFeature.minimize() : this._components.resizeFeature.maximise()
}) })
swapPanelApi.event.on('showing', () => { this._components.resizeFeature.panel1.clientWidth === 0 ? this._components.resizeFeature.maximise() : '' }) swapPanelApi.event.on('showing', () => { this._components.resizeFeature.panel1.clientWidth === 0 ? this._components.resizeFeature.maximise() : '' })
self._components.editorpanel.init()
self._components.fileManager.init()
self._view.mainpanel.appendChild(self._components.editorpanel.render())
self._view.iconpanel.appendChild(verticalIconComponent.render())
self._view.swappanel.appendChild(swapPanelComponent.render())
appManager.activateOne('App')
appManager.activateOne('Udapp')
appManager.activateOne('FileManager')
appManager.activateOne('SourceHighlighters')
appManager.activateOne('config')
appManager.activateOne('TxListener')
appManager.activateOne('FilePanel')
appManager.activateOne('SolidityCompile')
appManager.activateOne('Run')
appManager.activateOne('PluginManager')
appManager.activateOne('Settings')
appManager.activateOne('Support')
verticalIconComponent.select('FilePanel') verticalIconComponent.select('FilePanel')

@ -33,6 +33,8 @@ class PluginManagerComponent {
this.store = store this.store = store
this.store.event.on('activate', (name) => { this.reRender() }) this.store.event.on('activate', (name) => { this.reRender() })
this.store.event.on('deactivate', (name) => { this.reRender() }) this.store.event.on('deactivate', (name) => { this.reRender() })
this.store.event.on('add', (name) => { this.reRender() })
this.store.event.on('remove', (name) => { this.reRender() })
} }
render () { render () {

@ -133,6 +133,7 @@ export class EntityStore extends Store {
add(id, entity) { add(id, entity) {
this.state.entities[id] = entity this.state.entities[id] = entity
this.state.ids.push(id) this.state.ids.push(id)
this.event.emit('add', id, entity)
} }
/** /**

Loading…
Cancel
Save