@snack-uikit/code-editor 0.4.7-preview-aa6874cd.0 → 0.4.7-preview-9a2892b7.0
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.
- package/README.md +10 -2
- package/dist/cjs/components/CodeEditor.d.ts +3 -3
- package/dist/cjs/components/CodeEditor.js +6 -10
- package/dist/cjs/components/hooks.d.ts +1 -0
- package/dist/cjs/components/hooks.js +13 -0
- package/dist/cjs/components/types.d.ts +5 -5
- package/dist/esm/components/CodeEditor.d.ts +3 -3
- package/dist/esm/components/CodeEditor.js +8 -12
- package/dist/esm/components/hooks.d.ts +1 -0
- package/dist/esm/components/hooks.js +12 -0
- package/dist/esm/components/types.d.ts +5 -5
- package/package.json +2 -2
- package/src/components/CodeEditor.tsx +10 -16
- package/src/components/hooks.ts +15 -0
- package/src/components/types.ts +5 -5
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|------|------|---------------|-------------|
|
|
15
15
|
| themeName | `string` | - | Название текущей темы. Значение не важно, важно что смена значения запускает пересчет стилей. |
|
|
16
16
|
| hasBackground | `boolean` | true | Включение/отключение псевдобекграунда |
|
|
17
|
-
|
|
|
17
|
+
| schema | `SchemasSettings` | - | Схема для валидации |
|
|
18
18
|
| defaultValue | `string` | - | Default value of the current model |
|
|
19
19
|
| defaultLanguage | `string` | - | Default language of the current model |
|
|
20
20
|
| defaultPath | `string` | - | Default path of the current model Will be passed as the third argument to `.createModel` method `monaco.editor.createModel(..., ..., monaco.Uri.parse(defaultPath))` |
|
|
@@ -44,4 +44,12 @@
|
|
|
44
44
|
Для обеспечения полноценной работы YAML Monaco Editor необходимо подключить `yaml.worker`. Это можно сделать следующими способами: с использованием [`window.MonacoEnvironment`](https://www.npmjs.com/package/monaco-yaml#usage) или с помощью плагина [`MonacoWebpackPlugin`](https://www.npmjs.com/package/monaco-yaml#using-monaco-webpack-loader-plugin) . Подробнее с `monaco-yaml` можно ознакомиться [тут]((https://www.npmjs.com/package/monaco-yaml))
|
|
45
45
|
|
|
46
46
|
### Как редактор загружает worker?
|
|
47
|
-
|
|
47
|
+
Плагин создает новые точки входа каждого build-in воркера и для каждого дабавленного отдельно. Плагин создат глобальную переменную, используя которую редкатор будет загружать нужный воркер на основе текущего `language`.
|
|
48
|
+
|
|
49
|
+
Чтобы управлять конфигурацией загрузчика Monaco Editor, добавьте
|
|
50
|
+
```typescript
|
|
51
|
+
import * as monaco from 'monaco-editor';
|
|
52
|
+
import { loader } from '@snack-uikit/code-editor';
|
|
53
|
+
loader.config({ monaco });
|
|
54
|
+
```
|
|
55
|
+
Это позволяет динамически настраивать пути и другие параметры при инициализации редактора.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WithSupportProps } from '@snack-uikit/utils';
|
|
2
|
-
import { EditorProps,
|
|
2
|
+
import { EditorProps, EditorWithSchemaProps } from './types';
|
|
3
3
|
export type CodeEditorProps = WithSupportProps<{
|
|
4
4
|
/**
|
|
5
5
|
* Название текущей темы. Значение не важно, важно что смена значения запускает пересчет стилей.
|
|
@@ -9,5 +9,5 @@ export type CodeEditorProps = WithSupportProps<{
|
|
|
9
9
|
* Включение/отключение псевдобекграунда
|
|
10
10
|
*/
|
|
11
11
|
hasBackground?: boolean;
|
|
12
|
-
}> & (EditorProps |
|
|
13
|
-
export declare function CodeEditor({ themeName, className, theme, options, loading, hasBackground, onMount, ...props }: CodeEditorProps): import("react/jsx-runtime").JSX.Element
|
|
12
|
+
}> & (EditorProps | EditorWithSchemaProps);
|
|
13
|
+
export declare function CodeEditor({ themeName, className, theme, options, loading, hasBackground, onMount, ...props }: CodeEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,7 +27,9 @@ const constants_1 = require("./constants");
|
|
|
27
27
|
const hooks_1 = require("./hooks");
|
|
28
28
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
29
29
|
const utils_2 = require("./utils");
|
|
30
|
+
(0, utils_2.initLoaderConfig)();
|
|
30
31
|
function CodeEditor(_a) {
|
|
32
|
+
var _b, _c;
|
|
31
33
|
var {
|
|
32
34
|
themeName,
|
|
33
35
|
className,
|
|
@@ -41,14 +43,11 @@ function CodeEditor(_a) {
|
|
|
41
43
|
const {
|
|
42
44
|
language
|
|
43
45
|
} = props;
|
|
44
|
-
const [canRender, setCanRender] = (0, react_2.useState)(false);
|
|
45
|
-
(0, utils_1.useLayoutEffect)(() => {
|
|
46
|
-
(0, utils_2.initLoaderConfig)();
|
|
47
|
-
setCanRender(true);
|
|
48
|
-
}, []);
|
|
49
46
|
const monaco = (0, react_1.useMonaco)();
|
|
50
47
|
const [wrapperElement, setWrapperElement] = (0, react_2.useState)(null);
|
|
51
|
-
const
|
|
48
|
+
const modelPath = 'schema' in props ? (_c = (_b = props.schema) === null || _b === void 0 ? void 0 : _b.fileMatch) === null || _c === void 0 ? void 0 : _c[0] : undefined;
|
|
49
|
+
(0, hooks_1.useYamlEditor)(props.language === 'yaml' ? props.schema : undefined);
|
|
50
|
+
(0, hooks_1.useJsonEditor)(props.language === 'json' ? props.schema : undefined);
|
|
52
51
|
const onEditorMount = (0, react_2.useCallback)((editor, monaco) => {
|
|
53
52
|
var _a;
|
|
54
53
|
monaco && (0, utils_1.isBrowser)() && ((_a = document === null || document === void 0 ? void 0 : document.fonts) === null || _a === void 0 ? void 0 : _a.ready.finally(monaco.editor.remeasureFonts));
|
|
@@ -114,9 +113,6 @@ function CodeEditor(_a) {
|
|
|
114
113
|
fontWeight: themeValues.mono.body.s['font-weight'],
|
|
115
114
|
fontFamily: themeValues.mono.body.s['font-family']
|
|
116
115
|
} : constants_1.DEFAULT_THEME_OPTIONS.mono.s), options), [options, language, themeValues === null || themeValues === void 0 ? void 0 : themeValues.mono]);
|
|
117
|
-
if (!canRender) {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
116
|
return (0, jsx_runtime_1.jsx)("div", Object.assign({
|
|
121
117
|
className: className
|
|
122
118
|
}, (0, utils_1.extractSupportProps)(props), {
|
|
@@ -129,7 +125,7 @@ function CodeEditor(_a) {
|
|
|
129
125
|
loading: loading !== null && loading !== void 0 ? loading : (0, jsx_runtime_1.jsx)(loaders_1.Spinner, {}),
|
|
130
126
|
options: mergedOptions,
|
|
131
127
|
onMount: onEditorMount,
|
|
132
|
-
path:
|
|
128
|
+
path: modelPath
|
|
133
129
|
}))
|
|
134
130
|
}));
|
|
135
131
|
}
|
|
@@ -43,4 +43,5 @@ export declare function useCalculatedThemeValues({ stylesOriginNode, themeName }
|
|
|
43
43
|
};
|
|
44
44
|
} | undefined;
|
|
45
45
|
export declare function useYamlEditor(yamlSchema?: SchemasSettings): string | undefined;
|
|
46
|
+
export declare function useJsonEditor(jsonSchema?: SchemasSettings): void;
|
|
46
47
|
export {};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useCalculatedThemeValues = useCalculatedThemeValues;
|
|
7
7
|
exports.useYamlEditor = useYamlEditor;
|
|
8
|
+
exports.useJsonEditor = useJsonEditor;
|
|
8
9
|
const react_1 = require("@monaco-editor/react");
|
|
9
10
|
const monaco_yaml_1 = require("monaco-yaml");
|
|
10
11
|
const react_2 = require("react");
|
|
@@ -55,4 +56,16 @@ function useYamlEditor(yamlSchema) {
|
|
|
55
56
|
});
|
|
56
57
|
}, [monaco, yamlSchema]);
|
|
57
58
|
return modelPath;
|
|
59
|
+
}
|
|
60
|
+
function useJsonEditor(jsonSchema) {
|
|
61
|
+
const monaco = (0, react_1.useMonaco)();
|
|
62
|
+
(0, react_2.useEffect)(() => {
|
|
63
|
+
if (!jsonSchema || !monaco) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
67
|
+
validate: true,
|
|
68
|
+
schemas: [jsonSchema]
|
|
69
|
+
});
|
|
70
|
+
}, [monaco, jsonSchema]);
|
|
58
71
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EditorProps as MonacoEditorProps } from '@monaco-editor/react';
|
|
2
2
|
import { SchemasSettings } from 'monaco-yaml';
|
|
3
3
|
export type EditorProps = {
|
|
4
|
-
|
|
4
|
+
schema?: never;
|
|
5
5
|
} & MonacoEditorProps;
|
|
6
|
-
export type
|
|
7
|
-
language: 'yaml';
|
|
6
|
+
export type EditorWithSchemaProps = {
|
|
7
|
+
language: 'yaml' | 'json';
|
|
8
8
|
/**
|
|
9
|
-
* Схема для
|
|
9
|
+
* Схема для валидации
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
schema?: SchemasSettings;
|
|
12
12
|
} & Omit<MonacoEditorProps, 'language'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WithSupportProps } from '@snack-uikit/utils';
|
|
2
|
-
import { EditorProps,
|
|
2
|
+
import { EditorProps, EditorWithSchemaProps } from './types';
|
|
3
3
|
export type CodeEditorProps = WithSupportProps<{
|
|
4
4
|
/**
|
|
5
5
|
* Название текущей темы. Значение не важно, важно что смена значения запускает пересчет стилей.
|
|
@@ -9,5 +9,5 @@ export type CodeEditorProps = WithSupportProps<{
|
|
|
9
9
|
* Включение/отключение псевдобекграунда
|
|
10
10
|
*/
|
|
11
11
|
hasBackground?: boolean;
|
|
12
|
-
}> & (EditorProps |
|
|
13
|
-
export declare function CodeEditor({ themeName, className, theme, options, loading, hasBackground, onMount, ...props }: CodeEditorProps): import("react/jsx-runtime").JSX.Element
|
|
12
|
+
}> & (EditorProps | EditorWithSchemaProps);
|
|
13
|
+
export declare function CodeEditor({ themeName, className, theme, options, loading, hasBackground, onMount, ...props }: CodeEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,22 +14,21 @@ import { Editor, useMonaco } from '@monaco-editor/react';
|
|
|
14
14
|
import cn from 'classnames';
|
|
15
15
|
import { useCallback, useMemo, useState } from 'react';
|
|
16
16
|
import { Spinner } from '@snack-uikit/loaders';
|
|
17
|
-
import { extractSupportProps, isBrowser
|
|
17
|
+
import { extractSupportProps, isBrowser } from '@snack-uikit/utils';
|
|
18
18
|
import { CODE_EDITOR_OPTIONS, DEFAULT_THEME_OPTIONS, DEFAULT_THEME_VALUES, YAML_CODE_EDITOR_OPTIONS, } from './constants';
|
|
19
|
-
import { useCalculatedThemeValues, useYamlEditor } from './hooks';
|
|
19
|
+
import { useCalculatedThemeValues, useJsonEditor, useYamlEditor } from './hooks';
|
|
20
20
|
import styles from './styles.module.css';
|
|
21
21
|
import { initLoaderConfig, isDark } from './utils';
|
|
22
|
+
initLoaderConfig();
|
|
22
23
|
export function CodeEditor(_a) {
|
|
24
|
+
var _b, _c;
|
|
23
25
|
var { themeName, className, theme, options, loading, hasBackground = true, onMount } = _a, props = __rest(_a, ["themeName", "className", "theme", "options", "loading", "hasBackground", "onMount"]);
|
|
24
26
|
const { language } = props;
|
|
25
|
-
const [canRender, setCanRender] = useState(false);
|
|
26
|
-
useLayoutEffect(() => {
|
|
27
|
-
initLoaderConfig();
|
|
28
|
-
setCanRender(true);
|
|
29
|
-
}, []);
|
|
30
27
|
const monaco = useMonaco();
|
|
31
28
|
const [wrapperElement, setWrapperElement] = useState(null);
|
|
32
|
-
const
|
|
29
|
+
const modelPath = 'schema' in props ? (_c = (_b = props.schema) === null || _b === void 0 ? void 0 : _b.fileMatch) === null || _c === void 0 ? void 0 : _c[0] : undefined;
|
|
30
|
+
useYamlEditor(props.language === 'yaml' ? props.schema : undefined);
|
|
31
|
+
useJsonEditor(props.language === 'json' ? props.schema : undefined);
|
|
33
32
|
const onEditorMount = useCallback((editor, monaco) => {
|
|
34
33
|
var _a;
|
|
35
34
|
monaco && isBrowser() && ((_a = document === null || document === void 0 ? void 0 : document.fonts) === null || _a === void 0 ? void 0 : _a.ready.finally(monaco.editor.remeasureFonts));
|
|
@@ -92,8 +91,5 @@ export function CodeEditor(_a) {
|
|
|
92
91
|
fontFamily: themeValues.mono.body.s['font-family'],
|
|
93
92
|
}
|
|
94
93
|
: DEFAULT_THEME_OPTIONS.mono.s)), options)), [options, language, themeValues === null || themeValues === void 0 ? void 0 : themeValues.mono]);
|
|
95
|
-
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
return (_jsx("div", Object.assign({ className: className }, extractSupportProps(props), { ref: setWrapperElement, children: _jsx(Editor, Object.assign({}, props, { theme: theme !== null && theme !== void 0 ? theme : (dark ? 'snackDark' : 'snack'), className: cn({ [styles.editor]: hasBackground }), loading: loading !== null && loading !== void 0 ? loading : _jsx(Spinner, {}), options: mergedOptions, onMount: onEditorMount, path: yamlModelPath })) })));
|
|
94
|
+
return (_jsx("div", Object.assign({ className: className }, extractSupportProps(props), { ref: setWrapperElement, children: _jsx(Editor, Object.assign({}, props, { theme: theme !== null && theme !== void 0 ? theme : (dark ? 'snackDark' : 'snack'), className: cn({ [styles.editor]: hasBackground }), loading: loading !== null && loading !== void 0 ? loading : _jsx(Spinner, {}), options: mergedOptions, onMount: onEditorMount, path: modelPath })) })));
|
|
99
95
|
}
|
|
@@ -43,4 +43,5 @@ export declare function useCalculatedThemeValues({ stylesOriginNode, themeName }
|
|
|
43
43
|
};
|
|
44
44
|
} | undefined;
|
|
45
45
|
export declare function useYamlEditor(yamlSchema?: SchemasSettings): string | undefined;
|
|
46
|
+
export declare function useJsonEditor(jsonSchema?: SchemasSettings): void;
|
|
46
47
|
export {};
|
|
@@ -43,3 +43,15 @@ export function useYamlEditor(yamlSchema) {
|
|
|
43
43
|
}, [monaco, yamlSchema]);
|
|
44
44
|
return modelPath;
|
|
45
45
|
}
|
|
46
|
+
export function useJsonEditor(jsonSchema) {
|
|
47
|
+
const monaco = useMonaco();
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!jsonSchema || !monaco) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
53
|
+
validate: true,
|
|
54
|
+
schemas: [jsonSchema],
|
|
55
|
+
});
|
|
56
|
+
}, [monaco, jsonSchema]);
|
|
57
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EditorProps as MonacoEditorProps } from '@monaco-editor/react';
|
|
2
2
|
import { SchemasSettings } from 'monaco-yaml';
|
|
3
3
|
export type EditorProps = {
|
|
4
|
-
|
|
4
|
+
schema?: never;
|
|
5
5
|
} & MonacoEditorProps;
|
|
6
|
-
export type
|
|
7
|
-
language: 'yaml';
|
|
6
|
+
export type EditorWithSchemaProps = {
|
|
7
|
+
language: 'yaml' | 'json';
|
|
8
8
|
/**
|
|
9
|
-
* Схема для
|
|
9
|
+
* Схема для валидации
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
schema?: SchemasSettings;
|
|
12
12
|
} & Omit<MonacoEditorProps, 'language'>;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.4.7-preview-
|
|
7
|
+
"version": "0.4.7-preview-9a2892b7.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/chroma-js": "2.4.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "f7c3a794edac35282a081e454b0d2c514401194c"
|
|
50
50
|
}
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { useCallback, useMemo, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { Spinner } from '@snack-uikit/loaders';
|
|
6
|
-
import { extractSupportProps, isBrowser,
|
|
6
|
+
import { extractSupportProps, isBrowser, WithSupportProps } from '@snack-uikit/utils';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
CODE_EDITOR_OPTIONS,
|
|
@@ -11,11 +11,13 @@ import {
|
|
|
11
11
|
DEFAULT_THEME_VALUES,
|
|
12
12
|
YAML_CODE_EDITOR_OPTIONS,
|
|
13
13
|
} from './constants';
|
|
14
|
-
import { useCalculatedThemeValues, useYamlEditor } from './hooks';
|
|
14
|
+
import { useCalculatedThemeValues, useJsonEditor, useYamlEditor } from './hooks';
|
|
15
15
|
import styles from './styles.module.scss';
|
|
16
|
-
import { EditorProps,
|
|
16
|
+
import { EditorProps, EditorWithSchemaProps } from './types';
|
|
17
17
|
import { initLoaderConfig, isDark } from './utils';
|
|
18
18
|
|
|
19
|
+
initLoaderConfig();
|
|
20
|
+
|
|
19
21
|
export type CodeEditorProps = WithSupportProps<{
|
|
20
22
|
/**
|
|
21
23
|
* Название текущей темы. Значение не важно, важно что смена значения запускает пересчет стилей.
|
|
@@ -26,7 +28,7 @@ export type CodeEditorProps = WithSupportProps<{
|
|
|
26
28
|
*/
|
|
27
29
|
hasBackground?: boolean;
|
|
28
30
|
}> &
|
|
29
|
-
(EditorProps |
|
|
31
|
+
(EditorProps | EditorWithSchemaProps);
|
|
30
32
|
|
|
31
33
|
export function CodeEditor({
|
|
32
34
|
themeName,
|
|
@@ -39,17 +41,13 @@ export function CodeEditor({
|
|
|
39
41
|
...props
|
|
40
42
|
}: CodeEditorProps) {
|
|
41
43
|
const { language } = props;
|
|
42
|
-
const [canRender, setCanRender] = useState(false);
|
|
43
|
-
|
|
44
|
-
useLayoutEffect(() => {
|
|
45
|
-
initLoaderConfig();
|
|
46
|
-
setCanRender(true);
|
|
47
|
-
}, []);
|
|
48
44
|
|
|
49
45
|
const monaco = useMonaco();
|
|
50
46
|
const [wrapperElement, setWrapperElement] = useState<HTMLDivElement | null>(null);
|
|
51
47
|
|
|
52
|
-
const
|
|
48
|
+
const modelPath = 'schema' in props ? props.schema?.fileMatch?.[0] : undefined;
|
|
49
|
+
useYamlEditor(props.language === 'yaml' ? props.schema : undefined);
|
|
50
|
+
useJsonEditor(props.language === 'json' ? props.schema : undefined);
|
|
53
51
|
|
|
54
52
|
const onEditorMount = useCallback<OnMount>(
|
|
55
53
|
(editor, monaco) => {
|
|
@@ -138,10 +136,6 @@ export function CodeEditor({
|
|
|
138
136
|
[options, language, themeValues?.mono],
|
|
139
137
|
);
|
|
140
138
|
|
|
141
|
-
if (!canRender) {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
139
|
return (
|
|
146
140
|
<div className={className} {...extractSupportProps(props)} ref={setWrapperElement}>
|
|
147
141
|
<Editor
|
|
@@ -151,7 +145,7 @@ export function CodeEditor({
|
|
|
151
145
|
loading={loading ?? <Spinner />}
|
|
152
146
|
options={mergedOptions}
|
|
153
147
|
onMount={onEditorMount}
|
|
154
|
-
path={
|
|
148
|
+
path={modelPath}
|
|
155
149
|
/>
|
|
156
150
|
</div>
|
|
157
151
|
);
|
package/src/components/hooks.ts
CHANGED
|
@@ -62,3 +62,18 @@ export function useYamlEditor(yamlSchema?: SchemasSettings) {
|
|
|
62
62
|
|
|
63
63
|
return modelPath;
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
export function useJsonEditor(jsonSchema?: SchemasSettings) {
|
|
67
|
+
const monaco = useMonaco();
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!jsonSchema || !monaco) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
75
|
+
validate: true,
|
|
76
|
+
schemas: [jsonSchema],
|
|
77
|
+
});
|
|
78
|
+
}, [monaco, jsonSchema]);
|
|
79
|
+
}
|
package/src/components/types.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { EditorProps as MonacoEditorProps } from '@monaco-editor/react';
|
|
|
2
2
|
import { SchemasSettings } from 'monaco-yaml';
|
|
3
3
|
|
|
4
4
|
export type EditorProps = {
|
|
5
|
-
|
|
5
|
+
schema?: never;
|
|
6
6
|
} & MonacoEditorProps;
|
|
7
7
|
|
|
8
|
-
export type
|
|
9
|
-
language: 'yaml';
|
|
8
|
+
export type EditorWithSchemaProps = {
|
|
9
|
+
language: 'yaml' | 'json';
|
|
10
10
|
/**
|
|
11
|
-
* Схема для
|
|
11
|
+
* Схема для валидации
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
schema?: SchemasSettings;
|
|
14
14
|
} & Omit<MonacoEditorProps, 'language'>;
|