+
+
-
- )
-}
\ No newline at end of file
diff --git a/apps/circuit-compiler/src/app/services/circomPluginClient.ts b/apps/circuit-compiler/src/app/services/circomPluginClient.ts
index ff3170f26e0..daee5c96067 100644
--- a/apps/circuit-compiler/src/app/services/circomPluginClient.ts
+++ b/apps/circuit-compiler/src/app/services/circomPluginClient.ts
@@ -7,8 +7,8 @@ import * as compilerV218 from 'circom_wasm/v2.1.8'
import * as compilerV217 from 'circom_wasm/v2.1.7'
import * as compilerV216 from 'circom_wasm/v2.1.6'
import * as compilerV215 from 'circom_wasm/v2.1.5'
-import { extractNameFromKey, extractParentFromKey } from '@remix-ui/helper'
-import { CompilationConfig, CompilerReport, PrimeValue } from '../types'
+import { extractNameFromKey, extractParentFromKey, CompilerReport } from '@remix-ui/helper'
+import { CompilationConfig, PrimeValue } from '../types'
import isElectron from 'is-electron'
export class CircomPluginClient extends PluginClient {
diff --git a/apps/circuit-compiler/src/app/types/index.ts b/apps/circuit-compiler/src/app/types/index.ts
index bd770bbec17..33c2420cb9a 100644
--- a/apps/circuit-compiler/src/app/types/index.ts
+++ b/apps/circuit-compiler/src/app/types/index.ts
@@ -1,6 +1,7 @@
import { compiler_list } from 'circom_wasm'
import { Dispatch } from 'react'
import type { CircomPluginClient } from '../services/circomPluginClient'
+import { CompilerReport } from '@remix-ui/helper'
export type CompilerStatus = "compiling" | "computing" | "idle" | "errored" | "warning" | "exporting" | "proving"
@@ -87,34 +88,6 @@ export type CompilationConfig = {
export type PrimeValue = "bn128" | "bls12381" | "goldilocks" | "grumpkin" | "pallas" | "vesta"
-export type CompilerFeedbackProps = {
- feedback: string | CompilerReport[],
- filePathToId: Record
- setCircuitAutoCompile(e.target.checked)}
- title="Auto compile"
- checked={autoCompile}
- id="autoCompileCircuit"
- />
-
-
-
- setCircuitHideWarnings(e.target.checked)}
- id="hideCircuitWarnings"
- type="checkbox"
- title="Hide warnings"
- checked={hideWarnings}
- />
-
-
-
+
+
+
+
+
+
+
+
+ )
+}
+
+export default App
diff --git a/apps/noir-compiler/src/app/components/container.tsx b/apps/noir-compiler/src/app/components/container.tsx
new file mode 100644
index 00000000000..062149bb598
--- /dev/null
+++ b/apps/noir-compiler/src/app/components/container.tsx
@@ -0,0 +1,68 @@
+import { useContext } from 'react'
+import { CompileBtn, CompilerFeedback, CompilerReport, CustomTooltip, RenderIf } from '@remix-ui/helper'
+import { FormattedMessage } from 'react-intl'
+import { NoirAppContext } from '../contexts'
+import { CompileOptions } from '@remix-ui/helper'
+import { compileNoirCircuit } from '../actions'
+
+export function Container () {
+ const noirApp = useContext(NoirAppContext)
+
+ const showCompilerLicense = async (message = 'License not available') => {
+ try {
+ const response = await fetch('https://raw.githubusercontent.com/noir-lang/noir/master/LICENSE-APACHE')
+ if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`)
+ const content = await response.text()
+ // @ts-ignore
+ noirApp.plugin.call('notification', 'modal', { id: 'modal_noir_compiler_license', title: 'Compiler License', message: content })
+ } catch (e) {
+ // @ts-ignore
+ noirApp.plugin.call('notification', 'modal', { id: 'modal_noir_compiler_license', title: 'Compiler License', message })
+ }
+ }
+
+ const handleOpenErrorLocation = async (report: CompilerReport) => {}
+
+ const handleCircuitAutoCompile = (value: boolean) => {
+ noirApp.dispatch({ type: 'SET_AUTO_COMPILE', payload: value })
+ }
+
+ const handleCircuitHideWarnings = (value: boolean) => {
+ noirApp.dispatch({ type: 'SET_HIDE_WARNINGS', payload: value })
+ }
+
+ const askGPT = async (report: CompilerReport) => {}
+
+ const handleCompileClick = () => {
+ compileNoirCircuit(noirApp.plugin, noirApp.appState)
+ }
+
+ return (
+
+
+
+
+
+ showCompilerLicense()}>
+
+
+
+
+
+
+
+
+
+
{
@@ -43,19 +33,19 @@ export function CompilerFeedback ({ feedback, filePathToId, hideWarnings, openEr
<>
{
Array.isArray(feedback) && feedback.map((response, index) => (
-
handleOpenError(response)}>
+ (true)
+ const [showAlert, setShowAlert] = useState(true)
const handleCloseAlert = () => {
setShowAlert(false)
diff --git a/libs/remix-ui/helper/src/lib/helper-components.tsx b/libs/remix-ui/helper/src/lib/helper-components.tsx
index 663955414e3..81d7aa9d5e3 100644
--- a/libs/remix-ui/helper/src/lib/helper-components.tsx
+++ b/libs/remix-ui/helper/src/lib/helper-components.tsx
@@ -1,5 +1,9 @@
import { LayoutCompatibilityReport } from '@openzeppelin/upgrades-core/dist/storage/report'
import React from 'react'
+import { FormattedMessage } from 'react-intl'
+import { CompileOptionsProps } from '../types/compilerTypes'
+import { CustomTooltip } from './components/custom-tooltip'
+import { extractNameFromKey } from './remix-ui-helper'
export const fileChangedToastMsg = (from: string, path: string) => (
,
+ openErrorLocation: (report: CompilerReport) => void,
+ hideWarnings: boolean,
+ askGPT: (report: CompilerReport) => void
+ }
+
+export type CompilerReport = {
+ type: "Error" | "Bug" | "Help" | "Note" | "Warning" | "Unknown",
+ message: string,
+ labels: {
+ style: "Primary" | "Secondary" | "Unknown",
+ file_id: string,
+ range: {
+ start: string,
+ end: string
+ },
+ message: string
+ }[],
+ notes: string[]
+ }
\ No newline at end of file
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 0d279961a33..b8d1ce97346 100644
--- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
+++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
@@ -66,6 +66,7 @@ const tabsReducer = (state: ITabsState, action: ITabsAction) => {
return state
}
}
+const PlayExtList = ['js', 'ts', 'sol', 'circom', 'vy', 'nr']
export const TabsUI = (props: TabsUIProps) => {
const [tabsState, dispatch] = useReducer(tabsReducer, initialTabsState)
@@ -208,23 +209,22 @@ export const TabsUI = (props: TabsUIProps) => {
openErrorLocation(response)}>
handleAskGPT(response) } />
+ askGPT={ () => askGPT(response) } />
{ handleAskGPT(response) }} />
+ askGPT={() => { askGPT(response) }} />
diff --git a/apps/circuit-compiler/src/app/components/feedbackAlert.tsx b/libs/remix-ui/helper/src/lib/components/feedbackAlert.tsx
similarity index 79%
rename from apps/circuit-compiler/src/app/components/feedbackAlert.tsx
rename to libs/remix-ui/helper/src/lib/components/feedbackAlert.tsx
index c6328dd510a..cf7137ab20e 100644
--- a/apps/circuit-compiler/src/app/components/feedbackAlert.tsx
+++ b/libs/remix-ui/helper/src/lib/components/feedbackAlert.tsx
@@ -1,10 +1,10 @@
-import { useState } from 'react'
-import { FeedbackAlertProps } from '../types'
+import React, { useState } from 'react'
+import { FeedbackAlertProps } from '../../types/compilerTypes'
import { RenderIf } from '@remix-ui/helper'
-import {CopyToClipboard} from '@remix-ui/clipboard'
+import { CopyToClipboard } from '@remix-ui/clipboard'
export function FeedbackAlert ({ message, askGPT }: FeedbackAlertProps) {
- const [ showAlert, setShowAlert] = useState
@@ -142,3 +146,75 @@ export function RenderIf({ condition, children }: { condition: boolean, children
export function RenderIfNot({ condition, children }: { condition: boolean, children: JSX.Element }) {
return condition ? null : children
}
+
+export const CompileOptions = ({ autoCompile, hideWarnings, setCircuitAutoCompile, setCircuitHideWarnings }: CompileOptionsProps) => (
+
+
+
+ }
+ >
+
+
+)
diff --git a/libs/remix-ui/helper/src/lib/remix-ui-helper.ts b/libs/remix-ui/helper/src/lib/remix-ui-helper.ts
index aecc3ebc690..32e3947b822 100644
--- a/libs/remix-ui/helper/src/lib/remix-ui-helper.ts
+++ b/libs/remix-ui/helper/src/lib/remix-ui-helper.ts
@@ -82,7 +82,8 @@ export const getPathIcon = (path: string) => {
? 'fad fa-brackets-curly' : path.endsWith('.cairo')
? 'small fa-kit fa-cairo' : path.endsWith('.circom')
? 'fa-kit fa-circom' : path.endsWith('.nr')
- ? 'fa-duotone fa-regular fa-diamond' : 'far fa-file'
+ ? 'fa-kit fa-noir' : path.endsWith('.toml')
+ ? 'fad fa-cog': 'far fa-file'
}
export const isNumeric = (value) => {
diff --git a/libs/remix-ui/helper/src/types/compilerTypes.ts b/libs/remix-ui/helper/src/types/compilerTypes.ts
new file mode 100644
index 00000000000..17b96cd48e5
--- /dev/null
+++ b/libs/remix-ui/helper/src/types/compilerTypes.ts
@@ -0,0 +1,34 @@
+export type CompileOptionsProps = {
+ setCircuitAutoCompile: (value: boolean) => void,
+ setCircuitHideWarnings: (value: boolean) => void,
+ autoCompile: boolean,
+ hideWarnings: boolean
+ }
+
+export type FeedbackAlertProps = {
+ message: string,
+ askGPT: () => void
+ }
+
+export type CompilerFeedbackProps = {
+ feedback: string | CompilerReport[],
+ filePathToId: Record
+
+)
+
+export const CompileBtn = ({ plugin, appState, id, compileAction }: { plugin: any, appState: { status, filePath }, id: string, compileAction: () => void }) => (
+
+ setCircuitAutoCompile(e.target.checked)}
+ title="Auto compile"
+ checked={autoCompile}
+ id="autoCompileCircuit"
+ />
+
+
+
+ setCircuitHideWarnings(e.target.checked)}
+ id="hideCircuitWarnings"
+ type="checkbox"
+ title="Hide warnings"
+ checked={hideWarnings}
+ />
+
+
+
+ Ctrl+S to compile {appState.filePath}
+
+