add mainPanelComponent

pull/1/head
yann300 6 years ago
parent 454778e474
commit 7c62812ece
  1. 2
      package.json
  2. 17
      src/app.js
  3. 1
      src/app/components/swap-panel-api.js
  4. 1
      src/app/components/swap-panel-component.js
  5. 10
      src/app/panels/editor-panel.js
  6. 28
      src/remixAppManager.js

@ -42,7 +42,7 @@
"remix-analyzer": "0.3.1",
"remix-debug": "0.3.1",
"remix-lib": "0.4.1",
"remix-plugin": "0.0.1-alpha.7",
"remix-plugin": "0.0.1-alpha.8",
"remix-solidity": "0.3.1",
"remix-tests": "0.1.1",
"remixd": "0.1.8-alpha.6",

@ -411,12 +411,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const pluginManagerComponent = new PluginManagerComponent()
const swapPanelComponent = new SwapPanelComponent()
const mainPanelComponent = new SwapPanelComponent()
const verticalIconComponent = new VerticalIconsComponent()
const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent) // eslint-disable-line
const mainPanelApi = new SwapPanelApi(mainPanelComponent, verticalIconComponent) // eslint-disable-line
const verticalIconsApi = new VerticalIconsApi(verticalIconComponent) // eslint-disable-line
let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} })
const appManager = new RemixAppManager(appStore, swapPanelApi, verticalIconsApi)
const appManager = new RemixAppManager(appStore, swapPanelApi, mainPanelApi, verticalIconsApi)
registry.put({api: appManager.proxy(), name: 'pluginmanager'})
pluginManagerComponent.setApp(appManager)
@ -425,7 +427,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
self._components.editorpanel.init()
self._components.fileManager.init()
self._view.mainpanel.appendChild(self._components.editorpanel.render())
self._view.mainpanel.appendChild(mainPanelComponent.render())
self._view.iconpanel.appendChild(verticalIconComponent.render())
self._view.swappanel.appendChild(swapPanelComponent.render())
@ -458,6 +460,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
{ profile: sourceHighlighters.profile(), api: sourceHighlighters },
{ profile: configProvider.profile(), api: configProvider },
{ profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy },
{ profile: self._components.editorpanel.profile(), api: self._components.editorpanel },
{ profile: filePanel.profile(), api: filePanel },
{ profile: support.profile(), api: support },
{ profile: settings.profile(), api: settings },
@ -481,9 +484,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// warn the content that it is being displayed. TODO should probably be done in each view
if (current && current.api.__showing) current.api.__showing()
})
mainPanelApi.event.on('showing', (moduleName) => {
if (moduleName === 'code editor') {
verticalIconComponent.select('file explorers')
this._components.resizeFeature.maximise()
return
}
this._components.resizeFeature.minimize()
})
verticalIconComponent.select('file explorers')
verticalIconComponent.select('code editor')
// The event listener needs to be registered as early as possible, because the
// parent will send the message upon the "load" event.
var filesToLoad = null

@ -6,6 +6,7 @@ class SwapPanelApi {
this.component = swapPanelComponent
this.currentContent
verticalIconsComponent.event.on('showContent', (moduleName) => {
if (!swapPanelComponent.contents[moduleName]) return
if (this.currentContent === moduleName) {
this.event.emit('toggle')
return

@ -23,7 +23,6 @@ class SwapPanelComponent {
this.currentNode = moduleName
return
}
console.log(`${moduleName} not found`)
}
add (moduleName, content) {

@ -22,6 +22,16 @@ class EditorPanel {
self._components.editor = new Editor({})
self._components.registry.put({api: self._components.editor, name: 'editor'})
}
profile () {
return {
name: 'code editor',
methods: [],
events: [],
icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4=',
description: ' - ',
prefferedLocation: 'mainPanel'
}
}
init () {
var self = this
self._deps = {

@ -4,8 +4,13 @@ import PluginManagerProxy from './app/components/plugin-manager-proxy'
export class RemixAppManager extends AppManagerApi {
constructor (store, swapPanelApi, verticalIconsApi) {
constructor (store, swapPanelApi, mainPanelApi, verticalIconsApi) {
super(null)
this.location = {
'default': swapPanelApi,
'swapPanel': swapPanelApi,
'mainPanel': mainPanelApi
}
this.store = store
this.verticalIconsApi = verticalIconsApi
this.swapPanelApi = swapPanelApi
@ -51,7 +56,11 @@ export class RemixAppManager extends AppManagerApi {
// if there's an icon, we add to the swap panel
// if not we suppose it just need to be put to DOM (that would be)
if (profile.icon) {
this.swapPanelApi.add(profile, domEl)
var panel = this.location[profile.prefferedLocation] ? this.location[profile.prefferedLocation] : this.location['default']
domEl.style.height = '100%'
domEl.style.width = '100%'
domEl.style.border = '0'
panel.add(profile, domEl)
this.verticalIconsApi.addIcon(profile)
return
}
@ -77,9 +86,20 @@ export class RemixAppManager extends AppManagerApi {
notifications: {
'solCompiler': ['getCompilationFinished']
},
url: 'https://ipfs.io/ipfs/Qmdu56TjQLMQmwitM6GRZXwvTWh8LBoNCWmoZbSzykPycJ/',
url: 'https://ipfs.io/ipfs/QmbxaFhAzSYbQ4TNQhCQqBgW3dFMt7Zj1D2achHHYvJhkz/',
description: 'generate solidity documentation'
}
return [{ profile: ethDoc, api: new Plugin(ethDoc, { resolveLocaton: (iframe) => { return this.resolveLocation(ethDoc, iframe) } }) }]
var pipeline = {
name: 'pipeline',
events: [],
methods: [],
notifications: {},
url: 'https://pipeline.pipeos.one',
description: ' - ',
icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwb2x5Z29uIGZpbGw9Im5vbmUiIHBvaW50cz0iNDksMTQgMzYsMjEgMzYsMjkgICA0OSwzNiAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjxwYXRoIGQ9Ik0zNiwzNmMwLDIuMjA5LTEuNzkxLDQtNCw0ICBINWMtMi4yMDksMC00LTEuNzkxLTQtNFYxNGMwLTIuMjA5LDEuNzkxLTQsNC00aDI3YzIuMjA5LDAsNCwxLjc5MSw0LDRWMzZ6IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=',
prefferedLocation: 'mainPanel'
}
return [{ profile: ethDoc, api: new Plugin(ethDoc, { resolveLocaton: (iframe) => { return this.resolveLocation(ethDoc, iframe) } }) },
{ profile: pipeline, api: new Plugin(pipeline, { resolveLocaton: (iframe) => { return this.resolveLocation(pipeline, iframe) } }) }]
}
}

Loading…
Cancel
Save