@ngstarter-ui/components 22.1.3 → 22.2.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/README.md +133 -13
- package/ai/component-registry.json +140 -9
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-B2GUlWO2.mjs +54 -0
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-B2GUlWO2.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs +47 -0
- package/fesm2022/ngstarter-ui-components-content-editor-block-base-BHAxKEOT.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Cnga7Z-6.mjs +27 -0
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Cnga7Z-6.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BbK5fCoE.mjs → ngstarter-ui-components-content-editor-code-block.component-DSdVOJtH.mjs} +49 -15
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-DSdVOJtH.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-divider-block.component-B5wyMHjr.mjs → ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs} +5 -3
- package/fesm2022/{ngstarter-ui-components-content-editor-divider-block.component-B5wyMHjr.mjs.map → ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-DGqupBLe.mjs → ngstarter-ui-components-content-editor-embed-block-DhFxtMQS.mjs} +16 -4
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DhFxtMQS.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-cEy-dCMa.mjs +103 -0
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-cEy-dCMa.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-DFLGRFiO.mjs +66 -0
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-DFLGRFiO.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-D1s2yalT.mjs → ngstarter-ui-components-content-editor-heading-block.component-BYpctSPe.mjs} +23 -14
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-BYpctSPe.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-D75DrPNq.mjs → ngstarter-ui-components-content-editor-image-block.component-B3MnANpi.mjs} +20 -7
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-B3MnANpi.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-B7pDlrQ_.mjs → ngstarter-ui-components-content-editor-list-block.component-6SMBxIl4.mjs} +28 -17
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-6SMBxIl4.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DSY7xfzf.mjs +117 -0
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DSY7xfzf.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs +3310 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor--rb3-UuO.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-CVV2f-ON.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs} +25 -14
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-JVxf_Cdx.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CVb-bkJw.mjs → ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs} +29 -16
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-7EO7z7Sr.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DSpLBC4V.mjs → ngstarter-ui-components-content-editor-table-block.component-CJS-IBHw.mjs} +28 -13
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-CJS-IBHw.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-B01lhY_V.mjs +21 -0
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-B01lhY_V.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-D9ELpJr-.mjs +29 -0
- package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-D9ELpJr-.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-D3U8uXIy.mjs → ngstarter-ui-components-content-editor-video-block.component-DQUPVDwV.mjs} +19 -5
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-DQUPVDwV.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +90 -12
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +9 -5
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-upload.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngstarter-ui-components-content-editor.d.ts +303 -83
- package/types/ngstarter-ui-components-headless-editor.d.ts +17 -2
- package/types/ngstarter-ui-components-menu.d.ts +3 -1
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbK5fCoE.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs +0 -127
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGqupBLe.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-D1s2yalT.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-D75DrPNq.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-B7pDlrQ_.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs +0 -3102
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CVV2f-ON.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-CVb-bkJw.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-DSpLBC4V.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-D3U8uXIy.mjs.map +0 -1
|
@@ -1,13 +1,62 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InjectionToken, Signal, Type, InputSignal,
|
|
3
|
-
import
|
|
2
|
+
import { InjectionToken, Signal, Type, InputSignal, EnvironmentProviders, OnDestroy, OnInit, AfterViewInit, EventEmitter, ViewContainerRef, ElementRef, Renderer2, NgZone, Provider } from '@angular/core';
|
|
3
|
+
import * as _ngstarter_ui_components_headless_editor from '@ngstarter-ui/components/headless-editor';
|
|
4
|
+
import { NgsHeadlessEditor, NgsHeadlessEditorMark, NgsHeadlessEditorBlock, NgsHeadlessEditorText, NgsHeadlessEditorDocument } from '@ngstarter-ui/components/headless-editor';
|
|
5
|
+
import * as _ngstarter_ui_components_content_editor from '@ngstarter-ui/components/content-editor';
|
|
6
|
+
import { CdkDropList, CdkDragDrop, CdkDrag, CdkDragStart } from '@angular/cdk/drag-drop';
|
|
4
7
|
import { Menu, MenuCloseReason } from '@ngstarter-ui/components/menu';
|
|
5
8
|
import { Popover } from '@ngstarter-ui/components/popover';
|
|
6
9
|
import { Observable } from 'rxjs';
|
|
7
10
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
8
11
|
import { Overlay, OverlayContainer } from '@angular/cdk/overlay';
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
declare class CommandBarComponent {
|
|
14
|
+
readonly editor: NgsHeadlessEditor;
|
|
15
|
+
private readonly dialog;
|
|
16
|
+
readonly observedElement: _angular_core.InputSignal<HTMLElement | null>;
|
|
17
|
+
readonly alignment: _angular_core.Signal<string>;
|
|
18
|
+
private savedSelection;
|
|
19
|
+
private region;
|
|
20
|
+
toggleBold(): void;
|
|
21
|
+
toggleItalic(): void;
|
|
22
|
+
toggleCode(): void;
|
|
23
|
+
toggleStrike(): void;
|
|
24
|
+
toggleUnderline(): void;
|
|
25
|
+
toggleSuperscript(): void;
|
|
26
|
+
toggleSubscript(): void;
|
|
27
|
+
isLinkActive(): boolean;
|
|
28
|
+
isActive(tag: string): boolean;
|
|
29
|
+
setTextAlignment(value: string): void;
|
|
30
|
+
isTextAlignment(value: string): boolean;
|
|
31
|
+
addLink(): void;
|
|
32
|
+
editLink(): void;
|
|
33
|
+
private openLinkDialog;
|
|
34
|
+
protected preserveSelection(event: MouseEvent): void;
|
|
35
|
+
protected retainSelection(): void;
|
|
36
|
+
private restoreSelection;
|
|
37
|
+
protected restoreSelectionAfterOverlay(): void;
|
|
38
|
+
protected preventMenuClose(event: MouseEvent): void;
|
|
39
|
+
protected onTextColorChanged(color: string): void;
|
|
40
|
+
protected onBackgroundColorChanged(color: string): void;
|
|
41
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CommandBarComponent, never>;
|
|
42
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CommandBarComponent, "ngs-command-bar", never, { "observedElement": { "alias": "observedElement"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** A converter receives saved block data, never an Angular component or editor DOM. */
|
|
46
|
+
type ContentEditorBlockHtmlConverter<T = any> = (block: ContentEditorBlock<T>, context: ContentEditorHtmlContext) => string;
|
|
47
|
+
type ContentEditorMarkHtmlConverter = (html: string, mark: NgsHeadlessEditorMark, context: ContentEditorHtmlContext) => string;
|
|
48
|
+
type ContentEditorHtmlUrlKind = 'link' | 'image' | 'media' | 'attachment' | 'embed';
|
|
49
|
+
interface ContentEditorHtmlContext {
|
|
50
|
+
renderBlock(block: ContentEditorBlock): string;
|
|
51
|
+
renderBlocks(blocks: readonly ContentEditorBlock[]): string;
|
|
52
|
+
renderText(text: ContentEditorText): string;
|
|
53
|
+
/** Calls the built-in converter without re-entering the current override. */
|
|
54
|
+
defaultToHtml(block: ContentEditorBlock): string;
|
|
55
|
+
escape(value: unknown): string;
|
|
56
|
+
safeUrl(value: unknown, kind?: ContentEditorHtmlUrlKind): string | null;
|
|
57
|
+
/** Styles are included once per export, unless includeStyles is false. */
|
|
58
|
+
addStyles(css: string): void;
|
|
59
|
+
}
|
|
11
60
|
|
|
12
61
|
declare const CONTENT_BUILDER: InjectionToken<unknown>;
|
|
13
62
|
declare const CONTENT_EDITOR_BLOCK: InjectionToken<readonly ContentEditorDataBlock[]>;
|
|
@@ -24,11 +73,66 @@ interface ContentEditorBlockEmpty {
|
|
|
24
73
|
[prop: string]: any;
|
|
25
74
|
};
|
|
26
75
|
}
|
|
27
|
-
|
|
76
|
+
type ContentEditorDocument = NgsHeadlessEditorDocument;
|
|
77
|
+
type ContentEditorBlock<TContent = unknown> = NgsHeadlessEditorBlock<TContent>;
|
|
78
|
+
type ContentEditorText = readonly NgsHeadlessEditorText[];
|
|
79
|
+
type ContentEditorCalloutVariant = 'note' | 'tip' | 'warning' | 'danger';
|
|
80
|
+
interface ContentEditorCalloutSettings {
|
|
81
|
+
variant: ContentEditorCalloutVariant;
|
|
82
|
+
}
|
|
83
|
+
interface ContentEditorToggleContent {
|
|
84
|
+
title: ContentEditorText;
|
|
85
|
+
blocks: readonly ContentEditorBlock[];
|
|
86
|
+
}
|
|
87
|
+
interface ContentEditorToggleSettings {
|
|
88
|
+
expanded: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface ContentEditorAttachmentContent {
|
|
91
|
+
url: string;
|
|
92
|
+
name: string;
|
|
93
|
+
size: number;
|
|
94
|
+
mimeType: string;
|
|
95
|
+
}
|
|
96
|
+
interface ContentEditorGalleryImage {
|
|
97
|
+
id: string;
|
|
98
|
+
src: string;
|
|
99
|
+
alt: string;
|
|
100
|
+
caption: ContentEditorText;
|
|
101
|
+
}
|
|
102
|
+
interface ContentEditorGalleryContent {
|
|
103
|
+
images: readonly ContentEditorGalleryImage[];
|
|
104
|
+
}
|
|
105
|
+
interface ContentEditorGridCell {
|
|
106
|
+
id: string;
|
|
107
|
+
blocks: readonly ContentEditorBlock[];
|
|
108
|
+
}
|
|
109
|
+
interface ContentEditorGridContent {
|
|
110
|
+
cells: readonly ContentEditorGridCell[];
|
|
111
|
+
}
|
|
112
|
+
type ContentEditorGridGap = 'small' | 'medium' | 'large';
|
|
113
|
+
interface ContentEditorGridSettings {
|
|
114
|
+
columns: 2 | 3 | 4;
|
|
115
|
+
gap: ContentEditorGridGap;
|
|
116
|
+
stackOnMobile: boolean;
|
|
117
|
+
}
|
|
118
|
+
/** A block collection in the root document, a toggle, or a cell. */
|
|
119
|
+
interface ContentEditorBlockScope {
|
|
120
|
+
parentId?: string;
|
|
121
|
+
cellId?: string;
|
|
122
|
+
}
|
|
123
|
+
/** Destination passed to the shared block menu; omission of afterId appends to the collection. */
|
|
124
|
+
interface ContentEditorBlockInsertionTarget {
|
|
125
|
+
scope: ContentEditorBlockScope;
|
|
126
|
+
afterId?: string;
|
|
127
|
+
}
|
|
128
|
+
type ContentEditorUploadFn = (file: File, dataUrl: string) => Promise<string>;
|
|
129
|
+
/** UI input view of a native document block. Never used as the saved document. */
|
|
130
|
+
interface ContentEditorBlockView {
|
|
28
131
|
id: string;
|
|
29
132
|
type: string;
|
|
30
133
|
content: any;
|
|
31
134
|
isEmpty: boolean;
|
|
135
|
+
attrs?: Readonly<Record<string, unknown>>;
|
|
32
136
|
props?: ContentEditorItemProperty[];
|
|
33
137
|
settings: any;
|
|
34
138
|
}
|
|
@@ -36,6 +140,7 @@ interface ContentEditorBlockDef {
|
|
|
36
140
|
component: () => any;
|
|
37
141
|
type: string;
|
|
38
142
|
empty: () => ContentEditorBlockEmpty;
|
|
143
|
+
toHtml?: ContentEditorBlockHtmlConverter;
|
|
39
144
|
options: {
|
|
40
145
|
[prop: string]: any;
|
|
41
146
|
};
|
|
@@ -88,7 +193,7 @@ interface ContentEditorEmbedBlockSettings {
|
|
|
88
193
|
height: number | null;
|
|
89
194
|
}
|
|
90
195
|
interface ContentEditorListItem {
|
|
91
|
-
content:
|
|
196
|
+
content: ContentEditorText;
|
|
92
197
|
props?: ContentEditorItemProperty[];
|
|
93
198
|
children: ContentEditorListItem[];
|
|
94
199
|
[prop: string]: any;
|
|
@@ -110,7 +215,7 @@ interface ContentEditorBlockRendererDef {
|
|
|
110
215
|
component: Type<unknown>;
|
|
111
216
|
}
|
|
112
217
|
interface ContentEditorBlockRendererInputs<TContent = unknown, TSettings = unknown> extends Record<string, unknown> {
|
|
113
|
-
block:
|
|
218
|
+
block: NgsHeadlessEditorBlock | null;
|
|
114
219
|
id: string;
|
|
115
220
|
type: string;
|
|
116
221
|
content: TContent;
|
|
@@ -119,7 +224,7 @@ interface ContentEditorBlockRendererInputs<TContent = unknown, TSettings = unkno
|
|
|
119
224
|
index: number;
|
|
120
225
|
}
|
|
121
226
|
interface ContentEditorBlockRendererInputSignals<TContent = unknown, TSettings = unknown> {
|
|
122
|
-
block: InputSignal<
|
|
227
|
+
block: InputSignal<NgsHeadlessEditorBlock | null>;
|
|
123
228
|
id: InputSignal<string>;
|
|
124
229
|
type: InputSignal<string>;
|
|
125
230
|
content: InputSignal<TContent>;
|
|
@@ -128,40 +233,22 @@ interface ContentEditorBlockRendererInputSignals<TContent = unknown, TSettings =
|
|
|
128
233
|
index: InputSignal<number>;
|
|
129
234
|
}
|
|
130
235
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
toggleSubscript(): void;
|
|
148
|
-
isLinkActive(): boolean;
|
|
149
|
-
isActive(tagName: string): boolean;
|
|
150
|
-
setTextAlignment(alignment: TextAlignment): void;
|
|
151
|
-
isTextAlignment(alignment: TextAlignment): boolean;
|
|
152
|
-
addLink(): void;
|
|
153
|
-
editLink(): void;
|
|
154
|
-
protected onMenuOpen(): void;
|
|
155
|
-
protected onMenuClose(): void;
|
|
156
|
-
protected preventMenuClose(event: MouseEvent): void;
|
|
157
|
-
protected onTextColorChanged(color: string): void;
|
|
158
|
-
protected onBackgroundColorChanged(color: string): void;
|
|
159
|
-
private _extractProps;
|
|
160
|
-
ngOnDestroy(): void;
|
|
161
|
-
private _unwrapTextSelection;
|
|
162
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CommandBarComponent, never>;
|
|
163
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CommandBarComponent, "ngs-command-bar", never, { "observedElement": { "alias": "observedElement"; "required": false; }; }, {}, never, never, true, never>;
|
|
164
|
-
}
|
|
236
|
+
interface ContentEditorBlockConfig {
|
|
237
|
+
toHtml?: ContentEditorBlockHtmlConverter;
|
|
238
|
+
options?: Readonly<Record<string, unknown>>;
|
|
239
|
+
}
|
|
240
|
+
interface ContentEditorConfig {
|
|
241
|
+
blocks?: Readonly<Record<string, ContentEditorBlockConfig>>;
|
|
242
|
+
marks?: Readonly<Record<string, ContentEditorMarkHtmlConverter>>;
|
|
243
|
+
includeStyles?: boolean;
|
|
244
|
+
/** Unknown blocks throw by default to avoid silently losing saved content. */
|
|
245
|
+
unknownBlockToHtml?: ContentEditorBlockHtmlConverter;
|
|
246
|
+
}
|
|
247
|
+
declare const CONTENT_EDITOR_CONFIG: InjectionToken<ContentEditorConfig>;
|
|
248
|
+
/** Later configurations override individual block fields, preserving unrelated options. */
|
|
249
|
+
declare function mergeContentEditorConfig(...configs: readonly ContentEditorConfig[]): ContentEditorConfig;
|
|
250
|
+
/** Application or route environment configuration. Child environments inherit parent settings. */
|
|
251
|
+
declare function provideContentEditorConfig(config?: ContentEditorConfig): EnvironmentProviders;
|
|
165
252
|
|
|
166
253
|
/**
|
|
167
254
|
* Directive to enable mouse-drag selection of child blocks inside a container.
|
|
@@ -202,8 +289,19 @@ declare class BlockSelectionDirective implements OnDestroy {
|
|
|
202
289
|
|
|
203
290
|
declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
204
291
|
private static readonly DRAFT_STORAGE_PREFIX;
|
|
292
|
+
readonly editor: NgsHeadlessEditor;
|
|
293
|
+
private readonly globalConfig;
|
|
294
|
+
private readonly htmlSerializer;
|
|
295
|
+
readonly config: _angular_core.InputSignal<ContentEditorConfig>;
|
|
296
|
+
/** One insertion menu shared by root controls, nested collections and custom blocks. */
|
|
297
|
+
readonly blockMenu: _angular_core.Signal<Menu>;
|
|
298
|
+
private readonly document;
|
|
299
|
+
private loaded;
|
|
300
|
+
private lastInput;
|
|
205
301
|
private _platformId;
|
|
206
302
|
private _store;
|
|
303
|
+
private readonly dropList;
|
|
304
|
+
readonly connectedDropLists: _angular_core.WritableSignal<CdkDropList<_ngstarter_ui_components_content_editor.ContentEditorBlockScope>[]>;
|
|
207
305
|
private elRef;
|
|
208
306
|
private envInjector;
|
|
209
307
|
private cdr;
|
|
@@ -215,28 +313,32 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
215
313
|
private _scroll$;
|
|
216
314
|
get scrollContainerScrolled(): Observable<number>;
|
|
217
315
|
private blockDefs;
|
|
218
|
-
content: _angular_core.InputSignal<
|
|
316
|
+
content: _angular_core.InputSignal<_ngstarter_ui_components_headless_editor.NgsHeadlessEditorDocument>;
|
|
219
317
|
contentChangedDelay: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
220
318
|
persistDraft: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
221
319
|
suggestions: _angular_core.InputSignal<any>;
|
|
222
320
|
options: _angular_core.InputSignal<ContentEditorOptions>;
|
|
223
321
|
scrollContainer: _angular_core.InputSignal<string | undefined>;
|
|
224
|
-
readonly contentChanged: _angular_core.OutputEmitterRef<
|
|
322
|
+
readonly contentChanged: _angular_core.OutputEmitterRef<_ngstarter_ui_components_headless_editor.NgsHeadlessEditorDocument>;
|
|
225
323
|
readonly focusChanged: EventEmitter<void>;
|
|
226
|
-
protected _content: _angular_core.
|
|
324
|
+
protected readonly _content: _angular_core.Signal<ContentEditorBlockView[]>;
|
|
227
325
|
protected blockDefsMap: Map<string, any>;
|
|
228
326
|
protected blockDefsOptionsMap: Map<string, any>;
|
|
229
327
|
protected _blockDragging: _angular_core.WritableSignal<boolean>;
|
|
230
328
|
isSelectionOfBlocksActive: _angular_core.WritableSignal<boolean>;
|
|
231
|
-
_oldContent: _angular_core.WritableSignal<{}>;
|
|
232
329
|
readonly selectedBlocksModel: SelectionModel<unknown>;
|
|
233
330
|
commandBar: typeof CommandBarComponent;
|
|
234
331
|
get api(): {
|
|
235
332
|
focusChanged: EventEmitter<void>;
|
|
236
333
|
};
|
|
237
334
|
private buildBlockDefMaps;
|
|
335
|
+
/** Shared by nested block collections; all edits use this root editor. */
|
|
336
|
+
get rootBuilder(): ContentBuilderComponent;
|
|
337
|
+
getBlockComponent(type: string): any;
|
|
338
|
+
createBlockView(type: string, settings?: {}, content?: any): ContentEditorBlockView;
|
|
238
339
|
getBlockDefOption(type: string, key: string): any;
|
|
239
340
|
ngOnInit(): void;
|
|
341
|
+
constructor();
|
|
240
342
|
ngAfterViewInit(): void;
|
|
241
343
|
/**
|
|
242
344
|
* Public accessor for the resolved scroll container. If not computed yet, it will compute now.
|
|
@@ -252,20 +354,27 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
252
354
|
private _isElementScrollable;
|
|
253
355
|
private _rebindScrollListener;
|
|
254
356
|
appendBlock(type: string, focus?: boolean): void;
|
|
255
|
-
insertBlock(type: string, index: number, options?: object, focus?: boolean, content?: any):
|
|
357
|
+
insertBlock(type: string, index: number, options?: object, focus?: boolean, content?: any): ContentEditorBlock;
|
|
256
358
|
private _createBlock;
|
|
257
359
|
addBlock(type: string, options: object, index?: number): void;
|
|
258
360
|
duplicateBlock(blockId: string): void;
|
|
361
|
+
private regenerateChildIds;
|
|
259
362
|
duplicateSelectedBlocks(popover: Popover): void;
|
|
260
363
|
deleteBlock(blockId: string): void;
|
|
261
364
|
setBlockProps(id: string, props: ContentEditorItemProperty[]): void;
|
|
262
365
|
insertEmptyBlock(index: number): void;
|
|
366
|
+
updateParagraph(id: string, data: Partial<ContentEditorBlockView>): void;
|
|
367
|
+
chooseBlock(target: ContentEditorBlockInsertionTarget, type: string, options: object): void;
|
|
263
368
|
focusBlock(id: string | null): void;
|
|
264
369
|
isBlockFocused(id: string): boolean;
|
|
265
370
|
isActiveBlock(id: string): boolean;
|
|
266
|
-
drop(event: CdkDragDrop<
|
|
371
|
+
drop(event: CdkDragDrop<ContentEditorBlockScope>): void;
|
|
372
|
+
readonly canEnterRoot: (_drag: CdkDrag, drop: CdkDropList) => boolean;
|
|
267
373
|
onTagSelected(tagName: string | null): void;
|
|
268
|
-
getData():
|
|
374
|
+
getData(): _ngstarter_ui_components_headless_editor.NgsHeadlessEditorDocument;
|
|
375
|
+
/** Exports the live document, including nested blocks, through the configured converters. */
|
|
376
|
+
toHtml(config?: ContentEditorConfig): string;
|
|
377
|
+
blockToHtml(block: ContentEditorBlock, config?: ContentEditorConfig): string;
|
|
269
378
|
emitContentChangeEvent(): void;
|
|
270
379
|
selectBlock(blockId: string, multiple?: boolean): void;
|
|
271
380
|
unselectBlock(blockId: string): void;
|
|
@@ -273,13 +382,12 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
273
382
|
isBlockSelected(blockId: string): boolean;
|
|
274
383
|
deleteSelectedBlocks(popover?: Popover): void;
|
|
275
384
|
protected _onKeyDown(event: KeyboardEvent): void;
|
|
276
|
-
protected onDragStarted(event: CdkDragStart, block:
|
|
277
|
-
protected onDragEnded(event: CdkDragStart, block:
|
|
278
|
-
protected addBlockFromSuggestionMenu(suggestionsMenu: Menu, type: string, options: object): void;
|
|
385
|
+
protected onDragStarted(event: CdkDragStart, block: ContentEditorBlockView): void;
|
|
386
|
+
protected onDragEnded(event: CdkDragStart, block: ContentEditorBlockView): void;
|
|
387
|
+
protected addBlockFromSuggestionMenu(suggestionsMenu: Menu, target: ContentEditorBlockInsertionTarget, type: string, options: object): void;
|
|
279
388
|
protected preventMenuClose(event: Event): void;
|
|
280
389
|
protected setActiveBlockId(event: Event, id: string | null): void;
|
|
281
|
-
protected onFocusChange(origin: string | null, dataBlock:
|
|
282
|
-
protected onSuggestionsMenuOpen(): void;
|
|
390
|
+
protected onFocusChange(origin: string | null, dataBlock: ContentEditorBlockView): void;
|
|
283
391
|
protected onSuggestionsMenuClose(reason: MenuCloseReason): void;
|
|
284
392
|
ngOnDestroy(): void;
|
|
285
393
|
private _getDraftContent;
|
|
@@ -293,22 +401,25 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
293
401
|
private _mapNodeToBlock;
|
|
294
402
|
private _mapListItems;
|
|
295
403
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentBuilderComponent, never>;
|
|
296
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentBuilderComponent, "ngs-content-editor-builder", ["ngsContentEditorBuilder"], { "content": { "alias": "content"; "required": false; "isSignal": true; }; "contentChangedDelay": { "alias": "contentChangedDelay"; "required": false; "isSignal": true; }; "persistDraft": { "alias": "persistDraft"; "required": false; "isSignal": true; }; "suggestions": { "alias": "suggestions"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "scrollContainer": { "alias": "scrollContainer"; "required": false; "isSignal": true; }; }, { "contentChanged": "contentChanged"; }, never, never, true, [{ directive: typeof BlockSelectionDirective; inputs: { "autoScrollContainerSelector": "autoScrollContainerSelector"; }; outputs: {}; }]>;
|
|
404
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentBuilderComponent, "ngs-content-editor-builder", ["ngsContentEditorBuilder"], { "config": { "alias": "config"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "contentChangedDelay": { "alias": "contentChangedDelay"; "required": false; "isSignal": true; }; "persistDraft": { "alias": "persistDraft"; "required": false; "isSignal": true; }; "suggestions": { "alias": "suggestions"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "scrollContainer": { "alias": "scrollContainer"; "required": false; "isSignal": true; }; }, { "contentChanged": "contentChanged"; }, never, never, true, [{ directive: typeof BlockSelectionDirective; inputs: { "autoScrollContainerSelector": "autoScrollContainerSelector"; }; outputs: {}; }]>;
|
|
297
405
|
}
|
|
298
406
|
|
|
299
407
|
interface ContentEditorRenderItem {
|
|
300
|
-
block:
|
|
408
|
+
block: NgsHeadlessEditorBlock;
|
|
301
409
|
component: Type<unknown> | null;
|
|
302
410
|
inputs: ContentEditorBlockRendererInputs;
|
|
303
411
|
}
|
|
304
412
|
declare class ContentEditorRenderer {
|
|
413
|
+
private readonly htmlSerializer;
|
|
414
|
+
readonly config: _angular_core.InputSignal<ContentEditorConfig>;
|
|
305
415
|
private readonly providedRendererGroups;
|
|
306
|
-
content: _angular_core.InputSignal<
|
|
307
|
-
blocks: _angular_core.InputSignal<readonly
|
|
416
|
+
content: _angular_core.InputSignal<_ngstarter_ui_components_headless_editor.NgsHeadlessEditorDocument>;
|
|
417
|
+
blocks: _angular_core.InputSignal<readonly NgsHeadlessEditorBlock<unknown>[] | null>;
|
|
418
|
+
toHtml(config?: ContentEditorConfig): string;
|
|
308
419
|
readonly rendererMap: _angular_core.Signal<Map<string, Type<unknown>>>;
|
|
309
420
|
protected readonly items: _angular_core.Signal<ContentEditorRenderItem[]>;
|
|
310
421
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorRenderer, never>;
|
|
311
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorRenderer, "ngs-content-editor-renderer", ["ngsContentEditorRenderer"], { "content": { "alias": "content"; "required": false; "isSignal": true; }; "blocks": { "alias": "blocks"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
422
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorRenderer, "ngs-content-editor-renderer", ["ngsContentEditorRenderer"], { "config": { "alias": "config"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "blocks": { "alias": "blocks"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
312
423
|
}
|
|
313
424
|
|
|
314
425
|
declare const CONTENT_EDITOR_BLOCK_RENDERERS: InjectionToken<readonly (readonly ContentEditorBlockRendererDef[])[]>;
|
|
@@ -321,7 +432,7 @@ interface ContentEditorCodeRendererSettings {
|
|
|
321
432
|
language?: string;
|
|
322
433
|
}
|
|
323
434
|
declare class ContentEditorCodeRenderer implements ContentEditorBlockRendererInputSignals<unknown, ContentEditorCodeRendererSettings> {
|
|
324
|
-
block: _angular_core.InputSignal<
|
|
435
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
325
436
|
id: _angular_core.InputSignal<string>;
|
|
326
437
|
type: _angular_core.InputSignal<string>;
|
|
327
438
|
content: _angular_core.InputSignal<unknown>;
|
|
@@ -335,7 +446,7 @@ declare class ContentEditorCodeRenderer implements ContentEditorBlockRendererInp
|
|
|
335
446
|
}
|
|
336
447
|
|
|
337
448
|
declare class ContentEditorDividerRenderer implements ContentEditorBlockRendererInputSignals<unknown, Record<string, unknown>> {
|
|
338
|
-
block: _angular_core.InputSignal<
|
|
449
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
339
450
|
id: _angular_core.InputSignal<string>;
|
|
340
451
|
type: _angular_core.InputSignal<string>;
|
|
341
452
|
content: _angular_core.InputSignal<unknown>;
|
|
@@ -347,7 +458,7 @@ declare class ContentEditorDividerRenderer implements ContentEditorBlockRenderer
|
|
|
347
458
|
}
|
|
348
459
|
|
|
349
460
|
declare class ContentEditorEmbedRenderer implements ContentEditorBlockRendererInputSignals<Partial<ContentEditorEmbedContent> | null, Partial<ContentEditorEmbedBlockSettings>> {
|
|
350
|
-
block: _angular_core.InputSignal<
|
|
461
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
351
462
|
id: _angular_core.InputSignal<string>;
|
|
352
463
|
type: _angular_core.InputSignal<string>;
|
|
353
464
|
content: _angular_core.InputSignal<Partial<ContentEditorEmbedContent> | null>;
|
|
@@ -364,23 +475,23 @@ declare class ContentEditorEmbedRenderer implements ContentEditorBlockRendererIn
|
|
|
364
475
|
|
|
365
476
|
type ContentEditorTextAlignment = 'left' | 'center' | 'right' | 'justify';
|
|
366
477
|
|
|
367
|
-
declare class ContentEditorHeadingRenderer implements ContentEditorBlockRendererInputSignals<
|
|
368
|
-
block: _angular_core.InputSignal<
|
|
478
|
+
declare class ContentEditorHeadingRenderer implements ContentEditorBlockRendererInputSignals<ContentEditorText, Partial<ContentEditorHeadingBlockSettings>> {
|
|
479
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
369
480
|
id: _angular_core.InputSignal<string>;
|
|
370
481
|
type: _angular_core.InputSignal<string>;
|
|
371
|
-
content: _angular_core.InputSignal<
|
|
482
|
+
content: _angular_core.InputSignal<ContentEditorText>;
|
|
372
483
|
settings: _angular_core.InputSignal<Partial<ContentEditorHeadingBlockSettings>>;
|
|
373
484
|
props: _angular_core.InputSignal<ContentEditorItemProperty[]>;
|
|
374
485
|
index: _angular_core.InputSignal<number>;
|
|
375
|
-
protected readonly
|
|
376
|
-
protected readonly level: _angular_core.Signal<
|
|
486
|
+
protected readonly runs: _angular_core.Signal<ContentEditorText>;
|
|
487
|
+
protected readonly level: _angular_core.Signal<2 | 3 | 1>;
|
|
377
488
|
protected readonly alignment: _angular_core.Signal<ContentEditorTextAlignment>;
|
|
378
489
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorHeadingRenderer, never>;
|
|
379
490
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorHeadingRenderer, "ngs-content-editor-heading-renderer", never, { "block": { "alias": "block"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "settings": { "alias": "settings"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
380
491
|
}
|
|
381
492
|
|
|
382
493
|
declare class ContentEditorImageRenderer implements ContentEditorBlockRendererInputSignals<Partial<ContentEditorImageContent> | null, Partial<ContentEditorImageBlockSettings>> {
|
|
383
|
-
block: _angular_core.InputSignal<
|
|
494
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
384
495
|
id: _angular_core.InputSignal<string>;
|
|
385
496
|
type: _angular_core.InputSignal<string>;
|
|
386
497
|
content: _angular_core.InputSignal<Partial<ContentEditorImageContent> | null>;
|
|
@@ -396,7 +507,7 @@ declare class ContentEditorImageRenderer implements ContentEditorBlockRendererIn
|
|
|
396
507
|
}
|
|
397
508
|
|
|
398
509
|
declare class ContentEditorListRenderer implements ContentEditorBlockRendererInputSignals<ContentEditorListItem[], Partial<ContentEditorListSettings>> {
|
|
399
|
-
block: _angular_core.InputSignal<
|
|
510
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
400
511
|
id: _angular_core.InputSignal<string>;
|
|
401
512
|
type: _angular_core.InputSignal<string>;
|
|
402
513
|
content: _angular_core.InputSignal<ContentEditorListItem[]>;
|
|
@@ -410,22 +521,22 @@ declare class ContentEditorListRenderer implements ContentEditorBlockRendererInp
|
|
|
410
521
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorListRenderer, "ngs-content-editor-list-renderer", never, { "block": { "alias": "block"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "settings": { "alias": "settings"; "required": false; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
411
522
|
}
|
|
412
523
|
|
|
413
|
-
declare class ContentEditorParagraphRenderer implements ContentEditorBlockRendererInputSignals<
|
|
414
|
-
block: _angular_core.InputSignal<
|
|
524
|
+
declare class ContentEditorParagraphRenderer implements ContentEditorBlockRendererInputSignals<ContentEditorText, Record<string, unknown>> {
|
|
525
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
415
526
|
id: _angular_core.InputSignal<string>;
|
|
416
527
|
type: _angular_core.InputSignal<string>;
|
|
417
|
-
content: _angular_core.InputSignal<
|
|
528
|
+
content: _angular_core.InputSignal<ContentEditorText>;
|
|
418
529
|
props: _angular_core.InputSignal<ContentEditorItemProperty[]>;
|
|
419
530
|
settings: _angular_core.InputSignal<Record<string, unknown>>;
|
|
420
531
|
index: _angular_core.InputSignal<number>;
|
|
421
|
-
protected readonly
|
|
532
|
+
protected readonly runs: _angular_core.Signal<ContentEditorText>;
|
|
422
533
|
protected readonly alignment: _angular_core.Signal<ContentEditorTextAlignment>;
|
|
423
534
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorParagraphRenderer, never>;
|
|
424
535
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorParagraphRenderer, "ngs-content-editor-paragraph-renderer", never, { "block": { "alias": "block"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "settings": { "alias": "settings"; "required": false; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
425
536
|
}
|
|
426
537
|
|
|
427
538
|
interface ContentEditorQuoteRendererContentPart {
|
|
428
|
-
content?:
|
|
539
|
+
content?: ContentEditorText;
|
|
429
540
|
props?: ContentEditorItemProperty[];
|
|
430
541
|
}
|
|
431
542
|
interface ContentEditorQuoteRendererContent {
|
|
@@ -433,15 +544,16 @@ interface ContentEditorQuoteRendererContent {
|
|
|
433
544
|
caption?: ContentEditorQuoteRendererContentPart;
|
|
434
545
|
}
|
|
435
546
|
declare class ContentEditorQuoteRenderer implements ContentEditorBlockRendererInputSignals<ContentEditorQuoteRendererContent | null, Record<string, unknown>> {
|
|
436
|
-
block: _angular_core.InputSignal<
|
|
547
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
437
548
|
id: _angular_core.InputSignal<string>;
|
|
438
549
|
type: _angular_core.InputSignal<string>;
|
|
439
550
|
content: _angular_core.InputSignal<ContentEditorQuoteRendererContent | null>;
|
|
440
551
|
props: _angular_core.InputSignal<ContentEditorItemProperty[]>;
|
|
441
552
|
settings: _angular_core.InputSignal<Record<string, unknown>>;
|
|
442
553
|
index: _angular_core.InputSignal<number>;
|
|
443
|
-
protected readonly
|
|
444
|
-
protected readonly
|
|
554
|
+
protected readonly quoteRuns: _angular_core.Signal<ContentEditorText>;
|
|
555
|
+
protected readonly captionRuns: _angular_core.Signal<ContentEditorText>;
|
|
556
|
+
protected readonly hasCaption: _angular_core.Signal<boolean>;
|
|
445
557
|
protected readonly quoteAlignment: _angular_core.Signal<ContentEditorTextAlignment>;
|
|
446
558
|
protected readonly captionAlignment: _angular_core.Signal<ContentEditorTextAlignment>;
|
|
447
559
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorQuoteRenderer, never>;
|
|
@@ -449,7 +561,7 @@ declare class ContentEditorQuoteRenderer implements ContentEditorBlockRendererIn
|
|
|
449
561
|
}
|
|
450
562
|
|
|
451
563
|
interface ContentEditorTableCell {
|
|
452
|
-
content?:
|
|
564
|
+
content?: ContentEditorText;
|
|
453
565
|
props?: unknown[];
|
|
454
566
|
styles?: Record<string, unknown>;
|
|
455
567
|
options?: {
|
|
@@ -459,13 +571,14 @@ interface ContentEditorTableCell {
|
|
|
459
571
|
};
|
|
460
572
|
}
|
|
461
573
|
declare class ContentEditorTableRenderer implements ContentEditorBlockRendererInputSignals<ContentEditorTableCell[][], ContentEditorTableBlockSettings> {
|
|
462
|
-
block: _angular_core.InputSignal<
|
|
574
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
463
575
|
id: _angular_core.InputSignal<string>;
|
|
464
576
|
type: _angular_core.InputSignal<string>;
|
|
465
577
|
content: _angular_core.InputSignal<ContentEditorTableCell[][]>;
|
|
466
578
|
props: _angular_core.InputSignal<ContentEditorItemProperty[]>;
|
|
467
579
|
settings: _angular_core.InputSignal<ContentEditorTableBlockSettings>;
|
|
468
580
|
index: _angular_core.InputSignal<number>;
|
|
581
|
+
protected readonly header: _angular_core.Signal<boolean>;
|
|
469
582
|
protected readonly rows: _angular_core.Signal<ContentEditorTableCell[][]>;
|
|
470
583
|
protected readonly firstRow: _angular_core.Signal<ContentEditorTableCell[]>;
|
|
471
584
|
protected width(cell: ContentEditorTableCell): number | null;
|
|
@@ -476,7 +589,7 @@ declare class ContentEditorTableRenderer implements ContentEditorBlockRendererIn
|
|
|
476
589
|
}
|
|
477
590
|
|
|
478
591
|
declare class ContentEditorVideoRenderer implements ContentEditorBlockRendererInputSignals<Partial<ContentEditorVideoContent> | null, Partial<ContentEditorVideoBlockSettings>> {
|
|
479
|
-
block: _angular_core.InputSignal<
|
|
592
|
+
block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
480
593
|
id: _angular_core.InputSignal<string>;
|
|
481
594
|
type: _angular_core.InputSignal<string>;
|
|
482
595
|
content: _angular_core.InputSignal<Partial<ContentEditorVideoContent> | null>;
|
|
@@ -492,7 +605,7 @@ declare class ContentEditorVideoRenderer implements ContentEditorBlockRendererIn
|
|
|
492
605
|
}
|
|
493
606
|
|
|
494
607
|
interface ISelectionPopupComponent {
|
|
495
|
-
observedElement?:
|
|
608
|
+
observedElement?: unknown;
|
|
496
609
|
}
|
|
497
610
|
declare class TextSelectionPopupDirective implements OnDestroy {
|
|
498
611
|
private overlay;
|
|
@@ -510,6 +623,7 @@ declare class TextSelectionPopupDirective implements OnDestroy {
|
|
|
510
623
|
private documentClickListener;
|
|
511
624
|
private positionStrategy;
|
|
512
625
|
private scrollListener;
|
|
626
|
+
private popupResizeObserver;
|
|
513
627
|
private scrollSubject;
|
|
514
628
|
private scrollSubscription;
|
|
515
629
|
constructor(overlay: Overlay, viewContainerRef: ViewContainerRef, elementRef: ElementRef<HTMLElement>, renderer: Renderer2, overlayContainer: OverlayContainer, ngZone: NgZone);
|
|
@@ -521,7 +635,7 @@ declare class TextSelectionPopupDirective implements OnDestroy {
|
|
|
521
635
|
private closePopup;
|
|
522
636
|
private addScrollListener;
|
|
523
637
|
private removeScrollListener;
|
|
524
|
-
private
|
|
638
|
+
private updatePopupPosition;
|
|
525
639
|
private findClosestElementWithClass;
|
|
526
640
|
private getContainingTagName;
|
|
527
641
|
private addDocumentClickListener;
|
|
@@ -536,5 +650,111 @@ declare class TextSelectionPopupDirective implements OnDestroy {
|
|
|
536
650
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TextSelectionPopupDirective, "[ngsTextSelectionPopup]", never, { "targetComponent": { "alias": "targetComponent"; "required": false; }; "closestContentObserverClass": { "alias": "closestContentObserverClass"; "required": false; }; }, { "tagSelected": "tagSelected"; }, never, never, true, never>;
|
|
537
651
|
}
|
|
538
652
|
|
|
539
|
-
|
|
540
|
-
|
|
653
|
+
/** Plain HTML layout styles, independent of Angular and the component library's theme. */
|
|
654
|
+
declare const CONTENT_EDITOR_GRID_HTML_STYLES = ".ngs-content-editor-html-grid{container-type:inline-size}.ngs-content-editor-html-grid-cells{display:grid;grid-template-columns:repeat(var(--ngs-html-grid-columns),minmax(0,1fr));gap:var(--ngs-html-grid-gap)}.ngs-content-editor-html-grid-cell{min-width:0}@container(max-width:480px){.ngs-content-editor-html-grid-stack{grid-template-columns:minmax(0,1fr)}}";
|
|
655
|
+
declare const CONTENT_EDITOR_CALLOUT_HTML_STYLES = ".ngs-content-editor-html-callout{padding:16px;border-radius:8px;background:var(--ngs-color-primary-container,#eef3ff);color:var(--ngs-color-on-surface,#172033)}.ngs-content-editor-html-callout[data-callout=tip]{background:var(--ngs-color-success-container,#e8f5ee)}.ngs-content-editor-html-callout[data-callout=warning]{background:var(--ngs-color-warning-container,#fff3dc)}.ngs-content-editor-html-callout[data-callout=danger]{background:var(--ngs-color-danger-container,#fdeaea)}";
|
|
656
|
+
declare const CONTENT_EDITOR_GALLERY_HTML_STYLES = ".ngs-content-editor-html-gallery{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:16px}.ngs-content-editor-html-gallery>figure{flex:0 0 100%;min-width:0;margin:0;scroll-snap-align:start}.ngs-content-editor-html-gallery img{display:block;width:100%}";
|
|
657
|
+
declare const contentEditorParagraphToHtml: ContentEditorBlockHtmlConverter;
|
|
658
|
+
declare const contentEditorHeadingToHtml: ContentEditorBlockHtmlConverter;
|
|
659
|
+
declare const contentEditorCodeToHtml: ContentEditorBlockHtmlConverter;
|
|
660
|
+
declare const contentEditorDividerToHtml: ContentEditorBlockHtmlConverter;
|
|
661
|
+
declare const contentEditorListToHtml: ContentEditorBlockHtmlConverter<readonly ContentEditorListItem[]>;
|
|
662
|
+
declare const contentEditorQuoteToHtml: ContentEditorBlockHtmlConverter;
|
|
663
|
+
declare const contentEditorTableToHtml: ContentEditorBlockHtmlConverter;
|
|
664
|
+
declare const contentEditorImageToHtml: ContentEditorBlockHtmlConverter;
|
|
665
|
+
declare const contentEditorVideoToHtml: ContentEditorBlockHtmlConverter;
|
|
666
|
+
declare const contentEditorEmbedToHtml: ContentEditorBlockHtmlConverter;
|
|
667
|
+
declare const contentEditorCalloutToHtml: ContentEditorBlockHtmlConverter;
|
|
668
|
+
declare const contentEditorToggleToHtml: ContentEditorBlockHtmlConverter<ContentEditorToggleContent>;
|
|
669
|
+
declare const contentEditorAttachmentToHtml: ContentEditorBlockHtmlConverter;
|
|
670
|
+
declare const contentEditorGalleryToHtml: ContentEditorBlockHtmlConverter<ContentEditorGalleryContent>;
|
|
671
|
+
declare const contentEditorGridToHtml: ContentEditorBlockHtmlConverter<ContentEditorGridContent>;
|
|
672
|
+
declare const CONTENT_EDITOR_DEFAULT_HTML_CONVERTERS: Readonly<Record<string, ContentEditorBlockHtmlConverter>>;
|
|
673
|
+
|
|
674
|
+
/** Pure document export: works without DOM, Angular DI, or a mounted editor. */
|
|
675
|
+
declare function contentEditorToHtml(document: ContentEditorDocument, config?: ContentEditorConfig): string;
|
|
676
|
+
declare function contentEditorBlockToHtml(block: ContentEditorBlock, config?: ContentEditorConfig): string;
|
|
677
|
+
|
|
678
|
+
/** Export saved documents with the current environment's shared configuration. */
|
|
679
|
+
declare class ContentEditorHtmlSerializer {
|
|
680
|
+
private readonly config;
|
|
681
|
+
toHtml(document: ContentEditorDocument, config?: ContentEditorConfig): string;
|
|
682
|
+
blockToHtml(block: ContentEditorBlock, config?: ContentEditorConfig): string;
|
|
683
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorHtmlSerializer, never>;
|
|
684
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/** Plain text used by empty states and literal code editing. */
|
|
688
|
+
declare function contentEditorText(value: ContentEditorText | unknown): string;
|
|
689
|
+
/** Maps a native block to the existing UI inputs. Saved data always stays native. */
|
|
690
|
+
declare function contentEditorBlockView(block: NgsHeadlessEditorBlock): ContentEditorBlockView;
|
|
691
|
+
declare function contentEditorNativeBlock(block: ContentEditorBlockView): NgsHeadlessEditorBlock;
|
|
692
|
+
declare function isContentEditorBlockEmpty(block: NgsHeadlessEditorBlock): boolean;
|
|
693
|
+
declare function contentEditorChildCollections(block: NgsHeadlessEditorBlock): readonly (readonly NgsHeadlessEditorBlock[])[];
|
|
694
|
+
declare function findContentEditorBlock(blocks: readonly NgsHeadlessEditorBlock[], id: string): NgsHeadlessEditorBlock | undefined;
|
|
695
|
+
declare function contentEditorCollection(blocks: readonly NgsHeadlessEditorBlock[], scope: ContentEditorBlockScope): readonly NgsHeadlessEditorBlock[];
|
|
696
|
+
/** Update only on a cloned document; callers preserve immutable undo snapshots. */
|
|
697
|
+
declare function replaceContentEditorCollection(blocks: NgsHeadlessEditorBlock[], scope: ContentEditorBlockScope, value: readonly NgsHeadlessEditorBlock[]): void;
|
|
698
|
+
/** Mutable UI payloads must not mutate saved documents or undo snapshots. */
|
|
699
|
+
declare function cloneContentEditorValue<T>(value: T): T;
|
|
700
|
+
|
|
701
|
+
/** Shared marks and commands for content editing and read-only rendering. */
|
|
702
|
+
declare function provideContentEditor(): Provider[];
|
|
703
|
+
|
|
704
|
+
declare abstract class ContentEditorRendererBase<T, S extends object = Record<string, unknown>> {
|
|
705
|
+
readonly block: _angular_core.InputSignal<NgsHeadlessEditorBlock<unknown> | null>;
|
|
706
|
+
readonly id: _angular_core.InputSignal<string>;
|
|
707
|
+
readonly type: _angular_core.InputSignal<string>;
|
|
708
|
+
readonly content: _angular_core.InputSignal<T | null>;
|
|
709
|
+
readonly settings: _angular_core.InputSignal<Partial<S>>;
|
|
710
|
+
readonly props: _angular_core.InputSignal<ContentEditorItemProperty[]>;
|
|
711
|
+
readonly index: _angular_core.InputSignal<number>;
|
|
712
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorRendererBase<any, any>, never>;
|
|
713
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ContentEditorRendererBase<any, any>, never, never, { "block": { "alias": "block"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "settings": { "alias": "settings"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
declare class ContentEditorCalloutRenderer extends ContentEditorRendererBase<ContentEditorText, ContentEditorCalloutSettings> {
|
|
717
|
+
readonly appearance: _angular_core.Signal<string>;
|
|
718
|
+
readonly icon: _angular_core.Signal<string>;
|
|
719
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorCalloutRenderer, never>;
|
|
720
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorCalloutRenderer, "ngs-content-editor-callout-renderer", never, {}, {}, never, never, true, never>;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
declare class ContentEditorToggleRenderer extends ContentEditorRendererBase<ContentEditorToggleContent, ContentEditorToggleSettings> {
|
|
724
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorToggleRenderer, never>;
|
|
725
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorToggleRenderer, "ngs-content-editor-toggle-renderer", never, {}, {}, never, never, true, never>;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
declare class ContentEditorAttachmentRenderer extends ContentEditorRendererBase<ContentEditorAttachmentContent> {
|
|
729
|
+
readonly sizeLabel: _angular_core.Signal<string>;
|
|
730
|
+
readonly href: _angular_core.Signal<string>;
|
|
731
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorAttachmentRenderer, never>;
|
|
732
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorAttachmentRenderer, "ngs-content-editor-attachment-renderer", never, {}, {}, never, never, true, never>;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
declare class ContentEditorGalleryRenderer extends ContentEditorRendererBase<ContentEditorGalleryContent> {
|
|
736
|
+
readonly images: _angular_core.Signal<readonly ContentEditorGalleryImage[]>;
|
|
737
|
+
readonly selectedId: _angular_core.WritableSignal<string | null>;
|
|
738
|
+
readonly selectedIndex: _angular_core.Signal<number>;
|
|
739
|
+
readonly selectedImage: _angular_core.Signal<ContentEditorGalleryImage>;
|
|
740
|
+
readonly captionText: typeof contentEditorText;
|
|
741
|
+
private readonly cards;
|
|
742
|
+
private readonly thumbnails;
|
|
743
|
+
constructor();
|
|
744
|
+
selectImage(index: number): void;
|
|
745
|
+
onIndexChange(index: number): void;
|
|
746
|
+
onKeydown(event: KeyboardEvent): void;
|
|
747
|
+
private scrollToImage;
|
|
748
|
+
private revealThumbnail;
|
|
749
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorGalleryRenderer, never>;
|
|
750
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorGalleryRenderer, "ngs-content-editor-gallery-renderer", never, {}, {}, never, never, true, never>;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
declare class ContentEditorGridRenderer extends ContentEditorRendererBase<ContentEditorGridContent, ContentEditorGridSettings> {
|
|
754
|
+
readonly layout: _angular_core.Signal<ContentEditorGridSettings>;
|
|
755
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorGridRenderer, never>;
|
|
756
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorGridRenderer, "ngs-content-editor-grid-renderer", never, {}, {}, never, never, true, never>;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
export { BlockSelectionDirective, CONTENT_BUILDER, CONTENT_EDITOR_BLOCK, CONTENT_EDITOR_BLOCK_RENDERERS, CONTENT_EDITOR_CALLOUT_HTML_STYLES, CONTENT_EDITOR_CONFIG, CONTENT_EDITOR_DEFAULT_HTML_CONVERTERS, CONTENT_EDITOR_DEFAULT_RENDERERS, CONTENT_EDITOR_GALLERY_HTML_STYLES, CONTENT_EDITOR_GRID_HTML_STYLES, CommandBarComponent, ContentBuilderComponent, ContentEditorAttachmentRenderer, ContentEditorCalloutRenderer, ContentEditorCodeRenderer, ContentEditorDividerRenderer, ContentEditorEmbedRenderer, ContentEditorGalleryRenderer, ContentEditorGridRenderer, ContentEditorHeadingRenderer, ContentEditorHtmlSerializer, ContentEditorImageRenderer, ContentEditorListRenderer, ContentEditorParagraphRenderer, ContentEditorQuoteRenderer, ContentEditorRenderer, ContentEditorTableRenderer, ContentEditorToggleRenderer, ContentEditorVideoRenderer, TextSelectionPopupDirective, cloneContentEditorValue, contentEditorAttachmentToHtml, contentEditorBlockToHtml, contentEditorBlockView, contentEditorCalloutToHtml, contentEditorChildCollections, contentEditorCodeToHtml, contentEditorCollection, contentEditorDividerToHtml, contentEditorEmbedToHtml, contentEditorGalleryToHtml, contentEditorGridToHtml, contentEditorHeadingToHtml, contentEditorImageToHtml, contentEditorListToHtml, contentEditorNativeBlock, contentEditorParagraphToHtml, contentEditorQuoteToHtml, contentEditorTableToHtml, contentEditorText, contentEditorToHtml, contentEditorToggleToHtml, contentEditorVideoToHtml, findContentEditorBlock, isContentEditorBlockEmpty, mergeContentEditorConfig, provideContentEditor, provideContentEditorConfig, provideContentEditorRenderer, provideContentEditorRenderers, replaceContentEditorCollection };
|
|
760
|
+
export type { ContentEditorAttachmentContent, ContentEditorBlock, ContentEditorBlockConfig, ContentEditorBlockDef, ContentEditorBlockEmpty, ContentEditorBlockHtmlConverter, ContentEditorBlockInsertionTarget, ContentEditorBlockRendererDef, ContentEditorBlockRendererInputSignals, ContentEditorBlockRendererInputs, ContentEditorBlockScope, ContentEditorBlockView, ContentEditorCalloutSettings, ContentEditorCalloutVariant, ContentEditorCodeRendererSettings, ContentEditorConfig, ContentEditorDataBlock, ContentEditorDocument, ContentEditorEmbedBlockSettings, ContentEditorEmbedContent, ContentEditorGalleryContent, ContentEditorGalleryImage, ContentEditorGridCell, ContentEditorGridContent, ContentEditorGridGap, ContentEditorGridSettings, ContentEditorHeadingBlockSettings, ContentEditorHtmlContext, ContentEditorHtmlUrlKind, ContentEditorImageBlockSettings, ContentEditorImageContent, ContentEditorItemProperty, ContentEditorListItem, ContentEditorListSettings, ContentEditorMarkHtmlConverter, ContentEditorOptions, ContentEditorQuoteRendererContent, ContentEditorQuoteRendererContentPart, ContentEditorSuggestionHeading, ContentEditorSuggestionItem, ContentEditorTableBlockSettings, ContentEditorTableCell, ContentEditorText, ContentEditorToggleContent, ContentEditorToggleSettings, ContentEditorUploadFn, ContentEditorVideoBlockSettings, ContentEditorVideoContent, ISelectionPopupComponent };
|