@flogeez/angular-tiptap-editor 3.7.0 → 3.8.1
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 +18 -0
- package/esm2022/lib/components/editor/angular-tiptap-editor.component.mjs +30 -20
- package/esm2022/lib/components/slash-commands/ate-slash-commands.component.mjs +5 -7
- package/esm2022/lib/services/ate-image.service.mjs +83 -36
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +114 -60
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/lib/components/editor/angular-tiptap-editor.component.d.ts +7 -0
- package/lib/services/ate-image.service.d.ts +15 -1
- package/package.json +12 -12
|
@@ -132,6 +132,8 @@ export declare class AngularTiptapEditorComponent implements AfterViewInit, OnDe
|
|
|
132
132
|
private _wordCount;
|
|
133
133
|
private _isDragOver;
|
|
134
134
|
private _editorFullyInitialized;
|
|
135
|
+
/** Technical config the current editor was created with, see `technicalConfig()` */
|
|
136
|
+
private editorTechnicalConfig;
|
|
135
137
|
private _hoveredBlock;
|
|
136
138
|
private lastEmittedHtml;
|
|
137
139
|
readonly editor: import("@angular/core").Signal<Editor | null>;
|
|
@@ -262,6 +264,11 @@ export declare class AngularTiptapEditorComponent implements AfterViewInit, OnDe
|
|
|
262
264
|
constructor();
|
|
263
265
|
ngAfterViewInit(): void;
|
|
264
266
|
ngOnDestroy(): void;
|
|
267
|
+
/**
|
|
268
|
+
* Settings that require re-creating the editor when they change.
|
|
269
|
+
* Each computed compares by value, so a new reference means a real change.
|
|
270
|
+
*/
|
|
271
|
+
private technicalConfig;
|
|
265
272
|
private initEditor;
|
|
266
273
|
toggleEditMode(event: Event): void;
|
|
267
274
|
private updateCharacterCount;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Editor } from "@tiptap/core";
|
|
2
2
|
import { AteResizeOptions, AteImageUploadOptions, AteImageUploadHandler, AteImageSrcResolver, AteImageUploadResult, AteImageData, AteImageRejection, AteImageSource, AteImageValidationReason } from "../models/ate-image.model";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/** An image position followed through document changes, see `trackSelectedImage` */
|
|
5
|
+
interface AteTrackedImage {
|
|
6
|
+
/** Current position of the image, or `null` when no image was selected */
|
|
7
|
+
pos: () => number | null;
|
|
8
|
+
stop: () => void;
|
|
9
|
+
}
|
|
4
10
|
export declare class AteImageService {
|
|
5
11
|
onImageUploadedCallback?: (result: AteImageUploadResult) => void;
|
|
6
12
|
onImageRejectedCallback?: (rejection: AteImageRejection) => void;
|
|
@@ -79,7 +85,14 @@ export declare class AteImageService {
|
|
|
79
85
|
/** Select file and replace currently selected image */
|
|
80
86
|
selectAndReplaceImage(editor: Editor, options?: AteImageUploadOptions): Promise<void>;
|
|
81
87
|
/** Internal helper used by replacement logic */
|
|
82
|
-
uploadAndReplaceImage(editor: Editor, file: File, options?: AteImageUploadOptions, source?: AteImageSource): Promise<void>;
|
|
88
|
+
uploadAndReplaceImage(editor: Editor, file: File, options?: AteImageUploadOptions, source?: AteImageSource, target?: AteTrackedImage): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Remembers the selected image and follows its position through the transactions
|
|
91
|
+
* dispatched until `stop()` (e.g. while the file picker is open and the image uploads).
|
|
92
|
+
*/
|
|
93
|
+
private trackSelectedImage;
|
|
94
|
+
/** Replaces the image at `pos` with `imageData` (keeping its other attributes) and selects it */
|
|
95
|
+
private replaceImageAt;
|
|
83
96
|
/**
|
|
84
97
|
* Handle image drop event.
|
|
85
98
|
* Calculates the position from coordinates and sets the selection accordingly.
|
|
@@ -92,3 +105,4 @@ export declare class AteImageService {
|
|
|
92
105
|
static ɵfac: i0.ɵɵFactoryDeclaration<AteImageService, never>;
|
|
93
106
|
static ɵprov: i0.ɵɵInjectableDeclaration<AteImageService>;
|
|
94
107
|
}
|
|
108
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flogeez/angular-tiptap-editor",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.1",
|
|
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",
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
"@angular/core": ">=18.0.0",
|
|
28
28
|
"@angular/forms": ">=18.0.0",
|
|
29
29
|
"@fontsource/material-symbols-outlined": "^5.0.0",
|
|
30
|
-
"@tiptap/core": "^3.
|
|
31
|
-
"@tiptap/starter-kit": "^3.
|
|
32
|
-
"@tiptap/extensions": "^3.
|
|
33
|
-
"@tiptap/extension-superscript": "^3.
|
|
34
|
-
"@tiptap/extension-subscript": "^3.
|
|
35
|
-
"@tiptap/extension-text-align": "^3.
|
|
36
|
-
"@tiptap/extension-highlight": "^3.
|
|
37
|
-
"@tiptap/extension-table": "^3.
|
|
38
|
-
"@tiptap/extension-color": "^3.
|
|
39
|
-
"@tiptap/extension-text-style": "^3.
|
|
40
|
-
"@tiptap/pm": "^3.
|
|
30
|
+
"@tiptap/core": "^3.31.4",
|
|
31
|
+
"@tiptap/starter-kit": "^3.31.4",
|
|
32
|
+
"@tiptap/extensions": "^3.31.4",
|
|
33
|
+
"@tiptap/extension-superscript": "^3.31.4",
|
|
34
|
+
"@tiptap/extension-subscript": "^3.31.4",
|
|
35
|
+
"@tiptap/extension-text-align": "^3.31.4",
|
|
36
|
+
"@tiptap/extension-highlight": "^3.31.4",
|
|
37
|
+
"@tiptap/extension-table": "^3.31.4",
|
|
38
|
+
"@tiptap/extension-color": "^3.31.4",
|
|
39
|
+
"@tiptap/extension-text-style": "^3.31.4",
|
|
40
|
+
"@tiptap/pm": "^3.31.4",
|
|
41
41
|
"@intevation/tiptap-extension-office-paste": "^0.1.2",
|
|
42
42
|
"tippy.js": "^6.3.7"
|
|
43
43
|
},
|