@kolkov/angular-editor 3.0.0-beta.0 → 3.0.0-beta.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.
- package/README.md +69 -11
- package/assets/icons/icons.svg +156 -0
- package/esm2020/kolkov-angular-editor.mjs +4 -4
- package/esm2020/lib/ae-button/ae-button.component.mjs +21 -22
- package/esm2020/lib/ae-select/ae-select.component.mjs +185 -185
- package/esm2020/lib/ae-toolbar/ae-toolbar.component.mjs +365 -0
- package/esm2020/lib/ae-toolbar-set/ae-toolbar-set.component.mjs +15 -12
- package/esm2020/lib/angular-editor.module.mjs +27 -27
- package/esm2020/lib/angular-editor.service.mjs +264 -264
- package/esm2020/lib/config.mjs +35 -35
- package/esm2020/lib/editor/angular-editor.component.mjs +415 -0
- package/esm2020/lib/utils.mjs +3 -3
- package/esm2020/public-api.mjs +11 -11
- package/fesm2015/kolkov-angular-editor.mjs +1286 -1285
- package/fesm2015/kolkov-angular-editor.mjs.map +1 -1
- package/fesm2020/kolkov-angular-editor.mjs +1280 -1279
- package/fesm2020/kolkov-angular-editor.mjs.map +1 -1
- package/kolkov-angular-editor.d.ts +5 -5
- package/lib/ae-button/ae-button.component.d.ts +7 -10
- package/lib/ae-select/ae-select.component.d.ts +46 -46
- package/lib/{angular-editor-toolbar.component.d.ts → ae-toolbar/ae-toolbar.component.d.ts} +97 -97
- package/lib/ae-toolbar-set/ae-toolbar-set.component.d.ts +6 -6
- package/lib/angular-editor.module.d.ts +13 -13
- package/lib/angular-editor.service.d.ts +87 -87
- package/lib/config.d.ts +39 -39
- package/lib/{angular-editor.component.d.ts → editor/angular-editor.component.d.ts} +133 -133
- package/lib/utils.d.ts +1 -1
- package/package.json +2 -2
- package/public-api.d.ts +8 -8
- package/themes/default.scss +22 -0
- package/assets/FontAwesome.otf +0 -0
- package/assets/fontawesome-webfont.eot +0 -0
- package/assets/fontawesome-webfont.svg +0 -2671
- package/assets/fontawesome-webfont.ttf +0 -0
- package/assets/fontawesome-webfont.woff +0 -0
- package/assets/fontawesome-webfont.woff2 +0 -0
- package/esm2020/lib/angular-editor-toolbar.component.mjs +0 -363
- package/esm2020/lib/angular-editor.component.mjs +0 -415
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { ElementRef, EventEmitter, OnInit, Renderer2 } from '@angular/core';
|
|
2
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export interface SelectOption {
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class AeSelectComponent implements OnInit, ControlValueAccessor {
|
|
9
|
-
private elRef;
|
|
10
|
-
private r;
|
|
11
|
-
options: SelectOption[];
|
|
12
|
-
isHidden: boolean;
|
|
13
|
-
selectedOption: SelectOption;
|
|
14
|
-
disabled: boolean;
|
|
15
|
-
optionId: number;
|
|
16
|
-
get label(): string;
|
|
17
|
-
opened: boolean;
|
|
18
|
-
get value(): string;
|
|
19
|
-
hidden: string;
|
|
20
|
-
changeEvent: EventEmitter<any>;
|
|
21
|
-
labelButton: ElementRef;
|
|
22
|
-
constructor(elRef: ElementRef, r: Renderer2);
|
|
23
|
-
ngOnInit(): void;
|
|
24
|
-
hide(): void;
|
|
25
|
-
optionSelect(option: SelectOption, event: MouseEvent): void;
|
|
26
|
-
toggleOpen(event: MouseEvent): void;
|
|
27
|
-
onClick($event: MouseEvent): void;
|
|
28
|
-
close(): void;
|
|
29
|
-
get isOpen(): boolean;
|
|
30
|
-
writeValue(value: any): void;
|
|
31
|
-
setValue(value: any): void;
|
|
32
|
-
onChange: any;
|
|
33
|
-
onTouched: any;
|
|
34
|
-
registerOnChange(fn: any): void;
|
|
35
|
-
registerOnTouched(fn: any): void;
|
|
36
|
-
setDisabledState(isDisabled: boolean): void;
|
|
37
|
-
handleKeyDown($event: KeyboardEvent): void;
|
|
38
|
-
_handleArrowDown($event: any): void;
|
|
39
|
-
_handleArrowUp($event: any): void;
|
|
40
|
-
_handleSpace($event: any): void;
|
|
41
|
-
_handleEnter($event: any): void;
|
|
42
|
-
_handleTab($event: any): void;
|
|
43
|
-
_handleBackspace(): void;
|
|
44
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AeSelectComponent, never>;
|
|
45
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AeSelectComponent, "ae-select", never, { "options": "options"; "isHidden": "hidden"; }, { "changeEvent": "change"; }, never, never>;
|
|
46
|
-
}
|
|
1
|
+
import { ElementRef, EventEmitter, OnInit, Renderer2 } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export interface SelectOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class AeSelectComponent implements OnInit, ControlValueAccessor {
|
|
9
|
+
private elRef;
|
|
10
|
+
private r;
|
|
11
|
+
options: SelectOption[];
|
|
12
|
+
isHidden: boolean;
|
|
13
|
+
selectedOption: SelectOption;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
optionId: number;
|
|
16
|
+
get label(): string;
|
|
17
|
+
opened: boolean;
|
|
18
|
+
get value(): string;
|
|
19
|
+
hidden: string;
|
|
20
|
+
changeEvent: EventEmitter<any>;
|
|
21
|
+
labelButton: ElementRef;
|
|
22
|
+
constructor(elRef: ElementRef, r: Renderer2);
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
hide(): void;
|
|
25
|
+
optionSelect(option: SelectOption, event: MouseEvent): void;
|
|
26
|
+
toggleOpen(event: MouseEvent): void;
|
|
27
|
+
onClick($event: MouseEvent): void;
|
|
28
|
+
close(): void;
|
|
29
|
+
get isOpen(): boolean;
|
|
30
|
+
writeValue(value: any): void;
|
|
31
|
+
setValue(value: any): void;
|
|
32
|
+
onChange: any;
|
|
33
|
+
onTouched: any;
|
|
34
|
+
registerOnChange(fn: any): void;
|
|
35
|
+
registerOnTouched(fn: any): void;
|
|
36
|
+
setDisabledState(isDisabled: boolean): void;
|
|
37
|
+
handleKeyDown($event: KeyboardEvent): void;
|
|
38
|
+
_handleArrowDown($event: any): void;
|
|
39
|
+
_handleArrowUp($event: any): void;
|
|
40
|
+
_handleSpace($event: any): void;
|
|
41
|
+
_handleEnter($event: any): void;
|
|
42
|
+
_handleTab($event: any): void;
|
|
43
|
+
_handleBackspace(): void;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AeSelectComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AeSelectComponent, "ae-select", never, { "options": "options"; "isHidden": "hidden"; }, { "changeEvent": "change"; }, never, never>;
|
|
46
|
+
}
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { ElementRef, EventEmitter, Renderer2 } from '@angular/core';
|
|
2
|
-
import { AngularEditorService, UploadResponse } from '
|
|
3
|
-
import {
|
|
4
|
-
import { CustomClass } from '
|
|
5
|
-
import { SelectOption } from '
|
|
6
|
-
import { Observable } from 'rxjs';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class
|
|
9
|
-
private r;
|
|
10
|
-
private editorService;
|
|
11
|
-
private er;
|
|
12
|
-
private doc;
|
|
13
|
-
htmlMode: boolean;
|
|
14
|
-
linkSelected: boolean;
|
|
15
|
-
block: string;
|
|
16
|
-
fontName: string;
|
|
17
|
-
fontSize: string;
|
|
18
|
-
foreColour: any;
|
|
19
|
-
backColor: any;
|
|
20
|
-
headings: SelectOption[];
|
|
21
|
-
fontSizes: SelectOption[];
|
|
22
|
-
customClassId: string;
|
|
23
|
-
_customClasses: CustomClass[];
|
|
24
|
-
customClassList: SelectOption[];
|
|
25
|
-
tagMap: {
|
|
26
|
-
BLOCKQUOTE: string;
|
|
27
|
-
A: string;
|
|
28
|
-
};
|
|
29
|
-
select: string[];
|
|
30
|
-
buttons: string[];
|
|
31
|
-
id: string;
|
|
32
|
-
uploadUrl: string;
|
|
33
|
-
upload: (file: File) => Observable<HttpEvent<UploadResponse>>;
|
|
34
|
-
showToolbar: boolean;
|
|
35
|
-
fonts: SelectOption[];
|
|
36
|
-
set customClasses(classes: CustomClass[]);
|
|
37
|
-
set defaultFontName(value: string);
|
|
38
|
-
set defaultFontSize(value: string);
|
|
39
|
-
hiddenButtons: string[][];
|
|
40
|
-
execute: EventEmitter<string>;
|
|
41
|
-
myInputFile: ElementRef;
|
|
42
|
-
get isLinkButtonDisabled(): boolean;
|
|
43
|
-
constructor(r: Renderer2, editorService: AngularEditorService, er: ElementRef, doc: any);
|
|
44
|
-
/**
|
|
45
|
-
* Trigger command from editor header buttons
|
|
46
|
-
* @param command string from toolbar buttons
|
|
47
|
-
*/
|
|
48
|
-
triggerCommand(command: string): void;
|
|
49
|
-
/**
|
|
50
|
-
* highlight editor buttons when cursor moved or positioning
|
|
51
|
-
*/
|
|
52
|
-
triggerButtons(): void;
|
|
53
|
-
/**
|
|
54
|
-
* trigger highlight editor buttons when cursor moved or positioning in block
|
|
55
|
-
*/
|
|
56
|
-
triggerBlocks(nodes: Node[]): void;
|
|
57
|
-
/**
|
|
58
|
-
* insert URL link
|
|
59
|
-
*/
|
|
60
|
-
insertUrl(): void;
|
|
61
|
-
/**
|
|
62
|
-
* insert Video link
|
|
63
|
-
*/
|
|
64
|
-
insertVideo(): void;
|
|
65
|
-
/** insert color */
|
|
66
|
-
insertColor(color: string, where: string): void;
|
|
67
|
-
/**
|
|
68
|
-
* set font Name/family
|
|
69
|
-
* @param foreColor string
|
|
70
|
-
*/
|
|
71
|
-
setFontName(foreColor: string): void;
|
|
72
|
-
/**
|
|
73
|
-
* set font Size
|
|
74
|
-
* @param fontSize string
|
|
75
|
-
*/
|
|
76
|
-
setFontSize(fontSize: string): void;
|
|
77
|
-
/**
|
|
78
|
-
* toggle editor mode (WYSIWYG or SOURCE)
|
|
79
|
-
* @param m boolean
|
|
80
|
-
*/
|
|
81
|
-
setEditorMode(m: boolean): void;
|
|
82
|
-
/**
|
|
83
|
-
* Upload image when file is selected.
|
|
84
|
-
*/
|
|
85
|
-
onFileChanged(event: any): void;
|
|
86
|
-
watchUploadImage(response: HttpResponse<{
|
|
87
|
-
imageUrl: string;
|
|
88
|
-
}>, event: any): void;
|
|
89
|
-
/**
|
|
90
|
-
* Set custom class
|
|
91
|
-
*/
|
|
92
|
-
setCustomClass(classId: string): void;
|
|
93
|
-
isButtonHidden(name: string): boolean;
|
|
94
|
-
focus(): void;
|
|
95
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
96
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
97
|
-
}
|
|
1
|
+
import { ElementRef, EventEmitter, Renderer2 } from '@angular/core';
|
|
2
|
+
import { AngularEditorService, UploadResponse } from '../angular-editor.service';
|
|
3
|
+
import { HttpEvent, HttpResponse } from '@angular/common/http';
|
|
4
|
+
import { CustomClass } from '../config';
|
|
5
|
+
import { SelectOption } from '../ae-select/ae-select.component';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class AeToolbarComponent {
|
|
9
|
+
private r;
|
|
10
|
+
private editorService;
|
|
11
|
+
private er;
|
|
12
|
+
private doc;
|
|
13
|
+
htmlMode: boolean;
|
|
14
|
+
linkSelected: boolean;
|
|
15
|
+
block: string;
|
|
16
|
+
fontName: string;
|
|
17
|
+
fontSize: string;
|
|
18
|
+
foreColour: any;
|
|
19
|
+
backColor: any;
|
|
20
|
+
headings: SelectOption[];
|
|
21
|
+
fontSizes: SelectOption[];
|
|
22
|
+
customClassId: string;
|
|
23
|
+
_customClasses: CustomClass[];
|
|
24
|
+
customClassList: SelectOption[];
|
|
25
|
+
tagMap: {
|
|
26
|
+
BLOCKQUOTE: string;
|
|
27
|
+
A: string;
|
|
28
|
+
};
|
|
29
|
+
select: string[];
|
|
30
|
+
buttons: string[];
|
|
31
|
+
id: string;
|
|
32
|
+
uploadUrl: string;
|
|
33
|
+
upload: (file: File) => Observable<HttpEvent<UploadResponse>>;
|
|
34
|
+
showToolbar: boolean;
|
|
35
|
+
fonts: SelectOption[];
|
|
36
|
+
set customClasses(classes: CustomClass[]);
|
|
37
|
+
set defaultFontName(value: string);
|
|
38
|
+
set defaultFontSize(value: string);
|
|
39
|
+
hiddenButtons: string[][];
|
|
40
|
+
execute: EventEmitter<string>;
|
|
41
|
+
myInputFile: ElementRef;
|
|
42
|
+
get isLinkButtonDisabled(): boolean;
|
|
43
|
+
constructor(r: Renderer2, editorService: AngularEditorService, er: ElementRef, doc: any);
|
|
44
|
+
/**
|
|
45
|
+
* Trigger command from editor header buttons
|
|
46
|
+
* @param command string from toolbar buttons
|
|
47
|
+
*/
|
|
48
|
+
triggerCommand(command: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* highlight editor buttons when cursor moved or positioning
|
|
51
|
+
*/
|
|
52
|
+
triggerButtons(): void;
|
|
53
|
+
/**
|
|
54
|
+
* trigger highlight editor buttons when cursor moved or positioning in block
|
|
55
|
+
*/
|
|
56
|
+
triggerBlocks(nodes: Node[]): void;
|
|
57
|
+
/**
|
|
58
|
+
* insert URL link
|
|
59
|
+
*/
|
|
60
|
+
insertUrl(): void;
|
|
61
|
+
/**
|
|
62
|
+
* insert Video link
|
|
63
|
+
*/
|
|
64
|
+
insertVideo(): void;
|
|
65
|
+
/** insert color */
|
|
66
|
+
insertColor(color: string, where: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* set font Name/family
|
|
69
|
+
* @param foreColor string
|
|
70
|
+
*/
|
|
71
|
+
setFontName(foreColor: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* set font Size
|
|
74
|
+
* @param fontSize string
|
|
75
|
+
*/
|
|
76
|
+
setFontSize(fontSize: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* toggle editor mode (WYSIWYG or SOURCE)
|
|
79
|
+
* @param m boolean
|
|
80
|
+
*/
|
|
81
|
+
setEditorMode(m: boolean): void;
|
|
82
|
+
/**
|
|
83
|
+
* Upload image when file is selected.
|
|
84
|
+
*/
|
|
85
|
+
onFileChanged(event: any): void;
|
|
86
|
+
watchUploadImage(response: HttpResponse<{
|
|
87
|
+
imageUrl: string;
|
|
88
|
+
}>, event: any): void;
|
|
89
|
+
/**
|
|
90
|
+
* Set custom class
|
|
91
|
+
*/
|
|
92
|
+
setCustomClass(classId: string): void;
|
|
93
|
+
isButtonHidden(name: string): boolean;
|
|
94
|
+
focus(): void;
|
|
95
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AeToolbarComponent, never>;
|
|
96
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AeToolbarComponent, "angular-editor-toolbar, ae-toolbar, div[aeToolbar]", never, { "id": "id"; "uploadUrl": "uploadUrl"; "upload": "upload"; "showToolbar": "showToolbar"; "fonts": "fonts"; "customClasses": "customClasses"; "defaultFontName": "defaultFontName"; "defaultFontSize": "defaultFontSize"; "hiddenButtons": "hiddenButtons"; }, { "execute": "execute"; }, never, ["*"]>;
|
|
97
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class AeToolbarSetComponent {
|
|
3
|
-
constructor();
|
|
4
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AeToolbarSetComponent, never>;
|
|
5
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AeToolbarSetComponent, "ae-toolbar-set", never, {}, {}, never, ["*"]>;
|
|
6
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class AeToolbarSetComponent {
|
|
3
|
+
constructor();
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AeToolbarSetComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AeToolbarSetComponent, "ae-toolbar-set, [aeToolbarSet]", never, {}, {}, never, ["*"]>;
|
|
6
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./angular-editor.component";
|
|
3
|
-
import * as i2 from "./
|
|
4
|
-
import * as i3 from "./ae-select/ae-select.component";
|
|
5
|
-
import * as i4 from "./ae-button/ae-button.component";
|
|
6
|
-
import * as i5 from "./ae-toolbar-set/ae-toolbar-set.component";
|
|
7
|
-
import * as i6 from "@angular/common";
|
|
8
|
-
import * as i7 from "@angular/forms";
|
|
9
|
-
export declare class AngularEditorModule {
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AngularEditorModule, never>;
|
|
11
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularEditorModule, [typeof i1.AngularEditorComponent, typeof i2.
|
|
12
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<AngularEditorModule>;
|
|
13
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./editor/angular-editor.component";
|
|
3
|
+
import * as i2 from "./ae-toolbar/ae-toolbar.component";
|
|
4
|
+
import * as i3 from "./ae-select/ae-select.component";
|
|
5
|
+
import * as i4 from "./ae-button/ae-button.component";
|
|
6
|
+
import * as i5 from "./ae-toolbar-set/ae-toolbar-set.component";
|
|
7
|
+
import * as i6 from "@angular/common";
|
|
8
|
+
import * as i7 from "@angular/forms";
|
|
9
|
+
export declare class AngularEditorModule {
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularEditorModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularEditorModule, [typeof i1.AngularEditorComponent, typeof i2.AeToolbarComponent, typeof i3.AeSelectComponent, typeof i4.AeButtonComponent, typeof i5.AeToolbarSetComponent], [typeof i6.CommonModule, typeof i7.FormsModule, typeof i7.ReactiveFormsModule], [typeof i1.AngularEditorComponent, typeof i2.AeToolbarComponent, typeof i4.AeButtonComponent, typeof i5.AeToolbarSetComponent]>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AngularEditorModule>;
|
|
13
|
+
}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { HttpClient, HttpEvent } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { CustomClass } from './config';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export interface UploadResponse {
|
|
6
|
-
imageUrl: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class AngularEditorService {
|
|
9
|
-
private http;
|
|
10
|
-
private doc;
|
|
11
|
-
savedSelection: Range | null;
|
|
12
|
-
selectedText: string;
|
|
13
|
-
uploadUrl: string;
|
|
14
|
-
uploadWithCredentials: boolean;
|
|
15
|
-
constructor(http: HttpClient, doc: any);
|
|
16
|
-
/**
|
|
17
|
-
* Executed command from editor header buttons exclude toggleEditorMode
|
|
18
|
-
* @param command string from triggerCommand
|
|
19
|
-
* @param value
|
|
20
|
-
*/
|
|
21
|
-
executeCommand(command: string, value?: string): void;
|
|
22
|
-
/**
|
|
23
|
-
* Create URL link
|
|
24
|
-
* @param url string from UI prompt
|
|
25
|
-
*/
|
|
26
|
-
createLink(url: string): void;
|
|
27
|
-
/**
|
|
28
|
-
* insert color either font or background
|
|
29
|
-
*
|
|
30
|
-
* @param color color to be inserted
|
|
31
|
-
* @param where where the color has to be inserted either text/background
|
|
32
|
-
*/
|
|
33
|
-
insertColor(color: string, where: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Set font name
|
|
36
|
-
* @param fontName string
|
|
37
|
-
*/
|
|
38
|
-
setFontName(fontName: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Set font size
|
|
41
|
-
* @param fontSize string
|
|
42
|
-
*/
|
|
43
|
-
setFontSize(fontSize: string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Create raw HTML
|
|
46
|
-
* @param html HTML string
|
|
47
|
-
*/
|
|
48
|
-
insertHtml(html: string): void;
|
|
49
|
-
/**
|
|
50
|
-
* save selection when the editor is focussed out
|
|
51
|
-
*/
|
|
52
|
-
saveSelection: () => void;
|
|
53
|
-
/**
|
|
54
|
-
* restore selection when the editor is focused in
|
|
55
|
-
*
|
|
56
|
-
* saved selection when the editor is focused out
|
|
57
|
-
*/
|
|
58
|
-
restoreSelection(): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* setTimeout used for execute 'saveSelection' method in next event loop iteration
|
|
61
|
-
*/
|
|
62
|
-
executeInNextQueueIteration(callbackFn: (...args: any[]) => any, timeout?: number): void;
|
|
63
|
-
/** check any selection is made or not */
|
|
64
|
-
private checkSelection;
|
|
65
|
-
/**
|
|
66
|
-
* Upload file to uploadUrl
|
|
67
|
-
* @param file The file
|
|
68
|
-
*/
|
|
69
|
-
uploadImage(file: File): Observable<HttpEvent<UploadResponse>>;
|
|
70
|
-
/**
|
|
71
|
-
* Insert image with Url
|
|
72
|
-
* @param imageUrl The imageUrl.
|
|
73
|
-
*/
|
|
74
|
-
insertImage(imageUrl: string): void;
|
|
75
|
-
setDefaultParagraphSeparator(separator: string): void;
|
|
76
|
-
createCustomClass(customClass: CustomClass): void;
|
|
77
|
-
insertVideo(videoUrl: string): void;
|
|
78
|
-
private insertYouTubeVideoTag;
|
|
79
|
-
private insertVimeoVideoTag;
|
|
80
|
-
nextNode(node: any): any;
|
|
81
|
-
getRangeSelectedNodes(range: any, includePartiallySelectedContainers: any): any[];
|
|
82
|
-
getSelectedNodes(): any[];
|
|
83
|
-
replaceWithOwnChildren(el: any): void;
|
|
84
|
-
removeSelectedElements(tagNames: any): void;
|
|
85
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AngularEditorService, never>;
|
|
86
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AngularEditorService>;
|
|
87
|
-
}
|
|
1
|
+
import { HttpClient, HttpEvent } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { CustomClass } from './config';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface UploadResponse {
|
|
6
|
+
imageUrl: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class AngularEditorService {
|
|
9
|
+
private http;
|
|
10
|
+
private doc;
|
|
11
|
+
savedSelection: Range | null;
|
|
12
|
+
selectedText: string;
|
|
13
|
+
uploadUrl: string;
|
|
14
|
+
uploadWithCredentials: boolean;
|
|
15
|
+
constructor(http: HttpClient, doc: any);
|
|
16
|
+
/**
|
|
17
|
+
* Executed command from editor header buttons exclude toggleEditorMode
|
|
18
|
+
* @param command string from triggerCommand
|
|
19
|
+
* @param value
|
|
20
|
+
*/
|
|
21
|
+
executeCommand(command: string, value?: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Create URL link
|
|
24
|
+
* @param url string from UI prompt
|
|
25
|
+
*/
|
|
26
|
+
createLink(url: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* insert color either font or background
|
|
29
|
+
*
|
|
30
|
+
* @param color color to be inserted
|
|
31
|
+
* @param where where the color has to be inserted either text/background
|
|
32
|
+
*/
|
|
33
|
+
insertColor(color: string, where: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Set font name
|
|
36
|
+
* @param fontName string
|
|
37
|
+
*/
|
|
38
|
+
setFontName(fontName: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Set font size
|
|
41
|
+
* @param fontSize string
|
|
42
|
+
*/
|
|
43
|
+
setFontSize(fontSize: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Create raw HTML
|
|
46
|
+
* @param html HTML string
|
|
47
|
+
*/
|
|
48
|
+
insertHtml(html: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* save selection when the editor is focussed out
|
|
51
|
+
*/
|
|
52
|
+
saveSelection: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* restore selection when the editor is focused in
|
|
55
|
+
*
|
|
56
|
+
* saved selection when the editor is focused out
|
|
57
|
+
*/
|
|
58
|
+
restoreSelection(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* setTimeout used for execute 'saveSelection' method in next event loop iteration
|
|
61
|
+
*/
|
|
62
|
+
executeInNextQueueIteration(callbackFn: (...args: any[]) => any, timeout?: number): void;
|
|
63
|
+
/** check any selection is made or not */
|
|
64
|
+
private checkSelection;
|
|
65
|
+
/**
|
|
66
|
+
* Upload file to uploadUrl
|
|
67
|
+
* @param file The file
|
|
68
|
+
*/
|
|
69
|
+
uploadImage(file: File): Observable<HttpEvent<UploadResponse>>;
|
|
70
|
+
/**
|
|
71
|
+
* Insert image with Url
|
|
72
|
+
* @param imageUrl The imageUrl.
|
|
73
|
+
*/
|
|
74
|
+
insertImage(imageUrl: string): void;
|
|
75
|
+
setDefaultParagraphSeparator(separator: string): void;
|
|
76
|
+
createCustomClass(customClass: CustomClass): void;
|
|
77
|
+
insertVideo(videoUrl: string): void;
|
|
78
|
+
private insertYouTubeVideoTag;
|
|
79
|
+
private insertVimeoVideoTag;
|
|
80
|
+
nextNode(node: any): any;
|
|
81
|
+
getRangeSelectedNodes(range: any, includePartiallySelectedContainers: any): any[];
|
|
82
|
+
getSelectedNodes(): any[];
|
|
83
|
+
replaceWithOwnChildren(el: any): void;
|
|
84
|
+
removeSelectedElements(tagNames: any): void;
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularEditorService, never>;
|
|
86
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AngularEditorService>;
|
|
87
|
+
}
|
package/lib/config.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { UploadResponse } from './angular-editor.service';
|
|
2
|
-
import { HttpEvent } from '@angular/common/http';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
export interface CustomClass {
|
|
5
|
-
name: string;
|
|
6
|
-
class: string;
|
|
7
|
-
tag?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface Font {
|
|
10
|
-
name: string;
|
|
11
|
-
class: string;
|
|
12
|
-
}
|
|
13
|
-
export interface AngularEditorConfig {
|
|
14
|
-
editable?: boolean;
|
|
15
|
-
spellcheck?: boolean;
|
|
16
|
-
height?: 'auto' | string;
|
|
17
|
-
minHeight?: '0' | string;
|
|
18
|
-
maxHeight?: 'auto' | string;
|
|
19
|
-
width?: 'auto' | string;
|
|
20
|
-
minWidth?: '0' | string;
|
|
21
|
-
translate?: 'yes' | 'now' | string;
|
|
22
|
-
enableToolbar?: boolean;
|
|
23
|
-
showToolbar?: boolean;
|
|
24
|
-
placeholder?: string;
|
|
25
|
-
defaultParagraphSeparator?: string;
|
|
26
|
-
defaultFontName?: string;
|
|
27
|
-
defaultFontSize?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | string;
|
|
28
|
-
uploadUrl?: string;
|
|
29
|
-
upload?: (file: File) => Observable<HttpEvent<UploadResponse>>;
|
|
30
|
-
uploadWithCredentials?: boolean;
|
|
31
|
-
fonts?: Font[];
|
|
32
|
-
customClasses?: CustomClass[];
|
|
33
|
-
sanitize?: boolean;
|
|
34
|
-
toolbarPosition?: 'top' | 'bottom';
|
|
35
|
-
outline?: boolean;
|
|
36
|
-
toolbarHiddenButtons?: string[][];
|
|
37
|
-
rawPaste?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export declare const angularEditorConfig: AngularEditorConfig;
|
|
1
|
+
import { UploadResponse } from './angular-editor.service';
|
|
2
|
+
import { HttpEvent } from '@angular/common/http';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
export interface CustomClass {
|
|
5
|
+
name: string;
|
|
6
|
+
class: string;
|
|
7
|
+
tag?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Font {
|
|
10
|
+
name: string;
|
|
11
|
+
class: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AngularEditorConfig {
|
|
14
|
+
editable?: boolean;
|
|
15
|
+
spellcheck?: boolean;
|
|
16
|
+
height?: 'auto' | string;
|
|
17
|
+
minHeight?: '0' | string;
|
|
18
|
+
maxHeight?: 'auto' | string;
|
|
19
|
+
width?: 'auto' | string;
|
|
20
|
+
minWidth?: '0' | string;
|
|
21
|
+
translate?: 'yes' | 'now' | string;
|
|
22
|
+
enableToolbar?: boolean;
|
|
23
|
+
showToolbar?: boolean;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
defaultParagraphSeparator?: string;
|
|
26
|
+
defaultFontName?: string;
|
|
27
|
+
defaultFontSize?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | string;
|
|
28
|
+
uploadUrl?: string;
|
|
29
|
+
upload?: (file: File) => Observable<HttpEvent<UploadResponse>>;
|
|
30
|
+
uploadWithCredentials?: boolean;
|
|
31
|
+
fonts?: Font[];
|
|
32
|
+
customClasses?: CustomClass[];
|
|
33
|
+
sanitize?: boolean;
|
|
34
|
+
toolbarPosition?: 'top' | 'bottom';
|
|
35
|
+
outline?: boolean;
|
|
36
|
+
toolbarHiddenButtons?: string[][];
|
|
37
|
+
rawPaste?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const angularEditorConfig: AngularEditorConfig;
|