@trebco/treb 25.5.0 → 25.6.1

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.
@@ -2512,12 +2512,12 @@ export class Sheet {
2512
2512
  // push out for annotations
2513
2513
 
2514
2514
  for (const annotation of this.annotations) {
2515
- if (!annotation.extent) {
2515
+ if (!annotation.data.extent) {
2516
2516
  this.CalculateAnnotationExtent(annotation);
2517
2517
  }
2518
- if (annotation.extent) {
2519
- rows = Math.max(rows, annotation.extent.row + 1);
2520
- columns = Math.max(columns, annotation.extent.column + 1);
2518
+ if (annotation.data.extent) {
2519
+ rows = Math.max(rows, annotation.data.extent.row + 1);
2520
+ columns = Math.max(columns, annotation.data.extent.column + 1);
2521
2521
  }
2522
2522
  }
2523
2523
 
@@ -2769,22 +2769,22 @@ export class Sheet {
2769
2769
  // at some point, we just need to make sure that happens before this
2770
2770
  // is called
2771
2771
 
2772
- if (annotation.layout) {
2773
- annotation.extent = { ...annotation.layout.br.address };
2772
+ if (annotation.data.layout) {
2773
+ annotation.data.extent = { ...annotation.data.layout.br.address };
2774
2774
  return;
2775
2775
  }
2776
2776
 
2777
2777
  // 1000 here is just sanity check, it might be larger
2778
2778
  const sanity = 1000;
2779
2779
 
2780
- annotation.extent = { row: 0, column: 0 };
2780
+ annotation.data.extent = { row: 0, column: 0 };
2781
2781
 
2782
2782
  let right = annotation.rect?.right;
2783
2783
  if (right && this.default_column_width) { // also sanity check
2784
2784
  for (let i = 0; right >= 0 && i < sanity; i++) {
2785
2785
  right -= this.GetColumnWidth(i); // FIXME: check // it's ok, rect is scaled to unit
2786
2786
  if (right < 0) {
2787
- annotation.extent.column = i;
2787
+ annotation.data.extent.column = i;
2788
2788
  break;
2789
2789
  }
2790
2790
  }
@@ -2795,7 +2795,7 @@ export class Sheet {
2795
2795
  for (let i = 0; bottom >= 0 && i < sanity; i++) {
2796
2796
  bottom -= this.GetRowHeight(i); // FIXME: check // it's ok, rect is scaled to unit
2797
2797
  if (bottom < 0) {
2798
- annotation.extent.row = i;
2798
+ annotation.data.extent.row = i;
2799
2799
  break;
2800
2800
  }
2801
2801
  }
@@ -20,7 +20,7 @@
20
20
  */
21
21
 
22
22
  import type { IArea, SerializedCellData, Style } from 'treb-base-types';
23
- import type { Annotation } from './annotation';
23
+ import type { Annotation, AnnotationData } from './annotation';
24
24
  import type { GridSelection } from './grid_selection';
25
25
 
26
26
  export interface UpdateHints {
@@ -82,7 +82,7 @@ export interface SerializedSheet {
82
82
  name?: string;
83
83
 
84
84
  selection: GridSelection;
85
- annotations?: Partial<Annotation>[];
85
+ annotations?: Partial<AnnotationData>[]; // Partial<Annotation>[];
86
86
  scroll?: ScrollOffset;
87
87
 
88
88
  visible?: boolean;