@talrace/ngx-noder 19.0.43 → 19.0.44

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.
@@ -1388,6 +1388,9 @@ class ExternalComponent extends BaseNoderComponent {
1388
1388
  }
1389
1389
  focus() {
1390
1390
  super.focus();
1391
+ if (this.isText) {
1392
+ this.rerender();
1393
+ }
1391
1394
  if (this.skipSidenav()) {
1392
1395
  return;
1393
1396
  }
@@ -1395,6 +1398,9 @@ class ExternalComponent extends BaseNoderComponent {
1395
1398
  }
1396
1399
  blur() {
1397
1400
  super.blur();
1401
+ if (this.isText) {
1402
+ this.rerender();
1403
+ }
1398
1404
  if (this.skipSidenav()) {
1399
1405
  return;
1400
1406
  }
@@ -1919,7 +1925,7 @@ const PARENT_TAG = 'APP-NOD-EDITOR';
1919
1925
  const TABLE_CELL_TAG = 'APP-NOD-TABLE-CELL';
1920
1926
  const EDGE_TAG = 'APP-NOD-EDGE';
1921
1927
  const IMAGE_TAG = 'APP-NOD-IMAGE';
1922
- const CUSTOM_TAG = 'APP-NOD-CUSTOM-ELEMENT';
1928
+ const CUSTOM_TAG = 'app-nod-custom-element';
1923
1929
 
1924
1930
  class CustomElementSearchResult {
1925
1931
  constructor(init) {
@@ -6584,6 +6590,8 @@ class RenderingHelper {
6584
6590
  static renderExternalText(fragment, textStyle, wordSpacing, instance, line, renderedTokensInLine, paragraphStartIndex) {
6585
6591
  let additionalTokens = 0;
6586
6592
  let renderedIndexes = 0;
6593
+ const style = `max-height:${instance.ascent() + instance.descent()}px;`;
6594
+ const classes = instance.isFocused ? [CUSTOM_TAG, 'noder-focussed', 'noder-pointing'] : [CUSTOM_TAG, 'noder-pointing'];
6587
6595
  const attributes = [
6588
6596
  { name: 'data-session-id', value: `${instance.sessionId}` },
6589
6597
  { name: 'data-insert-index', value: `${instance.insertIndex}` }
@@ -6593,7 +6601,7 @@ class RenderingHelper {
6593
6601
  const customText = line.customTexts.find(x => x.index === instance.insertIndex - paragraphStartIndex);
6594
6602
  const customTextFragment = text.substring(customText.start, customText.end);
6595
6603
  if (!line.wordSpacing) {
6596
- this.renderText(fragment, textStyle, customTextFragment, wordSpacing, [CUSTOM_TAG, 'noder-pointing'], attributes);
6604
+ this.renderText(fragment, textStyle, customTextFragment, wordSpacing, classes, attributes, style);
6597
6605
  additionalTokens += customTextFragment.length;
6598
6606
  }
6599
6607
  else {
@@ -6601,15 +6609,15 @@ class RenderingHelper {
6601
6609
  const wordSpacingEnd = line.wordSpacingEndToken - renderedTokensInLine - renderedIndexes - additionalTokens;
6602
6610
  if (wordSpacingStart > 0) {
6603
6611
  const leftText = customTextFragment.substring(0, wordSpacingStart);
6604
- this.renderText(fragment, textStyle, leftText, null, [CUSTOM_TAG, 'noder-pointing'], attributes);
6612
+ this.renderText(fragment, textStyle, leftText, null, classes, attributes, style);
6605
6613
  additionalTokens += leftText.length;
6606
6614
  }
6607
6615
  const middleText = customTextFragment.substring(wordSpacingStart, wordSpacingEnd + 1);
6608
- this.renderText(fragment, textStyle, middleText, line.wordSpacing, [CUSTOM_TAG, 'noder-pointing'], attributes);
6616
+ this.renderText(fragment, textStyle, middleText, line.wordSpacing, classes, attributes, style);
6609
6617
  additionalTokens += middleText.length;
6610
6618
  if (wordSpacingEnd >= 0) {
6611
6619
  const rightText = customTextFragment.substring(wordSpacingEnd + 1);
6612
- this.renderText(fragment, textStyle, rightText, null, [CUSTOM_TAG, 'noder-pointing'], attributes);
6620
+ this.renderText(fragment, textStyle, rightText, null, classes, attributes, style);
6613
6621
  additionalTokens += rightText.length;
6614
6622
  }
6615
6623
  }
@@ -6619,7 +6627,7 @@ class RenderingHelper {
6619
6627
  }
6620
6628
  return { renderedIndexes, additionalTokens };
6621
6629
  }
6622
- static renderText(fragment, textStyle, content, wordSpacing, additionalClasses = [], additionalAttributes = []) {
6630
+ static renderText(fragment, textStyle, content, wordSpacing, additionalClasses = [], additionalAttributes = [], additionalStyle = '') {
6623
6631
  if (!content.length) {
6624
6632
  return;
6625
6633
  }
@@ -6643,7 +6651,7 @@ class RenderingHelper {
6643
6651
  span.onmouseleave = () => span.classList.remove('hyperlink-hover');
6644
6652
  }
6645
6653
  span.textContent = content;
6646
- let styleString = ContentStyleHelper.getTextStylesString(textStyle);
6654
+ let styleString = additionalStyle + ContentStyleHelper.getTextStylesString(textStyle);
6647
6655
  if (wordSpacing) {
6648
6656
  styleString += `word-spacing:${wordSpacing}px;`;
6649
6657
  }