@kolkov/angular-editor 3.0.0-beta.1 → 3.0.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 (35) hide show
  1. package/CHANGELOG.md +57 -1
  2. package/README.md +75 -16
  3. package/assets/icons/icons.svg +2 -2
  4. package/fesm2022/kolkov-angular-editor.mjs +1360 -0
  5. package/fesm2022/kolkov-angular-editor.mjs.map +1 -0
  6. package/index.d.ts +412 -0
  7. package/package.json +10 -16
  8. package/themes/default.scss +22 -0
  9. package/esm2020/kolkov-angular-editor.mjs +0 -5
  10. package/esm2020/lib/ae-button/ae-button.component.mjs +0 -21
  11. package/esm2020/lib/ae-select/ae-select.component.mjs +0 -185
  12. package/esm2020/lib/ae-toolbar-set/ae-toolbar-set.component.mjs +0 -14
  13. package/esm2020/lib/angular-editor-toolbar.component.mjs +0 -365
  14. package/esm2020/lib/angular-editor.component.mjs +0 -415
  15. package/esm2020/lib/angular-editor.module.mjs +0 -27
  16. package/esm2020/lib/angular-editor.service.mjs +0 -275
  17. package/esm2020/lib/config.mjs +0 -36
  18. package/esm2020/lib/utils.mjs +0 -4
  19. package/esm2020/public-api.mjs +0 -11
  20. package/fesm2015/kolkov-angular-editor.mjs +0 -1324
  21. package/fesm2015/kolkov-angular-editor.mjs.map +0 -1
  22. package/fesm2020/kolkov-angular-editor.mjs +0 -1318
  23. package/fesm2020/kolkov-angular-editor.mjs.map +0 -1
  24. package/kolkov-angular-editor.d.ts +0 -5
  25. package/lib/ae-button/ae-button.component.d.ts +0 -7
  26. package/lib/ae-select/ae-select.component.d.ts +0 -46
  27. package/lib/ae-toolbar-set/ae-toolbar-set.component.d.ts +0 -6
  28. package/lib/angular-editor-toolbar.component.d.ts +0 -97
  29. package/lib/angular-editor.component.d.ts +0 -133
  30. package/lib/angular-editor.module.d.ts +0 -13
  31. package/lib/angular-editor.service.d.ts +0 -87
  32. package/lib/config.d.ts +0 -39
  33. package/lib/utils.d.ts +0 -1
  34. package/public-api.d.ts +0 -8
  35. package/src/lib/style.scss +0 -290
@@ -1,87 +0,0 @@
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 DELETED
@@ -1,39 +0,0 @@
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;
package/lib/utils.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function isDefined(value: any): boolean;
package/public-api.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './lib/angular-editor.service';
2
- export * from './lib/angular-editor.component';
3
- export * from './lib/ae-button/ae-button.component';
4
- export * from './lib/ae-toolbar-set/ae-toolbar-set.component';
5
- export * from './lib/ae-select/ae-select.component';
6
- export * from './lib/angular-editor-toolbar.component';
7
- export * from './lib/angular-editor.module';
8
- export { AngularEditorConfig, CustomClass } from './lib/config';
@@ -1,290 +0,0 @@
1
- a {
2
- cursor: pointer;
3
- }
4
-
5
- .angular-editor-textarea {
6
- min-height: 150px;
7
- overflow: auto;
8
- margin-top: 5px;
9
- resize: vertical;
10
- &:after {
11
- content:"";
12
- position: absolute;
13
- bottom: 0;
14
- right:0;
15
- display:block;
16
- width:8px;
17
- height:8px;
18
- cursor: nwse-resize;
19
- background-color: rgba(255,255,255,0.5)
20
- }
21
- }
22
-
23
- .angular-editor-toolbar {
24
- font: 100 14px/15px Roboto, Arial, sans-serif;
25
- background-color: #f5f5f5;
26
- font-size: 0.8rem;
27
- padding: 0.2rem;
28
- border: 1px solid #ddd;
29
- display: flex;
30
- flex-wrap: wrap;
31
- gap: 4px;
32
-
33
- .angular-editor-toolbar-set {
34
- display: flex;
35
- gap: 1px;
36
- width: fit-content;
37
- vertical-align: baseline;
38
- .angular-editor-button {
39
- background-color: white;
40
- vertical-align: middle;
41
- border: 1px solid #ddd;
42
- padding: 0.4rem;
43
- float: left;
44
- width: 2rem;
45
- height: 2rem;
46
-
47
- &:hover {
48
- cursor: pointer;
49
- background-color: #f1f1f1;
50
- transition: 0.2s ease;
51
- }
52
-
53
- &:focus,
54
- &.focus {
55
- outline: 0;
56
- }
57
-
58
- &:disabled {
59
- background-color: #f5f5f5;
60
- pointer-events: none;
61
- cursor: not-allowed;
62
-
63
- > .color-label {
64
- pointer-events: none;
65
- cursor: not-allowed;
66
-
67
- &.foreground {
68
- :after {
69
- background: #555555;
70
- }
71
- }
72
-
73
- &.background {
74
- background: #555555;
75
- }
76
- }
77
- }
78
-
79
- &.active {
80
- background: #fff5b9;
81
-
82
- &:hover {
83
- background-color: #fffa98;
84
- }
85
- }
86
- }
87
-
88
- select {
89
- font-size: 11px;
90
- width: 90px;
91
- vertical-align: middle;
92
- background-color: transparent;
93
- border: 0.5px solid rgba(255, 255, 255, 0);
94
- border-radius: 5px;
95
- outline: none;
96
- padding: 0.4rem;
97
- cursor: pointer;
98
- }
99
-
100
- .select-heading {
101
- display: inline-block;
102
- width: 90px;
103
- @supports not( -moz-appearance:none ) {
104
- optgroup {
105
- font-size: 12px;
106
- background-color: #f4f4f4;
107
- padding: 5px;
108
- }
109
- option {
110
- border: 1px solid;
111
- background-color: white;
112
- }
113
- .default {
114
- font-size: 16px;
115
- }
116
- .h1 {
117
- font-size: 24px;
118
- }
119
- .h2 {
120
- font-size: 20px;
121
- }
122
- .h3 {
123
- font-size: 16px;
124
- }
125
- .h4 {
126
- font-size: 15px;
127
- }
128
- .h5 {
129
- font-size: 14px;
130
- }
131
- .h6 {
132
- font-size: 13px;
133
- }
134
- .div {
135
- font-size: 12px;
136
- }
137
- .pre {
138
- font-size: 12px;
139
- }
140
- }
141
-
142
- &:disabled {
143
- background-color: #f5f5f5;
144
- pointer-events: none;
145
- cursor: not-allowed;
146
- }
147
-
148
- &:hover {
149
- cursor: pointer;
150
- background-color: #f1f1f1;
151
- transition: 0.2s ease;
152
- }
153
- }
154
-
155
- .select-font {
156
- display: inline-block;
157
- width: 90px;
158
- @supports not( -moz-appearance:none ) {
159
- optgroup {
160
- font-size: 12px;
161
- background-color: #f4f4f4;
162
- padding: 5px;
163
- }
164
- option {
165
- border: 1px solid;
166
- background-color: white;
167
- }
168
- }
169
-
170
- &:disabled {
171
- background-color: #f5f5f5;
172
- pointer-events: none;
173
- cursor: not-allowed;
174
- }
175
-
176
- &:hover {
177
- cursor: pointer;
178
- background-color: #f1f1f1;
179
- transition: 0.2s ease;
180
- }
181
- }
182
-
183
- .select-font-size {
184
- display: inline-block;
185
- width: 50px;
186
- @supports not( -moz-appearance:none ) {
187
- optgroup {
188
- font-size: 12px;
189
- background-color: #f4f4f4;
190
- padding: 5px;
191
- }
192
- option {
193
- border: 1px solid;
194
- background-color: white;
195
- }
196
- .size1 {
197
- font-size: 10px;
198
- }
199
- .size2 {
200
- font-size: 12px;
201
- }
202
- .size3 {
203
- font-size: 14px;
204
- }
205
- .size4 {
206
- font-size: 16px;
207
- }
208
- .size5 {
209
- font-size: 18px;
210
- }
211
- .size6 {
212
- font-size: 20px;
213
- }
214
- .size7 {
215
- font-size: 22px;
216
- }
217
- }
218
-
219
- &:disabled {
220
- background-color: #f5f5f5;
221
- pointer-events: none;
222
- cursor: not-allowed;
223
- }
224
-
225
- &:hover {
226
- cursor: pointer;
227
- background-color: #f1f1f1;
228
- transition: 0.2s ease;
229
- }
230
- }
231
-
232
- .select-custom-style {
233
- display: inline-block;
234
- width: 90px;
235
- @supports not( -moz-appearance:none ) {
236
- optgroup {
237
- font-size: 12px;
238
- background-color: #f4f4f4;
239
- padding: 5px;
240
- }
241
- option {
242
- border: 1px solid;
243
- background-color: white;
244
- }
245
- }
246
-
247
- &:disabled {
248
- background-color: #f5f5f5;
249
- pointer-events: none;
250
- cursor: not-allowed;
251
- }
252
-
253
- &:hover {
254
- cursor: pointer;
255
- background-color: #f1f1f1;
256
- transition: 0.2s ease;
257
- }
258
- }
259
-
260
- .color-label {
261
- position: relative;
262
- cursor: pointer;
263
- }
264
-
265
- .background {
266
- font-size: smaller;
267
- background: #1b1b1b;
268
- color: white;
269
- padding: 3px;
270
- }
271
-
272
- .foreground {
273
- :after {
274
- position: absolute;
275
- content: "";
276
- left: -1px;
277
- top: auto;
278
- bottom: -3px;
279
- right: auto;
280
- width: 15px;
281
- height: 2px;
282
- z-index: 0;
283
- background: #1b1b1b;
284
- }
285
- }
286
- }
287
- .angular-editor-toolbar-set:not([style*="display:none"]):not([style*="display: none"]){
288
- //display: inline-block;
289
- }
290
- }