@flogeez/angular-tiptap-editor 0.2.7 → 0.3.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/index.d.ts
CHANGED
|
@@ -3,102 +3,6 @@ import * as _angular_core from '@angular/core';
|
|
|
3
3
|
import { AfterViewInit, OnDestroy, ElementRef } from '@angular/core';
|
|
4
4
|
import { ControlValueAccessor } from '@angular/forms';
|
|
5
5
|
|
|
6
|
-
interface SlashCommandItem {
|
|
7
|
-
title: string;
|
|
8
|
-
description: string;
|
|
9
|
-
icon: string;
|
|
10
|
-
keywords: string[];
|
|
11
|
-
command: (editor: Editor) => void;
|
|
12
|
-
}
|
|
13
|
-
interface SlashCommandsConfig {
|
|
14
|
-
commands?: SlashCommandItem[];
|
|
15
|
-
}
|
|
16
|
-
declare const DEFAULT_SLASH_COMMANDS: SlashCommandItem[];
|
|
17
|
-
|
|
18
|
-
interface ImageData {
|
|
19
|
-
src: string;
|
|
20
|
-
alt?: string;
|
|
21
|
-
title?: string;
|
|
22
|
-
width?: number;
|
|
23
|
-
height?: number;
|
|
24
|
-
}
|
|
25
|
-
interface ImageUploadResult {
|
|
26
|
-
src: string;
|
|
27
|
-
name: string;
|
|
28
|
-
size: number;
|
|
29
|
-
type: string;
|
|
30
|
-
width?: number;
|
|
31
|
-
height?: number;
|
|
32
|
-
originalSize?: number;
|
|
33
|
-
}
|
|
34
|
-
interface ResizeOptions {
|
|
35
|
-
width?: number;
|
|
36
|
-
height?: number;
|
|
37
|
-
maintainAspectRatio?: boolean;
|
|
38
|
-
}
|
|
39
|
-
declare class ImageService {
|
|
40
|
-
selectedImage: _angular_core.WritableSignal<ImageData | null>;
|
|
41
|
-
isImageSelected: _angular_core.Signal<boolean>;
|
|
42
|
-
isResizing: _angular_core.WritableSignal<boolean>;
|
|
43
|
-
isUploading: _angular_core.WritableSignal<boolean>;
|
|
44
|
-
uploadProgress: _angular_core.WritableSignal<number>;
|
|
45
|
-
uploadMessage: _angular_core.WritableSignal<string>;
|
|
46
|
-
private currentEditor;
|
|
47
|
-
selectImage(editor: Editor): void;
|
|
48
|
-
clearSelection(): void;
|
|
49
|
-
insertImage(editor: Editor, imageData: ImageData): void;
|
|
50
|
-
updateImageAttributes(editor: Editor, attributes: Partial<ImageData>): void;
|
|
51
|
-
resizeImage(editor: Editor, options: ResizeOptions): void;
|
|
52
|
-
resizeImageByPercentage(editor: Editor, percentage: number): void;
|
|
53
|
-
resizeImageToSmall(editor: Editor): void;
|
|
54
|
-
resizeImageToMedium(editor: Editor): void;
|
|
55
|
-
resizeImageToLarge(editor: Editor): void;
|
|
56
|
-
resizeImageToOriginal(editor: Editor): void;
|
|
57
|
-
resizeImageFreely(editor: Editor, width: number, height: number): void;
|
|
58
|
-
getImageDimensions(editor: Editor): {
|
|
59
|
-
width: number;
|
|
60
|
-
height: number;
|
|
61
|
-
} | null;
|
|
62
|
-
getNaturalImageDimensions(src: string): Promise<{
|
|
63
|
-
width: number;
|
|
64
|
-
height: number;
|
|
65
|
-
}>;
|
|
66
|
-
deleteImage(editor: Editor): void;
|
|
67
|
-
private updateSelectedImage;
|
|
68
|
-
validateImage(file: File, maxSize?: number): {
|
|
69
|
-
valid: boolean;
|
|
70
|
-
error?: string;
|
|
71
|
-
};
|
|
72
|
-
compressImage(file: File, quality?: number, maxWidth?: number, maxHeight?: number): Promise<ImageUploadResult>;
|
|
73
|
-
private uploadImageWithProgress;
|
|
74
|
-
uploadAndInsertImage(editor: Editor, file: File, options?: {
|
|
75
|
-
quality?: number;
|
|
76
|
-
maxWidth?: number;
|
|
77
|
-
maxHeight?: number;
|
|
78
|
-
}): Promise<void>;
|
|
79
|
-
private forceEditorUpdate;
|
|
80
|
-
private selectFileAndProcess;
|
|
81
|
-
selectAndUploadImage(editor: Editor, options?: {
|
|
82
|
-
quality?: number;
|
|
83
|
-
maxWidth?: number;
|
|
84
|
-
maxHeight?: number;
|
|
85
|
-
accept?: string;
|
|
86
|
-
}): Promise<void>;
|
|
87
|
-
selectAndReplaceImage(editor: Editor, options?: {
|
|
88
|
-
quality?: number;
|
|
89
|
-
maxWidth?: number;
|
|
90
|
-
maxHeight?: number;
|
|
91
|
-
accept?: string;
|
|
92
|
-
}): Promise<void>;
|
|
93
|
-
uploadAndReplaceImage(editor: Editor, file: File, options?: {
|
|
94
|
-
quality?: number;
|
|
95
|
-
maxWidth?: number;
|
|
96
|
-
maxHeight?: number;
|
|
97
|
-
}): Promise<void>;
|
|
98
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ImageService, never>;
|
|
99
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ImageService>;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
6
|
type SupportedLocale = "en" | "fr";
|
|
103
7
|
interface TiptapTranslations {
|
|
104
8
|
toolbar: {
|
|
@@ -123,8 +27,10 @@ interface TiptapTranslations {
|
|
|
123
27
|
link: string;
|
|
124
28
|
image: string;
|
|
125
29
|
horizontalRule: string;
|
|
30
|
+
table: string;
|
|
126
31
|
undo: string;
|
|
127
32
|
redo: string;
|
|
33
|
+
clear: string;
|
|
128
34
|
};
|
|
129
35
|
bubbleMenu: {
|
|
130
36
|
bold: string;
|
|
@@ -189,6 +95,24 @@ interface TiptapTranslations {
|
|
|
189
95
|
description: string;
|
|
190
96
|
keywords: string[];
|
|
191
97
|
};
|
|
98
|
+
table: {
|
|
99
|
+
title: string;
|
|
100
|
+
description: string;
|
|
101
|
+
keywords: string[];
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
table: {
|
|
105
|
+
addRowBefore: string;
|
|
106
|
+
addRowAfter: string;
|
|
107
|
+
deleteRow: string;
|
|
108
|
+
addColumnBefore: string;
|
|
109
|
+
addColumnAfter: string;
|
|
110
|
+
deleteColumn: string;
|
|
111
|
+
deleteTable: string;
|
|
112
|
+
toggleHeaderRow: string;
|
|
113
|
+
toggleHeaderColumn: string;
|
|
114
|
+
mergeCells: string;
|
|
115
|
+
splitCell: string;
|
|
192
116
|
};
|
|
193
117
|
imageUpload: {
|
|
194
118
|
selectImage: string;
|
|
@@ -208,8 +132,8 @@ interface TiptapTranslations {
|
|
|
208
132
|
};
|
|
209
133
|
editor: {
|
|
210
134
|
placeholder: string;
|
|
211
|
-
|
|
212
|
-
|
|
135
|
+
character: string;
|
|
136
|
+
word: string;
|
|
213
137
|
imageLoadError: string;
|
|
214
138
|
linkPrompt: string;
|
|
215
139
|
linkUrlPrompt: string;
|
|
@@ -255,8 +179,10 @@ declare class TiptapI18nService {
|
|
|
255
179
|
link: string;
|
|
256
180
|
image: string;
|
|
257
181
|
horizontalRule: string;
|
|
182
|
+
table: string;
|
|
258
183
|
undo: string;
|
|
259
184
|
redo: string;
|
|
185
|
+
clear: string;
|
|
260
186
|
}>;
|
|
261
187
|
readonly bubbleMenu: _angular_core.Signal<{
|
|
262
188
|
bold: string;
|
|
@@ -321,6 +247,24 @@ declare class TiptapI18nService {
|
|
|
321
247
|
description: string;
|
|
322
248
|
keywords: string[];
|
|
323
249
|
};
|
|
250
|
+
table: {
|
|
251
|
+
title: string;
|
|
252
|
+
description: string;
|
|
253
|
+
keywords: string[];
|
|
254
|
+
};
|
|
255
|
+
}>;
|
|
256
|
+
readonly table: _angular_core.Signal<{
|
|
257
|
+
addRowBefore: string;
|
|
258
|
+
addRowAfter: string;
|
|
259
|
+
deleteRow: string;
|
|
260
|
+
addColumnBefore: string;
|
|
261
|
+
addColumnAfter: string;
|
|
262
|
+
deleteColumn: string;
|
|
263
|
+
deleteTable: string;
|
|
264
|
+
toggleHeaderRow: string;
|
|
265
|
+
toggleHeaderColumn: string;
|
|
266
|
+
mergeCells: string;
|
|
267
|
+
splitCell: string;
|
|
324
268
|
}>;
|
|
325
269
|
readonly imageUpload: _angular_core.Signal<{
|
|
326
270
|
selectImage: string;
|
|
@@ -340,8 +284,8 @@ declare class TiptapI18nService {
|
|
|
340
284
|
}>;
|
|
341
285
|
readonly editor: _angular_core.Signal<{
|
|
342
286
|
placeholder: string;
|
|
343
|
-
|
|
344
|
-
|
|
287
|
+
character: string;
|
|
288
|
+
word: string;
|
|
345
289
|
imageLoadError: string;
|
|
346
290
|
linkPrompt: string;
|
|
347
291
|
linkUrlPrompt: string;
|
|
@@ -402,11 +346,158 @@ declare class TiptapI18nService {
|
|
|
402
346
|
title: string;
|
|
403
347
|
description: string;
|
|
404
348
|
keywords: string[];
|
|
349
|
+
} | {
|
|
350
|
+
title: string;
|
|
351
|
+
description: string;
|
|
352
|
+
keywords: string[];
|
|
405
353
|
};
|
|
406
354
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TiptapI18nService, never>;
|
|
407
355
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TiptapI18nService>;
|
|
408
356
|
}
|
|
409
357
|
|
|
358
|
+
interface CellBubbleMenuConfig$1 {
|
|
359
|
+
mergeCells?: boolean;
|
|
360
|
+
splitCell?: boolean;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
interface SlashCommandItem {
|
|
364
|
+
title: string;
|
|
365
|
+
description: string;
|
|
366
|
+
icon: string;
|
|
367
|
+
keywords: string[];
|
|
368
|
+
command: (editor: Editor) => void;
|
|
369
|
+
}
|
|
370
|
+
interface SlashCommandsConfig {
|
|
371
|
+
commands?: SlashCommandItem[];
|
|
372
|
+
}
|
|
373
|
+
declare const DEFAULT_SLASH_COMMANDS: SlashCommandItem[];
|
|
374
|
+
|
|
375
|
+
interface ImageData {
|
|
376
|
+
src: string;
|
|
377
|
+
alt?: string;
|
|
378
|
+
title?: string;
|
|
379
|
+
width?: number;
|
|
380
|
+
height?: number;
|
|
381
|
+
}
|
|
382
|
+
interface ImageUploadResult {
|
|
383
|
+
src: string;
|
|
384
|
+
name: string;
|
|
385
|
+
size: number;
|
|
386
|
+
type: string;
|
|
387
|
+
width?: number;
|
|
388
|
+
height?: number;
|
|
389
|
+
originalSize?: number;
|
|
390
|
+
}
|
|
391
|
+
interface ResizeOptions {
|
|
392
|
+
width?: number;
|
|
393
|
+
height?: number;
|
|
394
|
+
maintainAspectRatio?: boolean;
|
|
395
|
+
}
|
|
396
|
+
declare class ImageService {
|
|
397
|
+
selectedImage: _angular_core.WritableSignal<ImageData | null>;
|
|
398
|
+
isImageSelected: _angular_core.Signal<boolean>;
|
|
399
|
+
isResizing: _angular_core.WritableSignal<boolean>;
|
|
400
|
+
isUploading: _angular_core.WritableSignal<boolean>;
|
|
401
|
+
uploadProgress: _angular_core.WritableSignal<number>;
|
|
402
|
+
uploadMessage: _angular_core.WritableSignal<string>;
|
|
403
|
+
private currentEditor;
|
|
404
|
+
selectImage(editor: Editor): void;
|
|
405
|
+
clearSelection(): void;
|
|
406
|
+
insertImage(editor: Editor, imageData: ImageData): void;
|
|
407
|
+
updateImageAttributes(editor: Editor, attributes: Partial<ImageData>): void;
|
|
408
|
+
resizeImage(editor: Editor, options: ResizeOptions): void;
|
|
409
|
+
resizeImageByPercentage(editor: Editor, percentage: number): void;
|
|
410
|
+
resizeImageToSmall(editor: Editor): void;
|
|
411
|
+
resizeImageToMedium(editor: Editor): void;
|
|
412
|
+
resizeImageToLarge(editor: Editor): void;
|
|
413
|
+
resizeImageToOriginal(editor: Editor): void;
|
|
414
|
+
resizeImageFreely(editor: Editor, width: number, height: number): void;
|
|
415
|
+
getImageDimensions(editor: Editor): {
|
|
416
|
+
width: number;
|
|
417
|
+
height: number;
|
|
418
|
+
} | null;
|
|
419
|
+
getNaturalImageDimensions(src: string): Promise<{
|
|
420
|
+
width: number;
|
|
421
|
+
height: number;
|
|
422
|
+
}>;
|
|
423
|
+
deleteImage(editor: Editor): void;
|
|
424
|
+
private updateSelectedImage;
|
|
425
|
+
validateImage(file: File, maxSize?: number): {
|
|
426
|
+
valid: boolean;
|
|
427
|
+
error?: string;
|
|
428
|
+
};
|
|
429
|
+
compressImage(file: File, quality?: number, maxWidth?: number, maxHeight?: number): Promise<ImageUploadResult>;
|
|
430
|
+
private uploadImageWithProgress;
|
|
431
|
+
uploadAndInsertImage(editor: Editor, file: File, options?: {
|
|
432
|
+
quality?: number;
|
|
433
|
+
maxWidth?: number;
|
|
434
|
+
maxHeight?: number;
|
|
435
|
+
}): Promise<void>;
|
|
436
|
+
private forceEditorUpdate;
|
|
437
|
+
private selectFileAndProcess;
|
|
438
|
+
selectAndUploadImage(editor: Editor, options?: {
|
|
439
|
+
quality?: number;
|
|
440
|
+
maxWidth?: number;
|
|
441
|
+
maxHeight?: number;
|
|
442
|
+
accept?: string;
|
|
443
|
+
}): Promise<void>;
|
|
444
|
+
selectAndReplaceImage(editor: Editor, options?: {
|
|
445
|
+
quality?: number;
|
|
446
|
+
maxWidth?: number;
|
|
447
|
+
maxHeight?: number;
|
|
448
|
+
accept?: string;
|
|
449
|
+
}): Promise<void>;
|
|
450
|
+
uploadAndReplaceImage(editor: Editor, file: File, options?: {
|
|
451
|
+
quality?: number;
|
|
452
|
+
maxWidth?: number;
|
|
453
|
+
maxHeight?: number;
|
|
454
|
+
}): Promise<void>;
|
|
455
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ImageService, never>;
|
|
456
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ImageService>;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
declare class EditorCommandsService {
|
|
460
|
+
isActive(editor: Editor, name: string, attributes?: Record<string, any>): boolean;
|
|
461
|
+
canExecute(editor: Editor, command: string): boolean;
|
|
462
|
+
toggleBold(editor: Editor): void;
|
|
463
|
+
toggleItalic(editor: Editor): void;
|
|
464
|
+
toggleStrike(editor: Editor): void;
|
|
465
|
+
toggleCode(editor: Editor): void;
|
|
466
|
+
toggleHeading(editor: Editor, level: 1 | 2 | 3): void;
|
|
467
|
+
toggleBulletList(editor: Editor): void;
|
|
468
|
+
toggleOrderedList(editor: Editor): void;
|
|
469
|
+
toggleBlockquote(editor: Editor): void;
|
|
470
|
+
undo(editor: Editor): void;
|
|
471
|
+
redo(editor: Editor): void;
|
|
472
|
+
toggleUnderline(editor: Editor): void;
|
|
473
|
+
toggleSuperscript(editor: Editor): void;
|
|
474
|
+
toggleSubscript(editor: Editor): void;
|
|
475
|
+
setTextAlign(editor: Editor, alignment: "left" | "center" | "right" | "justify"): void;
|
|
476
|
+
toggleLink(editor: Editor, url?: string): void;
|
|
477
|
+
insertHorizontalRule(editor: Editor): void;
|
|
478
|
+
toggleHighlight(editor: Editor, color?: string): void;
|
|
479
|
+
insertTable(editor: Editor, rows?: number, cols?: number): void;
|
|
480
|
+
addColumnBefore(editor: Editor): void;
|
|
481
|
+
addColumnAfter(editor: Editor): void;
|
|
482
|
+
deleteColumn(editor: Editor): void;
|
|
483
|
+
addRowBefore(editor: Editor): void;
|
|
484
|
+
addRowAfter(editor: Editor): void;
|
|
485
|
+
deleteRow(editor: Editor): void;
|
|
486
|
+
deleteTable(editor: Editor): void;
|
|
487
|
+
mergeCells(editor: Editor): void;
|
|
488
|
+
splitCell(editor: Editor): void;
|
|
489
|
+
toggleHeaderColumn(editor: Editor): void;
|
|
490
|
+
toggleHeaderRow(editor: Editor): void;
|
|
491
|
+
toggleHeaderCell(editor: Editor): void;
|
|
492
|
+
clearContent(editor: Editor): void;
|
|
493
|
+
focus(editor: Editor): void;
|
|
494
|
+
blur(editor: Editor): void;
|
|
495
|
+
setContent(editor: Editor, content: string, emitUpdate?: boolean): void;
|
|
496
|
+
setEditable(editor: Editor, editable: boolean): void;
|
|
497
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditorCommandsService, never>;
|
|
498
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<EditorCommandsService>;
|
|
499
|
+
}
|
|
500
|
+
|
|
410
501
|
interface ToolbarConfig {
|
|
411
502
|
bold?: boolean;
|
|
412
503
|
italic?: boolean;
|
|
@@ -429,8 +520,10 @@ interface ToolbarConfig {
|
|
|
429
520
|
link?: boolean;
|
|
430
521
|
image?: boolean;
|
|
431
522
|
horizontalRule?: boolean;
|
|
523
|
+
table?: boolean;
|
|
432
524
|
undo?: boolean;
|
|
433
525
|
redo?: boolean;
|
|
526
|
+
clear?: boolean;
|
|
434
527
|
separator?: boolean;
|
|
435
528
|
}
|
|
436
529
|
|
|
@@ -455,6 +548,22 @@ interface ImageBubbleMenuConfig {
|
|
|
455
548
|
deleteImage?: boolean;
|
|
456
549
|
separator?: boolean;
|
|
457
550
|
}
|
|
551
|
+
interface TableBubbleMenuConfig {
|
|
552
|
+
addRowBefore?: boolean;
|
|
553
|
+
addRowAfter?: boolean;
|
|
554
|
+
deleteRow?: boolean;
|
|
555
|
+
addColumnBefore?: boolean;
|
|
556
|
+
addColumnAfter?: boolean;
|
|
557
|
+
deleteColumn?: boolean;
|
|
558
|
+
deleteTable?: boolean;
|
|
559
|
+
toggleHeaderRow?: boolean;
|
|
560
|
+
toggleHeaderColumn?: boolean;
|
|
561
|
+
separator?: boolean;
|
|
562
|
+
}
|
|
563
|
+
interface CellBubbleMenuConfig {
|
|
564
|
+
mergeCells?: boolean;
|
|
565
|
+
splitCell?: boolean;
|
|
566
|
+
}
|
|
458
567
|
|
|
459
568
|
declare class NoopValueAccessorDirective implements ControlValueAccessor {
|
|
460
569
|
writeValue(obj: any): void;
|
|
@@ -467,6 +576,8 @@ declare class NoopValueAccessorDirective implements ControlValueAccessor {
|
|
|
467
576
|
declare const DEFAULT_TOOLBAR_CONFIG: ToolbarConfig;
|
|
468
577
|
declare const DEFAULT_BUBBLE_MENU_CONFIG: BubbleMenuConfig;
|
|
469
578
|
declare const DEFAULT_IMAGE_BUBBLE_MENU_CONFIG: ImageBubbleMenuConfig;
|
|
579
|
+
declare const DEFAULT_TABLE_MENU_CONFIG: TableBubbleMenuConfig;
|
|
580
|
+
declare const DEFAULT_CELL_MENU_CONFIG: CellBubbleMenuConfig$1;
|
|
470
581
|
declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
|
|
471
582
|
content: _angular_core.InputSignal<string>;
|
|
472
583
|
placeholder: _angular_core.InputSignal<string>;
|
|
@@ -502,17 +613,35 @@ declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
|
|
|
502
613
|
event: FocusEvent;
|
|
503
614
|
}>;
|
|
504
615
|
editorElement: _angular_core.Signal<ElementRef<any>>;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
616
|
+
private _editor;
|
|
617
|
+
private _characterCount;
|
|
618
|
+
private _wordCount;
|
|
619
|
+
private _isDragOver;
|
|
620
|
+
private _editorFullyInitialized;
|
|
621
|
+
readonly editor: _angular_core.Signal<Editor | null>;
|
|
622
|
+
readonly characterCount: _angular_core.Signal<number>;
|
|
623
|
+
readonly wordCount: _angular_core.Signal<number>;
|
|
624
|
+
readonly isDragOver: _angular_core.Signal<boolean>;
|
|
625
|
+
readonly editorFullyInitialized: _angular_core.Signal<boolean>;
|
|
512
626
|
isEditorReady: _angular_core.Signal<boolean>;
|
|
513
627
|
toolbarConfig: _angular_core.Signal<ToolbarConfig>;
|
|
514
628
|
bubbleMenuConfig: _angular_core.Signal<BubbleMenuConfig>;
|
|
515
629
|
imageBubbleMenuConfig: _angular_core.Signal<ImageBubbleMenuConfig>;
|
|
630
|
+
tableBubbleMenuConfig: _angular_core.Signal<{
|
|
631
|
+
addRowBefore: boolean;
|
|
632
|
+
addRowAfter: boolean;
|
|
633
|
+
deleteRow: boolean;
|
|
634
|
+
addColumnBefore: boolean;
|
|
635
|
+
addColumnAfter: boolean;
|
|
636
|
+
deleteColumn: boolean;
|
|
637
|
+
deleteTable: boolean;
|
|
638
|
+
toggleHeaderRow: boolean;
|
|
639
|
+
toggleHeaderColumn: boolean;
|
|
640
|
+
}>;
|
|
641
|
+
cellBubbleMenuConfig: _angular_core.Signal<{
|
|
642
|
+
mergeCells: boolean;
|
|
643
|
+
splitCell: boolean;
|
|
644
|
+
}>;
|
|
516
645
|
imageUploadConfig: _angular_core.Signal<{
|
|
517
646
|
maxSize: number;
|
|
518
647
|
maxWidth: number;
|
|
@@ -529,6 +658,7 @@ declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
|
|
|
529
658
|
private ngControl;
|
|
530
659
|
readonly i18nService: TiptapI18nService;
|
|
531
660
|
readonly imageService: ImageService;
|
|
661
|
+
readonly editorCommandsService: EditorCommandsService;
|
|
532
662
|
constructor();
|
|
533
663
|
ngAfterViewInit(): void;
|
|
534
664
|
ngOnDestroy(): void;
|
|
@@ -547,6 +677,7 @@ declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
|
|
|
547
677
|
focus(): void;
|
|
548
678
|
blur(): void;
|
|
549
679
|
clearContent(): void;
|
|
680
|
+
getEditor(): Editor | null;
|
|
550
681
|
private setupFormControlSubscription;
|
|
551
682
|
setDisabledState(isDisabled: boolean): void;
|
|
552
683
|
onEditorClick(event: MouseEvent): void;
|
|
@@ -554,10 +685,19 @@ declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
|
|
|
554
685
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AngularTiptapEditorComponent, "angular-tiptap-editor", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "showToolbar": { "alias": "showToolbar"; "required": false; "isSignal": true; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; "isSignal": true; }; "maxCharacters": { "alias": "maxCharacters"; "required": false; "isSignal": true; }; "enableOfficePaste": { "alias": "enableOfficePaste"; "required": false; "isSignal": true; }; "enableSlashCommands": { "alias": "enableSlashCommands"; "required": false; "isSignal": true; }; "slashCommandsConfig": { "alias": "slashCommandsConfig"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "showBubbleMenu": { "alias": "showBubbleMenu"; "required": false; "isSignal": true; }; "bubbleMenu": { "alias": "bubbleMenu"; "required": false; "isSignal": true; }; "showImageBubbleMenu": { "alias": "showImageBubbleMenu"; "required": false; "isSignal": true; }; "imageBubbleMenu": { "alias": "imageBubbleMenu"; "required": false; "isSignal": true; }; "toolbar": { "alias": "toolbar"; "required": false; "isSignal": true; }; "imageUpload": { "alias": "imageUpload"; "required": false; "isSignal": true; }; }, { "contentChange": "contentChange"; "editorCreated": "editorCreated"; "editorUpdate": "editorUpdate"; "editorFocus": "editorFocus"; "editorBlur": "editorBlur"; }, never, never, true, [{ directive: typeof NoopValueAccessorDirective; inputs: {}; outputs: {}; }]>;
|
|
555
686
|
}
|
|
556
687
|
|
|
688
|
+
/**
|
|
689
|
+
* Clés des commandes dans l'ordre de création
|
|
690
|
+
*/
|
|
691
|
+
declare const SLASH_COMMAND_KEYS: readonly ["heading1", "heading2", "heading3", "bulletList", "orderedList", "blockquote", "code", "image", "horizontalRule", "table"];
|
|
557
692
|
/**
|
|
558
693
|
* Factory function pour créer les slash commands traduits
|
|
559
694
|
*/
|
|
560
695
|
declare function createI18nSlashCommands(i18nService: TiptapI18nService): SlashCommandItem[];
|
|
696
|
+
/**
|
|
697
|
+
* Fonction utilitaire pour filtrer les slash commands selon les commandes actives
|
|
698
|
+
* Utilise le service i18n injecté en interne
|
|
699
|
+
*/
|
|
700
|
+
declare function filterSlashCommands(activeCommands: Set<string>): SlashCommandItem[];
|
|
561
701
|
|
|
562
702
|
type HeightConfig = {
|
|
563
703
|
minHeight?: number;
|
|
@@ -565,5 +705,5 @@ type HeightConfig = {
|
|
|
565
705
|
maxHeight?: number;
|
|
566
706
|
};
|
|
567
707
|
|
|
568
|
-
export { AngularTiptapEditorComponent, DEFAULT_BUBBLE_MENU_CONFIG, DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, DEFAULT_SLASH_COMMANDS, DEFAULT_TOOLBAR_CONFIG, NoopValueAccessorDirective, TiptapI18nService, createI18nSlashCommands };
|
|
569
|
-
export type { BubbleMenuConfig, HeightConfig, ImageBubbleMenuConfig, SlashCommandItem, SlashCommandsConfig, SupportedLocale, TiptapTranslations, ToolbarConfig };
|
|
708
|
+
export { AngularTiptapEditorComponent, DEFAULT_BUBBLE_MENU_CONFIG, DEFAULT_CELL_MENU_CONFIG, DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, DEFAULT_SLASH_COMMANDS, DEFAULT_TABLE_MENU_CONFIG, DEFAULT_TOOLBAR_CONFIG, EditorCommandsService, ImageService, NoopValueAccessorDirective, SLASH_COMMAND_KEYS, TiptapI18nService, createI18nSlashCommands, filterSlashCommands };
|
|
709
|
+
export type { BubbleMenuConfig, CellBubbleMenuConfig, HeightConfig, ImageBubbleMenuConfig, ImageData, ImageUploadResult, ResizeOptions, SlashCommandItem, SlashCommandsConfig, SupportedLocale, TableBubbleMenuConfig, TiptapTranslations, ToolbarConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flogeez/angular-tiptap-editor",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "A modern, customizable rich-text editor for Angular (18+), built with Tiptap and featuring complete internationalization support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"@tiptap/extension-text-align": "^2.0.0",
|
|
39
39
|
"@tiptap/extension-link": "^2.0.0",
|
|
40
40
|
"@tiptap/extension-highlight": "^2.0.0",
|
|
41
|
+
"@tiptap/extension-image": "^2.0.0",
|
|
42
|
+
"@tiptap/extension-table": "^2.0.0",
|
|
43
|
+
"@tiptap/extension-table-cell": "^2.0.0",
|
|
44
|
+
"@tiptap/extension-table-header": "^2.0.0",
|
|
45
|
+
"@tiptap/extension-table-row": "^2.0.0",
|
|
41
46
|
"@intevation/tiptap-extension-office-paste": "^0.1.0",
|
|
42
47
|
"tippy.js": "^6.3.7"
|
|
43
48
|
},
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
/* Styles globaux pour les menus contextuels Tiptap */
|
|
2
|
+
.tippy-box {
|
|
3
|
+
/* Par défaut Tippy limite à 350px */
|
|
4
|
+
max-width: none !important;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.tippy-content {
|
|
8
|
+
/* Le container interne ne doit pas rajouter de padding, on gère dans .bubble-menu */
|
|
9
|
+
padding: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
2
12
|
.tippy-box .bubble-menu {
|
|
3
13
|
display: flex;
|
|
4
14
|
align-items: center;
|
|
@@ -11,6 +21,8 @@
|
|
|
11
21
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
12
22
|
z-index: 1000;
|
|
13
23
|
animation: slideUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
24
|
+
/* Empêcher les retours à la ligne pour des barres d'icônes */
|
|
25
|
+
white-space: nowrap;
|
|
14
26
|
}
|
|
15
27
|
|
|
16
28
|
.bubble-menu .tiptap-separator {
|