@flogeez/angular-tiptap-editor 3.1.2 → 3.1.4

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 (113) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +2 -2
  3. package/esm2022/flogeez-angular-tiptap-editor.mjs +5 -0
  4. package/esm2022/lib/ate-editor.provider.mjs +38 -0
  5. package/esm2022/lib/components/bubble-menus/base/ate-base-bubble-menu.mjs +207 -0
  6. package/esm2022/lib/components/bubble-menus/base/ate-base-sub-bubble-menu.mjs +137 -0
  7. package/esm2022/lib/components/bubble-menus/color/ate-color-bubble-menu.component.mjs +365 -0
  8. package/esm2022/lib/components/bubble-menus/image/ate-image-bubble-menu.component.mjs +309 -0
  9. package/esm2022/lib/components/bubble-menus/link/ate-link-bubble-menu.component.mjs +247 -0
  10. package/esm2022/lib/components/bubble-menus/table/ate-cell-bubble-menu.component.mjs +126 -0
  11. package/esm2022/lib/components/bubble-menus/table/ate-table-bubble-menu.component.mjs +271 -0
  12. package/esm2022/lib/components/bubble-menus/text/ate-bubble-menu.component.mjs +272 -0
  13. package/esm2022/lib/components/color-picker/ate-color-picker.component.mjs +123 -0
  14. package/esm2022/lib/components/edit-toggle/ate-edit-toggle.component.mjs +42 -0
  15. package/esm2022/lib/components/editor/angular-tiptap-editor.component.mjs +1031 -0
  16. package/esm2022/lib/components/editor/ate-block-controls.component.mjs +256 -0
  17. package/esm2022/lib/components/slash-commands/ate-slash-commands.component.mjs +328 -0
  18. package/esm2022/lib/components/toolbar/ate-toolbar.component.mjs +531 -0
  19. package/esm2022/lib/components/ui/ate-button.component.mjs +91 -0
  20. package/esm2022/lib/components/ui/ate-separator.component.mjs +11 -0
  21. package/esm2022/lib/config/ate-editor.config.mjs +133 -0
  22. package/esm2022/lib/config/ate-global-config.token.mjs +6 -0
  23. package/esm2022/lib/config/ate-slash-commands.config.mjs +130 -0
  24. package/esm2022/lib/directives/ate-noop-value-accessor.directive.mjs +40 -0
  25. package/esm2022/lib/directives/ate-tooltip.directive.mjs +138 -0
  26. package/esm2022/lib/extensions/ate-block-controls.extension.mjs +156 -0
  27. package/esm2022/lib/extensions/ate-link-click-behavior.extension.mjs +32 -0
  28. package/esm2022/lib/extensions/ate-resizable-image.extension.mjs +277 -0
  29. package/esm2022/lib/extensions/ate-table.extension.mjs +27 -0
  30. package/esm2022/lib/extensions/ate-tiptap-state.extension.mjs +85 -0
  31. package/esm2022/lib/extensions/ate-upload-progress.extension.mjs +195 -0
  32. package/esm2022/lib/extensions/calculators/ate-discovery.calculator.mjs +62 -0
  33. package/esm2022/lib/extensions/calculators/ate-image.calculator.mjs +8 -0
  34. package/esm2022/lib/extensions/calculators/ate-marks.calculator.mjs +75 -0
  35. package/esm2022/lib/extensions/calculators/ate-selection.calculator.mjs +35 -0
  36. package/esm2022/lib/extensions/calculators/ate-structure.calculator.mjs +34 -0
  37. package/esm2022/lib/extensions/calculators/ate-table.calculator.mjs +38 -0
  38. package/esm2022/lib/models/ate-bubble-menu.model.mjs +53 -0
  39. package/esm2022/lib/models/ate-editor-config.model.mjs +2 -0
  40. package/esm2022/lib/models/ate-editor-state.model.mjs +90 -0
  41. package/esm2022/lib/models/ate-image.model.mjs +2 -0
  42. package/esm2022/lib/models/ate-slash-command.model.mjs +2 -0
  43. package/esm2022/lib/models/ate-toolbar.model.mjs +35 -0
  44. package/esm2022/lib/node-view/ate-angular-node-view.mjs +97 -0
  45. package/esm2022/lib/node-view/ate-injector.registry.mjs +16 -0
  46. package/esm2022/lib/node-view/ate-node-view.factory.mjs +125 -0
  47. package/esm2022/lib/node-view/ate-node-view.models.mjs +2 -0
  48. package/esm2022/lib/node-view/ate-node-view.renderer.mjs +154 -0
  49. package/esm2022/lib/node-view/ate-register-angular-component.mjs +49 -0
  50. package/esm2022/lib/services/ate-color-picker.service.mjs +194 -0
  51. package/esm2022/lib/services/ate-editor-commands.service.mjs +474 -0
  52. package/esm2022/lib/services/ate-i18n.service.mjs +422 -0
  53. package/esm2022/lib/services/ate-image.service.mjs +459 -0
  54. package/esm2022/lib/services/ate-link.service.mjs +99 -0
  55. package/esm2022/lib/utils/ate-color.utils.mjs +60 -0
  56. package/esm2022/public-api.mjs +40 -0
  57. package/fesm2022/flogeez-angular-tiptap-editor.mjs +321 -354
  58. package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
  59. package/index.d.ts +3 -1734
  60. package/lib/ate-editor.provider.d.ts +21 -0
  61. package/lib/components/bubble-menus/base/ate-base-bubble-menu.d.ts +71 -0
  62. package/lib/components/bubble-menus/base/ate-base-sub-bubble-menu.d.ts +60 -0
  63. package/lib/components/bubble-menus/color/ate-color-bubble-menu.component.d.ts +77 -0
  64. package/lib/components/bubble-menus/image/ate-image-bubble-menu.component.d.ts +49 -0
  65. package/lib/components/bubble-menus/link/ate-link-bubble-menu.component.d.ts +55 -0
  66. package/lib/components/bubble-menus/table/ate-cell-bubble-menu.component.d.ts +16 -0
  67. package/lib/components/bubble-menus/table/ate-table-bubble-menu.component.d.ts +25 -0
  68. package/lib/components/bubble-menus/text/ate-bubble-menu.component.d.ts +53 -0
  69. package/lib/components/color-picker/ate-color-picker.component.d.ts +54 -0
  70. package/lib/components/edit-toggle/ate-edit-toggle.component.d.ts +13 -0
  71. package/lib/components/editor/angular-tiptap-editor.component.d.ts +242 -0
  72. package/lib/components/editor/ate-block-controls.component.d.ts +44 -0
  73. package/lib/components/slash-commands/ate-slash-commands.component.d.ts +34 -0
  74. package/lib/components/toolbar/ate-toolbar.component.d.ts +47 -0
  75. package/lib/components/ui/ate-button.component.d.ts +25 -0
  76. package/lib/components/ui/ate-separator.component.d.ts +5 -0
  77. package/lib/config/ate-editor.config.d.ts +19 -0
  78. package/lib/config/ate-global-config.token.d.ts +6 -0
  79. package/lib/config/ate-slash-commands.config.d.ts +41 -0
  80. package/lib/directives/ate-noop-value-accessor.directive.d.ts +13 -0
  81. package/lib/directives/ate-tooltip.directive.d.ts +30 -0
  82. package/lib/extensions/ate-block-controls.extension.d.ts +10 -0
  83. package/lib/extensions/ate-link-click-behavior.extension.d.ts +2 -0
  84. package/lib/extensions/ate-resizable-image.extension.d.ts +27 -0
  85. package/lib/extensions/ate-table.extension.d.ts +2 -0
  86. package/lib/extensions/ate-tiptap-state.extension.d.ts +7 -0
  87. package/lib/extensions/ate-upload-progress.extension.d.ts +7 -0
  88. package/lib/extensions/calculators/ate-discovery.calculator.d.ts +7 -0
  89. package/lib/extensions/calculators/ate-image.calculator.d.ts +2 -0
  90. package/lib/extensions/calculators/ate-marks.calculator.d.ts +2 -0
  91. package/lib/extensions/calculators/ate-selection.calculator.d.ts +2 -0
  92. package/lib/extensions/calculators/ate-structure.calculator.d.ts +2 -0
  93. package/lib/extensions/calculators/ate-table.calculator.d.ts +2 -0
  94. package/lib/models/ate-bubble-menu.model.d.ts +33 -0
  95. package/lib/models/ate-editor-config.model.d.ts +113 -0
  96. package/lib/models/ate-editor-state.model.d.ts +109 -0
  97. package/lib/models/ate-image.model.d.ts +104 -0
  98. package/lib/models/ate-slash-command.model.d.ts +17 -0
  99. package/lib/models/ate-toolbar.model.d.ts +18 -0
  100. package/lib/node-view/ate-angular-node-view.d.ts +115 -0
  101. package/lib/node-view/ate-injector.registry.d.ts +3 -0
  102. package/lib/node-view/ate-node-view.factory.d.ts +10 -0
  103. package/lib/node-view/ate-node-view.models.d.ts +138 -0
  104. package/lib/node-view/ate-node-view.renderer.d.ts +23 -0
  105. package/lib/node-view/ate-register-angular-component.d.ts +35 -0
  106. package/lib/services/ate-color-picker.service.d.ts +65 -0
  107. package/lib/services/ate-editor-commands.service.d.ts +75 -0
  108. package/lib/services/ate-i18n.service.d.ts +406 -0
  109. package/lib/services/ate-image.service.d.ts +82 -0
  110. package/lib/services/ate-link.service.d.ts +42 -0
  111. package/lib/utils/ate-color.utils.d.ts +12 -0
  112. package/package.json +3 -1
  113. package/public-api.d.ts +31 -0
package/index.d.ts CHANGED
@@ -1,1736 +1,5 @@
1
- import * as _flogeez_angular_tiptap_editor from '@flogeez/angular-tiptap-editor';
2
- import * as _angular_core from '@angular/core';
3
- import { Injector, Type, AfterViewInit, OnDestroy, ElementRef, EnvironmentProviders, InjectionToken, Signal } from '@angular/core';
4
- import { Editor, NodeConfig, Extension, Node as Node$2, Mark, EditorOptions, JSONContent } from '@tiptap/core';
5
- import { Node as Node$1 } from '@tiptap/pm/model';
6
- import { Observable } from 'rxjs';
7
- import { ControlValueAccessor } from '@angular/forms';
8
- import * as _popperjs_core from '@popperjs/core';
9
- import { Decoration, EditorView, NodeView } from '@tiptap/pm/view';
10
-
11
1
  /**
12
- * Interface representing a single item in the slash commands menu.
2
+ * Generated bundle index. Do not edit.
13
3
  */
14
- interface AteSlashCommandItem {
15
- title: string;
16
- description: string;
17
- icon: string;
18
- keywords: string[];
19
- command: (editor: Editor) => void;
20
- }
21
- /**
22
- * Custom slash commands configuration.
23
- */
24
- interface AteCustomSlashCommands {
25
- commands?: AteSlashCommandItem[];
26
- }
27
-
28
- type SupportedLocale = "en" | "fr" | (string & {});
29
- interface AteTranslations {
30
- toolbar: {
31
- bold: string;
32
- italic: string;
33
- underline: string;
34
- strike: string;
35
- code: string;
36
- codeBlock: string;
37
- superscript: string;
38
- subscript: string;
39
- highlight: string;
40
- highlightPicker: string;
41
- heading1: string;
42
- heading2: string;
43
- heading3: string;
44
- bulletList: string;
45
- orderedList: string;
46
- blockquote: string;
47
- alignLeft: string;
48
- alignCenter: string;
49
- alignRight: string;
50
- alignJustify: string;
51
- link: string;
52
- image: string;
53
- horizontalRule: string;
54
- table: string;
55
- undo: string;
56
- redo: string;
57
- clear: string;
58
- textColor: string;
59
- customColor: string;
60
- presets: string;
61
- };
62
- bubbleMenu: {
63
- bold: string;
64
- italic: string;
65
- underline: string;
66
- strike: string;
67
- code: string;
68
- superscript: string;
69
- subscript: string;
70
- highlight: string;
71
- highlightPicker: string;
72
- textColor: string;
73
- link: string;
74
- addLink: string;
75
- editLink: string;
76
- removeLink: string;
77
- linkUrl: string;
78
- linkText: string;
79
- openLink: string;
80
- customColor: string;
81
- presets: string;
82
- };
83
- slashCommands: {
84
- heading1: {
85
- title: string;
86
- description: string;
87
- keywords: string[];
88
- };
89
- heading2: {
90
- title: string;
91
- description: string;
92
- keywords: string[];
93
- };
94
- heading3: {
95
- title: string;
96
- description: string;
97
- keywords: string[];
98
- };
99
- bulletList: {
100
- title: string;
101
- description: string;
102
- keywords: string[];
103
- };
104
- orderedList: {
105
- title: string;
106
- description: string;
107
- keywords: string[];
108
- };
109
- blockquote: {
110
- title: string;
111
- description: string;
112
- keywords: string[];
113
- };
114
- code: {
115
- title: string;
116
- description: string;
117
- keywords: string[];
118
- };
119
- image: {
120
- title: string;
121
- description: string;
122
- keywords: string[];
123
- };
124
- horizontalRule: {
125
- title: string;
126
- description: string;
127
- keywords: string[];
128
- };
129
- table: {
130
- title: string;
131
- description: string;
132
- keywords: string[];
133
- };
134
- };
135
- table: {
136
- addRowBefore: string;
137
- addRowAfter: string;
138
- deleteRow: string;
139
- addColumnBefore: string;
140
- addColumnAfter: string;
141
- deleteColumn: string;
142
- deleteTable: string;
143
- toggleHeaderRow: string;
144
- toggleHeaderColumn: string;
145
- mergeCells: string;
146
- splitCell: string;
147
- };
148
- imageUpload: {
149
- selectImage: string;
150
- loadError: string;
151
- uploadingImage: string;
152
- uploadProgress: string;
153
- uploadError: string;
154
- uploadSuccess: string;
155
- imageTooLarge: string;
156
- invalidFileType: string;
157
- dragDropText: string;
158
- changeImage: string;
159
- downloadImage: string;
160
- deleteImage: string;
161
- resizeSmall: string;
162
- resizeMedium: string;
163
- resizeLarge: string;
164
- resizeOriginal: string;
165
- alignLeft: string;
166
- alignCenter: string;
167
- alignRight: string;
168
- resizing: string;
169
- compressing: string;
170
- compressionError: string;
171
- validating: string;
172
- uploadingToServer: string;
173
- replacingImage: string;
174
- insertingImage: string;
175
- noFileSelected: string;
176
- selectionCancelled: string;
177
- };
178
- editor: {
179
- placeholder: string;
180
- character: string;
181
- word: string;
182
- linkPrompt: string;
183
- linkUrlPrompt: string;
184
- confirmDelete: string;
185
- toggleEdit: string;
186
- viewMode: string;
187
- blockAdd: string;
188
- blockDrag: string;
189
- };
190
- common: {
191
- cancel: string;
192
- confirm: string;
193
- apply: string;
194
- delete: string;
195
- save: string;
196
- close: string;
197
- loading: string;
198
- error: string;
199
- success: string;
200
- };
201
- }
202
- declare class AteI18nService {
203
- private _currentLocale;
204
- private _translations;
205
- readonly currentLocale: _angular_core.Signal<SupportedLocale>;
206
- /** All loaded translations (useful for dynamic key access) */
207
- readonly allTranslations: _angular_core.Signal<Record<SupportedLocale, AteTranslations>>;
208
- readonly translations: _angular_core.Signal<AteTranslations>;
209
- readonly t: _angular_core.Signal<AteTranslations>;
210
- readonly toolbar: _angular_core.Signal<{
211
- bold: string;
212
- italic: string;
213
- underline: string;
214
- strike: string;
215
- code: string;
216
- codeBlock: string;
217
- superscript: string;
218
- subscript: string;
219
- highlight: string;
220
- highlightPicker: string;
221
- heading1: string;
222
- heading2: string;
223
- heading3: string;
224
- bulletList: string;
225
- orderedList: string;
226
- blockquote: string;
227
- alignLeft: string;
228
- alignCenter: string;
229
- alignRight: string;
230
- alignJustify: string;
231
- link: string;
232
- image: string;
233
- horizontalRule: string;
234
- table: string;
235
- undo: string;
236
- redo: string;
237
- clear: string;
238
- textColor: string;
239
- customColor: string;
240
- presets: string;
241
- }>;
242
- readonly bubbleMenu: _angular_core.Signal<{
243
- bold: string;
244
- italic: string;
245
- underline: string;
246
- strike: string;
247
- code: string;
248
- superscript: string;
249
- subscript: string;
250
- highlight: string;
251
- highlightPicker: string;
252
- textColor: string;
253
- link: string;
254
- addLink: string;
255
- editLink: string;
256
- removeLink: string;
257
- linkUrl: string;
258
- linkText: string;
259
- openLink: string;
260
- customColor: string;
261
- presets: string;
262
- }>;
263
- readonly slashCommands: _angular_core.Signal<{
264
- heading1: {
265
- title: string;
266
- description: string;
267
- keywords: string[];
268
- };
269
- heading2: {
270
- title: string;
271
- description: string;
272
- keywords: string[];
273
- };
274
- heading3: {
275
- title: string;
276
- description: string;
277
- keywords: string[];
278
- };
279
- bulletList: {
280
- title: string;
281
- description: string;
282
- keywords: string[];
283
- };
284
- orderedList: {
285
- title: string;
286
- description: string;
287
- keywords: string[];
288
- };
289
- blockquote: {
290
- title: string;
291
- description: string;
292
- keywords: string[];
293
- };
294
- code: {
295
- title: string;
296
- description: string;
297
- keywords: string[];
298
- };
299
- image: {
300
- title: string;
301
- description: string;
302
- keywords: string[];
303
- };
304
- horizontalRule: {
305
- title: string;
306
- description: string;
307
- keywords: string[];
308
- };
309
- table: {
310
- title: string;
311
- description: string;
312
- keywords: string[];
313
- };
314
- }>;
315
- readonly table: _angular_core.Signal<{
316
- addRowBefore: string;
317
- addRowAfter: string;
318
- deleteRow: string;
319
- addColumnBefore: string;
320
- addColumnAfter: string;
321
- deleteColumn: string;
322
- deleteTable: string;
323
- toggleHeaderRow: string;
324
- toggleHeaderColumn: string;
325
- mergeCells: string;
326
- splitCell: string;
327
- }>;
328
- readonly imageUpload: _angular_core.Signal<{
329
- selectImage: string;
330
- loadError: string;
331
- uploadingImage: string;
332
- uploadProgress: string;
333
- uploadError: string;
334
- uploadSuccess: string;
335
- imageTooLarge: string;
336
- invalidFileType: string;
337
- dragDropText: string;
338
- changeImage: string;
339
- downloadImage: string;
340
- deleteImage: string;
341
- resizeSmall: string;
342
- resizeMedium: string;
343
- resizeLarge: string;
344
- resizeOriginal: string;
345
- alignLeft: string;
346
- alignCenter: string;
347
- alignRight: string;
348
- resizing: string;
349
- compressing: string;
350
- compressionError: string;
351
- validating: string;
352
- uploadingToServer: string;
353
- replacingImage: string;
354
- insertingImage: string;
355
- noFileSelected: string;
356
- selectionCancelled: string;
357
- }>;
358
- readonly editor: _angular_core.Signal<{
359
- placeholder: string;
360
- character: string;
361
- word: string;
362
- linkPrompt: string;
363
- linkUrlPrompt: string;
364
- confirmDelete: string;
365
- toggleEdit: string;
366
- viewMode: string;
367
- blockAdd: string;
368
- blockDrag: string;
369
- }>;
370
- readonly common: _angular_core.Signal<{
371
- cancel: string;
372
- confirm: string;
373
- apply: string;
374
- delete: string;
375
- save: string;
376
- close: string;
377
- loading: string;
378
- error: string;
379
- success: string;
380
- }>;
381
- constructor();
382
- setLocale(locale: SupportedLocale): void;
383
- autoDetectLocale(): void;
384
- getSupportedLocales(): SupportedLocale[];
385
- addTranslations(locale: string, translations: AteTranslations | Partial<AteTranslations>): void;
386
- private detectBrowserLanguage;
387
- getToolbarTitle(key: keyof AteTranslations["toolbar"]): string;
388
- getBubbleMenuTitle(key: keyof AteTranslations["bubbleMenu"]): string;
389
- getSlashCommand(key: keyof AteTranslations["slashCommands"]): {
390
- title: string;
391
- description: string;
392
- keywords: string[];
393
- } | {
394
- title: string;
395
- description: string;
396
- keywords: string[];
397
- } | {
398
- title: string;
399
- description: string;
400
- keywords: string[];
401
- } | {
402
- title: string;
403
- description: string;
404
- keywords: string[];
405
- } | {
406
- title: string;
407
- description: string;
408
- keywords: string[];
409
- } | {
410
- title: string;
411
- description: string;
412
- keywords: string[];
413
- } | {
414
- title: string;
415
- description: string;
416
- keywords: string[];
417
- } | {
418
- title: string;
419
- description: string;
420
- keywords: string[];
421
- } | {
422
- title: string;
423
- description: string;
424
- keywords: string[];
425
- } | {
426
- title: string;
427
- description: string;
428
- keywords: string[];
429
- };
430
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteI18nService, never>;
431
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<AteI18nService>;
432
- }
433
-
434
- type AteStateCalculator = (editor: Editor) => Partial<{
435
- [K in keyof AteEditorStateSnapshot]: AteEditorStateSnapshot[K] extends object ? Partial<AteEditorStateSnapshot[K]> : AteEditorStateSnapshot[K];
436
- }>;
437
- interface AteEditorStateSnapshot {
438
- /** Global editor states */
439
- isFocused: boolean;
440
- isEditable: boolean;
441
- /**
442
- * Detailed selection information to avoid overlap between menus
443
- */
444
- selection: {
445
- type: "text" | "node" | "cell" | "none";
446
- from: number;
447
- to: number;
448
- empty: boolean;
449
- /** Specific for CellSelection */
450
- isSingleCell: boolean;
451
- };
452
- /** Text formatting states (Marks) */
453
- marks: {
454
- bold: boolean;
455
- italic: boolean;
456
- underline: boolean;
457
- strike: boolean;
458
- code: boolean;
459
- superscript: boolean;
460
- subscript: boolean;
461
- highlight: boolean;
462
- link: boolean;
463
- linkHref: string | null;
464
- color: string | null;
465
- computedColor: string | null;
466
- background: string | null;
467
- computedBackground: string | null;
468
- linkOpenOnClick: boolean;
469
- };
470
- /** Capability states (canExecute) */
471
- can: {
472
- toggleBold: boolean;
473
- toggleItalic: boolean;
474
- toggleUnderline: boolean;
475
- toggleStrike: boolean;
476
- toggleCode: boolean;
477
- toggleHighlight: boolean;
478
- toggleLink: boolean;
479
- toggleSuperscript: boolean;
480
- toggleSubscript: boolean;
481
- setColor: boolean;
482
- setHighlight: boolean;
483
- undo: boolean;
484
- redo: boolean;
485
- /** Table specific capabilities */
486
- addRowBefore: boolean;
487
- addRowAfter: boolean;
488
- deleteRow: boolean;
489
- addColumnBefore: boolean;
490
- addColumnAfter: boolean;
491
- deleteColumn: boolean;
492
- deleteTable: boolean;
493
- mergeCells: boolean;
494
- splitCell: boolean;
495
- toggleHeaderRow: boolean;
496
- toggleHeaderColumn: boolean;
497
- /** Structure/Node capabilities */
498
- toggleHeading1: boolean;
499
- toggleHeading2: boolean;
500
- toggleHeading3: boolean;
501
- toggleBulletList: boolean;
502
- toggleOrderedList: boolean;
503
- toggleBlockquote: boolean;
504
- toggleCodeBlock: boolean;
505
- setTextAlignLeft: boolean;
506
- setTextAlignCenter: boolean;
507
- setTextAlignRight: boolean;
508
- setTextAlignJustify: boolean;
509
- insertHorizontalRule: boolean;
510
- insertTable: boolean;
511
- insertImage: boolean;
512
- };
513
- /** Current node context */
514
- nodes: {
515
- isTable: boolean;
516
- isTableNodeSelected: boolean;
517
- isTableCell: boolean;
518
- isImage: boolean;
519
- isBlockquote: boolean;
520
- isCodeBlock: boolean;
521
- isBulletList: boolean;
522
- isOrderedList: boolean;
523
- /** Headings */
524
- h1: boolean;
525
- h2: boolean;
526
- h3: boolean;
527
- /** Alignment */
528
- alignLeft: boolean;
529
- alignCenter: boolean;
530
- alignRight: boolean;
531
- alignJustify: boolean;
532
- /** Table specific */
533
- isTableHeaderRow: boolean;
534
- isTableHeaderColumn: boolean;
535
- /** Name of the active node at selection head */
536
- activeNodeName: string | null;
537
- };
538
- /** Placeholder for custom extension states */
539
- custom: Record<string, unknown>;
540
- }
541
- declare const ATE_INITIAL_EDITOR_STATE: AteEditorStateSnapshot;
542
-
543
- interface AteImageData {
544
- src: string;
545
- alt?: string;
546
- title?: string;
547
- width?: number;
548
- height?: number;
549
- }
550
- interface AteImageUploadResult {
551
- src: string;
552
- name: string;
553
- size: number;
554
- type: string;
555
- width?: number;
556
- height?: number;
557
- originalSize?: number;
558
- }
559
- interface AteResizeOptions {
560
- width?: number;
561
- height?: number;
562
- maintainAspectRatio?: boolean;
563
- }
564
- interface AteImageUploadOptions {
565
- quality?: number;
566
- maxWidth?: number;
567
- maxHeight?: number;
568
- maxSize?: number;
569
- allowedTypes?: string[];
570
- }
571
- /**
572
- * Context passed to the image upload handler containing information about the image
573
- */
574
- interface AteImageUploadContext {
575
- /** Original file being uploaded */
576
- file: File;
577
- /** Width of the processed image */
578
- width: number;
579
- /** Height of the processed image */
580
- height: number;
581
- /** MIME type of the image */
582
- type: string;
583
- /** Base64 data URL of the processed image (after compression/resize) */
584
- base64: string;
585
- }
586
- /**
587
- * Result expected from a custom image upload handler.
588
- * Must contain at least the `src` property with the image URL.
589
- */
590
- interface AteImageUploadHandlerResult {
591
- /** URL of the uploaded image (can be a remote URL or any string) */
592
- src: string;
593
- /** Optional custom alt text */
594
- alt?: string;
595
- /** Optional custom title */
596
- title?: string;
597
- }
598
- /**
599
- * Custom handler function for image uploads.
600
- * Allows users to implement their own image storage logic (e.g., upload to S3, Cloudinary, etc.)
601
- *
602
- * Can return either a Promise or an Observable (Angular-friendly).
603
- *
604
- * @param context - Context containing the image file and metadata
605
- * @returns Promise or Observable resolving to ImageUploadHandlerResult
606
- *
607
- * @example Using Promise (async/await)
608
- * ```typescript
609
- * uploadHandler: ImageUploadHandler = async (ctx) => {
610
- * const formData = new FormData();
611
- * formData.append('image', ctx.file);
612
- * const result = await firstValueFrom(this.http.post<{url: string}>('/api/upload', formData));
613
- * return { src: result.url };
614
- * };
615
- * ```
616
- *
617
- * @example Using Observable (Angular HttpClient)
618
- * ```typescript
619
- * uploadHandler: ImageUploadHandler = (ctx) => {
620
- * const formData = new FormData();
621
- * formData.append('image', ctx.file);
622
- * return this.http.post<{url: string}>('/api/upload', formData).pipe(
623
- * map(result => ({ src: result.url }))
624
- * );
625
- * };
626
- * ```
627
- */
628
- type AteImageUploadHandler = (context: AteImageUploadContext) => Promise<AteImageUploadHandlerResult> | Observable<AteImageUploadHandlerResult>;
629
- /**
630
- * Interface dedicated to image upload configuration.
631
- */
632
- interface AteImageUploadConfig {
633
- /** Callback function to handle upload (Promise or Observable) */
634
- handler?: AteImageUploadHandler;
635
- /** Compression quality (0 to 1) */
636
- quality?: number;
637
- /** Maximum allowed width in pixels */
638
- maxWidth?: number;
639
- /** Maximum allowed height in pixels */
640
- maxHeight?: number;
641
- /** Maximum allowed size in MB */
642
- maxSize?: number;
643
- /** Accepted file types (e.g., ['image/jpeg', 'image/png']) */
644
- allowedTypes?: string[];
645
- }
646
-
647
- declare class AteEditorCommandsService {
648
- private imageService;
649
- private colorPickerSvc;
650
- private linkSvc;
651
- private readonly _editorState;
652
- /** Exposed editor state as a readonly signal */
653
- readonly editorState: _angular_core.Signal<AteEditorStateSnapshot>;
654
- /** Signal to track when the toolbar is being hovered/interacted with */
655
- private readonly _isToolbarInteracting;
656
- readonly isToolbarInteracting: _angular_core.Signal<boolean>;
657
- /** Set toolbar interaction state (called by editor component) */
658
- setToolbarInteracting(value: boolean): void;
659
- readonly isUploading: _angular_core.Signal<boolean>;
660
- readonly uploadProgress: _angular_core.Signal<number>;
661
- readonly uploadMessage: _angular_core.Signal<string>;
662
- set uploadHandler(handler: AteImageUploadHandler | null);
663
- /** Update state (called by TiptapStateExtension) */
664
- updateState(state: AteEditorStateSnapshot): void;
665
- /** Signal to toggle link edit mode from UI (Toolbar) - Immediate response */
666
- readonly linkEditMode: _angular_core.Signal<boolean>;
667
- /** Reference to the element that triggered the link menu (for anchoring) */
668
- readonly linkMenuTrigger: _angular_core.Signal<HTMLElement | null>;
669
- /** Signal to toggle color picker mode from UI (text or highlight) */
670
- readonly colorEditMode: _angular_core.Signal<_flogeez_angular_tiptap_editor.AteColorEditMode | null>;
671
- /** Reference to the element that triggered the color menu (for anchoring) */
672
- readonly colorMenuTrigger: _angular_core.Signal<HTMLElement | null>;
673
- /** Generic method to execute any command by name */
674
- execute(editor: Editor, command: string, ...args: unknown[]): void;
675
- toggleBold(editor: Editor): void;
676
- toggleItalic(editor: Editor): void;
677
- toggleStrike(editor: Editor): void;
678
- toggleCode(editor: Editor): void;
679
- toggleCodeBlock(editor: Editor): void;
680
- toggleUnderline(editor: Editor): void;
681
- toggleSuperscript(editor: Editor): void;
682
- toggleSubscript(editor: Editor): void;
683
- toggleHeading(editor: Editor, level: 1 | 2 | 3): void;
684
- toggleHighlight(editor: Editor, color?: string): void;
685
- toggleBulletList(editor: Editor): void;
686
- toggleOrderedList(editor: Editor): void;
687
- toggleBlockquote(editor: Editor): void;
688
- setTextAlign(editor: Editor, alignment: "left" | "center" | "right" | "justify"): void;
689
- insertHorizontalRule(editor: Editor): void;
690
- undo(editor: Editor): void;
691
- redo(editor: Editor): void;
692
- insertTable(editor: Editor, rows?: number, cols?: number): void;
693
- addColumnBefore(editor: Editor): void;
694
- addColumnAfter(editor: Editor): void;
695
- deleteColumn(editor: Editor): void;
696
- addRowBefore(editor: Editor): void;
697
- addRowAfter(editor: Editor): void;
698
- deleteRow(editor: Editor): void;
699
- deleteTable(editor: Editor): void;
700
- mergeCells(editor: Editor): void;
701
- splitCell(editor: Editor): void;
702
- toggleHeaderColumn(editor: Editor): void;
703
- toggleHeaderRow(editor: Editor): void;
704
- clearContent(editor: Editor): void;
705
- focus(editor: Editor): void;
706
- blur(editor: Editor): void;
707
- setContent(editor: Editor, content: string, emitUpdate?: boolean): void;
708
- setEditable(editor: Editor, editable: boolean): void;
709
- insertContent(editor: Editor, content: string): void;
710
- insertImage(editor: Editor, options?: AteImageUploadOptions): Promise<void>;
711
- uploadImage(editor: Editor, file: File, options?: AteImageUploadOptions): Promise<void>;
712
- downloadImage(editor: Editor): void;
713
- handleImageDrop(editor: Editor, event: DragEvent, options?: AteImageUploadOptions): boolean;
714
- handleImagePaste(editor: Editor, event: ClipboardEvent, options?: AteImageUploadOptions): boolean;
715
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteEditorCommandsService, never>;
716
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<AteEditorCommandsService>;
717
- }
718
-
719
- /**
720
- * Clés des commandes natives dans l'ordre d'affichage
721
- */
722
- declare const ATE_SLASH_COMMAND_KEYS: readonly ["heading1", "heading2", "heading3", "bulletList", "orderedList", "blockquote", "code", "image", "horizontalRule", "table"];
723
- type AteSlashCommandKey = (typeof ATE_SLASH_COMMAND_KEYS)[number];
724
- /**
725
- * Configuration simplifiée pour activer/désactiver les slash commands natives.
726
- * Permet aussi d'ajouter des commandes personnalisées.
727
- */
728
- interface AteSlashCommandsConfig extends Partial<Record<AteSlashCommandKey, boolean>> {
729
- /**
730
- * Liste de commandes supplémentaires à ajouter à la fin du menu
731
- */
732
- custom?: AteSlashCommandItem[];
733
- }
734
- /**
735
- * Configuration par défaut : toutes les commandes natives sont activées
736
- */
737
- declare const ATE_DEFAULT_SLASH_COMMANDS_CONFIG: AteSlashCommandsConfig;
738
- /**
739
- * Factory pour créer les commandes natives avec leurs traductions et leur logique d'exécution.
740
- * Utilise les services de l'éditeur pour garantir une cohérence de comportement.
741
- */
742
- declare function createDefaultSlashCommands(i18n: AteI18nService, commands: AteEditorCommandsService, imageOptions?: {
743
- quality?: number;
744
- maxWidth?: number;
745
- maxHeight?: number;
746
- allowedTypes?: string[];
747
- }): AteSlashCommandItem[];
748
- /**
749
- * Filtre et assemble les commandes selon la configuration fournie.
750
- */
751
- declare function filterSlashCommands(config: AteSlashCommandsConfig, i18n: AteI18nService, commands: AteEditorCommandsService, imageOptions?: {
752
- quality?: number;
753
- maxWidth?: number;
754
- maxHeight?: number;
755
- allowedTypes?: string[];
756
- }): AteSlashCommandItem[];
757
-
758
- /**
759
- * Clés des boutons de la barre d'outils native
760
- */
761
- declare const ATE_TOOLBAR_KEYS: readonly ["bold", "italic", "underline", "strike", "code", "codeBlock", "superscript", "subscript", "highlight", "highlightPicker", "heading1", "heading2", "heading3", "bulletList", "orderedList", "blockquote", "alignLeft", "alignCenter", "alignRight", "alignJustify", "link", "image", "horizontalRule", "table", "undo", "redo", "clear", "textColor", "separator"];
762
- type AteToolbarKey = (typeof ATE_TOOLBAR_KEYS)[number];
763
- interface AteToolbarConfig extends Partial<Record<AteToolbarKey, boolean>> {
764
- /**
765
- * Boutons personnalisés à ajouter
766
- */
767
- custom?: AteCustomToolbarItem[];
768
- }
769
- interface AteCustomToolbarItem {
770
- key: string;
771
- label: string;
772
- icon: string;
773
- command: (editor: Editor) => void | Promise<void>;
774
- }
775
-
776
- /**
777
- * Clés des options du menu bulle de texte
778
- */
779
- declare const ATE_BUBBLE_MENU_KEYS: readonly ["bold", "italic", "underline", "strike", "code", "superscript", "subscript", "highlight", "highlightPicker", "textColor", "link", "separator"];
780
- type AteBubbleMenuKey = (typeof ATE_BUBBLE_MENU_KEYS)[number];
781
- interface AteBubbleMenuConfig extends Partial<Record<AteBubbleMenuKey, boolean>> {
782
- custom?: AteCustomBubbleMenuItem[];
783
- }
784
- interface AteCustomBubbleMenuItem {
785
- key: string;
786
- label: string;
787
- icon: string;
788
- command: (editor: Editor) => void | Promise<void>;
789
- }
790
- /**
791
- * Clés des options du menu bulle d'image
792
- */
793
- declare const ATE_IMAGE_BUBBLE_MENU_KEYS: readonly ["changeImage", "downloadImage", "resizeSmall", "resizeMedium", "resizeLarge", "resizeOriginal", "alignLeft", "alignCenter", "alignRight", "deleteImage", "separator"];
794
- type AteImageBubbleMenuKey = (typeof ATE_IMAGE_BUBBLE_MENU_KEYS)[number];
795
- type AteImageBubbleMenuConfig = Partial<Record<AteImageBubbleMenuKey, boolean>>;
796
- /**
797
- * Clés des options du menu de table
798
- */
799
- declare const ATE_TABLE_BUBBLE_MENU_KEYS: readonly ["addRowBefore", "addRowAfter", "deleteRow", "addColumnBefore", "addColumnAfter", "deleteColumn", "deleteTable", "toggleHeaderRow", "toggleHeaderColumn", "separator"];
800
- type AteTableBubbleMenuKey = (typeof ATE_TABLE_BUBBLE_MENU_KEYS)[number];
801
- type AteTableBubbleMenuConfig = Partial<Record<AteTableBubbleMenuKey, boolean>>;
802
- /**
803
- * Clés des options du menu de cellule
804
- */
805
- declare const ATE_CELL_BUBBLE_MENU_KEYS: readonly ["mergeCells", "splitCell"];
806
- type AteCellBubbleMenuKey = (typeof ATE_CELL_BUBBLE_MENU_KEYS)[number];
807
- type AteCellBubbleMenuConfig = Partial<Record<AteCellBubbleMenuKey, boolean>>;
808
-
809
- /**
810
- * Common options for rendering any Angular component as a TipTap NodeView
811
- */
812
- interface AteComponentRenderOptions {
813
- /**
814
- * Angular injector to use for creating the component
815
- */
816
- injector: Injector;
817
- /**
818
- * Additional inputs to pass to the component
819
- */
820
- inputs?: Record<string, unknown>;
821
- /**
822
- * Custom wrapper element tag (default: 'div')
823
- */
824
- wrapperTag?: string;
825
- /**
826
- * CSS classes to add to the wrapper element
827
- */
828
- wrapperClass?: string;
829
- /**
830
- * Whether the node should be treated as an atom (not editable)
831
- * Default: true
832
- */
833
- atom?: boolean;
834
- /**
835
- * Enables editable content for <ng-content>.
836
- * If true, TipTap will treat the component's content as editable.
837
- * @default false
838
- */
839
- editableContent?: boolean;
840
- /**
841
- * Optional CSS selector to target an internal element of the component as the editable area.
842
- */
843
- contentSelector?: string;
844
- /**
845
- * Type of content allowed in the editable area.
846
- */
847
- contentMode?: "block" | "inline";
848
- /**
849
- * Whether to ignore mutations in the component's DOM.
850
- * If true, TipTap won't try to sync changes from the component's DOM back to the editor state.
851
- * @default true
852
- */
853
- ignoreMutation?: boolean | ((mutation: MutationRecord | {
854
- type: "selection";
855
- target: Node;
856
- }) => boolean);
857
- /**
858
- * Callback called when an Output event is emitted by the component.
859
- */
860
- onOutput?: (outputName: string, value: unknown) => void;
861
- /**
862
- * Callback called when the node is updated.
863
- */
864
- onUpdate?: (node: Node$1) => void;
865
- /**
866
- * Callback called when the component is destroyed.
867
- */
868
- onDestroy?: () => void;
869
- }
870
- /**
871
- * Unified configuration for registering an Angular component as an interactive 'Angular Node'.
872
- * This provides high-level options to map Angular component logic (inputs, outputs, lifestyle)
873
- * directly to TipTap's document structure.
874
- */
875
- interface RegisterAngularComponentOptions<T = unknown> {
876
- /**
877
- * The Angular component to register
878
- */
879
- component: Type<T>;
880
- /**
881
- * Unique name for the TipTap node
882
- */
883
- name?: string;
884
- /**
885
- * Default inputs (for standard components)
886
- */
887
- defaultInputs?: Record<string, unknown>;
888
- /**
889
- * TipTap attributes (for TipTap-aware components)
890
- */
891
- attributes?: Record<string, {
892
- default?: unknown;
893
- parseHTML?: (element: HTMLElement) => unknown;
894
- renderHTML?: (attributes: Record<string, unknown>) => Record<string, unknown> | null;
895
- }>;
896
- /**
897
- * CSS selector for the editable area inside the component
898
- */
899
- contentSelector?: string;
900
- /**
901
- * Content mode for the editable area
902
- */
903
- contentMode?: "block" | "inline";
904
- /**
905
- * Enable editable content via <ng-content> or contentSelector
906
- * @default false
907
- */
908
- editableContent?: boolean;
909
- /**
910
- * Node group (block or inline)
911
- * @default 'block'
912
- */
913
- group?: "block" | "inline";
914
- /**
915
- * Is the node draggable?
916
- * @default true
917
- */
918
- draggable?: boolean;
919
- /**
920
- * Whether to ignore mutations in the component's DOM.
921
- * @default true
922
- */
923
- ignoreMutation?: boolean | ((mutation: MutationRecord | {
924
- type: "selection";
925
- target: Node;
926
- }) => boolean);
927
- /**
928
- * Custom HTML attributes for the wrapper
929
- */
930
- HTMLAttributes?: Record<string, unknown>;
931
- /**
932
- * Custom parseHTML rules
933
- */
934
- parseHTML?: NodeConfig["parseHTML"];
935
- /**
936
- * Custom renderHTML function
937
- */
938
- renderHTML?: NodeConfig["renderHTML"];
939
- /**
940
- * Callback called when an Output event is emitted by the component.
941
- */
942
- onOutput?: (outputName: string, value: unknown) => void;
943
- }
944
-
945
- /**
946
- * Type representing an Angular component that can be registered as an editor node.
947
- * Can be a direct Component class or a full registration options object.
948
- */
949
- type AteAngularNode = Type<unknown> | RegisterAngularComponentOptions<unknown>;
950
- /** Possible display modes for block level controls */
951
- type AteBlockControlsMode = "inside" | "outside" | "none";
952
- /** Possible values for editor autofocus */
953
- type AteAutofocusMode = "start" | "end" | "all" | boolean | number;
954
- /**
955
- * Global configuration interface for Angular Tiptap Editor.
956
- * Uses a flat structure for common settings and objects for complex configurations.
957
- */
958
- interface AteEditorConfig {
959
- /** Editor theme: light, dark, or system auto-detection */
960
- theme?: "light" | "dark" | "auto";
961
- /** Display mode: classic or seamless (no borders/background) */
962
- mode?: "classic" | "seamless";
963
- /** Editor height (e.g., '300px', 300, 'auto') */
964
- height?: string | number;
965
- /** Focus position on initialization */
966
- autofocus?: AteAutofocusMode;
967
- /** Placeholder text displayed when the editor is empty */
968
- placeholder?: string;
969
- /** Initial editing state (if false, the editor is read-only) */
970
- editable?: boolean;
971
- /** Minimum editor height (e.g., '200px', 200) */
972
- minHeight?: string | number;
973
- /** Maximum editor height (e.g., '500px', 500) */
974
- maxHeight?: string | number;
975
- /** If true, the editor takes 100% of the parent container's height */
976
- fillContainer?: boolean;
977
- /** Disabled state (often used with forms) */
978
- disabled?: boolean;
979
- /** Editor locale (overrides the global i18n service) */
980
- locale?: string;
981
- /** Enable browser spellcheck */
982
- spellcheck?: boolean;
983
- /** Enable smart cleanup when pasting from Office/Word */
984
- enableOfficePaste?: boolean;
985
- /** Show or hide the toolbar */
986
- showToolbar?: boolean;
987
- /** Show or hide the footer (counters area) */
988
- showFooter?: boolean;
989
- /** Show or hide the character count */
990
- showCharacterCount?: boolean;
991
- /** Show or hide the word count */
992
- showWordCount?: boolean;
993
- /** Show or hide the read-only/edit toggle button */
994
- showEditToggle?: boolean;
995
- /** Show or hide the text context menu */
996
- showBubbleMenu?: boolean;
997
- /** Show or hide the image context menu */
998
- showImageBubbleMenu?: boolean;
999
- /** Show or hide the table menu */
1000
- showTableMenu?: boolean;
1001
- /** Show or hide the cell menu */
1002
- showCellMenu?: boolean;
1003
- /** Whether to allow image downloading from bubble menu */
1004
- downloadImage?: boolean;
1005
- /** Enable or disable slash commands (/) */
1006
- enableSlashCommands?: boolean;
1007
- /** Maximum number of characters allowed */
1008
- maxCharacters?: number;
1009
- /**
1010
- * Block level controls (plus button and drag handle) display mode.
1011
- * - 'inside': Elements are placed inside the editor (reserves space via padding).
1012
- * - 'outside': Elements float outside the editor boundary (no layout shift).
1013
- * - 'none': Disabled (not displayed).
1014
- */
1015
- blockControls?: AteBlockControlsMode;
1016
- /** Detailed toolbar configuration (items, groups) */
1017
- toolbar?: AteToolbarConfig;
1018
- /** Text context menu configuration */
1019
- bubbleMenu?: AteBubbleMenuConfig;
1020
- /** Image context menu configuration */
1021
- imageBubbleMenu?: AteImageBubbleMenuConfig;
1022
- /** Table context menu configuration */
1023
- tableBubbleMenu?: AteTableBubbleMenuConfig;
1024
- /** Cell context menu configuration */
1025
- cellBubbleMenu?: AteCellBubbleMenuConfig;
1026
- /** Slash commands configuration (/) */
1027
- slashCommands?: AteSlashCommandsConfig;
1028
- /** If true, shows the floating toolbar on focus */
1029
- floatingToolbar?: boolean;
1030
- /** Technical configuration for image uploads */
1031
- imageUpload?: AteImageUploadConfig;
1032
- /**
1033
- * List of Angular components to automatically register as interactive editor nodes.
1034
- * This is the preferred way to extend the editor with custom Angular logic.
1035
- */
1036
- angularNodes?: AteAngularNode[];
1037
- /** Standard TipTap extensions (Nodes, Marks, or Plugins) */
1038
- tiptapExtensions?: (Extension | Node$2 | Mark)[];
1039
- /** Raw TipTap editor options (e.g., enableInputRules, injectCSS, etc.) */
1040
- tiptapOptions?: Partial<EditorOptions>;
1041
- /** Reactive state calculators to extend the editor's live state */
1042
- stateCalculators?: AteStateCalculator[];
1043
- /**
1044
- * Fully custom slash commands configuration.
1045
- * When provided, it replaces the default groups based on toolbar toggles.
1046
- */
1047
- customSlashCommands?: AteCustomSlashCommands;
1048
- }
1049
-
1050
- /**
1051
- * Noop Value Accessor Directive
1052
- * @link https://medium.com/netanelbasal/forwarding-form-controls-to-custom-control-components-in-angular-701e8406cc55
1053
- */
1054
- declare class AteNoopValueAccessorDirective implements ControlValueAccessor {
1055
- writeValue(_obj: unknown): void;
1056
- registerOnChange(_fn: unknown): void;
1057
- registerOnTouched(_fn: unknown): void;
1058
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteNoopValueAccessorDirective, never>;
1059
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AteNoopValueAccessorDirective, never, never, {}, {}, never, never, true, never>;
1060
- }
1061
-
1062
- /**
1063
- * The main rich-text editor component for Angular.
1064
- *
1065
- * Powered by Tiptap and built with a native Signal-based architecture, it provides
1066
- * a seamless, high-performance editing experience. Supports automatic registration
1067
- * of Angular components as interactive nodes ('Angular Nodes'), full Reactive Forms
1068
- * integration, and extensive customization via the AteEditorConfig.
1069
- */
1070
- declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
1071
- /** Configuration globale de l'éditeur */
1072
- config: _angular_core.InputSignal<AteEditorConfig>;
1073
- content: _angular_core.InputSignal<string>;
1074
- placeholder: _angular_core.InputSignal<string | undefined>;
1075
- editable: _angular_core.InputSignal<boolean | undefined>;
1076
- disabled: _angular_core.InputSignal<boolean | undefined>;
1077
- minHeight: _angular_core.InputSignal<string | number | undefined>;
1078
- height: _angular_core.InputSignal<string | number | undefined>;
1079
- maxHeight: _angular_core.InputSignal<string | number | undefined>;
1080
- fillContainer: _angular_core.InputSignal<boolean | undefined>;
1081
- showToolbar: _angular_core.InputSignal<boolean | undefined>;
1082
- showFooter: _angular_core.InputSignal<boolean | undefined>;
1083
- showCharacterCount: _angular_core.InputSignal<boolean | undefined>;
1084
- showWordCount: _angular_core.InputSignal<boolean | undefined>;
1085
- maxCharacters: _angular_core.InputSignal<number | undefined>;
1086
- enableOfficePaste: _angular_core.InputSignal<boolean | undefined>;
1087
- enableSlashCommands: _angular_core.InputSignal<boolean | undefined>;
1088
- slashCommands: _angular_core.InputSignal<AteSlashCommandsConfig | undefined>;
1089
- customSlashCommands: _angular_core.InputSignal<AteCustomSlashCommands | undefined>;
1090
- blockControls: _angular_core.InputSignal<AteBlockControlsMode | undefined>;
1091
- locale: _angular_core.InputSignal<SupportedLocale | undefined>;
1092
- autofocus: _angular_core.InputSignal<AteAutofocusMode | undefined>;
1093
- seamless: _angular_core.InputSignal<boolean | undefined>;
1094
- floatingToolbar: _angular_core.InputSignal<boolean | undefined>;
1095
- showEditToggle: _angular_core.InputSignal<boolean | undefined>;
1096
- spellcheck: _angular_core.InputSignal<boolean | undefined>;
1097
- tiptapExtensions: _angular_core.InputSignal<(Mark<any, any> | Node$2<any, any> | Extension<any, any>)[] | undefined>;
1098
- tiptapOptions: _angular_core.InputSignal<Partial<EditorOptions> | undefined>;
1099
- showBubbleMenu: _angular_core.InputSignal<boolean | undefined>;
1100
- bubbleMenu: _angular_core.InputSignal<Partial<AteBubbleMenuConfig> | undefined>;
1101
- showImageBubbleMenu: _angular_core.InputSignal<boolean | undefined>;
1102
- imageBubbleMenu: _angular_core.InputSignal<Partial<Partial<Record<"separator" | "alignLeft" | "alignCenter" | "alignRight" | "changeImage" | "downloadImage" | "resizeSmall" | "resizeMedium" | "resizeLarge" | "resizeOriginal" | "deleteImage", boolean>>> | undefined>;
1103
- toolbar: _angular_core.InputSignal<Partial<AteToolbarConfig> | undefined>;
1104
- showTableBubbleMenu: _angular_core.InputSignal<boolean | undefined>;
1105
- tableBubbleMenu: _angular_core.InputSignal<Partial<Partial<Record<"addColumnBefore" | "addColumnAfter" | "deleteColumn" | "addRowBefore" | "addRowAfter" | "deleteRow" | "deleteTable" | "toggleHeaderColumn" | "toggleHeaderRow" | "separator", boolean>>> | undefined>;
1106
- showCellBubbleMenu: _angular_core.InputSignal<boolean | undefined>;
1107
- cellBubbleMenu: _angular_core.InputSignal<Partial<Partial<Record<"mergeCells" | "splitCell", boolean>>> | undefined>;
1108
- /**
1109
- * Additionnal state calculators to extend the reactive editor state.
1110
- */
1111
- stateCalculators: _angular_core.InputSignal<AteStateCalculator[] | undefined>;
1112
- imageUpload: _angular_core.InputSignal<Partial<AteImageUploadOptions> | undefined>;
1113
- /**
1114
- * Custom handler for image uploads.
1115
- * When provided, images will be processed through this handler instead of being converted to base64.
1116
- * This allows you to upload images to your own server/storage and use the returned URL.
1117
- *
1118
- * @example
1119
- * ```typescript
1120
- * myUploadHandler: ImageUploadHandler = async (context) => {
1121
- * const formData = new FormData();
1122
- * formData.append('image', context.file);
1123
- * const response = await fetch('/api/upload', { method: 'POST', body: formData });
1124
- * const data = await response.json();
1125
- * return { src: data.imageUrl };
1126
- * };
1127
- *
1128
- * // In template:
1129
- * // <angular-tiptap-editor [imageUploadHandler]="myUploadHandler" />
1130
- * ```
1131
- */
1132
- imageUploadHandler: _angular_core.InputSignal<AteImageUploadHandler | undefined>;
1133
- contentChange: _angular_core.OutputEmitterRef<string>;
1134
- editorCreated: _angular_core.OutputEmitterRef<Editor>;
1135
- editorUpdate: _angular_core.OutputEmitterRef<{
1136
- editor: Editor;
1137
- transaction: unknown;
1138
- }>;
1139
- editorFocus: _angular_core.OutputEmitterRef<{
1140
- editor: Editor;
1141
- event: FocusEvent;
1142
- }>;
1143
- editorBlur: _angular_core.OutputEmitterRef<{
1144
- editor: Editor;
1145
- event: FocusEvent;
1146
- }>;
1147
- editableChange: _angular_core.OutputEmitterRef<boolean>;
1148
- editorElement: _angular_core.Signal<ElementRef<any>>;
1149
- hideBubbleMenus(): void;
1150
- showBubbleMenus(): void;
1151
- private _editor;
1152
- private _characterCount;
1153
- private _wordCount;
1154
- private _isDragOver;
1155
- private _editorFullyInitialized;
1156
- private _hoveredBlock;
1157
- private lastEmittedHtml;
1158
- readonly editor: _angular_core.Signal<Editor | null>;
1159
- readonly characterCount: _angular_core.Signal<number>;
1160
- readonly wordCount: _angular_core.Signal<number>;
1161
- readonly isDragOver: _angular_core.Signal<boolean>;
1162
- readonly editorFullyInitialized: _angular_core.Signal<boolean>;
1163
- readonly hoveredBlock: _angular_core.Signal<{
1164
- node: Node$1;
1165
- element: HTMLElement;
1166
- pos: number;
1167
- } | null>;
1168
- private _isFormControlDisabled;
1169
- readonly isFormControlDisabled: _angular_core.Signal<boolean>;
1170
- readonly mergedDisabled: _angular_core.Signal<boolean>;
1171
- isEditorReady: _angular_core.Signal<boolean>;
1172
- readonly finalSeamless: _angular_core.Signal<boolean>;
1173
- readonly finalEditable: _angular_core.Signal<boolean>;
1174
- readonly finalPlaceholder: _angular_core.Signal<string>;
1175
- readonly finalFillContainer: _angular_core.Signal<boolean | undefined>;
1176
- readonly finalShowFooter: _angular_core.Signal<boolean>;
1177
- readonly finalShowEditToggle: _angular_core.Signal<boolean>;
1178
- readonly finalHeight: _angular_core.Signal<string | undefined>;
1179
- readonly finalMinHeight: _angular_core.Signal<string | undefined>;
1180
- readonly finalMaxHeight: _angular_core.Signal<string | undefined>;
1181
- readonly finalSpellcheck: _angular_core.Signal<boolean>;
1182
- readonly finalEnableOfficePaste: _angular_core.Signal<boolean>;
1183
- readonly finalShowToolbar: _angular_core.Signal<boolean>;
1184
- readonly finalToolbarConfig: _angular_core.Signal<AteToolbarConfig>;
1185
- readonly finalFloatingToolbar: _angular_core.Signal<boolean>;
1186
- readonly finalShowBubbleMenu: _angular_core.Signal<boolean>;
1187
- readonly finalBubbleMenuConfig: _angular_core.Signal<AteBubbleMenuConfig>;
1188
- readonly finalShowImageBubbleMenu: _angular_core.Signal<boolean>;
1189
- readonly finalImageBubbleMenuConfig: _angular_core.Signal<Partial<Record<"separator" | "alignLeft" | "alignCenter" | "alignRight" | "changeImage" | "downloadImage" | "resizeSmall" | "resizeMedium" | "resizeLarge" | "resizeOriginal" | "deleteImage", boolean>>>;
1190
- readonly finalShowTableBubbleMenu: _angular_core.Signal<boolean>;
1191
- readonly finalTableBubbleMenuConfig: _angular_core.Signal<Partial<Record<"addColumnBefore" | "addColumnAfter" | "deleteColumn" | "addRowBefore" | "addRowAfter" | "deleteRow" | "deleteTable" | "toggleHeaderColumn" | "toggleHeaderRow" | "separator", boolean>>>;
1192
- readonly finalShowCellBubbleMenu: _angular_core.Signal<boolean>;
1193
- readonly finalCellBubbleMenuConfig: _angular_core.Signal<Partial<Record<"mergeCells" | "splitCell", boolean>>>;
1194
- readonly finalEnableSlashCommands: _angular_core.Signal<boolean>;
1195
- readonly finalSlashCommandsConfig: _angular_core.Signal<AteCustomSlashCommands>;
1196
- readonly finalAutofocus: _angular_core.Signal<AteAutofocusMode | undefined>;
1197
- readonly finalMaxCharacters: _angular_core.Signal<number | undefined>;
1198
- readonly finalBlockControls: _angular_core.Signal<AteBlockControlsMode>;
1199
- readonly finalShowCharacterCount: _angular_core.Signal<boolean>;
1200
- readonly finalShowWordCount: _angular_core.Signal<boolean>;
1201
- readonly finalLocale: _angular_core.Signal<SupportedLocale>;
1202
- readonly finalTiptapExtensions: _angular_core.Signal<(Mark<any, any> | Node$2<any, any> | Extension<any, any>)[]>;
1203
- readonly finalTiptapOptions: _angular_core.Signal<Partial<EditorOptions>>;
1204
- readonly finalStateCalculators: _angular_core.Signal<AteStateCalculator[]>;
1205
- readonly finalAngularNodesConfig: _angular_core.Signal<AteAngularNode[]>;
1206
- readonly finalImageUploadConfig: _angular_core.Signal<{
1207
- maxSize: number;
1208
- quality?: number;
1209
- maxWidth?: number;
1210
- maxHeight?: number;
1211
- allowedTypes?: string[];
1212
- handler?: AteImageUploadHandler;
1213
- }>;
1214
- readonly finalImageUploadHandler: _angular_core.Signal<AteImageUploadHandler | undefined>;
1215
- readonly currentTranslations: _angular_core.Signal<_flogeez_angular_tiptap_editor.AteTranslations>;
1216
- private _destroyRef;
1217
- private ngControl;
1218
- readonly i18nService: AteI18nService;
1219
- readonly editorCommandsService: AteEditorCommandsService;
1220
- readonly editorState: _angular_core.Signal<_flogeez_angular_tiptap_editor.AteEditorStateSnapshot>;
1221
- private injector;
1222
- private globalConfig;
1223
- /**
1224
- * Final merged configuration.
1225
- * Priority: Input [config] > Global config via provideAteEditor()
1226
- */
1227
- readonly effectiveConfig: _angular_core.Signal<{
1228
- theme?: "light" | "dark" | "auto";
1229
- mode?: "classic" | "seamless";
1230
- height?: string | number;
1231
- autofocus?: AteAutofocusMode;
1232
- placeholder?: string;
1233
- editable?: boolean;
1234
- minHeight?: string | number;
1235
- maxHeight?: string | number;
1236
- fillContainer?: boolean;
1237
- disabled?: boolean;
1238
- locale?: string;
1239
- spellcheck?: boolean;
1240
- enableOfficePaste?: boolean;
1241
- showToolbar?: boolean;
1242
- showFooter?: boolean;
1243
- showCharacterCount?: boolean;
1244
- showWordCount?: boolean;
1245
- showEditToggle?: boolean;
1246
- showBubbleMenu?: boolean;
1247
- showImageBubbleMenu?: boolean;
1248
- showTableMenu?: boolean;
1249
- showCellMenu?: boolean;
1250
- downloadImage?: boolean;
1251
- enableSlashCommands?: boolean;
1252
- maxCharacters?: number;
1253
- blockControls?: AteBlockControlsMode;
1254
- toolbar?: AteToolbarConfig;
1255
- bubbleMenu?: AteBubbleMenuConfig;
1256
- imageBubbleMenu?: AteImageBubbleMenuConfig;
1257
- tableBubbleMenu?: AteTableBubbleMenuConfig;
1258
- cellBubbleMenu?: AteCellBubbleMenuConfig;
1259
- slashCommands?: AteSlashCommandsConfig;
1260
- floatingToolbar?: boolean;
1261
- imageUpload?: _flogeez_angular_tiptap_editor.AteImageUploadConfig;
1262
- angularNodes?: AteAngularNode[];
1263
- tiptapExtensions?: (Extension | Node$2 | Mark)[];
1264
- tiptapOptions?: Partial<EditorOptions>;
1265
- stateCalculators?: AteStateCalculator[];
1266
- customSlashCommands?: AteCustomSlashCommands;
1267
- }>;
1268
- constructor();
1269
- ngAfterViewInit(): void;
1270
- ngOnDestroy(): void;
1271
- private initEditor;
1272
- toggleEditMode(event: Event): void;
1273
- private updateCharacterCount;
1274
- onDragOver(event: DragEvent): void;
1275
- onDrop(event: DragEvent): void;
1276
- private getImageUploadOptions;
1277
- getHTML(): string;
1278
- getJSON(): JSONContent | undefined;
1279
- getText(): string;
1280
- setContent(content: string, emitUpdate?: boolean): void;
1281
- focus(): void;
1282
- blur(): void;
1283
- clearContent(): void;
1284
- getEditor(): Editor | null;
1285
- private setupFormControlSubscription;
1286
- onEditorClick(event: Event): void;
1287
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AngularTiptapEditorComponent, never>;
1288
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AngularTiptapEditorComponent, "angular-tiptap-editor", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "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; }; "fillContainer": { "alias": "fillContainer"; "required": false; "isSignal": true; }; "showToolbar": { "alias": "showToolbar"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; "isSignal": true; }; "showWordCount": { "alias": "showWordCount"; "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; }; "slashCommands": { "alias": "slashCommands"; "required": false; "isSignal": true; }; "customSlashCommands": { "alias": "customSlashCommands"; "required": false; "isSignal": true; }; "blockControls": { "alias": "blockControls"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "seamless": { "alias": "seamless"; "required": false; "isSignal": true; }; "floatingToolbar": { "alias": "floatingToolbar"; "required": false; "isSignal": true; }; "showEditToggle": { "alias": "showEditToggle"; "required": false; "isSignal": true; }; "spellcheck": { "alias": "spellcheck"; "required": false; "isSignal": true; }; "tiptapExtensions": { "alias": "tiptapExtensions"; "required": false; "isSignal": true; }; "tiptapOptions": { "alias": "tiptapOptions"; "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; }; "showTableBubbleMenu": { "alias": "showTableBubbleMenu"; "required": false; "isSignal": true; }; "tableBubbleMenu": { "alias": "tableBubbleMenu"; "required": false; "isSignal": true; }; "showCellBubbleMenu": { "alias": "showCellBubbleMenu"; "required": false; "isSignal": true; }; "cellBubbleMenu": { "alias": "cellBubbleMenu"; "required": false; "isSignal": true; }; "stateCalculators": { "alias": "stateCalculators"; "required": false; "isSignal": true; }; "imageUpload": { "alias": "imageUpload"; "required": false; "isSignal": true; }; "imageUploadHandler": { "alias": "imageUploadHandler"; "required": false; "isSignal": true; }; }, { "contentChange": "contentChange"; "editorCreated": "editorCreated"; "editorUpdate": "editorUpdate"; "editorFocus": "editorFocus"; "editorBlur": "editorBlur"; "editableChange": "editableChange"; }, never, never, true, [{ directive: typeof AteNoopValueAccessorDirective; inputs: {}; outputs: {}; }]>;
1289
- }
1290
-
1291
- /**
1292
- * Provides the necessary configuration and initialization for the Angular TipTap Editor.
1293
- * This should be called in your app.config.ts (for standalone) or main.ts.
1294
- *
1295
- * This provider is essential for 'Angular Nodes' to work correctly, as it captures the
1296
- * root Injector required to instantiate custom Angular components within the editor.
1297
- * @example
1298
- * ```ts
1299
- * bootstrapApplication(AppComponent, {
1300
- * providers: [
1301
- * provideAteEditor({
1302
- * theme: 'dark',
1303
- * mode: 'seamless'
1304
- * })
1305
- * ]
1306
- * });
1307
- * ```
1308
- */
1309
- declare function provideAteEditor(config?: AteEditorConfig): EnvironmentProviders;
1310
-
1311
- declare class AteTooltipDirective implements OnDestroy {
1312
- private readonly el;
1313
- private tippyInstance;
1314
- content: _angular_core.InputSignal<string | null>;
1315
- placement: _angular_core.InputSignal<_popperjs_core.Placement>;
1316
- delay: _angular_core.InputSignal<number | [number, number]>;
1317
- disabled: _angular_core.InputSignal<boolean>;
1318
- /**
1319
- * Computed logic for ARIA shortcuts.
1320
- */
1321
- protected readonly ariaShortcut: _angular_core.Signal<string | null>;
1322
- /**
1323
- * Computed logic for Tippy content.
1324
- * Includes strict escaping of dynamic content to prevent XSS.
1325
- */
1326
- private readonly processedTooltip;
1327
- constructor();
1328
- ngOnDestroy(): void;
1329
- /**
1330
- * Basic HTML escaping for security.
1331
- * Effectively neutralizes scripts or malicious HTML tags.
1332
- */
1333
- private escapeHtml;
1334
- private initTippy;
1335
- private destroyTippy;
1336
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteTooltipDirective, never>;
1337
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AteTooltipDirective, "[ateTooltip]", never, { "content": { "alias": "ateTooltip"; "required": false; "isSignal": true; }; "placement": { "alias": "ateTooltipPlacement"; "required": false; "isSignal": true; }; "delay": { "alias": "ateTooltipDelay"; "required": false; "isSignal": true; }; "disabled": { "alias": "ateTooltipDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1338
- }
1339
-
1340
- declare class AteImageService {
1341
- /** Signals for image state */
1342
- selectedImage: _angular_core.WritableSignal<AteImageData | null>;
1343
- isImageSelected: _angular_core.Signal<boolean>;
1344
- /** Resizing state */
1345
- isResizing: _angular_core.WritableSignal<boolean>;
1346
- private i18n;
1347
- private readonly t;
1348
- /** Upload state signals */
1349
- isUploading: _angular_core.WritableSignal<boolean>;
1350
- uploadProgress: _angular_core.WritableSignal<number>;
1351
- uploadMessage: _angular_core.WritableSignal<string>;
1352
- /**
1353
- * Custom upload handler.
1354
- * If set, this handler replaces the default base64 conversion.
1355
- */
1356
- uploadHandler: AteImageUploadHandler | null;
1357
- private currentEditor;
1358
- /** Select and track an image from the editor */
1359
- selectImage(editor: Editor): void;
1360
- clearSelection(): void;
1361
- /** Insert a new image and ensure it's selected */
1362
- insertImage(editor: Editor, imageData: AteImageData): void;
1363
- /** Update attributes of the currently active image */
1364
- updateImageAttributes(editor: Editor, attributes: Partial<AteImageData>): void;
1365
- /** Resize image with optional aspect ratio maintenance */
1366
- resizeImage(editor: Editor, options: AteResizeOptions): void;
1367
- /** Predetermined resize helpers used by UI */
1368
- resizeImageToSmall(editor: Editor): void;
1369
- resizeImageToMedium(editor: Editor): void;
1370
- resizeImageToLarge(editor: Editor): void;
1371
- resizeImageToOriginal(editor: Editor): void;
1372
- /** Get current image dimensions */
1373
- getImageDimensions(editor: Editor): {
1374
- width: number;
1375
- height: number;
1376
- } | null;
1377
- /** Remove the selected image */
1378
- deleteImage(editor: Editor): void;
1379
- /** Download the current image */
1380
- downloadImage(editor: Editor): void;
1381
- private updateSelectedImage;
1382
- /** Validate file type and size */
1383
- validateImage(file: File, options?: {
1384
- maxSize?: number;
1385
- allowedTypes?: string[];
1386
- }): {
1387
- valid: boolean;
1388
- error?: string;
1389
- };
1390
- /** Compress and process image on client side */
1391
- compressImage(file: File, quality?: number, maxWidth?: number, maxHeight?: number): Promise<AteImageUploadResult>;
1392
- /** Core upload logic with progress tracking */
1393
- private uploadImageWithProgress;
1394
- private resetUploadState;
1395
- /** Main entry point for file upload and insertion */
1396
- uploadAndInsertImage(editor: Editor, file: File, options?: AteImageUploadOptions): Promise<void>;
1397
- /** Trigger an editor transaction to force decoration update */
1398
- private forceEditorUpdate;
1399
- /** Generic helper to open file picker and process selection */
1400
- private selectFileAndProcess;
1401
- /** Select file and upload as new image */
1402
- selectAndUploadImage(editor: Editor, options?: AteImageUploadOptions): Promise<void>;
1403
- /** Select file and replace currently selected image */
1404
- selectAndReplaceImage(editor: Editor, options?: AteImageUploadOptions): Promise<void>;
1405
- /** Internal helper used by replacement logic */
1406
- uploadAndReplaceImage(editor: Editor, file: File, options?: AteImageUploadOptions): Promise<void>;
1407
- /**
1408
- * Handle image drop event.
1409
- * Calculates the position from coordinates and sets the selection accordingly.
1410
- */
1411
- handleDrop(editor: Editor, event: DragEvent, options?: AteImageUploadOptions): boolean;
1412
- /**
1413
- * Handle image paste event.
1414
- */
1415
- handlePaste(editor: Editor, event: ClipboardEvent, options?: AteImageUploadOptions): boolean;
1416
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteImageService, never>;
1417
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<AteImageService>;
1418
- }
1419
-
1420
- interface AteColorPickerSelection {
1421
- from: number;
1422
- to: number;
1423
- }
1424
- type AteColorEditMode = "text" | "highlight";
1425
- declare class AteColorPickerService {
1426
- private storedSelection;
1427
- /** Current edit mode: null when closed, 'text' or 'highlight' when open */
1428
- readonly editMode: _angular_core.WritableSignal<AteColorEditMode | null>;
1429
- /** Reference to the element that triggered the menu (for anchoring) */
1430
- readonly menuTrigger: _angular_core.WritableSignal<HTMLElement | null>;
1431
- /** Whether the user is currently interacting with the picker UI (e.g. typing) */
1432
- readonly isInteracting: _angular_core.WritableSignal<boolean>;
1433
- /**
1434
- * Open the color picker menu in the specified mode.
1435
- */
1436
- open(mode: AteColorEditMode, trigger?: HTMLElement): void;
1437
- /**
1438
- * Close the color picker menu.
1439
- */
1440
- close(): void;
1441
- /**
1442
- * Set interaction state (prevents premature closing when blurring editor)
1443
- */
1444
- setInteracting(value: boolean): void;
1445
- /**
1446
- * Toggle color picker from UI (extracts trigger from event).
1447
- */
1448
- toggle(editor: Editor, mode: AteColorEditMode, event?: Event): void;
1449
- /**
1450
- * Capture current editor selection.
1451
- */
1452
- captureSelection(editor: Editor): void;
1453
- /**
1454
- * Get last captured selection.
1455
- */
1456
- getStoredSelection(): AteColorPickerSelection | null;
1457
- /**
1458
- * Clear captured selection.
1459
- */
1460
- done(): void;
1461
- /**
1462
- * Apply text color to selection.
1463
- */
1464
- applyColor(editor: Editor, color: string, addToHistory?: boolean, focus?: boolean): void;
1465
- /**
1466
- * Remove text color from selection.
1467
- */
1468
- unsetColor(editor: Editor, focus?: boolean): void;
1469
- /**
1470
- * Apply highlight color to selection.
1471
- */
1472
- applyHighlight(editor: Editor, color: string, addToHistory?: boolean, focus?: boolean): void;
1473
- /**
1474
- * Remove highlight from selection.
1475
- */
1476
- unsetHighlight(editor: Editor, focus?: boolean): void;
1477
- normalizeColor(color: string | null | undefined): string;
1478
- getLuminance(color: string): number;
1479
- getContrastColor(color: string): "black" | "white";
1480
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteColorPickerService, never>;
1481
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<AteColorPickerService>;
1482
- }
1483
-
1484
- declare class AteLinkService {
1485
- /** Whether link edit mode is active */
1486
- readonly editMode: _angular_core.WritableSignal<boolean>;
1487
- /** Reference to the element that triggered the menu (for anchoring) */
1488
- readonly menuTrigger: _angular_core.WritableSignal<HTMLElement | null>;
1489
- /** Whether the user is currently interacting with the link UI (input focus) */
1490
- readonly isInteracting: _angular_core.WritableSignal<boolean>;
1491
- /**
1492
- * Open the link edit menu.
1493
- */
1494
- open(trigger?: HTMLElement): void;
1495
- /**
1496
- * Close the link edit menu.
1497
- */
1498
- close(): void;
1499
- /**
1500
- * Final cleanup (called after UI is hidden)
1501
- */
1502
- done(): void;
1503
- /**
1504
- * Set interaction state
1505
- */
1506
- setInteracting(value: boolean): void;
1507
- /**
1508
- * Toggle link mode from UI.
1509
- * If a URL string is provided, applies the link and closes.
1510
- * If an Event is provided, extracts the trigger for anchoring.
1511
- */
1512
- toggle(editor: Editor, urlOrEvent?: string | Event): void;
1513
- /**
1514
- * Apply a link to the current selection.
1515
- */
1516
- setLink(editor: Editor, url: string): void;
1517
- /**
1518
- * Remove link from the current selection.
1519
- */
1520
- unsetLink(editor: Editor): void;
1521
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteLinkService, never>;
1522
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<AteLinkService>;
1523
- }
1524
-
1525
- /**
1526
- * DiscoveryCalculator automatically detects and tracks the state of any TipTap extension.
1527
- * It provides a "fallback" reactive state for any mark or node not explicitly handled
1528
- * by specialized calculators.
1529
- */
1530
- declare const AteDiscoveryCalculator: AteStateCalculator;
1531
-
1532
- declare const AteImageCalculator: AteStateCalculator;
1533
-
1534
- declare const AteMarksCalculator: AteStateCalculator;
1535
-
1536
- declare const AteSelectionCalculator: AteStateCalculator;
1537
-
1538
- declare const AteStructureCalculator: AteStateCalculator;
1539
-
1540
- declare const AteTableCalculator: AteStateCalculator;
1541
-
1542
- declare const ATE_DEFAULT_TOOLBAR_CONFIG: AteToolbarConfig;
1543
- declare const ATE_DEFAULT_BUBBLE_MENU_CONFIG: AteBubbleMenuConfig;
1544
- declare const ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG: AteImageBubbleMenuConfig;
1545
- declare const ATE_DEFAULT_TABLE_MENU_CONFIG: AteTableBubbleMenuConfig;
1546
- declare const ATE_DEFAULT_CELL_MENU_CONFIG: AteCellBubbleMenuConfig;
1547
- declare const ATE_DEFAULT_IMAGE_UPLOAD_CONFIG: AteImageUploadConfig;
1548
-
1549
- /**
1550
- * Ultimate default configuration for the Angular Tiptap Editor.
1551
- * This serves as the 'Level 4' fallback in the configuration hierarchy:
1552
- * 1. Component Inputs (Le Roi)
1553
- * 2. Component [config] (Le Prince)
1554
- * 3. Global provideAteEditor() (Le Duc)
1555
- * 4. ATE_DEFAULT_CONFIG (Le Peuple)
1556
- */
1557
- declare const ATE_DEFAULT_CONFIG: AteEditorConfig;
1558
-
1559
- /**
1560
- * Injection Token for global editor configuration.
1561
- */
1562
- declare const ATE_GLOBAL_CONFIG: InjectionToken<AteEditorConfig>;
1563
-
1564
- /**
1565
- * Props that are injected into Angular NodeView components
1566
- */
1567
- interface AteAngularNodeViewProps {
1568
- editor: Editor;
1569
- node: Node$1;
1570
- decorations: readonly Decoration[];
1571
- selected: boolean;
1572
- extension: unknown;
1573
- getPos: () => number | undefined;
1574
- updateAttributes: (attrs: Record<string, unknown>) => void;
1575
- deleteNode: () => void;
1576
- }
1577
- /**
1578
- * Base abstract class for custom 'Angular Nodes'.
1579
- *
1580
- * Extend this class in your custom components to automatically receive TipTap editor
1581
- * properties (node attributes, selection state, etc.) as reactive Signals.
1582
- *
1583
- * @example
1584
- * ```typescript
1585
- * @Component({
1586
- * selector: 'app-counter',
1587
- * template: `
1588
- * <div>
1589
- * <button (click)="increment()">Count: {{ node().attrs['count'] }}</button>
1590
- * </div>
1591
- * `
1592
- * })
1593
- * export class CounterComponent extends AteAngularNodeView {
1594
- * increment() {
1595
- * const count = this.node().attrs['count'] || 0;
1596
- * this.updateAttributes({ count: count + 1 });
1597
- * }
1598
- * }
1599
- * ```
1600
- */
1601
- declare abstract class AteAngularNodeView {
1602
- /**
1603
- * The TipTap editor instance
1604
- */
1605
- editor: Signal<Editor>;
1606
- /**
1607
- * The ProseMirror node
1608
- */
1609
- node: Signal<Node$1>;
1610
- /**
1611
- * Decorations applied to this node
1612
- */
1613
- decorations: Signal<readonly Decoration[]>;
1614
- /**
1615
- * Whether the node is currently selected
1616
- */
1617
- selected: Signal<boolean>;
1618
- /**
1619
- * The extension instance that created this node
1620
- */
1621
- extension: Signal<unknown>;
1622
- /**
1623
- * Function to get the current position of this node in the document
1624
- */
1625
- getPos: () => number | undefined;
1626
- /**
1627
- * Update the attributes of this node
1628
- *
1629
- * @param attrs - Partial attributes to update
1630
- *
1631
- * @example
1632
- * ```typescript
1633
- * this.updateAttributes({ count: 5, color: 'blue' });
1634
- * ```
1635
- */
1636
- updateAttributes: (attrs: Record<string, unknown>) => void;
1637
- /**
1638
- * Delete this node from the document
1639
- */
1640
- deleteNode: () => void;
1641
- /** @internal */
1642
- private _writableSignals?;
1643
- /**
1644
- * Internal method to initialize the component with NodeView props.
1645
- * This is called by the AngularNodeViewRenderer.
1646
- *
1647
- * @internal
1648
- */
1649
- _initNodeView(props: AteAngularNodeViewProps): void;
1650
- /**
1651
- * Internal method to update the component when the node changes.
1652
- * This is called by the AngularNodeViewRenderer.
1653
- *
1654
- * @internal
1655
- */
1656
- _updateNodeView(node: Node$1, decorations: readonly Decoration[]): void;
1657
- /**
1658
- * Internal method to update the selection state.
1659
- * This is called by the AngularNodeViewRenderer.
1660
- *
1661
- * @internal
1662
- */
1663
- _selectNodeView(): void;
1664
- /**
1665
- * Internal method to update the deselection state.
1666
- * This is called by the AngularNodeViewRenderer.
1667
- *
1668
- * @internal
1669
- */
1670
- _deselectNodeView(): void;
1671
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteAngularNodeView, never>;
1672
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AteAngularNodeView, never, never, {}, {}, never, never, true, never>;
1673
- }
1674
-
1675
- /**
1676
- * Universal Renderer for Angular Components as TipTap NodeViews.
1677
- *
1678
- * Supports:
1679
- * - TipTap-Aware components (extending AteAngularNodeView)
1680
- * - Standard library components (automatic @Input() sync)
1681
- * - Signal-based inputs and outputs (Angular 18+)
1682
- * - Content projection (editableContent)
1683
- * - Unified lifecycle and event management
1684
- */
1685
- declare function AteNodeViewRenderer<T>(component: Type<T>, options: AteComponentRenderOptions): (props: {
1686
- node: Node$1;
1687
- view: EditorView;
1688
- getPos: () => number | undefined;
1689
- decorations: readonly Decoration[];
1690
- editor: Editor;
1691
- extension: unknown;
1692
- }) => NodeView;
1693
-
1694
- /**
1695
- * Factory to transform an Angular component into a TipTap Node extension.
1696
- * Supports both "TipTap-Aware" and "Standard" modes.
1697
- *
1698
- * @internal
1699
- */
1700
- declare function createAngularComponentExtension<T = unknown>(injector: Injector, options: RegisterAngularComponentOptions<T>): Node$2;
1701
-
1702
- /**
1703
- * Registers ANY Angular component as a TipTap node extension.
1704
- *
1705
- * This function is the single public entry point for adding custom components.
1706
- * It supports two distinct modes:
1707
- *
1708
- * 1. **TipTap-Aware Mode** (the component extends `AteAngularNodeView`):
1709
- * Grants direct access to the TipTap API (`editor`, `node`, `updateAttributes`, etc.) within the component.
1710
- *
1711
- * 2. **Standard Mode** (library or legacy components):
1712
- * Allows using any existing Angular component. Its `@Input()` properties are automatically
1713
- * synchronized with TipTap node attributes.
1714
- *
1715
- * @param injectorOrOptions - The Angular Injector OR the configuration options
1716
- * @param maybeOptions - Configuration options (if the first param was an injector)
1717
- * @returns A TipTap Node extension ready to be used
1718
- *
1719
- * @example
1720
- * ```typescript
1721
- * // Modern way (requires provideAteEditor())
1722
- * registerAngularComponent({
1723
- * component: MyComponent,
1724
- * name: 'myComponent'
1725
- * });
1726
- *
1727
- * // Classic way
1728
- * registerAngularComponent(injector, {
1729
- * component: MyComponent
1730
- * });
1731
- * ```
1732
- */
1733
- declare function registerAngularComponent<T = unknown>(injectorOrOptions: Injector | RegisterAngularComponentOptions<T>, maybeOptions?: RegisterAngularComponentOptions<T>): Node$2;
1734
-
1735
- export { ATE_BUBBLE_MENU_KEYS, ATE_CELL_BUBBLE_MENU_KEYS, ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_IMAGE_UPLOAD_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_GLOBAL_CONFIG, ATE_IMAGE_BUBBLE_MENU_KEYS, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, ATE_TABLE_BUBBLE_MENU_KEYS, ATE_TOOLBAR_KEYS, AngularTiptapEditorComponent, AteAngularNodeView, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, AteTooltipDirective, createAngularComponentExtension, createDefaultSlashCommands, filterSlashCommands, provideAteEditor, registerAngularComponent };
1736
- export type { AteAngularNode, AteAutofocusMode, AteBlockControlsMode, AteBubbleMenuConfig, AteBubbleMenuKey, AteCellBubbleMenuConfig, AteCellBubbleMenuKey, AteColorEditMode, AteColorPickerSelection, AteComponentRenderOptions, AteCustomBubbleMenuItem, AteCustomSlashCommands, AteCustomToolbarItem, AteEditorConfig, AteEditorStateSnapshot, AteImageBubbleMenuConfig, AteImageBubbleMenuKey, AteImageData, AteImageUploadConfig, AteImageUploadContext, AteImageUploadHandler, AteImageUploadHandlerResult, AteImageUploadOptions, AteImageUploadResult, AteResizeOptions, AteSlashCommandItem, AteSlashCommandKey, AteSlashCommandsConfig, AteStateCalculator, AteTableBubbleMenuConfig, AteTableBubbleMenuKey, AteToolbarConfig, AteToolbarKey, AteTranslations, RegisterAngularComponentOptions, SupportedLocale };
4
+ /// <amd-module name="@flogeez/angular-tiptap-editor" />
5
+ export * from './public-api';