@3ddv/software-division-components 1.4.11 → 1.5.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/fesm2022/3ddv-software-division-components.mjs +605 -4
- package/fesm2022/3ddv-software-division-components.mjs.map +1 -1
- package/generic/public-api.d.ts +1 -0
- package/generic/public-api.d.ts.map +1 -1
- package/generic/rich-text-editor/components/editor-toolbar/editor-toolbar.component.d.ts +88 -0
- package/generic/rich-text-editor/components/editor-toolbar/editor-toolbar.component.d.ts.map +1 -0
- package/generic/rich-text-editor/components/link-modal/link-modal.component.d.ts +43 -0
- package/generic/rich-text-editor/components/link-modal/link-modal.component.d.ts.map +1 -0
- package/generic/rich-text-editor/index.d.ts +2 -0
- package/generic/rich-text-editor/index.d.ts.map +1 -0
- package/generic/rich-text-editor/models/editor-config.model.d.ts +46 -0
- package/generic/rich-text-editor/models/editor-config.model.d.ts.map +1 -0
- package/generic/rich-text-editor/models/index.d.ts +3 -0
- package/generic/rich-text-editor/models/index.d.ts.map +1 -0
- package/generic/rich-text-editor/models/toolbar-config.model.d.ts +63 -0
- package/generic/rich-text-editor/models/toolbar-config.model.d.ts.map +1 -0
- package/generic/rich-text-editor/public-api.d.ts +5 -0
- package/generic/rich-text-editor/public-api.d.ts.map +1 -0
- package/generic/rich-text-editor/rich-text-editor.component.d.ts +113 -0
- package/generic/rich-text-editor/rich-text-editor.component.d.ts.map +1 -0
- package/package.json +25 -1
package/generic/public-api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/generic/public-api.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/generic/public-api.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { ToolbarConfig } from '../../models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Toolbar component for the rich text editor
|
|
6
|
+
* Provides formatting buttons with responsive design and active state tracking
|
|
7
|
+
*/
|
|
8
|
+
export declare class EditorToolbarComponent {
|
|
9
|
+
/** The TipTap editor instance */
|
|
10
|
+
readonly editor: import("@angular/core").InputSignal<Editor>;
|
|
11
|
+
/** Toolbar configuration */
|
|
12
|
+
readonly config: import("@angular/core").InputSignal<ToolbarConfig>;
|
|
13
|
+
/** Event emitted when link button is clicked */
|
|
14
|
+
readonly linkRequested: import("@angular/core").OutputEmitterRef<void>;
|
|
15
|
+
/** Mobile menu visibility state */
|
|
16
|
+
readonly showMobileMenu: import("@angular/core").WritableSignal<boolean>;
|
|
17
|
+
/** Computed config with defaults applied */
|
|
18
|
+
protected readonly mergedConfig: import("@angular/core").Signal<{
|
|
19
|
+
bold?: boolean;
|
|
20
|
+
italic?: boolean;
|
|
21
|
+
underline?: boolean;
|
|
22
|
+
strike?: boolean;
|
|
23
|
+
bulletList?: boolean;
|
|
24
|
+
orderedList?: boolean;
|
|
25
|
+
headings?: (1 | 2 | 3 | 4 | 5 | 6)[];
|
|
26
|
+
horizontalRule?: boolean;
|
|
27
|
+
link?: boolean;
|
|
28
|
+
blockquote?: boolean;
|
|
29
|
+
code?: boolean;
|
|
30
|
+
codeBlock?: boolean;
|
|
31
|
+
undo?: boolean;
|
|
32
|
+
redo?: boolean;
|
|
33
|
+
customButtons?: import("../../models").CustomToolbarButton[];
|
|
34
|
+
}>;
|
|
35
|
+
/** Check if any formatting option is enabled */
|
|
36
|
+
protected readonly hasFormattingOptions: import("@angular/core").Signal<boolean | undefined>;
|
|
37
|
+
/** Check if any list option is enabled */
|
|
38
|
+
protected readonly hasListOptions: import("@angular/core").Signal<boolean | undefined>;
|
|
39
|
+
/** Check if any heading is enabled */
|
|
40
|
+
protected readonly hasHeadings: import("@angular/core").Signal<boolean | undefined>;
|
|
41
|
+
/** Check if history buttons are enabled */
|
|
42
|
+
protected readonly hasHistory: import("@angular/core").Signal<boolean | undefined>;
|
|
43
|
+
/** Check if code options are enabled */
|
|
44
|
+
protected readonly hasCodeOptions: import("@angular/core").Signal<boolean | undefined>;
|
|
45
|
+
/** Toggle mobile menu visibility */
|
|
46
|
+
toggleMobileMenu(): void;
|
|
47
|
+
/** Toggle heading with smart selection handling */
|
|
48
|
+
toggleHeading(level: 1 | 2 | 3 | 4 | 5 | 6): void;
|
|
49
|
+
/** Request link insertion/editing */
|
|
50
|
+
setLink(): void;
|
|
51
|
+
/** Toggle bold formatting */
|
|
52
|
+
toggleBold(): void;
|
|
53
|
+
/** Toggle italic formatting */
|
|
54
|
+
toggleItalic(): void;
|
|
55
|
+
/** Toggle underline formatting */
|
|
56
|
+
toggleUnderline(): void;
|
|
57
|
+
/** Toggle strikethrough formatting */
|
|
58
|
+
toggleStrike(): void;
|
|
59
|
+
/** Toggle bullet list */
|
|
60
|
+
toggleBulletList(): void;
|
|
61
|
+
/** Toggle ordered list */
|
|
62
|
+
toggleOrderedList(): void;
|
|
63
|
+
/** Insert horizontal rule */
|
|
64
|
+
insertHorizontalRule(): void;
|
|
65
|
+
/** Toggle blockquote */
|
|
66
|
+
toggleBlockquote(): void;
|
|
67
|
+
/** Toggle inline code */
|
|
68
|
+
toggleCode(): void;
|
|
69
|
+
/** Toggle code block */
|
|
70
|
+
toggleCodeBlock(): void;
|
|
71
|
+
/** Undo last action */
|
|
72
|
+
undo(): void;
|
|
73
|
+
/** Redo last undone action */
|
|
74
|
+
redo(): void;
|
|
75
|
+
/** Remove link from selection */
|
|
76
|
+
unsetLink(): void;
|
|
77
|
+
/** Check if a formatting type is active */
|
|
78
|
+
isActive(type: string, options?: Record<string, unknown>): boolean;
|
|
79
|
+
/** Track function for heading levels */
|
|
80
|
+
trackByLevel(index: number, level: number): number;
|
|
81
|
+
/** Track function for custom buttons */
|
|
82
|
+
trackByButtonId(index: number, btn: {
|
|
83
|
+
id: string;
|
|
84
|
+
}): string;
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditorToolbarComponent, never>;
|
|
86
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditorToolbarComponent, "sdc-editor-toolbar", never, { "editor": { "alias": "editor"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; }, { "linkRequested": "linkRequested"; }, never, never, true, never>;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=editor-toolbar.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-toolbar.component.d.ts","sourceRoot":"","sources":["../../../../../src/generic/rich-text-editor/components/editor-toolbar/editor-toolbar.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAA0B,MAAM,cAAc,CAAC;;AAErE;;;GAGG;AACH,qBAQa,sBAAsB;IACjC,iCAAiC;IACjC,SAAgB,MAAM,8CAA4B;IAElD,4BAA4B;IAC5B,SAAgB,MAAM,qDAAgD;IAEtE,gDAAgD;IAChD,SAAgB,aAAa,iDAAkB;IAE/C,mCAAmC;IACnC,SAAgB,cAAc,kDAAiB;IAE/C,4CAA4C;IAC5C,SAAS,CAAC,QAAQ,CAAC,YAAY;;;;;;;;;;;;;;;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E,KAAK,EAAE,MAAM,GAAG,MAAM;IAIlD,wCAAwC;IACxC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;yCA1JhD,sBAAsB;2CAAtB,sBAAsB;CA6JlC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FormGroup } from '@angular/forms';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Link data structure for link insertion
|
|
5
|
+
*/
|
|
6
|
+
export interface LinkData {
|
|
7
|
+
url: string;
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Modal component for inserting/editing links in the rich text editor
|
|
12
|
+
*/
|
|
13
|
+
export declare class LinkModalComponent {
|
|
14
|
+
private readonly fb;
|
|
15
|
+
/** Whether the modal is visible */
|
|
16
|
+
readonly visible: import("@angular/core").InputSignal<boolean>;
|
|
17
|
+
/** Pre-selected text to use as link text */
|
|
18
|
+
readonly selectedText: import("@angular/core").InputSignal<string>;
|
|
19
|
+
/** Existing URL when editing a link */
|
|
20
|
+
readonly existingUrl: import("@angular/core").InputSignal<string>;
|
|
21
|
+
/** Event emitted when a link is added/updated */
|
|
22
|
+
readonly linkAdded: import("@angular/core").OutputEmitterRef<LinkData>;
|
|
23
|
+
/** Event emitted when the modal is closed */
|
|
24
|
+
readonly closed: import("@angular/core").OutputEmitterRef<void>;
|
|
25
|
+
/** Form group for link data */
|
|
26
|
+
readonly linkForm: FormGroup;
|
|
27
|
+
/** Track if form was submitted to show validation errors */
|
|
28
|
+
protected readonly submitted: import("@angular/core").WritableSignal<boolean>;
|
|
29
|
+
/** Computed title based on whether we're editing or adding */
|
|
30
|
+
protected readonly modalTitle: import("@angular/core").Signal<"Edit Link" | "Add Link">;
|
|
31
|
+
constructor();
|
|
32
|
+
/** Submit the form and emit link data */
|
|
33
|
+
addLink(): void;
|
|
34
|
+
/** Close the modal and reset form */
|
|
35
|
+
closeModal(): void;
|
|
36
|
+
/** Check if a field has errors and should show them */
|
|
37
|
+
hasError(fieldName: string): boolean;
|
|
38
|
+
/** Get specific error for a field */
|
|
39
|
+
getError(fieldName: string, errorType: string): boolean;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LinkModalComponent, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LinkModalComponent, "sdc-link-modal", never, { "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "selectedText": { "alias": "selectedText"; "required": false; "isSignal": true; }; "existingUrl": { "alias": "existingUrl"; "required": false; "isSignal": true; }; }, { "linkAdded": "linkAdded"; "closed": "closed"; }, never, never, true, never>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=link-modal.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-modal.component.d.ts","sourceRoot":"","sources":["../../../../../src/generic/rich-text-editor/components/link-modal/link-modal.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,SAAS,EAAmC,MAAM,gBAAgB,CAAC;;AAEzF;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAQa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAuB;IAE1C,mCAAmC;IACnC,SAAgB,OAAO,+CAAyB;IAEhD,4CAA4C;IAC5C,SAAgB,YAAY,8CAAqB;IAEjD,uCAAuC;IACvC,SAAgB,WAAW,8CAAqB;IAEhD,iDAAiD;IACjD,SAAgB,SAAS,qDAAsB;IAE/C,6CAA6C;IAC7C,SAAgB,MAAM,iDAAkB;IAExC,+BAA+B;IAC/B,SAAgB,QAAQ,EAAE,SAAS,CAAC;IAEpC,4DAA4D;IAC5D,SAAS,CAAC,QAAQ,CAAC,SAAS,kDAAiB;IAE7C,8DAA8D;IAC9D,SAAS,CAAC,QAAQ,CAAC,UAAU,2DAE1B;;IAwBH,yCAAyC;IACzC,OAAO,IAAI,IAAI;IAYf,qCAAqC;IACrC,UAAU,IAAI,IAAI;IAMlB,uDAAuD;IACvD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAKpC,qCAAqC;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;yCA9E5C,kBAAkB;2CAAlB,kBAAkB;CAkF9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generic/rich-text-editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Extension } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for link behavior in the editor
|
|
4
|
+
*/
|
|
5
|
+
export interface LinkConfig {
|
|
6
|
+
/** Whether links open on click (default: false) */
|
|
7
|
+
openOnClick?: boolean;
|
|
8
|
+
/** CSS classes to apply to links */
|
|
9
|
+
linkClass?: string;
|
|
10
|
+
/** Whether to add rel="noopener noreferrer" to external links */
|
|
11
|
+
addNoopener?: boolean;
|
|
12
|
+
/** Whether to add target="_blank" to links */
|
|
13
|
+
openInNewTab?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Default link configuration
|
|
17
|
+
*/
|
|
18
|
+
export declare const DEFAULT_LINK_CONFIG: LinkConfig;
|
|
19
|
+
/**
|
|
20
|
+
* Error display mode for the editor
|
|
21
|
+
*/
|
|
22
|
+
export type ErrorDisplayMode = 'always' | 'after-submit';
|
|
23
|
+
/**
|
|
24
|
+
* Full editor configuration options
|
|
25
|
+
*/
|
|
26
|
+
export interface EditorConfig {
|
|
27
|
+
/** Placeholder text when editor is empty */
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/** Minimum height of the editor */
|
|
30
|
+
minHeight?: string;
|
|
31
|
+
/** Maximum height of the editor (enables scrolling) */
|
|
32
|
+
maxHeight?: string;
|
|
33
|
+
/** Whether the editor should auto-focus on initialization */
|
|
34
|
+
autoFocus?: boolean;
|
|
35
|
+
/** Custom TipTap extensions to add or override defaults */
|
|
36
|
+
extensions?: Extension[];
|
|
37
|
+
/** Link behavior configuration */
|
|
38
|
+
linkConfig?: LinkConfig;
|
|
39
|
+
/** Whether to enable spellcheck */
|
|
40
|
+
spellcheck?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Default editor configuration
|
|
44
|
+
*/
|
|
45
|
+
export declare const DEFAULT_EDITOR_CONFIG: EditorConfig;
|
|
46
|
+
//# sourceMappingURL=editor-config.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-config.model.d.ts","sourceRoot":"","sources":["../../../../src/generic/rich-text-editor/models/editor-config.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAKjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,cAAc,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,kCAAkC;IAClC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mCAAmC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAMnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generic/rich-text-editor/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom toolbar button configuration for extending the toolbar
|
|
3
|
+
*/
|
|
4
|
+
export interface CustomToolbarButton {
|
|
5
|
+
/** Unique identifier for the button */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Icon to display (SVG string or icon name) */
|
|
8
|
+
icon: string;
|
|
9
|
+
/** Tooltip text */
|
|
10
|
+
title: string;
|
|
11
|
+
/** Click handler function */
|
|
12
|
+
action: () => void;
|
|
13
|
+
/** Function to determine active state */
|
|
14
|
+
isActive?: () => boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for the rich text editor toolbar
|
|
18
|
+
*/
|
|
19
|
+
export interface ToolbarConfig {
|
|
20
|
+
/** Enable bold formatting */
|
|
21
|
+
bold?: boolean;
|
|
22
|
+
/** Enable italic formatting */
|
|
23
|
+
italic?: boolean;
|
|
24
|
+
/** Enable underline formatting */
|
|
25
|
+
underline?: boolean;
|
|
26
|
+
/** Enable strikethrough formatting */
|
|
27
|
+
strike?: boolean;
|
|
28
|
+
/** Enable bullet list */
|
|
29
|
+
bulletList?: boolean;
|
|
30
|
+
/** Enable ordered list */
|
|
31
|
+
orderedList?: boolean;
|
|
32
|
+
/** Heading levels to enable (1-6) */
|
|
33
|
+
headings?: (1 | 2 | 3 | 4 | 5 | 6)[];
|
|
34
|
+
/** Enable horizontal rule insertion */
|
|
35
|
+
horizontalRule?: boolean;
|
|
36
|
+
/** Enable link insertion/editing */
|
|
37
|
+
link?: boolean;
|
|
38
|
+
/** Enable blockquote formatting */
|
|
39
|
+
blockquote?: boolean;
|
|
40
|
+
/** Enable inline code formatting */
|
|
41
|
+
code?: boolean;
|
|
42
|
+
/** Enable code block */
|
|
43
|
+
codeBlock?: boolean;
|
|
44
|
+
/** Enable undo button */
|
|
45
|
+
undo?: boolean;
|
|
46
|
+
/** Enable redo button */
|
|
47
|
+
redo?: boolean;
|
|
48
|
+
/** Custom buttons to add to the toolbar */
|
|
49
|
+
customButtons?: CustomToolbarButton[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Preset name for toolbar configuration
|
|
53
|
+
*/
|
|
54
|
+
export type ToolbarPreset = 'minimal' | 'standard' | 'full';
|
|
55
|
+
/**
|
|
56
|
+
* Predefined toolbar presets
|
|
57
|
+
*/
|
|
58
|
+
export declare const TOOLBAR_PRESETS: Record<ToolbarPreset, ToolbarConfig>;
|
|
59
|
+
/**
|
|
60
|
+
* Default toolbar configuration (standard preset)
|
|
61
|
+
*/
|
|
62
|
+
export declare const DEFAULT_TOOLBAR_CONFIG: ToolbarConfig;
|
|
63
|
+
//# sourceMappingURL=toolbar-config.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-config.model.d.ts","sourceRoot":"","sources":["../../../../src/generic/rich-text-editor/models/toolbar-config.model.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB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ourceRoot":"","sources":["../../../src/generic/rich-text-editor/public-api.ts"],"names":[],"mappings":"AACA,cAAc,8BAA8B,CAAC;AAG7C,cAAc,sDAAsD,CAAC;AACrE,cAAc,8CAA8C,CAAC;AAG7D,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { AbstractControl, FormControl, ValidationErrors } from '@angular/forms';
|
|
3
|
+
import { Editor } from '@tiptap/core';
|
|
4
|
+
import { ToolbarConfig, ToolbarPreset, LinkConfig, ErrorDisplayMode } from './models';
|
|
5
|
+
import { LinkData } from './components/link-modal/link-modal.component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* A rich text editor component built on TipTap
|
|
9
|
+
*
|
|
10
|
+
* This component provides a WYSIWYG editor with configurable toolbar,
|
|
11
|
+
* form integration, and theme support.
|
|
12
|
+
*
|
|
13
|
+
* @since 1.5.0
|
|
14
|
+
*/
|
|
15
|
+
export declare class RichTextEditorComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
16
|
+
/** Editor content container element */
|
|
17
|
+
private readonly editorContent;
|
|
18
|
+
/** TipTap editor instance (signal for change detection) */
|
|
19
|
+
readonly editorSignal: import("@angular/core").WritableSignal<Editor | null>;
|
|
20
|
+
/** Getter for backward compatibility */
|
|
21
|
+
get editor(): Editor | null;
|
|
22
|
+
/** Theme class to apply */
|
|
23
|
+
readonly theme: import("@angular/core").InputSignal<"theme-backoffice" | "theme-sdc">;
|
|
24
|
+
/** Form control for two-way binding */
|
|
25
|
+
readonly control: import("@angular/core").InputSignal<FormControl<any> | AbstractControl<string | null, string | null> | null>;
|
|
26
|
+
/** Placeholder text when editor is empty */
|
|
27
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
28
|
+
/** Whether the editor is disabled */
|
|
29
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
30
|
+
/** Minimum height of the editor */
|
|
31
|
+
readonly minHeight: import("@angular/core").InputSignal<string>;
|
|
32
|
+
/** Maximum height of the editor (enables scrolling) */
|
|
33
|
+
readonly maxHeight: import("@angular/core").InputSignal<string | null>;
|
|
34
|
+
/** Toolbar configuration object */
|
|
35
|
+
readonly toolbarConfig: import("@angular/core").InputSignal<ToolbarConfig>;
|
|
36
|
+
/** Toolbar preset name (overrides toolbarConfig) */
|
|
37
|
+
readonly toolbarPreset: import("@angular/core").InputSignal<ToolbarPreset | null>;
|
|
38
|
+
/** Link behavior configuration */
|
|
39
|
+
readonly linkConfig: import("@angular/core").InputSignal<LinkConfig>;
|
|
40
|
+
/** Error display mode */
|
|
41
|
+
readonly errorDisplayMode: import("@angular/core").InputSignal<ErrorDisplayMode>;
|
|
42
|
+
/** Custom error message */
|
|
43
|
+
readonly errorMessage: import("@angular/core").InputSignal<string>;
|
|
44
|
+
/** Label text */
|
|
45
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
46
|
+
/** Label position */
|
|
47
|
+
readonly labelPosition: import("@angular/core").InputSignal<"left" | "top">;
|
|
48
|
+
/** Name attribute for form control */
|
|
49
|
+
readonly name: import("@angular/core").InputSignal<string>;
|
|
50
|
+
/** Whether to autofocus the editor on init */
|
|
51
|
+
readonly autoFocus: import("@angular/core").InputSignal<boolean>;
|
|
52
|
+
/** Emits when the editor is ready */
|
|
53
|
+
readonly editorReady: import("@angular/core").OutputEmitterRef<Editor>;
|
|
54
|
+
/** Emits HTML content on change */
|
|
55
|
+
readonly contentChange: import("@angular/core").OutputEmitterRef<string>;
|
|
56
|
+
/** Emits on focus */
|
|
57
|
+
readonly onFocus: import("@angular/core").OutputEmitterRef<FocusEvent>;
|
|
58
|
+
/** Emits on blur */
|
|
59
|
+
readonly onBlur: import("@angular/core").OutputEmitterRef<FocusEvent>;
|
|
60
|
+
/** Form control state for validation display */
|
|
61
|
+
readonly controlState: import("@angular/core").WritableSignal<{
|
|
62
|
+
invalid: boolean;
|
|
63
|
+
touched: boolean;
|
|
64
|
+
dirty: boolean;
|
|
65
|
+
errors: ValidationErrors | null;
|
|
66
|
+
isFormSubmitted: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
/** Link modal visibility state */
|
|
69
|
+
protected readonly showLinkModal: import("@angular/core").WritableSignal<boolean>;
|
|
70
|
+
/** Selected text for link modal */
|
|
71
|
+
protected readonly selectedText: import("@angular/core").WritableSignal<string>;
|
|
72
|
+
/** Existing URL when editing a link */
|
|
73
|
+
protected readonly existingLinkUrl: import("@angular/core").WritableSignal<string>;
|
|
74
|
+
/** Subscriptions for cleanup */
|
|
75
|
+
private readonly subscriptions;
|
|
76
|
+
/** Flag to prevent update loops */
|
|
77
|
+
private isUpdatingFromEditor;
|
|
78
|
+
/** Cached form control reference (to avoid calling signals in callbacks) */
|
|
79
|
+
private formControlRef;
|
|
80
|
+
/** Computed toolbar config using preset or custom config */
|
|
81
|
+
protected readonly computedToolbarConfig: import("@angular/core").Signal<ToolbarConfig>;
|
|
82
|
+
/** Computed class string for the component */
|
|
83
|
+
protected readonly computedClass: import("@angular/core").Signal<string>;
|
|
84
|
+
/** Computed label class */
|
|
85
|
+
protected readonly labelClass: import("@angular/core").Signal<"sdc-rich-text-editor__label left" | "sdc-rich-text-editor__label top">;
|
|
86
|
+
/** Whether to show the label */
|
|
87
|
+
protected readonly showLabel: import("@angular/core").Signal<boolean | "">;
|
|
88
|
+
/** Current error message to display */
|
|
89
|
+
protected readonly currentErrorMessage: import("@angular/core").Signal<string>;
|
|
90
|
+
/** Whether to show error */
|
|
91
|
+
protected readonly showError: import("@angular/core").Signal<boolean>;
|
|
92
|
+
/** Computed editor styles */
|
|
93
|
+
protected readonly editorStyles: import("@angular/core").Signal<Record<string, string>>;
|
|
94
|
+
constructor();
|
|
95
|
+
ngOnInit(): void;
|
|
96
|
+
ngAfterViewInit(): void;
|
|
97
|
+
ngOnDestroy(): void;
|
|
98
|
+
/** Initialize the TipTap editor */
|
|
99
|
+
private initializeEditor;
|
|
100
|
+
/** Update error state from form control */
|
|
101
|
+
private updateErrors;
|
|
102
|
+
/** Get error message for validator */
|
|
103
|
+
private getValidatorErrorMessage;
|
|
104
|
+
/** Handle link button click from toolbar */
|
|
105
|
+
protected handleLinkRequested(): void;
|
|
106
|
+
/** Handle link added from modal */
|
|
107
|
+
protected handleLinkAdded(data: LinkData): void;
|
|
108
|
+
/** Handle link modal close */
|
|
109
|
+
protected handleLinkModalClose(): void;
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RichTextEditorComponent, never>;
|
|
111
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RichTextEditorComponent, "sdc-rich-text-editor", never, { "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "toolbarConfig": { "alias": "toolbarConfig"; "required": false; "isSignal": true; }; "toolbarPreset": { "alias": "toolbarPreset"; "required": false; "isSignal": true; }; "linkConfig": { "alias": "linkConfig"; "required": false; "isSignal": true; }; "errorDisplayMode": { "alias": "errorDisplayMode"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; }, { "editorReady": "editorReady"; "contentChange": "contentChange"; "onFocus": "onFocus"; "onBlur": "onBlur"; }, never, never, true, never>;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=rich-text-editor.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-editor.component.d.ts","sourceRoot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AgB;IA+DxB,2CAA2C;IAC3C,OAAO,CAAC,YAAY;IAUpB,sCAAsC;IACtC,OAAO,CAAC,wBAAwB;IAahC,4CAA4C;IAC5C,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAgBrC,mCAAmC;IACnC,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAqB/C,8BAA8B;IAC9B,SAAS,CAAC,oBAAoB,IAAI,IAAI;yCA7W3B,uBAAuB;2CAAvB,uBAAuB;CAkXnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3ddv/software-division-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"main": "./fesm2022/3ddv-software-division-components.mjs",
|
|
5
5
|
"module": "fesm2022/3ddv-software-division-components.mjs",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -147,6 +147,10 @@
|
|
|
147
147
|
"types": "./generic/icon/index.d.ts",
|
|
148
148
|
"default": "./fesm2022/generic/icon/index.mjs"
|
|
149
149
|
},
|
|
150
|
+
"./generic/rich-text-editor": {
|
|
151
|
+
"types": "./generic/rich-text-editor/index.d.ts",
|
|
152
|
+
"default": "./fesm2022/generic/rich-text-editor/index.mjs"
|
|
153
|
+
},
|
|
150
154
|
"./package.json": {
|
|
151
155
|
"default": "./package.json"
|
|
152
156
|
}
|
|
@@ -171,12 +175,32 @@
|
|
|
171
175
|
"@angular/platform-browser": "^19.2.0",
|
|
172
176
|
"@angular/platform-browser-dynamic": "^19.2.0",
|
|
173
177
|
"@angular/router": "^19.2.0",
|
|
178
|
+
"@tiptap/core": "^3.1.0",
|
|
179
|
+
"@tiptap/extension-link": "^3.1.0",
|
|
180
|
+
"@tiptap/extension-placeholder": "^3.1.0",
|
|
181
|
+
"@tiptap/extension-underline": "^3.1.0",
|
|
182
|
+
"@tiptap/starter-kit": "^3.1.0",
|
|
174
183
|
"rxjs": "^7.8.0",
|
|
175
184
|
"zone.js": "~0.15.0"
|
|
176
185
|
},
|
|
177
186
|
"peerDependenciesMeta": {
|
|
178
187
|
"rxjs": {
|
|
179
188
|
"optional": false
|
|
189
|
+
},
|
|
190
|
+
"@tiptap/core": {
|
|
191
|
+
"optional": true
|
|
192
|
+
},
|
|
193
|
+
"@tiptap/extension-link": {
|
|
194
|
+
"optional": true
|
|
195
|
+
},
|
|
196
|
+
"@tiptap/extension-placeholder": {
|
|
197
|
+
"optional": true
|
|
198
|
+
},
|
|
199
|
+
"@tiptap/extension-underline": {
|
|
200
|
+
"optional": true
|
|
201
|
+
},
|
|
202
|
+
"@tiptap/starter-kit": {
|
|
203
|
+
"optional": true
|
|
180
204
|
}
|
|
181
205
|
},
|
|
182
206
|
"sideEffects": false,
|