@ng-util/monaco-editor 12.1.2 → 14.0.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 +1 -0
- package/esm2020/monaco-editor-base.component.mjs +153 -0
- package/esm2020/monaco-editor-diff.component.mjs +48 -0
- package/esm2020/monaco-editor.component.mjs +103 -0
- package/{esm2015/monaco-editor.config.js → esm2020/monaco-editor.config.mjs} +0 -0
- package/esm2020/monaco-editor.module.mjs +26 -0
- package/{esm2015/monaco-editor.types.js → esm2020/monaco-editor.types.mjs} +0 -0
- package/esm2020/ng-util-monaco-editor.mjs +5 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/fesm2015/{ng-util-monaco-editor.js → ng-util-monaco-editor.mjs} +103 -87
- package/fesm2015/ng-util-monaco-editor.mjs.map +1 -0
- package/fesm2020/ng-util-monaco-editor.mjs +328 -0
- package/fesm2020/ng-util-monaco-editor.mjs.map +1 -0
- package/{ng-util-monaco-editor.d.ts → index.d.ts} +1 -1
- package/monaco-editor-base.component.d.ts +5 -2
- package/monaco-editor-diff.component.d.ts +5 -2
- package/monaco-editor.component.d.ts +5 -1
- package/monaco-editor.module.d.ts +7 -0
- package/monaco.d.ts +1603 -997
- package/package.json +23 -10
- package/bundles/ng-util-monaco-editor.umd.js +0 -676
- package/bundles/ng-util-monaco-editor.umd.js.map +0 -1
- package/esm2015/monaco-editor-base.component.js +0 -155
- package/esm2015/monaco-editor-diff.component.js +0 -45
- package/esm2015/monaco-editor.component.js +0 -88
- package/esm2015/monaco-editor.module.js +0 -24
- package/esm2015/ng-util-monaco-editor.js +0 -6
- package/fesm2015/ng-util-monaco-editor.js.map +0 -1
- package/ng-util-monaco-editor.metadata.json +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, EventEmitter, Component, Inject, Input, Output, forwardRef, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
2
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
4
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
4
5
|
import { fromEvent } from 'rxjs';
|
|
5
6
|
import { debounceTime } from 'rxjs/operators';
|
|
6
7
|
|
|
7
|
-
// tslint:disable-next-line: no-reference
|
|
8
|
-
|
|
9
8
|
const NU_MONACO_EDITOR_CONFIG = new InjectionToken('NU_MONACO_EDITOR_CONFIG');
|
|
10
9
|
|
|
11
10
|
let loadedMonaco = false;
|
|
@@ -33,7 +32,6 @@ class NuMonacoEditorBase {
|
|
|
33
32
|
get options() {
|
|
34
33
|
return this._options;
|
|
35
34
|
}
|
|
36
|
-
initMonaco(_options, _initEvent) { }
|
|
37
35
|
notifyEvent(type, other) {
|
|
38
36
|
this.ngZone.run(() => this.event.emit(Object.assign({ type, editor: this._editor }, other)));
|
|
39
37
|
}
|
|
@@ -129,39 +127,40 @@ class NuMonacoEditorBase {
|
|
|
129
127
|
}
|
|
130
128
|
}
|
|
131
129
|
}
|
|
132
|
-
/** @type {
|
|
133
|
-
NuMonacoEditorBase
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
]
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
};
|
|
130
|
+
/** @nocollapse */ NuMonacoEditorBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorBase, deps: [{ token: i0.ElementRef }, { token: NU_MONACO_EDITOR_CONFIG }, { token: DOCUMENT }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
131
|
+
/** @nocollapse */ NuMonacoEditorBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.3", type: NuMonacoEditorBase, isStandalone: true, selector: "nu-monaco-base", inputs: { height: "height", delay: "delay", disabled: "disabled", options: "options" }, outputs: { event: "event" }, usesOnChanges: true, ngImport: i0, template: ``, isInline: true });
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorBase, decorators: [{
|
|
133
|
+
type: Component,
|
|
134
|
+
args: [{
|
|
135
|
+
selector: 'nu-monaco-base',
|
|
136
|
+
template: ``,
|
|
137
|
+
standalone: true,
|
|
138
|
+
}]
|
|
139
|
+
}], ctorParameters: function () {
|
|
140
|
+
return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
141
|
+
type: Inject,
|
|
142
|
+
args: [NU_MONACO_EDITOR_CONFIG]
|
|
143
|
+
}] }, { type: undefined, decorators: [{
|
|
144
|
+
type: Inject,
|
|
145
|
+
args: [DOCUMENT]
|
|
146
|
+
}] }, { type: i0.NgZone }];
|
|
147
|
+
}, propDecorators: { height: [{
|
|
148
|
+
type: Input
|
|
149
|
+
}], delay: [{
|
|
150
|
+
type: Input
|
|
151
|
+
}], disabled: [{
|
|
152
|
+
type: Input
|
|
153
|
+
}], options: [{
|
|
154
|
+
type: Input
|
|
155
|
+
}], event: [{
|
|
156
|
+
type: Output
|
|
157
|
+
}] } });
|
|
160
158
|
|
|
161
159
|
class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
162
160
|
constructor() {
|
|
163
161
|
super(...arguments);
|
|
164
162
|
this._value = '';
|
|
163
|
+
this.autoFormat = true;
|
|
165
164
|
this.onChange = (_) => { };
|
|
166
165
|
this.onTouched = () => { };
|
|
167
166
|
}
|
|
@@ -196,10 +195,14 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
196
195
|
});
|
|
197
196
|
editor.onDidBlurEditorWidget(() => this.onTouched());
|
|
198
197
|
this.registerResize();
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
198
|
+
if (this.autoFormat) {
|
|
199
|
+
editor
|
|
200
|
+
.getAction('editor.action.formatDocument')
|
|
201
|
+
.run()
|
|
202
|
+
.then(() => this.notifyEvent(initEvent ? 'init' : 're-init'));
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.notifyEvent(initEvent ? 'init' : 're-init');
|
|
203
206
|
}
|
|
204
207
|
writeValue(value) {
|
|
205
208
|
this._value = value || '';
|
|
@@ -218,30 +221,39 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
218
221
|
this.setDisabled();
|
|
219
222
|
}
|
|
220
223
|
}
|
|
221
|
-
/** @
|
|
222
|
-
NuMonacoEditorComponent
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
224
|
+
/** @nocollapse */ NuMonacoEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
225
|
+
/** @nocollapse */ NuMonacoEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.3", type: NuMonacoEditorComponent, isStandalone: true, selector: "nu-monaco-editor", inputs: { model: "model", autoFormat: "autoFormat" }, host: { properties: { "style.display": "'block'", "style.height": "height" } }, providers: [
|
|
226
|
+
{
|
|
227
|
+
provide: NG_VALUE_ACCESSOR,
|
|
228
|
+
useExisting: forwardRef((() => NuMonacoEditorComponent)),
|
|
229
|
+
multi: true,
|
|
230
|
+
},
|
|
231
|
+
], exportAs: ["nuMonacoEditor"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorComponent, decorators: [{
|
|
233
|
+
type: Component,
|
|
234
|
+
args: [{
|
|
235
|
+
selector: 'nu-monaco-editor',
|
|
236
|
+
template: ``,
|
|
237
|
+
exportAs: 'nuMonacoEditor',
|
|
238
|
+
host: {
|
|
239
|
+
'[style.display]': `'block'`,
|
|
240
|
+
'[style.height]': 'height',
|
|
236
241
|
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
providers: [
|
|
243
|
+
{
|
|
244
|
+
provide: NG_VALUE_ACCESSOR,
|
|
245
|
+
useExisting: forwardRef((() => NuMonacoEditorComponent)),
|
|
246
|
+
multi: true,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
250
|
+
standalone: true,
|
|
251
|
+
}]
|
|
252
|
+
}], propDecorators: { model: [{
|
|
253
|
+
type: Input
|
|
254
|
+
}], autoFormat: [{
|
|
255
|
+
type: Input
|
|
256
|
+
}] } });
|
|
245
257
|
|
|
246
258
|
class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
247
259
|
get editor() {
|
|
@@ -267,24 +279,26 @@ class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
|
267
279
|
this.notifyEvent('init');
|
|
268
280
|
}
|
|
269
281
|
}
|
|
270
|
-
/** @
|
|
271
|
-
NuMonacoEditorDiffComponent
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
282
|
+
/** @nocollapse */ NuMonacoEditorDiffComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorDiffComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
283
|
+
/** @nocollapse */ NuMonacoEditorDiffComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.3", type: NuMonacoEditorDiffComponent, isStandalone: true, selector: "nu-monaco-diff-editor", inputs: { old: "old", new: "new" }, host: { properties: { "style.display": "'block'", "style.height": "height" } }, exportAs: ["nuMonacoDiffEditor"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorDiffComponent, decorators: [{
|
|
285
|
+
type: Component,
|
|
286
|
+
args: [{
|
|
287
|
+
selector: 'nu-monaco-diff-editor',
|
|
288
|
+
template: ``,
|
|
289
|
+
exportAs: 'nuMonacoDiffEditor',
|
|
290
|
+
host: {
|
|
291
|
+
'[style.display]': `'block'`,
|
|
292
|
+
'[style.height]': 'height',
|
|
293
|
+
},
|
|
294
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
295
|
+
standalone: true,
|
|
296
|
+
}]
|
|
297
|
+
}], propDecorators: { old: [{
|
|
298
|
+
type: Input
|
|
299
|
+
}], new: [{
|
|
300
|
+
type: Input
|
|
301
|
+
}] } });
|
|
288
302
|
|
|
289
303
|
const COMPONENTS = [NuMonacoEditorComponent, NuMonacoEditorDiffComponent];
|
|
290
304
|
class NuMonacoEditorModule {
|
|
@@ -295,18 +309,20 @@ class NuMonacoEditorModule {
|
|
|
295
309
|
};
|
|
296
310
|
}
|
|
297
311
|
}
|
|
298
|
-
/** @
|
|
299
|
-
NuMonacoEditorModule
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
312
|
+
/** @nocollapse */ NuMonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
313
|
+
/** @nocollapse */ NuMonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorModule, imports: [CommonModule, NuMonacoEditorComponent, NuMonacoEditorDiffComponent], exports: [NuMonacoEditorComponent, NuMonacoEditorDiffComponent] });
|
|
314
|
+
/** @nocollapse */ NuMonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorModule, imports: [CommonModule, COMPONENTS] });
|
|
315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorModule, decorators: [{
|
|
316
|
+
type: NgModule,
|
|
317
|
+
args: [{
|
|
318
|
+
imports: [CommonModule, ...COMPONENTS],
|
|
319
|
+
exports: COMPONENTS,
|
|
320
|
+
}]
|
|
321
|
+
}] });
|
|
306
322
|
|
|
307
323
|
/**
|
|
308
324
|
* Generated bundle index. Do not edit.
|
|
309
325
|
*/
|
|
310
326
|
|
|
311
|
-
export { NU_MONACO_EDITOR_CONFIG, NuMonacoEditorComponent, NuMonacoEditorDiffComponent, NuMonacoEditorModule
|
|
312
|
-
//# sourceMappingURL=ng-util-monaco-editor.
|
|
327
|
+
export { NU_MONACO_EDITOR_CONFIG, NuMonacoEditorComponent, NuMonacoEditorDiffComponent, NuMonacoEditorModule };
|
|
328
|
+
//# sourceMappingURL=ng-util-monaco-editor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-util-monaco-editor.mjs","sources":["../../../../packages/monaco-editor/monaco-editor.config.ts","../../../../packages/monaco-editor/monaco-editor-base.component.ts","../../../../packages/monaco-editor/monaco-editor.component.ts","../../../../packages/monaco-editor/monaco-editor-diff.component.ts","../../../../packages/monaco-editor/monaco-editor.module.ts","../../../../packages/monaco-editor/ng-util-monaco-editor.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const NU_MONACO_EDITOR_CONFIG = new InjectionToken('NU_MONACO_EDITOR_CONFIG');\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","import { DOCUMENT } from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChange,\n SimpleChanges,\n} from '@angular/core';\nimport { fromEvent, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\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 standalone: true,\n})\n// eslint-disable-next-line @angular-eslint/component-class-suffix\nexport abstract class NuMonacoEditorBase implements AfterViewInit, OnChanges, OnDestroy {\n protected _editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;\n protected _options!: monaco.editor.IStandaloneEditorConstructionOptions;\n protected _resize$: Subscription | null = null;\n protected _config: NuMonacoEditorConfig;\n protected _disabled?: boolean;\n\n @Input() height = `200px`;\n @Input() delay = 0;\n @Input()\n set disabled(val: boolean | string) {\n this._disabled = typeof val === 'string' ? true : val;\n this.setDisabled();\n }\n @Input()\n set options(val: monaco.editor.IStandaloneEditorConstructionOptions) {\n this._options = { ...this._config.defaultOptions, ...val };\n }\n get options() {\n return this._options;\n }\n @Output() event = new EventEmitter<NuMonacoEditorEvent>();\n\n constructor(\n protected el: ElementRef<HTMLElement>,\n @Inject(NU_MONACO_EDITOR_CONFIG) config: NuMonacoEditorConfig,\n @Inject(DOCUMENT) protected doc: any,\n protected ngZone: NgZone,\n ) {\n this._config = { baseUrl: 'https://cdn.jsdelivr.net/npm/monaco-editor/min', ...config };\n this.options = this._config.defaultOptions!;\n }\n\n protected abstract initMonaco(_options: monaco.editor.IStandaloneEditorConstructionOptions, _initEvent: boolean): void;\n\n protected notifyEvent(type: NuMonacoEditorEventType, other?: NuMonacoEditorEvent): void {\n this.ngZone.run(() => this.event.emit({ type, editor: this._editor!, ...other }));\n }\n\n protected setDisabled(): this {\n if (this._editor) {\n (this._editor as monaco.editor.IStandaloneCodeEditor).updateOptions({ readOnly: this._disabled });\n }\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 const baseUrl = this._config.baseUrl;\n const amdLoader = () => {\n win.require.config({ paths: { vs: `${baseUrl}/vs` } });\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}/vs/loader.js`;\n loaderScript.onload = amdLoader;\n loaderScript.onerror = () => 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 if (this._resize$) {\n this._resize$.unsubscribe();\n }\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 updateOptions(): void {\n if (!this._editor) return;\n this.ngZone.runOutsideAngular(() => {\n this._editor!.dispose();\n this.initMonaco(this._options, false);\n });\n }\n\n ngAfterViewInit(): void {\n this.ngZone.runOutsideAngular(() => setTimeout(() => this.init(), +this.delay));\n }\n\n ngOnChanges(changes: { [P in keyof this]?: SimpleChange } & SimpleChanges): void {\n const allKeys = Object.keys(changes);\n if (allKeys.length === 1 && allKeys[0] === 'disabled') return;\n this.updateOptions();\n }\n\n ngOnDestroy(): void {\n this.cleanResize();\n if (this._editor) {\n this._editor.dispose();\n this._editor = undefined;\n }\n }\n}\n","import { ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NuMonacoEditorBase } from './monaco-editor-base.component';\nimport { NuMonacoEditorModel } from './monaco-editor.types';\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 standalone: true,\n})\nexport class NuMonacoEditorComponent extends NuMonacoEditorBase implements ControlValueAccessor {\n private _value = '';\n\n @Input() model?: NuMonacoEditorModel | null;\n @Input() autoFormat = true;\n\n get editor(): monaco.editor.IStandaloneCodeEditor {\n return this._editor as monaco.editor.IStandaloneCodeEditor;\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\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 }\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\n this.ngZone.run(() => {\n this._value = value;\n this.onChange(value);\n });\n });\n editor.onDidBlurEditorWidget(() => this.onTouched());\n\n this.registerResize();\n\n if (this.autoFormat) {\n editor\n .getAction('editor.action.formatDocument')\n .run()\n .then(() => this.notifyEvent(initEvent ? 'init' : 're-init'));\n return;\n }\n this.notifyEvent(initEvent ? 'init' : 're-init');\n }\n\n writeValue(value: string): void {\n this._value = value || '';\n if (this._editor) {\n (this._editor as monaco.editor.IStandaloneCodeEditor).setValue(this._value);\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(_isDisabled: boolean): void {\n this.disabled = _isDisabled;\n this.setDisabled();\n }\n}\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\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 standalone: true,\n})\nexport class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {\n @Input() old!: NuMonacoEditorDiffModel | null;\n @Input() new!: NuMonacoEditorDiffModel | null;\n\n get editor(): monaco.editor.IStandaloneDiffEditor {\n return this._editor as monaco.editor.IStandaloneDiffEditor;\n }\n\n initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void {\n if (!this.old || !this.new) {\n throw new Error('old or new not found for nu-monaco-diff-editor');\n }\n\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(this.old.code, this.old.language || options.language),\n modified: monaco.editor.createModel(this.new.code, this.new.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","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NuMonacoEditorDiffComponent } from './monaco-editor-diff.component';\nimport { NuMonacoEditorComponent } from './monaco-editor.component';\nimport { NuMonacoEditorConfig, NU_MONACO_EDITOR_CONFIG } from './monaco-editor.config';\n\nconst COMPONENTS = [NuMonacoEditorComponent, NuMonacoEditorDiffComponent];\n\n@NgModule({\n imports: [CommonModule, ...COMPONENTS],\n exports: COMPONENTS,\n})\nexport class NuMonacoEditorModule {\n static forRoot(config?: NuMonacoEditorConfig): ModuleWithProviders<NuMonacoEditorModule> {\n return {\n ngModule: NuMonacoEditorModule,\n providers: [{ provide: NU_MONACO_EDITOR_CONFIG, useValue: config }],\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,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,UAAU,EAAE,IAAI;iBACjB,CAAA;8BAEU,GAAG,EAAA,CAAA;sBAAX,KAAK;gBACG,GAAG,EAAA,CAAA;sBAAX,KAAK;;;ACXR,MAAM,UAAU,GAAG,CAAC,uBAAuB,EAAE,2BAA2B,CAAC,CAAC;MAM7D,oBAAoB,CAAA;IAC/B,OAAO,OAAO,CAAC,MAA6B,EAAA;QAC1C,OAAO;AACL,YAAA,QAAQ,EAAE,oBAAoB;YAC9B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;SACpE,CAAC;KACH;;oIANU,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;qIAApB,oBAAoB,EAAA,OAAA,EAAA,CAHrB,YAAY,EAHJ,uBAAuB,EAAE,2BAA2B,CAAA,EAAA,OAAA,EAAA,CAApD,uBAAuB,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA;qIAM3D,oBAAoB,EAAA,OAAA,EAAA,CAHrB,YAAY,EAAK,UAAU,CAAA,EAAA,CAAA,CAAA;2FAG1B,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,GAAG,UAAU,CAAC;AACtC,oBAAA,OAAO,EAAE,UAAU;iBACpB,CAAA;;;ACXD;;AAEG;;;;"}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, EventEmitter, Component, Inject, Input, Output, forwardRef, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
|
+
import { fromEvent } from 'rxjs';
|
|
6
|
+
import { debounceTime } from 'rxjs/operators';
|
|
7
|
+
|
|
8
|
+
// tslint:disable-next-line: no-reference
|
|
9
|
+
|
|
10
|
+
const NU_MONACO_EDITOR_CONFIG = new InjectionToken('NU_MONACO_EDITOR_CONFIG');
|
|
11
|
+
|
|
12
|
+
let loadedMonaco = false;
|
|
13
|
+
let loadPromise;
|
|
14
|
+
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
15
|
+
class NuMonacoEditorBase {
|
|
16
|
+
constructor(el, config, doc, ngZone) {
|
|
17
|
+
this.el = el;
|
|
18
|
+
this.doc = doc;
|
|
19
|
+
this.ngZone = ngZone;
|
|
20
|
+
this._resize$ = null;
|
|
21
|
+
this.height = `200px`;
|
|
22
|
+
this.delay = 0;
|
|
23
|
+
this.event = new EventEmitter();
|
|
24
|
+
this._config = { baseUrl: 'https://cdn.jsdelivr.net/npm/monaco-editor/min', ...config };
|
|
25
|
+
this.options = this._config.defaultOptions;
|
|
26
|
+
}
|
|
27
|
+
set disabled(val) {
|
|
28
|
+
this._disabled = typeof val === 'string' ? true : val;
|
|
29
|
+
this.setDisabled();
|
|
30
|
+
}
|
|
31
|
+
set options(val) {
|
|
32
|
+
this._options = { ...this._config.defaultOptions, ...val };
|
|
33
|
+
}
|
|
34
|
+
get options() {
|
|
35
|
+
return this._options;
|
|
36
|
+
}
|
|
37
|
+
notifyEvent(type, other) {
|
|
38
|
+
this.ngZone.run(() => this.event.emit({ type, editor: this._editor, ...other }));
|
|
39
|
+
}
|
|
40
|
+
setDisabled() {
|
|
41
|
+
if (this._editor) {
|
|
42
|
+
this._editor.updateOptions({ readOnly: this._disabled });
|
|
43
|
+
}
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
init() {
|
|
47
|
+
if (loadedMonaco) {
|
|
48
|
+
loadPromise.then(() => this.initMonaco(this.options, true));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
loadedMonaco = true;
|
|
52
|
+
loadPromise = new Promise((resolve, reject) => {
|
|
53
|
+
const win = window;
|
|
54
|
+
if (win == null) {
|
|
55
|
+
resolve();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (win.monaco) {
|
|
59
|
+
resolve();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const baseUrl = this._config.baseUrl;
|
|
63
|
+
const amdLoader = () => {
|
|
64
|
+
win.require.config({ paths: { vs: `${baseUrl}/vs` } });
|
|
65
|
+
if (typeof this._config.monacoPreLoad === 'function') {
|
|
66
|
+
this._config.monacoPreLoad();
|
|
67
|
+
}
|
|
68
|
+
win.require(['vs/editor/editor.main'], () => {
|
|
69
|
+
if (typeof this._config.monacoLoad === 'function') {
|
|
70
|
+
this._config.monacoLoad(win.monaco);
|
|
71
|
+
}
|
|
72
|
+
this.initMonaco(this.options, true);
|
|
73
|
+
resolve();
|
|
74
|
+
}, () => {
|
|
75
|
+
reject(`Unable to load editor/editor.main module, please check your network environment.`);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
if (!win.require) {
|
|
79
|
+
const loaderScript = this.doc.createElement('script');
|
|
80
|
+
loaderScript.type = 'text/javascript';
|
|
81
|
+
loaderScript.src = `${baseUrl}/vs/loader.js`;
|
|
82
|
+
loaderScript.onload = amdLoader;
|
|
83
|
+
loaderScript.onerror = () => reject(`Unable to load ${loaderScript.src}, please check your network environment.`);
|
|
84
|
+
this.doc.getElementsByTagName('head')[0].appendChild(loaderScript);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
amdLoader();
|
|
88
|
+
}
|
|
89
|
+
}).catch(error => this.notifyEvent('load-error', { error }));
|
|
90
|
+
}
|
|
91
|
+
cleanResize() {
|
|
92
|
+
if (this._resize$) {
|
|
93
|
+
this._resize$.unsubscribe();
|
|
94
|
+
}
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
registerResize() {
|
|
98
|
+
this.cleanResize();
|
|
99
|
+
this._resize$ = fromEvent(window, 'resize')
|
|
100
|
+
.pipe(debounceTime(100))
|
|
101
|
+
.subscribe(() => {
|
|
102
|
+
this._editor.layout();
|
|
103
|
+
this.notifyEvent('resize');
|
|
104
|
+
});
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
updateOptions() {
|
|
108
|
+
if (!this._editor)
|
|
109
|
+
return;
|
|
110
|
+
this.ngZone.runOutsideAngular(() => {
|
|
111
|
+
this._editor.dispose();
|
|
112
|
+
this.initMonaco(this._options, false);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
ngAfterViewInit() {
|
|
116
|
+
this.ngZone.runOutsideAngular(() => setTimeout(() => this.init(), +this.delay));
|
|
117
|
+
}
|
|
118
|
+
ngOnChanges(changes) {
|
|
119
|
+
const allKeys = Object.keys(changes);
|
|
120
|
+
if (allKeys.length === 1 && allKeys[0] === 'disabled')
|
|
121
|
+
return;
|
|
122
|
+
this.updateOptions();
|
|
123
|
+
}
|
|
124
|
+
ngOnDestroy() {
|
|
125
|
+
this.cleanResize();
|
|
126
|
+
if (this._editor) {
|
|
127
|
+
this._editor.dispose();
|
|
128
|
+
this._editor = undefined;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/** @nocollapse */ NuMonacoEditorBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorBase, deps: [{ token: i0.ElementRef }, { token: NU_MONACO_EDITOR_CONFIG }, { token: DOCUMENT }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
133
|
+
/** @nocollapse */ NuMonacoEditorBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.3", type: NuMonacoEditorBase, isStandalone: true, selector: "nu-monaco-base", inputs: { height: "height", delay: "delay", disabled: "disabled", options: "options" }, outputs: { event: "event" }, usesOnChanges: true, ngImport: i0, template: ``, isInline: true });
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorBase, decorators: [{
|
|
135
|
+
type: Component,
|
|
136
|
+
args: [{
|
|
137
|
+
selector: 'nu-monaco-base',
|
|
138
|
+
template: ``,
|
|
139
|
+
standalone: true,
|
|
140
|
+
}]
|
|
141
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
142
|
+
type: Inject,
|
|
143
|
+
args: [NU_MONACO_EDITOR_CONFIG]
|
|
144
|
+
}] }, { type: undefined, decorators: [{
|
|
145
|
+
type: Inject,
|
|
146
|
+
args: [DOCUMENT]
|
|
147
|
+
}] }, { type: i0.NgZone }]; }, propDecorators: { height: [{
|
|
148
|
+
type: Input
|
|
149
|
+
}], delay: [{
|
|
150
|
+
type: Input
|
|
151
|
+
}], disabled: [{
|
|
152
|
+
type: Input
|
|
153
|
+
}], options: [{
|
|
154
|
+
type: Input
|
|
155
|
+
}], event: [{
|
|
156
|
+
type: Output
|
|
157
|
+
}] } });
|
|
158
|
+
|
|
159
|
+
class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
160
|
+
constructor() {
|
|
161
|
+
super(...arguments);
|
|
162
|
+
this._value = '';
|
|
163
|
+
this.autoFormat = true;
|
|
164
|
+
this.onChange = (_) => { };
|
|
165
|
+
this.onTouched = () => { };
|
|
166
|
+
}
|
|
167
|
+
get editor() {
|
|
168
|
+
return this._editor;
|
|
169
|
+
}
|
|
170
|
+
initMonaco(options, initEvent) {
|
|
171
|
+
const hasModel = !!this.model;
|
|
172
|
+
if (hasModel) {
|
|
173
|
+
const model = monaco.editor.getModel(this.model.uri || '');
|
|
174
|
+
if (model) {
|
|
175
|
+
options.model = model;
|
|
176
|
+
options.model.setValue(this._value);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
const { value, language, uri } = this.model;
|
|
180
|
+
options.model = monaco.editor.createModel(value || this._value, language, uri);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (this._disabled != null)
|
|
184
|
+
options.readOnly = this._disabled;
|
|
185
|
+
const editor = (this._editor = monaco.editor.create(this.el.nativeElement, options));
|
|
186
|
+
if (!hasModel) {
|
|
187
|
+
editor.setValue(this._value);
|
|
188
|
+
}
|
|
189
|
+
editor.onDidChangeModelContent(() => {
|
|
190
|
+
const value = editor.getValue();
|
|
191
|
+
this.ngZone.run(() => {
|
|
192
|
+
this._value = value;
|
|
193
|
+
this.onChange(value);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
editor.onDidBlurEditorWidget(() => this.onTouched());
|
|
197
|
+
this.registerResize();
|
|
198
|
+
if (this.autoFormat) {
|
|
199
|
+
editor
|
|
200
|
+
.getAction('editor.action.formatDocument')
|
|
201
|
+
.run()
|
|
202
|
+
.then(() => this.notifyEvent(initEvent ? 'init' : 're-init'));
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.notifyEvent(initEvent ? 'init' : 're-init');
|
|
206
|
+
}
|
|
207
|
+
writeValue(value) {
|
|
208
|
+
this._value = value || '';
|
|
209
|
+
if (this._editor) {
|
|
210
|
+
this._editor.setValue(this._value);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
registerOnChange(fn) {
|
|
214
|
+
this.onChange = fn;
|
|
215
|
+
}
|
|
216
|
+
registerOnTouched(fn) {
|
|
217
|
+
this.onTouched = fn;
|
|
218
|
+
}
|
|
219
|
+
setDisabledState(_isDisabled) {
|
|
220
|
+
this.disabled = _isDisabled;
|
|
221
|
+
this.setDisabled();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/** @nocollapse */ NuMonacoEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
225
|
+
/** @nocollapse */ NuMonacoEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.3", type: NuMonacoEditorComponent, isStandalone: true, selector: "nu-monaco-editor", inputs: { model: "model", autoFormat: "autoFormat" }, host: { properties: { "style.display": "'block'", "style.height": "height" } }, providers: [
|
|
226
|
+
{
|
|
227
|
+
provide: NG_VALUE_ACCESSOR,
|
|
228
|
+
useExisting: forwardRef((() => NuMonacoEditorComponent)),
|
|
229
|
+
multi: true,
|
|
230
|
+
},
|
|
231
|
+
], exportAs: ["nuMonacoEditor"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorComponent, decorators: [{
|
|
233
|
+
type: Component,
|
|
234
|
+
args: [{
|
|
235
|
+
selector: 'nu-monaco-editor',
|
|
236
|
+
template: ``,
|
|
237
|
+
exportAs: 'nuMonacoEditor',
|
|
238
|
+
host: {
|
|
239
|
+
'[style.display]': `'block'`,
|
|
240
|
+
'[style.height]': 'height',
|
|
241
|
+
},
|
|
242
|
+
providers: [
|
|
243
|
+
{
|
|
244
|
+
provide: NG_VALUE_ACCESSOR,
|
|
245
|
+
useExisting: forwardRef((() => NuMonacoEditorComponent)),
|
|
246
|
+
multi: true,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
250
|
+
standalone: true,
|
|
251
|
+
}]
|
|
252
|
+
}], propDecorators: { model: [{
|
|
253
|
+
type: Input
|
|
254
|
+
}], autoFormat: [{
|
|
255
|
+
type: Input
|
|
256
|
+
}] } });
|
|
257
|
+
|
|
258
|
+
class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
259
|
+
get editor() {
|
|
260
|
+
return this._editor;
|
|
261
|
+
}
|
|
262
|
+
initMonaco(options, initEvent) {
|
|
263
|
+
if (!this.old || !this.new) {
|
|
264
|
+
throw new Error('old or new not found for nu-monaco-diff-editor');
|
|
265
|
+
}
|
|
266
|
+
const theme = options.theme;
|
|
267
|
+
if (this._disabled != null)
|
|
268
|
+
options.readOnly = this._disabled;
|
|
269
|
+
const editor = (this._editor = monaco.editor.createDiffEditor(this.el.nativeElement, options));
|
|
270
|
+
options.theme = theme;
|
|
271
|
+
editor.setModel({
|
|
272
|
+
original: monaco.editor.createModel(this.old.code, this.old.language || options.language),
|
|
273
|
+
modified: monaco.editor.createModel(this.new.code, this.new.language || options.language),
|
|
274
|
+
});
|
|
275
|
+
// this.setDisabled();
|
|
276
|
+
editor.onDidUpdateDiff(() => this.notifyEvent('update-diff', { diffValue: editor.getModifiedEditor().getValue() }));
|
|
277
|
+
this.registerResize();
|
|
278
|
+
if (initEvent)
|
|
279
|
+
this.notifyEvent('init');
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/** @nocollapse */ NuMonacoEditorDiffComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorDiffComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
283
|
+
/** @nocollapse */ NuMonacoEditorDiffComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.3", type: NuMonacoEditorDiffComponent, isStandalone: true, selector: "nu-monaco-diff-editor", inputs: { old: "old", new: "new" }, host: { properties: { "style.display": "'block'", "style.height": "height" } }, exportAs: ["nuMonacoDiffEditor"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorDiffComponent, decorators: [{
|
|
285
|
+
type: Component,
|
|
286
|
+
args: [{
|
|
287
|
+
selector: 'nu-monaco-diff-editor',
|
|
288
|
+
template: ``,
|
|
289
|
+
exportAs: 'nuMonacoDiffEditor',
|
|
290
|
+
host: {
|
|
291
|
+
'[style.display]': `'block'`,
|
|
292
|
+
'[style.height]': 'height',
|
|
293
|
+
},
|
|
294
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
295
|
+
standalone: true,
|
|
296
|
+
}]
|
|
297
|
+
}], propDecorators: { old: [{
|
|
298
|
+
type: Input
|
|
299
|
+
}], new: [{
|
|
300
|
+
type: Input
|
|
301
|
+
}] } });
|
|
302
|
+
|
|
303
|
+
const COMPONENTS = [NuMonacoEditorComponent, NuMonacoEditorDiffComponent];
|
|
304
|
+
class NuMonacoEditorModule {
|
|
305
|
+
static forRoot(config) {
|
|
306
|
+
return {
|
|
307
|
+
ngModule: NuMonacoEditorModule,
|
|
308
|
+
providers: [{ provide: NU_MONACO_EDITOR_CONFIG, useValue: config }],
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/** @nocollapse */ NuMonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
313
|
+
/** @nocollapse */ NuMonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorModule, imports: [CommonModule, NuMonacoEditorComponent, NuMonacoEditorDiffComponent], exports: [NuMonacoEditorComponent, NuMonacoEditorDiffComponent] });
|
|
314
|
+
/** @nocollapse */ NuMonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorModule, imports: [CommonModule, COMPONENTS] });
|
|
315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: NuMonacoEditorModule, decorators: [{
|
|
316
|
+
type: NgModule,
|
|
317
|
+
args: [{
|
|
318
|
+
imports: [CommonModule, ...COMPONENTS],
|
|
319
|
+
exports: COMPONENTS,
|
|
320
|
+
}]
|
|
321
|
+
}] });
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Generated bundle index. Do not edit.
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
export { NU_MONACO_EDITOR_CONFIG, NuMonacoEditorComponent, NuMonacoEditorDiffComponent, NuMonacoEditorModule };
|
|
328
|
+
//# sourceMappingURL=ng-util-monaco-editor.mjs.map
|