@node-projects/web-component-designer-codeview-monaco 0.1.26 → 0.1.28
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.
|
@@ -129,6 +129,7 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
|
|
|
129
129
|
if (this._editor.offsetWidth > 0) {
|
|
130
130
|
let options = {
|
|
131
131
|
automaticLayout: true,
|
|
132
|
+
theme: this._theme,
|
|
132
133
|
language: this.language,
|
|
133
134
|
value: this.#code,
|
|
134
135
|
fixedOverflowWidgets: true,
|
|
@@ -226,6 +227,7 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
|
|
|
226
227
|
this._disableSelectionAfterUpd = true;
|
|
227
228
|
if (this._monacoEditor)
|
|
228
229
|
this._monacoEditor.setValue(code);
|
|
230
|
+
CodeViewMonaco.monacoLib.editor.setTheme(this._theme);
|
|
229
231
|
CodeViewMonaco.monacoLib.editor.setModelLanguage(this._monacoEditor.getModel(), this.language);
|
|
230
232
|
this._disableSelectionAfterUpd = false;
|
|
231
233
|
}
|
|
@@ -235,12 +237,14 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
|
|
|
235
237
|
}
|
|
236
238
|
setSelection(position) {
|
|
237
239
|
if (this._monacoEditor && !this._disableSelection && position) {
|
|
240
|
+
this._disableSelection = true;
|
|
238
241
|
let model = this._monacoEditor.getModel();
|
|
239
242
|
let point1 = model.getPositionAt(position.start);
|
|
240
243
|
let point2 = model.getPositionAt(position.start + position.length);
|
|
241
244
|
setTimeout(() => {
|
|
242
245
|
this._monacoEditor.setSelection({ startLineNumber: point1.lineNumber, startColumn: point1.column, endLineNumber: point2.lineNumber, endColumn: point2.column });
|
|
243
246
|
this._monacoEditor.revealRangeInCenterIfOutsideViewport(new CodeViewMonaco.monacoLib.Range(point1.lineNumber, point1.column, point2.lineNumber, point2.column), 1);
|
|
247
|
+
this._disableSelection = false;
|
|
244
248
|
}, 50);
|
|
245
249
|
}
|
|
246
250
|
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "web-component-designer addon: Code Editor using Monaco",
|
|
3
|
-
"name": "@node-projects/web-component-designer-codeview-monaco",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/widgets/codeView/code-view-monaco.js",
|
|
7
|
-
"author": "jochen.kuehner@gmx.de",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"tsc": "tsc",
|
|
11
|
-
"build": "tsc",
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"@node-projects/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"description": "web-component-designer addon: Code Editor using Monaco",
|
|
3
|
+
"name": "@node-projects/web-component-designer-codeview-monaco",
|
|
4
|
+
"version": "0.1.28",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/widgets/codeView/code-view-monaco.js",
|
|
7
|
+
"author": "jochen.kuehner@gmx.de",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"tsc": "tsc",
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"link": "npm link",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"monaco-editor": ">=0.49.0",
|
|
17
|
+
"@node-projects/base-custom-webcomponent": ">=0.19.0",
|
|
18
|
+
"@node-projects/web-component-designer": ">=0.1.137"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/node-projects/web-component-designer.git"
|
|
23
|
+
}
|
|
24
|
+
}
|