@snack-uikit/code-editor 0.2.2-preview-b06241ae.0 → 0.2.3-preview-94780dcd.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.2.2 (2024-07-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-0000:** code-editor theme init ([da4f622](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/commits/da4f622f5a5b9b8028127d357dbe6fc8e20a81ab))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 0.2.1 (2024-07-18)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -14,7 +14,7 @@ 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 } from '@snack-uikit/utils';
|
|
17
|
+
import { extractSupportProps, isBrowser } from '@snack-uikit/utils';
|
|
18
18
|
import { CODE_EDITOR_OPTIONS, DEFAULT_THEME_OPTIONS, DEFAULT_THEME_VALUES } from './constants';
|
|
19
19
|
import { useCalculatedThemeValues } from './hooks';
|
|
20
20
|
import styles from './styles.module.css';
|
|
@@ -25,8 +25,8 @@ export function CodeEditor(_a) {
|
|
|
25
25
|
const monaco = useMonaco();
|
|
26
26
|
const [wrapperElement, setWrapperElement] = useState(null);
|
|
27
27
|
const onEditorMount = useCallback((editor, monaco) => {
|
|
28
|
-
var _a
|
|
29
|
-
monaco && (
|
|
28
|
+
var _a;
|
|
29
|
+
monaco && isBrowser() && ((_a = document === null || document === void 0 ? void 0 : document.fonts) === null || _a === void 0 ? void 0 : _a.ready.finally(monaco.editor.remeasureFonts));
|
|
30
30
|
onMount === null || onMount === void 0 ? void 0 : onMount(editor, monaco);
|
|
31
31
|
}, [onMount]);
|
|
32
32
|
const themeValues = useCalculatedThemeValues({ themeName, stylesOriginNode: wrapperElement });
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.2.
|
|
7
|
+
"version": "0.2.3-preview-94780dcd.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"scripts": {},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@monaco-editor/react": "4.6.0",
|
|
36
|
-
"@snack-uikit/loaders": "0.5.
|
|
37
|
-
"@snack-uikit/utils": "3.3.0",
|
|
36
|
+
"@snack-uikit/loaders": "0.5.3-preview-94780dcd.0",
|
|
37
|
+
"@snack-uikit/utils": "3.3.1-preview-94780dcd.0",
|
|
38
38
|
"classnames": "2.5.1"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "0b67805c876ec8ccc1567d110a3b37b04d2f0fb6"
|
|
41
41
|
}
|
|
@@ -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, WithSupportProps } from '@snack-uikit/utils';
|
|
6
|
+
import { extractSupportProps, isBrowser, WithSupportProps } from '@snack-uikit/utils';
|
|
7
7
|
|
|
8
8
|
import { CODE_EDITOR_OPTIONS, DEFAULT_THEME_OPTIONS, DEFAULT_THEME_VALUES } from './constants';
|
|
9
9
|
import { useCalculatedThemeValues } from './hooks';
|
|
@@ -39,7 +39,7 @@ export function CodeEditor({
|
|
|
39
39
|
|
|
40
40
|
const onEditorMount = useCallback<OnMount>(
|
|
41
41
|
(editor, monaco) => {
|
|
42
|
-
monaco &&
|
|
42
|
+
monaco && isBrowser() && document?.fonts?.ready.finally(monaco.editor.remeasureFonts);
|
|
43
43
|
onMount?.(editor, monaco);
|
|
44
44
|
},
|
|
45
45
|
[onMount],
|