Skip to content

Commit 8870dd1

Browse files
chore: Bump monaco-editor and monaco-yaml (#3871)
* chore: Bump monaco-editor and monaco-yaml * fix x-index of the minimap * Bump and fix duplicate hover content * Fix index for cluster wizard buttons * Move z-index style deep to proper editor child * Fix z-index * Tests correction * force focus * Tests correction * Update packages * Test correction * Tests corrections --------- Co-authored-by: Pietocha <konrad.pietocha@sap.com>
1 parent 104c71c commit 8870dd1

File tree

10 files changed

+737
-1776
lines changed

10 files changed

+737
-1776
lines changed

package-lock.json

Lines changed: 113 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@
9494
"lodash": "^4.17.19",
9595
"marked": "^15.0.7",
9696
"marked-react": "^3.0.0",
97-
"monaco-editor": "^0.33.0",
98-
"monaco-yaml": "^4.0.4",
97+
"monaco-editor": "^0.52.2",
98+
"monaco-yaml": "^5.4.0",
9999
"oidc-client-ts": "^3.2.0",
100100
"p-queue": "^8.1.0",
101101
"pako": "^2.0.4",

src/shared/components/MonacoEditorESM/Editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function Editor({
9797
</div>
9898
)}
9999
<div ref={divRef} className="resource-form__editor" />
100-
{placeholder && !!!value && (
100+
{placeholder && !value && (
101101
<div className="resource-form__placeholder">{placeholder}</div>
102102
)}
103103
<div className="resource-form__legend">

src/shared/components/MonacoEditorESM/Editor.scss

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
position: relative;
77
}
88

9+
.minimap {
10+
z-index: 0 !important;
11+
}
12+
913
.resource-form__overlay {
1014
position: absolute;
1115
top: 0;
@@ -25,8 +29,15 @@
2529
flex-grow: 1;
2630
border: 1px solid var(--sapNeutralBackground);
2731

28-
.monaco-hover {
29-
z-index: 100;
32+
.monaco-editor {
33+
textarea.inputarea {
34+
z-index: unset;
35+
}
36+
37+
.overflowingContentWidgets {
38+
z-index: 100;
39+
position: absolute;
40+
}
3041
}
3142
}
3243

@@ -61,6 +72,9 @@
6172
pointer-events: none;
6273
}
6374

64-
.monaco-hover-content .hover-contents p:last-of-type {
65-
display: none;
75+
.monaco-hover-content {
76+
.hover-row:not(:first-of-type),
77+
p:last-of-type {
78+
display: none;
79+
}
6680
}

src/shared/components/MonacoEditorESM/autocompletion/useAutocompleteWorker.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useCallback, useState } from 'react';
22
import { Uri } from 'monaco-editor';
3-
import { setDiagnosticsOptions } from 'monaco-yaml';
3+
import * as monaco from 'monaco-editor';
4+
import { configureMonacoYaml } from 'monaco-yaml';
45
import { useGetSchema } from 'hooks/useGetSchema';
56
import { v4 as uuid } from 'uuid';
67
import YamlWorker from './yaml.worker.js?worker';
@@ -65,7 +66,7 @@ export function useAutocompleteWorker({
6566
});
6667
}
6768

68-
setDiagnosticsOptions({
69+
configureMonacoYaml(monaco, {
6970
enableSchemaRequest: false,
7071
hover: true,
7172
completion: !!schema && !readOnly,

0 commit comments

Comments
 (0)