@snack-uikit/code-editor 0.2.0 → 0.2.1-preview-62ed8d71.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.
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { Editor, useMonaco } from '@monaco-editor/react';
|
|
13
|
+
import { Editor, loader, useMonaco } from '@monaco-editor/react';
|
|
14
14
|
import cn from 'classnames';
|
|
15
15
|
import { useMemo } from 'react';
|
|
16
16
|
import { Spinner } from '@snack-uikit/loaders';
|
|
@@ -19,6 +19,7 @@ import { CODE_EDITOR_OPTIONS, DEFAULT_THEME_OPTIONS, DEFAULT_THEME_VALUES } from
|
|
|
19
19
|
import { useCalculatedThemeValues } from './hooks';
|
|
20
20
|
import styles from './styles.module.css';
|
|
21
21
|
import { isDark } from './utils';
|
|
22
|
+
loader.config({ paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.43.0/min/vs' } });
|
|
22
23
|
export function CodeEditor(_a) {
|
|
23
24
|
var { themeClassName, className, theme, options, loading, hasBackground = true } = _a, props = __rest(_a, ["themeClassName", "className", "theme", "options", "loading", "hasBackground"]);
|
|
24
25
|
const monaco = useMonaco();
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.2.0",
|
|
7
|
+
"version": "0.2.1-preview-62ed8d71.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"@snack-uikit/utils": "3.3.0",
|
|
38
38
|
"classnames": "2.5.1"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "04318956c6d179aa137184a48f90ec3f9aa83942"
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Editor, EditorProps, useMonaco } from '@monaco-editor/react';
|
|
1
|
+
import { Editor, EditorProps, loader, useMonaco } from '@monaco-editor/react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
|
|
@@ -10,6 +10,8 @@ import { useCalculatedThemeValues } from './hooks';
|
|
|
10
10
|
import styles from './styles.module.scss';
|
|
11
11
|
import { isDark } from './utils';
|
|
12
12
|
|
|
13
|
+
loader.config({ paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.43.0/min/vs' } });
|
|
14
|
+
|
|
13
15
|
export type CodeEditorProps = WithSupportProps<{
|
|
14
16
|
/** Класснейм подключенной темы (из хука useThemeConfig() или ThemeProvider)
|
|
15
17
|
* <br> По дефолту берется значение из useTheme внутри
|