Skip to content

Commit 2ba809f

Browse files
committed
update demo
1 parent 09cbfce commit 2ba809f

File tree

7 files changed

+611
-64
lines changed

7 files changed

+611
-64
lines changed

fixMonaco.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

index.html

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<script>
2020
const importMap = {
2121
imports: {
22+
"aa__monaco-editor": "./node_modules/monaco-editor/esm/vs/editor/editor.main.min.js",
2223
"aa__@node-projects/base-custom-webcomponent": "./node_modules/@node-projects/base-custom-webcomponent/dist/index-min.js",
2324
"aa__@node-projects/css-parser": "./node_modules/@node-projects/css-parser/dist/index-min.js",
2425
"aa__@node-projects/web-component-designer": "./node_modules/@node-projects/web-component-designer/dist/index-min.js",
@@ -27,6 +28,7 @@
2728
"aa__@node-projects/node-html-parser-esm": "./node_modules/@node-projects/node-html-parser-esm/dist/index-min.js",
2829
"aa__dock-spawn-ts": "./node_modules/dock-spawn-ts/lib/js/index-webcomponent-min.js",
2930

31+
"monaco-editor": "./node_modules/monaco-editor/esm/vs/editor/editor.main.js",
3032
"@node-projects/base-custom-webcomponent": "./node_modules/@node-projects/base-custom-webcomponent/dist/index.js",
3133
"@node-projects/css-parser": "./node_modules/@node-projects/css-parser/dist/index.js",
3234
"@node-projects/web-component-designer": "./node_modules/@node-projects/web-component-designer/dist/index.js",
@@ -60,15 +62,6 @@
6062
});
6163
</script>
6264

63-
<!-- if you use Moacco Editor -->
64-
<script src="./node_modules/monaco-editor/min/vs/loader.js"></script>
65-
<script>
66-
require.config({ paths: { 'vs': 'node_modules/monaco-editor/min/vs', 'vs/css': { disabled: true } } });
67-
require(['vs/editor/editor.main'], () => {
68-
monaco.editor.setTheme('vs-dark');
69-
});
70-
</script>
71-
7265
<!-- if you use ACE Editor -->
7366
<!--
7467
<script src="./node_modules/ace-builds/src-min-noconflict/ace.js"></script>
@@ -82,6 +75,9 @@
8275
-->
8376

8477
<script type="module">
78+
let { CodeViewMonaco } = await importShim('@node-projects/web-component-designer-codeview-monaco');
79+
await CodeViewMonaco.loadMonacoEditorViaImport();
80+
8581
await importShim('dock-spawn-ts');
8682
await importShim('@node-projects/web-component-designer');
8783
await importShim('./dist/appShell.js');
@@ -218,7 +214,8 @@
218214
src="./node_modules/@node-projects/web-component-designer/assets/icons/copy.svg"></button>
219215
<button data-command="delete" title="delete" disabled><img
220216
src="./node_modules/@node-projects/web-component-designer/assets/icons/delete.svg"></button>
221-
<button ondragstart="return false;" style="margin-left: 10px;" data-command="undo" disabled title="click and hold to see the undo list"><img
217+
<button ondragstart="return false;" style="margin-left: 10px;" data-command="undo" disabled
218+
title="click and hold to see the undo list"><img
222219
src="./node_modules/@node-projects/web-component-designer/assets/icons/undo.svg"></button>
223220
<button ondragstart="return false;" data-command="redo" disabled title="click and hold to see the redo list"><img
224221
src="./node_modules/@node-projects/web-component-designer/assets/icons/redo.svg"></button>

0 commit comments

Comments
 (0)