@ng-util/monaco-editor 20.1.0 → 21.0.1
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 +0 -24
- package/fesm2022/ng-util-monaco-editor.mjs +24 -47
- package/fesm2022/ng-util-monaco-editor.mjs.map +1 -1
- package/monaco.d.ts +9985 -9159
- package/package.json +3 -3
- package/{index.d.ts → types/ng-util-monaco-editor.d.ts} +4 -15
package/README.md
CHANGED
|
@@ -26,30 +26,6 @@ Install from npm repository:
|
|
|
26
26
|
npm install @ng-util/monaco-editor --save
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
**Configure monaco-editor library**
|
|
30
|
-
|
|
31
|
-
Currently this library only supports load monaco-editor with AMD mode. The default is to use cdn (`https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.20.0/min`) lazy loading。
|
|
32
|
-
|
|
33
|
-
If you are using local monaco editor library, you could add the following:
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
"assets": [
|
|
37
|
-
{
|
|
38
|
-
"glob": "**/*",
|
|
39
|
-
"input": "node_modules/monaco-editor/min/vs",
|
|
40
|
-
"output": "/lib/vs"
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
And configure `baseUrl` via `NuMonacoEditorModule.forRoot`.
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
NuMonacoEditorModule.forRoot({
|
|
49
|
-
baseUrl: `lib`,
|
|
50
|
-
}),
|
|
51
|
-
```
|
|
52
|
-
|
|
53
29
|
### Sample
|
|
54
30
|
|
|
55
31
|
Include `NuMonacoEditorModule` in Main Module and Feature Modules where you want to use the editor component.(eg: app.module.ts):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, makeEnvironmentProviders, inject, ElementRef, DestroyRef, input, numberAttribute, booleanAttribute, output, effect, Component, untracked, forwardRef, ChangeDetectionStrategy
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, inject, ElementRef, DestroyRef, input, numberAttribute, booleanAttribute, output, effect, 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
5
|
import { fromEvent, timer, take } from 'rxjs';
|
|
6
|
-
import { DOCUMENT
|
|
6
|
+
import { DOCUMENT } from '@angular/common';
|
|
7
7
|
import { debounceTime } from 'rxjs/operators';
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
@@ -25,10 +25,10 @@ class NuMonacoEditorBase {
|
|
|
25
25
|
_resize$ = null;
|
|
26
26
|
_config;
|
|
27
27
|
_disabled;
|
|
28
|
-
height = input(`200px
|
|
29
|
-
delay = input(0, { transform: numberAttribute });
|
|
30
|
-
disabled = input(false, { transform: booleanAttribute });
|
|
31
|
-
options = input();
|
|
28
|
+
height = input(`200px`, ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
29
|
+
delay = input(0, ...(ngDevMode ? [{ debugName: "delay", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
30
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
31
|
+
options = input(...(ngDevMode ? [undefined, { debugName: "options" }] : []));
|
|
32
32
|
event = output();
|
|
33
33
|
constructor() {
|
|
34
34
|
this._config = { baseUrl: 'https://cdn.jsdelivr.net/npm/monaco-editor/min', autoFormatTime: 100, ...this.config };
|
|
@@ -127,16 +127,16 @@ class NuMonacoEditorBase {
|
|
|
127
127
|
this.cleanResize();
|
|
128
128
|
this._editor?.dispose();
|
|
129
129
|
}
|
|
130
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
131
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
130
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NuMonacoEditorBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
131
|
+
/** @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 });
|
|
132
132
|
}
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NuMonacoEditorBase, decorators: [{
|
|
134
134
|
type: Component,
|
|
135
135
|
args: [{
|
|
136
136
|
selector: 'nu-monaco-base',
|
|
137
137
|
template: ``
|
|
138
138
|
}]
|
|
139
|
-
}], ctorParameters: () => [] });
|
|
139
|
+
}], ctorParameters: () => [], propDecorators: { height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], event: [{ type: i0.Output, args: ["event"] }] } });
|
|
140
140
|
|
|
141
141
|
class PlaceholderWidget {
|
|
142
142
|
ID = 'editor.widget.placeholderHint';
|
|
@@ -181,9 +181,9 @@ class PlaceholderWidget {
|
|
|
181
181
|
class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
182
182
|
_value = '';
|
|
183
183
|
_placeholderWidget;
|
|
184
|
-
placeholder = input();
|
|
185
|
-
model = input();
|
|
186
|
-
autoFormat = input(true, { transform: booleanAttribute });
|
|
184
|
+
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : []));
|
|
185
|
+
model = input(...(ngDevMode ? [undefined, { debugName: "model" }] : []));
|
|
186
|
+
autoFormat = input(true, ...(ngDevMode ? [{ debugName: "autoFormat", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
187
187
|
get editor() {
|
|
188
188
|
return this._editor;
|
|
189
189
|
}
|
|
@@ -279,8 +279,8 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
279
279
|
setDisabledState(v) {
|
|
280
280
|
this.setDisabled(v);
|
|
281
281
|
}
|
|
282
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
283
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
282
|
+
/** @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: [
|
|
284
284
|
{
|
|
285
285
|
provide: NG_VALUE_ACCESSOR,
|
|
286
286
|
useExisting: forwardRef((() => NuMonacoEditorComponent)),
|
|
@@ -288,7 +288,7 @@ class NuMonacoEditorComponent extends NuMonacoEditorBase {
|
|
|
288
288
|
}
|
|
289
289
|
], exportAs: ["nuMonacoEditor"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
290
290
|
}
|
|
291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NuMonacoEditorComponent, decorators: [{
|
|
292
292
|
type: Component,
|
|
293
293
|
args: [{
|
|
294
294
|
selector: 'nu-monaco-editor',
|
|
@@ -307,11 +307,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImpor
|
|
|
307
307
|
],
|
|
308
308
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
309
309
|
}]
|
|
310
|
-
}], ctorParameters: () => [] });
|
|
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 }] }] } });
|
|
311
311
|
|
|
312
312
|
class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
313
|
-
old = input();
|
|
314
|
-
new = input();
|
|
313
|
+
old = input(...(ngDevMode ? [undefined, { debugName: "old" }] : []));
|
|
314
|
+
new = input(...(ngDevMode ? [undefined, { debugName: "new" }] : []));
|
|
315
315
|
get editor() {
|
|
316
316
|
return this._editor;
|
|
317
317
|
}
|
|
@@ -338,10 +338,10 @@ class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
|
338
338
|
if (initEvent)
|
|
339
339
|
this.notifyEvent('init');
|
|
340
340
|
}
|
|
341
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
342
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
341
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NuMonacoEditorDiffComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
342
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.0", type: NuMonacoEditorDiffComponent, isStandalone: true, selector: "nu-monaco-diff-editor", inputs: { old: { classPropertyName: "old", publicName: "old", isSignal: true, isRequired: false, transformFunction: null }, new: { classPropertyName: "new", publicName: "new", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.display": "'block'", "style.height": "height()" } }, exportAs: ["nuMonacoDiffEditor"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
343
343
|
}
|
|
344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NuMonacoEditorDiffComponent, decorators: [{
|
|
345
345
|
type: Component,
|
|
346
346
|
args: [{
|
|
347
347
|
selector: 'nu-monaco-diff-editor',
|
|
@@ -353,34 +353,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImpor
|
|
|
353
353
|
},
|
|
354
354
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
355
355
|
}]
|
|
356
|
-
}] });
|
|
357
|
-
|
|
358
|
-
const COMPONENTS = [NuMonacoEditorComponent, NuMonacoEditorDiffComponent];
|
|
359
|
-
class NuMonacoEditorModule {
|
|
360
|
-
/**
|
|
361
|
-
* Or use `provideNuMonacoEditorConfig` instead.
|
|
362
|
-
*/
|
|
363
|
-
static forRoot(config) {
|
|
364
|
-
return {
|
|
365
|
-
ngModule: NuMonacoEditorModule,
|
|
366
|
-
providers: [{ provide: NU_MONACO_EDITOR_CONFIG, useValue: config }]
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NuMonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
370
|
-
/** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: NuMonacoEditorModule, imports: [CommonModule, NuMonacoEditorComponent, NuMonacoEditorDiffComponent], exports: [NuMonacoEditorComponent, NuMonacoEditorDiffComponent] });
|
|
371
|
-
/** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NuMonacoEditorModule, imports: [CommonModule] });
|
|
372
|
-
}
|
|
373
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NuMonacoEditorModule, decorators: [{
|
|
374
|
-
type: NgModule,
|
|
375
|
-
args: [{
|
|
376
|
-
imports: [CommonModule, ...COMPONENTS],
|
|
377
|
-
exports: COMPONENTS
|
|
378
|
-
}]
|
|
379
|
-
}] });
|
|
356
|
+
}], propDecorators: { old: [{ type: i0.Input, args: [{ isSignal: true, alias: "old", required: false }] }], new: [{ type: i0.Input, args: [{ isSignal: true, alias: "new", required: false }] }] } });
|
|
380
357
|
|
|
381
358
|
/**
|
|
382
359
|
* Generated bundle index. Do not edit.
|
|
383
360
|
*/
|
|
384
361
|
|
|
385
|
-
export { NU_MONACO_EDITOR_CONFIG, NuMonacoEditorComponent, NuMonacoEditorDiffComponent,
|
|
362
|
+
export { NU_MONACO_EDITOR_CONFIG, NuMonacoEditorComponent, NuMonacoEditorDiffComponent, provideNuMonacoEditorConfig };
|
|
386
363
|
//# sourceMappingURL=ng-util-monaco-editor.mjs.map
|
|
@@ -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/monaco-editor.module.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>();\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","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\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 /**\n * Or use `provideNuMonacoEditorConfig` instead.\n */\n static forRoot(config?: NuMonacoEditorConfig): ModuleWithProviders<NuMonacoEditorModule> {\n return {\n ngModule: NuMonacoEditorModule,\n providers: [{ provide: NU_MONACO_EDITOR_CONFIG, useValue: config }]\n };\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;;ACcA,IAAI,YAAY,GAAG,KAAK;AACxB,IAAI,WAA0B;MAMR,kBAAkB,CAA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
|
+
{"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 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;;ACcA,IAAI,YAAY,GAAG,KAAK;AACxB,IAAI,WAA0B;MAMR,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;AAEnB,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,GAAC;IAC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