@talrace/ngx-noder 19.0.49 → 19.0.50

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.
@@ -6890,41 +6890,33 @@ class DisplayTokenHelper {
6890
6890
  for (let i = 0; i < text.length; i++) {
6891
6891
  result.push(this.getSymbolToken(text[i], fontString, index));
6892
6892
  result[i].customIndex = i;
6893
+ result[i].customText = text;
6893
6894
  }
6894
- return result.length ? result : [this.getSymbolToken(' ', fontString, index)];
6895
+ return result;
6895
6896
  }
6896
- const ascent = component.instance.ascent() ?? 0;
6897
- const descent = component.instance.descent() ?? 0;
6898
- return [
6899
- new DisplayToken({
6900
- width: component.instance.width(),
6901
- height: ascent + descent,
6902
- font: FontMetrics.measureCharSize('0', fontString).font,
6903
- ascent,
6904
- descent,
6905
- displayValue: this.getComponentDisplayValue(component.instance),
6906
- index
6907
- })
6908
- ];
6897
+ return [this.getComponentToken(component, fontString, index)];
6909
6898
  }
6910
- static getTableTokens(component, fontString, index, withNumbering) {
6911
- if (!withNumbering) {
6912
- return this.getComponentTokens(component, fontString, index);
6913
- }
6914
- const spaceToken = this.getSymbolToken(' ', fontString, index);
6915
- spaceToken.customIndex = 0;
6899
+ static getComponentToken(component, fontString, index) {
6916
6900
  const ascent = component.instance.ascent() ?? 0;
6917
6901
  const descent = component.instance.descent() ?? 0;
6918
- const tableToken = new DisplayToken({
6902
+ return new DisplayToken({
6919
6903
  width: component.instance.width(),
6920
6904
  height: ascent + descent,
6921
6905
  font: FontMetrics.measureCharSize('0', fontString).font,
6922
6906
  ascent,
6923
6907
  descent,
6924
- displayValue: DisplayValue.table,
6925
- index,
6926
- customIndex: 1
6908
+ displayValue: this.getComponentDisplayValue(component.instance),
6909
+ index
6927
6910
  });
6911
+ }
6912
+ static getTableTokens(component, fontString, index, withNumbering) {
6913
+ const tableToken = this.getComponentToken(component, fontString, index);
6914
+ if (!withNumbering) {
6915
+ return [tableToken];
6916
+ }
6917
+ const spaceToken = this.getSymbolToken(' ', fontString, index);
6918
+ spaceToken.customIndex = 0;
6919
+ tableToken.customIndex = 1;
6928
6920
  return [spaceToken, tableToken];
6929
6921
  }
6930
6922
  static getBreakDisplayValue(breakType) {
@@ -7146,7 +7138,8 @@ class LineInfoHelper {
7146
7138
  line.customTexts.push({
7147
7139
  index: indexInParagraph,
7148
7140
  start: token.customIndex,
7149
- end: token.customIndex + 1
7141
+ end: token.customIndex + 1,
7142
+ text: token.customText
7150
7143
  });
7151
7144
  }
7152
7145
  }
@@ -13377,10 +13370,8 @@ class RenderingHelper {
13377
13370
  { name: 'data-session-id', value: `${instance.sessionId}` },
13378
13371
  { name: 'data-insert-index', value: `${instance.insertIndex}` }
13379
13372
  ];
13380
- let text = instance.getText();
13381
- text = !text.length ? ' ' : text;
13382
13373
  const customText = line.customTexts.find(x => x.index === instance.insertIndex - paragraphStartIndex);
13383
- const customTextFragment = text.substring(customText.start, customText.end);
13374
+ const customTextFragment = customText.text.substring(customText.start, customText.end);
13384
13375
  if (!line.wordSpacing) {
13385
13376
  this.renderText(fragment, textStyle, customTextFragment, wordSpacing, classes, attributes, style);
13386
13377
  additionalTokens += customTextFragment.length;
@@ -13402,7 +13393,7 @@ class RenderingHelper {
13402
13393
  additionalTokens += rightText.length;
13403
13394
  }
13404
13395
  }
13405
- if (text.length === customText.end) {
13396
+ if (customText.text.length === customText.end) {
13406
13397
  renderedIndexes++;
13407
13398
  additionalTokens--;
13408
13399
  }