@flogeez/angular-tiptap-editor 3.1.4 → 3.1.5
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 +6 -0
- package/esm2022/lib/components/editor/angular-tiptap-editor.component.mjs +4 -3
- package/esm2022/lib/services/ate-editor-commands.service.mjs +34 -1
- package/esm2022/lib/services/ate-export.service.mjs +71 -0
- package/esm2022/lib/services/ate-i18n.service.mjs +28 -1
- package/esm2022/lib/utils/ate-markdown.utils.mjs +179 -0
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +309 -3
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/lib/services/ate-editor-commands.service.d.ts +14 -0
- package/lib/services/ate-export.service.d.ts +27 -0
- package/lib/services/ate-i18n.service.d.ts +26 -0
- package/lib/utils/ate-markdown.utils.d.ts +4 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Editor } from "@tiptap/core";
|
|
2
|
+
import { AteExportFormat, AteExportOptions } from "./ate-export.service";
|
|
2
3
|
import { AteEditorStateSnapshot } from "../models/ate-editor-state.model";
|
|
3
4
|
import { AteImageUploadHandler, AteImageUploadOptions } from "../models/ate-image.model";
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
@@ -6,6 +7,7 @@ export declare class AteEditorCommandsService {
|
|
|
6
7
|
private imageService;
|
|
7
8
|
private colorPickerSvc;
|
|
8
9
|
private linkSvc;
|
|
10
|
+
private exportSvc;
|
|
9
11
|
private readonly _editorState;
|
|
10
12
|
/** Exposed editor state as a readonly signal */
|
|
11
13
|
readonly editorState: import("@angular/core").Signal<AteEditorStateSnapshot>;
|
|
@@ -60,6 +62,18 @@ export declare class AteEditorCommandsService {
|
|
|
60
62
|
toggleHeaderColumn(editor: Editor): void;
|
|
61
63
|
toggleHeaderRow(editor: Editor): void;
|
|
62
64
|
clearContent(editor: Editor): void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the editor content in the given format.
|
|
67
|
+
* @param format 'html' | 'markdown' | 'text'
|
|
68
|
+
*/
|
|
69
|
+
getContent(editor: Editor, format: AteExportFormat): string;
|
|
70
|
+
/**
|
|
71
|
+
* Exports the editor content.
|
|
72
|
+
* @param format 'html' | 'markdown' | 'text'
|
|
73
|
+
* @param method 'clipboard' | 'download'
|
|
74
|
+
* @param options Optional filename for download
|
|
75
|
+
*/
|
|
76
|
+
exportAs(editor: Editor, format: AteExportFormat, method: "clipboard" | "download", options?: AteExportOptions): Promise<void>;
|
|
63
77
|
focus(editor: Editor): void;
|
|
64
78
|
blur(editor: Editor): void;
|
|
65
79
|
setContent(editor: Editor, content: string, emitUpdate?: boolean): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Editor } from "@tiptap/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/** Supported export formats */
|
|
4
|
+
export type AteExportFormat = "html" | "markdown" | "text";
|
|
5
|
+
/** Export delivery method */
|
|
6
|
+
export type AteExportMethod = "clipboard" | "download";
|
|
7
|
+
/** Options for file download */
|
|
8
|
+
export interface AteExportOptions {
|
|
9
|
+
/** Custom filename (without extension). Defaults to "document". */
|
|
10
|
+
filename?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class AteExportService {
|
|
13
|
+
/** Returns the editor content as HTML string. */
|
|
14
|
+
getHtml(editor: Editor): string;
|
|
15
|
+
/** Returns the editor content as plain text. */
|
|
16
|
+
getText(editor: Editor): string;
|
|
17
|
+
/** Returns the editor content converted to Markdown. */
|
|
18
|
+
getMarkdown(editor: Editor): string;
|
|
19
|
+
/** Returns the editor content in the specified format. */
|
|
20
|
+
getContent(editor: Editor, format: AteExportFormat): string;
|
|
21
|
+
/** Copies the editor content to the clipboard. */
|
|
22
|
+
exportToClipboard(editor: Editor, format: AteExportFormat): Promise<void>;
|
|
23
|
+
/** Downloads the editor content as a file. */
|
|
24
|
+
exportToFile(editor: Editor, format: AteExportFormat, options?: AteExportOptions): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AteExportService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AteExportService>;
|
|
27
|
+
}
|
|
@@ -172,6 +172,19 @@ export interface AteTranslations {
|
|
|
172
172
|
error: string;
|
|
173
173
|
success: string;
|
|
174
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
|
+
};
|
|
175
188
|
}
|
|
176
189
|
export declare class AteI18nService {
|
|
177
190
|
private _currentLocale;
|
|
@@ -352,6 +365,19 @@ export declare class AteI18nService {
|
|
|
352
365
|
error: string;
|
|
353
366
|
success: string;
|
|
354
367
|
}>;
|
|
368
|
+
readonly export: import("@angular/core").Signal<{
|
|
369
|
+
export: string;
|
|
370
|
+
html: string;
|
|
371
|
+
markdown: string;
|
|
372
|
+
text: string;
|
|
373
|
+
copyHtml: string;
|
|
374
|
+
copyMarkdown: string;
|
|
375
|
+
copyText: string;
|
|
376
|
+
downloadHtml: string;
|
|
377
|
+
downloadMarkdown: string;
|
|
378
|
+
downloadText: string;
|
|
379
|
+
copiedSuccess: string;
|
|
380
|
+
}>;
|
|
355
381
|
constructor();
|
|
356
382
|
setLocale(locale: SupportedLocale): void;
|
|
357
383
|
autoDetectLocale(): void;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./lib/services/ate-editor-commands.service";
|
|
|
7
7
|
export * from "./lib/services/ate-image.service";
|
|
8
8
|
export * from "./lib/services/ate-color-picker.service";
|
|
9
9
|
export * from "./lib/services/ate-link.service";
|
|
10
|
+
export * from "./lib/services/ate-export.service";
|
|
10
11
|
export * from "./lib/models/ate-editor-state.model";
|
|
11
12
|
export * from "./lib/extensions/calculators/ate-discovery.calculator";
|
|
12
13
|
export * from "./lib/extensions/calculators/ate-image.calculator";
|