@firestitch/text-editor 18.0.1 → 18.0.3
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/app/components/text-editor/text-editor.component.d.ts +4 -4
- package/app/fs-text-editor.module.d.ts +5 -5
- package/app/interfaces/config.interface.d.ts +1 -0
- package/app/modules/ngx-monaco-editor/base-editor.d.ts +2 -4
- package/app/modules/ngx-monaco-editor/config.d.ts +1 -1
- package/app/modules/ngx-monaco-editor/diff-editor.component.d.ts +3 -6
- package/app/modules/ngx-monaco-editor/editor.component.d.ts +1 -4
- package/app/modules/ngx-monaco-editor/editor.module.d.ts +4 -4
- package/esm2022/app/components/text-editor/text-editor.component.mjs +153 -0
- package/esm2022/app/fs-text-editor.module.mjs +40 -0
- package/{esm2020 → esm2022}/app/interfaces/config.interface.mjs +1 -1
- package/esm2022/app/modules/ngx-monaco-editor/base-editor.mjs +75 -0
- package/esm2022/app/modules/ngx-monaco-editor/config.mjs +3 -0
- package/esm2022/app/modules/ngx-monaco-editor/diff-editor.component.mjs +71 -0
- package/esm2022/app/modules/ngx-monaco-editor/editor.component.mjs +99 -0
- package/esm2022/app/modules/ngx-monaco-editor/editor.module.mjs +37 -0
- package/{fesm2020 → fesm2022}/firestitch-text-editor.mjs +84 -122
- package/fesm2022/firestitch-text-editor.mjs.map +1 -0
- package/package.json +8 -14
- package/esm2020/app/components/text-editor/text-editor.component.mjs +0 -147
- package/esm2020/app/fs-text-editor.module.mjs +0 -42
- package/esm2020/app/modules/ngx-monaco-editor/base-editor.mjs +0 -77
- package/esm2020/app/modules/ngx-monaco-editor/config.mjs +0 -3
- package/esm2020/app/modules/ngx-monaco-editor/diff-editor.component.mjs +0 -91
- package/esm2020/app/modules/ngx-monaco-editor/editor.component.mjs +0 -118
- package/esm2020/app/modules/ngx-monaco-editor/editor.module.mjs +0 -40
- package/fesm2015/firestitch-text-editor.mjs +0 -502
- package/fesm2015/firestitch-text-editor.mjs.map +0 -1
- package/fesm2020/firestitch-text-editor.mjs.map +0 -1
- /package/{esm2020 → esm2022}/app/modules/ngx-monaco-editor/types.mjs +0 -0
- /package/{esm2020 → esm2022}/firestitch-text-editor.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
- /package/{firestitch-text-editor.d.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Component, Input, NgZone, forwardRef, inject } from '@angular/core';
|
|
2
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import { fromEvent } from 'rxjs';
|
|
4
|
+
import { BaseEditor } from './base-editor';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class EditorComponent extends BaseEditor {
|
|
7
|
+
zone = inject(NgZone);
|
|
8
|
+
editorConfig;
|
|
9
|
+
_value = '';
|
|
10
|
+
propagateChange = (_) => { };
|
|
11
|
+
onTouched = () => { };
|
|
12
|
+
set options(options) {
|
|
13
|
+
this._options = { ...this.config.defaultOptions, ...options };
|
|
14
|
+
if (this._editor) {
|
|
15
|
+
this._editor.dispose();
|
|
16
|
+
this.initMonaco(options);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
get options() {
|
|
20
|
+
return this._options;
|
|
21
|
+
}
|
|
22
|
+
set model(model) {
|
|
23
|
+
this.options.model = model;
|
|
24
|
+
if (this._editor) {
|
|
25
|
+
this._editor.dispose();
|
|
26
|
+
this.initMonaco(this.options);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
writeValue(value) {
|
|
30
|
+
this._value = value || '';
|
|
31
|
+
// Fix for value change while dispose in process.
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
if (this._editor && !this.options.model) {
|
|
34
|
+
this._editor.setValue(this._value);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
registerOnChange(fn) {
|
|
39
|
+
this.propagateChange = fn;
|
|
40
|
+
}
|
|
41
|
+
registerOnTouched(fn) {
|
|
42
|
+
this.onTouched = fn;
|
|
43
|
+
}
|
|
44
|
+
initMonaco(options) {
|
|
45
|
+
const hasModel = !!options.model;
|
|
46
|
+
if (hasModel) {
|
|
47
|
+
const model = monaco.editor.getModel(options.model.uri || '');
|
|
48
|
+
if (model) {
|
|
49
|
+
options.model = model;
|
|
50
|
+
options.model.setValue(this._value);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
options.model = monaco.editor.createModel(options.model.value, options.model.language, options.model.uri);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
this._editor = monaco.editor.create(this._editorContainer.nativeElement, options);
|
|
57
|
+
if (!hasModel) {
|
|
58
|
+
this._editor.setValue(this._value);
|
|
59
|
+
}
|
|
60
|
+
this._editor.onDidChangeModelContent((e) => {
|
|
61
|
+
const value = this._editor.getValue();
|
|
62
|
+
// value is not propagated to parent when executing outside zone.
|
|
63
|
+
this.zone.run(() => {
|
|
64
|
+
this.propagateChange(value);
|
|
65
|
+
this._value = value;
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
this._editor.onDidBlurEditorWidget(() => {
|
|
69
|
+
this.onTouched();
|
|
70
|
+
});
|
|
71
|
+
// refresh layout on resize event.
|
|
72
|
+
if (this._windowResizeSubscription) {
|
|
73
|
+
this._windowResizeSubscription.unsubscribe();
|
|
74
|
+
}
|
|
75
|
+
this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());
|
|
76
|
+
this.onInit.emit(this._editor);
|
|
77
|
+
}
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: EditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
79
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: EditorComponent, isStandalone: true, selector: "ngx-monaco-editor", inputs: { options: "options", model: "model" }, providers: [{
|
|
80
|
+
provide: NG_VALUE_ACCESSOR,
|
|
81
|
+
useExisting: forwardRef(() => EditorComponent),
|
|
82
|
+
multi: true,
|
|
83
|
+
}], usesInheritance: true, ngImport: i0, template: '<div class="editor-container" #editorContainer></div>', isInline: true, styles: [".editor-container{width:100%;height:100%}\n"] });
|
|
84
|
+
}
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: EditorComponent, decorators: [{
|
|
86
|
+
type: Component,
|
|
87
|
+
args: [{ selector: 'ngx-monaco-editor', template: '<div class="editor-container" #editorContainer></div>', providers: [{
|
|
88
|
+
provide: NG_VALUE_ACCESSOR,
|
|
89
|
+
useExisting: forwardRef(() => EditorComponent),
|
|
90
|
+
multi: true,
|
|
91
|
+
}], standalone: true, styles: [".editor-container{width:100%;height:100%}\n"] }]
|
|
92
|
+
}], propDecorators: { options: [{
|
|
93
|
+
type: Input,
|
|
94
|
+
args: ['options']
|
|
95
|
+
}], model: [{
|
|
96
|
+
type: Input,
|
|
97
|
+
args: ['model']
|
|
98
|
+
}] } });
|
|
99
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWRpdG9yLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvbW9kdWxlcy9uZ3gtbW9uYWNvLWVkaXRvci9lZGl0b3IuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzdFLE9BQU8sRUFBd0IsaUJBQWlCLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUV6RSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBRWpDLE9BQU8sRUFBRSx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ZENoYW5nZU1vZGVsQ29udGVudCgoZTogYW55KSA9PiB7XG4gICAgICBjb25zdCB2YWx1ZSA9IHRoaXMuX2VkaXRvci5nZXRWYWx1ZSgpO1xuXG4gICAgICAvLyB2YWx1ZSBpcyBub3QgcHJvcGFnYXRlZCB0byBwYXJlbnQgd2hlbiBleGVjdXRpbmcgb3V0c2lkZSB6b25lLlxuICAgICAgdGhpcy56b25lLnJ1bigoKSA9PiB7XG4gICAgICAgIHRoaXMucHJvcGFnYXRlQ2hhbmdlKHZhbHVlKTtcbiAgICAgICAgdGhpcy5fdmFsdWUgPSB2YWx1ZTtcbiAgICAgIH0pO1xuICAgIH0pO1xuXG4gICAgdGhpcy5fZWRpdG9yLm9uRGlkQmx1ckVkaXRvcldpZGdldCgoKSA9PiB7XG4gICAgICB0aGlzLm9uVG91Y2hlZCgpO1xuICAgIH0pO1xuXG4gICAgLy8gcmVmcmVzaCBsYXlvdXQgb24gcmVzaXplIGV2ZW50LlxuICAgIGlmICh0aGlzLl93aW5kb3dSZXNpemVTdWJzY3JpcHRpb24pIHtcbiAgICAgIHRoaXMuX3dpbmRvd1Jlc2l6ZVN1YnNjcmlwdGlvbi51bnN1YnNjcmliZSgpO1xuICAgIH1cbiAgICB0aGlzLl93aW5kb3dSZXNpemVTdWJzY3JpcHRpb24gPSBmcm9tRXZlbnQod2luZG93LCAncmVzaXplJykuc3Vic2NyaWJlKCgpID0+IHRoaXMuX2VkaXRvci5sYXlvdXQoKSk7XG4gICAgdGhpcy5vbkluaXQuZW1pdCh0aGlzLl9lZGl0b3IpO1xuICB9XG5cbn1cbiJdfQ==
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { NGX_MONACO_EDITOR_CONFIG } from './config';
|
|
4
|
+
import { DiffEditorComponent } from './diff-editor.component';
|
|
5
|
+
import { EditorComponent } from './editor.component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export class MonacoEditorModule {
|
|
8
|
+
static forRoot(config = {}) {
|
|
9
|
+
return {
|
|
10
|
+
ngModule: MonacoEditorModule,
|
|
11
|
+
providers: [
|
|
12
|
+
{ provide: NGX_MONACO_EDITOR_CONFIG, useValue: config }
|
|
13
|
+
]
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
17
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, imports: [CommonModule,
|
|
18
|
+
EditorComponent,
|
|
19
|
+
DiffEditorComponent], exports: [EditorComponent,
|
|
20
|
+
DiffEditorComponent] });
|
|
21
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, imports: [CommonModule] });
|
|
22
|
+
}
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, decorators: [{
|
|
24
|
+
type: NgModule,
|
|
25
|
+
args: [{
|
|
26
|
+
imports: [
|
|
27
|
+
CommonModule,
|
|
28
|
+
EditorComponent,
|
|
29
|
+
DiffEditorComponent
|
|
30
|
+
],
|
|
31
|
+
exports: [
|
|
32
|
+
EditorComponent,
|
|
33
|
+
DiffEditorComponent
|
|
34
|
+
]
|
|
35
|
+
}]
|
|
36
|
+
}] });
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWRpdG9yLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvbW9kdWxlcy9uZ3gtbW9uYWNvLWVkaXRvci9lZGl0b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pZGVycywgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuaW1wb3J0IHsgTkdYX01PTkFDT19FRElUT1JfQ09ORklHLCBOZ3hNb25hY29FZGl0b3JDb25maWcgfSBmcm9tICcuL2NvbmZpZyc7XG5pbXBvcnQgeyBEaWZmRWRpdG9yQ29tcG9uZW50IH0gZnJvbSAnLi9kaWZmLWVkaXRvci5jb21wb25lbnQnO1xuaW1wb3J0IHsgRWRpdG9yQ29tcG9uZW50IH0gZnJvbSAnLi9lZGl0b3IuY29tcG9uZW50JztcblxuQE5nTW9kdWxlKHtcbiAgICBpbXBvcnRzOiBbXG4gICAgICAgIENvbW1vbk1vZHVsZSxcbiAgICAgICAgRWRpdG9yQ29tcG9uZW50LFxuICAgICAgICBEaWZmRWRpdG9yQ29tcG9uZW50XG4gICAgXSxcbiAgICBleHBvcnRzOiBbXG4gICAgICAgIEVkaXRvckNvbXBvbmVudCxcbiAgICAgICAgRGlmZkVkaXRvckNvbXBvbmVudFxuICAgIF1cbn0pXG5leHBvcnQgY2xhc3MgTW9uYWNvRWRpdG9yTW9kdWxlIHtcbiAgcHVibGljIHN0YXRpYyBmb3JSb290KGNvbmZpZzogTmd4TW9uYWNvRWRpdG9yQ29uZmlnID0ge30pOiBNb2R1bGVXaXRoUHJvdmlkZXJzPE1vbmFjb0VkaXRvck1vZHVsZT4ge1xuICAgIHJldHVybiB7XG4gICAgICBuZ01vZHVsZTogTW9uYWNvRWRpdG9yTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOiBbXG4gICAgICAgIHsgcHJvdmlkZTogTkdYX01PTkFDT19FRElUT1JfQ09ORklHLCB1c2VWYWx1ZTogY29uZmlnIH1cbiAgICAgIF1cbiAgICB9O1xuICB9XG59XG4iXX0=
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, EventEmitter, Component, Inject, ViewChild, Output, forwardRef, Input, NgModule } from '@angular/core';
|
|
3
1
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
4
|
-
import * as
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, EventEmitter, inject, Component, ViewChild, Output, NgZone, forwardRef, Input, ElementRef, NgModule } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
6
6
|
import { fromEvent } from 'rxjs';
|
|
7
7
|
|
|
@@ -10,13 +10,14 @@ const NGX_MONACO_EDITOR_CONFIG = new InjectionToken('NGX_MONACO_EDITOR_CONFIG');
|
|
|
10
10
|
let loadedMonaco = false;
|
|
11
11
|
let loadPromise;
|
|
12
12
|
class BaseEditor {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
_editorContainer;
|
|
14
|
+
onInit = new EventEmitter();
|
|
15
|
+
_editor;
|
|
16
|
+
_options;
|
|
17
|
+
_windowResizeSubscription;
|
|
18
|
+
config = inject(NGX_MONACO_EDITOR_CONFIG);
|
|
17
19
|
ngAfterViewInit() {
|
|
18
20
|
if (loadedMonaco) {
|
|
19
|
-
// Wait until monaco editor is available
|
|
20
21
|
loadPromise.then(() => {
|
|
21
22
|
this.initMonaco(this._options);
|
|
22
23
|
});
|
|
@@ -63,18 +64,15 @@ class BaseEditor {
|
|
|
63
64
|
this._editor = undefined;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
67
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: BaseEditor, selector: "ng-component", outputs: { onInit: "onInit" }, viewQueries: [{ propertyName: "_editorContainer", first: true, predicate: ["editorContainer"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
BaseEditor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: BaseEditor, selector: "ng-component", outputs: { onInit: "onInit" }, viewQueries: [{ propertyName: "_editorContainer", first: true, predicate: ["editorContainer"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BaseEditor, decorators: [{
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseEditor, decorators: [{
|
|
70
71
|
type: Component,
|
|
71
72
|
args: [{
|
|
72
73
|
template: '',
|
|
73
74
|
}]
|
|
74
|
-
}],
|
|
75
|
-
type: Inject,
|
|
76
|
-
args: [NGX_MONACO_EDITOR_CONFIG]
|
|
77
|
-
}] }]; }, propDecorators: { _editorContainer: [{
|
|
75
|
+
}], propDecorators: { _editorContainer: [{
|
|
78
76
|
type: ViewChild,
|
|
79
77
|
args: ['editorContainer', { static: true }]
|
|
80
78
|
}], onInit: [{
|
|
@@ -82,14 +80,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
82
80
|
}] } });
|
|
83
81
|
|
|
84
82
|
class EditorComponent extends BaseEditor {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this.propagateChange = (_) => { };
|
|
91
|
-
this.onTouched = () => { };
|
|
92
|
-
}
|
|
83
|
+
zone = inject(NgZone);
|
|
84
|
+
editorConfig;
|
|
85
|
+
_value = '';
|
|
86
|
+
propagateChange = (_) => { };
|
|
87
|
+
onTouched = () => { };
|
|
93
88
|
set options(options) {
|
|
94
89
|
this._options = { ...this.config.defaultOptions, ...options };
|
|
95
90
|
if (this._editor) {
|
|
@@ -156,36 +151,21 @@ class EditorComponent extends BaseEditor {
|
|
|
156
151
|
this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());
|
|
157
152
|
this.onInit.emit(this._editor);
|
|
158
153
|
}
|
|
154
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: EditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
155
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: EditorComponent, isStandalone: true, selector: "ngx-monaco-editor", inputs: { options: "options", model: "model" }, providers: [{
|
|
156
|
+
provide: NG_VALUE_ACCESSOR,
|
|
157
|
+
useExisting: forwardRef(() => EditorComponent),
|
|
158
|
+
multi: true,
|
|
159
|
+
}], usesInheritance: true, ngImport: i0, template: '<div class="editor-container" #editorContainer></div>', isInline: true, styles: [".editor-container{width:100%;height:100%}\n"] });
|
|
159
160
|
}
|
|
160
|
-
|
|
161
|
-
EditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: EditorComponent, selector: "ngx-monaco-editor", inputs: { options: "options", model: "model" }, providers: [{
|
|
162
|
-
provide: NG_VALUE_ACCESSOR,
|
|
163
|
-
useExisting: forwardRef(() => EditorComponent),
|
|
164
|
-
multi: true,
|
|
165
|
-
}], usesInheritance: true, ngImport: i0, template: '<div class="editor-container" #editorContainer></div>', isInline: true, styles: [".editor-container{width:100%;height:100%}\n"] });
|
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EditorComponent, decorators: [{
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: EditorComponent, decorators: [{
|
|
167
162
|
type: Component,
|
|
168
|
-
args: [{
|
|
169
|
-
selector: 'ngx-monaco-editor',
|
|
170
|
-
template: '<div class="editor-container" #editorContainer></div>',
|
|
171
|
-
styles: [`
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
.editor-container {
|
|
175
|
-
width: 100%;
|
|
176
|
-
height: 100%;
|
|
177
|
-
}
|
|
178
|
-
`],
|
|
179
|
-
providers: [{
|
|
163
|
+
args: [{ selector: 'ngx-monaco-editor', template: '<div class="editor-container" #editorContainer></div>', providers: [{
|
|
180
164
|
provide: NG_VALUE_ACCESSOR,
|
|
181
165
|
useExisting: forwardRef(() => EditorComponent),
|
|
182
166
|
multi: true,
|
|
183
|
-
}],
|
|
184
|
-
|
|
185
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: undefined, decorators: [{
|
|
186
|
-
type: Inject,
|
|
187
|
-
args: [NGX_MONACO_EDITOR_CONFIG]
|
|
188
|
-
}] }]; }, propDecorators: { options: [{
|
|
167
|
+
}], standalone: true, styles: [".editor-container{width:100%;height:100%}\n"] }]
|
|
168
|
+
}], propDecorators: { options: [{
|
|
189
169
|
type: Input,
|
|
190
170
|
args: ['options']
|
|
191
171
|
}], model: [{
|
|
@@ -194,14 +174,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
194
174
|
}] } });
|
|
195
175
|
|
|
196
176
|
class FsTextEditorComponent {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
177
|
+
LINE_HEIGHT = 18;
|
|
178
|
+
config = {};
|
|
179
|
+
scrollable = false;
|
|
180
|
+
ready = new EventEmitter();
|
|
181
|
+
blur = new EventEmitter();
|
|
182
|
+
onChange;
|
|
183
|
+
onTouched;
|
|
184
|
+
_editorRef;
|
|
185
|
+
_value = '';
|
|
186
|
+
_window;
|
|
187
|
+
_document = inject(DOCUMENT);
|
|
188
|
+
_elementRef = inject(ElementRef);
|
|
189
|
+
constructor() {
|
|
205
190
|
this._window = this._document.defaultView;
|
|
206
191
|
}
|
|
207
192
|
get monaco() {
|
|
@@ -213,6 +198,7 @@ class FsTextEditorComponent {
|
|
|
213
198
|
minimap: {
|
|
214
199
|
enabled: false,
|
|
215
200
|
},
|
|
201
|
+
minHeight: this.config.minHeight ?? 150,
|
|
216
202
|
theme: 'vs-dark',
|
|
217
203
|
automaticLayout: !!this.config.height,
|
|
218
204
|
scrollBeyondLastLine: false,
|
|
@@ -223,6 +209,10 @@ class FsTextEditorComponent {
|
|
|
223
209
|
...this.config,
|
|
224
210
|
};
|
|
225
211
|
}
|
|
212
|
+
if (this.config.minHeight) {
|
|
213
|
+
this._elementRef.nativeElement.style
|
|
214
|
+
.setProperty('--min-height', `${this.config.minHeight}px`);
|
|
215
|
+
}
|
|
226
216
|
}
|
|
227
217
|
get value() {
|
|
228
218
|
return this._value;
|
|
@@ -239,8 +229,11 @@ class FsTextEditorComponent {
|
|
|
239
229
|
if (this.config.ready) {
|
|
240
230
|
this.config.ready(this._editorRef);
|
|
241
231
|
}
|
|
242
|
-
this._cleanupAMDLoader();
|
|
243
232
|
});
|
|
233
|
+
// moved forward for cases when several editors should be initialized on the same page
|
|
234
|
+
// setTimeout(() => {
|
|
235
|
+
// this._cleanupAMDLoader();
|
|
236
|
+
// }, 100);
|
|
244
237
|
}
|
|
245
238
|
writeValue(value) {
|
|
246
239
|
this._value = value || '';
|
|
@@ -303,28 +296,21 @@ class FsTextEditorComponent {
|
|
|
303
296
|
e.stopPropagation();
|
|
304
297
|
}, true);
|
|
305
298
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
299
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
300
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsTextEditorComponent, isStandalone: true, selector: "fs-text-editor", inputs: { config: "config", scrollable: "scrollable" }, outputs: { ready: "ready", blur: "blur" }, providers: [{
|
|
301
|
+
provide: NG_VALUE_ACCESSOR,
|
|
302
|
+
useExisting: forwardRef(() => FsTextEditorComponent),
|
|
303
|
+
multi: true,
|
|
304
|
+
}], ngImport: i0, template: "<ngx-monaco-editor\n [ngModel]=\"value\"\n (ngModelChange)=\"changed($event)\"\n [options]=\"config\"\n (onInit)=\"onEditorInit($event)\">\n</ngx-monaco-editor>", styles: ["ngx-monaco-editor{display:block}ngx-monaco-editor ::ng-deep .monaco-editor{min-height:var(--min-height)}\n"], dependencies: [{ kind: "component", type: EditorComponent, selector: "ngx-monaco-editor", inputs: ["options", "model"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
310
305
|
}
|
|
311
|
-
|
|
312
|
-
FsTextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsTextEditorComponent, selector: "fs-text-editor", inputs: { config: "config", scrollable: "scrollable" }, outputs: { ready: "ready", blur: "blur" }, providers: [{
|
|
313
|
-
provide: NG_VALUE_ACCESSOR,
|
|
314
|
-
useExisting: forwardRef(() => FsTextEditorComponent),
|
|
315
|
-
multi: true,
|
|
316
|
-
}], ngImport: i0, template: "<ngx-monaco-editor\n [style.height]=\"config.height\"\n [ngModel]=\"value\"\n (ngModelChange)=\"changed($event)\"\n [options]=\"config\"\n (onInit)=\"onEditorInit($event)\">\n</ngx-monaco-editor>\n", styles: ["ngx-monaco-editor{display:block}\n"], components: [{ type: EditorComponent, selector: "ngx-monaco-editor", inputs: ["options", "model"] }], directives: [{ type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorComponent, decorators: [{
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorComponent, decorators: [{
|
|
318
307
|
type: Component,
|
|
319
308
|
args: [{ selector: 'fs-text-editor', providers: [{
|
|
320
309
|
provide: NG_VALUE_ACCESSOR,
|
|
321
310
|
useExisting: forwardRef(() => FsTextEditorComponent),
|
|
322
311
|
multi: true,
|
|
323
|
-
}], template: "<ngx-monaco-editor\n [
|
|
324
|
-
}], ctorParameters:
|
|
325
|
-
type: Inject,
|
|
326
|
-
args: [DOCUMENT]
|
|
327
|
-
}] }]; }, propDecorators: { config: [{
|
|
312
|
+
}], standalone: true, imports: [EditorComponent, FormsModule], template: "<ngx-monaco-editor\n [ngModel]=\"value\"\n (ngModelChange)=\"changed($event)\"\n [options]=\"config\"\n (onInit)=\"onEditorInit($event)\">\n</ngx-monaco-editor>", styles: ["ngx-monaco-editor{display:block}ngx-monaco-editor ::ng-deep .monaco-editor{min-height:var(--min-height)}\n"] }]
|
|
313
|
+
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
328
314
|
type: Input
|
|
329
315
|
}], scrollable: [{
|
|
330
316
|
type: Input
|
|
@@ -335,10 +321,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
335
321
|
}] } });
|
|
336
322
|
|
|
337
323
|
class DiffEditorComponent extends BaseEditor {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
this.editorConfig = editorConfig;
|
|
341
|
-
}
|
|
324
|
+
_originalModel;
|
|
325
|
+
_modifiedModel;
|
|
342
326
|
set options(options) {
|
|
343
327
|
this._options = { ...this.config.defaultOptions, ...options };
|
|
344
328
|
if (this._editor) {
|
|
@@ -386,30 +370,13 @@ class DiffEditorComponent extends BaseEditor {
|
|
|
386
370
|
this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());
|
|
387
371
|
this.onInit.emit(this._editor);
|
|
388
372
|
}
|
|
373
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DiffEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
374
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: DiffEditorComponent, isStandalone: true, selector: "ngx-monaco-diff-editor", inputs: { options: "options", originalModel: "originalModel", modifiedModel: "modifiedModel" }, usesInheritance: true, ngImport: i0, template: '<div class="editor-container" #editorContainer></div>', isInline: true, styles: [":host{display:block;height:200px}.editor-container{width:100%;height:100%}\n"] });
|
|
389
375
|
}
|
|
390
|
-
|
|
391
|
-
DiffEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: DiffEditorComponent, selector: "ngx-monaco-diff-editor", inputs: { options: "options", originalModel: "originalModel", modifiedModel: "modifiedModel" }, usesInheritance: true, ngImport: i0, template: '<div class="editor-container" #editorContainer></div>', isInline: true, styles: [":host{display:block;height:200px}.editor-container{width:100%;height:100%}\n"] });
|
|
392
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DiffEditorComponent, decorators: [{
|
|
376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DiffEditorComponent, decorators: [{
|
|
393
377
|
type: Component,
|
|
394
|
-
args: [{
|
|
395
|
-
|
|
396
|
-
template: '<div class="editor-container" #editorContainer></div>',
|
|
397
|
-
styles: [`
|
|
398
|
-
:host {
|
|
399
|
-
display: block;
|
|
400
|
-
height: 200px;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
.editor-container {
|
|
404
|
-
width: 100%;
|
|
405
|
-
height: 100%;
|
|
406
|
-
}
|
|
407
|
-
`],
|
|
408
|
-
}]
|
|
409
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
410
|
-
type: Inject,
|
|
411
|
-
args: [NGX_MONACO_EDITOR_CONFIG]
|
|
412
|
-
}] }]; }, propDecorators: { options: [{
|
|
378
|
+
args: [{ selector: 'ngx-monaco-diff-editor', template: '<div class="editor-container" #editorContainer></div>', standalone: true, styles: [":host{display:block;height:200px}.editor-container{width:100%;height:100%}\n"] }]
|
|
379
|
+
}], propDecorators: { options: [{
|
|
413
380
|
type: Input,
|
|
414
381
|
args: ['options']
|
|
415
382
|
}], originalModel: [{
|
|
@@ -429,21 +396,18 @@ class MonacoEditorModule {
|
|
|
429
396
|
]
|
|
430
397
|
};
|
|
431
398
|
}
|
|
399
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
400
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, imports: [CommonModule,
|
|
401
|
+
EditorComponent,
|
|
402
|
+
DiffEditorComponent], exports: [EditorComponent,
|
|
403
|
+
DiffEditorComponent] });
|
|
404
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, imports: [CommonModule] });
|
|
432
405
|
}
|
|
433
|
-
|
|
434
|
-
MonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MonacoEditorModule, declarations: [EditorComponent,
|
|
435
|
-
DiffEditorComponent], imports: [CommonModule], exports: [EditorComponent,
|
|
436
|
-
DiffEditorComponent] });
|
|
437
|
-
MonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MonacoEditorModule, imports: [[
|
|
438
|
-
CommonModule
|
|
439
|
-
]] });
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MonacoEditorModule, decorators: [{
|
|
406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, decorators: [{
|
|
441
407
|
type: NgModule,
|
|
442
408
|
args: [{
|
|
443
409
|
imports: [
|
|
444
|
-
CommonModule
|
|
445
|
-
],
|
|
446
|
-
declarations: [
|
|
410
|
+
CommonModule,
|
|
447
411
|
EditorComponent,
|
|
448
412
|
DiffEditorComponent
|
|
449
413
|
],
|
|
@@ -463,30 +427,28 @@ class FsTextEditorModule {
|
|
|
463
427
|
],
|
|
464
428
|
};
|
|
465
429
|
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
FsTextEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorModule, declarations: [FsTextEditorComponent], imports: [CommonModule,
|
|
469
|
-
MonacoEditorModule,
|
|
470
|
-
FormsModule], exports: [FsTextEditorComponent] });
|
|
471
|
-
FsTextEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorModule, imports: [[
|
|
472
|
-
CommonModule,
|
|
430
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
431
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorModule, imports: [CommonModule,
|
|
473
432
|
MonacoEditorModule,
|
|
474
433
|
FormsModule,
|
|
475
|
-
|
|
476
|
-
i0.ɵɵ
|
|
434
|
+
FsTextEditorComponent], exports: [FsTextEditorComponent] });
|
|
435
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorModule, imports: [CommonModule,
|
|
436
|
+
MonacoEditorModule,
|
|
437
|
+
FormsModule,
|
|
438
|
+
FsTextEditorComponent] });
|
|
439
|
+
}
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorModule, decorators: [{
|
|
477
441
|
type: NgModule,
|
|
478
442
|
args: [{
|
|
479
443
|
imports: [
|
|
480
444
|
CommonModule,
|
|
481
445
|
MonacoEditorModule,
|
|
482
446
|
FormsModule,
|
|
447
|
+
FsTextEditorComponent,
|
|
483
448
|
],
|
|
484
449
|
exports: [
|
|
485
450
|
FsTextEditorComponent,
|
|
486
451
|
],
|
|
487
|
-
declarations: [
|
|
488
|
-
FsTextEditorComponent,
|
|
489
|
-
]
|
|
490
452
|
}]
|
|
491
453
|
}] });
|
|
492
454
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firestitch-text-editor.mjs","sources":["../../src/app/modules/ngx-monaco-editor/config.ts","../../src/app/modules/ngx-monaco-editor/base-editor.ts","../../src/app/modules/ngx-monaco-editor/editor.component.ts","../../src/app/components/text-editor/text-editor.component.ts","../../src/app/components/text-editor/text-editor.component.html","../../src/app/modules/ngx-monaco-editor/diff-editor.component.ts","../../src/app/modules/ngx-monaco-editor/editor.module.ts","../../src/app/fs-text-editor.module.ts","../../src/public_api.ts","../../src/firestitch-text-editor.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const NGX_MONACO_EDITOR_CONFIG = new InjectionToken<NgxMonacoEditorConfig>('NGX_MONACO_EDITOR_CONFIG');\n\nexport interface NgxMonacoEditorConfig {\n baseUrl?: string;\n defaultOptions?: { [key: string]: any; };\n onMonacoLoad?: Function;\n}\n","import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, Output, ViewChild, inject } from '@angular/core';\n\nimport { Subscription } from 'rxjs';\n\nimport { editor } from 'monaco-editor';\n\nimport { NGX_MONACO_EDITOR_CONFIG } from './config';\n\nlet loadedMonaco = false;\nlet loadPromise: Promise<void>;\n\n@Component({\n template: '',\n})\nexport abstract class BaseEditor implements AfterViewInit, OnDestroy {\n\n @ViewChild('editorContainer', { static: true }) public _editorContainer: ElementRef;\n\n @Output() public onInit = new EventEmitter<any>();\n\n protected _editor: editor.ICodeEditor;\n protected _options: any;\n protected _windowResizeSubscription: Subscription;\n\n public config = inject(NGX_MONACO_EDITOR_CONFIG);\n\n public ngAfterViewInit(): void {\n if (loadedMonaco) {\n loadPromise.then(() => {\n this.initMonaco(this._options);\n });\n } else {\n loadedMonaco = true;\n loadPromise = new Promise<void>((resolve: any) => {\n const baseUrl = `${this.config.baseUrl || './assets' }/monaco-editor/min/vs`;\n if (typeof ((<any>window).monaco) === 'object') {\n resolve();\n\n return;\n }\n const onGotAmdLoader: any = () => {\n // Load monaco\n (<any>window).require.config({ paths: { vs: `${baseUrl}` } });\n (<any>window).require(['vs/editor/editor.main'], () => {\n if (typeof this.config.onMonacoLoad === 'function') {\n this.config.onMonacoLoad();\n }\n this.initMonaco(this._options);\n resolve();\n });\n };\n\n // Load AMD loader if necessary\n if (!(<any>window).require) {\n const loaderScript: HTMLScriptElement = document.createElement('script');\n loaderScript.type = 'text/javascript';\n loaderScript.src = `${baseUrl}/loader.js`;\n loaderScript.addEventListener('load', onGotAmdLoader);\n document.body.appendChild(loaderScript);\n } else {\n onGotAmdLoader();\n }\n });\n }\n }\n\n public ngOnDestroy() {\n if (this._windowResizeSubscription) {\n this._windowResizeSubscription.unsubscribe();\n }\n if (this._editor) {\n this._editor.dispose();\n this._editor = undefined;\n }\n }\n\n protected abstract initMonaco(options: any): void;\n}\n","import { Component, Input, NgZone, forwardRef, inject } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { fromEvent } from 'rxjs';\n\nimport { BaseEditor } from './base-editor';\nimport { NgxMonacoEditorConfig } from './config';\nimport { NgxEditorModel } from './types';\n\ndeclare let monaco: any;\n\n@Component({\n selector: 'ngx-monaco-editor',\n template: '<div class=\"editor-container\" #editorContainer></div>',\n styles: [`\n\n\n .editor-container {\n width: 100%;\n height: 100%;\n }\n `],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => EditorComponent),\n multi: true,\n }],\n standalone: true,\n})\nexport class EditorComponent extends BaseEditor implements ControlValueAccessor {\n private zone = inject(NgZone);\n private editorConfig: NgxMonacoEditorConfig;\n\n private _value: string = '';\n\n public propagateChange = (_: any) => {};\n public onTouched = () => {};\n\n @Input('options')\n public set options(options: any) {\n this._options = { ...this.config.defaultOptions, ...options };\n if (this._editor) {\n this._editor.dispose();\n this.initMonaco(options);\n }\n }\n\n public get options(): any {\n return this._options;\n }\n\n @Input('model')\n public set model(model: NgxEditorModel) {\n this.options.model = model;\n if (this._editor) {\n this._editor.dispose();\n this.initMonaco(this.options);\n }\n }\n\n public writeValue(value: any): void {\n this._value = value || '';\n // Fix for value change while dispose in process.\n setTimeout(() => {\n if (this._editor && !this.options.model) {\n this._editor.setValue(this._value);\n }\n });\n }\n\n public registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n\n public registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n protected initMonaco(options: any): void {\n\n const hasModel = !!options.model;\n\n if (hasModel) {\n const model = monaco.editor.getModel(options.model.uri || '');\n if (model) {\n options.model = model;\n options.model.setValue(this._value);\n } else {\n options.model = monaco.editor.createModel(options.model.value, options.model.language, options.model.uri);\n }\n }\n\n this._editor = monaco.editor.create(this._editorContainer.nativeElement, options);\n\n if (!hasModel) {\n this._editor.setValue(this._value);\n }\n\n this._editor.onDidChangeModelContent((e: any) => {\n const value = this._editor.getValue();\n\n // value is not propagated to parent when executing outside zone.\n this.zone.run(() => {\n this.propagateChange(value);\n this._value = value;\n });\n });\n\n this._editor.onDidBlurEditorWidget(() => {\n this.onTouched();\n });\n\n // refresh layout on resize event.\n if (this._windowResizeSubscription) {\n this._windowResizeSubscription.unsubscribe();\n }\n this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());\n this.onInit.emit(this._editor);\n }\n\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Component, ElementRef, EventEmitter, Input, OnInit, Output, forwardRef, inject } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { editor } from 'monaco-editor';\n\nimport { FsTextEditorConfig } from '../../interfaces/config.interface';\nimport { EditorComponent } from '../../modules/ngx-monaco-editor/editor.component';\n\n\n@Component({\n selector: 'fs-text-editor',\n templateUrl: './text-editor.component.html',\n styleUrls: ['./text-editor.component.scss'],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FsTextEditorComponent),\n multi: true,\n }],\n standalone: true,\n imports: [EditorComponent, FormsModule],\n})\nexport class FsTextEditorComponent implements OnInit, ControlValueAccessor {\n\n public readonly LINE_HEIGHT = 18;\n\n @Input() public config: FsTextEditorConfig = {};\n @Input() public scrollable = false;\n\n @Output() public ready = new EventEmitter();\n @Output() public blur = new EventEmitter();\n\n public onChange: (_: any) => void;\n public onTouched: () => void;\n\n private _editorRef: editor.ICodeEditor;\n private _value = '';\n private _window: any; \n private _document = inject<Document>(DOCUMENT);\n private _elementRef = inject(ElementRef);\n\n constructor() {\n this._window = this._document.defaultView;\n }\n\n public get monaco() {\n return this._window.monaco;\n }\n\n public ngOnInit() {\n if (this.config) {\n this.config = {\n minimap: {\n enabled: false,\n },\n minHeight: this.config.minHeight ?? 150,\n theme: 'vs-dark',\n automaticLayout: !!this.config.height,\n scrollBeyondLastLine: false,\n scrollbar: {\n vertical: this.config.height ? 'auto' : 'hidden',\n },\n hideCursorInOverviewRuler: true,\n ...this.config,\n };\n }\n \n if (this.config.minHeight) {\n this._elementRef.nativeElement.style\n .setProperty('--min-height', `${this.config.minHeight}px`);\n }\n }\n\n public get value() {\n return this._value;\n }\n\n public onEditorInit(event) {\n // Timeout allows the content to fully load to and calculate height\n setTimeout(() => {\n this._editorRef = event;\n this._initEditor();\n this.ready.next(event);\n\n if (!this.scrollable && !this.config.height) {\n this._disableScroll();\n }\n\n if(this.config.ready) {\n this.config.ready(this._editorRef);\n }\n });\n\n // moved forward for cases when several editors should be initialized on the same page\n // setTimeout(() => {\n // this._cleanupAMDLoader();\n // }, 100);\n }\n\n public writeValue(value: any): void {\n this._value = value || '';\n }\n\n public changed(e) {\n if (this._value !== e) {\n this._value = e;\n this.onChange(e);\n }\n }\n\n public updateLayout(): void {\n this._editorRef.layout();\n }\n\n public registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n private _initEditor() {\n if (this._editorRef && !this.config.height) {\n this._updateEditorHeight();\n\n this._editorRef.onDidChangeModelContent((e) => {\n this._updateEditorHeight();\n });\n }\n\n this._editorRef.onDidBlurEditorText(() => {\n this.blur.next(null);\n if(this.config.blur) {\n this.config.blur();\n }\n });\n\n this._editorRef.onDidFocusEditorText(() => {\n if(this.config.focus) {\n this.config.focus();\n }\n });\n }\n\n private _updateEditorHeight() {\n const editorDomNode = this._editorRef.getDomNode();\n\n if (!editorDomNode) {\n return;\n }\n\n const container = editorDomNode.getElementsByClassName('view-lines')[0] as HTMLElement;\n const lineHeight = container.firstChild\n ? (container.firstChild as HTMLElement).offsetHeight\n : this.LINE_HEIGHT;\n\n const editorModel = this._editorRef.getModel();\n\n if (!editorModel) {\n return;\n }\n\n const nextHeight = this._editorRef.getModel().getLineCount() * lineHeight;\n\n // set the height and redo layout\n editorDomNode.style.height = `${nextHeight }px`;\n this.updateLayout();\n }\n\n private _disableScroll() {\n const node = this._editorRef.getDomNode();\n\n node.addEventListener('wheel', (e) => {\n e.stopPropagation();\n }, true);\n }\n\n// private _cleanupAMDLoader(): void {\n// // must be there to cleanup https://github.com/microsoft/monaco-editor/issues/827\n// //this._window.define = null;\n// }\n}\n","<ngx-monaco-editor\n [ngModel]=\"value\"\n (ngModelChange)=\"changed($event)\"\n [options]=\"config\"\n (onInit)=\"onEditorInit($event)\">\n</ngx-monaco-editor>","import { Component, Input } from '@angular/core';\n\nimport { fromEvent } from 'rxjs';\n\nimport { BaseEditor } from './base-editor';\nimport { DiffEditorModel } from './types';\n\ndeclare let monaco: any;\n\n@Component({\n selector: 'ngx-monaco-diff-editor',\n template: '<div class=\"editor-container\" #editorContainer></div>',\n styles: [`\n :host {\n display: block;\n height: 200px;\n }\n\n .editor-container {\n width: 100%;\n height: 100%;\n }\n `],\n standalone: true,\n})\nexport class DiffEditorComponent extends BaseEditor {\n\n private _originalModel: DiffEditorModel;\n private _modifiedModel: DiffEditorModel;\n\n @Input('options')\n public set options(options: any) {\n this._options = { ...this.config.defaultOptions, ...options };\n if (this._editor) {\n this._editor.dispose();\n this.initMonaco(options);\n }\n }\n\n public get options(): any {\n return this._options;\n }\n\n @Input('originalModel')\n public set originalModel(model: DiffEditorModel) {\n this._originalModel = model;\n if (this._editor) {\n this._editor.dispose();\n this.initMonaco(this.options);\n }\n }\n\n @Input('modifiedModel')\n public set modifiedModel(model: DiffEditorModel) {\n this._modifiedModel = model;\n if (this._editor) {\n this._editor.dispose();\n this.initMonaco(this.options);\n }\n }\n\n protected initMonaco(options: any): void {\n if (!this._originalModel || !this._modifiedModel) {\n throw new Error('originalModel or modifiedModel not found for ngx-monaco-diff-editor');\n }\n\n this._originalModel.language = this._originalModel.language || options.language;\n this._modifiedModel.language = this._modifiedModel.language || options.language;\n\n const originalModel = monaco.editor.createModel(this._originalModel.code, this._originalModel.language);\n const modifiedModel = monaco.editor.createModel(this._modifiedModel.code, this._modifiedModel.language);\n\n this._editorContainer.nativeElement.innerHTML = '';\n const theme = options.theme;\n this._editor = monaco.editor.createDiffEditor(this._editorContainer.nativeElement, options);\n options.theme = theme;\n this._editor.setModel({\n original: originalModel,\n modified: modifiedModel,\n } as any);\n\n // refresh layout on resize event.\n if (this._windowResizeSubscription) {\n this._windowResizeSubscription.unsubscribe();\n }\n this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());\n this.onInit.emit(this._editor);\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { NGX_MONACO_EDITOR_CONFIG, NgxMonacoEditorConfig } from './config';\nimport { DiffEditorComponent } from './diff-editor.component';\nimport { EditorComponent } from './editor.component';\n\n@NgModule({\n imports: [\n CommonModule,\n EditorComponent,\n DiffEditorComponent\n ],\n exports: [\n EditorComponent,\n DiffEditorComponent\n ]\n})\nexport class MonacoEditorModule {\n public static forRoot(config: NgxMonacoEditorConfig = {}): ModuleWithProviders<MonacoEditorModule> {\n return {\n ngModule: MonacoEditorModule,\n providers: [\n { provide: NGX_MONACO_EDITOR_CONFIG, useValue: config }\n ]\n };\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { FsTextEditorComponent } from './components/text-editor/text-editor.component';\nimport { NgxMonacoEditorConfig } from './modules/ngx-monaco-editor/config';\nimport { MonacoEditorModule } from './modules/ngx-monaco-editor/editor.module';\n\n\n@NgModule({\n imports: [\n CommonModule,\n MonacoEditorModule,\n FormsModule,\n FsTextEditorComponent,\n ],\n exports: [\n FsTextEditorComponent,\n ],\n})\nexport class FsTextEditorModule {\n public static forRoot(config?: NgxMonacoEditorConfig): ModuleWithProviders<FsTextEditorModule> {\n return {\n ngModule: FsTextEditorModule,\n providers: [\n MonacoEditorModule.forRoot(config).providers,\n ],\n };\n }\n}\n","/*\n * Public API Surface of fs-menu\n */\n\nimport { from } from 'rxjs';\n\nexport { FsTextEditorModule } from './app/fs-text-editor.module';\n\nexport { FsTextEditorConfig } from './app/interfaces/config.interface';\n\n\nexport { FsTextEditorComponent } from './app/components/text-editor/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,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAT3B,YAAY;YACZ,kBAAkB;YAClB,WAAW;YACX,qBAAqB,CAAA,EAAA,CAAA,CAAA;;2FAMZ,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAX9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,kBAAkB;wBAClB,WAAW;wBACX,qBAAqB;AACtB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,qBAAqB;AACtB,qBAAA;AACF,iBAAA,CAAA;;;ACnBD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firestitch/text-editor",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/Firestitch/ngx-text-editor"
|
|
@@ -17,27 +17,21 @@
|
|
|
17
17
|
"url": "https://github.com/Firestitch/ngx-text-editor/issues"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"monaco-editor": "^0.
|
|
20
|
+
"monaco-editor": "^0.55.1",
|
|
21
21
|
"tslib": "^2.3.0"
|
|
22
22
|
},
|
|
23
23
|
"sideEffects": false,
|
|
24
|
-
"module": "
|
|
25
|
-
"
|
|
26
|
-
"esm2020": "esm2020/firestitch-text-editor.mjs",
|
|
27
|
-
"fesm2020": "fesm2020/firestitch-text-editor.mjs",
|
|
28
|
-
"fesm2015": "fesm2015/firestitch-text-editor.mjs",
|
|
29
|
-
"typings": "firestitch-text-editor.d.ts",
|
|
24
|
+
"module": "fesm2022/firestitch-text-editor.mjs",
|
|
25
|
+
"typings": "index.d.ts",
|
|
30
26
|
"exports": {
|
|
31
27
|
"./package.json": {
|
|
32
28
|
"default": "./package.json"
|
|
33
29
|
},
|
|
34
30
|
".": {
|
|
35
|
-
"types": "./
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"node": "./fesm2015/firestitch-text-editor.mjs",
|
|
40
|
-
"default": "./fesm2020/firestitch-text-editor.mjs"
|
|
31
|
+
"types": "./index.d.ts",
|
|
32
|
+
"esm2022": "./esm2022/firestitch-text-editor.mjs",
|
|
33
|
+
"esm": "./esm2022/firestitch-text-editor.mjs",
|
|
34
|
+
"default": "./fesm2022/firestitch-text-editor.mjs"
|
|
41
35
|
}
|
|
42
36
|
}
|
|
43
37
|
}
|