@worktile/theia 20.2.1 → 20.2.2

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.
@@ -14363,8 +14363,8 @@ class TheImage extends TheBaseElement {
14363
14363
  if (!AngularEditor.isEnabledVirtualScroll(this.editor)) {
14364
14364
  return;
14365
14365
  }
14366
- const realHeight = getRealHeightByElement(this.editor, this.element, 0);
14367
- if (realHeight > 0) {
14366
+ const realHeight = getRealHeightByElement(this.editor, this.element);
14367
+ if (realHeight) {
14368
14368
  const blockCard = getBlockCardByNativeElement(this.nativeElement);
14369
14369
  if (blockCard) {
14370
14370
  const style = getComputedStyle(blockCard);
@@ -17402,7 +17402,7 @@ class TableTdFlavour extends TheBaseFlavourElement {
17402
17402
  }
17403
17403
 
17404
17404
  const withTable = (editor) => {
17405
- const { deleteBackward, deleteForward, onKeydown, setFragmentData, customInsertFragmentData, normalizeNode, isBlockCard, renderElement, deleteCutData, isContainer, onChange, onClick, mousedown } = editor;
17405
+ const { deleteBackward, deleteForward, onKeydown, setFragmentData, customInsertFragmentData, normalizeNode, isBlockCard, renderElement, deleteCutData, isContainer, onChange, onClick, mousedown, getRoughHeight } = editor;
17406
17406
  editor.deleteBackward = unit => {
17407
17407
  const opts = new TableOptions();
17408
17408
  if (!isSelectionInTable(opts, editor)) {
@@ -17453,6 +17453,13 @@ const withTable = (editor) => {
17453
17453
  }
17454
17454
  onClick(event);
17455
17455
  };
17456
+ editor.getRoughHeight = (element, defaultHeight) => {
17457
+ if (Element.isElement(element) && element.type === ElementKinds.table) {
17458
+ const defaultRowHeight = 41;
17459
+ return element.children.length * defaultRowHeight;
17460
+ }
17461
+ return getRoughHeight(element, defaultHeight);
17462
+ };
17456
17463
  editor.mousedown = (event) => {
17457
17464
  const hitElement = event.target;
17458
17465
  if (hitElement.classList.contains('the-table-wrapper')) {