@tmdjr/ngx-editor-js2 21.0.7 → 21.0.8
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 +183 -173
- 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 +82 -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
|
}
|
|
@@ -76,26 +48,6 @@ declare enum MovePositionActions {
|
|
|
76
48
|
type TAddBlockCallback = (block: Type<BlockComponent>, index: number) => Observable<unknown>;
|
|
77
49
|
type TMoveBlockPositionCallback = (action: MovePositionActions, index: number) => Observable<unknown>;
|
|
78
50
|
|
|
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
51
|
declare class BlockMovementService {
|
|
100
52
|
componentRefMap: Map<object, ComponentRef<BlockComponent>>;
|
|
101
53
|
clearComponentRefs(): void;
|
|
@@ -122,7 +74,7 @@ declare class EditorJsService {
|
|
|
122
74
|
getBlocks$(): Observable<NgxEditorJsBlock[]>;
|
|
123
75
|
createNgxEditorJsBlockWithComponent(blockComponent: Type<BlockComponent>, componentContextPositionIndex: number): Observable<NgxEditorJsBlockWithComponent>;
|
|
124
76
|
addBlockComponent(ngxEditorJsBlock: NgxEditorJsBlockWithComponent, emitEvent?: boolean): Observable<void>;
|
|
125
|
-
createFormGroupControl({ blockId, dataClean }: NgxEditorJsBlockWithComponent, emitEvent?: boolean): Observable<_angular_forms.FormControl<string | null>>;
|
|
77
|
+
createFormGroupControl({ blockId, dataClean, }: NgxEditorJsBlockWithComponent, emitEvent?: boolean): Observable<_angular_forms.FormControl<string | null>>;
|
|
126
78
|
attachComponent({ component, blockId, autofocus, savedAction, sortIndex: index, }: NgxEditorJsBlockWithComponent): Observable<_angular_core.ComponentRef<BlockComponent>>;
|
|
127
79
|
determineMovePositionAction(action: MovePositionActions, index: number, formControlName: string): Observable<any>;
|
|
128
80
|
moveBlockComponentPosition(previousIndex: number, currentIndex: number): Observable<any>;
|
|
@@ -176,37 +128,24 @@ declare class NgxEditorJs2Service {
|
|
|
176
128
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxEditorJs2Service>;
|
|
177
129
|
}
|
|
178
130
|
|
|
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>;
|
|
131
|
+
declare class ToolbarComponent {
|
|
132
|
+
componentContextPositionIndex: _angular_core.InputSignal<number>;
|
|
133
|
+
supportedBlocks: _angular_core.InputSignal<SupportedBlock[]>;
|
|
202
134
|
blockOptionActions: _angular_core.InputSignal<BlockOptionAction[] | undefined>;
|
|
203
135
|
actionCallback: _angular_core.InputSignal<(action: string) => void>;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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>;
|
|
210
149
|
}
|
|
211
150
|
|
|
212
151
|
declare class ToolbarInlineService {
|
|
@@ -242,5 +181,66 @@ declare class NgxEditorJs2Component {
|
|
|
242
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>;
|
|
243
182
|
}
|
|
244
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
|
+
type ComponentContext = {
|
|
193
|
+
index: number;
|
|
194
|
+
viewContainerRef: ViewContainerRef;
|
|
195
|
+
blockOptionActions: BlockOptionAction[];
|
|
196
|
+
actionCallback: (v: string) => void;
|
|
197
|
+
formControlName: string;
|
|
198
|
+
} | null;
|
|
199
|
+
declare class ToolFabService {
|
|
200
|
+
ngxEditorJs2Service: NgxEditorJs2Service;
|
|
201
|
+
editorJsService: EditorJsService;
|
|
202
|
+
componentContext: BehaviorSubject<ComponentContext>;
|
|
203
|
+
toolbarComponentRef$: rxjs.Observable<_angular_core.ComponentRef<ToolbarComponent>>;
|
|
204
|
+
addBlock(block: Type<BlockComponent>, index: number): rxjs.Observable<void>;
|
|
205
|
+
movePositionAction(action: MovePositionActions, index: number, formControlName: string): Promise<any>;
|
|
206
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolFabService, never>;
|
|
207
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ToolFabService>;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
type ToolbarComponentRef = Observable<ComponentRef<ToolbarComponent>>;
|
|
211
|
+
declare class ToolbarFabDirective {
|
|
212
|
+
toolFabService: ToolFabService;
|
|
213
|
+
viewContainerRef: ViewContainerRef;
|
|
214
|
+
autofocus: _angular_core.InputSignal<boolean | undefined>;
|
|
215
|
+
blockOptionActions: _angular_core.InputSignal<BlockOptionAction[] | undefined>;
|
|
216
|
+
actionCallback: _angular_core.InputSignal<(action: string) => void>;
|
|
217
|
+
componentContextPositionIndex: _angular_core.InputSignal<number>;
|
|
218
|
+
formControlName: _angular_core.InputSignal<string>;
|
|
219
|
+
onMouseEnter(): void;
|
|
220
|
+
constructor();
|
|
221
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToolbarFabDirective, never>;
|
|
222
|
+
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
|
+
}
|
|
224
|
+
|
|
225
|
+
declare class ControlAccessorDirective implements ControlValueAccessor {
|
|
226
|
+
elementRef: ElementRef<any>;
|
|
227
|
+
defaultValue: _angular_core.InputSignal<string | undefined>;
|
|
228
|
+
onChange: (value: any) => void;
|
|
229
|
+
onTouched: () => void;
|
|
230
|
+
writeValue(): void;
|
|
231
|
+
registerOnChange(fn: any): void;
|
|
232
|
+
registerOnTouched(fn: any): void;
|
|
233
|
+
onBlur(): void;
|
|
234
|
+
onInput(): void;
|
|
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>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare class CleanPasteDataDirective {
|
|
240
|
+
onPaste(event: Event): void;
|
|
241
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CleanPasteDataDirective, never>;
|
|
242
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CleanPasteDataDirective, "[cleanPasteData]", never, {}, {}, never, never, true, never>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
245
|
export { AutofocusDirective, CleanPasteDataDirective, ControlAccessorDirective, MovePositionActions, NGX_EDITORJS_OPTIONS, NgxEditorJs2Component, NgxEditorJs2Service, ToolbarFabDirective };
|
|
246
246
|
export type { BlockComponent, BlockOptionAction, NgxEditorJsBlock, NgxEditorJsBlockWithComponent, NgxEditorjsOptions, SupportedBlock, TAddBlockCallback, TMoveBlockPositionCallback, ToolbarComponentRef };
|