@ng-util/monaco-editor 15.0.0 → 16.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/esm2022/monaco-editor-base.component.mjs +152 -0
- package/{esm2020 → esm2022}/monaco-editor-diff.component.mjs +4 -4
- package/esm2022/monaco-editor.component.mjs +112 -0
- package/{esm2020 → esm2022}/monaco-editor.config.mjs +1 -1
- package/esm2022/monaco-editor.module.mjs +26 -0
- package/{fesm2020 → fesm2022}/ng-util-monaco-editor.mjs +48 -41
- package/fesm2022/ng-util-monaco-editor.mjs.map +1 -0
- package/monaco-editor-base.component.d.ts +4 -3
- package/monaco-editor-diff.component.d.ts +1 -1
- package/monaco-editor.component.d.ts +1 -1
- package/monaco-editor.config.d.ts +4 -0
- package/monaco-editor.types.d.ts +1 -1
- package/monaco.d.ts +838 -303
- package/package.json +5 -11
- package/esm2020/monaco-editor-base.component.mjs +0 -153
- package/esm2020/monaco-editor.component.mjs +0 -103
- package/esm2020/monaco-editor.module.mjs +0 -26
- package/fesm2015/ng-util-monaco-editor.mjs +0 -329
- package/fesm2015/ng-util-monaco-editor.mjs.map +0 -1
- package/fesm2020/ng-util-monaco-editor.mjs.map +0 -1
- /package/{esm2020 → esm2022}/monaco-editor.types.mjs +0 -0
- /package/{esm2020 → esm2022}/ng-util-monaco-editor.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, SimpleChange, SimpleChanges } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, DestroyRef, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, SimpleChange, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { Subscription } from 'rxjs';
|
|
3
3
|
import { NuMonacoEditorConfig } from './monaco-editor.config';
|
|
4
4
|
import { NuMonacoEditorEvent, NuMonacoEditorEventType } from './monaco-editor.types';
|
|
@@ -7,6 +7,7 @@ export declare abstract class NuMonacoEditorBase implements AfterViewInit, OnCha
|
|
|
7
7
|
protected el: ElementRef<HTMLElement>;
|
|
8
8
|
protected doc: any;
|
|
9
9
|
protected ngZone: NgZone;
|
|
10
|
+
protected destroy$: DestroyRef;
|
|
10
11
|
protected _editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;
|
|
11
12
|
protected _options: monaco.editor.IStandaloneEditorConstructionOptions;
|
|
12
13
|
protected _resize$: Subscription | null;
|
|
@@ -18,7 +19,7 @@ export declare abstract class NuMonacoEditorBase implements AfterViewInit, OnCha
|
|
|
18
19
|
set options(val: monaco.editor.IStandaloneEditorConstructionOptions);
|
|
19
20
|
get options(): monaco.editor.IStandaloneEditorConstructionOptions;
|
|
20
21
|
event: EventEmitter<NuMonacoEditorEvent>;
|
|
21
|
-
constructor(el: ElementRef<HTMLElement>, config: NuMonacoEditorConfig, doc: any, ngZone: NgZone);
|
|
22
|
+
constructor(el: ElementRef<HTMLElement>, config: NuMonacoEditorConfig, doc: any, ngZone: NgZone, destroy$: DestroyRef);
|
|
22
23
|
protected abstract initMonaco(_options: monaco.editor.IStandaloneEditorConstructionOptions, _initEvent: boolean): void;
|
|
23
24
|
protected notifyEvent(type: NuMonacoEditorEventType, other?: NuMonacoEditorEvent): void;
|
|
24
25
|
protected setDisabled(): this;
|
|
@@ -32,5 +33,5 @@ export declare abstract class NuMonacoEditorBase implements AfterViewInit, OnCha
|
|
|
32
33
|
} & SimpleChanges): void;
|
|
33
34
|
ngOnDestroy(): void;
|
|
34
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<NuMonacoEditorBase, never>;
|
|
35
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorBase, "nu-monaco-base", never, { "height": "height"; "delay": "delay"; "disabled": "disabled"; "options": "options"; }, { "event": "event"; }, never, never, true, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorBase, "nu-monaco-base", never, { "height": { "alias": "height"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "event": "event"; }, never, never, true, never>;
|
|
36
37
|
}
|
|
@@ -7,5 +7,5 @@ export declare class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
|
|
|
7
7
|
get editor(): monaco.editor.IStandaloneDiffEditor;
|
|
8
8
|
initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void;
|
|
9
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<NuMonacoEditorDiffComponent, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorDiffComponent, "nu-monaco-diff-editor", ["nuMonacoDiffEditor"], { "old": "old"; "new": "new"; }, {}, never, never, true, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorDiffComponent, "nu-monaco-diff-editor", ["nuMonacoDiffEditor"], { "old": { "alias": "old"; "required": false; }; "new": { "alias": "new"; "required": false; }; }, {}, never, never, true, never>;
|
|
11
11
|
}
|
|
@@ -15,5 +15,5 @@ export declare class NuMonacoEditorComponent extends NuMonacoEditorBase implemen
|
|
|
15
15
|
registerOnTouched(fn: any): void;
|
|
16
16
|
setDisabledState(_isDisabled: boolean): void;
|
|
17
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<NuMonacoEditorComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorComponent, "nu-monaco-editor", ["nuMonacoEditor"], { "model": "model"; "autoFormat": "autoFormat"; }, {}, never, never, true, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorComponent, "nu-monaco-editor", ["nuMonacoEditor"], { "model": { "alias": "model"; "required": false; }; "autoFormat": { "alias": "autoFormat"; "required": false; }; }, {}, never, never, true, never>;
|
|
19
19
|
}
|
|
@@ -19,4 +19,8 @@ export interface NuMonacoEditorConfig {
|
|
|
19
19
|
* The event before the first preload of the monaco editor library is completed, use this function to set nls availableLanguages.
|
|
20
20
|
*/
|
|
21
21
|
monacoPreLoad?: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Trigger automatic format delay time, default: `100`
|
|
24
|
+
*/
|
|
25
|
+
autoFormatTime?: number;
|
|
22
26
|
}
|
package/monaco-editor.types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface NuMonacoEditorDiffModel {
|
|
|
8
8
|
code: string;
|
|
9
9
|
language?: string;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type NuMonacoEditorEventType = 'load-error' | 'init' | 're-init' | 'resize' | 'update-diff';
|
|
12
12
|
export interface NuMonacoEditorEvent {
|
|
13
13
|
type?: NuMonacoEditorEventType;
|
|
14
14
|
editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;
|