@talrace/ngx-noder 0.0.47 → 19.0.24
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 +650 -649
- package/fesm2022/talrace-ngx-noder.mjs +187 -59
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/editor/components/editor.component.d.ts +3 -1
- package/lib/editor/components/shared/services/overlay.service.d.ts +1 -0
- package/lib/editor/content/display-data/text-line-info.d.ts +1 -0
- package/lib/editor/editor.module.d.ts +6 -0
- package/lib/editor/execution/editor.d.ts +6 -1
- package/lib/editor/gadgets/insert-overlays/insert-overlay-component.interface.d.ts +3 -0
- package/lib/editor/gadgets/insert-overlays/insert-overlays.d.ts +10 -0
- package/lib/editor/interaction/editor.service.d.ts +6 -0
- package/lib/editor/positioning/position.helper.d.ts +3 -0
- package/lib/editor/positioning/selection.d.ts +3 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -9,6 +9,7 @@ import { Editor } from '../execution/editor';
|
|
|
9
9
|
import { EditorSearchBarComponent } from '../../apart-components/editor-search-bar/editor-search-bar.component';
|
|
10
10
|
import { EditorService } from '../interaction/editor.service';
|
|
11
11
|
import { ExternalSidenavModel } from './external-element/models/external-sidenav.model';
|
|
12
|
+
import { InsertOverlays } from '../gadgets/insert-overlays/insert-overlays';
|
|
12
13
|
import { OverlayService } from './shared/services/overlay.service';
|
|
13
14
|
import { RegulatorService } from '../execution/regulator.service';
|
|
14
15
|
import { RulerUnit } from '../../apart-components/editor-ruler/editor-ruler.component';
|
|
@@ -22,6 +23,7 @@ export declare class EditorComponent implements OnDestroy {
|
|
|
22
23
|
private regulatorService;
|
|
23
24
|
private commandsService;
|
|
24
25
|
private clipboard;
|
|
26
|
+
private insertOverlays;
|
|
25
27
|
get isViewOnly$(): Observable<boolean>;
|
|
26
28
|
isMobile: boolean;
|
|
27
29
|
externalElementTagNames: string[];
|
|
@@ -40,7 +42,7 @@ export declare class EditorComponent implements OnDestroy {
|
|
|
40
42
|
sidenavProperties: ExternalSidenavModel;
|
|
41
43
|
readonly subscriptions: Subscription[];
|
|
42
44
|
private sidenavComponentRef;
|
|
43
|
-
constructor(cdr: ChangeDetectorRef, componentService: ComponentService, editorService: EditorService, overlayService: OverlayService, injector: Injector, regulatorService: RegulatorService, commandsService: CommandsService, clipboard: Clipboard);
|
|
45
|
+
constructor(cdr: ChangeDetectorRef, componentService: ComponentService, editorService: EditorService, overlayService: OverlayService, injector: Injector, regulatorService: RegulatorService, commandsService: CommandsService, clipboard: Clipboard, insertOverlays: InsertOverlays);
|
|
44
46
|
ngOnDestroy(): void;
|
|
45
47
|
initEditor(content: DocxModel): void;
|
|
46
48
|
toggleSidenavSubscription(): Subscription;
|
|
@@ -13,6 +13,7 @@ export declare class OverlayService {
|
|
|
13
13
|
clickSubscription(): void;
|
|
14
14
|
getOverlayConfig(xPosition: number, yPosition: number): OverlayConfig;
|
|
15
15
|
getOverlayPosition(xPosition: number, yPosition: number): PositionStrategy;
|
|
16
|
+
scroll(deltaY: number): void;
|
|
16
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayService, never>;
|
|
17
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<OverlayService>;
|
|
18
19
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ComponentType } from '@angular/cdk/portal';
|
|
1
2
|
import { ModuleWithProviders, Type } from '@angular/core';
|
|
2
3
|
import { ImageApiService } from './components/image/image-api.service';
|
|
3
4
|
import { ExternalElementInterface } from '../editor/components/external-element/external-element.service';
|
|
4
5
|
import { ExternalSidenavModel } from './components/external-element/models/external-sidenav.model';
|
|
6
|
+
import { InsertOverlayComponentInterface } from './gadgets/insert-overlays/insert-overlay-component.interface';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
import * as i1 from "./components/editor.component";
|
|
7
9
|
import * as i2 from "./components/edges/edge.component";
|
|
@@ -24,6 +26,10 @@ import * as i18 from "@ngx-translate/core";
|
|
|
24
26
|
export interface INoderOptions {
|
|
25
27
|
sidenav?: Partial<ExternalSidenavModel>;
|
|
26
28
|
imageApiService?: Type<ImageApiService>;
|
|
29
|
+
insertOverlays?: {
|
|
30
|
+
key: string;
|
|
31
|
+
component: ComponentType<InsertOverlayComponentInterface>;
|
|
32
|
+
}[];
|
|
27
33
|
elementService: Type<ExternalElementInterface>;
|
|
28
34
|
}
|
|
29
35
|
export declare class EditorModule {
|
|
@@ -22,6 +22,7 @@ import { InsertBreakModel } from '../../models/generated/insert-break.model';
|
|
|
22
22
|
import { InsertElementModel } from '../../models/generated/insert-element.model';
|
|
23
23
|
import { InsertImageModel } from '../../models/generated/insert-image.model';
|
|
24
24
|
import { InsertLinkModel } from '../../models/generated/insert-link.model';
|
|
25
|
+
import { InsertOverlays } from '../gadgets/insert-overlays/insert-overlays';
|
|
25
26
|
import { InsertTableModel } from '../../models/generated/insert-table.model';
|
|
26
27
|
import { InsertTabModel } from '../../models/generated/insert-tab.model';
|
|
27
28
|
import { LinkDataModel } from '../../models/generated/link-data.model';
|
|
@@ -60,6 +61,7 @@ export declare class Editor {
|
|
|
60
61
|
private commandsService;
|
|
61
62
|
private clipboard;
|
|
62
63
|
private externalElementTagNames;
|
|
64
|
+
private insertOverlays;
|
|
63
65
|
private customPageWidth?;
|
|
64
66
|
readonly MAX_COUNT = 999;
|
|
65
67
|
readonly parentTagName = "APP-NOD-EDITOR";
|
|
@@ -88,12 +90,13 @@ export declare class Editor {
|
|
|
88
90
|
private textInput;
|
|
89
91
|
private clipboardData;
|
|
90
92
|
private isRerenderSubscriptionOpen;
|
|
91
|
-
constructor(model: DocxModel, container: ElementRef<HTMLElement>, editorService: EditorService, overlayService: OverlayService, regulatorService: RegulatorService, commandsService: CommandsService, clipboard: Clipboard, externalElementTagNames: string[], customPageWidth?: number);
|
|
93
|
+
constructor(model: DocxModel, container: ElementRef<HTMLElement>, editorService: EditorService, overlayService: OverlayService, regulatorService: RegulatorService, commandsService: CommandsService, clipboard: Clipboard, externalElementTagNames: string[], insertOverlays: InsertOverlays, customPageWidth?: number);
|
|
92
94
|
destroy(): void;
|
|
93
95
|
selectPageDown(): void;
|
|
94
96
|
selectPageUp(): void;
|
|
95
97
|
gotoPageDown(): void;
|
|
96
98
|
gotoPageUp(): void;
|
|
99
|
+
showInsertOverlay(textKey: string): void;
|
|
97
100
|
cut(): void;
|
|
98
101
|
insert(text: string): void;
|
|
99
102
|
insertText(text: string, textStyle: TextStyleModel): void;
|
|
@@ -157,6 +160,7 @@ export declare class Editor {
|
|
|
157
160
|
saveInsertPageFormatToHistory(model: PageFormatModel, startIndex: number, endIndex: number): void;
|
|
158
161
|
saveApplyDocumentPageFormatToHistory(defaultPageFormat: PageFormatModel): void;
|
|
159
162
|
createCustomElement(data: ElementDataModel): void;
|
|
163
|
+
replaceByCustomElement(textKey: string, model: ElementDataModel): void;
|
|
160
164
|
removeSelected(): void;
|
|
161
165
|
removeWithParagraph(): void;
|
|
162
166
|
removeCustomElementsData(): void;
|
|
@@ -238,6 +242,7 @@ export declare class Editor {
|
|
|
238
242
|
setImageStyleSubscription(): Subscription;
|
|
239
243
|
rerenderSubscription(): Subscription;
|
|
240
244
|
createCustomComponentSubscription(): Subscription;
|
|
245
|
+
replaceByCustomComponentSubscription(): Subscription;
|
|
241
246
|
insertBreakSubscription(): Subscription;
|
|
242
247
|
insertImageSubscription(): Subscription;
|
|
243
248
|
insertLinkSubscription(): Subscription;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType } from '@angular/cdk/portal';
|
|
2
|
+
import { InsertOverlayComponentInterface } from './insert-overlay-component.interface';
|
|
3
|
+
export declare class InsertOverlays {
|
|
4
|
+
private readonly componentMap;
|
|
5
|
+
constructor(models?: {
|
|
6
|
+
key: string;
|
|
7
|
+
component: ComponentType<InsertOverlayComponentInterface>;
|
|
8
|
+
}[] | null);
|
|
9
|
+
getComponent(key: string): ComponentType<InsertOverlayComponentInterface> | null;
|
|
10
|
+
}
|
|
@@ -90,6 +90,11 @@ export declare class EditorService {
|
|
|
90
90
|
private readonly _rerender$;
|
|
91
91
|
get createCustomComponent$(): Observable<ElementDataModel>;
|
|
92
92
|
private readonly _createCustomComponent$;
|
|
93
|
+
get replaceByCustomComponent$(): Observable<{
|
|
94
|
+
textKey: string;
|
|
95
|
+
model: ElementDataModel;
|
|
96
|
+
}>;
|
|
97
|
+
private readonly _replaceByCustomComponent$;
|
|
93
98
|
get insertBreak$(): Observable<BreakTypes>;
|
|
94
99
|
private readonly _insertBreak$;
|
|
95
100
|
get insertImage$(): Observable<ImageDataModel>;
|
|
@@ -257,6 +262,7 @@ export declare class EditorService {
|
|
|
257
262
|
changeImageStyle(value: ImageModel): void;
|
|
258
263
|
rerender(index?: number): void;
|
|
259
264
|
createCustomComponent(model: ElementDataModel): void;
|
|
265
|
+
replaceByCustomComponent(textKey: string, model: ElementDataModel): void;
|
|
260
266
|
insertBreak(value: BreakTypes): void;
|
|
261
267
|
insertImage(imageData: ImageDataModel): void;
|
|
262
268
|
insertLink(text: string, link: string): void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { CursorParagraph } from './cursor-paragraph';
|
|
2
2
|
import { CursorPosition } from './cursor-position.interface';
|
|
3
3
|
import { EditSession } from '../execution/edit.session';
|
|
4
|
+
import { Paragraph } from '../content/display-data/paragraph';
|
|
4
5
|
import { ParagraphInfo } from '../content/display-data/paragraph-info.interface';
|
|
5
6
|
import { ParagraphInfoModel } from '../content/display-data/models/paragraph-info.model';
|
|
7
|
+
import { TextLineInfo } from '../content/display-data/text-line-info';
|
|
6
8
|
export declare class PositionHelper {
|
|
7
9
|
/**
|
|
8
10
|
* Returns an object containing the `pageX` and `pageY` coordinates of the document position.
|
|
@@ -44,4 +46,5 @@ export declare class PositionHelper {
|
|
|
44
46
|
lineIndex: number;
|
|
45
47
|
};
|
|
46
48
|
static getApproximatePosition(session: EditSession, documentLine: number, positionWidth: number): number;
|
|
49
|
+
static getMarkerWidth(paragraphSettings: Paragraph, textLineInfo: TextLineInfo, lineIndex: number): number;
|
|
47
50
|
}
|
|
@@ -3,8 +3,10 @@ import { BaseNoderComponent } from '../components/shared/abstract/base.component
|
|
|
3
3
|
import { ContentType } from '../content/contents.interface';
|
|
4
4
|
import { CursorParagraph } from './cursor-paragraph';
|
|
5
5
|
import { EditSession } from '../execution/edit.session';
|
|
6
|
+
import { OverlayService } from '../components/shared/services/overlay.service';
|
|
6
7
|
import { Range } from './range';
|
|
7
8
|
export declare class Selection {
|
|
9
|
+
private overlayService;
|
|
8
10
|
anchor: CursorParagraph | null;
|
|
9
11
|
cursor: CursorParagraph;
|
|
10
12
|
isDisabled: boolean;
|
|
@@ -15,6 +17,7 @@ export declare class Selection {
|
|
|
15
17
|
get isBackwards(): boolean;
|
|
16
18
|
get selectedRange(): Range;
|
|
17
19
|
get range(): Range;
|
|
20
|
+
constructor(overlayService: OverlayService);
|
|
18
21
|
focus(component: ComponentRef<BaseNoderComponent>, position: CursorParagraph): void;
|
|
19
22
|
blur(): void;
|
|
20
23
|
placeCursor(cursor: CursorParagraph): void;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './lib/editor/execution/helpers/dom.helper';
|
|
|
6
6
|
export * from './lib/editor/execution/helpers/format-style.helper';
|
|
7
7
|
export * from './lib/editor/gadgets/font-metrics/font-metrics.helper';
|
|
8
8
|
export * from './lib/editor/content/display-data/toolbar-styles.interface';
|
|
9
|
+
export * from './lib/editor/gadgets/insert-overlays/insert-overlay-component.interface';
|
|
9
10
|
export * from './lib/editor/components/external-element/models/element-data.model';
|
|
10
11
|
export * from './lib/editor/components/external-element/models/external-element.model';
|
|
11
12
|
export * from './lib/editor/components/external-element/external.component';
|