@flogeez/angular-tiptap-editor 2.1.2 → 2.2.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.
- package/CHANGELOG.md +35 -1
- package/README.md +16 -53
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +1850 -1855
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/index.d.ts +163 -128
- package/package.json +1 -1
- package/src/lib/styles/{bubble-menu.global.css → ate-bubble-menu.global.css} +1 -2
- package/src/lib/styles/index.css +4 -4
- package/src/lib/styles/material-symbols.css +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,41 @@
|
|
|
3
3
|
All notable changes to `@flogeez/angular-tiptap-editor` will be documented in this file.
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), with the exception that the major version is specifically aligned with the major version of [Tiptap](https://tiptap.dev).
|
|
7
|
+
|
|
8
|
+
## [2.2.0] - 2026-01-21
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Internal Ecosystem Prefixing**: Systemic renaming of all internal classes, services, models, and constants to use the `Ate` or `ATE_` prefix (e.g., `AteI18nService`, `AteEditorCommandsService`, `ATE_INITIAL_EDITOR_STATE`). This provides better library identification and avoids collisions with third-party extensions.
|
|
13
|
+
- **UI Branding Refactoring**: Refactored internal component selectors and CSS classes to use the new `ate-` prefix (e.g., `ate-button`, `ate-toolbar`). The main editor selector remains `angular-tiptap-editor`.
|
|
14
|
+
- **Project Standards**: Enforced Unix-style line endings (**LF**) across the entire repository via `.gitattributes` to ensure cross-platform consistency.
|
|
15
|
+
|
|
16
|
+
### Breaking Changes
|
|
17
|
+
|
|
18
|
+
- **Renamed Public Exports**: Systemal renaming of internal library exports to use the `Ate` prefix. **Backward compatibility is maintained** via deprecated aliases for all renamed items, which will be removed in v3.0.0.
|
|
19
|
+
- `EditorCommandsService` -> `AteEditorCommandsService`
|
|
20
|
+
- `TiptapI18nService` -> `AteI18nService`
|
|
21
|
+
- `EditorStateSnapshot` -> `AteEditorStateSnapshot`
|
|
22
|
+
- `INITIAL_EDITOR_STATE` -> `ATE_INITIAL_EDITOR_STATE`
|
|
23
|
+
- `ToolbarConfig` -> `AteToolbarConfig`, etc.
|
|
24
|
+
- All TipTap extensions (e.g., `AteResizableImage`, `AteTiptapStateExtension`).
|
|
25
|
+
- **Internal Component Selectors**: If you were using internal library components directly in your templates (outside of the main editor), they now use the `ate-` prefix:
|
|
26
|
+
- `tiptap-toolbar` -> `ate-toolbar`
|
|
27
|
+
- `tiptap-button` -> `ate-button`
|
|
28
|
+
- `tiptap-bubble-menu` -> `ate-bubble-menu`
|
|
29
|
+
- **Main Editor Selector**: Unchanged (`angular-tiptap-editor`), preserving the existing facade.
|
|
30
|
+
|
|
31
|
+
## [2.1.3] - 2026-01-21
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **Linting & Code Quality**: Systematically resolved all remaining lint errors across the library and demo app.
|
|
36
|
+
- **Improved Type Safety**: Replaced numerous `any` types with specific interfaces or `unknown`, and added explicit `eslint-disable` comments where dynamic logic (like Tiptap chaining) requires it.
|
|
37
|
+
- **Accessibility (A11y)**: Enhanced interactive components with appropriate ARIA roles, `tabindex`, and keyboard event handlers (`keydown.enter`, `keydown.space`, `keydown.escape`) to meet modern accessibility standards.
|
|
38
|
+
- **Output Naming Consistency**: Renamed several `@Output()` properties to avoid conflicts with native DOM events and `on-` prefixes (e.g., `onClick` -> `buttonClick`).
|
|
39
|
+
- **Regular Expressions**: Fixed redundant escape characters in slash command patterns.
|
|
40
|
+
- **Case Declarations**: Wrapped switch case blocks with curly braces to properly scope lexical declarations.
|
|
7
41
|
|
|
8
42
|
## [2.1.2] - 2026-01-21
|
|
9
43
|
|
package/README.md
CHANGED
|
@@ -69,12 +69,7 @@ import { AngularTiptapEditorComponent } from "@flogeez/angular-tiptap-editor";
|
|
|
69
69
|
selector: "app-example",
|
|
70
70
|
standalone: true,
|
|
71
71
|
imports: [AngularTiptapEditorComponent],
|
|
72
|
-
template: `
|
|
73
|
-
<angular-tiptap-editor
|
|
74
|
-
[content]="content"
|
|
75
|
-
(contentChange)="onContentChange($event)"
|
|
76
|
-
/>
|
|
77
|
-
`,
|
|
72
|
+
template: ` <angular-tiptap-editor [content]="content" (contentChange)="onContentChange($event)" /> `,
|
|
78
73
|
})
|
|
79
74
|
export class ExampleComponent {
|
|
80
75
|
content = "<p>Hello <strong>World</strong>!</p>";
|
|
@@ -92,22 +87,14 @@ The editor can be fully configured using a single `[config]` object, which provi
|
|
|
92
87
|
|
|
93
88
|
```typescript
|
|
94
89
|
import { Component } from "@angular/core";
|
|
95
|
-
import {
|
|
96
|
-
AngularTiptapEditorComponent,
|
|
97
|
-
AteEditorConfig,
|
|
98
|
-
DEFAULT_TOOLBAR_CONFIG,
|
|
99
|
-
} from "@flogeez/angular-tiptap-editor";
|
|
90
|
+
import { AngularTiptapEditorComponent, AteEditorConfig, DEFAULT_TOOLBAR_CONFIG } from "@flogeez/angular-tiptap-editor";
|
|
100
91
|
|
|
101
92
|
@Component({
|
|
102
93
|
selector: "app-advanced",
|
|
103
94
|
standalone: true,
|
|
104
95
|
imports: [AngularTiptapEditorComponent],
|
|
105
96
|
template: `
|
|
106
|
-
<angular-tiptap-editor
|
|
107
|
-
[content]="content"
|
|
108
|
-
[config]="editorConfig"
|
|
109
|
-
(contentChange)="onContentChange($event)"
|
|
110
|
-
/>
|
|
97
|
+
<angular-tiptap-editor [content]="content" [config]="editorConfig" (contentChange)="onContentChange($event)" />
|
|
111
98
|
`,
|
|
112
99
|
})
|
|
113
100
|
export class AdvancedComponent {
|
|
@@ -155,11 +142,7 @@ import { AngularTiptapEditorComponent } from "@flogeez/angular-tiptap-editor";
|
|
|
155
142
|
standalone: true,
|
|
156
143
|
imports: [AngularTiptapEditorComponent],
|
|
157
144
|
template: `
|
|
158
|
-
<angular-tiptap-editor
|
|
159
|
-
[content]="content"
|
|
160
|
-
[tiptapExtensions]="extensions"
|
|
161
|
-
(contentChange)="content = $event"
|
|
162
|
-
/>
|
|
145
|
+
<angular-tiptap-editor [content]="content" [tiptapExtensions]="extensions" (contentChange)="content = $event" />
|
|
163
146
|
`,
|
|
164
147
|
})
|
|
165
148
|
export class CustomExtensionsComponent {
|
|
@@ -190,8 +173,7 @@ import { AngularTiptapEditorComponent } from "@flogeez/angular-tiptap-editor";
|
|
|
190
173
|
[formControl]="contentControl"
|
|
191
174
|
placeholder="Enter your content here..."
|
|
192
175
|
[showCharacterCount]="true"
|
|
193
|
-
[showWordCount]="true"
|
|
194
|
-
/>
|
|
176
|
+
[showWordCount]="true" />
|
|
195
177
|
<button type="submit">Submit</button>
|
|
196
178
|
</form>
|
|
197
179
|
`,
|
|
@@ -244,10 +226,7 @@ export class CommandsComponent {
|
|
|
244
226
|
|
|
245
227
|
setContent() {
|
|
246
228
|
if (this.editor) {
|
|
247
|
-
this.editorCommandsService.setContent(
|
|
248
|
-
this.editor,
|
|
249
|
-
"<h1>New Content</h1>",
|
|
250
|
-
);
|
|
229
|
+
this.editorCommandsService.setContent(this.editor, "<h1>New Content</h1>");
|
|
251
230
|
}
|
|
252
231
|
}
|
|
253
232
|
}
|
|
@@ -274,7 +253,7 @@ If you need to extract complex data (like attributes, depth, or custom logic), y
|
|
|
274
253
|
import { StateCalculator } from "@flogeez/angular-tiptap-editor";
|
|
275
254
|
|
|
276
255
|
// This function will be called on every editor update
|
|
277
|
-
export const MyCustomCalculator: StateCalculator =
|
|
256
|
+
export const MyCustomCalculator: StateCalculator = editor => {
|
|
278
257
|
return {
|
|
279
258
|
custom: {
|
|
280
259
|
hasHighPriority: editor.isActive("priority"),
|
|
@@ -343,7 +322,7 @@ slashCommands: SlashCommandsConfig = {
|
|
|
343
322
|
description: "Insert some AI magic",
|
|
344
323
|
icon: "auto_fix",
|
|
345
324
|
keywords: ["magic", "ai"],
|
|
346
|
-
command:
|
|
325
|
+
command: editor => editor.commands.insertContent("✨ Magic happened!"),
|
|
347
326
|
},
|
|
348
327
|
],
|
|
349
328
|
};
|
|
@@ -372,10 +351,7 @@ The handler can return either an **Observable** or a **Promise**.
|
|
|
372
351
|
import { Component, inject } from "@angular/core";
|
|
373
352
|
import { HttpClient } from "@angular/common/http";
|
|
374
353
|
import { map } from "rxjs/operators";
|
|
375
|
-
import {
|
|
376
|
-
AngularTiptapEditorComponent,
|
|
377
|
-
ImageUploadHandler,
|
|
378
|
-
} from "@flogeez/angular-tiptap-editor";
|
|
354
|
+
import { AngularTiptapEditorComponent, ImageUploadHandler } from "@flogeez/angular-tiptap-editor";
|
|
379
355
|
|
|
380
356
|
@Component({
|
|
381
357
|
selector: "app-custom-upload",
|
|
@@ -385,21 +361,18 @@ import {
|
|
|
385
361
|
<angular-tiptap-editor
|
|
386
362
|
[content]="content"
|
|
387
363
|
[imageUploadHandler]="uploadHandler"
|
|
388
|
-
(contentChange)="onContentChange($event)"
|
|
389
|
-
/>
|
|
364
|
+
(contentChange)="onContentChange($event)" />
|
|
390
365
|
`,
|
|
391
366
|
})
|
|
392
367
|
export class CustomUploadComponent {
|
|
393
368
|
private http = inject(HttpClient);
|
|
394
369
|
content = "";
|
|
395
370
|
|
|
396
|
-
uploadHandler: ImageUploadHandler =
|
|
371
|
+
uploadHandler: ImageUploadHandler = ctx => {
|
|
397
372
|
const formData = new FormData();
|
|
398
373
|
formData.append("image", ctx.file);
|
|
399
374
|
|
|
400
|
-
return this.http
|
|
401
|
-
.post<{ url: string }>("/api/upload", formData)
|
|
402
|
-
.pipe(map((result) => ({ src: result.url })));
|
|
375
|
+
return this.http.post<{ url: string }>("/api/upload", formData).pipe(map(result => ({ src: result.url })));
|
|
403
376
|
};
|
|
404
377
|
|
|
405
378
|
onContentChange(newContent: string) {
|
|
@@ -411,13 +384,11 @@ export class CustomUploadComponent {
|
|
|
411
384
|
#### Using Promise (async/await)
|
|
412
385
|
|
|
413
386
|
```typescript
|
|
414
|
-
uploadHandler: ImageUploadHandler = async
|
|
387
|
+
uploadHandler: ImageUploadHandler = async ctx => {
|
|
415
388
|
const formData = new FormData();
|
|
416
389
|
formData.append("image", ctx.file);
|
|
417
390
|
|
|
418
|
-
const result = await firstValueFrom(
|
|
419
|
-
this.http.post<{ url: string }>("/api/upload", formData),
|
|
420
|
-
);
|
|
391
|
+
const result = await firstValueFrom(this.http.post<{ url: string }>("/api/upload", formData));
|
|
421
392
|
|
|
422
393
|
return { src: result.url };
|
|
423
394
|
};
|
|
@@ -619,16 +590,8 @@ angular-tiptap-editor {
|
|
|
619
590
|
--ate-primary: #2563eb;
|
|
620
591
|
--ate-primary-contrast: #ffffff;
|
|
621
592
|
--ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 90%);
|
|
622
|
-
--ate-primary-lighter: color-mix(
|
|
623
|
-
|
|
624
|
-
var(--ate-primary),
|
|
625
|
-
transparent 95%
|
|
626
|
-
);
|
|
627
|
-
--ate-primary-light-alpha: color-mix(
|
|
628
|
-
in srgb,
|
|
629
|
-
var(--ate-primary),
|
|
630
|
-
transparent 85%
|
|
631
|
-
);
|
|
593
|
+
--ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 95%);
|
|
594
|
+
--ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 85%);
|
|
632
595
|
|
|
633
596
|
--ate-surface: #ffffff;
|
|
634
597
|
--ate-surface-secondary: #f8f9fa;
|