@tmdjr/ngx-editor-js2 21.0.7 → 21.0.9
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 +26 -46
- package/fesm2022/tmdjr-ngx-editor-js2.mjs +193 -179
- 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 +4 -2
- package/schematics/ng-add/index.ts +22 -21
- package/schematics/ng-add/schema.json +1 -1
- package/src/styles/drag-preview.scss +1 -0
- package/styles/drag-preview.scss +1 -0
- package/types/tmdjr-ngx-editor-js2.d.ts +83 -82
|
@@ -1,40 +1,12 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { AfterContentInit, ElementRef, Type, InputSignal, Signal, ComponentRef, ViewContainerRef, InjectionToken } from '@angular/core';
|
|
3
|
-
import * as _angular_forms from '@angular/forms';
|
|
4
|
-
import { ControlValueAccessor, FormGroup, FormBuilder } from '@angular/forms';
|
|
5
1
|
import * as rxjs from 'rxjs';
|
|
6
2
|
import { Observable, BehaviorSubject } from 'rxjs';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { Type, InputSignal, Signal, ComponentRef, ViewContainerRef, InjectionToken, AfterContentInit, ElementRef } from '@angular/core';
|
|
5
|
+
import * as _angular_forms from '@angular/forms';
|
|
6
|
+
import { FormGroup, FormBuilder, ControlValueAccessor } from '@angular/forms';
|
|
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
|
-
|
|
38
10
|
interface NgxEditorjsOptions {
|
|
39
11
|
consumerSupportedBlocks?: SupportedBlock[];
|
|
40
12
|
}
|
|
@@ -67,6 +39,7 @@ interface BlockOptionAction {
|
|
|
67
39
|
action: string;
|
|
68
40
|
icon?: string;
|
|
69
41
|
text?: string;
|
|
42
|
+
devIcon?: string;
|
|
70
43
|
}
|
|
71
44
|
declare enum MovePositionActions {
|
|
72
45
|
UP = "UP",
|
|
@@ -76,26 +49,6 @@ declare enum MovePositionActions {
|
|
|
76
49
|
type TAddBlockCallback = (block: Type<BlockComponent>, index: number) => Observable<unknown>;
|
|
77
50
|
type TMoveBlockPositionCallback = (action: MovePositionActions, index: number) => Observable<unknown>;
|
|
78
51
|
|
|
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
|
-
|
|
99
52
|
declare class BlockMovementService {
|
|
100
53
|
componentRefMap: Map<object, ComponentRef<BlockComponent>>;
|
|
101
54
|
clearComponentRefs(): void;
|
|
@@ -122,7 +75,7 @@ declare class EditorJsService {
|
|
|
122
75
|
getBlocks$(): Observable<NgxEditorJsBlock[]>;
|
|
123
76
|
createNgxEditorJsBlockWithComponent(blockComponent: Type<BlockComponent>, componentContextPositionIndex: number): Observable<NgxEditorJsBlockWithComponent>;
|
|
124
77
|
addBlockComponent(ngxEditorJsBlock: NgxEditorJsBlockWithComponent, emitEvent?: boolean): Observable<void>;
|
|
125
|
-
createFormGroupControl({ blockId, dataClean }: NgxEditorJsBlockWithComponent, emitEvent?: boolean): Observable<_angular_forms.FormControl<string | null>>;
|
|
78
|
+
createFormGroupControl({ blockId, dataClean, }: NgxEditorJsBlockWithComponent, emitEvent?: boolean): Observable<_angular_forms.FormControl<string | null>>;
|
|
126
79
|
attachComponent({ component, blockId, autofocus, savedAction, sortIndex: index, }: NgxEditorJsBlockWithComponent): Observable<_angular_core.ComponentRef<BlockComponent>>;
|
|
127
80
|
determineMovePositionAction(action: MovePositionActions, index: number, formControlName: string): Observable<any>;
|
|
128
81
|
moveBlockComponentPosition(previousIndex: number, currentIndex: number): Observable<any>;
|
|
@@ -176,37 +129,24 @@ declare class NgxEditorJs2Service {
|
|
|
176
129
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxEditorJs2Service>;
|
|
177
130
|
}
|
|
178
131
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
blockOptionActions: BlockOptionAction[];
|
|
183
|
-
actionCallback: (v: string) => void;
|
|
184
|
-
formControlName: string;
|
|
185
|
-
} | null;
|
|
186
|
-
declare class ToolFabService {
|
|
187
|
-
ngxEditorJs2Service: NgxEditorJs2Service;
|
|
188
|
-
editorJsService: EditorJsService;
|
|
189
|
-
componentContext: BehaviorSubject<ComponentContext>;
|
|
190
|
-
toolbarComponentRef$: rxjs.Observable<_angular_core.ComponentRef<ToolbarComponent>>;
|
|
191
|
-
addBlock(block: Type<BlockComponent>, index: number): rxjs.Observable<void>;
|
|
192
|
-
movePositionAction(action: MovePositionActions, index: number, formControlName: string): Promise<any>;
|
|
193
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolFabService, never>;
|
|
194
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ToolFabService>;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
type ToolbarComponentRef = Observable<ComponentRef<ToolbarComponent>>;
|
|
198
|
-
declare class ToolbarFabDirective {
|
|
199
|
-
toolFabService: ToolFabService;
|
|
200
|
-
viewContainerRef: ViewContainerRef;
|
|
201
|
-
autofocus: _angular_core.InputSignal<boolean | undefined>;
|
|
132
|
+
declare class ToolbarComponent {
|
|
133
|
+
componentContextPositionIndex: _angular_core.InputSignal<number>;
|
|
134
|
+
supportedBlocks: _angular_core.InputSignal<SupportedBlock[]>;
|
|
202
135
|
blockOptionActions: _angular_core.InputSignal<BlockOptionAction[] | undefined>;
|
|
203
136
|
actionCallback: _angular_core.InputSignal<(action: string) => void>;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
137
|
+
formControlName: _angular_core.InputSignal<string | undefined>;
|
|
138
|
+
addBlockCallback: _angular_core.InputSignal<TAddBlockCallback>;
|
|
139
|
+
moveBlockPositionCallback: _angular_core.InputSignal<TMoveBlockPositionCallback>;
|
|
140
|
+
openBlocks: _angular_core.WritableSignal<boolean>;
|
|
141
|
+
openBlocksOption: _angular_core.WritableSignal<boolean>;
|
|
142
|
+
openBlocksList(): void;
|
|
143
|
+
openBlockOptionList(): void;
|
|
144
|
+
moveBlockPosition(action: MovePositionActions): void;
|
|
145
|
+
handleAction(action: string): void;
|
|
146
|
+
addBlock(block: Type<BlockComponent>): void;
|
|
147
|
+
closeLists(): void;
|
|
148
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarComponent, never>;
|
|
149
|
+
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>;
|
|
210
150
|
}
|
|
211
151
|
|
|
212
152
|
declare class ToolbarInlineService {
|
|
@@ -242,5 +182,66 @@ declare class NgxEditorJs2Component {
|
|
|
242
182
|
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
183
|
}
|
|
244
184
|
|
|
185
|
+
declare class AutofocusDirective implements AfterContentInit {
|
|
186
|
+
elementRef: ElementRef<any>;
|
|
187
|
+
autofocus: _angular_core.InputSignal<boolean>;
|
|
188
|
+
ngAfterContentInit(): void;
|
|
189
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutofocusDirective, never>;
|
|
190
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AutofocusDirective, "[autofocus]", never, { "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
type ComponentContext = {
|
|
194
|
+
index: number;
|
|
195
|
+
viewContainerRef: ViewContainerRef;
|
|
196
|
+
blockOptionActions: BlockOptionAction[];
|
|
197
|
+
actionCallback: (v: string) => void;
|
|
198
|
+
formControlName: string;
|
|
199
|
+
} | null;
|
|
200
|
+
declare class ToolFabService {
|
|
201
|
+
ngxEditorJs2Service: NgxEditorJs2Service;
|
|
202
|
+
editorJsService: EditorJsService;
|
|
203
|
+
componentContext: BehaviorSubject<ComponentContext>;
|
|
204
|
+
toolbarComponentRef$: rxjs.Observable<_angular_core.ComponentRef<ToolbarComponent>>;
|
|
205
|
+
addBlock(block: Type<BlockComponent>, index: number): rxjs.Observable<void>;
|
|
206
|
+
movePositionAction(action: MovePositionActions, index: number, formControlName: string): Promise<any>;
|
|
207
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolFabService, never>;
|
|
208
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ToolFabService>;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
type ToolbarComponentRef = Observable<ComponentRef<ToolbarComponent>>;
|
|
212
|
+
declare class ToolbarFabDirective {
|
|
213
|
+
toolFabService: ToolFabService;
|
|
214
|
+
viewContainerRef: ViewContainerRef;
|
|
215
|
+
autofocus: _angular_core.InputSignal<boolean | undefined>;
|
|
216
|
+
blockOptionActions: _angular_core.InputSignal<BlockOptionAction[] | undefined>;
|
|
217
|
+
actionCallback: _angular_core.InputSignal<(action: string) => void>;
|
|
218
|
+
componentContextPositionIndex: _angular_core.InputSignal<number>;
|
|
219
|
+
formControlName: _angular_core.InputSignal<string>;
|
|
220
|
+
onMouseEnter(): void;
|
|
221
|
+
constructor();
|
|
222
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarFabDirective, never>;
|
|
223
|
+
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>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
declare class ControlAccessorDirective implements ControlValueAccessor {
|
|
227
|
+
elementRef: ElementRef<any>;
|
|
228
|
+
defaultValue: _angular_core.InputSignal<string | undefined>;
|
|
229
|
+
onChange: (value: any) => void;
|
|
230
|
+
onTouched: () => void;
|
|
231
|
+
writeValue(): void;
|
|
232
|
+
registerOnChange(fn: any): void;
|
|
233
|
+
registerOnTouched(fn: any): void;
|
|
234
|
+
onBlur(): void;
|
|
235
|
+
onInput(): void;
|
|
236
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ControlAccessorDirective, never>;
|
|
237
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ControlAccessorDirective, "[controlAccessor]", never, { "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
declare class CleanPasteDataDirective {
|
|
241
|
+
onPaste(event: Event): void;
|
|
242
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CleanPasteDataDirective, never>;
|
|
243
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CleanPasteDataDirective, "[cleanPasteData]", never, {}, {}, never, never, true, never>;
|
|
244
|
+
}
|
|
245
|
+
|
|
245
246
|
export { AutofocusDirective, CleanPasteDataDirective, ControlAccessorDirective, MovePositionActions, NGX_EDITORJS_OPTIONS, NgxEditorJs2Component, NgxEditorJs2Service, ToolbarFabDirective };
|
|
246
247
|
export type { BlockComponent, BlockOptionAction, NgxEditorJsBlock, NgxEditorJsBlockWithComponent, NgxEditorjsOptions, SupportedBlock, TAddBlockCallback, TMoveBlockPositionCallback, ToolbarComponentRef };
|