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.
- package/esm2020/lib/el-text-editor.component.mjs +6 -19
- package/fesm2015/el-text-editor.mjs +5 -18
- package/fesm2015/el-text-editor.mjs.map +1 -1
- package/fesm2020/el-text-editor.mjs +5 -18
- package/fesm2020/el-text-editor.mjs.map +1 -1
- package/lib/el-text-editor.component.d.ts +2 -1
- package/package.json +1 -1
@@ -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;
|
@@ -495,12 +496,6 @@ class ElTextEditorComponent {
|
|
495
496
|
if (index >= 0) {
|
496
497
|
images[index].setAttribute('src', newSrc);
|
497
498
|
}
|
498
|
-
else {
|
499
|
-
console.warn(`Index ${index} is out of bounds. Total images: ${images.length}`);
|
500
|
-
}
|
501
|
-
}
|
502
|
-
else {
|
503
|
-
console.error('Editor element not found');
|
504
499
|
}
|
505
500
|
}
|
506
501
|
initEditor() {
|
@@ -648,10 +643,6 @@ class ElTextEditorComponent {
|
|
648
643
|
this.moveCaretToEnd(editor);
|
649
644
|
}
|
650
645
|
this.placeHolderRemove.emit();
|
651
|
-
console.log('New data inserted at caret.');
|
652
|
-
}
|
653
|
-
else {
|
654
|
-
console.log('No caret position found.');
|
655
646
|
}
|
656
647
|
}
|
657
648
|
// // Move caret to the end of the editor content
|
@@ -912,6 +903,7 @@ class ElTextEditorComponent {
|
|
912
903
|
const imgHTML = imgWidth > editorWidth
|
913
904
|
? `<img src="${img.src}" style="width: 100%; max-width: ${editorWidth}px; height: auto;">`
|
914
905
|
: `<img src="${img.src}" style="width: ${imgWidth}px; height: auto;">`;
|
906
|
+
this.newImageAdded.emit();
|
915
907
|
// Insert the image into the editor
|
916
908
|
document.execCommand('insertHTML', false, imgHTML);
|
917
909
|
};
|
@@ -1232,7 +1224,6 @@ class ElTextEditorComponent {
|
|
1232
1224
|
}
|
1233
1225
|
editImage() {
|
1234
1226
|
let data;
|
1235
|
-
console.log('this.editorFrom =', this.editorFrom);
|
1236
1227
|
switch (this.editorFrom.name) {
|
1237
1228
|
case 'section-content':
|
1238
1229
|
data = { editIMG: true, from: 'htmlEditor', index: this.selectedItemIndex, id: this.editorFrom.id };
|
@@ -1294,12 +1285,6 @@ class ElTextEditorComponent {
|
|
1294
1285
|
imgTags[index].setAttribute('src', newSrc);
|
1295
1286
|
this.editorText = doc.body.innerHTML;
|
1296
1287
|
}
|
1297
|
-
else {
|
1298
|
-
console.error(`Invalid index ${index}. There are only ${imgTags.length} <img> tags.`);
|
1299
|
-
}
|
1300
|
-
}
|
1301
|
-
else {
|
1302
|
-
console.error('No <img> tags found in the editor text.');
|
1303
1288
|
}
|
1304
1289
|
}
|
1305
1290
|
navigateToIMGEditor(data) {
|
@@ -1616,7 +1601,7 @@ class ElTextEditorComponent {
|
|
1616
1601
|
}
|
1617
1602
|
}
|
1618
1603
|
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 });
|
1619
|
-
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: [{
|
1604
|
+
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: [{
|
1620
1605
|
provide: NG_VALUE_ACCESSOR,
|
1621
1606
|
useExisting: forwardRef(() => ElTextEditorComponent),
|
1622
1607
|
multi: true
|
@@ -1662,6 +1647,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
1662
1647
|
type: Output
|
1663
1648
|
}], isOpen: [{
|
1664
1649
|
type: Output
|
1650
|
+
}], newImageAdded: [{
|
1651
|
+
type: Output
|
1665
1652
|
}], value: [{
|
1666
1653
|
type: Input
|
1667
1654
|
}], TextEditor: [{
|