@flogeez/angular-tiptap-editor 3.4.1 → 3.4.2
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 +11 -0
- package/esm2022/lib/components/table-of-contents/ate-table-of-contents.component.mjs +14 -3
- package/esm2022/lib/components/table-of-contents/ate-toc-node.component.mjs +9 -4
- package/esm2022/lib/config/ate-toc.config.mjs +13 -0
- package/esm2022/lib/models/ate-editor-config.model.mjs +1 -1
- package/esm2022/lib/models/ate-toc.model.mjs +2 -0
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +35 -6
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/lib/components/editor/angular-tiptap-editor.component.d.ts +1 -0
- package/lib/components/table-of-contents/ate-table-of-contents.component.d.ts +3 -9
- package/lib/config/ate-toc.config.d.ts +5 -0
- package/lib/models/ate-editor-config.model.d.ts +3 -0
- package/lib/models/ate-toc.model.d.ts +26 -0
- package/package.json +1 -1
- package/public-api.d.ts +3 -1
|
@@ -220,6 +220,7 @@ export declare class AngularTiptapEditorComponent implements AfterViewInit, OnDe
|
|
|
220
220
|
tableBubbleMenu?: Partial<Record<"addColumnBefore" | "addColumnAfter" | "deleteColumn" | "addRowBefore" | "addRowAfter" | "deleteRow" | "deleteTable" | "toggleHeaderColumn" | "toggleHeaderRow" | "separator", boolean>> | undefined;
|
|
221
221
|
cellBubbleMenu?: Partial<Record<"mergeCells" | "splitCell", boolean>> | undefined;
|
|
222
222
|
slashCommands?: AteSlashCommandsConfig | undefined;
|
|
223
|
+
tableOfContents?: import("@flogeez/angular-tiptap-editor").AteTocConfig | undefined;
|
|
223
224
|
floatingToolbar?: boolean | undefined;
|
|
224
225
|
imageUpload?: import("../../models/ate-image.model").AteImageUploadConfig | undefined;
|
|
225
226
|
angularNodes?: AteAngularNode[] | undefined;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { OnDestroy } from "@angular/core";
|
|
2
2
|
import { Editor } from "@tiptap/core";
|
|
3
3
|
import { AteEditorRef } from "../../models/ate-editor-ref";
|
|
4
|
+
import { AteTocItem, AteTocVariant } from "../../models/ate-toc.model";
|
|
4
5
|
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
6
|
/**
|
|
14
7
|
* Table of Contents Component (Notion-style)
|
|
15
8
|
* Dynamically extracts headings from the active editor and displays them.
|
|
@@ -23,6 +16,7 @@ export declare class AteTableOfContentsComponent implements OnDestroy {
|
|
|
23
16
|
position: import("@angular/core").InputSignal<"left" | "right">;
|
|
24
17
|
variant: import("@angular/core").InputSignal<AteTocVariant>;
|
|
25
18
|
hoverExpand: import("@angular/core").InputSignal<boolean>;
|
|
19
|
+
maxDepth: import("@angular/core").InputSignalWithTransform<number, string | number>;
|
|
26
20
|
private readonly registry;
|
|
27
21
|
private readonly i18n;
|
|
28
22
|
dashWidth(level: number): number;
|
|
@@ -44,5 +38,5 @@ export declare class AteTableOfContentsComponent implements OnDestroy {
|
|
|
44
38
|
private updateHeadings;
|
|
45
39
|
private checkActiveHeading;
|
|
46
40
|
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>;
|
|
41
|
+
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; }; "maxDepth": { "alias": "maxDepth"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
48
42
|
}
|
|
@@ -4,6 +4,7 @@ import { RegisterAngularComponentOptions } from "../node-view/ate-node-view.mode
|
|
|
4
4
|
import { AteBubbleMenuConfig, AteImageBubbleMenuConfig, AteTableBubbleMenuConfig, AteCellBubbleMenuConfig } from "./ate-bubble-menu.model";
|
|
5
5
|
import { AteSlashCommandsConfig } from "../config/ate-slash-commands.config";
|
|
6
6
|
import { AteImageUploadConfig } from "./ate-image.model";
|
|
7
|
+
import { AteTocConfig } from "./ate-toc.model";
|
|
7
8
|
import { Extension, Node, Mark, EditorOptions } from "@tiptap/core";
|
|
8
9
|
import { AteStateCalculator } from "./ate-editor-state.model";
|
|
9
10
|
import { AteCustomSlashCommands } from "./ate-slash-command.model";
|
|
@@ -90,6 +91,8 @@ export interface AteEditorConfig {
|
|
|
90
91
|
cellBubbleMenu?: AteCellBubbleMenuConfig;
|
|
91
92
|
/** Slash commands configuration (/) */
|
|
92
93
|
slashCommands?: AteSlashCommandsConfig;
|
|
94
|
+
/** Table of Contents configuration */
|
|
95
|
+
tableOfContents?: AteTocConfig;
|
|
93
96
|
/** If true, shows the floating toolbar on focus */
|
|
94
97
|
floatingToolbar?: boolean;
|
|
95
98
|
/** Technical configuration for image uploads */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visual variants for Table of Contents
|
|
3
|
+
*/
|
|
4
|
+
export type AteTocVariant = "card" | "transparent" | "minimal";
|
|
5
|
+
/**
|
|
6
|
+
* Item structure extracted by Table of Contents
|
|
7
|
+
*/
|
|
8
|
+
export interface AteTocItem {
|
|
9
|
+
text: string;
|
|
10
|
+
level: number;
|
|
11
|
+
pos: number;
|
|
12
|
+
id: string;
|
|
13
|
+
active: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Configuration options for Table of Contents
|
|
17
|
+
*/
|
|
18
|
+
export interface AteTocConfig {
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
floating?: boolean;
|
|
21
|
+
position?: "left" | "right";
|
|
22
|
+
variant?: AteTocVariant;
|
|
23
|
+
hoverExpand?: boolean;
|
|
24
|
+
showTitle?: boolean;
|
|
25
|
+
maxDepth?: number;
|
|
26
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./lib/components/editor/angular-tiptap-editor.component";
|
|
2
|
-
export { AteTableOfContentsComponent
|
|
2
|
+
export { AteTableOfContentsComponent } from "./lib/components/table-of-contents/ate-table-of-contents.component";
|
|
3
3
|
export { AteTocNodeComponent, AteTocNodeOptions, getAteTocNodeExtension } from "./lib/components/table-of-contents/ate-toc-node.component";
|
|
4
4
|
export * from "./lib/ate-editor.provider";
|
|
5
5
|
export * from "./lib/directives/ate-noop-value-accessor.directive";
|
|
@@ -24,8 +24,10 @@ export * from "./lib/models/ate-image.model";
|
|
|
24
24
|
export * from "./lib/models/ate-bubble-menu.model";
|
|
25
25
|
export * from "./lib/models/ate-editor-config.model";
|
|
26
26
|
export * from "./lib/models/ate-slash-command.model";
|
|
27
|
+
export * from "./lib/models/ate-toc.model";
|
|
27
28
|
export * from "./lib/config/ate-editor.config";
|
|
28
29
|
export * from "./lib/config/ate-global-config.token";
|
|
30
|
+
export * from "./lib/config/ate-toc.config";
|
|
29
31
|
export * from "./lib/config/ate-slash-commands.config";
|
|
30
32
|
export type { SupportedLocale } from "./lib/i18n/ateTranslationsModel";
|
|
31
33
|
export { AteAngularNodeView } from "./lib/node-view/ate-angular-node-view";
|