-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New debugInfo and console section #136
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ import { AppUiContext, CodeType, LogType } from '../../context/appUiContext' | |
|
||
import { ArgumentsHelperModal } from './ArgumentsHelperModal' | ||
import { registerCairoLanguageSupport } from './cairoLangConfig' | ||
import Console from './Console' | ||
import EditorControls from './EditorControls' | ||
import EditorFooter from './EditorFooter' | ||
import ExtraColumn from './ExtraColumn' | ||
|
@@ -317,90 +318,101 @@ const Editor = ({ readOnly = false }: Props) => { | |
> | ||
<div | ||
className={cn( | ||
'w-full md:w-1/2 flex flex-col', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for this change on line 320? It will break the app on mobile screen.. |
||
isThreeColumnLayout && 'md:w-1/3', | ||
'w-1/2 flex flex-col', | ||
isThreeColumnLayout && 'md:w-2/3', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
)} | ||
> | ||
<div className="border-b border-gray-200 dark:border-black-500 flex items-center pl-6 pr-2 h-14 flex-none md:border-r justify-between"> | ||
<Header | ||
codeType={codeType} | ||
onCodeTypeChange={({ value }) => setCodeType(value)} | ||
withLogo={isFullScreen} | ||
/> | ||
</div> | ||
<div className="flex" style={{ height: 'calc(100% - 22vh)' }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we setting the height here? Can it be removed? We should be able to just use |
||
<div | ||
className={cn( | ||
'w-full flex flex-col', | ||
isThreeColumnLayout && 'md:w-1/2', | ||
)} | ||
> | ||
<div className="border-b border-gray-200 dark:border-black-500 flex items-center pl-4 pr-2 h-14 flex-none md:border-r justify-between"> | ||
<Header | ||
codeType={codeType} | ||
onCodeTypeChange={({ value }) => setCodeType(value)} | ||
withLogo={isFullScreen} | ||
/> | ||
</div> | ||
|
||
<div className="relative pane grow pane-light overflow-auto md:border-r bg-gray-50 dark:bg-black-600 border-gray-200 dark:border-black-500"> | ||
{codeType === CodeType.CASM ? ( | ||
<InstructionsTable | ||
instructions={casmInstructions} | ||
codeType={codeType} | ||
activeIndexes={[activeCasmInstructionIndex]} | ||
errorIndexes={[errorCasmInstructionIndex]} | ||
variables={{}} | ||
/> | ||
) : codeType === CodeType.Sierra ? ( | ||
<InstructionsTable | ||
instructions={sierraStatements} | ||
codeType={codeType} | ||
activeIndexes={ | ||
casmToSierraProgramMap[activeCasmInstructionIndex] ?? [] | ||
} | ||
errorIndexes={ | ||
casmToSierraProgramMap[errorCasmInstructionIndex] ?? [] | ||
<div className="relative pane grow pane-light overflow-auto md:border-r bg-gray-50 dark:bg-black-600 border-gray-200 dark:border-black-500"> | ||
{codeType === CodeType.CASM ? ( | ||
<InstructionsTable | ||
instructions={casmInstructions} | ||
codeType={codeType} | ||
activeIndexes={[activeCasmInstructionIndex]} | ||
errorIndexes={[errorCasmInstructionIndex]} | ||
variables={{}} | ||
/> | ||
) : codeType === CodeType.Sierra ? ( | ||
<InstructionsTable | ||
instructions={sierraStatements} | ||
codeType={codeType} | ||
activeIndexes={ | ||
casmToSierraProgramMap[activeCasmInstructionIndex] ?? [] | ||
} | ||
errorIndexes={ | ||
casmToSierraProgramMap[errorCasmInstructionIndex] ?? [] | ||
} | ||
variables={currentSierraVariables || {}} | ||
/> | ||
) : ( | ||
<div className="h-full overflow-auto pane pane-light"> | ||
<MonacoEditor | ||
// @ts-ignore: SCEditor is not TS-friendly | ||
|
||
onMount={handleEditorDidMount} | ||
options={{ | ||
minimap: { enabled: false }, | ||
wordBreak: 'keepAll', | ||
wordWrap: 'on', | ||
readOnly: readOnly, | ||
}} | ||
value={codeType === CodeType.Cairo ? cairoCode : ''} | ||
onChange={handleCairoCodeChange} | ||
language={'cairo'} | ||
className={cn( | ||
'code-editor whitespace-pre-wrap overflow-hidden', | ||
{ | ||
'with-numbers': !isBytecode, | ||
}, | ||
)} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
|
||
<EditorControls | ||
isCompileDisabled={isCompileDisabled} | ||
programArguments={programArguments} | ||
areProgramArgumentsValid={areProgramArgumentsValid} | ||
onCopyPermalink={handleCopyPermalink} | ||
onProgramArgumentsUpdate={handleProgramArgumentsUpdate} | ||
onCompileRun={handleCompileRun} | ||
onShowArgumentsHelper={() => setShowArgumentsHelper(true)} | ||
handleChangeExampleOption={(newExample) => | ||
newExample !== null | ||
? setExampleOption(newExample.value) | ||
: setExampleOption(0) | ||
} | ||
variables={currentSierraVariables || {}} | ||
/> | ||
) : ( | ||
<div className="h-full overflow-auto pane pane-light"> | ||
<MonacoEditor | ||
// @ts-ignore: SCEditor is not TS-friendly | ||
|
||
onMount={handleEditorDidMount} | ||
options={{ | ||
minimap: { enabled: false }, | ||
wordBreak: 'keepAll', | ||
wordWrap: 'on', | ||
readOnly: readOnly, | ||
}} | ||
value={codeType === CodeType.Cairo ? cairoCode : ''} | ||
onChange={handleCairoCodeChange} | ||
language={'cairo'} | ||
className={cn( | ||
'code-editor whitespace-pre-wrap overflow-hidden', | ||
{ | ||
'with-numbers': !isBytecode, | ||
}, | ||
)} | ||
/> | ||
</div> | ||
</div> | ||
|
||
{isThreeColumnLayout && ( | ||
<ExtraColumn | ||
cairoCode={cairoCode} | ||
handleCairoCodeChange={handleCairoCodeChange} | ||
handleEditorDidMount={handleEditorDidMount} | ||
isBytecode={isBytecode} | ||
/> | ||
)} | ||
</div> | ||
|
||
<EditorControls | ||
isCompileDisabled={isCompileDisabled} | ||
programArguments={programArguments} | ||
areProgramArgumentsValid={areProgramArgumentsValid} | ||
onCopyPermalink={handleCopyPermalink} | ||
onProgramArgumentsUpdate={handleProgramArgumentsUpdate} | ||
onCompileRun={handleCompileRun} | ||
onShowArgumentsHelper={() => setShowArgumentsHelper(true)} | ||
handleChangeExampleOption={(newExample) => | ||
newExample !== null | ||
? setExampleOption(newExample.value) | ||
: setExampleOption(0) | ||
} | ||
/> | ||
<div className="h-[22vh] w-full overflow-auto border-t border-r border-gray-200 dark:border-black-500 pane pane-light"> | ||
<Console /> | ||
</div> | ||
</div> | ||
|
||
{isThreeColumnLayout && ( | ||
<ExtraColumn | ||
cairoCode={cairoCode} | ||
handleCairoCodeChange={handleCairoCodeChange} | ||
handleEditorDidMount={handleEditorDidMount} | ||
isBytecode={isBytecode} | ||
/> | ||
)} | ||
|
||
<div | ||
className={cn( | ||
'w-full md:w-1/2 flex flex-col justify-between', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of
text-[11px]
lets usefont-medium
to keep consistency with titles in the debug info section