Skip to content
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 Console #665

Merged
merged 9 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions app/components/CodeMirror/index.less

This file was deleted.

192 changes: 0 additions & 192 deletions app/components/CodeMirror/index.tsx

This file was deleted.

11 changes: 2 additions & 9 deletions app/components/GQLCodeMirror/index.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
import { Collapse, CollapseProps } from 'antd';
import { useI18n } from '@vesoft-inc/i18n';

import CodeMirror from '@app/components/CodeMirror';
import MonacoEditor from '@app/components/MonacoEditor';

import styles from './index.module.less';
interface IOptions {
[propName: string]: any;
}
const GQLCodeMirror = (props: { currentGQL: string; option?: IOptions }) => {
const options = {
keyMap: 'sublime',
fullScreen: true,
mode: 'nebula',
readOnly: true,
...props.option,
};
const { intl } = useI18n();
const items: CollapseProps['items'] = [
{
key: 'ngql',
label: intl.get('common.exportNGQL'),
children: <CodeMirror value={props.currentGQL} options={options} height="80px" />,
children: <MonacoEditor value={props.currentGQL} readOnly height="80px" />,
},
];
return <Collapse className={styles.exportGql} items={items} />;
Expand Down
32 changes: 32 additions & 0 deletions app/components/MonacoEditor/index.module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
:global {
/* padding between the gutter and code */
.monaco-editor .view-line {
padding-left: 5px;
}

/* fix cursor location */
.monaco-editor .cursor {
margin-left: 5px;
}

/* fix highlighted text selection */
.monaco-editor .selectionHighlight {
margin-left: 5px;
}

/* fix highlighted brackets */
.monaco-editor .bracket-match {
margin-left: 5px;
}

/* fix multiline text selection */
.monaco-editor .cslr.selected-text {
margin-left: 5px;
}

/* fix multiline text selection */
.monaco-editor .bottom-left-radius, .monaco-editor .top-left-radius {
margin-left: 5px;
}

}
Loading