@talrace/ngx-noder 19.0.31 → 19.0.32
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 +39 -47
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/editor/components/shared/abstract/base.component.d.ts +2 -1
- package/lib/editor/components/tab/tab.component.d.ts +1 -1
- package/lib/editor/content/constants/editor.const.d.ts +1 -0
- package/package.json +1 -1
|
@@ -177,6 +177,7 @@ const DEFAULT_HEADINGS = [
|
|
|
177
177
|
];
|
|
178
178
|
const NEW_LINE_MARKUP = '\n';
|
|
179
179
|
const DEFAULT_TAB_WIDTH = 48;
|
|
180
|
+
const DEFAULT_OFFSET_AFTER_NUMBERING_MARKER = 20;
|
|
180
181
|
const DEFAULT_EDGE_MAX_HEIGHT_MULTIPLIER = 0.4;
|
|
181
182
|
|
|
182
183
|
var PageType;
|
|
@@ -1171,7 +1172,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1171
1172
|
class BaseNoderComponent extends DestroyComponent {
|
|
1172
1173
|
constructor() {
|
|
1173
1174
|
super(...arguments);
|
|
1174
|
-
this.
|
|
1175
|
+
this.ascent = signal(0);
|
|
1176
|
+
this.descent = signal(0);
|
|
1175
1177
|
this.width = signal(0);
|
|
1176
1178
|
this._isFocused = false;
|
|
1177
1179
|
this.cdr = inject(ChangeDetectorRef);
|
|
@@ -5912,7 +5914,7 @@ class PositionHelper {
|
|
|
5912
5914
|
(textLineInfo.indentFirstLine ||
|
|
5913
5915
|
(numberingOffsetLeft - textLineInfo.indentLeft > 0 &&
|
|
5914
5916
|
numberingOffsetLeft - textLineInfo.indentLeft < textLineInfo.markerWidth))) {
|
|
5915
|
-
return
|
|
5917
|
+
return DEFAULT_OFFSET_AFTER_NUMBERING_MARKER;
|
|
5916
5918
|
}
|
|
5917
5919
|
return 0;
|
|
5918
5920
|
}
|
|
@@ -6022,7 +6024,7 @@ class RenderingHelper {
|
|
|
6022
6024
|
if (currentParagraph.textLinesInfo[0].indentFirstLine ||
|
|
6023
6025
|
(numberingOffsetLeft - currentParagraph.textLinesInfo[0].indentLeft > 0 &&
|
|
6024
6026
|
numberingOffsetLeft - currentParagraph.textLinesInfo[0].indentLeft < currentParagraph.textLinesInfo[0].markerWidth)) {
|
|
6025
|
-
markerWidth =
|
|
6027
|
+
markerWidth = DEFAULT_OFFSET_AFTER_NUMBERING_MARKER;
|
|
6026
6028
|
}
|
|
6027
6029
|
let lineEl = RenderingHelper.createLineElement(currentParagraph.textLinesInfo[splitIndex], numberingOffsetLeft - markerWidth, scalingRatio);
|
|
6028
6030
|
domContent.parentNode.appendChild(lineEl);
|
|
@@ -6896,7 +6898,7 @@ class TextLayer {
|
|
|
6896
6898
|
let offset = 0;
|
|
6897
6899
|
if (numberingOffsetLeft - paragraphSettings.textLinesInfo[0].indentLeft > 0 &&
|
|
6898
6900
|
numberingOffsetLeft - paragraphSettings.textLinesInfo[0].indentLeft < paragraphSettings.textLinesInfo[0].markerWidth) {
|
|
6899
|
-
offset =
|
|
6901
|
+
offset = DEFAULT_OFFSET_AFTER_NUMBERING_MARKER;
|
|
6900
6902
|
}
|
|
6901
6903
|
const lineInfo = paragraphSettings.textLinesInfo[0];
|
|
6902
6904
|
const lastLineEl = this.renderingHelper.createLineElement(lineInfo, numberingOffsetLeft - offset, this.session.generalProperties.scalingRatio);
|
|
@@ -10306,28 +10308,20 @@ class DisplayTokenHelper {
|
|
|
10306
10308
|
info.isNumbering = firstWrapToken.isNumbering;
|
|
10307
10309
|
info.markerWidth = firstWrapToken.markerWidth;
|
|
10308
10310
|
}
|
|
10309
|
-
let
|
|
10310
|
-
let
|
|
10311
|
-
let descent = 0;
|
|
10311
|
+
let maxAscent = 0;
|
|
10312
|
+
let maxDescent = 0;
|
|
10312
10313
|
const tokens = isAfterPageBreak && !wrapTokens.length ? [prevToken] : wrapTokens;
|
|
10313
10314
|
for (const wrapToken of tokens) {
|
|
10314
|
-
if (
|
|
10315
|
-
|
|
10315
|
+
if (maxAscent < wrapToken.ascent) {
|
|
10316
|
+
maxAscent = wrapToken.ascent;
|
|
10316
10317
|
}
|
|
10317
|
-
if (
|
|
10318
|
-
|
|
10319
|
-
ascent = wrapToken.ascent;
|
|
10320
|
-
descent = wrapToken.descent;
|
|
10318
|
+
if (maxDescent < wrapToken.descent) {
|
|
10319
|
+
maxDescent = wrapToken.descent;
|
|
10321
10320
|
}
|
|
10322
10321
|
info.width += wrapToken.width;
|
|
10323
10322
|
}
|
|
10324
|
-
info.height =
|
|
10325
|
-
|
|
10326
|
-
info.offsetAfter = (ascent + descent) * (info.lineSpacing - 1);
|
|
10327
|
-
}
|
|
10328
|
-
else if (ascent + descent === info.height) {
|
|
10329
|
-
info.height = info.height * info.lineSpacing;
|
|
10330
|
-
}
|
|
10323
|
+
info.height = maxAscent + maxDescent;
|
|
10324
|
+
info.offsetAfter = info.height * (info.lineSpacing - 1);
|
|
10331
10325
|
return info;
|
|
10332
10326
|
}
|
|
10333
10327
|
}
|
|
@@ -11461,20 +11455,20 @@ class NoderTableComponent extends BaseNoderComponent {
|
|
|
11461
11455
|
bordersHeight += this.borderSize;
|
|
11462
11456
|
}
|
|
11463
11457
|
}
|
|
11464
|
-
this.
|
|
11458
|
+
this.ascent.set(rowsHeight + bordersHeight);
|
|
11465
11459
|
}
|
|
11466
11460
|
processSplit(leftSpaceOnPage, spaceBetweenPagesContent, contentHeight) {
|
|
11467
11461
|
this.removeSplits();
|
|
11468
|
-
if (leftSpaceOnPage >= this.
|
|
11469
|
-
return { splitsCount: 0, tableHeight: this.
|
|
11462
|
+
if (leftSpaceOnPage >= this.ascent()) {
|
|
11463
|
+
return { splitsCount: 0, tableHeight: this.ascent(), leftHeight: 0 };
|
|
11470
11464
|
}
|
|
11471
11465
|
if (leftSpaceOnPage < this.rowMatrix[0].height) {
|
|
11472
|
-
return { splitsCount: 1, tableHeight: this.
|
|
11466
|
+
return { splitsCount: 1, tableHeight: this.ascent(), leftHeight: this.ascent() };
|
|
11473
11467
|
}
|
|
11474
11468
|
return this.splitTable(leftSpaceOnPage, spaceBetweenPagesContent, contentHeight);
|
|
11475
11469
|
}
|
|
11476
11470
|
splitTable(leftSpaceOnPage, spaceBetweenPagesContent, contentHeight) {
|
|
11477
|
-
let leftHeight = 0, tableHeightWithSplits = this.
|
|
11471
|
+
let leftHeight = 0, tableHeightWithSplits = this.ascent(), rowIndex = 0;
|
|
11478
11472
|
while (rowIndex < this.rowMatrix.length) {
|
|
11479
11473
|
let { index, rowsHeight } = this.getRowIndexByHeight(rowIndex, leftSpaceOnPage);
|
|
11480
11474
|
rowIndex = index;
|
|
@@ -11668,6 +11662,10 @@ class NumberingHelper {
|
|
|
11668
11662
|
}
|
|
11669
11663
|
numberingInfo[numberingId] ??= [];
|
|
11670
11664
|
this.updateNumberingInfo(numberingInfo, resultMarker, numberingId, levelModel.level);
|
|
11665
|
+
const markerLevels = resultMarker.split('.');
|
|
11666
|
+
if (levelModel.level !== 0 && markerLevels[markerLevels.length - 1] === '') {
|
|
11667
|
+
return resultMarker.slice(0, -1);
|
|
11668
|
+
}
|
|
11671
11669
|
return resultMarker;
|
|
11672
11670
|
}
|
|
11673
11671
|
static createDataModel(numberings, paragraphs, paragraphIndex, numberingInfo) {
|
|
@@ -12417,7 +12415,7 @@ class DisplayData extends EventEmitting {
|
|
|
12417
12415
|
}
|
|
12418
12416
|
const startIndex = tabIndex;
|
|
12419
12417
|
while (this.customComponents.tabs[tabIndex] && this.customComponents.tabs[tabIndex].instance.insertIndex <= paragraphLastIndex) {
|
|
12420
|
-
this.customComponents.tabs[tabIndex].instance.applySize(this.tabTokens[tabIndex - startIndex].width
|
|
12418
|
+
this.customComponents.tabs[tabIndex].instance.applySize(this.tabTokens[tabIndex - startIndex].width);
|
|
12421
12419
|
tabIndex++;
|
|
12422
12420
|
}
|
|
12423
12421
|
return tabIndex;
|
|
@@ -13652,7 +13650,7 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
13652
13650
|
this.content = val;
|
|
13653
13651
|
}
|
|
13654
13652
|
get size() {
|
|
13655
|
-
return { width: this.width(), height: this.
|
|
13653
|
+
return { width: this.width(), height: this.ascent() };
|
|
13656
13654
|
}
|
|
13657
13655
|
constructor(elementRef, apiService) {
|
|
13658
13656
|
super();
|
|
@@ -13662,7 +13660,7 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
13662
13660
|
}
|
|
13663
13661
|
initialize() {
|
|
13664
13662
|
const url = this.image.content?.replace('/api/', '') ?? '';
|
|
13665
|
-
this.
|
|
13663
|
+
this.ascent.set(ScalingHelper.scale(this.image.height, this.generalProperties.scalingRatio));
|
|
13666
13664
|
this.width.set(ScalingHelper.scale(this.image.width, this.generalProperties.scalingRatio));
|
|
13667
13665
|
this.apiService.getFile(url).subscribe(x => {
|
|
13668
13666
|
const fileSource = URL.createObjectURL(x);
|
|
@@ -13678,7 +13676,7 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
13678
13676
|
}
|
|
13679
13677
|
resize(size) {
|
|
13680
13678
|
this.width.set(size.width);
|
|
13681
|
-
this.
|
|
13679
|
+
this.ascent.set(size.height);
|
|
13682
13680
|
this.isCanvas ? this.resizeCanvas(size) : this.resizeImage(size);
|
|
13683
13681
|
this.cdr.markForCheck();
|
|
13684
13682
|
}
|
|
@@ -13697,7 +13695,7 @@ class NoderImageComponent extends BaseNoderComponent {
|
|
|
13697
13695
|
createImage(fileSource) {
|
|
13698
13696
|
const imageEl = document.createElement('img');
|
|
13699
13697
|
imageEl.width = this.width();
|
|
13700
|
-
imageEl.height = this.
|
|
13698
|
+
imageEl.height = this.ascent();
|
|
13701
13699
|
imageEl.draggable = false;
|
|
13702
13700
|
imageEl.src = fileSource;
|
|
13703
13701
|
return imageEl;
|
|
@@ -13728,20 +13726,18 @@ class NoderTabComponent extends BaseNoderComponent {
|
|
|
13728
13726
|
this.content = val;
|
|
13729
13727
|
}
|
|
13730
13728
|
initialize() {
|
|
13731
|
-
this.applySize(this.tab.width
|
|
13729
|
+
this.applySize(this.tab.width);
|
|
13732
13730
|
}
|
|
13733
|
-
applySize(width
|
|
13734
|
-
this.height.set(font);
|
|
13731
|
+
applySize(width) {
|
|
13735
13732
|
this.width.set(ScalingHelper.scale(width, this.generalProperties.scalingRatio));
|
|
13736
13733
|
}
|
|
13737
13734
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderTabComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
13738
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NoderTabComponent, isStandalone: false, selector: "app-nod-tab", host: { properties: { "style.width.px": "width()"
|
|
13735
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NoderTabComponent, isStandalone: false, selector: "app-nod-tab", host: { properties: { "style.width.px": "width()" } }, usesInheritance: true, ngImport: i0, template: " \n", styles: [":host{position:relative;outline:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13739
13736
|
}
|
|
13740
13737
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderTabComponent, decorators: [{
|
|
13741
13738
|
type: Component,
|
|
13742
13739
|
args: [{ selector: 'app-nod-tab', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, host: {
|
|
13743
|
-
'[style.width.px]': 'width()'
|
|
13744
|
-
'[style.fontSize.pt]': 'height()'
|
|
13740
|
+
'[style.width.px]': 'width()'
|
|
13745
13741
|
}, template: " \n", styles: [":host{position:relative;outline:none}\n"] }]
|
|
13746
13742
|
}] });
|
|
13747
13743
|
|
|
@@ -14034,6 +14030,7 @@ class EditSession {
|
|
|
14034
14030
|
const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
|
|
14035
14031
|
const endPosition = ContentHelper.documentIndexToParagraphWithOffset(this.displayData.paragraphs, endIndex);
|
|
14036
14032
|
OperationsHelper.restoreParagraphStyles(this.model, paragraphs);
|
|
14033
|
+
this.displayData.resetAllNumberingInfo(0);
|
|
14037
14034
|
this.displayData.updateNextLineIndexes(startParagraph, endPosition.row);
|
|
14038
14035
|
this.selection.placeCursor(endPosition);
|
|
14039
14036
|
this.applyToolbarStyles();
|
|
@@ -15921,21 +15918,16 @@ class CustomContentService {
|
|
|
15921
15918
|
return this.findComponent(components.tables, charIndex);
|
|
15922
15919
|
}
|
|
15923
15920
|
getTokenFromComponent(component, lineInfo, displayValue, isFirst, size) {
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
height =
|
|
15927
|
-
component.instance instanceof NoderImageComponent
|
|
15928
|
-
? component.instance.height() + size.descent
|
|
15929
|
-
: component.instance.height();
|
|
15930
|
-
}
|
|
15921
|
+
const ascent = component.instance.ascent() ?? 0;
|
|
15922
|
+
const descent = component.instance.descent() ?? 0;
|
|
15931
15923
|
return new DisplayToken({
|
|
15932
15924
|
width: component.instance.width(),
|
|
15933
|
-
height,
|
|
15925
|
+
height: ascent + descent,
|
|
15934
15926
|
baseline: 0,
|
|
15935
15927
|
content: 0,
|
|
15936
15928
|
font: size.font,
|
|
15937
|
-
ascent
|
|
15938
|
-
descent
|
|
15929
|
+
ascent,
|
|
15930
|
+
descent,
|
|
15939
15931
|
line: 0,
|
|
15940
15932
|
lineSpacing: lineInfo.lineSpacing,
|
|
15941
15933
|
multiplier: 0,
|
|
@@ -19198,5 +19190,5 @@ class OperationModel {
|
|
|
19198
19190
|
* Generated bundle index. Do not edit.
|
|
19199
19191
|
*/
|
|
19200
19192
|
|
|
19201
|
-
export { AddLinkDialogComponent, AddLinkMobileComponent, Alignment, BaseNoderComponent, Borders, BreakTypes, CommandModel, CommandType, CommandsService, ConfirmDialogComponent, DEFAULT_BACKGROUND_COLOR, DEFAULT_EDGE_MAX_HEIGHT_MULTIPLIER, DEFAULT_FONT_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_HEADINGS, DEFAULT_HEADING_STYLE_ID, DEFAULT_PARAGRAPH_STYLE, DEFAULT_TAB_WIDTH, DEFAULT_TEXT_STYLE, DEFAULT_TOOLBAR_STYLES, DefaultImageApiService, DestroyComponent, DocumentInfo, DocumentModel, DocumentNameModel, DocxModel, DomHelper, EditorComponent, EditorMobileToolbarComponent, EditorModule, EditorService, EditorTitleComponent, EditorTitleMobileComponent, EditorToolbarComponent, EditorToolbarMode, EditorToolbarModule, EditorToolbarService, ElementDataModel, ElementModel, ExternalComponent, ExternalElementModel, ExternalElementService, FileSourceModel, FontMetrics, FormatStyleHelper, GrammarService, HYPERLINK_FONT_COLOR, HYPERLINK_HEADING_STYLE_ID, ImageApiService, ImageDataModel, LastDocumentRevisionModel, LineStyles, MenuDropdownsComponent, MenuDropdownsMobileComponent, Mode, NEW_LINE_MARKUP, NoderTranslateLoader, NumberingLevelModel, OperationModel, OperationsHistoryInfoModel, PageSetupComponent, PageType, ParagraphStyleModel, RevisionHelper, RevisionModel, SearchResultLocation, TextFormatMobileComponent, TextStyleModel, ToolbarActionsComponent };
|
|
19193
|
+
export { AddLinkDialogComponent, AddLinkMobileComponent, Alignment, BaseNoderComponent, Borders, BreakTypes, CommandModel, CommandType, CommandsService, ConfirmDialogComponent, DEFAULT_BACKGROUND_COLOR, DEFAULT_EDGE_MAX_HEIGHT_MULTIPLIER, DEFAULT_FONT_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_HEADINGS, DEFAULT_HEADING_STYLE_ID, DEFAULT_OFFSET_AFTER_NUMBERING_MARKER, DEFAULT_PARAGRAPH_STYLE, DEFAULT_TAB_WIDTH, DEFAULT_TEXT_STYLE, DEFAULT_TOOLBAR_STYLES, DefaultImageApiService, DestroyComponent, DocumentInfo, DocumentModel, DocumentNameModel, DocxModel, DomHelper, EditorComponent, EditorMobileToolbarComponent, EditorModule, EditorService, EditorTitleComponent, EditorTitleMobileComponent, EditorToolbarComponent, EditorToolbarMode, EditorToolbarModule, EditorToolbarService, ElementDataModel, ElementModel, ExternalComponent, ExternalElementModel, ExternalElementService, FileSourceModel, FontMetrics, FormatStyleHelper, GrammarService, HYPERLINK_FONT_COLOR, HYPERLINK_HEADING_STYLE_ID, ImageApiService, ImageDataModel, LastDocumentRevisionModel, LineStyles, MenuDropdownsComponent, MenuDropdownsMobileComponent, Mode, NEW_LINE_MARKUP, NoderTranslateLoader, NumberingLevelModel, OperationModel, OperationsHistoryInfoModel, PageSetupComponent, PageType, ParagraphStyleModel, RevisionHelper, RevisionModel, SearchResultLocation, TextFormatMobileComponent, TextStyleModel, ToolbarActionsComponent };
|
|
19202
19194
|
//# sourceMappingURL=talrace-ngx-noder.mjs.map
|