@firestitch/text-editor 18.0.0 → 18.0.2

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 (28) hide show
  1. package/app/components/text-editor/text-editor.component.d.ts +4 -4
  2. package/app/modules/ngx-monaco-editor/base-editor.d.ts +1 -1
  3. package/app/modules/ngx-monaco-editor/diff-editor.component.d.ts +1 -1
  4. package/app/modules/ngx-monaco-editor/editor.component.d.ts +1 -1
  5. package/esm2020/app/components/text-editor/text-editor.component.mjs +150 -0
  6. package/esm2020/app/fs-text-editor.module.mjs +42 -0
  7. package/esm2020/app/modules/ngx-monaco-editor/base-editor.mjs +77 -0
  8. package/esm2020/app/modules/ngx-monaco-editor/diff-editor.component.mjs +91 -0
  9. package/esm2020/app/modules/ngx-monaco-editor/editor.component.mjs +118 -0
  10. package/esm2020/app/modules/ngx-monaco-editor/editor.module.mjs +40 -0
  11. package/fesm2015/firestitch-text-editor.mjs +505 -0
  12. package/fesm2015/firestitch-text-editor.mjs.map +1 -0
  13. package/{fesm2022 → fesm2020}/firestitch-text-editor.mjs +102 -83
  14. package/fesm2020/firestitch-text-editor.mjs.map +1 -0
  15. package/package.json +13 -7
  16. package/esm2022/app/components/text-editor/text-editor.component.mjs +0 -151
  17. package/esm2022/app/fs-text-editor.module.mjs +0 -40
  18. package/esm2022/app/modules/ngx-monaco-editor/base-editor.mjs +0 -82
  19. package/esm2022/app/modules/ngx-monaco-editor/diff-editor.component.mjs +0 -80
  20. package/esm2022/app/modules/ngx-monaco-editor/editor.component.mjs +0 -108
  21. package/esm2022/app/modules/ngx-monaco-editor/editor.module.mjs +0 -38
  22. package/fesm2022/firestitch-text-editor.mjs.map +0 -1
  23. /package/{esm2022 → esm2020}/app/interfaces/config.interface.mjs +0 -0
  24. /package/{esm2022 → esm2020}/app/modules/ngx-monaco-editor/config.mjs +0 -0
  25. /package/{esm2022 → esm2020}/app/modules/ngx-monaco-editor/types.mjs +0 -0
  26. /package/{esm2022 → esm2020}/firestitch-text-editor.mjs +0 -0
  27. /package/{esm2022 → esm2020}/public_api.mjs +0 -0
  28. /package/{index.d.ts → firestitch-text-editor.d.ts} +0 -0
@@ -10,14 +10,9 @@ 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
- config;
14
- _editorContainer;
15
- onInit = new EventEmitter();
16
- _editor;
17
- _options;
18
- _windowResizeSubscription;
19
13
  constructor(config) {
20
14
  this.config = config;
15
+ this.onInit = new EventEmitter();
21
16
  }
22
17
  ngAfterViewInit() {
23
18
  if (loadedMonaco) {
@@ -68,18 +63,18 @@ class BaseEditor {
68
63
  this._editor = undefined;
69
64
  }
70
65
  }
71
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseEditor, deps: [{ token: NGX_MONACO_EDITOR_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
72
- 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 });
73
66
  }
74
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseEditor, decorators: [{
67
+ BaseEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BaseEditor, deps: [{ token: NGX_MONACO_EDITOR_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
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: [{
75
70
  type: Component,
76
71
  args: [{
77
72
  template: '',
78
73
  }]
79
- }], ctorParameters: () => [{ type: undefined, decorators: [{
74
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
80
75
  type: Inject,
81
76
  args: [NGX_MONACO_EDITOR_CONFIG]
82
- }] }], propDecorators: { _editorContainer: [{
77
+ }] }]; }, propDecorators: { _editorContainer: [{
83
78
  type: ViewChild,
84
79
  args: ['editorContainer', { static: true }]
85
80
  }], onInit: [{
@@ -87,11 +82,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
87
82
  }] } });
88
83
 
89
84
  class EditorComponent extends BaseEditor {
90
- zone;
91
- editorConfig;
92
- _value = '';
93
- propagateChange = (_) => { };
94
- onTouched = () => { };
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
+ }
95
93
  set options(options) {
96
94
  this._options = { ...this.config.defaultOptions, ...options };
97
95
  if (this._editor) {
@@ -109,11 +107,6 @@ class EditorComponent extends BaseEditor {
109
107
  this.initMonaco(this.options);
110
108
  }
111
109
  }
112
- constructor(zone, editorConfig) {
113
- super(editorConfig);
114
- this.zone = zone;
115
- this.editorConfig = editorConfig;
116
- }
117
110
  writeValue(value) {
118
111
  this._value = value || '';
119
112
  // Fix for value change while dispose in process.
@@ -163,24 +156,36 @@ class EditorComponent extends BaseEditor {
163
156
  this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());
164
157
  this.onInit.emit(this._editor);
165
158
  }
166
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: EditorComponent, deps: [{ token: i0.NgZone }, { token: NGX_MONACO_EDITOR_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
167
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: EditorComponent, selector: "ngx-monaco-editor", inputs: { options: "options", model: "model" }, providers: [{
168
- provide: NG_VALUE_ACCESSOR,
169
- useExisting: forwardRef(() => EditorComponent),
170
- multi: true,
171
- }], usesInheritance: true, ngImport: i0, template: '<div class="editor-container" #editorContainer></div>', isInline: true, styles: [".editor-container{width:100%;height:100%}\n"] });
172
159
  }
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: EditorComponent, decorators: [{
160
+ EditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", 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: "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: [{
174
167
  type: Component,
175
- args: [{ selector: 'ngx-monaco-editor', template: '<div class="editor-container" #editorContainer></div>', providers: [{
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: [{
176
180
  provide: NG_VALUE_ACCESSOR,
177
181
  useExisting: forwardRef(() => EditorComponent),
178
182
  multi: true,
179
- }], styles: [".editor-container{width:100%;height:100%}\n"] }]
180
- }], ctorParameters: () => [{ type: i0.NgZone }, { type: undefined, decorators: [{
183
+ }],
184
+ }]
185
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: undefined, decorators: [{
181
186
  type: Inject,
182
187
  args: [NGX_MONACO_EDITOR_CONFIG]
183
- }] }], propDecorators: { options: [{
188
+ }] }]; }, propDecorators: { options: [{
184
189
  type: Input,
185
190
  args: ['options']
186
191
  }], model: [{
@@ -189,19 +194,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
189
194
  }] } });
190
195
 
191
196
  class FsTextEditorComponent {
192
- _document;
193
- LINE_HEIGHT = 18;
194
- config = {};
195
- scrollable = false;
196
- ready = new EventEmitter();
197
- blur = new EventEmitter();
198
- onChange;
199
- onTouched;
200
- _editorRef;
201
- _value = '';
202
- _window;
203
197
  constructor(_document) {
204
198
  this._document = _document;
199
+ this.LINE_HEIGHT = 18;
200
+ this.config = {};
201
+ this.scrollable = false;
202
+ this.ready = new EventEmitter();
203
+ this.blur = new EventEmitter();
204
+ this._value = '';
205
205
  this._window = this._document.defaultView;
206
206
  }
207
207
  get monaco() {
@@ -224,10 +224,6 @@ class FsTextEditorComponent {
224
224
  };
225
225
  }
226
226
  }
227
- ngOnDestroy() {
228
- // must be there to cleanup https://github.com/microsoft/monaco-editor/issues/827
229
- this._window.define = null;
230
- }
231
227
  get value() {
232
228
  return this._value;
233
229
  }
@@ -244,6 +240,10 @@ class FsTextEditorComponent {
244
240
  this.config.ready(this._editorRef);
245
241
  }
246
242
  });
243
+ // moved forward for cases when several editors should be initialized on the same page
244
+ setTimeout(() => {
245
+ this._cleanupAMDLoader();
246
+ }, 100);
247
247
  }
248
248
  writeValue(value) {
249
249
  this._value = value || '';
@@ -306,24 +306,28 @@ class FsTextEditorComponent {
306
306
  e.stopPropagation();
307
307
  }, true);
308
308
  }
309
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorComponent, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
310
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsTextEditorComponent, selector: "fs-text-editor", inputs: { config: "config", scrollable: "scrollable" }, outputs: { ready: "ready", blur: "blur" }, providers: [{
311
- provide: NG_VALUE_ACCESSOR,
312
- useExisting: forwardRef(() => FsTextEditorComponent),
313
- multi: true,
314
- }], 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"], dependencies: [{ kind: "component", type: EditorComponent, selector: "ngx-monaco-editor", inputs: ["options", "model"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
309
+ _cleanupAMDLoader() {
310
+ // must be there to cleanup https://github.com/microsoft/monaco-editor/issues/827
311
+ this._window.define = null;
312
+ }
315
313
  }
316
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorComponent, decorators: [{
314
+ FsTextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorComponent, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
315
+ 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: [{
316
+ provide: NG_VALUE_ACCESSOR,
317
+ useExisting: forwardRef(() => FsTextEditorComponent),
318
+ multi: true,
319
+ }], 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"] }] });
320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorComponent, decorators: [{
317
321
  type: Component,
318
322
  args: [{ selector: 'fs-text-editor', providers: [{
319
323
  provide: NG_VALUE_ACCESSOR,
320
324
  useExisting: forwardRef(() => FsTextEditorComponent),
321
325
  multi: true,
322
326
  }], 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"] }]
323
- }], ctorParameters: () => [{ type: Document, decorators: [{
327
+ }], ctorParameters: function () { return [{ type: Document, decorators: [{
324
328
  type: Inject,
325
329
  args: [DOCUMENT]
326
- }] }], propDecorators: { config: [{
330
+ }] }]; }, propDecorators: { config: [{
327
331
  type: Input
328
332
  }], scrollable: [{
329
333
  type: Input
@@ -334,9 +338,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
334
338
  }] } });
335
339
 
336
340
  class DiffEditorComponent extends BaseEditor {
337
- editorConfig;
338
- _originalModel;
339
- _modifiedModel;
341
+ constructor(editorConfig) {
342
+ super(editorConfig);
343
+ this.editorConfig = editorConfig;
344
+ }
340
345
  set options(options) {
341
346
  this._options = { ...this.config.defaultOptions, ...options };
342
347
  if (this._editor) {
@@ -361,10 +366,6 @@ class DiffEditorComponent extends BaseEditor {
361
366
  this.initMonaco(this.options);
362
367
  }
363
368
  }
364
- constructor(editorConfig) {
365
- super(editorConfig);
366
- this.editorConfig = editorConfig;
367
- }
368
369
  initMonaco(options) {
369
370
  if (!this._originalModel || !this._modifiedModel) {
370
371
  throw new Error('originalModel or modifiedModel not found for ngx-monaco-diff-editor');
@@ -388,16 +389,30 @@ class DiffEditorComponent extends BaseEditor {
388
389
  this._windowResizeSubscription = fromEvent(window, 'resize').subscribe(() => this._editor.layout());
389
390
  this.onInit.emit(this._editor);
390
391
  }
391
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DiffEditorComponent, deps: [{ token: NGX_MONACO_EDITOR_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
392
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", 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"] });
393
392
  }
394
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DiffEditorComponent, decorators: [{
393
+ DiffEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DiffEditorComponent, deps: [{ token: NGX_MONACO_EDITOR_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
394
+ 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"] });
395
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DiffEditorComponent, decorators: [{
395
396
  type: Component,
396
- args: [{ selector: 'ngx-monaco-diff-editor', template: '<div class="editor-container" #editorContainer></div>', styles: [":host{display:block;height:200px}.editor-container{width:100%;height:100%}\n"] }]
397
- }], ctorParameters: () => [{ type: undefined, decorators: [{
397
+ args: [{
398
+ selector: 'ngx-monaco-diff-editor',
399
+ template: '<div class="editor-container" #editorContainer></div>',
400
+ styles: [`
401
+ :host {
402
+ display: block;
403
+ height: 200px;
404
+ }
405
+
406
+ .editor-container {
407
+ width: 100%;
408
+ height: 100%;
409
+ }
410
+ `],
411
+ }]
412
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
398
413
  type: Inject,
399
414
  args: [NGX_MONACO_EDITOR_CONFIG]
400
- }] }], propDecorators: { options: [{
415
+ }] }]; }, propDecorators: { options: [{
401
416
  type: Input,
402
417
  args: ['options']
403
418
  }], originalModel: [{
@@ -417,13 +432,15 @@ class MonacoEditorModule {
417
432
  ]
418
433
  };
419
434
  }
420
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
421
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, declarations: [EditorComponent,
422
- DiffEditorComponent], imports: [CommonModule], exports: [EditorComponent,
423
- DiffEditorComponent] });
424
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, imports: [CommonModule] });
425
435
  }
426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonacoEditorModule, decorators: [{
436
+ MonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
437
+ MonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MonacoEditorModule, declarations: [EditorComponent,
438
+ DiffEditorComponent], imports: [CommonModule], exports: [EditorComponent,
439
+ DiffEditorComponent] });
440
+ MonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MonacoEditorModule, imports: [[
441
+ CommonModule
442
+ ]] });
443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MonacoEditorModule, decorators: [{
427
444
  type: NgModule,
428
445
  args: [{
429
446
  imports: [
@@ -449,15 +466,17 @@ class FsTextEditorModule {
449
466
  ],
450
467
  };
451
468
  }
452
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
453
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorModule, declarations: [FsTextEditorComponent], imports: [CommonModule,
454
- MonacoEditorModule,
455
- FormsModule], exports: [FsTextEditorComponent] });
456
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorModule, imports: [CommonModule,
457
- MonacoEditorModule,
458
- FormsModule] });
459
469
  }
460
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorModule, decorators: [{
470
+ FsTextEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
471
+ FsTextEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorModule, declarations: [FsTextEditorComponent], imports: [CommonModule,
472
+ MonacoEditorModule,
473
+ FormsModule], exports: [FsTextEditorComponent] });
474
+ FsTextEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorModule, imports: [[
475
+ CommonModule,
476
+ MonacoEditorModule,
477
+ FormsModule,
478
+ ]] });
479
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsTextEditorModule, decorators: [{
461
480
  type: NgModule,
462
481
  args: [{
463
482
  imports: [
@@ -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('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, Inject, OnDestroy, Output, ViewChild } from '@angular/core';\n\nimport { Subscription } from 'rxjs';\n\nimport { editor } from 'monaco-editor';\n\nimport { NGX_MONACO_EDITOR_CONFIG, NgxMonacoEditorConfig } 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 constructor(@Inject(NGX_MONACO_EDITOR_CONFIG) protected config: NgxMonacoEditorConfig) {}\n\n public ngAfterViewInit(): void {\n if (loadedMonaco) {\n // Wait until monaco editor is available\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, forwardRef, Inject, Input, NgZone } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { fromEvent } from 'rxjs';\n\nimport { BaseEditor } from './base-editor';\nimport { NGX_MONACO_EDITOR_CONFIG, 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})\nexport class EditorComponent extends BaseEditor implements ControlValueAccessor {\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 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 constructor(private zone: NgZone, @Inject(NGX_MONACO_EDITOR_CONFIG) private editorConfig: NgxMonacoEditorConfig) {\n super(editorConfig);\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 {\n Component,\n EventEmitter,\n Inject,\n Input,\n OnInit,\n Output,\n forwardRef,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { editor } from 'monaco-editor';\n\nimport { FsTextEditorConfig } from '../../interfaces/config.interface';\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})\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\n constructor(\n @Inject(DOCUMENT) private _document: Document,\n ) {\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 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\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 [style.height]=\"config.height\"\n [ngModel]=\"value\"\n (ngModelChange)=\"changed($event)\"\n [options]=\"config\"\n (onInit)=\"onEditorInit($event)\">\n</ngx-monaco-editor>\n","import { Component, Inject, Input } from '@angular/core';\n\nimport { fromEvent } from 'rxjs';\n\nimport { BaseEditor } from './base-editor';\nimport { NGX_MONACO_EDITOR_CONFIG, NgxMonacoEditorConfig } from './config';\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})\nexport class DiffEditorComponent extends BaseEditor {\n\n _originalModel: DiffEditorModel;\n _modifiedModel: DiffEditorModel;\n\n @Input('options')\n 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 get options(): any {\n return this._options;\n }\n\n @Input('originalModel')\n 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 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 constructor(@Inject(NGX_MONACO_EDITOR_CONFIG) private editorConfig: NgxMonacoEditorConfig) {\n super(editorConfig);\n }\n\n protected initMonaco(options: any): void {\n\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 ],\n declarations: [\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 { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { FsTextEditorComponent } from './components/text-editor/text-editor.component';\nimport { MonacoEditorModule } from './modules/ngx-monaco-editor/editor.module';\nimport { NgxMonacoEditorConfig } from './modules/ngx-monaco-editor/config';\n\n\n@NgModule({\n imports: [\n CommonModule,\n MonacoEditorModule,\n FormsModule,\n ],\n exports: [\n FsTextEditorComponent,\n ],\n declarations: [\n FsTextEditorComponent,\n ]\n})\nexport class FsTextEditorModule {\n 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/text-editor.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.EditorComponent"],"mappings":";;;;;;;AAEO,MAAM,wBAAwB,GAAG,IAAI,cAAc,CAAC,0BAA0B,CAAC;;ACMtF,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,IAAI,WAA0B,CAAC;MAKT,UAAU,CAAA;AAU9B,IAAA,WAAA,CAAwD,MAA6B,EAAA;QAA7B,IAAM,CAAA,MAAA,GAAN,MAAM,CAAuB;AANpE,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,YAAY,EAAO,CAAC;KAMuC;IAElF,eAAe,GAAA;AACpB,QAAA,IAAI,YAAY,EAAE;;AAEhB,YAAA,WAAW,CAAC,IAAI,CAAC,MAAK;AACpB,gBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACjC,aAAC,CAAC,CAAC;AACJ,SAAA;AAAM,aAAA;YACL,YAAY,GAAG,IAAI,CAAC;AACpB,YAAA,WAAW,GAAG,IAAI,OAAO,CAAO,CAAC,OAAY,KAAI;gBAC/C,MAAM,OAAO,GAAG,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,UAAY,CAAA,qBAAA,CAAuB,CAAC;gBAC9E,IAAI,QAAc,MAAO,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE;AAC9C,oBAAA,OAAO,EAAE,CAAC;oBAEV,OAAO;AACR,iBAAA;gBACD,MAAM,cAAc,GAAQ,MAAK;;AAEzB,oBAAA,MAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAG,EAAA,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;oBACxD,MAAO,CAAC,OAAO,CAAC,CAAC,uBAAuB,CAAC,EAAE,MAAK;wBACpD,IAAI,OAAO,IAAI,CAAC,MAAM,CA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Q;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,kBAAkB;wBAClB,WAAW;AACd,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,qBAAqB;AACxB,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACV,qBAAqB;AACxB,qBAAA;AACJ,iBAAA,CAAA;;;ACrBD;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestitch/text-editor",
3
- "version": "18.0.0",
3
+ "version": "18.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Firestitch/ngx-text-editor"
@@ -21,17 +21,23 @@
21
21
  "tslib": "^2.3.0"
22
22
  },
23
23
  "sideEffects": false,
24
- "module": "fesm2022/firestitch-text-editor.mjs",
25
- "typings": "index.d.ts",
24
+ "module": "fesm2015/firestitch-text-editor.mjs",
25
+ "es2020": "fesm2020/firestitch-text-editor.mjs",
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",
26
30
  "exports": {
27
31
  "./package.json": {
28
32
  "default": "./package.json"
29
33
  },
30
34
  ".": {
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"
35
+ "types": "./firestitch-text-editor.d.ts",
36
+ "esm2020": "./esm2020/firestitch-text-editor.mjs",
37
+ "es2020": "./fesm2020/firestitch-text-editor.mjs",
38
+ "es2015": "./fesm2015/firestitch-text-editor.mjs",
39
+ "node": "./fesm2015/firestitch-text-editor.mjs",
40
+ "default": "./fesm2020/firestitch-text-editor.mjs"
35
41
  }
36
42
  }
37
43
  }
@@ -1,151 +0,0 @@
1
- import { DOCUMENT } from '@angular/common';
2
- import { Component, EventEmitter, Inject, Input, Output, forwardRef, } from '@angular/core';
3
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "../../modules/ngx-monaco-editor/editor.component";
6
- import * as i2 from "@angular/forms";
7
- export class FsTextEditorComponent {
8
- _document;
9
- LINE_HEIGHT = 18;
10
- config = {};
11
- scrollable = false;
12
- ready = new EventEmitter();
13
- blur = new EventEmitter();
14
- onChange;
15
- onTouched;
16
- _editorRef;
17
- _value = '';
18
- _window;
19
- constructor(_document) {
20
- this._document = _document;
21
- this._window = this._document.defaultView;
22
- }
23
- get monaco() {
24
- return this._window.monaco;
25
- }
26
- ngOnInit() {
27
- if (this.config) {
28
- this.config = {
29
- minimap: {
30
- enabled: false,
31
- },
32
- theme: 'vs-dark',
33
- automaticLayout: !!this.config.height,
34
- scrollBeyondLastLine: false,
35
- scrollbar: {
36
- vertical: this.config.height ? 'auto' : 'hidden',
37
- },
38
- hideCursorInOverviewRuler: true,
39
- ...this.config,
40
- };
41
- }
42
- }
43
- ngOnDestroy() {
44
- // must be there to cleanup https://github.com/microsoft/monaco-editor/issues/827
45
- this._window.define = null;
46
- }
47
- get value() {
48
- return this._value;
49
- }
50
- onEditorInit(event) {
51
- // Timeout allows the content to fully load to and calculate height
52
- setTimeout(() => {
53
- this._editorRef = event;
54
- this._initEditor();
55
- this.ready.next(event);
56
- if (!this.scrollable && !this.config.height) {
57
- this._disableScroll();
58
- }
59
- if (this.config.ready) {
60
- this.config.ready(this._editorRef);
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
- updateLayout() {
74
- this._editorRef.layout();
75
- }
76
- registerOnChange(fn) {
77
- this.onChange = fn;
78
- }
79
- registerOnTouched(fn) {
80
- this.onTouched = fn;
81
- }
82
- _initEditor() {
83
- if (this._editorRef && !this.config.height) {
84
- this._updateEditorHeight();
85
- this._editorRef.onDidChangeModelContent((e) => {
86
- this._updateEditorHeight();
87
- });
88
- }
89
- this._editorRef.onDidBlurEditorText(() => {
90
- this.blur.next(null);
91
- if (this.config.blur) {
92
- this.config.blur();
93
- }
94
- });
95
- this._editorRef.onDidFocusEditorText(() => {
96
- if (this.config.focus) {
97
- this.config.focus();
98
- }
99
- });
100
- }
101
- _updateEditorHeight() {
102
- const editorDomNode = this._editorRef.getDomNode();
103
- if (!editorDomNode) {
104
- return;
105
- }
106
- const container = editorDomNode.getElementsByClassName('view-lines')[0];
107
- const lineHeight = container.firstChild
108
- ? container.firstChild.offsetHeight
109
- : this.LINE_HEIGHT;
110
- const editorModel = this._editorRef.getModel();
111
- if (!editorModel) {
112
- return;
113
- }
114
- const nextHeight = this._editorRef.getModel().getLineCount() * lineHeight;
115
- // set the height and redo layout
116
- editorDomNode.style.height = `${nextHeight}px`;
117
- this.updateLayout();
118
- }
119
- _disableScroll() {
120
- const node = this._editorRef.getDomNode();
121
- node.addEventListener('wheel', (e) => {
122
- e.stopPropagation();
123
- }, true);
124
- }
125
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorComponent, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
126
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsTextEditorComponent, selector: "fs-text-editor", inputs: { config: "config", scrollable: "scrollable" }, outputs: { ready: "ready", blur: "blur" }, providers: [{
127
- provide: NG_VALUE_ACCESSOR,
128
- useExisting: forwardRef(() => FsTextEditorComponent),
129
- multi: true,
130
- }], 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"], dependencies: [{ kind: "component", type: i1.EditorComponent, selector: "ngx-monaco-editor", inputs: ["options", "model"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
131
- }
132
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsTextEditorComponent, decorators: [{
133
- type: Component,
134
- args: [{ selector: 'fs-text-editor', providers: [{
135
- provide: NG_VALUE_ACCESSOR,
136
- useExisting: forwardRef(() => FsTextEditorComponent),
137
- multi: true,
138
- }], 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"] }]
139
- }], ctorParameters: () => [{ type: Document, decorators: [{
140
- type: Inject,
141
- args: [DOCUMENT]
142
- }] }], propDecorators: { config: [{
143
- type: Input
144
- }], scrollable: [{
145
- type: Input
146
- }], ready: [{
147
- type: Output
148
- }], blur: [{
149
- type: Output
150
- }] } });
151
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dC1lZGl0b3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2FwcC9jb21wb25lbnRzL3RleHQtZWRpdG9yL3RleHQtZWRpdG9yLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy90ZXh0LWVkaXRvci90ZXh0LWVkaXRvci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFP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