diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 323cd25d40..a7b0b5adc4 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -40,7 +40,7 @@ import {HardhatProvider} from './app/providers/hardhat-provider' import {GanacheProvider} from './app/providers/ganache-provider' import {FoundryProvider} from './app/providers/foundry-provider' import {ExternalHttpProvider} from './app/providers/external-http-provider' -import { GridProviders } from './app/providers/grid-providers' +import { EnvironmentExplorer } from './app/providers/environment-explorer' import { FileDecorator } from './app/plugins/file-decorator' import { CodeFormat } from './app/plugins/code-format' import { SolidityUmlGen } from './app/plugins/solidity-umlgen' @@ -278,7 +278,7 @@ class AppComponent { const foundryProvider = new FoundryProvider(blockchain) const externalHttpProvider = new ExternalHttpProvider(blockchain) - const gridProviders = new GridProviders() + const environmentExplorer = new EnvironmentExplorer() // ----------------- convert offset to line/column service ----------- const offsetToLineColumnConverter = new OffsetToLineColumnConverter() Registry.getInstance().put({ @@ -353,7 +353,7 @@ class AppComponent { ganacheProvider, foundryProvider, externalHttpProvider, - gridProviders, + environmentExplorer, this.walkthroughService, search, solidityumlgen, diff --git a/apps/remix-ide/src/app/providers/grid-providers.tsx b/apps/remix-ide/src/app/providers/environment-explorer.tsx similarity index 93% rename from apps/remix-ide/src/app/providers/grid-providers.tsx rename to apps/remix-ide/src/app/providers/environment-explorer.tsx index a2d57c7be8..d330ca21d8 100644 --- a/apps/remix-ide/src/app/providers/grid-providers.tsx +++ b/apps/remix-ide/src/app/providers/environment-explorer.tsx @@ -11,10 +11,10 @@ import * as packageJson from '../../../../../package.json' const _paq = (window._paq = window._paq || []) const profile = { - name: 'gridProviders', - displayName: 'Grid providers', - icon: 'assets/img/deployAndRun.webp', - description: 'Pin web3 providers', + name: 'environmentExplorer', + displayName: 'Environment Explorer', + icon: 'assets/img/EnvironmentExplorerLogo.webp', + description: 'Explore providers and customize web3 provider list', location: 'mainPanel', documentation: 'https://remix-ide.readthedocs.io/en/latest/run.html', version: packageJson.version, @@ -26,7 +26,7 @@ const profile = { type ProvidersSection = `Injected` | 'Remix VMs' | 'Externals' -export class GridProviders extends ViewPlugin { +export class EnvironmentExplorer extends ViewPlugin { providers: { [key in ProvidersSection]: Provider[] } providersFlat: { [key: string]: Provider } pinnedProviders: string[] @@ -64,7 +64,7 @@ export class GridProviders extends ViewPlugin { } render() { return ( -
+
) @@ -90,17 +90,17 @@ export class GridProviders extends ViewPlugin { {this.providers['Injected'].map(provider => { return { + this.on('environmentExplorer', 'providerPinned', (name, provider) => { this.emit('shouldAddProvidertoUdapp', name, provider) }) - this.on('gridProviders', 'providerUnpinned', (name, provider) => { + this.on('environmentExplorer', 'providerUnpinned', (name, provider) => { this.emit('shouldRemoveProviderFromUdapp', name, provider) }) } @@ -531,7 +530,7 @@ export class Blockchain extends Plugin { changeExecutionContext(context, confirmCb, infoCb, cb) { if (context.context === 'item-another-chain') { - this.call('manager', 'activatePlugin', 'gridProviders').then(() => this.call('tabs', 'focus', 'gridProviders')) + this.call('manager', 'activatePlugin', 'environmentExplorer').then(() => this.call('tabs', 'focus', 'environmentExplorer')) } else { return this.executionContext.executionContextChange(context, null, confirmCb, infoCb, cb) } diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 20b69d984f..bdfd9ecf06 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -82,7 +82,8 @@ let requiredModules = [ // services + layout views + system views 'pinnedPanel', 'pluginStateLogger', 'remixGuide', - 'matomo' + 'matomo', + 'walletconnect' ] @@ -389,7 +390,16 @@ class PluginLoader { constructor() { const queryParams = new QueryParams() - this.donotAutoReload = ['remixd'] // that would be a bad practice to force loading some plugins at page load. + // some plugins should not be activated at page load. + this.donotAutoReload = [ + 'remixd', + 'environmentExplorer', + 'templateSelection', + 'compilationDetails', + 'walletconnect', + 'dapp-draft', + 'solidityumlgen' + ] this.loaders = {} this.loaders.localStorage = { set: (plugin, actives) => { diff --git a/libs/remix-ui/run-tab/src/lib/components/environment.tsx b/libs/remix-ui/run-tab/src/lib/components/environment.tsx index f62c797577..6eecbba5a5 100644 --- a/libs/remix-ui/run-tab/src/lib/components/environment.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/environment.tsx @@ -6,6 +6,11 @@ import { Dropdown } from 'react-bootstrap' import { CustomMenu, CustomToggle, CustomTooltip } from '@remix-ui/helper' export function EnvironmentUI(props: EnvironmentProps) { + + Object.entries(props.providers.providerList.filter((provider) => { return provider.isVM })) + Object.entries(props.providers.providerList.filter((provider) => { return provider.isInjected })) + Object.entries(props.providers.providerList.filter((provider) => { return !(provider.isVM || provider.isInjected) })) + const handleChangeExEnv = (env: string) => { const provider = props.providers.providerList.find((exEnv) => exEnv.name === env) const context = provider.name @@ -23,7 +28,6 @@ export function EnvironmentUI(props: EnvironmentProps) {