@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.
@@ -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;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * HTML to Markdown converter utility (no external dependencies).
3
+ */
4
+ export declare function htmlToMarkdown(html: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flogeez/angular-tiptap-editor",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
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
@@ -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";