el-text-editor 0.0.67 → 0.0.69

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.
@@ -41,6 +41,7 @@ class ElTextEditorComponent {
41
41
  this.imageEdit2 = new EventEmitter();
42
42
  this.placeHolderRemove = new EventEmitter();
43
43
  this.isOpen = new EventEmitter();
44
+ this.newImageAdded = new EventEmitter();
44
45
  this.value = '';
45
46
  this.showToolbar = false;
46
47
  this.toolbarTop = 0;
@@ -497,12 +498,6 @@ class ElTextEditorComponent {
497
498
  if (index >= 0) {
498
499
  images[index].setAttribute('src', newSrc);
499
500
  }
500
- else {
501
- console.warn(`Index ${index} is out of bounds. Total images: ${images.length}`);
502
- }
503
- }
504
- else {
505
- console.error('Editor element not found');
506
501
  }
507
502
  }
508
503
  initEditor() {
@@ -650,10 +645,6 @@ class ElTextEditorComponent {
650
645
  this.moveCaretToEnd(editor);
651
646
  }
652
647
  this.placeHolderRemove.emit();
653
- console.log('New data inserted at caret.');
654
- }
655
- else {
656
- console.log('No caret position found.');
657
648
  }
658
649
  }
659
650
  // // Move caret to the end of the editor content
@@ -914,6 +905,7 @@ class ElTextEditorComponent {
914
905
  const imgHTML = imgWidth > editorWidth
915
906
  ? `<img src="${img.src}" style="width: 100%; max-width: ${editorWidth}px; height: auto;">`
916
907
  : `<img src="${img.src}" style="width: ${imgWidth}px; height: auto;">`;
908
+ this.newImageAdded.emit();
917
909
  // Insert the image into the editor
918
910
  document.execCommand('insertHTML', false, imgHTML);
919
911
  };
@@ -1236,7 +1228,6 @@ class ElTextEditorComponent {
1236
1228
  }
1237
1229
  editImage() {
1238
1230
  let data;
1239
- console.log('this.editorFrom =', this.editorFrom);
1240
1231
  switch (this.editorFrom.name) {
1241
1232
  case 'section-content':
1242
1233
  data = { editIMG: true, from: 'htmlEditor', index: this.selectedItemIndex, id: this.editorFrom.id };
@@ -1298,12 +1289,6 @@ class ElTextEditorComponent {
1298
1289
  imgTags[index].setAttribute('src', newSrc);
1299
1290
  this.editorText = doc.body.innerHTML;
1300
1291
  }
1301
- else {
1302
- console.error(`Invalid index ${index}. There are only ${imgTags.length} <img> tags.`);
1303
- }
1304
- }
1305
- else {
1306
- console.error('No <img> tags found in the editor text.');
1307
1292
  }
1308
1293
  }
1309
1294
  navigateToIMGEditor(data) {
@@ -1622,7 +1607,7 @@ class ElTextEditorComponent {
1622
1607
  }
1623
1608
  }
1624
1609
  ElTextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ElTextEditorComponent, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i0.Renderer2 }, { token: i2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
1625
- ElTextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: ElTextEditorComponent, selector: "text-editor", inputs: { editorText: "editorText", editorFrom: "editorFrom", editorAction: "editorAction", UserRole: "UserRole", style: "style", disableToolbar: "disableToolbar", placeHolder: "placeHolder", reportId: "reportId", backgroundImage: "backgroundImage", toolbarMode: "toolbarMode", value: "value" }, outputs: { editorTextChange: "editorTextChange", editorActionResponse: "editorActionResponse", editorTextClear: "editorTextClear", imageEdit: "imageEdit", imageEdit2: "imageEdit2", placeHolderRemove: "placeHolderRemove", isOpen: "isOpen" }, providers: [{
1610
+ ElTextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: ElTextEditorComponent, selector: "text-editor", inputs: { editorText: "editorText", editorFrom: "editorFrom", editorAction: "editorAction", UserRole: "UserRole", style: "style", disableToolbar: "disableToolbar", placeHolder: "placeHolder", reportId: "reportId", backgroundImage: "backgroundImage", toolbarMode: "toolbarMode", value: "value" }, outputs: { editorTextChange: "editorTextChange", editorActionResponse: "editorActionResponse", editorTextClear: "editorTextClear", imageEdit: "imageEdit", imageEdit2: "imageEdit2", placeHolderRemove: "placeHolderRemove", isOpen: "isOpen", newImageAdded: "newImageAdded" }, providers: [{
1626
1611
  provide: NG_VALUE_ACCESSOR,
1627
1612
  useExisting: forwardRef(() => ElTextEditorComponent),
1628
1613
  multi: true
@@ -1668,6 +1653,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
1668
1653
  type: Output
1669
1654
  }], isOpen: [{
1670
1655
  type: Output
1656
+ }], newImageAdded: [{
1657
+ type: Output
1671
1658
  }], value: [{
1672
1659
  type: Input
1673
1660
  }], TextEditor: [{