update after review

pull/5370/head
LianaHus 5 years ago
parent f7a39b036e
commit 1426cad1a6
  1. 47
      package-lock.json
  2. 2
      package.json
  3. 6
      src/app.js
  4. 20
      src/app/components/plugin-manager-component.js
  5. 18
      src/app/panels/tab-proxy.js
  6. 2
      src/app/panels/terminal.js
  7. 8
      src/app/tabs/test-tab.js

47
package-lock.json generated

@ -1778,9 +1778,9 @@
"integrity": "sha512-ePDxG9UuU9Kobk90ZUjtmDW8IT9U7aRb1/Rl9683MRNM+ur0ocHL2v7TPH2ajTiVSBUFbbeW8vKIt9jrb0JIAA=="
},
"@remixproject/engine": {
"version": "0.2.0-alpha.1",
"resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.2.0-alpha.1.tgz",
"integrity": "sha512-KeYCDBa02MddlyCDSF7YGTZgVcOWeNt4MEcTT/IMpHRyAht0apAq+2MDCMH3l1/wZ3ggiH0ZV12KxM/ZcQ92UQ=="
"version": "0.2.0-alpha.4",
"resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.2.0-alpha.4.tgz",
"integrity": "sha512-AY6HaF7Y4fR1oOdz60B2zt+gGftaT5fZWSl5ka7UuDHZUzeouNMx4O1+Uk4376Mv+M3vdmpGFo6KgfsZj6wSJw=="
},
"@resolver-engine/core": {
"version": "0.3.3",
@ -6737,8 +6737,7 @@
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"optional": true
"bundled": true
},
"aproba": {
"version": "1.2.0",
@ -6756,13 +6755,11 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"optional": true
"bundled": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -6775,18 +6772,15 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"core-util-is": {
"version": "1.0.2",
@ -6889,8 +6883,7 @@
},
"inherits": {
"version": "2.0.4",
"bundled": true,
"optional": true
"bundled": true
},
"ini": {
"version": "1.3.5",
@ -6900,7 +6893,6 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -6913,20 +6905,17 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"optional": true
"bundled": true
},
"minipass": {
"version": "2.9.0",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -6943,7 +6932,6 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -7024,8 +7012,7 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"object-assign": {
"version": "4.1.1",
@ -7035,7 +7022,6 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -7111,8 +7097,7 @@
},
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"optional": true
"bundled": true
},
"safer-buffer": {
"version": "2.1.2",
@ -7142,7 +7127,6 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -7160,7 +7144,6 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -7199,13 +7182,11 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"optional": true
"bundled": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
"optional": true
"bundled": true
}
}
},

@ -78,7 +78,7 @@
"yo-yoify": "^3.7.3"
},
"dependencies": {
"@remixproject/engine": "^0.2.0-alpha.1",
"@remixproject/engine": "^0.2.0-alpha.4",
"http-server": "^0.11.1",
"remixd": "0.1.8-alpha.10",
"standard": "^8.5.0"

@ -308,9 +308,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const mainview = new MainView(contextualListener, editor, appPanel, fileManager, appManager, terminal)
registry.put({ api: mainview, name: 'mainview' })
engine.register([
appPanel
])
engine.register(appPanel)
// those views depend on app_manager
const menuicons = new VerticalIcons(appManager)
@ -415,6 +413,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
}
if (isElectron()) {
appManager.activatePlugin(['remixd'])
appManager.activatePlugin('remixd')
}
}

@ -87,7 +87,11 @@ class PluginManagerComponent extends ViewPlugin {
this.appManager.event.on('added', () => { this.reRender() })
}
renderItem (profile, isActive) {
isActive (name) {
return this.appManager.actives.includes(name)
}
renderItem (profile) {
const displayName = (profile.displayName) ? profile.displayName : profile.name
// Check version of the plugin
@ -101,11 +105,12 @@ class PluginManagerComponent extends ViewPlugin {
versionWarning = yo`<small title="Version Beta" class="${css.versionWarning} plugin-version">beta</small>`
}
const activationButton = isActive
const activationButton = this.isActive(profile.name)
? yo`
<button onclick="${_ => this.appManager.deactivatePlugin(profile.name)}" class="btn btn-secondary btn-sm" data-id="pluginManagerComponentDeactivateButton${name}">
Deactivate
</button>`
</button>
`
: yo`
<button onclick="${_ => this.appManager.activatePlugin(profile.name)}" class="btn btn-success btn-sm" data-id="pluginManagerComponentActivateButton${name}">
Activate
@ -161,7 +166,7 @@ class PluginManagerComponent extends ViewPlugin {
}
// Filter all active and inactive modules that are not required
const isActive = (name) => { return this.appManager.actives.includes(name) }
const {actives, inactives} = this.appManager.getAll()
.filter(isFiltered)
@ -169,7 +174,8 @@ class PluginManagerComponent extends ViewPlugin {
.filter(isNotHome)
.sort(sortByName)
.reduce(({actives, inactives}, profile) => {
return isActive(profile.name) ? { actives: [...actives, profile], inactives }
return this.isActive(profile.name)
? { actives: [...actives, profile], inactives }
: { inactives: [...inactives, profile], actives }
}, { actives: [], inactives: [] })
@ -201,11 +207,11 @@ class PluginManagerComponent extends ViewPlugin {
<section data-id="pluginManagerComponentPluginManagerSection">
${activeTile}
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile">
${actives.map(profile => this.renderItem(profile, isActive(profile.name)))}
${actives.map(profile => this.renderItem(profile))}
</div>
${inactiveTile}
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentInactiveTile">
${inactives.map(profile => this.renderItem(profile, isActive(profile.name)))}
${inactives.map(profile => this.renderItem(profile))}
</div>
</section>
${settings}

@ -49,19 +49,19 @@ export class TabProxy {
})
})
appManager.event.on('activate', (profile) => {
if (profile.location === 'mainPanel') {
appManager.event.on('activate', ({ name, location, displayName, icon }) => {
if (location === 'mainPanel') {
this.addTab(
profile.name,
profile.displayName,
() => this.event.emit('switchApp', profile.name),
name,
displayName,
() => this.event.emit('switchApp', name),
() => {
this.event.emit('closeApp', profile.name)
this.appManager.deactivatePlugin(profile.name)
this.event.emit('closeApp', name)
this.appManager.deactivatePlugin(name)
},
profile.icon
icon
)
this.switchTab(profile.name)
this.switchTab(name)
}
})

@ -45,7 +45,7 @@ class Terminal extends Plugin {
self._api = api
self._opts = opts
self.data = {
lineLength: opts.lineLength || 80, // ???
lineLength: opts.lineLength || 80, // ????
session: [],
activeFilters: { commands: {}, input: '' },
filterFns: {}

@ -30,11 +30,11 @@ module.exports = class TestTab extends ViewPlugin {
this.appManager = appManager
this.renderer = renderer
this.baseurl = 'https://solc-bin.ethereum.org/bin'
appManager.event.on('activate', (profile) => {
if (profile.name === 'solidity') this.updateRunAction(fileManager.currentFile())
appManager.event.on('activate', (name) => {
if (name === 'solidity') this.updateRunAction(fileManager.currentFile())
})
appManager.event.on('deactivate', (profile) => {
if (profile.name === 'solidity') this.updateRunAction(fileManager.currentFile())
appManager.event.on('deactivate', (name) => {
if (name === 'solidity') this.updateRunAction(fileManager.currentFile())
})
}

Loading…
Cancel
Save