Skip to content

Commit 3dfd8e1

Browse files
Merge branch 'main' into zero-mapping-llm
2 parents 0b66fcf + ba5b5a7 commit 3dfd8e1

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

workspaces/ballerina/ballerina-side-panel/src/components/editors/ExpandedEditor/controls/TemplateMarkdownToolbar.tsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import React from "react";
2020
import styled from "@emotion/styled";
21-
import { ThemeColors, Icon, Switch } from "@wso2/ui-toolkit";
21+
import { ThemeColors, Icon } from "@wso2/ui-toolkit";
2222
import { EditorView } from "@codemirror/view";
2323
import {
2424
insertMarkdownFormatting,
@@ -178,21 +178,6 @@ export const TemplateMarkdownToolbar = React.forwardRef<HTMLDivElement, Template
178178
<Icon name="bi-checklist" sx={{ width: "20px", height: "20px", fontSize: "20px" }} />
179179
</ToolbarButton>
180180
</ToolbarButtonGroup>
181-
182-
{onTogglePreview && (
183-
<Switch
184-
checked={isPreviewMode}
185-
leftLabel="Edit"
186-
rightLabel="Preview"
187-
onChange={onTogglePreview}
188-
checkedColor="var(--vscode-button-background)"
189-
checkedBorder="1px solid color-mix(in srgb, var(--vscode-dropdown-border) 75%, transparent)"
190-
enableTransition={false}
191-
sx={{
192-
borderColor: ThemeColors.OUTLINE_VARIANT
193-
}}
194-
/>
195-
)}
196181
</ToolbarContainer>
197182
);
198183
});

workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/components/ChipExpressionEditor.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,20 +304,16 @@ export const ChipExpressionEditorComponent = (props: ChipExpressionEditorCompone
304304
...(props.isInExpandedMode
305305
? [EditorView.theme({
306306
"&": { height: "100%" },
307-
".cm-scroller": { overflow: "auto" }
307+
".cm-scroller": { overflow: "auto", maxHeight: "100%" }
308308
})]
309309
: props.sx && 'height' in props.sx
310310
? [EditorView.theme({
311-
"&": {
312-
height: typeof (props.sx as any).height === 'number' ?
313-
`${(props.sx as any).height}px` :
314-
(props.sx as any).height
315-
},
316-
".cm-scroller": { overflow: "auto" }
311+
"&": { height: "100%" },
312+
".cm-scroller": { overflow: "auto", maxHeight: "100%" }
317313
})]
318314
: [EditorView.theme({
319315
"&": { maxHeight: "150px" },
320-
".cm-scroller": { overflow: "auto" }
316+
".cm-scroller": { overflow: "auto", maxHeight: "150px" }
321317
})])
322318
]
323319
});
@@ -435,14 +431,18 @@ export const ChipExpressionEditorComponent = (props: ChipExpressionEditorCompone
435431
<ChipEditorContainer ref={fieldContainerRef} style={{
436432
position: 'relative',
437433
...props.sx,
438-
...(props.isInExpandedMode ? { height: '100%' } : { height: 'auto' })
434+
...(props.isInExpandedMode ? { height: '100%' } : props.sx && 'height' in props.sx ? {} : { height: 'auto' })
439435
}}>
440436
{!props.isInExpandedMode && <FXButton />}
441-
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
437+
<div style={{
438+
position: 'relative',
439+
width: '100%',
440+
...(props.isInExpandedMode || (props.sx && 'height' in props.sx) ? { height: '100%' } : {})
441+
}}>
442442
<div ref={editorRef} style={{
443443
border: '1px solid var(--vscode-dropdown-border)',
444-
...props.sx,
445-
...(props.isInExpandedMode ? { height: '100%' } : { height: 'auto', maxHeight: '150px' })
444+
width: '100%',
445+
height: '100%'
446446
}} />
447447
{helperPaneState.isOpen &&
448448
<HelperPane

0 commit comments

Comments
 (0)