@fc-components/monaco-editor 0.1.20 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import type * as monacoTypes from 'monaco-editor/esm/vs/editor/editor.api';
3
3
  import type { DataProviderParams } from './types';
4
4
  interface PromQLEditorProps {
5
+ className?: string;
5
6
  size?: 'small' | 'middle' | 'large';
6
7
  theme?: 'light' | 'dark';
7
8
  value?: string;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type * as monacoTypes from 'monaco-editor/esm/vs/editor/editor.api';
3
3
  interface SqlEditorProps {
4
+ className?: string;
4
5
  maxHeight?: number | string;
5
6
  fontSize?: number;
6
7
  size?: 'small' | 'middle' | 'large';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.20",
6
+ "version": "0.1.22",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/monaco-editor.esm.js",
@@ -14,6 +14,7 @@ import type { DataProviderParams } from './types';
14
14
  import { validateQuery } from './validation';
15
15
 
16
16
  interface PromQLEditorProps {
17
+ className?: string;
17
18
  size?: 'small' | 'middle' | 'large';
18
19
  theme?: 'light' | 'dark';
19
20
  value?: string;
@@ -88,6 +89,7 @@ const getStyles = (placeholder?: string) => {
88
89
  export default function PromQLEditor(props: PromQLEditorProps & DataProviderParams) {
89
90
  const id = uuidv4();
90
91
  const {
92
+ className,
91
93
  size = 'middle',
92
94
  theme = 'light',
93
95
  value,
@@ -344,7 +346,8 @@ export default function PromQLEditor(props: PromQLEditorProps & DataProviderPara
344
346
  'ant-input' +
345
347
  (size ? ` ${SIZE_MAP[size].className}` : '') +
346
348
  (disabled ? ` ant-input-disabled ${containerDisabledClassName}` : '') +
347
- (readOnly ? ` ${containerReadOnlyClassName}` : '')
349
+ (readOnly ? ` ${containerReadOnlyClassName}` : '') +
350
+ (className ? ` ${className}` : '')
348
351
  }
349
352
  >
350
353
  <div ref={containerRef}>
package/src/sql/index.tsx CHANGED
@@ -8,6 +8,7 @@ import { language, languageConfiguration } from './sql';
8
8
  import { getSqlCompletionProvider } from './completion/getCompletionProvider';
9
9
 
10
10
  interface SqlEditorProps {
11
+ className?: string;
11
12
  maxHeight?: number | string;
12
13
  fontSize?: number;
13
14
  size?: 'small' | 'middle' | 'large';
@@ -75,6 +76,7 @@ const containerReadOnlyClassName = css`
75
76
  export default function SqlEditor(props: SqlEditorProps) {
76
77
  const id = uuidv4();
77
78
  const {
79
+ className,
78
80
  maxHeight,
79
81
  fontSize,
80
82
  size = 'middle',
@@ -229,9 +231,11 @@ export default function SqlEditor(props: SqlEditorProps) {
229
231
  'ant-input' +
230
232
  (size ? ` ${SIZE_MAP[size].className}` : '') +
231
233
  (disabled ? ` ant-input-disabled ${containerDisabledClassName}` : '') +
232
- (readOnly ? ` ${containerReadOnlyClassName}` : '')
234
+ (readOnly ? ` ${containerReadOnlyClassName}` : '') +
235
+ (className ? ` ${className}` : '')
233
236
  }
234
237
  style={{
238
+ display: 'block',
235
239
  resize: 'vertical',
236
240
  overflow: 'auto',
237
241
  minHeight: SIZE_MAP[size].minHeight,
@@ -258,6 +262,7 @@ export default function SqlEditor(props: SqlEditorProps) {
258
262
  scrollBeyondLastLine: false,
259
263
  smoothScrolling: true,
260
264
  fontSize,
265
+ lineHeight: 24,
261
266
  tabSize: 2,
262
267
  wordWrap: 'on',
263
268
  automaticLayout: true,