From 8a3983312f4da4206b5830941a57668e9de2c43b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 12 Jan 2022 10:44:52 +0100 Subject: [PATCH 01/67] use onSelect from Tabs --- libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx index 740dfae507..3c791d1c1b 100644 --- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx +++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx @@ -36,7 +36,7 @@ export const TabsUI = (props: TabsUIProps) => { const classNameImg = 'my-1 mr-1 text-dark ' + tab.iconClass const classNameTab = 'nav-item nav-link d-flex justify-content-center align-items-center px-2 py-1 tab' + (index === currentIndexRef.current ? ' active' : '') return ( -
{ props.onSelect(index); currentIndexRef.current = index; setSelectedIndex(index) }} ref={el => { tabsRef.current[index] = el }} className={classNameTab} title={tab.tooltip}> +
{ tabsRef.current[index] = el }} className={classNameTab} title={tab.tooltip}> {tab.icon ? () : ()} {tab.title} { props.onClose(index); event.stopPropagation() }}> @@ -88,6 +88,11 @@ export const TabsUI = (props: TabsUIProps) => { tabsElement.current = domEl tabsElement.current.addEventListener('wheel', transformScroll) }} + onSelect={(index) => { + props.onSelect(index) + currentIndexRef.current = index + setSelectedIndex(index) + }} > {props.tabs.map((tab, i) => {renderTab(tab, i)})} From 54385e2210a56d5ccb4ba6be90cc4d02aa7c64d4 Mon Sep 17 00:00:00 2001 From: David Disu Date: Wed, 12 Jan 2022 11:37:03 +0100 Subject: [PATCH 02/67] Do not clear instance list for AtAddress --- libs/remix-ui/run-tab/src/lib/actions/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/index.ts b/libs/remix-ui/run-tab/src/lib/actions/index.ts index c659b2a802..9ee2446b1c 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/index.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/index.ts @@ -548,7 +548,6 @@ export const clearInstances = () => { export const loadAddress = (contract: ContractData, address: string) => { if (!contract) return dispatch(displayPopUp('No compiled contracts found.')) - clearInstances() loadContractFromAddress(address, (cb) => { dispatch(displayNotification('At Address', `Do you really want to interact with ${address} using the current ABI definition?`, 'OK', 'Cancel', cb, null)) From 01cc36ddefee771d3900762bfbb5e233ec209b4d Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 12 Jan 2022 15:31:12 +0100 Subject: [PATCH 03/67] some fixes --- apps/remix-ide/src/app/components/side-panel.tsx | 1 + apps/remix-ide/src/app/components/vertical-icons.js | 5 +++++ .../src/lib/components/Chevron.tsx | 13 +++++++++++-- .../src/lib/components/Home.tsx | 2 +- .../src/lib/components/RequiredSection.tsx | 1 + .../src/lib/components/Settings.tsx | 1 + .../src/lib/remix-ui-vertical-icons-panel.css | 4 ++++ .../src/lib/remix-ui-vertical-icons-panel.tsx | 3 --- 8 files changed, 24 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide/src/app/components/side-panel.tsx b/apps/remix-ide/src/app/components/side-panel.tsx index 8b64d64e45..a2aa2f0119 100644 --- a/apps/remix-ide/src/app/components/side-panel.tsx +++ b/apps/remix-ide/src/app/components/side-panel.tsx @@ -63,6 +63,7 @@ export class SidePanel extends AbstractPanel { } removeView (profile) { + if(this.plugins[profile.name].active) this.call('menuicons', 'select', 'filePanel') super.removeView(profile) this.emit('pluginDisabled', profile.name) this.call('menuicons', 'unlinkContent', profile) diff --git a/apps/remix-ide/src/app/components/vertical-icons.js b/apps/remix-ide/src/app/components/vertical-icons.js index c458e9e5ef..7a4a9f8230 100644 --- a/apps/remix-ide/src/app/components/vertical-icons.js +++ b/apps/remix-ide/src/app/components/vertical-icons.js @@ -64,6 +64,11 @@ export class VerticalIcons extends Plugin { } + async activateHome() { + await this.call('manager', 'activatePlugin', 'home') + await this.call('tabs', 'focus', 'home') + } + /** * Remove an icon from the map * @param {ModuleProfile} profile The profile of the module diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx index c3c5c472ba..c75fe9062d 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx @@ -3,14 +3,23 @@ import React, { MutableRefObject } from 'react' export interface ChevronProps { divElementRef: MutableRefObject - cssRule: string + cssRule: string, + direction: string } function Chevron (props: ChevronProps) { + const click = () => { + if (props.direction === 'down') { + props.divElementRef.current.scrollBy(0, 40) + } else { + props.divElementRef.current.scrollBy(0, -40) + } + } + return ( <> { props.divElementRef.current && props.divElementRef.current.scrollHeight > props.divElementRef.current.clientHeight - ? : null } + ? : null } ) } diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx index 8801a9556f..30a5497d4c 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx @@ -11,7 +11,7 @@ function Home ({ verticalIconPlugin }: HomeProps) { return (
verticalIconPlugin.activateHome()} + onClick={async () => await verticalIconPlugin.activateHome()} // @ts-ignore plugin="home" title="Home" diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx index 766994a8ab..0f6bf3f4da 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx @@ -60,6 +60,7 @@ function RequiredSection ({ verticalIconsPlugin, itemContextAction, addActive, r scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? ( diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Settings.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Settings.tsx index f8f0c04698..b15ace9b78 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Settings.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Settings.tsx @@ -36,6 +36,7 @@ function Settings ({ scrollableRef, verticalIconsPlugin, itemContextAction, addA
{ scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? () : null } {Object.keys(verticalIconsPlugin.targetProfileForChange) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css index 5ea1595507..7566dd8dd1 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css +++ b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css @@ -116,4 +116,8 @@ #menuitems { list-style: none; margin: 0px; + } + + .remixui_icon-chevron { + cursor: pointer; } \ No newline at end of file diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx index 95ea7e58d3..112e34d0ed 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx @@ -92,9 +92,6 @@ export function RemixUiVerticalIconsPanel ({ async function itemContextAction (e: any, name: string, documentation: string) { verticalIconsPlugin.appManager.deactivatePlugin(name) - if (e.target.parentElement.classList.contains('active')) { - verticalIconsPlugin.select('filePanel') - } verticalIconsPlugin.renderComponent() } From f25fc85dfb7ba49f7b55086fd24fc76e97f3b4c7 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 13 Jan 2022 12:54:01 +0530 Subject: [PATCH 04/67] fix input encoding --- libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index dd13a983ef..4bd6c7df96 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -62,13 +62,7 @@ export function ContractGUI (props: ContractGUIProps) { return 'cannot encode empty arguments' } const multiJSON = JSON.parse('[' + multiString + ']') - let encodeObj - - if (props.evmBC) { - encodeObj = txFormat.encodeData(props.funcABI, multiJSON, props.evmBC) - } else { - encodeObj = txFormat.encodeData(props.funcABI, multiJSON, null) - } + const encodeObj = txFormat.encodeData(props.funcABI, multiJSON, null) if (encodeObj.error) { console.error(encodeObj.error) return encodeObj.error From 018ade683a22ce25da09898e44d869d040a0d750 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 13 Jan 2022 10:38:11 +0100 Subject: [PATCH 05/67] fix solidity warning in the editor --- libs/remix-ui/editor/src/lib/remix-ui-editor.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.css b/libs/remix-ui/editor/src/lib/remix-ui-editor.css index af7cd06bfd..ad1c9a7d5b 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.css +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.css @@ -10,6 +10,11 @@ width: auto; } +.monaco-hover .markdown-hover > .hover-contents:not(.code-hover-contents) { + max-width: none !important; + word-wrap: break-word; +} + .contextview { opacity: 1; position: absolute; From 5cc598cffcae9b8783f4dccbdcd735b02f5d4173 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 13 Jan 2022 11:23:30 +0100 Subject: [PATCH 06/67] fix theme parameter being case sensitive --- apps/remix-ide/src/app/tabs/theme-module.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index d66ed07854..3349e4c53b 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -6,16 +6,16 @@ import Registry from '../state/registry' const _paq = window._paq = window._paq || [] const themes = [ - { name: 'Dark', quality: 'dark', url: 'assets/css/themes/remix-dark_tvx1s2.css' }, - { name: 'Light', quality: 'light', url: 'assets/css/themes/remix-light_powaqg.css' }, - { name: 'Midcentury', quality: 'light', url: 'assets/css/themes/remix-midcentury_hrzph3.css' }, - { name: 'Black', quality: 'dark', url: 'assets/css/themes/remix-black_undtds.css' }, - { name: 'Candy', quality: 'light', url: 'assets/css/themes/remix-candy_ikhg4m.css' }, + { name: 'dark', quality: 'dark', url: 'assets/css/themes/remix-dark_tvx1s2.css' }, + { name: 'light', quality: 'light', url: 'assets/css/themes/remix-light_powaqg.css' }, + { name: 'midcentury', quality: 'light', url: 'assets/css/themes/remix-midcentury_hrzph3.css' }, + { name: 'black', quality: 'dark', url: 'assets/css/themes/remix-black_undtds.css' }, + { name: 'candy', quality: 'light', url: 'assets/css/themes/remix-candy_ikhg4m.css' }, - { name: 'Cerulean', quality: 'light', url: 'assets/css/themes/bootstrap-cerulean.min.css' }, - { name: 'Flatly', quality: 'light', url: 'assets/css/themes/bootstrap-flatly.min.css' }, - { name: 'Spacelab', quality: 'light', url: 'assets/css/themes/bootstrap-spacelab.min.css' }, - { name: 'Cyborg', quality: 'dark', url: 'assets/css/themes/bootstrap-cyborg.min.css' } + { name: 'cerulean', quality: 'light', url: 'assets/css/themes/bootstrap-cerulean.min.css' }, + { name: 'flatly', quality: 'light', url: 'assets/css/themes/bootstrap-flatly.min.css' }, + { name: 'spacelab', quality: 'light', url: 'assets/css/themes/bootstrap-spacelab.min.css' }, + { name: 'cyborg', quality: 'dark', url: 'assets/css/themes/bootstrap-cyborg.min.css' } ] const profile = { @@ -39,8 +39,10 @@ export class ThemeModule extends Plugin { }, {}) this._paq = _paq let queryTheme = (new QueryParams()).get().theme + queryTheme = queryTheme && queryTheme.toLocaleLowerCase() queryTheme = this.themes[queryTheme] ? queryTheme : null let currentTheme = this._deps.config.get('settings/theme') + currentTheme = currentTheme && currentTheme.toLocaleLowerCase() currentTheme = this.themes[currentTheme] ? currentTheme : null this.currentThemeState = { queryTheme, currentTheme } this.active = queryTheme || currentTheme || 'Dark' From 1e0d479ac2b2e8c5762988889a7f6a4f80f4fac1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 13 Jan 2022 12:16:17 +0100 Subject: [PATCH 07/67] fix lower casing the theme&& remove unneded --- apps/remix-ide/src/app/tabs/theme-module.js | 23 +++++---- .../src/lib/remix-ui-theme-module.tsx | 51 +------------------ 2 files changed, 13 insertions(+), 61 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index 3349e4c53b..e973bdd2f9 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -6,16 +6,16 @@ import Registry from '../state/registry' const _paq = window._paq = window._paq || [] const themes = [ - { name: 'dark', quality: 'dark', url: 'assets/css/themes/remix-dark_tvx1s2.css' }, - { name: 'light', quality: 'light', url: 'assets/css/themes/remix-light_powaqg.css' }, - { name: 'midcentury', quality: 'light', url: 'assets/css/themes/remix-midcentury_hrzph3.css' }, - { name: 'black', quality: 'dark', url: 'assets/css/themes/remix-black_undtds.css' }, - { name: 'candy', quality: 'light', url: 'assets/css/themes/remix-candy_ikhg4m.css' }, + { name: 'Dark', quality: 'dark', url: 'assets/css/themes/remix-dark_tvx1s2.css' }, + { name: 'Light', quality: 'light', url: 'assets/css/themes/remix-light_powaqg.css' }, + { name: 'Midcentury', quality: 'light', url: 'assets/css/themes/remix-midcentury_hrzph3.css' }, + { name: 'Black', quality: 'dark', url: 'assets/css/themes/remix-black_undtds.css' }, + { name: 'Candy', quality: 'light', url: 'assets/css/themes/remix-candy_ikhg4m.css' }, - { name: 'cerulean', quality: 'light', url: 'assets/css/themes/bootstrap-cerulean.min.css' }, - { name: 'flatly', quality: 'light', url: 'assets/css/themes/bootstrap-flatly.min.css' }, - { name: 'spacelab', quality: 'light', url: 'assets/css/themes/bootstrap-spacelab.min.css' }, - { name: 'cyborg', quality: 'dark', url: 'assets/css/themes/bootstrap-cyborg.min.css' } + { name: 'Cerulean', quality: 'light', url: 'assets/css/themes/bootstrap-cerulean.min.css' }, + { name: 'Flatly', quality: 'light', url: 'assets/css/themes/bootstrap-flatly.min.css' }, + { name: 'Spacelab', quality: 'light', url: 'assets/css/themes/bootstrap-spacelab.min.css' }, + { name: 'Cyborg', quality: 'dark', url: 'assets/css/themes/bootstrap-cyborg.min.css' } ] const profile = { @@ -35,7 +35,7 @@ export class ThemeModule extends Plugin { } this.themes = themes.reduce((acc, theme) => { theme.url = window.location.origin + window.location.pathname + theme.url - return { ...acc, [theme.name]: theme } + return { ...acc, [theme.name.toLocaleLowerCase()]: theme } }, {}) this._paq = _paq let queryTheme = (new QueryParams()).get().theme @@ -45,7 +45,7 @@ export class ThemeModule extends Plugin { currentTheme = currentTheme && currentTheme.toLocaleLowerCase() currentTheme = this.themes[currentTheme] ? currentTheme : null this.currentThemeState = { queryTheme, currentTheme } - this.active = queryTheme || currentTheme || 'Dark' + this.active = queryTheme || currentTheme || 'dark' this.forced = !!queryTheme } @@ -84,6 +84,7 @@ export class ThemeModule extends Plugin { * @param {string} [themeName] - The name of the theme */ switchTheme (themeName) { + themeName = themeName && themeName.toLocaleLowerCase() if (themeName && !Object.keys(this.themes).includes(themeName)) { throw new Error(`Theme ${themeName} doesn't exist`) } diff --git a/libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx b/libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx index 92002f3a66..9a8e22143c 100644 --- a/libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx +++ b/libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx @@ -8,55 +8,6 @@ export interface RemixUiThemeModuleProps { themeModule: ThemeModule; } -const defaultThemes = [ - { - name: 'Dark', - quality: 'dark', - url: 'assets/css/themes/remix-dark_tvx1s2.css' - }, - { - name: 'Light', - quality: 'light', - url: 'assets/css/themes/remix-light_powaqg.css' - }, - { - name: 'Midcentury', - quality: 'light', - url: 'assets/css/themes/remix-midcentury_hrzph3.css' - }, - { - name: 'Black', - quality: 'dark', - url: 'assets/css/themes/remix-black_undtds.css' - }, - { - name: 'Candy', - quality: 'light', - url: 'assets/css/themes/remix-candy_ikhg4m.css' - }, - - { - name: 'Cerulean', - quality: 'light', - url: 'assets/css/themes/bootstrap-cerulean.min.css' - }, - { - name: 'Flatly', - quality: 'light', - url: 'assets/css/themes/bootstrap-flatly.min.css' - }, - { - name: 'Spacelab', - quality: 'light', - url: 'assets/css/themes/bootstrap-spacelab.min.css' - }, - { - name: 'Cyborg', - quality: 'dark', - url: 'assets/css/themes/bootstrap-cyborg.min.css' - } -]; - export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) { const [themeName, setThemeName] = useState('') @@ -85,7 +36,7 @@ export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) { name="theme" id={theme.name} data-id={`settingsTabTheme${theme.name}`} - checked={themeModule.active === theme.name} + checked={themeModule.active === theme.name.toLocaleLowerCase()} />
- playRemi() } alt=""> + playRemi() } alt="">
-
+

Featured Plugins

startSolidity()} /> - startOptimism()} /> + startCairo()} /> startSolhint()} /> startLearnEth()} /> startSourceVerify()} /> @@ -261,11 +261,11 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {

File

- createNewFile()}>New File + createNewFile()}>New File

- + Open Files { event.stopPropagation() @@ -275,7 +275,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {

- connectToLocalhost()}>Connect to Localhost + connectToLocalhost()}>Connect to Localhost

@@ -289,28 +289,28 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {

Resources

- Documentation + Documentation

- Gitter channel + Gitter channel

- - Featuring website + + Featuring website

- - switchToPreviousVersion()}>Old experience + + switchToPreviousVersion()}>Old experience

-
+
-
-
-