@talrace/ngx-noder 19.0.30 → 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.
@@ -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.height = signal(0);
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 textLineInfo.markerWidth;
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 = currentParagraph.textLinesInfo[0].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 = paragraphSettings.textLinesInfo[0].markerWidth;
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);
@@ -8346,6 +8348,13 @@ class Editor {
8346
8348
  insert(text) {
8347
8349
  const sanitizedText = text.replace(this.emojiRegex, ' ');
8348
8350
  if (this.selection.isEmpty) {
8351
+ if (text === NEW_LINE_MARKUP && this.selection.range.start.column === 0) {
8352
+ const paragraph = this.session.displayData.paragraphs[this.selection.range.start.row];
8353
+ if (paragraph.paragraphSettings.numberingData.numberingId) {
8354
+ this.removeOrLowerNestingNumbering(paragraph);
8355
+ return;
8356
+ }
8357
+ }
8349
8358
  const textStyle = ContentStyleHelper.combineTextStyles(null, this.editorService.styles);
8350
8359
  this.insertText(sanitizedText, textStyle);
8351
8360
  }
@@ -8419,7 +8428,7 @@ class Editor {
8419
8428
  }
8420
8429
  if (this.selection.range.start.column === 0) {
8421
8430
  const paragraph = this.session.displayData.paragraphs[this.selection.range.start.row];
8422
- if (paragraph.paragraphSettings.numberingData.numberingId) {
8431
+ if (paragraph.paragraphSettings.numberingData.numberingId && paragraph.paragraphSettings.numberingData.level <= 6) {
8423
8432
  this.applyParagraphStyles(new ParagraphStyleModel({
8424
8433
  numberingLevel: paragraph.paragraphSettings.numberingData.level + 1,
8425
8434
  indentLeft: 0,
@@ -8445,6 +8454,9 @@ class Editor {
8445
8454
  if (this.selection.range.start.column === 0) {
8446
8455
  const paragraph = this.session.displayData.paragraphs[this.selection.range.start.row];
8447
8456
  if (paragraph.paragraphSettings.numberingData.numberingId) {
8457
+ if (paragraph.paragraphSettings.numberingData.level === 0) {
8458
+ return;
8459
+ }
8448
8460
  this.applyParagraphStyles(new ParagraphStyleModel({
8449
8461
  numberingLevel: paragraph.paragraphSettings.numberingData.level - 1,
8450
8462
  indentLeft: 0,
@@ -9090,7 +9102,8 @@ class Editor {
9090
9102
  const indexes = ContentHelper.getSelectedPartDocumentIndexes(this.session.displayData.paragraphs, range);
9091
9103
  if (isNumbering && range.end.column === 0 && indexes.startIndex >= indexes.endIndex) {
9092
9104
  this.selection.placeCursor(range.end);
9093
- this.removeNumberingsFromParagraphs();
9105
+ const paragraph = this.session.displayData.paragraphs[this.selection.range.end.row];
9106
+ this.removeOrLowerNestingNumbering(paragraph);
9094
9107
  this.onSelectionChange();
9095
9108
  this.onContentChange();
9096
9109
  this.focus();
@@ -9135,6 +9148,14 @@ class Editor {
9135
9148
  this.editorService.removeCustomElementsData(elements);
9136
9149
  }
9137
9150
  }
9151
+ removeOrLowerNestingNumbering(paragraph) {
9152
+ if (paragraph.paragraphSettings.numberingData.level > 0) {
9153
+ this.applyParagraphStyles(new ParagraphStyleModel({ numberingLevel: paragraph.paragraphSettings.numberingData.level - 1 }));
9154
+ }
9155
+ else {
9156
+ this.removeNumberingsFromParagraphs();
9157
+ }
9158
+ }
9138
9159
  onInput() {
9139
9160
  const text = this.textInput.getInsertText();
9140
9161
  if (!text) {
@@ -10287,28 +10308,20 @@ class DisplayTokenHelper {
10287
10308
  info.isNumbering = firstWrapToken.isNumbering;
10288
10309
  info.markerWidth = firstWrapToken.markerWidth;
10289
10310
  }
10290
- let fontSize = 0;
10291
- let ascent = 0;
10292
- let descent = 0;
10311
+ let maxAscent = 0;
10312
+ let maxDescent = 0;
10293
10313
  const tokens = isAfterPageBreak && !wrapTokens.length ? [prevToken] : wrapTokens;
10294
10314
  for (const wrapToken of tokens) {
10295
- if (info.height < wrapToken.height) {
10296
- info.height = wrapToken.height;
10315
+ if (maxAscent < wrapToken.ascent) {
10316
+ maxAscent = wrapToken.ascent;
10297
10317
  }
10298
- if (fontSize < wrapToken.font && wrapToken.displayValue !== DisplayValue.customContent) {
10299
- fontSize = wrapToken.font;
10300
- ascent = wrapToken.ascent;
10301
- descent = wrapToken.descent;
10318
+ if (maxDescent < wrapToken.descent) {
10319
+ maxDescent = wrapToken.descent;
10302
10320
  }
10303
10321
  info.width += wrapToken.width;
10304
10322
  }
10305
- info.height = info.height || 18;
10306
- if (info.lineSpacing > 1) {
10307
- info.offsetAfter = (ascent + descent) * (info.lineSpacing - 1);
10308
- }
10309
- else if (ascent + descent === info.height) {
10310
- info.height = info.height * info.lineSpacing;
10311
- }
10323
+ info.height = maxAscent + maxDescent;
10324
+ info.offsetAfter = info.height * (info.lineSpacing - 1);
10312
10325
  return info;
10313
10326
  }
10314
10327
  }
@@ -11442,20 +11455,20 @@ class NoderTableComponent extends BaseNoderComponent {
11442
11455
  bordersHeight += this.borderSize;
11443
11456
  }
11444
11457
  }
11445
- this.height.set(rowsHeight + bordersHeight);
11458
+ this.ascent.set(rowsHeight + bordersHeight);
11446
11459
  }
11447
11460
  processSplit(leftSpaceOnPage, spaceBetweenPagesContent, contentHeight) {
11448
11461
  this.removeSplits();
11449
- if (leftSpaceOnPage >= this.height()) {
11450
- return { splitsCount: 0, tableHeight: this.height(), leftHeight: 0 };
11462
+ if (leftSpaceOnPage >= this.ascent()) {
11463
+ return { splitsCount: 0, tableHeight: this.ascent(), leftHeight: 0 };
11451
11464
  }
11452
11465
  if (leftSpaceOnPage < this.rowMatrix[0].height) {
11453
- return { splitsCount: 1, tableHeight: this.height(), leftHeight: this.height() };
11466
+ return { splitsCount: 1, tableHeight: this.ascent(), leftHeight: this.ascent() };
11454
11467
  }
11455
11468
  return this.splitTable(leftSpaceOnPage, spaceBetweenPagesContent, contentHeight);
11456
11469
  }
11457
11470
  splitTable(leftSpaceOnPage, spaceBetweenPagesContent, contentHeight) {
11458
- let leftHeight = 0, tableHeightWithSplits = this.height(), rowIndex = 0;
11471
+ let leftHeight = 0, tableHeightWithSplits = this.ascent(), rowIndex = 0;
11459
11472
  while (rowIndex < this.rowMatrix.length) {
11460
11473
  let { index, rowsHeight } = this.getRowIndexByHeight(rowIndex, leftSpaceOnPage);
11461
11474
  rowIndex = index;
@@ -11615,11 +11628,20 @@ class NumberingHelper {
11615
11628
  numberingInfo[numberingId][level].markerIndex++;
11616
11629
  return;
11617
11630
  }
11618
- this.updateNumberingInfo(numberingInfo, marker, numberingId);
11631
+ this.updateNumberingInfo(numberingInfo, marker, numberingId, level);
11619
11632
  }
11620
11633
  else {
11621
11634
  numberingInfo[numberingId][level].markerIndex++;
11622
- numberingInfo[numberingId].splice(level + 1);
11635
+ for (let i = 0; i < numberingInfo[numberingId].length; i++) {
11636
+ if (i >= level + 1) {
11637
+ numberingInfo[numberingId][i].markerIndex = 0;
11638
+ }
11639
+ else {
11640
+ if (numberingInfo[numberingId][i].markerIndex === 0) {
11641
+ numberingInfo[numberingId][i].markerIndex++;
11642
+ }
11643
+ }
11644
+ }
11623
11645
  }
11624
11646
  }
11625
11647
  static getMarker(levelModel, numberingId, paragraphs, paragraphIndex, numberingInfo) {
@@ -11639,7 +11661,11 @@ class NumberingHelper {
11639
11661
  index = resultMarker.indexOf('%');
11640
11662
  }
11641
11663
  numberingInfo[numberingId] ??= [];
11642
- this.updateNumberingInfo(numberingInfo, resultMarker, numberingId);
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
+ }
11643
11669
  return resultMarker;
11644
11670
  }
11645
11671
  static createDataModel(numberings, paragraphs, paragraphIndex, numberingInfo) {
@@ -11650,6 +11676,12 @@ class NumberingHelper {
11650
11676
  }
11651
11677
  const level = paragraph.paragraphStyle.numberingLevel;
11652
11678
  const numberingLevelModel = this.find(numberings, numberingId, level);
11679
+ for (let i = 0; i < level; i++) {
11680
+ if (!numberingInfo[numberingId][i]) {
11681
+ const numberingLevel = this.find(numberings, numberingId, i);
11682
+ this.getMarker(numberingLevel, numberingId, paragraphs, paragraphIndex, numberingInfo);
11683
+ }
11684
+ }
11653
11685
  const marker = this.getMarker(numberingLevelModel, numberingId, paragraphs, paragraphIndex, numberingInfo);
11654
11686
  return new NumberingDataModel({ numberingId, level, marker });
11655
11687
  }
@@ -11683,14 +11715,17 @@ class NumberingHelper {
11683
11715
  }
11684
11716
  return { height, width };
11685
11717
  }
11686
- static updateNumberingInfo(numberingInfo, marker, numberingId) {
11718
+ static updateNumberingInfo(numberingInfo, marker, numberingId, level) {
11687
11719
  if (!numberingInfo[numberingId]) {
11688
11720
  return;
11689
11721
  }
11690
- const levels = this.getLevelInfo(marker);
11691
- for (let i = 0; i < levels.length; i++) {
11692
- numberingInfo[numberingId][i] = { markerIndex: levels[i], visited: true };
11693
- }
11722
+ const markerLevels = this.getLevelInfo(marker);
11723
+ const lastMarkerLevel = markerLevels.length - 1;
11724
+ numberingInfo[numberingId][level] = {
11725
+ markerIndex: markerLevels[lastMarkerLevel],
11726
+ markerLevel: Math.min(lastMarkerLevel, level),
11727
+ visited: true
11728
+ };
11694
11729
  }
11695
11730
  static getLevelIndex(paragraphs, paragraphIndex, numberingId, numberingLevel) {
11696
11731
  let index = 0;
@@ -11723,10 +11758,13 @@ class NumberingHelper {
11723
11758
  if (level === 0) {
11724
11759
  return numberingInfo[numberingId][level].markerIndex + '.';
11725
11760
  }
11726
- return numberingInfo[numberingId]
11727
- .slice(0, level + 1)
11728
- .map(marker => marker.markerIndex)
11729
- .join('.');
11761
+ let marker = [];
11762
+ let { markerLevel, markerIndex } = numberingInfo[numberingId][level];
11763
+ for (let i = 0; i < markerLevel; i++) {
11764
+ marker.push(numberingInfo[numberingId][i].markerIndex);
11765
+ }
11766
+ marker.push(markerIndex);
11767
+ return marker.join('.');
11730
11768
  }
11731
11769
  }
11732
11770
 
@@ -12349,20 +12387,18 @@ class DisplayData extends EventEmitting {
12349
12387
  }
12350
12388
  resetAllNumberingInfo(paragraphIndex) {
12351
12389
  for (let i = paragraphIndex; i < this.model.paragraphs.length; i++) {
12352
- const { numberingId, numberingLevel } = this.model.paragraphs[i].paragraphStyle;
12353
- if (numberingId !== null &&
12354
- this.generalProperties.numberingInfo[numberingId] &&
12355
- this.generalProperties.numberingInfo[numberingId][numberingLevel]) {
12356
- this.generalProperties.numberingInfo[numberingId][numberingLevel].visited = false;
12390
+ const { numberingId } = this.model.paragraphs[i].paragraphStyle;
12391
+ if (numberingId !== null && this.generalProperties.numberingInfo[numberingId]) {
12392
+ this.generalProperties.numberingInfo[numberingId] = [];
12357
12393
  }
12358
12394
  }
12359
12395
  }
12360
12396
  resetNumberingInfoByTableCell(table) {
12361
12397
  for (const element of table.instance.rowMatrix) {
12362
12398
  for (let cell of element.cells) {
12363
- const { marker, numberingId } = cell.componentRef.instance.session.displayData.paragraphs[0].paragraphSettings.numberingData;
12399
+ const { marker, numberingId, level } = cell.componentRef.instance.session.displayData.paragraphs[0].paragraphSettings.numberingData;
12364
12400
  if (marker && numberingId) {
12365
- NumberingHelper.updateNumberingInfo(this.generalProperties.numberingInfo, marker, numberingId);
12401
+ NumberingHelper.updateNumberingInfo(this.generalProperties.numberingInfo, marker, numberingId, level);
12366
12402
  this.resetAllNumberingInfo(0);
12367
12403
  return;
12368
12404
  }
@@ -12379,7 +12415,7 @@ class DisplayData extends EventEmitting {
12379
12415
  }
12380
12416
  const startIndex = tabIndex;
12381
12417
  while (this.customComponents.tabs[tabIndex] && this.customComponents.tabs[tabIndex].instance.insertIndex <= paragraphLastIndex) {
12382
- this.customComponents.tabs[tabIndex].instance.applySize(this.tabTokens[tabIndex - startIndex].width, this.tabTokens[tabIndex - startIndex].font);
12418
+ this.customComponents.tabs[tabIndex].instance.applySize(this.tabTokens[tabIndex - startIndex].width);
12383
12419
  tabIndex++;
12384
12420
  }
12385
12421
  return tabIndex;
@@ -12847,12 +12883,8 @@ class DisplayData extends EventEmitting {
12847
12883
  if (displayTokens[0].isTable || (displayTokens[0].breaksLine && displayTokens.length === 1)) {
12848
12884
  return 1;
12849
12885
  }
12850
- const indent = displayTokens[0].indentLeft +
12851
- displayTokens[0].indentRight +
12852
- displayTokens[0].indentFirstLine -
12853
- displayTokens[0].indentHanging || 0;
12854
- const maxRowWidth = contentWidth - indent;
12855
- let sum = 0;
12886
+ const maxRowWidth = contentWidth - displayTokens[0].indentRight;
12887
+ let sum = displayTokens[0].indentLeft + displayTokens[0].indentFirstLine - displayTokens[0].indentHanging || 0;
12856
12888
  let prevTabIndex = null;
12857
12889
  let tabCenter = null;
12858
12890
  let prevTabAlignment = TabAlignment.Left;
@@ -13618,7 +13650,7 @@ class NoderImageComponent extends BaseNoderComponent {
13618
13650
  this.content = val;
13619
13651
  }
13620
13652
  get size() {
13621
- return { width: this.width(), height: this.height() };
13653
+ return { width: this.width(), height: this.ascent() };
13622
13654
  }
13623
13655
  constructor(elementRef, apiService) {
13624
13656
  super();
@@ -13628,7 +13660,7 @@ class NoderImageComponent extends BaseNoderComponent {
13628
13660
  }
13629
13661
  initialize() {
13630
13662
  const url = this.image.content?.replace('/api/', '') ?? '';
13631
- this.height.set(ScalingHelper.scale(this.image.height, this.generalProperties.scalingRatio));
13663
+ this.ascent.set(ScalingHelper.scale(this.image.height, this.generalProperties.scalingRatio));
13632
13664
  this.width.set(ScalingHelper.scale(this.image.width, this.generalProperties.scalingRatio));
13633
13665
  this.apiService.getFile(url).subscribe(x => {
13634
13666
  const fileSource = URL.createObjectURL(x);
@@ -13644,7 +13676,7 @@ class NoderImageComponent extends BaseNoderComponent {
13644
13676
  }
13645
13677
  resize(size) {
13646
13678
  this.width.set(size.width);
13647
- this.height.set(size.height);
13679
+ this.ascent.set(size.height);
13648
13680
  this.isCanvas ? this.resizeCanvas(size) : this.resizeImage(size);
13649
13681
  this.cdr.markForCheck();
13650
13682
  }
@@ -13663,7 +13695,7 @@ class NoderImageComponent extends BaseNoderComponent {
13663
13695
  createImage(fileSource) {
13664
13696
  const imageEl = document.createElement('img');
13665
13697
  imageEl.width = this.width();
13666
- imageEl.height = this.height();
13698
+ imageEl.height = this.ascent();
13667
13699
  imageEl.draggable = false;
13668
13700
  imageEl.src = fileSource;
13669
13701
  return imageEl;
@@ -13694,20 +13726,18 @@ class NoderTabComponent extends BaseNoderComponent {
13694
13726
  this.content = val;
13695
13727
  }
13696
13728
  initialize() {
13697
- this.applySize(this.tab.width, this.tab.fontSize);
13729
+ this.applySize(this.tab.width);
13698
13730
  }
13699
- applySize(width, font) {
13700
- this.height.set(font);
13731
+ applySize(width) {
13701
13732
  this.width.set(ScalingHelper.scale(width, this.generalProperties.scalingRatio));
13702
13733
  }
13703
13734
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderTabComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
13704
- 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()", "style.fontSize.pt": "height()" } }, usesInheritance: true, ngImport: i0, template: "&emsp;\n", styles: [":host{position:relative;outline:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
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: "&emsp;\n", styles: [":host{position:relative;outline:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
13705
13736
  }
13706
13737
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NoderTabComponent, decorators: [{
13707
13738
  type: Component,
13708
13739
  args: [{ selector: 'app-nod-tab', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, host: {
13709
- '[style.width.px]': 'width()',
13710
- '[style.fontSize.pt]': 'height()'
13740
+ '[style.width.px]': 'width()'
13711
13741
  }, template: "&emsp;\n", styles: [":host{position:relative;outline:none}\n"] }]
13712
13742
  }] });
13713
13743
 
@@ -14000,6 +14030,7 @@ class EditSession {
14000
14030
  const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
14001
14031
  const endPosition = ContentHelper.documentIndexToParagraphWithOffset(this.displayData.paragraphs, endIndex);
14002
14032
  OperationsHelper.restoreParagraphStyles(this.model, paragraphs);
14033
+ this.displayData.resetAllNumberingInfo(0);
14003
14034
  this.displayData.updateNextLineIndexes(startParagraph, endPosition.row);
14004
14035
  this.selection.placeCursor(endPosition);
14005
14036
  this.applyToolbarStyles();
@@ -14008,11 +14039,10 @@ class EditSession {
14008
14039
  const startIndex = paragraphs[0].insertIndex;
14009
14040
  const endIndex = paragraphs[paragraphs.length - 1].insertIndex;
14010
14041
  const startParagraph = ContentHelper.documentIndexToParagraphIndex(this.displayData.paragraphs, startIndex).row;
14011
- const endPosition = ContentHelper.documentIndexToParagraphWithOffset(this.displayData.paragraphs, endIndex);
14042
+ const endParagraph = ContentHelper.documentIndexToParagraphWithOffset(this.displayData.paragraphs, endIndex).row;
14012
14043
  OperationsHelper.applyParagraphs(this.model, paragraphs);
14013
14044
  this.displayData.resetAllNumberingInfo(startParagraph);
14014
- this.displayData.updateNextLineIndexes(startParagraph, endPosition.row);
14015
- this.displayData.updateNumberingsDataOnChange(startParagraph + 1);
14045
+ this.displayData.updateNextLineIndexes(startParagraph, endParagraph);
14016
14046
  this.applyToolbarStyles();
14017
14047
  }
14018
14048
  setTextStyle(textStyle) {
@@ -15888,21 +15918,16 @@ class CustomContentService {
15888
15918
  return this.findComponent(components.tables, charIndex);
15889
15919
  }
15890
15920
  getTokenFromComponent(component, lineInfo, displayValue, isFirst, size) {
15891
- let height = size.height;
15892
- if (component.instance.height() > size.height) {
15893
- height =
15894
- component.instance instanceof NoderImageComponent
15895
- ? component.instance.height() + size.descent
15896
- : component.instance.height();
15897
- }
15921
+ const ascent = component.instance.ascent() ?? 0;
15922
+ const descent = component.instance.descent() ?? 0;
15898
15923
  return new DisplayToken({
15899
15924
  width: component.instance.width(),
15900
- height,
15925
+ height: ascent + descent,
15901
15926
  baseline: 0,
15902
15927
  content: 0,
15903
15928
  font: size.font,
15904
- ascent: component.instance.height() ?? size.height,
15905
- descent: 0,
15929
+ ascent,
15930
+ descent,
15906
15931
  line: 0,
15907
15932
  lineSpacing: lineInfo.lineSpacing,
15908
15933
  multiplier: 0,
@@ -18938,53 +18963,6 @@ class RevisionHelper {
18938
18963
  const actions = operations.map(x => x.command);
18939
18964
  OperationsHelper.applyOperations(content, actions);
18940
18965
  }
18941
- static fillTablesDefaultStyles(tables) {
18942
- for (const table of tables) {
18943
- for (const row of table.rows) {
18944
- for (const cell of row.cells) {
18945
- this.fillDefaultStyles(cell);
18946
- }
18947
- }
18948
- }
18949
- }
18950
- static fillEdgesDefaultStyles(headers, footers) {
18951
- for (const header of headers) {
18952
- this.fillTablesDefaultStyles(header.tables);
18953
- this.fillDefaultStyles(header);
18954
- }
18955
- for (const footer of footers) {
18956
- this.fillTablesDefaultStyles(footer.tables);
18957
- this.fillDefaultStyles(footer);
18958
- }
18959
- }
18960
- static fillDefaultStyles(contents) {
18961
- for (const format of contents.formats) {
18962
- format.textStyle = ContentStyleHelper.combineTextStyles(format.textStyle, DEFAULT_TEXT_STYLE);
18963
- }
18964
- for (const paragraph of contents.paragraphs) {
18965
- paragraph.paragraphStyle = this.fillParagraphStyleModel(paragraph.paragraphStyle);
18966
- }
18967
- }
18968
- static fillParagraphStyleModel(paragraphStyle) {
18969
- return new ParagraphStyleModel({
18970
- alignment: paragraphStyle.alignment ?? DEFAULT_PARAGRAPH_STYLE.alignment,
18971
- backgroundColor: paragraphStyle.backgroundColor ?? DEFAULT_PARAGRAPH_STYLE.backgroundColor,
18972
- headingStyleId: paragraphStyle.headingStyleId,
18973
- indentFirstLine: paragraphStyle.indentFirstLine ?? DEFAULT_PARAGRAPH_STYLE.indentFirstLine,
18974
- indentHanging: paragraphStyle.indentHanging ?? DEFAULT_PARAGRAPH_STYLE.indentHanging,
18975
- indentLeft: paragraphStyle.indentLeft ?? DEFAULT_PARAGRAPH_STYLE.indentLeft,
18976
- indentRight: paragraphStyle.indentRight ?? DEFAULT_PARAGRAPH_STYLE.indentRight,
18977
- lineSpacing: paragraphStyle.lineSpacing ?? DEFAULT_PARAGRAPH_STYLE.lineSpacing,
18978
- spaceAfter: paragraphStyle.spaceAfter ?? DEFAULT_PARAGRAPH_STYLE.spaceAfter,
18979
- spaceBefore: paragraphStyle.spaceBefore ?? DEFAULT_PARAGRAPH_STYLE.spaceBefore,
18980
- contextualSpacing: paragraphStyle.contextualSpacing ?? DEFAULT_PARAGRAPH_STYLE.contextualSpacing,
18981
- beforeAutospacing: paragraphStyle.beforeAutospacing ?? DEFAULT_PARAGRAPH_STYLE.beforeAutospacing,
18982
- afterAutospacing: paragraphStyle.afterAutospacing ?? DEFAULT_PARAGRAPH_STYLE.afterAutospacing,
18983
- numberingId: paragraphStyle.numberingId ?? DEFAULT_PARAGRAPH_STYLE.numberingId,
18984
- numberingLevel: paragraphStyle.numberingLevel ?? DEFAULT_PARAGRAPH_STYLE.numberingLevel,
18985
- tabSettings: paragraphStyle.tabSettings ?? DEFAULT_PARAGRAPH_STYLE.tabSettings
18986
- });
18987
- }
18988
18966
  static getEmptyDocxModel() {
18989
18967
  const pageMargin = new MarginModel();
18990
18968
  return new DocxModel({
@@ -19212,5 +19190,5 @@ class OperationModel {
19212
19190
  * Generated bundle index. Do not edit.
19213
19191
  */
19214
19192
 
19215
- 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 };
19216
19194
  //# sourceMappingURL=talrace-ngx-noder.mjs.map