@codecademy/codebytes 0.6.7-alpha.3dce32.0 → 0.6.7-alpha.4be5c5.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 +1 -1
- package/dist/MonacoEditor/index.js +10 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.6.7-alpha.
|
|
6
|
+
### [0.6.7-alpha.4be5c5.0](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.6...@codecademy/codebytes@0.6.7-alpha.4be5c5.0) (2022-02-04)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @codecademy/codebytes
|
|
9
9
|
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
|
|
3
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
4
|
+
|
|
1
5
|
// DO NOT CHANGE ANYTHING HERE
|
|
2
6
|
// This component is part of the Codebytes MVP and only includes basic configuration around theming
|
|
3
7
|
// We are working on a monaco package in client-modules that has more configuration around themes and languages
|
|
4
8
|
// Monaco as a shared package RFC https://www.notion.so/codecademy/Monaco-editor-as-a-shared-package-1f4484db165b4abc8394c3556451ef6a
|
|
9
|
+
import { Box } from '@codecademy/gamut';
|
|
10
|
+
import styled from '@emotion/styled/types/base';
|
|
5
11
|
import ReactMonacoEditor from '@monaco-editor/react';
|
|
6
12
|
import React, { useCallback, useRef } from 'react';
|
|
7
13
|
import ResizeObserver from 'react-resize-observer';
|
|
8
14
|
import { dark } from './theme';
|
|
15
|
+
// A hidden element in monaco was causing its container to overflow
|
|
16
|
+
// https://github.com/microsoft/monaco-editor/issues/29#issuecomment-753854541
|
|
17
|
+
var EditorWrapper = styled(Box)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & .monaco-editor.rename-box,\n .monaco-hover {\n top: 0;\n }\n // A hidden overflowing element causes accessibility errors\n // The background of the overflowing element causes triggers color contrast errors\n & .lines-content {\n height: 100% !important;\n }\n"])));
|
|
9
18
|
export var SimpleMonacoEditor = function SimpleMonacoEditor(_ref) {
|
|
10
19
|
var value = _ref.value,
|
|
11
20
|
language = _ref.language,
|
|
@@ -16,7 +25,7 @@ export var SimpleMonacoEditor = function SimpleMonacoEditor(_ref) {
|
|
|
16
25
|
monaco.editor.defineTheme('dark', dark);
|
|
17
26
|
monaco.editor.setTheme('dark');
|
|
18
27
|
}, []);
|
|
19
|
-
return /*#__PURE__*/React.createElement(
|
|
28
|
+
return /*#__PURE__*/React.createElement(EditorWrapper, null, /*#__PURE__*/React.createElement(ResizeObserver, {
|
|
20
29
|
onResize: function onResize(_ref2) {
|
|
21
30
|
var _editorRef$current;
|
|
22
31
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/codebytes",
|
|
3
3
|
"description": "Codebytes Code Editor",
|
|
4
|
-
"version": "0.6.7-alpha.
|
|
4
|
+
"version": "0.6.7-alpha.4be5c5.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.css",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"files": [
|
|
65
65
|
"dist/**"
|
|
66
66
|
],
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "7a971eed82851209680b967a87356900c55bc669"
|
|
68
68
|
}
|