@tmdjr/ngx-editor-js2 21.0.6 → 21.0.7
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 +46 -26
- package/fesm2022/tmdjr-ngx-editor-js2.mjs +173 -183
- package/fesm2022/tmdjr-ngx-editor-js2.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/collection.json +1 -1
- package/schematics/ng-add/index.js +2 -4
- package/schematics/ng-add/index.ts +21 -22
- package/schematics/ng-add/schema.json +1 -1
- package/src/styles/drag-preview.scss +0 -1
- package/styles/drag-preview.scss +0 -1
- package/types/tmdjr-ngx-editor-js2.d.ts +82 -82
|
@@ -1,12 +1,40 @@
|
|
|
1
|
-
import * as rxjs from 'rxjs';
|
|
2
|
-
import { Observable, BehaviorSubject } from 'rxjs';
|
|
3
1
|
import * as _angular_core from '@angular/core';
|
|
4
|
-
import { Type, InputSignal, Signal, ComponentRef, ViewContainerRef, InjectionToken
|
|
2
|
+
import { AfterContentInit, ElementRef, Type, InputSignal, Signal, ComponentRef, ViewContainerRef, InjectionToken } from '@angular/core';
|
|
5
3
|
import * as _angular_forms from '@angular/forms';
|
|
6
|
-
import { FormGroup, FormBuilder
|
|
4
|
+
import { ControlValueAccessor, FormGroup, FormBuilder } from '@angular/forms';
|
|
5
|
+
import * as rxjs from 'rxjs';
|
|
6
|
+
import { Observable, BehaviorSubject } from 'rxjs';
|
|
7
7
|
import * as _tmdjr_ngx_editor_js2 from '@tmdjr/ngx-editor-js2';
|
|
8
8
|
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
|
9
9
|
|
|
10
|
+
declare class AutofocusDirective implements AfterContentInit {
|
|
11
|
+
elementRef: ElementRef<any>;
|
|
12
|
+
autofocus: _angular_core.InputSignal<boolean>;
|
|
13
|
+
ngAfterContentInit(): void;
|
|
14
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutofocusDirective, never>;
|
|
15
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AutofocusDirective, "[autofocus]", never, { "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare class CleanPasteDataDirective {
|
|
19
|
+
onPaste(event: Event): void;
|
|
20
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CleanPasteDataDirective, never>;
|
|
21
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CleanPasteDataDirective, "[cleanPasteData]", never, {}, {}, never, never, true, never>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class ControlAccessorDirective implements ControlValueAccessor {
|
|
25
|
+
elementRef: ElementRef<any>;
|
|
26
|
+
defaultValue: _angular_core.InputSignal<string | undefined>;
|
|
27
|
+
onChange: (value: any) => void;
|
|
28
|
+
onTouched: () => void;
|
|
29
|
+
writeValue(): void;
|
|
30
|
+
registerOnChange(fn: any): void;
|
|
31
|
+
registerOnTouched(fn: any): void;
|
|
32
|
+
onBlur(): void;
|
|
33
|
+
onInput(): void;
|
|
34
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ControlAccessorDirective, never>;
|
|
35
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ControlAccessorDirective, "[controlAccessor]", never, { "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
36
|
+
}
|
|
37
|
+
|
|
10
38
|
interface NgxEditorjsOptions {
|
|
11
39
|
consumerSupportedBlocks?: SupportedBlock[];
|
|
12
40
|
}
|
|
@@ -48,6 +76,26 @@ declare enum MovePositionActions {
|
|
|
48
76
|
type TAddBlockCallback = (block: Type<BlockComponent>, index: number) => Observable<unknown>;
|
|
49
77
|
type TMoveBlockPositionCallback = (action: MovePositionActions, index: number) => Observable<unknown>;
|
|
50
78
|
|
|
79
|
+
declare class ToolbarComponent {
|
|
80
|
+
componentContextPositionIndex: _angular_core.InputSignal<number>;
|
|
81
|
+
supportedBlocks: _angular_core.InputSignal<SupportedBlock[]>;
|
|
82
|
+
blockOptionActions: _angular_core.InputSignal<BlockOptionAction[] | undefined>;
|
|
83
|
+
actionCallback: _angular_core.InputSignal<(action: string) => void>;
|
|
84
|
+
formControlName: _angular_core.InputSignal<string | undefined>;
|
|
85
|
+
addBlockCallback: _angular_core.InputSignal<TAddBlockCallback>;
|
|
86
|
+
moveBlockPositionCallback: _angular_core.InputSignal<TMoveBlockPositionCallback>;
|
|
87
|
+
openBlocks: _angular_core.WritableSignal<boolean>;
|
|
88
|
+
openBlocksOption: _angular_core.WritableSignal<boolean>;
|
|
89
|
+
openBlocksList(): void;
|
|
90
|
+
openBlockOptionList(): void;
|
|
91
|
+
moveBlockPosition(action: MovePositionActions): void;
|
|
92
|
+
handleAction(action: string): void;
|
|
93
|
+
addBlock(block: Type<BlockComponent>): void;
|
|
94
|
+
closeLists(): void;
|
|
95
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarComponent, never>;
|
|
96
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToolbarComponent, "toolbar", never, { "componentContextPositionIndex": { "alias": "componentContextPositionIndex"; "required": true; "isSignal": true; }; "supportedBlocks": { "alias": "supportedBlocks"; "required": true; "isSignal": true; }; "blockOptionActions": { "alias": "blockOptionActions"; "required": false; "isSignal": true; }; "actionCallback": { "alias": "actionCallback"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "addBlockCallback": { "alias": "addBlockCallback"; "required": true; "isSignal": true; }; "moveBlockPositionCallback": { "alias": "moveBlockPositionCallback"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
97
|
+
}
|
|
98
|
+
|
|
51
99
|
declare class BlockMovementService {
|
|
52
100
|
componentRefMap: Map<object, ComponentRef<BlockComponent>>;
|
|
53
101
|
clearComponentRefs(): void;
|
|
@@ -74,7 +122,7 @@ declare class EditorJsService {
|
|
|
74
122
|
getBlocks$(): Observable<NgxEditorJsBlock[]>;
|
|
75
123
|
createNgxEditorJsBlockWithComponent(blockComponent: Type<BlockComponent>, componentContextPositionIndex: number): Observable<NgxEditorJsBlockWithComponent>;
|
|
76
124
|
addBlockComponent(ngxEditorJsBlock: NgxEditorJsBlockWithComponent, emitEvent?: boolean): Observable<void>;
|
|
77
|
-
createFormGroupControl({ blockId, dataClean
|
|
125
|
+
createFormGroupControl({ blockId, dataClean }: NgxEditorJsBlockWithComponent, emitEvent?: boolean): Observable<_angular_forms.FormControl<string | null>>;
|
|
78
126
|
attachComponent({ component, blockId, autofocus, savedAction, sortIndex: index, }: NgxEditorJsBlockWithComponent): Observable<_angular_core.ComponentRef<BlockComponent>>;
|
|
79
127
|
determineMovePositionAction(action: MovePositionActions, index: number, formControlName: string): Observable<any>;
|
|
80
128
|
moveBlockComponentPosition(previousIndex: number, currentIndex: number): Observable<any>;
|
|
@@ -128,67 +176,6 @@ declare class NgxEditorJs2Service {
|
|
|
128
176
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxEditorJs2Service>;
|
|
129
177
|
}
|
|
130
178
|
|
|
131
|
-
declare class ToolbarComponent {
|
|
132
|
-
componentContextPositionIndex: _angular_core.InputSignal<number>;
|
|
133
|
-
supportedBlocks: _angular_core.InputSignal<SupportedBlock[]>;
|
|
134
|
-
blockOptionActions: _angular_core.InputSignal<BlockOptionAction[] | undefined>;
|
|
135
|
-
actionCallback: _angular_core.InputSignal<(action: string) => void>;
|
|
136
|
-
formControlName: _angular_core.InputSignal<string | undefined>;
|
|
137
|
-
addBlockCallback: _angular_core.InputSignal<TAddBlockCallback>;
|
|
138
|
-
moveBlockPositionCallback: _angular_core.InputSignal<TMoveBlockPositionCallback>;
|
|
139
|
-
openBlocks: _angular_core.WritableSignal<boolean>;
|
|
140
|
-
openBlocksOption: _angular_core.WritableSignal<boolean>;
|
|
141
|
-
openBlocksList(): void;
|
|
142
|
-
openBlockOptionList(): void;
|
|
143
|
-
moveBlockPosition(action: MovePositionActions): void;
|
|
144
|
-
handleAction(action: string): void;
|
|
145
|
-
addBlock(block: Type<BlockComponent>): void;
|
|
146
|
-
closeLists(): void;
|
|
147
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarComponent, never>;
|
|
148
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToolbarComponent, "toolbar", never, { "componentContextPositionIndex": { "alias": "componentContextPositionIndex"; "required": true; "isSignal": true; }; "supportedBlocks": { "alias": "supportedBlocks"; "required": true; "isSignal": true; }; "blockOptionActions": { "alias": "blockOptionActions"; "required": false; "isSignal": true; }; "actionCallback": { "alias": "actionCallback"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "addBlockCallback": { "alias": "addBlockCallback"; "required": true; "isSignal": true; }; "moveBlockPositionCallback": { "alias": "moveBlockPositionCallback"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
declare class ToolbarInlineService {
|
|
152
|
-
overlay: Overlay;
|
|
153
|
-
overlayRef: OverlayRef;
|
|
154
|
-
determineToDisplayInlineToolbarBlock(_event: Event): rxjs.Observable<boolean>;
|
|
155
|
-
getSelectionParent(selection: Selection): HTMLElement | null;
|
|
156
|
-
isSelectionInABlock(target: HTMLElement | null): boolean;
|
|
157
|
-
attachInlineToolbar(selection: Selection): rxjs.Observable<boolean>;
|
|
158
|
-
createOverlay(selectionRect: DOMRect): OverlayRef;
|
|
159
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarInlineService, never>;
|
|
160
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ToolbarInlineService>;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
declare class NgxEditorJs2Component {
|
|
164
|
-
inlineToolbarSerivce: ToolbarInlineService;
|
|
165
|
-
editorJsService: EditorJsService;
|
|
166
|
-
ngxEditorJs2Service: NgxEditorJs2Service;
|
|
167
|
-
constructor();
|
|
168
|
-
blocks: _angular_core.InputSignal<NgxEditorJsBlock[]>;
|
|
169
|
-
blocksRequested: _angular_core.OutputEmitterRef<Observable<NgxEditorJsBlock[]>>;
|
|
170
|
-
requestBlocks: _angular_core.InputSignalWithTransform<unknown, unknown>;
|
|
171
|
-
formChanged: _angular_core.OutputEmitterRef<NgxEditorJsBlock[]>;
|
|
172
|
-
bootstrapEditorJs$: Observable<[_angular_core.ComponentRef<ToolbarComponent>, {
|
|
173
|
-
component: _angular_core.Type<_tmdjr_ngx_editor_js2.BlockComponent>;
|
|
174
|
-
blockId: string;
|
|
175
|
-
sortIndex: number;
|
|
176
|
-
componentInstanceName: string;
|
|
177
|
-
dataClean: string;
|
|
178
|
-
savedAction?: string;
|
|
179
|
-
}[], boolean]>;
|
|
180
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxEditorJs2Component, never>;
|
|
181
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxEditorJs2Component, "ngx-editor-js2", never, { "blocks": { "alias": "blocks"; "required": false; "isSignal": true; }; "requestBlocks": { "alias": "requestBlocks"; "required": true; "isSignal": true; }; }, { "blocksRequested": "blocksRequested"; "formChanged": "formChanged"; }, never, never, true, never>;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
declare class AutofocusDirective implements AfterContentInit {
|
|
185
|
-
elementRef: ElementRef<any>;
|
|
186
|
-
autofocus: _angular_core.InputSignal<boolean>;
|
|
187
|
-
ngAfterContentInit(): void;
|
|
188
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutofocusDirective, never>;
|
|
189
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AutofocusDirective, "[autofocus]", never, { "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
179
|
type ComponentContext = {
|
|
193
180
|
index: number;
|
|
194
181
|
viewContainerRef: ViewContainerRef;
|
|
@@ -222,24 +209,37 @@ declare class ToolbarFabDirective {
|
|
|
222
209
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ToolbarFabDirective, "[toolbarFab]", never, { "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "blockOptionActions": { "alias": "blockOptionActions"; "required": false; "isSignal": true; }; "actionCallback": { "alias": "actionCallback"; "required": true; "isSignal": true; }; "componentContextPositionIndex": { "alias": "componentContextPositionIndex"; "required": true; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
223
210
|
}
|
|
224
211
|
|
|
225
|
-
declare class
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ControlAccessorDirective, never>;
|
|
236
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ControlAccessorDirective, "[controlAccessor]", never, { "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
212
|
+
declare class ToolbarInlineService {
|
|
213
|
+
overlay: Overlay;
|
|
214
|
+
overlayRef: OverlayRef;
|
|
215
|
+
determineToDisplayInlineToolbarBlock(_event: Event): rxjs.Observable<boolean>;
|
|
216
|
+
getSelectionParent(selection: Selection): HTMLElement | null;
|
|
217
|
+
isSelectionInABlock(target: HTMLElement | null): boolean;
|
|
218
|
+
attachInlineToolbar(selection: Selection): rxjs.Observable<boolean>;
|
|
219
|
+
createOverlay(selectionRect: DOMRect): OverlayRef;
|
|
220
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarInlineService, never>;
|
|
221
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ToolbarInlineService>;
|
|
237
222
|
}
|
|
238
223
|
|
|
239
|
-
declare class
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
224
|
+
declare class NgxEditorJs2Component {
|
|
225
|
+
inlineToolbarSerivce: ToolbarInlineService;
|
|
226
|
+
editorJsService: EditorJsService;
|
|
227
|
+
ngxEditorJs2Service: NgxEditorJs2Service;
|
|
228
|
+
constructor();
|
|
229
|
+
blocks: _angular_core.InputSignal<NgxEditorJsBlock[]>;
|
|
230
|
+
blocksRequested: _angular_core.OutputEmitterRef<Observable<NgxEditorJsBlock[]>>;
|
|
231
|
+
requestBlocks: _angular_core.InputSignalWithTransform<unknown, unknown>;
|
|
232
|
+
formChanged: _angular_core.OutputEmitterRef<NgxEditorJsBlock[]>;
|
|
233
|
+
bootstrapEditorJs$: Observable<[_angular_core.ComponentRef<ToolbarComponent>, {
|
|
234
|
+
component: _angular_core.Type<_tmdjr_ngx_editor_js2.BlockComponent>;
|
|
235
|
+
blockId: string;
|
|
236
|
+
sortIndex: number;
|
|
237
|
+
componentInstanceName: string;
|
|
238
|
+
dataClean: string;
|
|
239
|
+
savedAction?: string;
|
|
240
|
+
}[], boolean]>;
|
|
241
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxEditorJs2Component, never>;
|
|
242
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxEditorJs2Component, "ngx-editor-js2", never, { "blocks": { "alias": "blocks"; "required": false; "isSignal": true; }; "requestBlocks": { "alias": "requestBlocks"; "required": true; "isSignal": true; }; }, { "blocksRequested": "blocksRequested"; "formChanged": "formChanged"; }, never, never, true, never>;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
export { AutofocusDirective, CleanPasteDataDirective, ControlAccessorDirective, MovePositionActions, NGX_EDITORJS_OPTIONS, NgxEditorJs2Component, NgxEditorJs2Service, ToolbarFabDirective };
|