Skip to content

Commit ed544b3

Browse files
committed
update demo and fix monaco
1 parent 332bb7c commit ed544b3

File tree

4 files changed

+399
-776
lines changed

4 files changed

+399
-776
lines changed

.github/workflows/buildDeploy.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
run: npm ci
2020
- name: Typescript
2121
run: npm run build
22+
- name: fixMonaco
23+
run: node fixMonaco.js
2224
- name: Copy js & json
2325
run: |
2426
npx copyfiles --verbose "node_modules/**/*.js" build/default

fixMonaco.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import fs from 'fs';
2+
3+
//fix for monaco editor (issue https://github.com/microsoft/monaco-editor/issues/3409)
4+
console.log("fix ./node_modules/monaco-editor/min/vs/editor/editor.main.js");
5+
fs.readFile("./node_modules/monaco-editor/min/vs/editor/editor.main.js", function (err, buf) {
6+
let code = buf.toString();
7+
let rgx = /(.)=>{this\.viewHelper\.viewDomNode\.contains\((.)\.target\)/;
8+
let newcode = code.replace(rgx, '$1=>{this.viewHelper.viewDomNode.contains($1.composedPath()[0])');
9+
if (code != newcode) {
10+
console.log("monaco was fixed!!");
11+
fs.writeFile("./node_modules/monaco-editor/min/vs/editor/editor.main.js", newcode, (err) => {
12+
if (err) console.log(err);
13+
});
14+
}
15+
});

0 commit comments

Comments
 (0)