@talrace/ngx-noder 19.0.41 → 19.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/fesm2022/talrace-ngx-noder.mjs +440 -338
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/editor/content/display-data/display-data.d.ts +2 -6
- package/lib/editor/content/display-data/display-token.model.d.ts +3 -1
- package/lib/editor/content/display-data/line-info.model.d.ts +8 -2
- package/lib/editor/content/display-data/models/custom-text.model.d.ts +8 -0
- package/lib/editor/content/display-data/models/paragraph-info.model.d.ts +0 -1
- package/lib/editor/content/helpers/display-token.helper.d.ts +7 -5
- package/lib/editor/content/helpers/line-info.helper.d.ts +8 -1
- package/lib/editor/display/rendering.helper.d.ts +1 -0
- package/lib/editor/execution/constants/editor-tags.const.d.ts +5 -0
- package/lib/editor/execution/editor.d.ts +3 -8
- package/lib/editor/execution/helpers/paragraph.helper.d.ts +1 -1
- package/lib/editor/gadgets/page-break/break.helper.d.ts +0 -1
- package/lib/editor/positioning/cursor-position.interface.d.ts +0 -1
- package/lib/editor/positioning/position.helper.d.ts +4 -7
- package/lib/editor/positioning/range.d.ts +2 -2
- package/lib/editor/positioning/selection.d.ts +2 -2
- package/package.json +1 -1
- package/src/scss/base-editor.scss +8 -8
|
@@ -67,18 +67,14 @@ export declare class DisplayData extends EventEmitting {
|
|
|
67
67
|
isSameNumberingId(paragraphIndex: number, numberingId: number): boolean;
|
|
68
68
|
private updateNumberingsDataOnChange;
|
|
69
69
|
private splitParagraphByLines;
|
|
70
|
-
private getParagraphTokens;
|
|
71
70
|
getParagraphLineTokens(paragraphIndex: number, paragraphLine: number): DisplayToken[];
|
|
72
|
-
getTokens(contentIndex: number, content: string, paragraphSymbolIndex: number):
|
|
73
|
-
tokens: DisplayToken[];
|
|
74
|
-
paragraphToken: DisplayToken;
|
|
75
|
-
};
|
|
71
|
+
getTokens(contentIndex: number, content: string, paragraphSymbolIndex: number): DisplayToken[];
|
|
76
72
|
private getOrGenerateComponent;
|
|
77
73
|
private getPageFormatParagraphs;
|
|
78
74
|
getPageFormatByPageNumber(pageNumber: number): PageFormat;
|
|
79
75
|
getPageFormatAtPosition(startParagraphIndex: number): PageFormat | undefined;
|
|
80
76
|
getPageFormatIndexAtPosition(startParagraphIndex: number): number;
|
|
81
|
-
private
|
|
77
|
+
private computeWrapToken;
|
|
82
78
|
private adjustLastTab;
|
|
83
79
|
private getPreviousParagraphInfo;
|
|
84
80
|
private getVisiblePages;
|
|
@@ -7,6 +7,8 @@ export declare class DisplayToken implements IFontMetricSize {
|
|
|
7
7
|
ascent: number;
|
|
8
8
|
descent: number;
|
|
9
9
|
displayValue: number;
|
|
10
|
+
index: number;
|
|
11
|
+
customIndex?: number;
|
|
10
12
|
get isSpace(): boolean;
|
|
11
13
|
get isParagraph(): boolean;
|
|
12
14
|
get isPageBreak(): boolean;
|
|
@@ -14,7 +16,7 @@ export declare class DisplayToken implements IFontMetricSize {
|
|
|
14
16
|
get isTab(): boolean;
|
|
15
17
|
get isTable(): boolean;
|
|
16
18
|
get isWhiteSpace(): boolean;
|
|
17
|
-
get
|
|
19
|
+
get isBreak(): boolean;
|
|
18
20
|
get breakable(): boolean;
|
|
19
21
|
constructor(fields?: Partial<DisplayToken>);
|
|
20
22
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomTextModel } from './models/custom-text.model';
|
|
1
2
|
import { IndentModel } from './indent.model';
|
|
2
3
|
export declare class LineInfoModel {
|
|
3
4
|
height: number;
|
|
@@ -8,13 +9,18 @@ export declare class LineInfoModel {
|
|
|
8
9
|
offsetBefore: number;
|
|
9
10
|
offsetAfter: number;
|
|
10
11
|
lineSpacing: number;
|
|
12
|
+
startIndex: number;
|
|
13
|
+
endIndex: number;
|
|
11
14
|
isAfterPageBreak: boolean;
|
|
12
15
|
isEndedByPageBreak: boolean;
|
|
13
16
|
backgroundColor: string;
|
|
14
17
|
hasTable: boolean;
|
|
15
18
|
isNumbering: boolean;
|
|
16
19
|
wordSpacing?: number;
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
wordSpacingStartToken?: number;
|
|
21
|
+
wordSpacingEndToken?: number;
|
|
22
|
+
wordSpacingStartIndex?: number;
|
|
23
|
+
wordSpacingEndIndex?: number;
|
|
24
|
+
customTexts?: CustomTextModel[];
|
|
19
25
|
constructor(fields?: Partial<LineInfoModel>);
|
|
20
26
|
}
|
|
@@ -2,11 +2,13 @@ import { ComponentRef } from '@angular/core';
|
|
|
2
2
|
import { BaseNoderComponent } from '../../components/shared/abstract/base.component';
|
|
3
3
|
import { BreakTypes } from '../../gadgets/page-break/break-types.enum';
|
|
4
4
|
import { DisplayToken } from '../display-data/display-token.model';
|
|
5
|
-
import { IFontMetricSize } from '../../gadgets/font-metrics/font-metric-size.interface';
|
|
6
5
|
import { TextStyleModel } from '../../../models/generated/text-style.model';
|
|
7
6
|
export declare class DisplayTokenHelper {
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static getSymbolToken(
|
|
11
|
-
static
|
|
7
|
+
static getParagraphToken(paragraphSymbolStyle: TextStyleModel, index: number): DisplayToken;
|
|
8
|
+
static getBreakToken(symbol: string, fontString: string, breakType: BreakTypes, index: number): DisplayToken;
|
|
9
|
+
static getSymbolToken(symbol: string, fontString: string, index: number): DisplayToken;
|
|
10
|
+
static getComponentTokens(component: ComponentRef<BaseNoderComponent>, fontString: string, index: number): DisplayToken[];
|
|
11
|
+
private static getBreakDisplayValue;
|
|
12
|
+
private static getSymbolDisplayValue;
|
|
13
|
+
private static getComponentDisplayValue;
|
|
12
14
|
}
|
|
@@ -5,6 +5,13 @@ import { IndentModel } from '../display-data/indent.model';
|
|
|
5
5
|
import { LineInfoModel } from '../display-data/line-info.model';
|
|
6
6
|
import { ParagraphStyleModel } from '../../../models/generated/paragraph-style.model';
|
|
7
7
|
export declare class LineInfoHelper {
|
|
8
|
-
static get(tokens: DisplayToken[],
|
|
8
|
+
static get(tokens: DisplayToken[], style: ParagraphStyleModel, indent: IndentModel, width: number, paragraphStartIndex: number, position: {
|
|
9
|
+
isAfterPageBreak: boolean;
|
|
10
|
+
isLastLine: boolean;
|
|
11
|
+
isNumbering: boolean;
|
|
12
|
+
}): LineInfoModel;
|
|
9
13
|
static getFirstLineIndent(model: ContentType, paragraphIndex: number, generalProperties: GeneralPropertiesModel): IndentModel;
|
|
14
|
+
private static applySizeToLine;
|
|
15
|
+
private static applyWordSpacingToLine;
|
|
16
|
+
private static applyCustomTextsToLine;
|
|
10
17
|
}
|
|
@@ -14,5 +14,6 @@ export declare class RenderingHelper {
|
|
|
14
14
|
static renderNumberingMarker(paragraph: Paragraph, layerElement: HTMLElement, scalingRatio: number): HTMLElement;
|
|
15
15
|
static createDivContainer(className: string): HTMLDivElement;
|
|
16
16
|
private static renderFormatContent;
|
|
17
|
+
private static renderExternalText;
|
|
17
18
|
private static renderText;
|
|
18
19
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const PARENT_TAG = "APP-NOD-EDITOR";
|
|
2
|
+
export declare const TABLE_CELL_TAG = "APP-NOD-TABLE-CELL";
|
|
3
|
+
export declare const EDGE_TAG = "APP-NOD-EDGE";
|
|
4
|
+
export declare const IMAGE_TAG = "APP-NOD-IMAGE";
|
|
5
|
+
export declare const CUSTOM_TAG = "APP-NOD-CUSTOM-ELEMENT";
|
|
@@ -64,15 +64,10 @@ export declare class Editor {
|
|
|
64
64
|
private regulatorService;
|
|
65
65
|
private commandsService;
|
|
66
66
|
private clipboard;
|
|
67
|
-
private
|
|
67
|
+
private externalElementTags;
|
|
68
68
|
private insertOverlays;
|
|
69
69
|
private customPageWidth?;
|
|
70
|
-
readonly
|
|
71
|
-
readonly parentTagName = "APP-NOD-EDITOR";
|
|
72
|
-
readonly tableCellTagName = "APP-NOD-TABLE-CELL";
|
|
73
|
-
readonly edgeElementTagName = "APP-NOD-EDGE";
|
|
74
|
-
readonly imageTagName = "APP-NOD-IMAGE";
|
|
75
|
-
readonly customElementTagNames: string[];
|
|
70
|
+
readonly customElementTags: string[];
|
|
76
71
|
readonly history: OperationHistory;
|
|
77
72
|
get mainSession(): EditSession;
|
|
78
73
|
get mainRenderer(): VirtualRenderer;
|
|
@@ -100,7 +95,7 @@ export declare class Editor {
|
|
|
100
95
|
private clipboardData;
|
|
101
96
|
private isRerenderSubscriptionOpen;
|
|
102
97
|
private commentsVisible;
|
|
103
|
-
constructor(model: DocxModel, container: ElementRef<HTMLElement>, editorService: EditorService, overlayService: OverlayService, regulatorService: RegulatorService, commandsService: CommandsService, clipboard: Clipboard,
|
|
98
|
+
constructor(model: DocxModel, container: ElementRef<HTMLElement>, editorService: EditorService, overlayService: OverlayService, regulatorService: RegulatorService, commandsService: CommandsService, clipboard: Clipboard, externalElementTags: string[], insertOverlays: InsertOverlays, customPageWidth?: number);
|
|
104
99
|
destroy(): void;
|
|
105
100
|
selectPageDown(): void;
|
|
106
101
|
selectPageUp(): void;
|
|
@@ -24,7 +24,7 @@ export declare class ParagraphHelper {
|
|
|
24
24
|
screenIndex: number;
|
|
25
25
|
visibleScreenIndex: number;
|
|
26
26
|
} | null;
|
|
27
|
-
static getParagraphPages(
|
|
27
|
+
static getParagraphPages(lines: TextLineInfo[]): number[];
|
|
28
28
|
static getParagraphHeight(paragraphTextLinesInfo: TextLineInfo[]): number;
|
|
29
29
|
static getPageLinesHeight(paragraphTextLinesInfo: TextLineInfo[], page: number): number;
|
|
30
30
|
static processOffsetLineWithNumberingMarker(textLineInfo: TextLineInfo, markerHeight: number, offsetBefore: number): void;
|
|
@@ -2,5 +2,4 @@ import { BreakModel } from '../../../models/generated/break.model';
|
|
|
2
2
|
import { BreakTypes } from './break-types.enum';
|
|
3
3
|
export declare class BreakHelper {
|
|
4
4
|
static getBreakType(breaks: BreakModel[], char: string, insertIndex: number): BreakTypes | null;
|
|
5
|
-
static removeBreakMarker(breaks: BreakModel[], text: string, fragmentStartIndex: number): string;
|
|
6
5
|
}
|
|
@@ -9,11 +9,11 @@ export declare class PositionHelper {
|
|
|
9
9
|
paragraph: number;
|
|
10
10
|
paragraphLine: number;
|
|
11
11
|
};
|
|
12
|
-
static paragraphToParagraphLine(
|
|
12
|
+
static paragraphToParagraphLine(paragraph: ParagraphInfoModel, indexInParagraph: number): {
|
|
13
13
|
paragraphLine: number;
|
|
14
14
|
indexInLine: number;
|
|
15
15
|
};
|
|
16
|
-
static paragraphToDocumentLine(
|
|
16
|
+
static paragraphToDocumentLine(paragraph: ParagraphInfoModel, indexInParagraph: number): CursorParagraph;
|
|
17
17
|
static documentLineToParagraph(session: EditSession, documentLine: number, indexInLine: number): CursorParagraph;
|
|
18
18
|
static paragraphToPixel(session: EditSession, paragraph: number, indexInParagraph: number): CursorPosition;
|
|
19
19
|
static documentLineToPixel(session: EditSession, documentLine: number, indexInLine: number): CursorPosition;
|
|
@@ -22,10 +22,7 @@ export declare class PositionHelper {
|
|
|
22
22
|
paragraph: number;
|
|
23
23
|
paragraphLine: number;
|
|
24
24
|
};
|
|
25
|
-
static
|
|
26
|
-
paragraph: number;
|
|
27
|
-
indexInParagraph: number;
|
|
28
|
-
};
|
|
29
|
-
static pixelToIndexInLine(session: EditSession, documentLine: number, pageX: number, tokenDivider: number): number;
|
|
25
|
+
static pixelToIndexInParagraph(session: EditSession, pageX: number, paragraph: number, paragraphLine: number, tokenDivider: number): number;
|
|
30
26
|
private static getIndexInLine;
|
|
27
|
+
private static mergeCustomTokens;
|
|
31
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CursorParagraph } from './cursor-paragraph';
|
|
2
|
-
import {
|
|
2
|
+
import { ParagraphInfoModel } from '../content/display-data/models/paragraph-info.model';
|
|
3
3
|
export declare class Range {
|
|
4
4
|
start: CursorParagraph;
|
|
5
5
|
end: CursorParagraph;
|
|
@@ -13,7 +13,7 @@ export declare class Range {
|
|
|
13
13
|
}): boolean;
|
|
14
14
|
contains(position: CursorParagraph): boolean;
|
|
15
15
|
comparePosition(position: CursorParagraph): number;
|
|
16
|
-
paragraphToDocumentLine(
|
|
16
|
+
paragraphToDocumentLine(paragraphs: ParagraphInfoModel[]): Range;
|
|
17
17
|
/**
|
|
18
18
|
* Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object.
|
|
19
19
|
* @param {Number} firstRow The starting row
|
|
@@ -51,8 +51,8 @@ export declare class Selection {
|
|
|
51
51
|
private moveCursorUp;
|
|
52
52
|
private moveCursorDown;
|
|
53
53
|
private moveToLine;
|
|
54
|
-
private
|
|
55
|
-
private
|
|
54
|
+
private getLeft;
|
|
55
|
+
private getRight;
|
|
56
56
|
private getLineStart;
|
|
57
57
|
private getLineEnd;
|
|
58
58
|
private getWordRight;
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ div.ngx-colors-overlay.noder-color-picker-overlay .opened .colors {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.mat-mdc-menu-item:not(:last-child) {
|
|
37
|
-
border-bottom: 1px dashed #
|
|
37
|
+
border-bottom: 1px dashed #e5ebf0;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -155,6 +155,10 @@ div.ngx-colors-overlay.noder-color-picker-overlay .opened .colors {
|
|
|
155
155
|
position: absolute;
|
|
156
156
|
contain: style size layout;
|
|
157
157
|
pointer-events: auto;
|
|
158
|
+
|
|
159
|
+
.noder-pointing {
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
}
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
.noder-edges-layer {
|
|
@@ -180,10 +184,6 @@ div.ngx-colors-overlay.noder-color-picker-overlay .opened .colors {
|
|
|
180
184
|
> * {
|
|
181
185
|
display: inline-block;
|
|
182
186
|
font-kerning: none;
|
|
183
|
-
|
|
184
|
-
&.paragraph-symbol {
|
|
185
|
-
align-self: flex-end;
|
|
186
|
-
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -325,14 +325,14 @@ div.ngx-colors-overlay.noder-color-picker-overlay .opened .colors {
|
|
|
325
325
|
background-color: rgb(255, 150, 50, 0.4);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
|
|
329
329
|
&.comments-highlight {
|
|
330
330
|
> .noder-highlight {
|
|
331
|
-
background: #
|
|
331
|
+
background: #e0a74a66;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
> .noder-selected-highlight {
|
|
335
|
-
background-color: #
|
|
335
|
+
background-color: #e69a1db2;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
}
|