@talrace/ngx-noder 0.0.41 → 0.0.43
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/assets/i18n/noder.en.json +2 -1
- package/assets/i18n/noder.es.json +2 -1
- package/assets/i18n/noder.ru.json +2 -1
- package/fesm2022/talrace-ngx-noder.mjs +705 -467
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/apart-components/editor-ruler/editor-ruler.component.d.ts +23 -10
- package/lib/apart-components/editor-search-bar/editor-search-bar.component.d.ts +26 -0
- package/lib/editor/components/editor.component.d.ts +7 -1
- package/lib/editor/display/layers/highlight.layer.d.ts +16 -0
- package/lib/editor/display/layers/search-highlight.layer.d.ts +12 -0
- package/lib/editor/display/layers/selection.layer.d.ts +3 -11
- package/lib/editor/display/render-changes.interface.d.ts +1 -0
- package/lib/editor/display/render-changes.model.d.ts +1 -0
- package/lib/editor/display/renderer.d.ts +5 -0
- package/lib/editor/display/virtual.renderer.d.ts +4 -1
- package/lib/editor/editor.module.d.ts +10 -9
- package/lib/editor/execution/edit.session.d.ts +1 -0
- package/lib/editor/execution/editor.d.ts +17 -8
- package/lib/editor/gadgets/history/operation-history.d.ts +1 -0
- package/lib/editor/gadgets/history/operation.type.d.ts +2 -1
- package/lib/editor/gadgets/search/search-result.interface.d.ts +5 -0
- package/lib/editor/gadgets/search/search.d.ts +14 -30
- package/lib/editor/interaction/editor.service.d.ts +40 -18
- package/lib/editor/operations/enums/command-type.enum.d.ts +2 -1
- package/lib/editor/operations/helpers/paragraph-operations.helper.d.ts +1 -0
- package/lib/editor/operations/operations-helper.helper.d.ts +1 -0
- package/lib/editor/operations/save-commands.helper.d.ts +1 -0
- package/lib/models/generated/apply-paragraphs.model.d.ts +5 -0
- package/lib/models/generated/command.model.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/src/_ngx-noder.theme.scss +2 -0
- package/src/lib/apart-components/editor-search-bar/_theme.scss +28 -0
- package/src/scss/base-editor.scss +13 -3
- package/lib/apart-components/editor-search/editor-search-dialog.component.d.ts +0 -23
- package/lib/editor/gadgets/search/replace.interface.d.ts +0 -4
- package/lib/editor/gadgets/search/search-iteration.interface.d.ts +0 -4
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import { EditorService } from '../../editor/interaction/editor.service';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
type
|
|
4
|
+
export type RulerUnit = 'cm' | 'inch';
|
|
5
|
+
type DragTarget = 'leftIndent' | 'first' | 'rightIndent' | 'leftMarginPageFormat' | 'rightMarginPageFormat';
|
|
5
6
|
interface Tick {
|
|
6
7
|
position: number;
|
|
7
8
|
originalPaddings: number;
|
|
@@ -11,33 +12,45 @@ interface Tick {
|
|
|
11
12
|
}
|
|
12
13
|
export declare class EditorRulerComponent {
|
|
13
14
|
rulerContainer: ElementRef<HTMLDivElement>;
|
|
15
|
+
unit: import("@angular/core").InputSignal<RulerUnit>;
|
|
14
16
|
readonly editorService: EditorService;
|
|
15
|
-
readonly pxPerCm = 37.8;
|
|
16
|
-
readonly snapCm = 0.25;
|
|
17
17
|
readonly defaultPaddingCm = 2.5;
|
|
18
18
|
readonly pageWidth$: import("rxjs").Observable<number>;
|
|
19
|
+
private readonly snapInch;
|
|
20
|
+
private readonly snapCm;
|
|
21
|
+
private readonly pxPerCm;
|
|
22
|
+
private readonly pxPerInch;
|
|
23
|
+
private readonly firstLine;
|
|
24
|
+
private readonly leftIndent;
|
|
25
|
+
private readonly rightIndent;
|
|
26
|
+
readonly leftIndentPx: import("@angular/core").Signal<number>;
|
|
27
|
+
readonly firstLinePx: import("@angular/core").Signal<number>;
|
|
28
|
+
readonly rightIndentPx: import("@angular/core").Signal<number>;
|
|
29
|
+
readonly leftMarginPageFormatPx: import("@angular/core").WritableSignal<number>;
|
|
30
|
+
readonly rightMarginPageFormatPx: import("@angular/core").WritableSignal<number>;
|
|
31
|
+
readonly guideX: import("@angular/core").WritableSignal<number>;
|
|
32
|
+
readonly showGuide: import("@angular/core").WritableSignal<boolean>;
|
|
19
33
|
containerWidthPx: number;
|
|
20
34
|
ticks: Tick[];
|
|
21
|
-
leftPx: import("@angular/core").WritableSignal<number>;
|
|
22
|
-
firstLinePx: import("@angular/core").WritableSignal<number>;
|
|
23
|
-
rightPx: import("@angular/core").WritableSignal<number>;
|
|
24
|
-
guideX: import("@angular/core").WritableSignal<number>;
|
|
25
|
-
showGuide: import("@angular/core").WritableSignal<boolean>;
|
|
26
35
|
private dragging;
|
|
27
36
|
private dragOffsetX;
|
|
37
|
+
constructor();
|
|
28
38
|
afterViewInit(): void;
|
|
29
39
|
onResize(): void;
|
|
30
40
|
private recalcGeometry;
|
|
31
41
|
private cmToPx;
|
|
32
42
|
private pxToCm;
|
|
43
|
+
private inchToPx;
|
|
44
|
+
private pxToInch;
|
|
33
45
|
private snapPx;
|
|
34
|
-
private
|
|
46
|
+
private buildTicksCm;
|
|
47
|
+
private buildTicksInch;
|
|
35
48
|
startDrag(ev: MouseEvent | TouchEvent, target: DragTarget): void;
|
|
36
49
|
private readonly onMove;
|
|
37
50
|
private readonly onUp;
|
|
38
51
|
private getClientX;
|
|
39
52
|
private getCurrentDraggedPx;
|
|
40
53
|
static ɵfac: i0.ɵɵFactoryDeclaration<EditorRulerComponent, never>;
|
|
41
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<EditorRulerComponent, "app-nod-editor-ruler", never, {}, {}, never, never, true, never>;
|
|
54
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditorRulerComponent, "app-nod-editor-ruler", never, { "unit": { "alias": "unit"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
42
55
|
}
|
|
43
56
|
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DestroyRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { FormControl } from '@angular/forms';
|
|
4
|
+
import { EditorService } from '../../editor/interaction/editor.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class EditorSearchBarComponent implements OnInit, OnDestroy {
|
|
7
|
+
private readonly editorService;
|
|
8
|
+
private readonly destroyRef;
|
|
9
|
+
searchInput: ElementRef<HTMLInputElement>;
|
|
10
|
+
searchControl: FormControl<string>;
|
|
11
|
+
replaceControl: FormControl<string>;
|
|
12
|
+
isReplace: boolean;
|
|
13
|
+
searchResultIndex$: Observable<number>;
|
|
14
|
+
searchResultCount$: Observable<number>;
|
|
15
|
+
constructor(editorService: EditorService, destroyRef: DestroyRef);
|
|
16
|
+
ngOnInit(): void;
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
onClose(): void;
|
|
19
|
+
focusInput(): void;
|
|
20
|
+
findNext(): void;
|
|
21
|
+
findPrev(): void;
|
|
22
|
+
setReplace(): void;
|
|
23
|
+
replace(): void;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditorSearchBarComponent, never>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditorSearchBarComponent, "app-nod-editor-search-bar", never, {}, {}, never, never, true, never>;
|
|
26
|
+
}
|
|
@@ -6,9 +6,11 @@ import { CommandsService } from '../operations/commands.service';
|
|
|
6
6
|
import { ComponentService } from './shared/services/component.service';
|
|
7
7
|
import { DocxModel } from '../../models/generated/docx.model';
|
|
8
8
|
import { Editor } from '../execution/editor';
|
|
9
|
+
import { EditorSearchBarComponent } from '../../apart-components/editor-search-bar/editor-search-bar.component';
|
|
9
10
|
import { EditorService } from '../interaction/editor.service';
|
|
10
11
|
import { ExternalSidenavModel } from './external-element/models/external-sidenav.model';
|
|
11
12
|
import { RegulatorService } from '../execution/regulator.service';
|
|
13
|
+
import { RulerUnit } from '../../apart-components/editor-ruler/editor-ruler.component';
|
|
12
14
|
import * as i0 from "@angular/core";
|
|
13
15
|
export declare class EditorComponent implements OnDestroy {
|
|
14
16
|
private cdr;
|
|
@@ -25,11 +27,14 @@ export declare class EditorComponent implements OnDestroy {
|
|
|
25
27
|
set content(model: DocxModel);
|
|
26
28
|
get content(): DocxModel;
|
|
27
29
|
private _content;
|
|
30
|
+
rulerUnit: import("@angular/core").InputSignal<RulerUnit>;
|
|
28
31
|
container: ElementRef<HTMLElement>;
|
|
29
32
|
sidenavContainer: ElementRef<HTMLElement>;
|
|
30
33
|
sidenav: MatDrawer;
|
|
34
|
+
searchBar: EditorSearchBarComponent;
|
|
31
35
|
class: string;
|
|
32
36
|
editor: Editor;
|
|
37
|
+
showSearchBar: boolean;
|
|
33
38
|
sidenavProperties: ExternalSidenavModel;
|
|
34
39
|
readonly subscriptions: Subscription[];
|
|
35
40
|
private sidenavComponentRef;
|
|
@@ -37,7 +42,8 @@ export declare class EditorComponent implements OnDestroy {
|
|
|
37
42
|
ngOnDestroy(): void;
|
|
38
43
|
initEditor(content: DocxModel): void;
|
|
39
44
|
toggleSidenavSubscription(): Subscription;
|
|
45
|
+
searchBarSubscription(): Subscription;
|
|
40
46
|
removeSidenavComponent(): void;
|
|
41
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<EditorComponent, never>;
|
|
42
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<EditorComponent, "app-nod-editor", never, { "isMobile": { "alias": "isMobile"; "required": false; }; "externalElementTagNames": { "alias": "externalElementTagNames"; "required": false; }; "customPageWidth": { "alias": "customPageWidth"; "required": false; }; "content": { "alias": "content"; "required": false; }; }, {}, never, never, false, never>;
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditorComponent, "app-nod-editor", never, { "isMobile": { "alias": "isMobile"; "required": false; }; "externalElementTagNames": { "alias": "externalElementTagNames"; "required": false; }; "customPageWidth": { "alias": "customPageWidth"; "required": false; }; "content": { "alias": "content"; "required": false; }; "rulerUnit": { "alias": "rulerUnit"; "required": true; "isSignal": true; }; }, {}, never, never, false, never>;
|
|
43
49
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EditSession } from '../../execution/edit.session';
|
|
2
|
+
import { ILayerConfig } from './layer.config';
|
|
3
|
+
import { Range } from '../../positioning/range';
|
|
4
|
+
export declare abstract class HighlightLayer {
|
|
5
|
+
protected readonly session: EditSession;
|
|
6
|
+
element: HTMLElement;
|
|
7
|
+
selectionIndex: number;
|
|
8
|
+
config: ILayerConfig;
|
|
9
|
+
constructor(parentEl: HTMLElement, cssClass: string, session: EditSession);
|
|
10
|
+
renderHighlight(cssPosition: string, cssClass: string): void;
|
|
11
|
+
getTop(row: number): number;
|
|
12
|
+
drawMultiLineMarker(range: Range, cssClass: string): void;
|
|
13
|
+
drawSingleLineMarker(range: Range, cssClass: string): void;
|
|
14
|
+
private getRangeInfo;
|
|
15
|
+
private getMarkerStyle;
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EditSession } from '../../execution/edit.session';
|
|
2
|
+
import { HighlightLayer } from './highlight.layer';
|
|
3
|
+
import { ILayerConfig } from './layer.config';
|
|
4
|
+
import { Range } from '../../positioning/range';
|
|
5
|
+
export declare class SearchHighlightLayer extends HighlightLayer {
|
|
6
|
+
private readonly className;
|
|
7
|
+
private readonly selectedClassName;
|
|
8
|
+
markers: Range[];
|
|
9
|
+
active: Range;
|
|
10
|
+
constructor(parentEl: HTMLElement, cssClass: string, session: EditSession);
|
|
11
|
+
update(config: ILayerConfig): void;
|
|
12
|
+
}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { EditSession } from '../../execution/edit.session';
|
|
2
|
+
import { HighlightLayer } from './highlight.layer';
|
|
2
3
|
import { ILayerConfig } from './layer.config';
|
|
3
4
|
import { Range } from '../../positioning/range';
|
|
4
|
-
export declare class SelectionLayer {
|
|
5
|
-
private readonly
|
|
6
|
-
element: HTMLElement;
|
|
5
|
+
export declare class SelectionLayer extends HighlightLayer {
|
|
6
|
+
private readonly className;
|
|
7
7
|
marker: Range | null;
|
|
8
|
-
selectionIndex: number;
|
|
9
|
-
config: ILayerConfig;
|
|
10
8
|
constructor(parentEl: HTMLElement, cssClass: string, session: EditSession);
|
|
11
|
-
renderSelection(css: string): void;
|
|
12
9
|
update(config: ILayerConfig): void;
|
|
13
|
-
getTop(row: number): number;
|
|
14
|
-
drawMultiLineMarker(range: Range): void;
|
|
15
|
-
drawSingleLineMarker(range: Range): void;
|
|
16
|
-
private getRangeInfo;
|
|
17
|
-
private getMarkerStyle;
|
|
18
10
|
}
|
|
@@ -6,6 +6,7 @@ import { ILayerConfig } from './layers/layer.config';
|
|
|
6
6
|
import { Range } from '../positioning/range';
|
|
7
7
|
import { RenderChangesModel } from './render-changes.model';
|
|
8
8
|
import { RenderLoop } from './renderloop';
|
|
9
|
+
import { SearchHighlightLayer } from './layers/search-highlight.layer';
|
|
9
10
|
import { SelectionLayer } from './layers/selection.layer';
|
|
10
11
|
import { TextLayer } from './layers/text.layer';
|
|
11
12
|
export declare class Renderer extends EventEmitting {
|
|
@@ -16,6 +17,7 @@ export declare class Renderer extends EventEmitting {
|
|
|
16
17
|
textLayer: TextLayer;
|
|
17
18
|
selectionLayer: SelectionLayer;
|
|
18
19
|
dragAndDropSelectionLayer: SelectionLayer;
|
|
20
|
+
searchHighlightLayer: SearchHighlightLayer;
|
|
19
21
|
loop: RenderLoop;
|
|
20
22
|
textarea: HTMLElement;
|
|
21
23
|
layerConfig: ILayerConfig;
|
|
@@ -32,6 +34,8 @@ export declare class Renderer extends EventEmitting {
|
|
|
32
34
|
updateLines(firstRow: number, lastRow: number): void;
|
|
33
35
|
moveTextAreaToCursor(): void;
|
|
34
36
|
updateSelection(range: Range): void;
|
|
37
|
+
updateSearchHighlights(ranges: Range[]): void;
|
|
38
|
+
updateActiveSearchHighlight(active: Range): void;
|
|
35
39
|
updateDragAndDropSelection(range: Range | null): void;
|
|
36
40
|
clearDragAndDropSelection(): void;
|
|
37
41
|
/**
|
|
@@ -55,6 +59,7 @@ export declare class Renderer extends EventEmitting {
|
|
|
55
59
|
renderText(): void;
|
|
56
60
|
renderCursor(): void;
|
|
57
61
|
renderSelection(): void;
|
|
62
|
+
renderSearchHighlights(): void;
|
|
58
63
|
renderDragAndDropSelection(): void;
|
|
59
64
|
private computeLayerConfig;
|
|
60
65
|
private pagesCountChangedHandler;
|
|
@@ -6,8 +6,8 @@ import { ILayerConfig } from './layers/layer.config';
|
|
|
6
6
|
import { PagesLayer } from './layers/pages.layer';
|
|
7
7
|
import { Range } from '../positioning/range';
|
|
8
8
|
import { RenderChangesModel } from './render-changes.model';
|
|
9
|
-
import { RenderLoop } from './renderloop';
|
|
10
9
|
import { Renderer } from './renderer';
|
|
10
|
+
import { RenderLoop } from './renderloop';
|
|
11
11
|
import { ScrollBar } from '../gadgets/scrollbar';
|
|
12
12
|
export declare class VirtualRenderer {
|
|
13
13
|
scrollBar: ScrollBar;
|
|
@@ -46,6 +46,8 @@ export declare class VirtualRenderer {
|
|
|
46
46
|
updateCachedSize(force: boolean, width: number, height: number): RenderChangesModel;
|
|
47
47
|
moveTextAreaToCursor(): void;
|
|
48
48
|
updateSelection(range: Range): void;
|
|
49
|
+
updateSearchHighlights(ranges: Range[]): void;
|
|
50
|
+
updateActiveSearchHighlight(active: Range): void;
|
|
49
51
|
updateDragAndDropSelection(range: Range): void;
|
|
50
52
|
clearDragAndDropSelection(): void;
|
|
51
53
|
/**
|
|
@@ -73,5 +75,6 @@ export declare class VirtualRenderer {
|
|
|
73
75
|
private renderText;
|
|
74
76
|
private renderCursor;
|
|
75
77
|
private renderSelection;
|
|
78
|
+
private renderSearchHighlights;
|
|
76
79
|
private renderDragAndDropSelection;
|
|
77
80
|
}
|
|
@@ -12,14 +12,15 @@ import * as i6 from "./components/table/components/table.component";
|
|
|
12
12
|
import * as i7 from "./components/image/resizer/resizer.component";
|
|
13
13
|
import * as i8 from "./components/table/overlay-menu/overlay-menu.component";
|
|
14
14
|
import * as i9 from "@angular/common";
|
|
15
|
-
import * as i10 from "
|
|
16
|
-
import * as i11 from "
|
|
17
|
-
import * as i12 from "@angular/material/
|
|
18
|
-
import * as i13 from "
|
|
19
|
-
import * as i14 from "@angular/material/
|
|
20
|
-
import * as i15 from "@angular/material/
|
|
21
|
-
import * as i16 from "@angular/
|
|
22
|
-
import * as i17 from "@
|
|
15
|
+
import * as i10 from "../apart-components/editor-ruler/editor-ruler.component";
|
|
16
|
+
import * as i11 from "../apart-components/editor-search-bar/editor-search-bar.component";
|
|
17
|
+
import * as i12 from "@angular/material/button";
|
|
18
|
+
import * as i13 from "@angular/material/dialog";
|
|
19
|
+
import * as i14 from "@angular/material/icon";
|
|
20
|
+
import * as i15 from "@angular/material/sidenav";
|
|
21
|
+
import * as i16 from "@angular/material/tooltip";
|
|
22
|
+
import * as i17 from "@angular/forms";
|
|
23
|
+
import * as i18 from "@ngx-translate/core";
|
|
23
24
|
export interface INoderOptions {
|
|
24
25
|
sidenav?: Partial<ExternalSidenavModel>;
|
|
25
26
|
imageApiService?: Type<ImageApiService>;
|
|
@@ -28,6 +29,6 @@ export interface INoderOptions {
|
|
|
28
29
|
export declare class EditorModule {
|
|
29
30
|
static forRoot(options?: INoderOptions): ModuleWithProviders<EditorModule>;
|
|
30
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<EditorModule, never>;
|
|
31
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<EditorModule, [typeof i1.EditorComponent, typeof i2.NoderEdgeComponent, typeof i3.NoderImageComponent, typeof i4.NoderTabComponent, typeof i5.NoderTableCellComponent, typeof i6.NoderTableComponent, typeof i7.ResizerComponent, typeof i8.TableOverlayMenuComponent], [typeof i9.CommonModule, typeof i10.
|
|
32
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<EditorModule, [typeof i1.EditorComponent, typeof i2.NoderEdgeComponent, typeof i3.NoderImageComponent, typeof i4.NoderTabComponent, typeof i5.NoderTableCellComponent, typeof i6.NoderTableComponent, typeof i7.ResizerComponent, typeof i8.TableOverlayMenuComponent], [typeof i9.CommonModule, typeof i10.EditorRulerComponent, typeof i11.EditorSearchBarComponent, typeof i12.MatButtonModule, typeof i13.MatDialogModule, typeof i14.MatIconModule, typeof i15.MatSidenavModule, typeof i16.MatTooltipModule, typeof i17.ReactiveFormsModule, typeof i18.TranslateModule], [typeof i1.EditorComponent]>;
|
|
32
33
|
static ɵinj: i0.ɵɵInjectorDeclaration<EditorModule>;
|
|
33
34
|
}
|
|
@@ -90,6 +90,7 @@ export declare class EditSession {
|
|
|
90
90
|
applyImageStyle(applyImage: ApplyImageStyleModel): void;
|
|
91
91
|
restoreTextStyles(formats: FormatModel[], linkFormats: FormatModel[]): void;
|
|
92
92
|
restoreParagraphStyles(paragraphs: ParagraphModel[]): void;
|
|
93
|
+
applyParagraphs(paragraphs: ParagraphModel[]): void;
|
|
93
94
|
setTextStyle(textStyle: TextStyleModel): void;
|
|
94
95
|
remove(range: Range): void;
|
|
95
96
|
replace(model: ReplaceModel): CursorParagraph;
|
|
@@ -30,6 +30,7 @@ import { Operation } from '../gadgets/history/operation.type';
|
|
|
30
30
|
import { OperationHistory } from '../gadgets/history/operation-history';
|
|
31
31
|
import { PageFormatModel } from '../../models/generated/page-format.model';
|
|
32
32
|
import { PageType } from '../components/edges/page-type.enum';
|
|
33
|
+
import { ParagraphModel } from '../../models/generated/paragraph.model';
|
|
33
34
|
import { ParagraphStyleModel } from '../../models/generated/paragraph-style.model';
|
|
34
35
|
import { Range } from '../positioning/range';
|
|
35
36
|
import { RegulatorService } from './regulator.service';
|
|
@@ -38,8 +39,6 @@ import { Renderer } from '../display/renderer';
|
|
|
38
39
|
import { ReplaceModel } from '../../models/generated/replace.model';
|
|
39
40
|
import { ResizeTableColumnsModel } from '../../models/generated/resize-table-columns.model';
|
|
40
41
|
import { RestoreWithParagraphModel } from '../../models/generated/restore-with-paragraph.model';
|
|
41
|
-
import { SearchOptions } from '../gadgets/search/search';
|
|
42
|
-
import { SearchIteration } from '../gadgets/search/search-iteration.interface';
|
|
43
42
|
import { Selection } from '../positioning/selection';
|
|
44
43
|
import { SessionModel } from '../execution/targeting/session.model';
|
|
45
44
|
import { TargetModel } from '../../models/generated/target.model';
|
|
@@ -75,7 +74,8 @@ export declare class Editor {
|
|
|
75
74
|
documentHandler: DocumentHandler;
|
|
76
75
|
dragAndDrop: DragAndDrop;
|
|
77
76
|
subscriptions: Subscription[];
|
|
78
|
-
private search;
|
|
77
|
+
private readonly search;
|
|
78
|
+
private replaceTerm;
|
|
79
79
|
private textInput;
|
|
80
80
|
private clipboardData;
|
|
81
81
|
private isRerenderSubscriptionOpen;
|
|
@@ -110,14 +110,16 @@ export declare class Editor {
|
|
|
110
110
|
applyTextStyles(textStyle: TextStyleModel): void;
|
|
111
111
|
setTextStyle(textStyle: TextStyleModel): void;
|
|
112
112
|
applyParagraphStyles(paragraphStyle: ParagraphStyleModel): void;
|
|
113
|
+
applyParagraphsMargin(value: Partial<ParagraphStyleModel>): void;
|
|
113
114
|
setNumberingTemplate(templateLevels: NumberingLevelModel[]): void;
|
|
114
115
|
removeNumberingsFromParagraphs(): void;
|
|
115
116
|
applyImageStyles(image: ImageModel): void;
|
|
116
117
|
focus(): void;
|
|
117
118
|
openSearch(): void;
|
|
118
|
-
find(
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
find(term: string, focusNext?: boolean): void;
|
|
120
|
+
findNext(): void;
|
|
121
|
+
findPrevious(): void;
|
|
122
|
+
replace(): void;
|
|
121
123
|
undo(): void;
|
|
122
124
|
redo(): void;
|
|
123
125
|
applyOperation(operation: Operation): void;
|
|
@@ -133,6 +135,7 @@ export declare class Editor {
|
|
|
133
135
|
saveInsertLinkToHistory(model: InsertLinkModel): void;
|
|
134
136
|
saveInsertTableToHistory(model: InsertTableModel): void;
|
|
135
137
|
saveApplyTextStyleToHistory(startIndex: number, endIndex: number, textStyle: TextStyleModel): void;
|
|
138
|
+
saveApplyParagraphsToHistory(oldParagraphs: ParagraphModel[], updatedParagraphs: ParagraphModel[]): void;
|
|
136
139
|
saveApplyParagraphStyleToHistory(startIndex: number, endIndex: number, paragraphStyle: ParagraphStyleModel): void;
|
|
137
140
|
saveAddNumberingToHistory(templateLevels: NumberingLevelModel[], startIndex: number, endIndex: number): void;
|
|
138
141
|
saveRemoveNumberingToHistory(startIndex: number, endIndex: number): void;
|
|
@@ -180,6 +183,7 @@ export declare class Editor {
|
|
|
180
183
|
getSelectedText(): string;
|
|
181
184
|
initMainSession(): void;
|
|
182
185
|
onSelectionChange(): void;
|
|
186
|
+
onContentChange(): void;
|
|
183
187
|
enableSelection(): void;
|
|
184
188
|
onHotKeyDown(event: KeyboardEvent): void;
|
|
185
189
|
onPrint(): void;
|
|
@@ -207,12 +211,15 @@ export declare class Editor {
|
|
|
207
211
|
applyPageFormatSubscription(): Subscription;
|
|
208
212
|
insertPageFormatSubscription(): Subscription;
|
|
209
213
|
applyDocumentPageFormatSubscription(): Subscription;
|
|
210
|
-
|
|
211
|
-
replaceSubscription(): Subscription;
|
|
214
|
+
searchOptionSubscriptions(): Subscription[];
|
|
215
|
+
replaceSubscription(): Subscription[];
|
|
212
216
|
setTextStylesSubscription(): Subscription;
|
|
213
217
|
setParagraphStylesSubscription(): Subscription;
|
|
214
218
|
setNumberingTemplateTypeSubscription(): Subscription;
|
|
215
219
|
removeNumberingsSubscription(): Subscription;
|
|
220
|
+
applyFirstLinePositionSubscription(): Subscription;
|
|
221
|
+
applyRightIndentParagraphSubscription(): Subscription;
|
|
222
|
+
applyLeftIndentParagraphSubscription(): Subscription;
|
|
216
223
|
setImageStyleSubscription(): Subscription;
|
|
217
224
|
rerenderSubscription(): Subscription;
|
|
218
225
|
createCustomComponentSubscription(): Subscription;
|
|
@@ -252,4 +259,6 @@ export declare class Editor {
|
|
|
252
259
|
private recreateMainSession;
|
|
253
260
|
private changeColumnsWidth;
|
|
254
261
|
private changeCellsWidth;
|
|
262
|
+
private updateActiveSearchHighlight;
|
|
263
|
+
private setCursorAtSearchResult;
|
|
255
264
|
}
|
|
@@ -47,6 +47,7 @@ export declare class OperationHistory {
|
|
|
47
47
|
pushDelete(model: RestoreModel): void;
|
|
48
48
|
pushApplyTextStyle(startIndex: number, endIndex: number, style: TextStyleModel, formats: FormatModel[], linkFormats: FormatModel[]): void;
|
|
49
49
|
pushApplyParagraphStyle(startIndex: number, endIndex: number, style: ParagraphStyleModel, paragraphs: ParagraphModel[]): void;
|
|
50
|
+
pushApplyParagraphs(oldParagraphs: ParagraphModel[], updatedParagraphs: ParagraphModel[]): void;
|
|
50
51
|
pushInsertTableRows(insertIndex: number, rowsCount: number, targetIndex: number, inheritIndex: number): void;
|
|
51
52
|
pushInsertTableColumns(insertIndex: number, columnsCount: number, targetIndex: number, inheritIndex: number): void;
|
|
52
53
|
pushRemoveTableRows(insertIndex: number, startIndex: number, endIndex: number): void;
|
|
@@ -2,6 +2,7 @@ import { AddNumberingModel } from '../../../models/generated/add-numbering.model
|
|
|
2
2
|
import { ApplyDocumentPageFormatModel } from '../../../models/generated/apply-document-page-format.model';
|
|
3
3
|
import { ApplyImageStyleModel } from '../../../models/generated/apply-image-style.model';
|
|
4
4
|
import { ApplyPageFormatModel } from '../../../models/generated/apply-page-format.model';
|
|
5
|
+
import { ApplyParagraphsModel } from '../../../models/generated/apply-paragraphs.model';
|
|
5
6
|
import { ApplyTextStyleModel } from '../../../models/generated/apply-text-style.model';
|
|
6
7
|
import { CreateEdgesModel } from '../../../models/generated/create-edges.model';
|
|
7
8
|
import { DeleteModel } from '../../../models/generated/delete.model';
|
|
@@ -31,4 +32,4 @@ import { RestorePageFormatsModel } from '../../../models/generated/restore-page-
|
|
|
31
32
|
import { RestoreParagraphStylesModel } from '../../../models/generated/restore-paragraph-styles.model';
|
|
32
33
|
import { RestoreTextStylesModel } from '../../../models/generated/restore-text-styles.model';
|
|
33
34
|
import { RestoreWithParagraphModel } from '../../../models/generated/restore-with-paragraph.model';
|
|
34
|
-
export type Operation = InsertTextModel | DeleteModel | InsertStyledTextModel | RestoreModel | ApplyTextStyleModel | RestoreTextStylesModel | RestoreParagraphStylesModel | InsertElementModel | InsertBreakModel | ApplyImageStyleModel | AddNumberingModel | RestoreNumberingsModel | InsertTabModel | InsertTableColumnsModel | InsertTableRowsModel | RemoveTableColumnsModel | RemoveTableRowsModel | ResizeTableColumnsModel | InsertTableModel | InsertImageModel | RemoveNumberingsModel | ReplaceModel | MoveRangeModel | CreateEdgesModel | RemoveEdgesModel | RemoveWithParagraphModel | RestoreWithParagraphModel | ApplyDocumentPageFormatModel | InsertPageFormatModel | ApplyPageFormatModel | RemoveInsertedPageFormatModel | RestorePageFormatsModel | ReplaceByRestoreModel;
|
|
35
|
+
export type Operation = InsertTextModel | DeleteModel | InsertStyledTextModel | RestoreModel | ApplyTextStyleModel | RestoreTextStylesModel | RestoreParagraphStylesModel | InsertElementModel | InsertBreakModel | ApplyImageStyleModel | AddNumberingModel | RestoreNumberingsModel | InsertTabModel | InsertTableColumnsModel | InsertTableRowsModel | RemoveTableColumnsModel | RemoveTableRowsModel | ResizeTableColumnsModel | InsertTableModel | InsertImageModel | RemoveNumberingsModel | ReplaceModel | MoveRangeModel | CreateEdgesModel | RemoveEdgesModel | RemoveWithParagraphModel | RestoreWithParagraphModel | ApplyDocumentPageFormatModel | InsertPageFormatModel | ApplyPageFormatModel | RemoveInsertedPageFormatModel | RestorePageFormatsModel | ApplyParagraphsModel | ReplaceByRestoreModel;
|
|
@@ -1,32 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export declare class SearchOptions {
|
|
5
|
-
term?: string;
|
|
6
|
-
backwards?: boolean;
|
|
7
|
-
start?: CursorParagraph | Range;
|
|
8
|
-
skipCurrent?: boolean;
|
|
9
|
-
wrap?: boolean;
|
|
10
|
-
isMultiLine?: boolean;
|
|
11
|
-
regex?: RegExp | (RegExp[] & {
|
|
12
|
-
offset?: number;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
1
|
+
import { SearchResult } from './search-result.interface';
|
|
2
|
+
import { Selection } from '../../positioning/selection';
|
|
3
|
+
import { SessionModel } from '../../execution/targeting/session.model';
|
|
15
4
|
export declare class Search {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
private setForEachForBackwards;
|
|
28
|
-
private setForEachInLine;
|
|
29
|
-
private setForEachInLineForRegArray;
|
|
30
|
-
private setForEachInLineForBackwards;
|
|
31
|
-
private setDefaultForEachInLine;
|
|
5
|
+
term: string;
|
|
6
|
+
regex: RegExp;
|
|
7
|
+
allMatches: SearchResult[];
|
|
8
|
+
private currentIndex;
|
|
9
|
+
get currentMatchIndex(): number;
|
|
10
|
+
get currentMatch(): SearchResult;
|
|
11
|
+
setSearchTerm(term: string): void;
|
|
12
|
+
findAll(sessions: SessionModel[]): void;
|
|
13
|
+
goNext(selection: Selection, currentSessionId: number): void;
|
|
14
|
+
goPrevious(selection: Selection, currentSessionId: number): void;
|
|
15
|
+
assembleRegExp(term: string): void;
|
|
32
16
|
}
|
|
@@ -14,10 +14,7 @@ import { OperationsHistoryInfoModel } from '../../editor/gadgets/history/operati
|
|
|
14
14
|
import { PageFormatModel } from '../../models/generated/page-format.model';
|
|
15
15
|
import { PageType } from '../components/edges/page-type.enum';
|
|
16
16
|
import { ParagraphStyleModel } from '../../models/generated/paragraph-style.model';
|
|
17
|
-
import { Replace } from '../gadgets/search/replace.interface';
|
|
18
17
|
import { ResizeTableColumnsModel } from '../../models/generated/resize-table-columns.model';
|
|
19
|
-
import { SearchIteration } from '../gadgets/search/search-iteration.interface';
|
|
20
|
-
import { SearchOptions } from '../gadgets/search/search';
|
|
21
18
|
import { TextStyleModel } from '../../models/generated/text-style.model';
|
|
22
19
|
import * as i0 from "@angular/core";
|
|
23
20
|
export declare class EditorService {
|
|
@@ -44,18 +41,25 @@ export declare class EditorService {
|
|
|
44
41
|
data?: object;
|
|
45
42
|
}>;
|
|
46
43
|
private readonly _toggleSidenav$;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
get
|
|
52
|
-
private readonly
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
get
|
|
58
|
-
private readonly
|
|
44
|
+
get displaySearchBar$(): Observable<boolean>;
|
|
45
|
+
private readonly _displaySearchBar$;
|
|
46
|
+
get searchTerm$(): Observable<string>;
|
|
47
|
+
private readonly _searchTerm$;
|
|
48
|
+
get dialogSearchTerm$(): Observable<string>;
|
|
49
|
+
private readonly _dialogSearchTerm$;
|
|
50
|
+
get replaceTerm$(): Observable<string>;
|
|
51
|
+
private readonly _replaceTerm$;
|
|
52
|
+
get searchPrevious$(): Observable<void>;
|
|
53
|
+
private readonly _searchPrevious$;
|
|
54
|
+
get searchNext$(): Observable<void>;
|
|
55
|
+
private readonly _searchNext$;
|
|
56
|
+
get replaceCurrent$(): Observable<void>;
|
|
57
|
+
private readonly _replaceCurrent$;
|
|
58
|
+
get currentSearchResultIndex$(): Observable<number>;
|
|
59
|
+
private readonly _currentSearchResultIndex$;
|
|
60
|
+
set searchResultCount(value: number);
|
|
61
|
+
get searchResultCount$(): Observable<number>;
|
|
62
|
+
private readonly _searchResultCount$;
|
|
59
63
|
get setTextStyles$(): Observable<TextStyleModel>;
|
|
60
64
|
private readonly _setTextStyles$;
|
|
61
65
|
get setParagraphStyles$(): Observable<ParagraphStyleModel>;
|
|
@@ -189,9 +193,18 @@ export declare class EditorService {
|
|
|
189
193
|
private readonly _leftMarginPageFormat$;
|
|
190
194
|
get rightMarginPageFormat$(): Observable<number>;
|
|
191
195
|
private readonly _rightMarginPageFormat$;
|
|
192
|
-
get
|
|
193
|
-
private readonly
|
|
194
|
-
|
|
196
|
+
get firstLinePosition$(): Observable<number>;
|
|
197
|
+
private readonly _firstLinePosition$;
|
|
198
|
+
get leftIndentParagraph$(): Observable<number>;
|
|
199
|
+
private readonly _leftIndentParagraph$;
|
|
200
|
+
get rightIndentParagraph$(): Observable<number>;
|
|
201
|
+
private readonly _rightIndentParagraph$;
|
|
202
|
+
get paragraphStyle$(): Observable<ParagraphStyleModel>;
|
|
203
|
+
private readonly _paragraphStyle$;
|
|
204
|
+
applyFirstLinePosition(value: number): void;
|
|
205
|
+
applyLeftIndentParagraph(value: number): void;
|
|
206
|
+
applyRightIndentParagraph(value: number): void;
|
|
207
|
+
paragraphStyle(value: ParagraphStyleModel): void;
|
|
195
208
|
applyRightMarginPageFormat(value: number): void;
|
|
196
209
|
applyLeftMarginPageFormat(value: number): void;
|
|
197
210
|
applyDocumentPageFormat(value: PageFormatModel): void;
|
|
@@ -247,6 +260,15 @@ export declare class EditorService {
|
|
|
247
260
|
insertText(text: string): void;
|
|
248
261
|
removeLeft(): void;
|
|
249
262
|
removeCustomElementsData(elements: ElementModel[]): void;
|
|
263
|
+
setNewSearchTerm(term: string): void;
|
|
264
|
+
setNewReplaceTerm(term: string): void;
|
|
265
|
+
setDialogSearchTerm(term: string): void;
|
|
266
|
+
goNextSearchResult(): void;
|
|
267
|
+
goPreviousSearchResult(): void;
|
|
268
|
+
replaceCurrentSearchResult(): void;
|
|
269
|
+
setDisplaySearchBar(show: boolean): void;
|
|
270
|
+
setSearchResultCount(count: number): void;
|
|
271
|
+
setCurrentSearchResultIndex(index: number): void;
|
|
250
272
|
static ɵfac: i0.ɵɵFactoryDeclaration<EditorService, never>;
|
|
251
273
|
static ɵprov: i0.ɵɵInjectableDeclaration<EditorService>;
|
|
252
274
|
}
|
|
@@ -9,5 +9,6 @@ export declare class ParagraphOperationsHelper {
|
|
|
9
9
|
static applySingle(paragraphs: ParagraphModel[], index: number, style: ParagraphStyleModel): void;
|
|
10
10
|
static applyNumbering(paragraphs: ParagraphModel[], startIndex: number, endIndex: number, numberingId?: number): number[];
|
|
11
11
|
static apply(paragraphs: ParagraphModel[], startIndex: number, endIndex: number, style: ParagraphStyleModel): void;
|
|
12
|
+
static applyParagraphs(paragraphs: ParagraphModel[], updatedParagraphs: ParagraphModel[]): void;
|
|
12
13
|
static applyParagraphStyles(target: ParagraphStyleModel, value: ParagraphStyleModel): void;
|
|
13
14
|
}
|
|
@@ -46,6 +46,7 @@ export declare class OperationsHelper {
|
|
|
46
46
|
static restoreTextStyles(document: ContentType, textFormats: FormatModel[], linkFormats: FormatModel[]): void;
|
|
47
47
|
static restoreParagraphStyles(document: ContentType, paragraphs: ParagraphModel[]): void;
|
|
48
48
|
static applyParagraphStyle(document: ContentType, startIndex: number, endIndex: number, style: ParagraphStyleModel): void;
|
|
49
|
+
static applyParagraphs(document: ContentType, paragraphs: ParagraphModel[]): void;
|
|
49
50
|
static applyImageStyle(document: ContentType, image: ApplyImageStyleModel): void;
|
|
50
51
|
static insertTableRows(document: ContentType, insertIndex: number, rowsCount: number, targetIndex: number, inheritIndex: number): void;
|
|
51
52
|
static insertTableColumns(document: ContentType, insertIndex: number, columnsCount: number, targetIndex: number, inheritIndex: number, contentWidth: number): void;
|
|
@@ -48,6 +48,7 @@ export declare class SaveCommandsHelper {
|
|
|
48
48
|
static getRemoveTableRowsCommand(startIndex: number, endIndex: number, insertIndex: number, targets: TargetModel[]): CommandModel;
|
|
49
49
|
static getRestoreTextStylesCommand(formats: FormatModel[], targets: TargetModel[]): CommandModel;
|
|
50
50
|
static getRestoreParagraphStylesCommand(paragraphs: ParagraphModel[], targets: TargetModel[]): CommandModel;
|
|
51
|
+
static getApplyParagraphsCommand(paragraphs: ParagraphModel[], targets: TargetModel[]): CommandModel;
|
|
51
52
|
static getRestoreCommand(restore: RestoreModel, targets: TargetModel[]): CommandModel;
|
|
52
53
|
static getReplaceByRestoreCommand(replaceByRestore: ReplaceByRestoreModel, targets: TargetModel[]): CommandModel;
|
|
53
54
|
static getMoveRangeCommand(model: MoveRangeModel, targets: TargetModel[]): CommandModel;
|
|
@@ -2,6 +2,7 @@ import { AddNumberingModel } from './add-numbering.model';
|
|
|
2
2
|
import { ApplyDocumentPageFormatModel } from './apply-document-page-format.model';
|
|
3
3
|
import { ApplyImageStyleModel } from './apply-image-style.model';
|
|
4
4
|
import { ApplyPageFormatModel } from './apply-page-format.model';
|
|
5
|
+
import { ApplyParagraphsModel } from './apply-paragraphs.model';
|
|
5
6
|
import { ApplyParagraphStyleModel } from './apply-paragraph-style.model';
|
|
6
7
|
import { ApplyTextStyleModel } from './apply-text-style.model';
|
|
7
8
|
import { CreateEdgesModel } from './create-edges.model';
|
|
@@ -40,6 +41,7 @@ export declare class CommandModel {
|
|
|
40
41
|
applyDocumentPageFormat: ApplyDocumentPageFormatModel;
|
|
41
42
|
applyImageStyle: ApplyImageStyleModel;
|
|
42
43
|
applyPageFormat: ApplyPageFormatModel;
|
|
44
|
+
applyParagraphs: ApplyParagraphsModel;
|
|
43
45
|
applyParagraphStyle: ApplyParagraphStyleModel;
|
|
44
46
|
applyTextStyle: ApplyTextStyleModel;
|
|
45
47
|
binding: number;
|