From 30043df2e5778f0835e5b0e02626a93a4669a04b Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 28 Feb 2024 11:37:47 +0100 Subject: [PATCH 1/5] fix radio button and ctrl+s to save for vyper --- apps/vyper/src/app/app.tsx | 14 ++++++++++---- .../solidity-compiler/src/lib/api/compiler-api.ts | 10 ++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx index 18fc0f5a86..c971468947 100644 --- a/apps/vyper/src/app/app.tsx +++ b/apps/vyper/src/app/app.tsx @@ -131,11 +131,17 @@ const App = () => { -
+
-
- setEnvironment('remote')} label="Remote Compiler" className={`${state.environment === 'remote' ? 'd-flex mr-4' : 'd-flex mr-4 cursor-status'}`} /> - setEnvironment('local')} label="Local Compiler" className={`${state.environment === 'local' ? '' : `cursor-status`}`} /> +
+
+ setEnvironment('remote')} className={`custom-control-input ${state.environment === 'remote' ? 'd-flex mr-4' : 'd-flex mr-4 cursor-status'}`} /> + +
+
+ setEnvironment('local')} className={`custom-control-input ${state.environment === 'local' ? '' : `cursor-status`}`} /> + +
diff --git a/libs/remix-ui/solidity-compiler/src/lib/api/compiler-api.ts b/libs/remix-ui/solidity-compiler/src/lib/api/compiler-api.ts index 68e62915c5..0528aeda0a 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/api/compiler-api.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/api/compiler-api.ts @@ -28,7 +28,7 @@ export const CompilerApiMixin = (Base) => class extends Base { onContentChanged: () => void onFileClosed: (name: string) => void statusChanged: (data: { key: string, title?: string, type?: string }) => void - + setSolJsonBinData: (urls: iSolJsonBinData) => void initCompilerApi () { @@ -336,7 +336,7 @@ export const CompilerApiMixin = (Base) => class extends Base { await this.call('editor', 'addAnnotation', pos, file) } } - } + } } this.compiler.event.register('compilationFinished', this.data.eventHandlers.onCompilationFinished) @@ -360,6 +360,8 @@ export const CompilerApiMixin = (Base) => class extends Base { else this.compileTabLogic.runCompiler(undefined) } else if (this.currentFile && this.currentFile.endsWith('.circom')) { await this.call('circuit-compiler', 'compile', this.currentFile) + } else if (this.currentFile && this.currentFile.endsWith('.vy')) { + await this.call('vyper', 'vyperCompileCustomAction', this.currentFile) } } } @@ -370,7 +372,7 @@ export const CompilerApiMixin = (Base) => class extends Base { return new Promise((resolve) => { if (!data.contracts || (data.contracts && Object.keys(data.contracts).length === 0)) { return resolve({ - contractMap: {}, + contractMap: {}, contractsDetails: {}, target: source.target }) @@ -386,7 +388,7 @@ export const CompilerApiMixin = (Base) => class extends Base { ) }) return resolve({ - contractMap, + contractMap, contractsDetails, target: source.target }) From d8826c0bd37ebce09e5410bfd04d87e27493b19b Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 28 Feb 2024 14:41:41 +0100 Subject: [PATCH 2/5] fix new vyper icon in tab heading --- apps/remix-ide/src/app/panels/tab-proxy.js | 16 +++++++++++++++- apps/remix-ide/src/assets/img/vyperLogo2.webp | Bin 0 -> 2556 bytes 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 apps/remix-ide/src/assets/img/vyperLogo2.webp diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index 984efe7534..fa6521023a 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -224,9 +224,23 @@ export class TabProxy extends Plugin { this.removeTab(oldName) } + /** + * + * @param {string} name + * @param {string} title + * @param {Function} switchTo + * @param {Function} close + * @param {string} icon + * @param {string} description + * @returns + */ addTab (name, title, switchTo, close, icon, description = '') { if (this._handlers[name]) return this.renderComponent() + if ((name.endsWith('.vy') && icon === undefined) || title.includes('Vyper')) { + icon = 'assets/img/vyperLogo2.webp' + } + var slash = name.split('/') const tabPath = slash.reverse() const tempTitle = [] @@ -292,7 +306,7 @@ export class TabProxy extends Plugin { if (!previous && tab.name === name) { if(index - 1 >= 0 && this.loadedTabs[index - 1]) previous = this.loadedTabs[index - 1] - else if (index + 1 && this.loadedTabs[index + 1]) + else if (index + 1 && this.loadedTabs[index + 1]) previous = this.loadedTabs[index + 1] } return tab.name !== name diff --git a/apps/remix-ide/src/assets/img/vyperLogo2.webp b/apps/remix-ide/src/assets/img/vyperLogo2.webp new file mode 100644 index 0000000000000000000000000000000000000000..fc8599362730673b65abfe2218246956b419a847 GIT binary patch literal 2556 zcmV<|BMM6+kP&il$0000G0000{0RVOZ06|PpNcaT+00E!?0FWU$ zs@=QTwr$(CZQHhOXY#g<*tTsar`TCkoXt*kRXsN%Ai0g?NKz=Ufz6pUNB;nLa~uVR z|8U^KP5&h9^yc?kCjz08bI31e?x3IYIBd&;TG7Gh#2$PW{T=u3l?5WW%^vi7ZZAmZ z<7d!60&U6Wg3?gqB-)ZE3*z`dwmoQ9T+<>+LaZ;)wp^+BRvO+z8?!m79Ar9-w!4T6-au`S?cm{<5|HR3+Mgb;k>M5+$kzhk zT!jR9Qux(RVIz`AWB%!ZByv2;OWGj~LfC&*qB}?Zs~^nfqP=`N;MaU;L<3ZQtCdk2riGxCnfG8O=!w!i9%F1OBJdzS+bCo#WD-7 zh{|9ILs<4om$h`krBOJe^gX1@7k?m1JWJk1!YuvVFi7Y)d= zC~Q2#04_QJU>lk-rQA3bUeE^(QOIJhmn3%~nsJoyint$M$=7JglyGBd_mip!#MbtU=NjzzuZOyM>jiv+LdGc-rpidEnZB)M&nqV+p?W4a*9^@Ni5&=f+G z!JG4qIj)Qz(yYp8ahFk784W&U)E3hIMpa0Y+%~CFI>)3+X}o&|RZK@3R51;@X3l$+(<J{0=#GfIv7VRyx7U@c@MY&>Y5w6@?bStVp)*!u7bd)bi?Kp|#$Wb6Ojiv}RF zl+O!;fs-`h#Gtiyai=K&XvJh_?O|(L0L7T`k`08ka{{Qwln4FIgPCyvKsiQx&+AVj z#w7#*{RpM@_zTzaHZcG|M>?wg{`B3s`gP|-@FHpwAb!Jnt4@X7^d(_u_ig%USi_9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From: Joseph Izang Date: Wed, 28 Feb 2024 15:36:06 +0100 Subject: [PATCH 3/5] fix css --- apps/vyper/src/app/app.css | 4 ++++ apps/vyper/src/app/app.tsx | 2 +- apps/vyper/src/app/components/CompileErrorCard.tsx | 5 +---- apps/vyper/src/app/components/VyperResult.tsx | 5 ++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/vyper/src/app/app.css b/apps/vyper/src/app/app.css index 23eae179b3..2d05f1fead 100644 --- a/apps/vyper/src/app/app.css +++ b/apps/vyper/src/app/app.css @@ -262,3 +262,7 @@ html, body, #root, main { padding: 0; border-radius: 0; } + +.vyper-panel-width { + width: 94%; +} diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx index c971468947..165e9a4735 100644 --- a/apps/vyper/src/app/app.tsx +++ b/apps/vyper/src/app/app.tsx @@ -149,7 +149,7 @@ const App = () => {
- + Specify the{' '} compiler version diff --git a/apps/vyper/src/app/components/CompileErrorCard.tsx b/apps/vyper/src/app/components/CompileErrorCard.tsx index 761d64f6e8..e9489c6e1e 100644 --- a/apps/vyper/src/app/components/CompileErrorCard.tsx +++ b/apps/vyper/src/app/components/CompileErrorCard.tsx @@ -5,11 +5,8 @@ export function CompileErrorCard(props: any) { return (
-
-
-