Skip to content

Commit 14f9258

Browse files
committed
revert formatting for merging
1 parent 3a37ec4 commit 14f9258

File tree

1 file changed

+95
-102
lines changed

1 file changed

+95
-102
lines changed

ui/src/components/Canvas.tsx

Lines changed: 95 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -235,30 +235,23 @@ function ResultBlock({ pod, id }) {
235235
<Box overflow="scroll" maxHeight="145px" border="1px">
236236
{/* <Box bgcolor="lightgray">Error</Box> */}
237237
{pod.stdout && (
238-
<Box whiteSpace="pre-wrap" sx={{ fontSize: 10 }}>
238+
<Box whiteSpace="pre-wrap" sx={{fontSize: 10}}>
239239
<Ansi>{pod.stdout}</Ansi>
240240
</Box>
241241
)}
242242
{pod?.result?.text && pod?.result?.count > 0 && (
243-
<Box
244-
sx={{
245-
display: "flex",
246-
fontSize: 10,
247-
flexDirection: "row",
248-
alignItems: "center",
249-
}}
250-
>
243+
<Box sx={{ display: "flex", fontSize: 10, flexDirection: "row", alignItems: 'center' }}>
251244
<Box>Result[{pod.result.count}]:</Box>
252245
<Box component="pre" whiteSpace="pre-wrap">
253-
{pod.result.text}
246+
{pod.result.text}
254247
</Box>
255248
</Box>
256249
)}
257250
{pod?.error && <Box color="red">{pod?.error?.evalue}</Box>}
258251
{pod?.error?.stacktrace && (
259252
<Box>
260253
<Box>StackTrace</Box>
261-
<Box whiteSpace="pre-wrap" sx={{ fontSize: 10 }}>
254+
<Box whiteSpace="pre-wrap" sx={{fontSize: 10}}>
262255
<Ansi>{pod.error.stacktrace.join("\n")}</Ansi>
263256
</Box>
264257
</Box>
@@ -340,106 +333,106 @@ const CodeNode = memo<Props>(({ data, id, isConnectable }) => {
340333
if (!pod) return null;
341334
return (
342335
<ResizableBox
343-
onResizeStop={onResize}
344-
height={pod.height || 100}
345-
width={pod.width}
346-
axis="x"
347-
minConstraints={[200, 200]}
336+
onResizeStop={onResize}
337+
height={pod.height || 100}
338+
width={pod.width}
339+
axis="x"
340+
minConstraints={[200, 200]}
341+
>
342+
<Box
343+
sx={{
344+
border: "solid 1px #d6dee6",
345+
borderRadius: "4px",
346+
width: "100%",
347+
height: "100%",
348+
backgroundColor: "rgb(244, 246, 248)",
349+
borderColor: isEditorBlur ? "#d6dee6" : "#3182ce",
350+
}}
351+
ref={ref}
348352
>
353+
<Handle
354+
type="source"
355+
position={Position.Top}
356+
id="top"
357+
isConnectable={isConnectable}
358+
/>
359+
<Handle
360+
type="source"
361+
position={Position.Bottom}
362+
id="bottom"
363+
isConnectable={isConnectable}
364+
/>
365+
<Handle
366+
type="source"
367+
position={Position.Left}
368+
id="left"
369+
isConnectable={isConnectable}
370+
/>
371+
<Handle
372+
type="source"
373+
position={Position.Right}
374+
id="right"
375+
isConnectable={isConnectable}
376+
/>
377+
{/* The header of code pods. */}
378+
<Box className="custom-drag-handle">
379+
<Box sx={styles["pod-index"]}>[{pod.index}]</Box>
380+
<ToolBox data={{ id }} onRunTask={runToolBoxTask}></ToolBox>
381+
</Box>
349382
<Box
350383
sx={{
351-
border: "solid 1px #d6dee6",
352-
borderRadius: "4px",
353-
width: "100%",
354-
height: "100%",
355-
backgroundColor: "rgb(244, 246, 248)",
356-
borderColor: isEditorBlur ? "#d6dee6" : "#3182ce",
384+
height: "90%",
385+
}}
386+
onClick={(e) => {
387+
// If the node is selected (for resize), the cursor is not shown. So
388+
// we need to deselect it when we re-focus on the editor.
389+
setSelected(null);
390+
setNodes((nds) =>
391+
applyNodeChanges(
392+
[
393+
{
394+
id,
395+
type: "select",
396+
selected: false,
397+
},
398+
],
399+
nds
400+
)
401+
);
357402
}}
358-
ref={ref}
359403
>
360-
<Handle
361-
type="source"
362-
position={Position.Top}
363-
id="top"
364-
isConnectable={isConnectable}
365-
/>
366-
<Handle
367-
type="source"
368-
position={Position.Bottom}
369-
id="bottom"
370-
isConnectable={isConnectable}
371-
/>
372-
<Handle
373-
type="source"
374-
position={Position.Left}
375-
id="left"
376-
isConnectable={isConnectable}
377-
/>
378-
<Handle
379-
type="source"
380-
position={Position.Right}
381-
id="right"
382-
isConnectable={isConnectable}
383-
/>
384-
{/* The header of code pods. */}
385-
<Box className="custom-drag-handle">
386-
<Box sx={styles["pod-index"]}>[{pod.index}]</Box>
387-
<ToolBox data={{ id }} onRunTask={runToolBoxTask}></ToolBox>
388-
</Box>
389-
<Box
390-
sx={{
391-
height: "90%",
404+
<MyMonaco
405+
id={id}
406+
gitvalue=""
407+
onBlur={() => {
408+
setIsEditorBlur(true);
392409
}}
393-
onClick={(e) => {
394-
// If the node is selected (for resize), the cursor is not shown. So
395-
// we need to deselect it when we re-focus on the editor.
396-
setSelected(null);
397-
setNodes((nds) =>
398-
applyNodeChanges(
399-
[
400-
{
401-
id,
402-
type: "select",
403-
selected: false,
404-
},
405-
],
406-
nds
407-
)
408-
);
410+
onFocus={() => {
411+
setIsEditorBlur(false);
409412
}}
410-
>
411-
<MyMonaco
412-
id={id}
413-
gitvalue=""
414-
onBlur={() => {
415-
setIsEditorBlur(true);
416-
}}
417-
onFocus={() => {
418-
setIsEditorBlur(false);
413+
/>
414+
{showResult && (
415+
<Box
416+
className="nowheel"
417+
sx={{
418+
border: "solid 1px #d6dee6",
419+
borderRadius: "4px",
420+
position: "absolute",
421+
top: isRightLayout ? 0 : "100%",
422+
left: isRightLayout ? "100%" : 0,
423+
maxHeight: "158px",
424+
minWidth: isRightLayout ? "200px" : "100%",
425+
boxSizing: "border-box",
426+
backgroundColor: "white",
427+
zIndex: 100,
428+
padding: "0 10px",
419429
}}
420-
/>
421-
{showResult && (
422-
<Box
423-
className="nowheel"
424-
sx={{
425-
border: "solid 1px #d6dee6",
426-
borderRadius: "4px",
427-
position: "absolute",
428-
top: isRightLayout ? 0 : "100%",
429-
left: isRightLayout ? "100%" : 0,
430-
maxHeight: "158px",
431-
minWidth: isRightLayout ? "200px" : "100%",
432-
boxSizing: "border-box",
433-
backgroundColor: "white",
434-
zIndex: 100,
435-
padding: "0 10px",
436-
}}
437-
>
438-
<ResultBlock pod={pod} id={id} />
439-
</Box>
440-
)}
441-
</Box>
430+
>
431+
<ResultBlock pod={pod} id={id} />
432+
</Box>
433+
)}
442434
</Box>
435+
</Box>
443436
</ResizableBox>
444437
);
445438
});

0 commit comments

Comments
 (0)