@firestitch/text-editor 12.3.0 → 12.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/app/components/text-editor/text-editor.component.d.ts +37 -37
  2. package/app/fs-text-editor.module.d.ts +13 -13
  3. package/app/interfaces/config.interface.d.ts +4 -4
  4. package/app/modules/ngx-monaco-editor/base-editor.d.ts +18 -0
  5. package/app/modules/ngx-monaco-editor/config.d.ts +9 -0
  6. package/app/modules/ngx-monaco-editor/diff-editor.component.d.ts +17 -0
  7. package/app/modules/ngx-monaco-editor/editor.component.d.ts +23 -0
  8. package/app/modules/ngx-monaco-editor/editor.module.d.ts +12 -0
  9. package/app/modules/ngx-monaco-editor/types.d.ts +9 -0
  10. package/bundles/firestitch-text-editor.umd.js +1020 -225
  11. package/bundles/firestitch-text-editor.umd.js.map +1 -1
  12. package/esm2015/app/components/text-editor/text-editor.component.js +150 -150
  13. package/esm2015/app/fs-text-editor.module.js +43 -43
  14. package/esm2015/app/interfaces/config.interface.js +1 -1
  15. package/esm2015/app/modules/ngx-monaco-editor/base-editor.js +77 -0
  16. package/esm2015/app/modules/ngx-monaco-editor/config.js +3 -0
  17. package/esm2015/app/modules/ngx-monaco-editor/diff-editor.component.js +91 -0
  18. package/esm2015/app/modules/ngx-monaco-editor/editor.component.js +121 -0
  19. package/esm2015/app/modules/ngx-monaco-editor/editor.module.js +40 -0
  20. package/esm2015/app/modules/ngx-monaco-editor/types.js +2 -0
  21. package/esm2015/firestitch-text-editor.js +4 -4
  22. package/esm2015/public_api.js +5 -5
  23. package/fesm2015/firestitch-text-editor.js +491 -181
  24. package/fesm2015/firestitch-text-editor.js.map +1 -1
  25. package/firestitch-text-editor.d.ts +5 -5
  26. package/package.json +2 -11
  27. package/public_api.d.ts +3 -3
@@ -1,197 +1,507 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, forwardRef, Component, Inject, Input, Output, ViewChild, NgModule } from '@angular/core';
2
+ import { InjectionToken, EventEmitter, Component, Inject, ViewChild, Output, forwardRef, Input, NgModule } from '@angular/core';
3
3
  import { DOCUMENT, CommonModule } from '@angular/common';
4
4
  import * as i2 from '@angular/forms';
5
5
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
6
- import * as i1 from 'ngx-monaco-editor';
7
- import { EditorComponent, MonacoEditorModule } from 'ngx-monaco-editor';
6
+ import { fromEvent } from 'rxjs';
8
7
 
9
- class FsTextEditorComponent {
10
- constructor(_element, _document) {
11
- this._element = _element;
12
- this._document = _document;
13
- this.config = {};
14
- this.scrollable = false;
15
- this.init = new EventEmitter();
16
- this.blur = new EventEmitter();
17
- this.defaultConfig = {
18
- minimap: {
19
- enabled: false
20
- },
21
- theme: 'vs-dark',
22
- automaticLayout: false,
23
- scrollBeyondLastLine: false,
24
- autoHeight: true,
25
- scrollbar: {
26
- vertical: 'hidden'
27
- },
28
- hideCursorInOverviewRuler: true
29
- };
30
- this.onChange = (_) => { };
31
- this.onTouched = () => { };
32
- this._window = this._document.defaultView;
33
- this.LINE_HEIGHT = 18;
34
- this._value = '';
35
- }
36
- get monaco() {
37
- return this._window.monaco;
38
- }
39
- ;
40
- ;
41
- ngOnInit() {
42
- if (this.config) {
43
- this.config = Object.assign({}, this.defaultConfig, this.config);
44
- }
45
- }
46
- ngOnDestroy() {
47
- // must be there to cleanup https://github.com/microsoft/monaco-editor/issues/827
48
- this._window.define = null;
49
- }
50
- get value() {
51
- return this._value;
52
- }
53
- onEditorInit(event) {
54
- // Timeout allows the content to fully load to and calculate height
55
- setTimeout(() => {
56
- this._editorRef = event;
57
- this._initEditor();
58
- this.init.next(event);
59
- if (!this.scrollable) {
60
- this._disableScroll();
61
- }
62
- });
63
- }
64
- writeValue(value) {
65
- this._value = value || '';
66
- }
67
- changed(e) {
68
- if (this._value !== e) {
69
- this._value = e;
70
- this.onChange(e);
71
- }
72
- }
73
- registerOnChange(fn) {
74
- this.onChange = fn;
75
- }
76
- registerOnTouched(fn) {
77
- this.onTouched = fn;
78
- }
79
- _initEditor() {
80
- if (this._editorRef && this.config.autoHeight) {
81
- this._updateEditorHeight();
82
- this._editorRef.onDidChangeModelContent((e) => {
83
- this._updateEditorHeight();
84
- });
85
- this._editorRef.onDidBlurEditorText(() => {
86
- this.blur.next();
87
- });
88
- }
89
- }
90
- _updateEditorHeight() {
91
- const editorDomNode = this._editorRef.getDomNode();
92
- if (!editorDomNode) {
93
- return;
94
- }
95
- const container = editorDomNode.getElementsByClassName('view-lines')[0];
96
- const lineHeight = container.firstChild
97
- ? container.firstChild.offsetHeight
98
- : this.LINE_HEIGHT;
99
- const editorModel = this._editorRef.getModel();
100
- if (!editorModel) {
101
- return;
102
- }
103
- const nextHeight = this._editorRef.getModel().getLineCount() * lineHeight;
104
- // set the height and redo layout
105
- editorDomNode.style.height = nextHeight + 'px';
106
- this.updateLayout();
107
- }
108
- updateLayout() {
109
- this._editorRef.layout();
8
+ const NGX_MONACO_EDITOR_CONFIG = new InjectionToken('NGX_MONACO_EDITOR_CONFIG');
9
+
10
+ let loadedMonaco = false;
11
+ let loadPromise;
12
+ class BaseEditor {
13
+ constructor(config) {
14
+ this.config = config;
15
+ this.onInit = new EventEmitter();
16
+ }
17
+ ngAfterViewInit() {
18
+ if (loadedMonaco) {
19
+ // Wait until monaco editor is available
20
+ loadPromise.then(() => {
21
+ this.initMonaco(this._options);
22
+ });
23
+ }
24
+ else {
25
+ loadedMonaco = true;
26
+ loadPromise = new Promise((resolve) => {
27
+ const baseUrl = (this.config.baseUrl || './assets') + '/monaco-editor/min/vs';
28
+ if (typeof (window.monaco) === 'object') {
29
+ resolve();
30
+ return;
31
+ }
32
+ const onGotAmdLoader = () => {
33
+ // Load monaco
34
+ window.require.config({ paths: { 'vs': `${baseUrl}` } });
35
+ window.require([`vs/editor/editor.main`], () => {
36
+ if (typeof this.config.onMonacoLoad === 'function') {
37
+ this.config.onMonacoLoad();
38
+ }
39
+ this.initMonaco(this._options);
40
+ resolve();
41
+ });
42
+ };
43
+ // Load AMD loader if necessary
44
+ if (!window.require) {
45
+ const loaderScript = document.createElement('script');
46
+ loaderScript.type = 'text/javascript';
47
+ loaderScript.src = `${baseUrl}/loader.js`;
48
+ loaderScript.addEventListener('load', onGotAmdLoader);
49
+ document.body.appendChild(loaderScript);
50
+ }
51
+ else {
52
+ onGotAmdLoader();
53
+ }
54
+ });
55
+ }
56
+ }
57
+ ngOnDestroy() {
58
+ if (this._windowResizeSubscription) {
59
+ this._windowResizeSubscription.unsubscribe();
60
+ }
61
+ if (this._editor) {
62
+ this._editor.dispose();
63
+ this._editor = undefined;
64
+ }
65
+ }
66
+ }
67
+ BaseEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseEditor, deps: [{ token: NGX_MONACO_EDITOR_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
68
+ BaseEditor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", 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: "12.2.17", ngImport: i0, type: BaseEditor, decorators: [{
70
+ type: Component,
71
+ args: [{
72
+ template: ''
73
+ }]
74
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
75
+ type: Inject,
76
+ args: [NGX_MONACO_EDITOR_CONFIG]
77
+ }] }]; }, propDecorators: { _editorContainer: [{
78
+ type: ViewChild,
79
+ args: ['editorContainer', { static: true }]
80
+ }], onInit: [{
81
+ type: Output
82
+ }] } });
83
+
84
+ class EditorComponent extends BaseEditor {
85
+ constructor(zone, editorConfig) {
86
+ super(editorConfig);
87
+ this.zone = zone;
88
+ this.editorConfig = editorConfig;
89
+ this._value = '';
90
+ this.propagateChange = (_) => { };
91
+ this.onTouched = () => { };
92
+ }
93
+ set options(options) {
94
+ this._options = Object.assign({}, this.config.defaultOptions, options);
95
+ if (this._editor) {
96
+ this._editor.dispose();
97
+ this.initMonaco(options);
98
+ }
99
+ }
100
+ get options() {
101
+ return this._options;
102
+ }
103
+ set model(model) {
104
+ this.options.model = model;
105
+ if (this._editor) {
106
+ this._editor.dispose();
107
+ this.initMonaco(this.options);
108
+ }
109
+ }
110
+ writeValue(value) {
111
+ this._value = value || '';
112
+ // Fix for value change while dispose in process.
113
+ setTimeout(() => {
114
+ if (this._editor && !this.options.model) {
115
+ this._editor.setValue(this._value);
116
+ }
117
+ });
118
+ }
119
+ registerOnChange(fn) {
120
+ this.propagateChange = fn;
121
+ }
122
+ registerOnTouched(fn) {
123
+ this.onTouched = fn;
124
+ }
125
+ initMonaco(options) {
126
+ const hasModel = !!options.model;
127
+ if (hasModel) {
128
+ const model = monaco.editor.getModel(options.model.uri || '');
129
+ if (model) {
130
+ options.model = model;
131
+ options.model.setValue(this._value);
132
+ }
133
+ else {
134
+ options.model = monaco.editor.createModel(options.model.value, options.model.language, options.model.uri);
135
+ }
136
+ }
137
+ this._editor = monaco.editor.create(this._editorContainer.nativeElement, options);
138
+ if (!hasModel) {
139
+ this._editor.setValue(this._value);
140
+ }
141
+ this._editor.onDidChangeModelContent((e) => {
142
+ const value = this._editor.getValue();
143
+ // value is not propagated to parent when executing outside zone.
144
+ this.zone.run(() => {
145
+ this.propagateChange(value);
146
+ this._value = value;
147
+ });
148
+ });
149
+ this._editor.onDidBlurEditorWidget(() => {
150
+ this.onTouched();
151
+ });
152
+ // refresh layout on resize event.
153
+ if (this._windowResizeSubscription) {
154
+ this._windowResizeSubscription.unsubscribe();
155
+ }
156
+ this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());
157
+ this.onInit.emit(this._editor);
158
+ }
159
+ }
160
+ EditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EditorComponent, deps: [{ token: i0.NgZone }, { token: NGX_MONACO_EDITOR_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
161
+ EditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", 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: ["\n :host {\n display: block;\n height: 200px;\n }\n\n .editor-container {\n width: 100%;\n height: 98%;\n }\n "] });
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EditorComponent, decorators: [{
167
+ type: Component,
168
+ args: [{
169
+ selector: 'ngx-monaco-editor',
170
+ template: '<div class="editor-container" #editorContainer></div>',
171
+ styles: [`
172
+ :host {
173
+ display: block;
174
+ height: 200px;
175
+ }
176
+
177
+ .editor-container {
178
+ width: 100%;
179
+ height: 98%;
180
+ }
181
+ `],
182
+ providers: [{
183
+ provide: NG_VALUE_ACCESSOR,
184
+ useExisting: forwardRef(() => EditorComponent),
185
+ multi: true
186
+ }]
187
+ }]
188
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: undefined, decorators: [{
189
+ type: Inject,
190
+ args: [NGX_MONACO_EDITOR_CONFIG]
191
+ }] }]; }, propDecorators: { options: [{
192
+ type: Input,
193
+ args: ['options']
194
+ }], model: [{
195
+ type: Input,
196
+ args: ['model']
197
+ }] } });
198
+
199
+ class FsTextEditorComponent {
200
+ constructor(_element, _document) {
201
+ this._element = _element;
202
+ this._document = _document;
203
+ this.config = {};
204
+ this.scrollable = false;
205
+ this.init = new EventEmitter();
206
+ this.blur = new EventEmitter();
207
+ this.defaultConfig = {
208
+ minimap: {
209
+ enabled: false
210
+ },
211
+ theme: 'vs-dark',
212
+ automaticLayout: false,
213
+ scrollBeyondLastLine: false,
214
+ autoHeight: true,
215
+ scrollbar: {
216
+ vertical: 'hidden'
217
+ },
218
+ hideCursorInOverviewRuler: true
219
+ };
220
+ this.onChange = (_) => { };
221
+ this.onTouched = () => { };
222
+ this._window = this._document.defaultView;
223
+ this.LINE_HEIGHT = 18;
224
+ this._value = '';
225
+ }
226
+ get monaco() {
227
+ return this._window.monaco;
228
+ }
229
+ ;
230
+ ;
231
+ ngOnInit() {
232
+ if (this.config) {
233
+ this.config = Object.assign({}, this.defaultConfig, this.config);
234
+ }
235
+ }
236
+ ngOnDestroy() {
237
+ // must be there to cleanup https://github.com/microsoft/monaco-editor/issues/827
238
+ this._window.define = null;
239
+ }
240
+ get value() {
241
+ return this._value;
242
+ }
243
+ onEditorInit(event) {
244
+ // Timeout allows the content to fully load to and calculate height
245
+ setTimeout(() => {
246
+ this._editorRef = event;
247
+ this._initEditor();
248
+ this.init.next(event);
249
+ if (!this.scrollable) {
250
+ this._disableScroll();
251
+ }
252
+ });
253
+ }
254
+ writeValue(value) {
255
+ this._value = value || '';
256
+ }
257
+ changed(e) {
258
+ if (this._value !== e) {
259
+ this._value = e;
260
+ this.onChange(e);
261
+ }
262
+ }
263
+ registerOnChange(fn) {
264
+ this.onChange = fn;
265
+ }
266
+ registerOnTouched(fn) {
267
+ this.onTouched = fn;
268
+ }
269
+ _initEditor() {
270
+ if (this._editorRef && this.config.autoHeight) {
271
+ this._updateEditorHeight();
272
+ this._editorRef.onDidChangeModelContent((e) => {
273
+ this._updateEditorHeight();
274
+ });
275
+ this._editorRef.onDidBlurEditorText(() => {
276
+ this.blur.next();
277
+ });
278
+ }
279
+ }
280
+ _updateEditorHeight() {
281
+ const editorDomNode = this._editorRef.getDomNode();
282
+ if (!editorDomNode) {
283
+ return;
284
+ }
285
+ const container = editorDomNode.getElementsByClassName('view-lines')[0];
286
+ const lineHeight = container.firstChild
287
+ ? container.firstChild.offsetHeight
288
+ : this.LINE_HEIGHT;
289
+ const editorModel = this._editorRef.getModel();
290
+ if (!editorModel) {
291
+ return;
292
+ }
293
+ const nextHeight = this._editorRef.getModel().getLineCount() * lineHeight;
294
+ // set the height and redo layout
295
+ editorDomNode.style.height = nextHeight + 'px';
296
+ this.updateLayout();
297
+ }
298
+ updateLayout() {
299
+ this._editorRef.layout();
300
+ }
301
+ _disableScroll() {
302
+ const node = this._editorRef.getDomNode();
303
+ node.addEventListener('wheel', (e) => {
304
+ e.stopPropagation();
305
+ }, true);
306
+ }
307
+ }
308
+ FsTextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsTextEditorComponent, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
309
+ FsTextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FsTextEditorComponent, selector: "fs-text-editor", inputs: { config: "config", scrollable: "scrollable" }, outputs: { init: "init", blur: "blur" }, providers: [{
310
+ provide: NG_VALUE_ACCESSOR,
311
+ useExisting: forwardRef(() => FsTextEditorComponent),
312
+ multi: true
313
+ }], viewQueries: [{ propertyName: "_editorContainer", first: true, predicate: EditorComponent, descendants: true, static: true }], ngImport: i0, template: "<ngx-monaco-editor\n [ngModel]=\"value\"\n (ngModelChange)=\"changed($event)\"\n [options]=\"config\"\n (onInit)=\"onEditorInit($event)\">\n</ngx-monaco-editor>\n", styles: [":host ngx-monaco-editor{height:100%!important}:host ::ng-deep .decorationsOverviewRuler{display:none}:host ::ng-deep .margin,:host ::ng-deep .monaco-editor-background{top:0px!important}\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"] }] });
314
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsTextEditorComponent, decorators: [{
315
+ type: Component,
316
+ args: [{
317
+ selector: 'fs-text-editor',
318
+ templateUrl: 'text-editor.component.html',
319
+ styleUrls: ['text-editor.component.scss'],
320
+ providers: [{
321
+ provide: NG_VALUE_ACCESSOR,
322
+ useExisting: forwardRef(() => FsTextEditorComponent),
323
+ multi: true
324
+ }]
325
+ }]
326
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: Document, decorators: [{
327
+ type: Inject,
328
+ args: [DOCUMENT]
329
+ }] }]; }, propDecorators: { config: [{
330
+ type: Input
331
+ }], scrollable: [{
332
+ type: Input
333
+ }], init: [{
334
+ type: Output
335
+ }], blur: [{
336
+ type: Output
337
+ }], _editorContainer: [{
338
+ type: ViewChild,
339
+ args: [EditorComponent, { static: true }]
340
+ }] } });
341
+
342
+ class DiffEditorComponent extends BaseEditor {
343
+ constructor(editorConfig) {
344
+ super(editorConfig);
345
+ this.editorConfig = editorConfig;
346
+ }
347
+ set options(options) {
348
+ this._options = Object.assign({}, this.config.defaultOptions, options);
349
+ if (this._editor) {
350
+ this._editor.dispose();
351
+ this.initMonaco(options);
352
+ }
353
+ }
354
+ get options() {
355
+ return this._options;
356
+ }
357
+ set originalModel(model) {
358
+ this._originalModel = model;
359
+ if (this._editor) {
360
+ this._editor.dispose();
361
+ this.initMonaco(this.options);
362
+ }
363
+ }
364
+ set modifiedModel(model) {
365
+ this._modifiedModel = model;
366
+ if (this._editor) {
367
+ this._editor.dispose();
368
+ this.initMonaco(this.options);
369
+ }
370
+ }
371
+ initMonaco(options) {
372
+ if (!this._originalModel || !this._modifiedModel) {
373
+ throw new Error('originalModel or modifiedModel not found for ngx-monaco-diff-editor');
374
+ }
375
+ this._originalModel.language = this._originalModel.language || options.language;
376
+ this._modifiedModel.language = this._modifiedModel.language || options.language;
377
+ let originalModel = monaco.editor.createModel(this._originalModel.code, this._originalModel.language);
378
+ let modifiedModel = monaco.editor.createModel(this._modifiedModel.code, this._modifiedModel.language);
379
+ this._editorContainer.nativeElement.innerHTML = '';
380
+ const theme = options.theme;
381
+ this._editor = monaco.editor.createDiffEditor(this._editorContainer.nativeElement, options);
382
+ options.theme = theme;
383
+ this._editor.setModel({
384
+ original: originalModel,
385
+ modified: modifiedModel
386
+ });
387
+ // refresh layout on resize event.
388
+ if (this._windowResizeSubscription) {
389
+ this._windowResizeSubscription.unsubscribe();
390
+ }
391
+ this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());
392
+ this.onInit.emit(this._editor);
393
+ }
394
+ }
395
+ DiffEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DiffEditorComponent, deps: [{ token: NGX_MONACO_EDITOR_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
396
+ DiffEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", 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: ["\n :host {\n display: block;\n height: 200px;\n }\n\n .editor-container {\n width: 100%;\n height: 98%;\n }\n "] });
397
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DiffEditorComponent, decorators: [{
398
+ type: Component,
399
+ args: [{
400
+ selector: 'ngx-monaco-diff-editor',
401
+ template: '<div class="editor-container" #editorContainer></div>',
402
+ styles: [`
403
+ :host {
404
+ display: block;
405
+ height: 200px;
110
406
  }
111
- _disableScroll() {
112
- const node = this._editorRef.getDomNode();
113
- node.addEventListener('wheel', (e) => {
114
- e.stopPropagation();
115
- }, true);
407
+
408
+ .editor-container {
409
+ width: 100%;
410
+ height: 98%;
116
411
  }
117
- }
118
- FsTextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTextEditorComponent, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
119
- FsTextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsTextEditorComponent, selector: "fs-text-editor", inputs: { config: "config", scrollable: "scrollable" }, outputs: { init: "init", blur: "blur" }, providers: [{
120
- provide: NG_VALUE_ACCESSOR,
121
- useExisting: forwardRef(() => FsTextEditorComponent),
122
- multi: true
123
- }], viewQueries: [{ propertyName: "_editorContainer", first: true, predicate: EditorComponent, descendants: true, static: true }], ngImport: i0, template: "<ngx-monaco-editor\n [ngModel]=\"value\"\n (ngModelChange)=\"changed($event)\"\n [options]=\"config\"\n (onInit)=\"onEditorInit($event)\">\n</ngx-monaco-editor>\n", styles: [":host ngx-monaco-editor{height:100%!important}:host ::ng-deep .decorationsOverviewRuler{display:none}:host ::ng-deep .margin,:host ::ng-deep .monaco-editor-background{top:0px!important}\n"], components: [{ type: i1.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"] }] });
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTextEditorComponent, decorators: [{
125
- type: Component,
126
- args: [{
127
- selector: 'fs-text-editor',
128
- templateUrl: 'text-editor.component.html',
129
- styleUrls: ['text-editor.component.scss'],
130
- providers: [{
131
- provide: NG_VALUE_ACCESSOR,
132
- useExisting: forwardRef(() => FsTextEditorComponent),
133
- multi: true
134
- }]
135
- }]
136
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: Document, decorators: [{
137
- type: Inject,
138
- args: [DOCUMENT]
139
- }] }]; }, propDecorators: { config: [{
140
- type: Input
141
- }], scrollable: [{
142
- type: Input
143
- }], init: [{
144
- type: Output
145
- }], blur: [{
146
- type: Output
147
- }], _editorContainer: [{
148
- type: ViewChild,
149
- args: [EditorComponent, { static: true }]
412
+ `]
413
+ }]
414
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
415
+ type: Inject,
416
+ args: [NGX_MONACO_EDITOR_CONFIG]
417
+ }] }]; }, propDecorators: { options: [{
418
+ type: Input,
419
+ args: ['options']
420
+ }], originalModel: [{
421
+ type: Input,
422
+ args: ['originalModel']
423
+ }], modifiedModel: [{
424
+ type: Input,
425
+ args: ['modifiedModel']
150
426
  }] } });
151
427
 
152
- class FsTextEditorModule {
153
- static forRoot(config) {
154
- return {
155
- ngModule: FsTextEditorModule,
156
- providers: [
157
- MonacoEditorModule.forRoot(config).providers,
158
- ],
159
- };
160
- }
161
- }
162
- FsTextEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTextEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
163
- FsTextEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTextEditorModule, declarations: [FsTextEditorComponent], imports: [CommonModule,
164
- MonacoEditorModule,
165
- FormsModule], exports: [FsTextEditorComponent] });
166
- FsTextEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTextEditorModule, imports: [[
167
- CommonModule,
168
- MonacoEditorModule,
169
- FormsModule,
170
- ]] });
171
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTextEditorModule, decorators: [{
172
- type: NgModule,
173
- args: [{
174
- imports: [
175
- CommonModule,
176
- MonacoEditorModule,
177
- FormsModule,
178
- ],
179
- exports: [
180
- FsTextEditorComponent,
181
- ],
182
- entryComponents: [],
183
- declarations: [
184
- FsTextEditorComponent,
185
- ]
186
- }]
428
+ class MonacoEditorModule {
429
+ static forRoot(config = {}) {
430
+ return {
431
+ ngModule: MonacoEditorModule,
432
+ providers: [
433
+ { provide: NGX_MONACO_EDITOR_CONFIG, useValue: config }
434
+ ]
435
+ };
436
+ }
437
+ }
438
+ MonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
439
+ MonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MonacoEditorModule, declarations: [EditorComponent,
440
+ DiffEditorComponent], imports: [CommonModule], exports: [EditorComponent,
441
+ DiffEditorComponent] });
442
+ MonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MonacoEditorModule, imports: [[
443
+ CommonModule
444
+ ]] });
445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MonacoEditorModule, decorators: [{
446
+ type: NgModule,
447
+ args: [{
448
+ imports: [
449
+ CommonModule
450
+ ],
451
+ declarations: [
452
+ EditorComponent,
453
+ DiffEditorComponent
454
+ ],
455
+ exports: [
456
+ EditorComponent,
457
+ DiffEditorComponent
458
+ ]
459
+ }]
460
+ }] });
461
+
462
+ class FsTextEditorModule {
463
+ static forRoot(config) {
464
+ return {
465
+ ngModule: FsTextEditorModule,
466
+ providers: [
467
+ MonacoEditorModule.forRoot(config).providers,
468
+ ],
469
+ };
470
+ }
471
+ }
472
+ FsTextEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsTextEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
473
+ FsTextEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsTextEditorModule, declarations: [FsTextEditorComponent], imports: [CommonModule,
474
+ MonacoEditorModule,
475
+ FormsModule], exports: [FsTextEditorComponent] });
476
+ FsTextEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsTextEditorModule, imports: [[
477
+ CommonModule,
478
+ MonacoEditorModule,
479
+ FormsModule,
480
+ ]] });
481
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsTextEditorModule, decorators: [{
482
+ type: NgModule,
483
+ args: [{
484
+ imports: [
485
+ CommonModule,
486
+ MonacoEditorModule,
487
+ FormsModule,
488
+ ],
489
+ exports: [
490
+ FsTextEditorComponent,
491
+ ],
492
+ entryComponents: [],
493
+ declarations: [
494
+ FsTextEditorComponent,
495
+ ]
496
+ }]
187
497
  }] });
188
498
 
189
- /*
190
- * Public API Surface of fs-menu
499
+ /*
500
+ * Public API Surface of fs-menu
191
501
  */
192
502
 
193
- /**
194
- * Generated bundle index. Do not edit.
503
+ /**
504
+ * Generated bundle index. Do not edit.
195
505
  */
196
506
 
197
507
  export { FsTextEditorComponent, FsTextEditorModule };