@flogeez/angular-tiptap-editor 3.2.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +17 -19
  3. package/esm2022/lib/components/bubble-menus/base/ate-base-bubble-menu.mjs +3 -3
  4. package/esm2022/lib/components/bubble-menus/base/ate-base-sub-bubble-menu.mjs +1 -1
  5. package/esm2022/lib/components/bubble-menus/color/ate-color-bubble-menu.component.mjs +2 -2
  6. package/esm2022/lib/components/bubble-menus/link/ate-link-bubble-menu.component.mjs +2 -2
  7. package/esm2022/lib/components/edit-toggle/ate-edit-toggle.component.mjs +1 -1
  8. package/esm2022/lib/components/editor/angular-tiptap-editor.component.mjs +23 -7
  9. package/esm2022/lib/components/editor/ate-block-controls.component.mjs +4 -4
  10. package/esm2022/lib/components/slash-commands/ate-slash-commands.component.mjs +2 -2
  11. package/esm2022/lib/components/table-of-contents/ate-table-of-contents.component.mjs +359 -0
  12. package/esm2022/lib/extensions/ate-block-controls.extension.mjs +3 -3
  13. package/esm2022/lib/i18n/ateTranslationsModel.mjs +2 -0
  14. package/esm2022/lib/i18n/de_ateTranslations.mjs +190 -0
  15. package/esm2022/lib/i18n/en_ateTranslations.mjs +190 -0
  16. package/esm2022/lib/i18n/fr_ateTranslations.mjs +190 -0
  17. package/esm2022/lib/services/ate-i18n.service.mjs +6 -374
  18. package/esm2022/lib/services/ate-image.service.mjs +2 -2
  19. package/esm2022/public-api.mjs +2 -1
  20. package/fesm2022/flogeez-angular-tiptap-editor.mjs +589 -20
  21. package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
  22. package/lib/components/bubble-menus/base/ate-base-bubble-menu.d.ts +1 -1
  23. package/lib/components/bubble-menus/base/ate-base-sub-bubble-menu.d.ts +1 -1
  24. package/lib/components/edit-toggle/ate-edit-toggle.component.d.ts +1 -1
  25. package/lib/components/editor/angular-tiptap-editor.component.d.ts +3 -2
  26. package/lib/components/table-of-contents/ate-table-of-contents.component.d.ts +48 -0
  27. package/lib/i18n/ateTranslationsModel.d.ts +190 -0
  28. package/lib/i18n/de_ateTranslations.d.ts +2 -0
  29. package/lib/i18n/en_ateTranslations.d.ts +2 -0
  30. package/lib/i18n/fr_ateTranslations.d.ts +2 -0
  31. package/lib/services/ate-i18n.service.d.ts +5 -187
  32. package/package.json +1 -1
  33. package/public-api.d.ts +2 -1
  34. package/src/lib/styles/ate-variables.global.css +173 -0
  35. package/src/lib/styles/index.css +1 -0
@@ -14,7 +14,7 @@ export declare abstract class AteBaseBubbleMenu implements AfterViewInit, OnDest
14
14
  editor: import("@angular/core").InputSignal<Editor>;
15
15
  menuRef: import("@angular/core").Signal<ElementRef<HTMLDivElement>>;
16
16
  protected tippyInstance: TippyInstance | null;
17
- protected updateTimeout: number | null;
17
+ protected updateTimeout: ReturnType<typeof setTimeout> | null;
18
18
  protected readonly isToolbarInteracting: import("@angular/core").Signal<boolean>;
19
19
  readonly state: import("@angular/core").Signal<import("@flogeez/angular-tiptap-editor").AteEditorStateSnapshot>;
20
20
  constructor();
@@ -14,7 +14,7 @@ export declare abstract class AteBaseSubBubbleMenu implements AfterViewInit, OnD
14
14
  editor: import("@angular/core").InputSignal<Editor>;
15
15
  menuRef: import("@angular/core").Signal<ElementRef<HTMLDivElement>>;
16
16
  protected tippyInstance: TippyInstance | null;
17
- protected updateTimeout: number | null;
17
+ protected updateTimeout: ReturnType<typeof setTimeout> | null;
18
18
  readonly state: import("@angular/core").Signal<import("@flogeez/angular-tiptap-editor").AteEditorStateSnapshot>;
19
19
  constructor();
20
20
  ngAfterViewInit(): void;
@@ -1,4 +1,4 @@
1
- import { AteTranslations } from "../../services/ate-i18n.service";
1
+ import { AteTranslations } from "../../i18n/ateTranslationsModel";
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Edit Toggle Component
@@ -2,7 +2,7 @@ import { ElementRef, OnDestroy, AfterViewInit } from "@angular/core";
2
2
  import { Editor, EditorOptions, Extension, Node, Mark, JSONContent } from "@tiptap/core";
3
3
  import { Node as PMNode } from "@tiptap/pm/model";
4
4
  import { AteCustomSlashCommands } from "../../models/ate-slash-command.model";
5
- import { AteI18nService, SupportedLocale } from "../../services/ate-i18n.service";
5
+ import { AteI18nService } from "../../services/ate-i18n.service";
6
6
  import { AteEditorCommandsService } from "../../services/ate-editor-commands.service";
7
7
  import { AteStateCalculator } from "../../models/ate-editor-state.model";
8
8
  import { AteSlashCommandsConfig } from "../../config/ate-slash-commands.config";
@@ -10,6 +10,7 @@ import { AteToolbarConfig } from "../../models/ate-toolbar.model";
10
10
  import { AteBubbleMenuConfig } from "../../models/ate-bubble-menu.model";
11
11
  import { AteEditorConfig, AteAngularNode, AteBlockControlsMode, AteAutofocusMode } from "../../models/ate-editor-config.model";
12
12
  import { AteImageUploadHandler, AteImageUploadOptions, AteImageUploadResult } from "../../models/ate-image.model";
13
+ import { SupportedLocale } from "../../i18n/ateTranslationsModel";
13
14
  import * as i0 from "@angular/core";
14
15
  import * as i1 from "../../directives/ate-noop-value-accessor.directive";
15
16
  /**
@@ -171,7 +172,7 @@ export declare class AngularTiptapEditorComponent implements AfterViewInit, OnDe
171
172
  handler?: AteImageUploadHandler | undefined;
172
173
  }>;
173
174
  readonly finalImageUploadHandler: import("@angular/core").Signal<AteImageUploadHandler | undefined>;
174
- readonly currentTranslations: import("@angular/core").Signal<import("../../services/ate-i18n.service").AteTranslations>;
175
+ readonly currentTranslations: import("@angular/core").Signal<import("../../i18n/ateTranslationsModel").AteTranslations>;
175
176
  private _destroyRef;
176
177
  private ngControl;
177
178
  readonly i18nService: AteI18nService;
@@ -0,0 +1,48 @@
1
+ import { OnDestroy } from "@angular/core";
2
+ import { Editor } from "@tiptap/core";
3
+ import { AteEditorRef } from "../../models/ate-editor-ref";
4
+ import * as i0 from "@angular/core";
5
+ export interface AteTocItem {
6
+ text: string;
7
+ level: number;
8
+ pos: number;
9
+ id: string;
10
+ active: boolean;
11
+ }
12
+ export type AteTocVariant = "card" | "transparent" | "minimal";
13
+ /**
14
+ * Table of Contents Component (Notion-style)
15
+ * Dynamically extracts headings from the active editor and displays them.
16
+ * Configurable via inputs (floating, position, variants, hover expansion) and CSS variables.
17
+ */
18
+ export declare class AteTableOfContentsComponent implements OnDestroy {
19
+ editor: import("@angular/core").InputSignal<string | Editor | AteEditorRef | null | undefined>;
20
+ title: import("@angular/core").InputSignal<string | null>;
21
+ showTitle: import("@angular/core").InputSignal<boolean>;
22
+ floating: import("@angular/core").InputSignal<boolean>;
23
+ position: import("@angular/core").InputSignal<"left" | "right">;
24
+ variant: import("@angular/core").InputSignal<AteTocVariant>;
25
+ hoverExpand: import("@angular/core").InputSignal<boolean>;
26
+ private readonly registry;
27
+ private readonly i18n;
28
+ dashWidth(level: number): number;
29
+ readonly headerTitle: import("@angular/core").Signal<string>;
30
+ readonly resolvedEditor: import("@angular/core").Signal<Editor | null>;
31
+ readonly items: import("@angular/core").WritableSignal<AteTocItem[]>;
32
+ isMouseHovered: import("@angular/core").WritableSignal<boolean>;
33
+ isFocused: import("@angular/core").WritableSignal<boolean>;
34
+ readonly isExpanded: import("@angular/core").Signal<boolean>;
35
+ constructor();
36
+ ngOnDestroy(): void;
37
+ onScroll(): void;
38
+ setMouseHover(hovered: boolean): void;
39
+ setFocused(focused: boolean): void;
40
+ scrollToHeading(item: AteTocItem, event: MouseEvent): void;
41
+ private bindEditorEvents;
42
+ private unbindEditorEvents;
43
+ private readonly onEditorUpdate;
44
+ private updateHeadings;
45
+ private checkActiveHeading;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<AteTableOfContentsComponent, never>;
47
+ static ɵcmp: i0.ɵɵComponentDeclaration<AteTableOfContentsComponent, "ate-table-of-contents", never, { "editor": { "alias": "editor"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "showTitle": { "alias": "showTitle"; "required": false; "isSignal": true; }; "floating": { "alias": "floating"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "hoverExpand": { "alias": "hoverExpand"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
48
+ }
@@ -0,0 +1,190 @@
1
+ export type SupportedLocale = "en" | "fr" | "de" | (string & {});
2
+ export interface AteTranslations {
3
+ toolbar: {
4
+ bold: string;
5
+ italic: string;
6
+ underline: string;
7
+ strike: string;
8
+ code: string;
9
+ codeBlock: string;
10
+ superscript: string;
11
+ subscript: string;
12
+ highlight: string;
13
+ highlightPicker: string;
14
+ heading1: string;
15
+ heading2: string;
16
+ heading3: string;
17
+ bulletList: string;
18
+ orderedList: string;
19
+ blockquote: string;
20
+ alignLeft: string;
21
+ alignCenter: string;
22
+ alignRight: string;
23
+ alignJustify: string;
24
+ link: string;
25
+ image: string;
26
+ horizontalRule: string;
27
+ table: string;
28
+ undo: string;
29
+ redo: string;
30
+ clear: string;
31
+ textColor: string;
32
+ customColor: string;
33
+ presets: string;
34
+ };
35
+ bubbleMenu: {
36
+ bold: string;
37
+ italic: string;
38
+ underline: string;
39
+ strike: string;
40
+ code: string;
41
+ superscript: string;
42
+ subscript: string;
43
+ highlight: string;
44
+ highlightPicker: string;
45
+ textColor: string;
46
+ link: string;
47
+ addLink: string;
48
+ editLink: string;
49
+ removeLink: string;
50
+ linkUrl: string;
51
+ linkText: string;
52
+ openLink: string;
53
+ customColor: string;
54
+ presets: string;
55
+ };
56
+ slashCommands: {
57
+ heading1: {
58
+ title: string;
59
+ description: string;
60
+ keywords: string[];
61
+ };
62
+ heading2: {
63
+ title: string;
64
+ description: string;
65
+ keywords: string[];
66
+ };
67
+ heading3: {
68
+ title: string;
69
+ description: string;
70
+ keywords: string[];
71
+ };
72
+ bulletList: {
73
+ title: string;
74
+ description: string;
75
+ keywords: string[];
76
+ };
77
+ orderedList: {
78
+ title: string;
79
+ description: string;
80
+ keywords: string[];
81
+ };
82
+ blockquote: {
83
+ title: string;
84
+ description: string;
85
+ keywords: string[];
86
+ };
87
+ code: {
88
+ title: string;
89
+ description: string;
90
+ keywords: string[];
91
+ };
92
+ image: {
93
+ title: string;
94
+ description: string;
95
+ keywords: string[];
96
+ };
97
+ horizontalRule: {
98
+ title: string;
99
+ description: string;
100
+ keywords: string[];
101
+ };
102
+ table: {
103
+ title: string;
104
+ description: string;
105
+ keywords: string[];
106
+ };
107
+ };
108
+ table: {
109
+ addRowBefore: string;
110
+ addRowAfter: string;
111
+ deleteRow: string;
112
+ addColumnBefore: string;
113
+ addColumnAfter: string;
114
+ deleteColumn: string;
115
+ deleteTable: string;
116
+ toggleHeaderRow: string;
117
+ toggleHeaderColumn: string;
118
+ mergeCells: string;
119
+ splitCell: string;
120
+ };
121
+ imageUpload: {
122
+ selectImage: string;
123
+ loadError: string;
124
+ uploadingImage: string;
125
+ uploadProgress: string;
126
+ uploadError: string;
127
+ uploadSuccess: string;
128
+ imageTooLarge: string;
129
+ invalidFileType: string;
130
+ dragDropText: string;
131
+ changeImage: string;
132
+ downloadImage: string;
133
+ deleteImage: string;
134
+ resizeSmall: string;
135
+ resizeMedium: string;
136
+ resizeLarge: string;
137
+ resizeOriginal: string;
138
+ alignLeft: string;
139
+ alignCenter: string;
140
+ alignRight: string;
141
+ resizing: string;
142
+ compressing: string;
143
+ compressionError: string;
144
+ validating: string;
145
+ uploadingToServer: string;
146
+ replacingImage: string;
147
+ insertingImage: string;
148
+ noFileSelected: string;
149
+ selectionCancelled: string;
150
+ };
151
+ editor: {
152
+ placeholder: string;
153
+ character: string;
154
+ characterPlural: string;
155
+ word: string;
156
+ wordPlural: string;
157
+ linkPrompt: string;
158
+ linkUrlPrompt: string;
159
+ confirmDelete: string;
160
+ toggleEdit: string;
161
+ viewMode: string;
162
+ blockAdd: string;
163
+ blockDrag: string;
164
+ tableOfContents: string;
165
+ };
166
+ common: {
167
+ cancel: string;
168
+ confirm: string;
169
+ apply: string;
170
+ delete: string;
171
+ save: string;
172
+ close: string;
173
+ loading: string;
174
+ error: string;
175
+ success: string;
176
+ };
177
+ export: {
178
+ export: string;
179
+ html: string;
180
+ markdown: string;
181
+ text: string;
182
+ copyHtml: string;
183
+ copyMarkdown: string;
184
+ copyText: string;
185
+ downloadHtml: string;
186
+ downloadMarkdown: string;
187
+ downloadText: string;
188
+ copiedSuccess: string;
189
+ };
190
+ }
@@ -0,0 +1,2 @@
1
+ import { AteTranslations } from "./ateTranslationsModel";
2
+ export declare const GERMAN_TRANSLATIONS: AteTranslations;
@@ -0,0 +1,2 @@
1
+ import { AteTranslations } from "./ateTranslationsModel";
2
+ export declare const ENGLISH_TRANSLATIONS: AteTranslations;
@@ -0,0 +1,2 @@
1
+ import { AteTranslations } from "./ateTranslationsModel";
2
+ export declare const FRENCH_TRANSLATIONS: AteTranslations;
@@ -1,191 +1,5 @@
1
+ import { AteTranslations, SupportedLocale } from "../i18n/ateTranslationsModel";
1
2
  import * as i0 from "@angular/core";
2
- export type SupportedLocale = "en" | "fr" | (string & {});
3
- export interface AteTranslations {
4
- toolbar: {
5
- bold: string;
6
- italic: string;
7
- underline: string;
8
- strike: string;
9
- code: string;
10
- codeBlock: string;
11
- superscript: string;
12
- subscript: string;
13
- highlight: string;
14
- highlightPicker: string;
15
- heading1: string;
16
- heading2: string;
17
- heading3: string;
18
- bulletList: string;
19
- orderedList: string;
20
- blockquote: string;
21
- alignLeft: string;
22
- alignCenter: string;
23
- alignRight: string;
24
- alignJustify: string;
25
- link: string;
26
- image: string;
27
- horizontalRule: string;
28
- table: string;
29
- undo: string;
30
- redo: string;
31
- clear: string;
32
- textColor: string;
33
- customColor: string;
34
- presets: string;
35
- };
36
- bubbleMenu: {
37
- bold: string;
38
- italic: string;
39
- underline: string;
40
- strike: string;
41
- code: string;
42
- superscript: string;
43
- subscript: string;
44
- highlight: string;
45
- highlightPicker: string;
46
- textColor: string;
47
- link: string;
48
- addLink: string;
49
- editLink: string;
50
- removeLink: string;
51
- linkUrl: string;
52
- linkText: string;
53
- openLink: string;
54
- customColor: string;
55
- presets: string;
56
- };
57
- slashCommands: {
58
- heading1: {
59
- title: string;
60
- description: string;
61
- keywords: string[];
62
- };
63
- heading2: {
64
- title: string;
65
- description: string;
66
- keywords: string[];
67
- };
68
- heading3: {
69
- title: string;
70
- description: string;
71
- keywords: string[];
72
- };
73
- bulletList: {
74
- title: string;
75
- description: string;
76
- keywords: string[];
77
- };
78
- orderedList: {
79
- title: string;
80
- description: string;
81
- keywords: string[];
82
- };
83
- blockquote: {
84
- title: string;
85
- description: string;
86
- keywords: string[];
87
- };
88
- code: {
89
- title: string;
90
- description: string;
91
- keywords: string[];
92
- };
93
- image: {
94
- title: string;
95
- description: string;
96
- keywords: string[];
97
- };
98
- horizontalRule: {
99
- title: string;
100
- description: string;
101
- keywords: string[];
102
- };
103
- table: {
104
- title: string;
105
- description: string;
106
- keywords: string[];
107
- };
108
- };
109
- table: {
110
- addRowBefore: string;
111
- addRowAfter: string;
112
- deleteRow: string;
113
- addColumnBefore: string;
114
- addColumnAfter: string;
115
- deleteColumn: string;
116
- deleteTable: string;
117
- toggleHeaderRow: string;
118
- toggleHeaderColumn: string;
119
- mergeCells: string;
120
- splitCell: string;
121
- };
122
- imageUpload: {
123
- selectImage: string;
124
- loadError: string;
125
- uploadingImage: string;
126
- uploadProgress: string;
127
- uploadError: string;
128
- uploadSuccess: string;
129
- imageTooLarge: string;
130
- invalidFileType: string;
131
- dragDropText: string;
132
- changeImage: string;
133
- downloadImage: string;
134
- deleteImage: string;
135
- resizeSmall: string;
136
- resizeMedium: string;
137
- resizeLarge: string;
138
- resizeOriginal: string;
139
- alignLeft: string;
140
- alignCenter: string;
141
- alignRight: string;
142
- resizing: string;
143
- compressing: string;
144
- compressionError: string;
145
- validating: string;
146
- uploadingToServer: string;
147
- replacingImage: string;
148
- insertingImage: string;
149
- noFileSelected: string;
150
- selectionCancelled: string;
151
- };
152
- editor: {
153
- placeholder: string;
154
- character: string;
155
- word: string;
156
- linkPrompt: string;
157
- linkUrlPrompt: string;
158
- confirmDelete: string;
159
- toggleEdit: string;
160
- viewMode: string;
161
- blockAdd: string;
162
- blockDrag: string;
163
- };
164
- common: {
165
- cancel: string;
166
- confirm: string;
167
- apply: string;
168
- delete: string;
169
- save: string;
170
- close: string;
171
- loading: string;
172
- error: string;
173
- success: string;
174
- };
175
- export: {
176
- export: string;
177
- html: string;
178
- markdown: string;
179
- text: string;
180
- copyHtml: string;
181
- copyMarkdown: string;
182
- copyText: string;
183
- downloadHtml: string;
184
- downloadMarkdown: string;
185
- downloadText: string;
186
- copiedSuccess: string;
187
- };
188
- }
189
3
  export declare class AteI18nService {
190
4
  private _currentLocale;
191
5
  private _translations;
@@ -217,6 +31,7 @@ export declare class AteI18nService {
217
31
  alignJustify: string;
218
32
  link: string;
219
33
  image: string;
34
+ /** All loaded translations (useful for dynamic key access) */
220
35
  horizontalRule: string;
221
36
  table: string;
222
37
  undo: string;
@@ -345,7 +160,9 @@ export declare class AteI18nService {
345
160
  readonly editor: import("@angular/core").Signal<{
346
161
  placeholder: string;
347
162
  character: string;
163
+ characterPlural: string;
348
164
  word: string;
165
+ wordPlural: string;
349
166
  linkPrompt: string;
350
167
  linkUrlPrompt: string;
351
168
  confirmDelete: string;
@@ -353,6 +170,7 @@ export declare class AteI18nService {
353
170
  viewMode: string;
354
171
  blockAdd: string;
355
172
  blockDrag: string;
173
+ tableOfContents: string;
356
174
  }>;
357
175
  readonly common: import("@angular/core").Signal<{
358
176
  cancel: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flogeez/angular-tiptap-editor",
3
- "version": "3.2.2",
3
+ "version": "3.4.0",
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",
package/public-api.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./lib/components/editor/angular-tiptap-editor.component";
2
+ export { AteTableOfContentsComponent, type AteTocItem, type AteTocVariant } from "./lib/components/table-of-contents/ate-table-of-contents.component";
2
3
  export * from "./lib/ate-editor.provider";
3
4
  export * from "./lib/directives/ate-noop-value-accessor.directive";
4
5
  export * from "./lib/directives/ate-tooltip.directive";
@@ -25,7 +26,7 @@ export * from "./lib/models/ate-slash-command.model";
25
26
  export * from "./lib/config/ate-editor.config";
26
27
  export * from "./lib/config/ate-global-config.token";
27
28
  export * from "./lib/config/ate-slash-commands.config";
28
- export type { SupportedLocale } from "./lib/services/ate-i18n.service";
29
+ export type { SupportedLocale } from "./lib/i18n/ateTranslationsModel";
29
30
  export { AteAngularNodeView } from "./lib/node-view/ate-angular-node-view";
30
31
  export { AteNodeViewRenderer } from "./lib/node-view/ate-node-view.renderer";
31
32
  export { createAngularComponentExtension } from "./lib/node-view/ate-node-view.factory";