@ng-util/monaco-editor 21.0.1 → 21.2.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/README.md
CHANGED
|
@@ -14,7 +14,6 @@ Monaco Code Editor for Angular.
|
|
|
14
14
|
## Demo
|
|
15
15
|
|
|
16
16
|
- [Stackblitz](https://stackblitz.com/edit/ng-util-monaco-editor?file=src/app/app.component.ts)
|
|
17
|
-
- [Codesandbox](https://codesandbox.io/s/ng-util-monaco-editor-0m474?file=/src/app/app.component.ts)
|
|
18
17
|
|
|
19
18
|
## Usage
|
|
20
19
|
|
|
@@ -28,47 +27,28 @@ npm install @ng-util/monaco-editor --save
|
|
|
28
27
|
|
|
29
28
|
### Sample
|
|
30
29
|
|
|
31
|
-
Include `NuMonacoEditorModule` in Main Module and Feature Modules where you want to use the editor component.(eg: app.module.ts):
|
|
32
|
-
|
|
33
|
-
```ts
|
|
34
|
-
import { NgModule } from '@angular/core';
|
|
35
|
-
import { NuMonacoEditorModule } from '@ng-util/monaco-editor';
|
|
36
|
-
|
|
37
|
-
@NgModule({
|
|
38
|
-
imports: [
|
|
39
|
-
NuMonacoEditorModule // And use `provideNuMonacoEditorConfig` to modify the global configuration
|
|
40
|
-
],
|
|
41
|
-
})
|
|
42
|
-
export class AppModule { }
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Create Editor options in component.
|
|
46
|
-
|
|
47
30
|
```ts
|
|
48
31
|
import { Component } from '@angular/core';
|
|
32
|
+
import {
|
|
33
|
+
NuMonacoEditorComponent,
|
|
34
|
+
NuMonacoEditorDiffComponent,
|
|
35
|
+
NuMonacoEditorDiffModel,
|
|
36
|
+
NuMonacoEditorEvent,
|
|
37
|
+
NuMonacoEditorModel
|
|
38
|
+
} from '@ng-util/monaco-editor';
|
|
49
39
|
|
|
50
40
|
@Component({
|
|
51
41
|
selector: 'app-root',
|
|
52
|
-
template:
|
|
42
|
+
template: `
|
|
43
|
+
<nu-monaco-editor [(ngModel)]="value" [options]="editorOptions" />
|
|
44
|
+
<h2>Diff</h2>
|
|
45
|
+
<nu-monaco-diff-editor [options]="editorOptions" [old]="old" [new]="new" />
|
|
46
|
+
`,
|
|
47
|
+
imports: [NuMonacoEditorComponent, NuMonacoEditorDiffComponent]
|
|
53
48
|
})
|
|
54
49
|
export class DemoComponent {
|
|
55
50
|
value: string = 'const a = 1;';
|
|
56
51
|
editorOptions = { theme: 'vs-dark', language: 'typescript' };
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Or monaco diff editor:
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
import { Component } from '@angular/core';
|
|
64
|
-
import { NuMonacoEditorDiffModel } from '@ng-util/monaco-editor';
|
|
65
|
-
|
|
66
|
-
@Component({
|
|
67
|
-
selector: 'app-root',
|
|
68
|
-
template: `<nu-monaco-diff-editor [options]="editorOptions" [old]="old" [new]="new"></nu-monaco-diff-editor>`,
|
|
69
|
-
})
|
|
70
|
-
export class DemoComponent {
|
|
71
|
-
editorOptions = { theme: 'vs-dark', language: 'javascript' };
|
|
72
52
|
old: NuMonacoEditorDiffModel = { code: `<p>1</p>` };
|
|
73
53
|
new: NuMonacoEditorDiffModel = { code: `<p>2</p>` };
|
|
74
54
|
}
|
|
@@ -100,10 +80,10 @@ export class DemoComponent {
|
|
|
100
80
|
|
|
101
81
|
### Configurations
|
|
102
82
|
|
|
103
|
-
`
|
|
83
|
+
`provideNuMonacoEditorConfig` accepts config of type `NuMonacoEditorConfig`.
|
|
104
84
|
|
|
105
85
|
```ts
|
|
106
|
-
|
|
86
|
+
provideNuMonacoEditorConfig({
|
|
107
87
|
baseUrl: ``, // The base URL to monaco editor library assets via AMD (RequireJS), Default: `https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.20.0/min`
|
|
108
88
|
defaultOptions: {}, // Default options when creating editors
|
|
109
89
|
monacoLoad: (m) => {} // The event after the first loading of the monaco editor library is completed, use this function to extend monaco editor functionalities.
|
|
@@ -115,11 +95,11 @@ NuMonacoEditorModule.forRoot({
|
|
|
115
95
|
`monacoLoad` property of `NuMonacoEditorConfig` can be used to configure JSON default.
|
|
116
96
|
|
|
117
97
|
```ts
|
|
118
|
-
|
|
98
|
+
provideNuMonacoEditorConfig({
|
|
119
99
|
defaultOptions: { scrollBeyondLastLine: false },
|
|
120
100
|
monacoLoad: () => {
|
|
121
101
|
const uri = monaco.Uri.parse('a://b/foo.json');
|
|
122
|
-
monaco.
|
|
102
|
+
monaco.json.jsonDefaults.setDiagnosticsOptions({
|
|
123
103
|
validate: true,
|
|
124
104
|
schemas: [
|
|
125
105
|
{
|
|
@@ -155,7 +135,7 @@ NuMonacoEditorModule.forRoot({
|
|
|
155
135
|
}),
|
|
156
136
|
```
|
|
157
137
|
|
|
158
|
-
Now pass `model` config of type `
|
|
138
|
+
Now pass `model` config of type `NuMonacoEditorModel` to Editor Component.
|
|
159
139
|
|
|
160
140
|
```ts
|
|
161
141
|
import { Component } from '@angular/core';
|
|
@@ -164,7 +144,7 @@ import { NuMonacoEditorEvent, NuMonacoEditorModel } from '@ng-util/monaco-editor
|
|
|
164
144
|
@Component({
|
|
165
145
|
selector: 'app-demo',
|
|
166
146
|
template: `
|
|
167
|
-
<nu-monaco-editor #a [(ngModel)]="value" [model]="model" (event)="showEvent($event)"
|
|
147
|
+
<nu-monaco-editor #a [(ngModel)]="value" [model]="model" (event)="showEvent($event)" />
|
|
168
148
|
<button (click)="a.editor.getAction('editor.action.formatDocument').run()">Format document</button>
|
|
169
149
|
`,
|
|
170
150
|
})
|
|
@@ -191,7 +171,9 @@ export class DemoComponent {
|
|
|
191
171
|
| Property | Description | Type | Default |
|
|
192
172
|
|----------|-------------|------|---------|
|
|
193
173
|
| `[placeholder]` | Placeholder of monaco editor, Can change the style via defining the `.monaco-editor-placeholder` CSS. | `string` | - |
|
|
194
|
-
| `[height]` | Height of monaco editor | `string` | `200px` |
|
|
174
|
+
| `[height]` | Height of monaco editor, can be set `auto` | `string` | `200px` |
|
|
175
|
+
| `[minHeight]` | Min-height of monaco editor, when `height` set `auto` | `number` | - |
|
|
176
|
+
| `[maxHeight]` | Max-height of monaco editor, when `height` set `auto` | `number` | `1000` |
|
|
195
177
|
| `[disabled]` | Disabled of monaco editor | `boolean` | `false` |
|
|
196
178
|
| `[autoFormat]` | Whether to automatically format the document | `boolean` | `true` |
|
|
197
179
|
| `[options]` | Default options when creating editors | `monaco.editor.IStandaloneEditorConstructionOptions` | - |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, makeEnvironmentProviders, inject, ElementRef, DestroyRef, input, numberAttribute, booleanAttribute, output, effect, Component, untracked, forwardRef, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, inject, ElementRef, DestroyRef, input, numberAttribute, booleanAttribute, output, effect, afterNextRender, Component, untracked, forwardRef, ChangeDetectionStrategy } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
-
import {
|
|
5
|
+
import { timer, fromEvent, take } from 'rxjs';
|
|
6
6
|
import { DOCUMENT } from '@angular/common';
|
|
7
7
|
import { debounceTime } from 'rxjs/operators';
|
|
8
8
|
|
|
@@ -14,8 +14,7 @@ function provideNuMonacoEditorConfig(config) {
|
|
|
14
14
|
return makeEnvironmentProviders([{ provide: NU_MONACO_EDITOR_CONFIG, useValue: config }]);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
let
|
|
18
|
-
let loadPromise;
|
|
17
|
+
let monacoLoadPromise = null;
|
|
19
18
|
class NuMonacoEditorBase {
|
|
20
19
|
el = inject(ElementRef);
|
|
21
20
|
config = inject(NU_MONACO_EDITOR_CONFIG, { optional: true });
|
|
@@ -25,6 +24,7 @@ class NuMonacoEditorBase {
|
|
|
25
24
|
_resize$ = null;
|
|
26
25
|
_config;
|
|
27
26
|
_disabled;
|
|
27
|
+
_disposables = [];
|
|
28
28
|
height = input(`200px`, ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
29
29
|
delay = input(0, ...(ngDevMode ? [{ debugName: "delay", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
30
30
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
@@ -37,8 +37,14 @@ class NuMonacoEditorBase {
|
|
|
37
37
|
});
|
|
38
38
|
effect(() => {
|
|
39
39
|
const options = this.options();
|
|
40
|
+
this.height();
|
|
40
41
|
this.updateOptions(options);
|
|
41
42
|
});
|
|
43
|
+
afterNextRender(() => {
|
|
44
|
+
timer(this.delay())
|
|
45
|
+
.pipe(takeUntilDestroyed(this.destroy$))
|
|
46
|
+
.subscribe(() => this.init());
|
|
47
|
+
});
|
|
42
48
|
}
|
|
43
49
|
notifyEvent(type, other) {
|
|
44
50
|
this.event.emit({ type, editor: this._editor, ...other });
|
|
@@ -48,57 +54,59 @@ class NuMonacoEditorBase {
|
|
|
48
54
|
return this;
|
|
49
55
|
}
|
|
50
56
|
init() {
|
|
51
|
-
if (
|
|
52
|
-
loadPromise.then(() => this.initMonaco(this.options(), true));
|
|
57
|
+
if (typeof window === 'undefined')
|
|
53
58
|
return;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
let baseUrl = `${this._config.baseUrl}/vs`;
|
|
67
|
-
// fix: https://github.com/microsoft/monaco-editor/issues/4778
|
|
68
|
-
if (!/^https?:\/\//g.test(baseUrl)) {
|
|
69
|
-
baseUrl = `${window.location.origin}/${baseUrl.startsWith('/') ? baseUrl.substring(1) : baseUrl}`;
|
|
70
|
-
}
|
|
71
|
-
const amdLoader = () => {
|
|
72
|
-
win.require.config({
|
|
73
|
-
paths: {
|
|
74
|
-
vs: baseUrl
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
if (typeof this._config.monacoPreLoad === 'function') {
|
|
78
|
-
this._config.monacoPreLoad();
|
|
59
|
+
if (!monacoLoadPromise) {
|
|
60
|
+
monacoLoadPromise = new Promise((resolve, reject) => {
|
|
61
|
+
const windowRef = window;
|
|
62
|
+
if (windowRef.monaco) {
|
|
63
|
+
resolve();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
let baseUrl = `${this._config.baseUrl}/vs`;
|
|
67
|
+
// fix: https://github.com/microsoft/monaco-editor/issues/4778
|
|
68
|
+
if (!/^https?:\/\//.test(baseUrl)) {
|
|
69
|
+
baseUrl = `${window.location.origin}/${baseUrl.startsWith('/') ? baseUrl.substring(1) : baseUrl}`;
|
|
79
70
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
const amdLoader = () => {
|
|
72
|
+
windowRef.require.config({
|
|
73
|
+
paths: {
|
|
74
|
+
vs: baseUrl
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
if (typeof this._config.monacoPreLoad === 'function') {
|
|
78
|
+
this._config.monacoPreLoad();
|
|
83
79
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
windowRef.require(['vs/editor/editor.main'], () => {
|
|
81
|
+
if (typeof this._config.monacoLoad === 'function') {
|
|
82
|
+
this._config.monacoLoad(windowRef.monaco);
|
|
83
|
+
}
|
|
84
|
+
resolve();
|
|
85
|
+
}, () => {
|
|
86
|
+
reject(`Unable to load editor/editor.main module, please check your network environment.`);
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
if (!windowRef.require) {
|
|
90
|
+
const loaderScript = this.doc.createElement('script');
|
|
91
|
+
loaderScript.type = 'text/javascript';
|
|
92
|
+
loaderScript.src = `${baseUrl}/loader.js`;
|
|
93
|
+
loaderScript.onload = amdLoader;
|
|
94
|
+
loaderScript.onerror = () => {
|
|
95
|
+
reject(`Unable to load ${loaderScript.src}, please check your network environment.`);
|
|
96
|
+
};
|
|
97
|
+
this.doc.getElementsByTagName('head')[0].appendChild(loaderScript);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
amdLoader();
|
|
101
|
+
}
|
|
102
|
+
}).catch(error => {
|
|
103
|
+
monacoLoadPromise = null;
|
|
104
|
+
throw error;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
monacoLoadPromise
|
|
108
|
+
.then(() => this.initMonaco(this.options(), true))
|
|
109
|
+
.catch(error => this.notifyEvent('load-error', { error }));
|
|
102
110
|
}
|
|
103
111
|
cleanResize() {
|
|
104
112
|
this._resize$?.unsubscribe();
|
|
@@ -109,23 +117,27 @@ class NuMonacoEditorBase {
|
|
|
109
117
|
this._resize$ = fromEvent(window, 'resize')
|
|
110
118
|
.pipe(debounceTime(100))
|
|
111
119
|
.subscribe(() => {
|
|
112
|
-
this._editor
|
|
120
|
+
this._editor?.layout();
|
|
113
121
|
this.notifyEvent('resize');
|
|
114
122
|
});
|
|
115
123
|
return this;
|
|
116
124
|
}
|
|
125
|
+
disposeEditor() {
|
|
126
|
+
this._disposables.forEach(d => d.dispose());
|
|
127
|
+
this._disposables.length = 0;
|
|
128
|
+
this._editor?.dispose();
|
|
129
|
+
this._editor = undefined;
|
|
130
|
+
return this;
|
|
131
|
+
}
|
|
117
132
|
updateOptions(v) {
|
|
118
133
|
if (!this._editor)
|
|
119
134
|
return;
|
|
120
|
-
this.
|
|
135
|
+
this.disposeEditor();
|
|
121
136
|
this.initMonaco(v, false);
|
|
122
137
|
}
|
|
123
|
-
ngAfterViewInit() {
|
|
124
|
-
setTimeout(() => this.init(), +this.delay());
|
|
125
|
-
}
|
|
126
138
|
ngOnDestroy() {
|
|
127
139
|
this.cleanResize();
|
|
128
|
-
this.
|
|
140
|
+
this.disposeEditor();
|
|
129
141
|
}
|
|
130
142
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NuMonacoEditorBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
131
143
|
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.0", type: NuMonacoEditorBase, isStandalone: true, selector: "nu-monaco-base", inputs: { height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { event: "event" }, ngImport: i0, template: ``, isInline: true });
|
|
@@ -184,6 +196,8 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
184
196
|
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : []));
|
|
185
197
|
model = input(...(ngDevMode ? [undefined, { debugName: "model" }] : []));
|
|
186
198
|
autoFormat = input(true, ...(ngDevMode ? [{ debugName: "autoFormat", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
199
|
+
maxHeight = input(undefined, ...(ngDevMode ? [{ debugName: "maxHeight", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
200
|
+
minHeight = input(undefined, ...(ngDevMode ? [{ debugName: "minHeight", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
187
201
|
get editor() {
|
|
188
202
|
return this._editor;
|
|
189
203
|
}
|
|
@@ -202,16 +216,17 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
202
216
|
}
|
|
203
217
|
togglePlaceholder() {
|
|
204
218
|
const text = this.placeholder();
|
|
205
|
-
if (text
|
|
219
|
+
if (typeof text !== 'string' || text.length <= 0 || this.editor == null)
|
|
206
220
|
return;
|
|
207
|
-
|
|
208
|
-
|
|
221
|
+
let widget = this._placeholderWidget;
|
|
222
|
+
if (widget == null) {
|
|
223
|
+
this._placeholderWidget = widget = new PlaceholderWidget(this.editor, text);
|
|
209
224
|
}
|
|
210
225
|
if (this._value.length > 0) {
|
|
211
|
-
this.editor.removeContentWidget(
|
|
226
|
+
this.editor.removeContentWidget(widget);
|
|
212
227
|
}
|
|
213
228
|
else {
|
|
214
|
-
this.editor.addContentWidget(
|
|
229
|
+
this.editor.addContentWidget(widget);
|
|
215
230
|
}
|
|
216
231
|
}
|
|
217
232
|
onChange = (_) => { };
|
|
@@ -219,6 +234,11 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
219
234
|
initMonaco(options, initEvent) {
|
|
220
235
|
const hasModel = !!this.model();
|
|
221
236
|
options = { ...this.config?.defaultOptions, ...options };
|
|
237
|
+
const heightAuto = this.height() === 'auto';
|
|
238
|
+
if (heightAuto) {
|
|
239
|
+
options.scrollBeyondLastLine = false;
|
|
240
|
+
options.overviewRulerLanes = 0;
|
|
241
|
+
}
|
|
222
242
|
if (hasModel) {
|
|
223
243
|
const model = monaco.editor.getModel(this.model().uri || '');
|
|
224
244
|
if (model) {
|
|
@@ -237,15 +257,19 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
237
257
|
if (!hasModel) {
|
|
238
258
|
editor.setValue(this._value);
|
|
239
259
|
}
|
|
240
|
-
editor.onDidChangeModelContent(() => {
|
|
260
|
+
this._disposables.push(editor.onDidChangeModelContent(() => {
|
|
241
261
|
const value = editor.getValue();
|
|
242
262
|
this._value = value;
|
|
243
263
|
this.onChange(value);
|
|
244
264
|
this.togglePlaceholder();
|
|
245
|
-
});
|
|
246
|
-
editor.onDidBlurEditorWidget(() => this.onTouched());
|
|
265
|
+
}));
|
|
266
|
+
this._disposables.push(editor.onDidBlurEditorWidget(() => this.onTouched()));
|
|
247
267
|
this.togglePlaceholder();
|
|
248
268
|
this.registerResize();
|
|
269
|
+
if (heightAuto) {
|
|
270
|
+
this._disposables.push(editor.onDidContentSizeChange(() => this.updateHeight()));
|
|
271
|
+
this.updateHeight();
|
|
272
|
+
}
|
|
249
273
|
const eventName = initEvent ? 'init' : 're-init';
|
|
250
274
|
if (this.autoFormat()) {
|
|
251
275
|
timer(this._config.autoFormatTime)
|
|
@@ -257,6 +281,21 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
257
281
|
}
|
|
258
282
|
this.notifyEvent(eventName);
|
|
259
283
|
}
|
|
284
|
+
updateHeight() {
|
|
285
|
+
const editor = this.editor;
|
|
286
|
+
if (editor == null)
|
|
287
|
+
return;
|
|
288
|
+
const isFiniteNumber = (value) => value != null && Number.isFinite(value);
|
|
289
|
+
const contentHeight = editor.getContentHeight();
|
|
290
|
+
const minHeightLimit = this.minHeight();
|
|
291
|
+
const maxHeightInput = this.maxHeight();
|
|
292
|
+
const maxHeightLimit = isFiniteNumber(maxHeightInput) ? maxHeightInput : 1000;
|
|
293
|
+
let targetHeight = Math.min(contentHeight, maxHeightLimit);
|
|
294
|
+
if (isFiniteNumber(minHeightLimit)) {
|
|
295
|
+
targetHeight = Math.max(targetHeight, minHeightLimit);
|
|
296
|
+
}
|
|
297
|
+
editor.layout({ width: editor.getLayoutInfo().width, height: targetHeight });
|
|
298
|
+
}
|
|
260
299
|
format() {
|
|
261
300
|
const action = this.editor?.getAction('editor.action.formatDocument');
|
|
262
301
|
if (action == null)
|
|
@@ -280,7 +319,7 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
280
319
|
this.setDisabled(v);
|
|
281
320
|
}
|
|
282
321
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NuMonacoEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
283
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.0", type: NuMonacoEditorComponent, isStandalone: true, selector: "nu-monaco-editor", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, autoFormat: { classPropertyName: "autoFormat", publicName: "autoFormat", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.display": "'block'", "style.height": "height()" } }, providers: [
|
|
322
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.0", type: NuMonacoEditorComponent, isStandalone: true, selector: "nu-monaco-editor", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, autoFormat: { classPropertyName: "autoFormat", publicName: "autoFormat", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.display": "'block'", "style.height": "height()" } }, providers: [
|
|
284
323
|
{
|
|
285
324
|
provide: NG_VALUE_ACCESSOR,
|
|
286
325
|
useExisting: forwardRef((() => NuMonacoEditorComponent)),
|
|
@@ -307,7 +346,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
|
|
|
307
346
|
],
|
|
308
347
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
309
348
|
}]
|
|
310
|
-
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }], autoFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFormat", required: false }] }] } });
|
|
349
|
+
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }], autoFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFormat", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }] } });
|
|
311
350
|
|
|
312
351
|
class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
313
352
|
old = input(...(ngDevMode ? [undefined, { debugName: "old" }] : []));
|
|
@@ -332,8 +371,7 @@ class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
|
332
371
|
original: monaco.editor.createModel(oldModel.code, oldModel.language || options.language),
|
|
333
372
|
modified: monaco.editor.createModel(newModel.code, newModel.language || options.language)
|
|
334
373
|
});
|
|
335
|
-
|
|
336
|
-
editor.onDidUpdateDiff(() => this.notifyEvent('update-diff', { diffValue: editor.getModifiedEditor().getValue() }));
|
|
374
|
+
this._disposables.push(editor.onDidUpdateDiff(() => this.notifyEvent('update-diff', { diffValue: editor.getModifiedEditor().getValue() })));
|
|
337
375
|
this.registerResize();
|
|
338
376
|
if (initEvent)
|
|
339
377
|
this.notifyEvent('init');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-util-monaco-editor.mjs","sources":["../../../../packages/monaco-editor/monaco-editor.types.ts","../../../../packages/monaco-editor/monaco-editor.config.ts","../../../../packages/monaco-editor/monaco-editor-base.component.ts","../../../../packages/monaco-editor/placholder.ts","../../../../packages/monaco-editor/monaco-editor.component.ts","../../../../packages/monaco-editor/monaco-editor-diff.component.ts","../../../../packages/monaco-editor/ng-util-monaco-editor.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// <reference path=\"./monaco.d.ts\" preserve=\"true\" />\n\nexport interface NuMonacoEditorModel {\n value?: string;\n language?: string;\n uri?: monaco.Uri;\n}\n\nexport interface NuMonacoEditorDiffModel {\n code: string;\n language?: string;\n}\n\nexport type NuMonacoEditorEventType = 'load-error' | 'init' | 're-init' | 'resize' | 'update-diff' | 'error';\n\nexport interface NuMonacoEditorEvent {\n type?: NuMonacoEditorEventType;\n editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;\n error?: string;\n /** Just only `nu-monaco-editor-diff` component */\n diffValue?: string;\n}\n","import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\n\nexport const NU_MONACO_EDITOR_CONFIG = new InjectionToken<NuMonacoEditorConfig>('NU_MONACO_EDITOR_CONFIG');\n\nexport function provideNuMonacoEditorConfig(config?: NuMonacoEditorConfig): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: NU_MONACO_EDITOR_CONFIG, useValue: config }]);\n}\n\nexport interface NuMonacoEditorConfig {\n /**\n * The base URL to monaco editor library assets via AMD (RequireJS), Default: `https://cdn.jsdelivr.net/npm/monaco-editor/min`\n * You can using local path, e.g.: `assets/monaco-editor/min`.\n */\n baseUrl?: string;\n /**\n * Default options when creating editors\n */\n defaultOptions?: monaco.editor.IStandaloneEditorConstructionOptions;\n /**\n * The event after the first loading of the monaco editor library is completed, use this function to extend monaco editor functionalities.\n * - @param `_monaco` equar to `window.monaco`\n */\n monacoLoad?: (_monaco: any) => void;\n /**\n * The event before the first preload of the monaco editor library is completed, use this function to set nls availableLanguages.\n */\n monacoPreLoad?: () => void;\n /**\n * Trigger automatic format delay time, default: `100`\n */\n autoFormatTime?: number;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n AfterViewInit,\n booleanAttribute,\n Component,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n numberAttribute,\n OnDestroy,\n output\n} from '@angular/core';\nimport { fromEvent, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\n\nimport { NuMonacoEditorConfig, NU_MONACO_EDITOR_CONFIG } from './monaco-editor.config';\nimport { NuMonacoEditorEvent, NuMonacoEditorEventType } from './monaco-editor.types';\n\nlet loadedMonaco = false;\nlet loadPromise: Promise<void>;\n\n@Component({\n selector: 'nu-monaco-base',\n template: ``\n})\nexport abstract class NuMonacoEditorBase implements AfterViewInit, OnDestroy {\n protected el = inject<ElementRef<HTMLElement>>(ElementRef);\n protected config = inject(NU_MONACO_EDITOR_CONFIG, { optional: true });\n protected doc = inject(DOCUMENT);\n protected destroy$ = inject(DestroyRef);\n\n protected _editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;\n protected _resize$: Subscription | null = null;\n protected _config: NuMonacoEditorConfig;\n protected _disabled?: boolean;\n\n height = input(`200px`);\n delay = input(0, { transform: numberAttribute });\n disabled = input(false, { transform: booleanAttribute });\n options = input<monaco.editor.IStandaloneEditorConstructionOptions>();\n readonly event = output<NuMonacoEditorEvent>();\n\n constructor() {\n this._config = { baseUrl: 'https://cdn.jsdelivr.net/npm/monaco-editor/min', autoFormatTime: 100, ...this.config };\n\n effect(() => {\n this.setDisabled(this.disabled());\n });\n\n effect(() => {\n const options = this.options();\n this.updateOptions(options);\n });\n }\n\n protected abstract initMonaco(\n _options: monaco.editor.IStandaloneEditorConstructionOptions | undefined,\n _initEvent: boolean\n ): void;\n\n protected notifyEvent(type: NuMonacoEditorEventType, other?: NuMonacoEditorEvent): void {\n this.event.emit({ type, editor: this._editor!, ...other });\n }\n\n protected setDisabled(v: boolean): this {\n (this._editor as monaco.editor.IStandaloneCodeEditor)?.updateOptions({ readOnly: v });\n return this;\n }\n\n private init(): void {\n if (loadedMonaco) {\n loadPromise.then(() => this.initMonaco(this.options(), true));\n return;\n }\n\n loadedMonaco = true;\n loadPromise = new Promise<void>((resolve: () => void, reject: (err: string) => void) => {\n const win: any = window;\n if (win == null) {\n resolve();\n return;\n }\n\n if (win.monaco) {\n resolve();\n return;\n }\n\n let baseUrl = `${this._config.baseUrl}/vs`;\n // fix: https://github.com/microsoft/monaco-editor/issues/4778\n if (!/^https?:\\/\\//g.test(baseUrl)) {\n baseUrl = `${window.location.origin}/${baseUrl.startsWith('/') ? baseUrl.substring(1) : baseUrl}`;\n }\n const amdLoader = () => {\n win.require.config({\n paths: {\n vs: baseUrl\n }\n });\n if (typeof this._config.monacoPreLoad === 'function') {\n this._config.monacoPreLoad();\n }\n win.require(\n ['vs/editor/editor.main'],\n () => {\n if (typeof this._config.monacoLoad === 'function') {\n this._config.monacoLoad(win.monaco);\n }\n this.initMonaco(this.options(), true);\n resolve();\n },\n () => {\n reject(`Unable to load editor/editor.main module, please check your network environment.`);\n }\n );\n };\n\n if (!win.require) {\n const loaderScript = this.doc.createElement('script') as HTMLScriptElement;\n loaderScript.type = 'text/javascript';\n loaderScript.src = `${baseUrl}/loader.js`;\n loaderScript.onload = amdLoader;\n loaderScript.onerror = () =>\n reject(`Unable to load ${loaderScript.src}, please check your network environment.`);\n this.doc.getElementsByTagName('head')[0].appendChild(loaderScript);\n } else {\n amdLoader();\n }\n }).catch(error => this.notifyEvent('load-error', { error }));\n }\n\n protected cleanResize(): this {\n this._resize$?.unsubscribe();\n return this;\n }\n\n protected registerResize(): this {\n this.cleanResize();\n this._resize$ = fromEvent(window, 'resize')\n .pipe(debounceTime(100))\n .subscribe(() => {\n this._editor!.layout();\n this.notifyEvent('resize');\n });\n return this;\n }\n\n updateOptions(v: monaco.editor.IStandaloneEditorConstructionOptions | undefined): void {\n if (!this._editor) return;\n this._editor!.dispose();\n this.initMonaco(v, false);\n }\n\n ngAfterViewInit(): void {\n setTimeout(() => this.init(), +this.delay());\n }\n\n ngOnDestroy(): void {\n this.cleanResize();\n this._editor?.dispose();\n }\n}\n","export class PlaceholderWidget implements monaco.editor.IContentWidget {\n private readonly ID = 'editor.widget.placeholderHint';\n private placeholder?: string;\n private editor: monaco.editor.IStandaloneCodeEditor;\n private node?: HTMLElement;\n\n constructor(editor: monaco.editor.IStandaloneCodeEditor, placeholder?: string) {\n this.placeholder = placeholder;\n this.editor = editor;\n }\n\n update(text?: string | null | undefined) {\n if (this.node == null) return;\n\n this.node.innerHTML = text ?? this.placeholder ?? '';\n }\n\n getId(): string {\n return this.ID;\n }\n getDomNode(): HTMLElement {\n if (this.node == null) {\n const node = (this.node = document.createElement('div'));\n node.classList.add('monaco-editor-placeholder');\n node.style.width = 'max-content';\n node.style.color = 'gray';\n node.innerHTML = this.placeholder!;\n node.style.fontStyle = 'italic';\n this.editor.applyFontInfo(node);\n }\n return this.node;\n }\n getPosition(): monaco.editor.IContentWidgetPosition | null {\n return {\n position: { lineNumber: 1, column: 1 },\n preference: [monaco.editor.ContentWidgetPositionPreference.EXACT]\n };\n }\n\n dispose() {\n this.editor.removeContentWidget(this);\n }\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n effect,\n forwardRef,\n input,\n untracked\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { take, timer } from 'rxjs';\n\nimport { NuMonacoEditorBase } from './monaco-editor-base.component';\nimport { NuMonacoEditorModel } from './monaco-editor.types';\nimport { PlaceholderWidget } from './placholder';\n\n@Component({\n selector: 'nu-monaco-editor',\n template: ``,\n exportAs: 'nuMonacoEditor',\n host: {\n '[style.display]': `'block'`,\n '[style.height]': 'height()'\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NuMonacoEditorComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NuMonacoEditorComponent extends NuMonacoEditorBase implements ControlValueAccessor {\n private _value = '';\n private _placeholderWidget?: PlaceholderWidget;\n placeholder = input<string>();\n model = input<NuMonacoEditorModel | null>();\n autoFormat = input(true, { transform: booleanAttribute });\n\n get editor(): monaco.editor.IStandaloneCodeEditor | null | undefined {\n return this._editor as monaco.editor.IStandaloneCodeEditor;\n }\n\n constructor() {\n super();\n effect(() => {\n const ph = this.placeholder();\n this._placeholderWidget?.update(ph);\n });\n effect(() => {\n const model = this.model();\n if (model == null) return;\n this.updateOptions(untracked(() => this.options()));\n });\n }\n\n private togglePlaceholder() {\n const text = this.placeholder();\n if (text == null || text.length <= 0 || this.editor == null) return;\n\n if (this._placeholderWidget == null) {\n this._placeholderWidget = new PlaceholderWidget(this.editor, text);\n }\n\n if (this._value.length > 0) {\n this.editor.removeContentWidget(this._placeholderWidget);\n } else {\n this.editor.addContentWidget(this._placeholderWidget);\n }\n }\n\n private onChange = (_: string) => {};\n private onTouched = () => {};\n\n initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void {\n const hasModel = !!this.model();\n options = { ...this.config?.defaultOptions, ...options };\n\n if (hasModel) {\n const model = monaco.editor.getModel(this.model()!.uri! || '');\n if (model) {\n options.model = model;\n options.model.setValue(this._value);\n } else {\n const { value, language, uri } = this.model()!;\n options.model = monaco.editor.createModel(value || this._value, language, uri);\n }\n this._value = options.model.getValue();\n }\n\n if (this._disabled != null) options.readOnly = this._disabled;\n const editor = (this._editor = monaco.editor.create(this.el.nativeElement, options));\n\n if (!hasModel) {\n editor.setValue(this._value);\n }\n\n editor.onDidChangeModelContent(() => {\n const value = editor.getValue();\n this._value = value;\n\n this.onChange(value);\n\n this.togglePlaceholder();\n });\n editor.onDidBlurEditorWidget(() => this.onTouched());\n\n this.togglePlaceholder();\n this.registerResize();\n\n const eventName = initEvent ? 'init' : 're-init';\n if (this.autoFormat()) {\n timer(this._config.autoFormatTime!)\n .pipe(takeUntilDestroyed(this.destroy$), take(1))\n .subscribe(() => {\n this.format()?.then(() => this.notifyEvent(eventName));\n });\n return;\n }\n this.notifyEvent(eventName);\n }\n\n format(): Promise<void> | undefined {\n const action = this.editor?.getAction('editor.action.formatDocument');\n if (action == null) return;\n return action.run();\n }\n\n writeValue(value: string): void {\n this._value = value || '';\n (this._editor as monaco.editor.IStandaloneCodeEditor)?.setValue(this._value);\n if (this.autoFormat()) {\n this.format();\n }\n }\n\n registerOnChange(fn: (_: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState(v: boolean): void {\n this.setDisabled(v);\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport { NuMonacoEditorBase } from './monaco-editor-base.component';\nimport { NuMonacoEditorDiffModel } from './monaco-editor.types';\n\n@Component({\n selector: 'nu-monaco-diff-editor',\n template: ``,\n exportAs: 'nuMonacoDiffEditor',\n host: {\n '[style.display]': `'block'`,\n '[style.height]': 'height()'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {\n old = input<NuMonacoEditorDiffModel>();\n new = input<NuMonacoEditorDiffModel>();\n\n get editor(): monaco.editor.IStandaloneDiffEditor | null | undefined {\n return this._editor as monaco.editor.IStandaloneDiffEditor;\n }\n\n initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void {\n const oldModel = this.old();\n const newModel = this.new();\n if (!oldModel || !newModel) {\n this.notifyEvent('error', { error: 'old or new not found for nu-monaco-diff-editor' });\n return;\n }\n\n options = { ...this.config?.defaultOptions, ...options };\n const theme = options.theme;\n if (this._disabled != null) options.readOnly = this._disabled;\n const editor = (this._editor = monaco.editor.createDiffEditor(this.el.nativeElement, options));\n options.theme = theme;\n editor.setModel({\n original: monaco.editor.createModel(oldModel.code, oldModel.language || options.language),\n modified: monaco.editor.createModel(newModel.code, newModel.language || options.language)\n });\n\n // this.setDisabled();\n editor.onDidUpdateDiff(() => this.notifyEvent('update-diff', { diffValue: editor.getModifiedEditor().getValue() }));\n\n this.registerResize();\n if (initEvent) this.notifyEvent('init');\n }\n}\n","/**\n * Generated bund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,CAAA;kBAVvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,CAAA,CAAE;AACZ,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,IAAI,EAAE;AACJ,wBAAA,iBAAiB,EAAE,CAAA,OAAA,CAAS;AAC5B,wBAAA,gBAAgB,EAAE;AACnB,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC;AAC1C,iBAAA;;;ACdD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-util-monaco-editor.mjs","sources":["../../../../packages/monaco-editor/monaco-editor.types.ts","../../../../packages/monaco-editor/monaco-editor.config.ts","../../../../packages/monaco-editor/monaco-editor-base.component.ts","../../../../packages/monaco-editor/placeholder.ts","../../../../packages/monaco-editor/monaco-editor.component.ts","../../../../packages/monaco-editor/monaco-editor-diff.component.ts","../../../../packages/monaco-editor/ng-util-monaco-editor.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// <reference path=\"./monaco.d.ts\" preserve=\"true\" />\n\nexport interface NuMonacoEditorModel {\n value?: string;\n language?: string;\n uri?: monaco.Uri;\n}\n\nexport interface NuMonacoEditorDiffModel {\n code: string;\n language?: string;\n}\n\nexport type NuMonacoEditorEventType = 'load-error' | 'init' | 're-init' | 'resize' | 'update-diff' | 'error';\n\nexport interface NuMonacoEditorEvent {\n type?: NuMonacoEditorEventType;\n editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;\n error?: string;\n /** Just only `nu-monaco-editor-diff` component */\n diffValue?: string;\n}\n","import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\n\nexport const NU_MONACO_EDITOR_CONFIG = new InjectionToken<NuMonacoEditorConfig>('NU_MONACO_EDITOR_CONFIG');\n\nexport function provideNuMonacoEditorConfig(config?: NuMonacoEditorConfig): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: NU_MONACO_EDITOR_CONFIG, useValue: config }]);\n}\n\nexport interface NuMonacoEditorConfig {\n /**\n * The base URL to monaco editor library assets via AMD (RequireJS), Default: `https://cdn.jsdelivr.net/npm/monaco-editor/min`\n * You can using local path, e.g.: `assets/monaco-editor/min`.\n */\n baseUrl?: string;\n /**\n * Default options when creating editors\n */\n defaultOptions?: monaco.editor.IStandaloneEditorConstructionOptions;\n /**\n * The event after the first loading of the monaco editor library is completed, use this function to extend monaco editor functionalities.\n * - @param `_monaco` equar to `window.monaco`\n */\n monacoLoad?: (_monaco: any) => void;\n /**\n * The event before the first preload of the monaco editor library is completed, use this function to set nls availableLanguages.\n */\n monacoPreLoad?: () => void;\n /**\n * Trigger automatic format delay time, default: `100`\n */\n autoFormatTime?: number;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n booleanAttribute,\n Component,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n numberAttribute,\n OnDestroy,\n output\n} from '@angular/core';\nimport { fromEvent, Subscription, timer } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\n\nimport { NuMonacoEditorConfig, NU_MONACO_EDITOR_CONFIG } from './monaco-editor.config';\nimport { NuMonacoEditorEvent, NuMonacoEditorEventType } from './monaco-editor.types';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nlet monacoLoadPromise: Promise<void> | null = null;\n\n@Component({\n selector: 'nu-monaco-base',\n template: ``\n})\nexport abstract class NuMonacoEditorBase implements OnDestroy {\n protected el = inject<ElementRef<HTMLElement>>(ElementRef);\n protected config = inject(NU_MONACO_EDITOR_CONFIG, { optional: true });\n protected doc = inject(DOCUMENT);\n protected destroy$ = inject(DestroyRef);\n\n protected _editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;\n protected _resize$: Subscription | null = null;\n protected _config: NuMonacoEditorConfig;\n protected _disabled?: boolean;\n protected readonly _disposables: monaco.IDisposable[] = [];\n\n readonly height = input(`200px`);\n readonly delay = input(0, { transform: numberAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly options = input<monaco.editor.IStandaloneEditorConstructionOptions>();\n readonly event = output<NuMonacoEditorEvent>();\n\n constructor() {\n this._config = { baseUrl: 'https://cdn.jsdelivr.net/npm/monaco-editor/min', autoFormatTime: 100, ...this.config };\n\n effect(() => {\n this.setDisabled(this.disabled());\n });\n\n effect(() => {\n const options = this.options();\n this.height();\n this.updateOptions(options);\n });\n\n afterNextRender(() => {\n timer(this.delay())\n .pipe(takeUntilDestroyed(this.destroy$))\n .subscribe(() => this.init());\n });\n }\n\n protected abstract initMonaco(\n _options: monaco.editor.IStandaloneEditorConstructionOptions | undefined,\n _initEvent: boolean\n ): void;\n\n protected notifyEvent(type: NuMonacoEditorEventType, other?: NuMonacoEditorEvent): void {\n this.event.emit({ type, editor: this._editor!, ...other });\n }\n\n protected setDisabled(v: boolean): this {\n (this._editor as monaco.editor.IStandaloneCodeEditor)?.updateOptions({ readOnly: v });\n return this;\n }\n\n private init(): void {\n if (typeof window === 'undefined') return;\n\n if (!monacoLoadPromise) {\n monacoLoadPromise = new Promise<void>((resolve: () => void, reject: (err: string) => void) => {\n const windowRef = window as any;\n if (windowRef.monaco) {\n resolve();\n return;\n }\n\n let baseUrl = `${this._config.baseUrl}/vs`;\n // fix: https://github.com/microsoft/monaco-editor/issues/4778\n if (!/^https?:\\/\\//.test(baseUrl)) {\n baseUrl = `${window.location.origin}/${baseUrl.startsWith('/') ? baseUrl.substring(1) : baseUrl}`;\n }\n const amdLoader = () => {\n windowRef.require.config({\n paths: {\n vs: baseUrl\n }\n });\n if (typeof this._config.monacoPreLoad === 'function') {\n this._config.monacoPreLoad();\n }\n windowRef.require(\n ['vs/editor/editor.main'],\n () => {\n if (typeof this._config.monacoLoad === 'function') {\n this._config.monacoLoad(windowRef.monaco);\n }\n resolve();\n },\n () => {\n reject(`Unable to load editor/editor.main module, please check your network environment.`);\n }\n );\n };\n\n if (!windowRef.require) {\n const loaderScript = this.doc.createElement('script') as HTMLScriptElement;\n loaderScript.type = 'text/javascript';\n loaderScript.src = `${baseUrl}/loader.js`;\n loaderScript.onload = amdLoader;\n loaderScript.onerror = () => {\n reject(`Unable to load ${loaderScript.src}, please check your network environment.`);\n };\n this.doc.getElementsByTagName('head')[0].appendChild(loaderScript);\n } else {\n amdLoader();\n }\n }).catch(error => {\n monacoLoadPromise = null;\n throw error;\n });\n }\n\n monacoLoadPromise\n .then(() => this.initMonaco(this.options(), true))\n .catch(error => this.notifyEvent('load-error', { error }));\n }\n\n protected cleanResize(): this {\n this._resize$?.unsubscribe();\n return this;\n }\n\n protected registerResize(): this {\n this.cleanResize();\n this._resize$ = fromEvent(window, 'resize')\n .pipe(debounceTime(100))\n .subscribe(() => {\n this._editor?.layout();\n this.notifyEvent('resize');\n });\n return this;\n }\n\n protected disposeEditor(): this {\n this._disposables.forEach(d => d.dispose());\n this._disposables.length = 0;\n this._editor?.dispose();\n this._editor = undefined;\n return this;\n }\n\n updateOptions(v: monaco.editor.IStandaloneEditorConstructionOptions | undefined): void {\n if (!this._editor) return;\n\n this.disposeEditor();\n this.initMonaco(v, false);\n }\n\n ngOnDestroy(): void {\n this.cleanResize();\n this.disposeEditor();\n }\n}\n","export class PlaceholderWidget implements monaco.editor.IContentWidget {\n private readonly ID = 'editor.widget.placeholderHint';\n private placeholder?: string;\n private editor: monaco.editor.IStandaloneCodeEditor;\n private node?: HTMLElement;\n\n constructor(editor: monaco.editor.IStandaloneCodeEditor, placeholder?: string) {\n this.placeholder = placeholder;\n this.editor = editor;\n }\n\n update(text?: string | null | undefined) {\n if (this.node == null) return;\n\n this.node.innerHTML = text ?? this.placeholder ?? '';\n }\n\n getId(): string {\n return this.ID;\n }\n getDomNode(): HTMLElement {\n if (this.node == null) {\n const node = (this.node = document.createElement('div'));\n node.classList.add('monaco-editor-placeholder');\n node.style.width = 'max-content';\n node.style.color = 'gray';\n node.innerHTML = this.placeholder!;\n node.style.fontStyle = 'italic';\n this.editor.applyFontInfo(node);\n }\n return this.node;\n }\n getPosition(): monaco.editor.IContentWidgetPosition | null {\n return {\n position: { lineNumber: 1, column: 1 },\n preference: [monaco.editor.ContentWidgetPositionPreference.EXACT]\n };\n }\n\n dispose() {\n this.editor.removeContentWidget(this);\n }\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n effect,\n forwardRef,\n input,\n numberAttribute,\n untracked\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { take, timer } from 'rxjs';\n\nimport { NuMonacoEditorBase } from './monaco-editor-base.component';\nimport { NuMonacoEditorModel } from './monaco-editor.types';\nimport { PlaceholderWidget } from './placeholder';\n\n@Component({\n selector: 'nu-monaco-editor',\n template: ``,\n exportAs: 'nuMonacoEditor',\n host: {\n '[style.display]': `'block'`,\n '[style.height]': 'height()'\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NuMonacoEditorComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NuMonacoEditorComponent extends NuMonacoEditorBase implements ControlValueAccessor {\n private _value = '';\n private _placeholderWidget?: PlaceholderWidget;\n readonly placeholder = input<string>();\n readonly model = input<NuMonacoEditorModel | null>();\n readonly autoFormat = input(true, { transform: booleanAttribute });\n readonly maxHeight = input(undefined, { transform: numberAttribute });\n readonly minHeight = input(undefined, { transform: numberAttribute });\n\n get editor(): monaco.editor.IStandaloneCodeEditor | null | undefined {\n return this._editor as monaco.editor.IStandaloneCodeEditor;\n }\n\n constructor() {\n super();\n effect(() => {\n const ph = this.placeholder();\n this._placeholderWidget?.update(ph);\n });\n effect(() => {\n const model = this.model();\n if (model == null) return;\n this.updateOptions(untracked(() => this.options()));\n });\n }\n\n private togglePlaceholder() {\n const text = this.placeholder();\n if (typeof text !== 'string' || text.length <= 0 || this.editor == null) return;\n\n let widget = this._placeholderWidget;\n if (widget == null) {\n this._placeholderWidget = widget = new PlaceholderWidget(this.editor, text);\n }\n\n if (this._value.length > 0) {\n this.editor.removeContentWidget(widget);\n } else {\n this.editor.addContentWidget(widget);\n }\n }\n\n private onChange = (_: string) => {};\n private onTouched = () => {};\n\n initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void {\n const hasModel = !!this.model();\n options = { ...this.config?.defaultOptions, ...options };\n const heightAuto = this.height() === 'auto';\n if (heightAuto) {\n options.scrollBeyondLastLine = false;\n options.overviewRulerLanes = 0;\n }\n\n if (hasModel) {\n const model = monaco.editor.getModel(this.model()!.uri! || '');\n if (model) {\n options.model = model;\n options.model.setValue(this._value);\n } else {\n const { value, language, uri } = this.model()!;\n options.model = monaco.editor.createModel(value || this._value, language, uri);\n }\n this._value = options.model.getValue();\n }\n\n if (this._disabled != null) options.readOnly = this._disabled;\n const editor = (this._editor = monaco.editor.create(this.el.nativeElement, options));\n\n if (!hasModel) {\n editor.setValue(this._value);\n }\n\n this._disposables.push(\n editor.onDidChangeModelContent(() => {\n const value = editor.getValue();\n this._value = value;\n\n this.onChange(value);\n\n this.togglePlaceholder();\n })\n );\n this._disposables.push(editor.onDidBlurEditorWidget(() => this.onTouched()));\n\n this.togglePlaceholder();\n this.registerResize();\n if (heightAuto) {\n this._disposables.push(editor.onDidContentSizeChange(() => this.updateHeight()));\n this.updateHeight();\n }\n\n const eventName = initEvent ? 'init' : 're-init';\n if (this.autoFormat()) {\n timer(this._config.autoFormatTime!)\n .pipe(takeUntilDestroyed(this.destroy$), take(1))\n .subscribe(() => {\n this.format()?.then(() => this.notifyEvent(eventName));\n });\n return;\n }\n this.notifyEvent(eventName);\n }\n\n private updateHeight() {\n const editor = this.editor;\n if (editor == null) return;\n\n const isFiniteNumber = (value?: number): value is number => value != null && Number.isFinite(value);\n const contentHeight = editor.getContentHeight();\n const minHeightLimit = this.minHeight();\n const maxHeightInput = this.maxHeight();\n const maxHeightLimit = isFiniteNumber(maxHeightInput) ? maxHeightInput : 1000;\n\n let targetHeight = Math.min(contentHeight, maxHeightLimit);\n if (isFiniteNumber(minHeightLimit)) {\n targetHeight = Math.max(targetHeight, minHeightLimit);\n }\n\n editor.layout({ width: editor.getLayoutInfo().width, height: targetHeight });\n }\n\n format(): Promise<void> | undefined {\n const action = this.editor?.getAction('editor.action.formatDocument');\n if (action == null) return;\n return action.run();\n }\n\n writeValue(value: string): void {\n this._value = value || '';\n (this._editor as monaco.editor.IStandaloneCodeEditor)?.setValue(this._value);\n if (this.autoFormat()) {\n this.format();\n }\n }\n\n registerOnChange(fn: (_: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(v: boolean): void {\n this.setDisabled(v);\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport { NuMonacoEditorBase } from './monaco-editor-base.component';\nimport { NuMonacoEditorDiffModel } from './monaco-editor.types';\n\n@Component({\n selector: 'nu-monaco-diff-editor',\n template: ``,\n exportAs: 'nuMonacoDiffEditor',\n host: {\n '[style.display]': `'block'`,\n '[style.height]': 'height()'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {\n readonly old = input<NuMonacoEditorDiffModel>();\n readonly new = input<NuMonacoEditorDiffModel>();\n\n get editor(): monaco.editor.IStandaloneDiffEditor | null | undefined {\n return this._editor as monaco.editor.IStandaloneDiffEditor;\n }\n\n initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void {\n const oldModel = this.old();\n const newModel = this.new();\n if (!oldModel || !newModel) {\n this.notifyEvent('error', { error: 'old or new not found for nu-monaco-diff-editor' });\n return;\n }\n\n options = { ...this.config?.defaultOptions, ...options };\n const theme = options.theme;\n if (this._disabled != null) options.readOnly = this._disabled;\n const editor = (this._editor = monaco.editor.createDiffEditor(this.el.nativeElement, options));\n options.theme = theme;\n editor.setModel({\n original: monaco.editor.createModel(oldModel.code, oldModel.language || options.language),\n modified: monaco.editor.createModel(newModel.code, newModel.language || options.language)\n });\n\n this._disposables.push(\n editor.onDidUpdateDiff(() =>\n this.notifyEvent('update-diff', { diffValue: editor.getModifiedEditor().getValue() })\n )\n );\n\n this.registerResize();\n if (initEvent) this.notifyEvent('init');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;;MCCa,uBAAuB,GAAG,IAAI,cAAc,CAAuB,yBAAyB;AAEnG,SAAU,2BAA2B,CAAC,MAA6B,EAAA;AACvE,IAAA,OAAO,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;AAC3F;;ACeA,IAAI,iBAAiB,GAAyB,IAAI;MAM5B,kBAAkB,CAAA;AAC5B,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;IAChD,MAAM,GAAG,MAAM,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5D,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AACtB,IAAA,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;AAE7B,IAAA,OAAO;IACP,QAAQ,GAAwB,IAAI;AACpC,IAAA,OAAO;AACP,IAAA,SAAS;IACA,YAAY,GAAyB,EAAE;AAEjD,IAAA,MAAM,GAAG,KAAK,CAAC,CAAA,KAAA,CAAO,kDAAC;AACvB,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,yCAAI,SAAS,EAAE,eAAe,EAAA,CAAA,GAAA,CAA5B,EAAE,SAAS,EAAE,eAAe,EAAE,GAAC;AAChD,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,4CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,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A;;2FAQD,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAVvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,CAAA,CAAE;AACZ,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,IAAI,EAAE;AACJ,wBAAA,iBAAiB,EAAE,CAAA,OAAA,CAAS;AAC5B,wBAAA,gBAAgB,EAAE;AACnB,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC;AAC1C,iBAAA;;;ACdD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-util/monaco-editor",
|
|
3
|
-
"version": "21.0
|
|
3
|
+
"version": "21.2.0",
|
|
4
4
|
"author": "cipchk<cipchk@qq.com>",
|
|
5
5
|
"description": "Monaco Code Editor for Angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"default": "./fesm2022/ng-util-monaco-editor.mjs"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
+
"type": "module",
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"tslib": "^2.3.0"
|
|
37
38
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="../monaco.d.ts" />
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
|
-
import { InjectionToken, EnvironmentProviders,
|
|
3
|
+
import { InjectionToken, EnvironmentProviders, OnDestroy, ElementRef, DestroyRef } from '@angular/core';
|
|
4
4
|
import { ControlValueAccessor } from '@angular/forms';
|
|
5
5
|
import { Subscription } from 'rxjs';
|
|
6
6
|
|
|
@@ -49,7 +49,7 @@ interface NuMonacoEditorConfig {
|
|
|
49
49
|
autoFormatTime?: number;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
declare abstract class NuMonacoEditorBase implements
|
|
52
|
+
declare abstract class NuMonacoEditorBase implements OnDestroy {
|
|
53
53
|
protected el: ElementRef<HTMLElement>;
|
|
54
54
|
protected config: NuMonacoEditorConfig | null;
|
|
55
55
|
protected doc: Document;
|
|
@@ -58,10 +58,11 @@ declare abstract class NuMonacoEditorBase implements AfterViewInit, OnDestroy {
|
|
|
58
58
|
protected _resize$: Subscription | null;
|
|
59
59
|
protected _config: NuMonacoEditorConfig;
|
|
60
60
|
protected _disabled?: boolean;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
protected readonly _disposables: monaco.IDisposable[];
|
|
62
|
+
readonly height: _angular_core.InputSignal<string>;
|
|
63
|
+
readonly delay: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
64
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
65
|
+
readonly options: _angular_core.InputSignal<monaco.editor.IStandaloneEditorConstructionOptions | undefined>;
|
|
65
66
|
readonly event: _angular_core.OutputEmitterRef<NuMonacoEditorEvent>;
|
|
66
67
|
constructor();
|
|
67
68
|
protected abstract initMonaco(_options: monaco.editor.IStandaloneEditorConstructionOptions | undefined, _initEvent: boolean): void;
|
|
@@ -70,8 +71,8 @@ declare abstract class NuMonacoEditorBase implements AfterViewInit, OnDestroy {
|
|
|
70
71
|
private init;
|
|
71
72
|
protected cleanResize(): this;
|
|
72
73
|
protected registerResize(): this;
|
|
74
|
+
protected disposeEditor(): this;
|
|
73
75
|
updateOptions(v: monaco.editor.IStandaloneEditorConstructionOptions | undefined): void;
|
|
74
|
-
ngAfterViewInit(): void;
|
|
75
76
|
ngOnDestroy(): void;
|
|
76
77
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NuMonacoEditorBase, never>;
|
|
77
78
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NuMonacoEditorBase, "nu-monaco-base", never, { "height": { "alias": "height"; "required": false; "isSignal": true; }; "delay": { "alias": "delay"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "event": "event"; }, never, never, true, never>;
|
|
@@ -80,27 +81,30 @@ declare abstract class NuMonacoEditorBase implements AfterViewInit, OnDestroy {
|
|
|
80
81
|
declare class NuMonacoEditorComponent extends NuMonacoEditorBase implements ControlValueAccessor {
|
|
81
82
|
private _value;
|
|
82
83
|
private _placeholderWidget?;
|
|
83
|
-
placeholder: _angular_core.InputSignal<string | undefined>;
|
|
84
|
-
model: _angular_core.InputSignal<NuMonacoEditorModel | null | undefined>;
|
|
85
|
-
autoFormat: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
84
|
+
readonly placeholder: _angular_core.InputSignal<string | undefined>;
|
|
85
|
+
readonly model: _angular_core.InputSignal<NuMonacoEditorModel | null | undefined>;
|
|
86
|
+
readonly autoFormat: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
87
|
+
readonly maxHeight: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
88
|
+
readonly minHeight: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
86
89
|
get editor(): monaco.editor.IStandaloneCodeEditor | null | undefined;
|
|
87
90
|
constructor();
|
|
88
91
|
private togglePlaceholder;
|
|
89
92
|
private onChange;
|
|
90
93
|
private onTouched;
|
|
91
94
|
initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void;
|
|
95
|
+
private updateHeight;
|
|
92
96
|
format(): Promise<void> | undefined;
|
|
93
97
|
writeValue(value: string): void;
|
|
94
98
|
registerOnChange(fn: (_: string) => void): void;
|
|
95
|
-
registerOnTouched(fn:
|
|
99
|
+
registerOnTouched(fn: () => void): void;
|
|
96
100
|
setDisabledState(v: boolean): void;
|
|
97
101
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NuMonacoEditorComponent, never>;
|
|
98
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NuMonacoEditorComponent, "nu-monaco-editor", ["nuMonacoEditor"], { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; "autoFormat": { "alias": "autoFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
102
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NuMonacoEditorComponent, "nu-monaco-editor", ["nuMonacoEditor"], { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; "autoFormat": { "alias": "autoFormat"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
declare class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
102
|
-
old: _angular_core.InputSignal<NuMonacoEditorDiffModel | undefined>;
|
|
103
|
-
new: _angular_core.InputSignal<NuMonacoEditorDiffModel | undefined>;
|
|
106
|
+
readonly old: _angular_core.InputSignal<NuMonacoEditorDiffModel | undefined>;
|
|
107
|
+
readonly new: _angular_core.InputSignal<NuMonacoEditorDiffModel | undefined>;
|
|
104
108
|
get editor(): monaco.editor.IStandaloneDiffEditor | null | undefined;
|
|
105
109
|
initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void;
|
|
106
110
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NuMonacoEditorDiffComponent, never>;
|