@trebco/treb 25.6.3 → 25.6.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trebco/treb",
3
- "version": "25.6.3",
3
+ "version": "25.6.4",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "homepage": "https://treb.app",
6
6
  "repository": {
@@ -155,6 +155,15 @@ export interface AnnotationDataBase {
155
155
 
156
156
  }
157
157
 
158
+ const default_annotation_data: Partial<AnnotationDataBase> = {
159
+ move_with_cells: true,
160
+ resize_with_cells: true,
161
+ movable: true,
162
+ resizable: true,
163
+ removable: true,
164
+ selectable: true,
165
+ };
166
+
158
167
  export interface AnnotationImageData extends AnnotationDataBase {
159
168
  type: 'image';
160
169
  data: ImageAnnotationData;
@@ -177,7 +186,9 @@ export type AnnotationData = AnnotationChartData | AnnotationImageData | Annotat
177
186
  */
178
187
  export class Annotation {
179
188
 
180
- public data: Partial<AnnotationData> = {};
189
+ public data: Partial<AnnotationData> = {
190
+ ...default_annotation_data
191
+ };
181
192
 
182
193
  /**
183
194
  * the key field is used to identify and coordinate annotations when we
@@ -212,7 +223,10 @@ export class Annotation {
212
223
  * constructor takes persisted data
213
224
  */
214
225
  constructor(opts: Partial<AnnotationData> = {}) {
215
- this.data = JSON.parse(JSON.stringify(opts)); // why clone?
226
+ this.data = {
227
+ ...default_annotation_data,
228
+ ...JSON.parse(JSON.stringify(opts))
229
+ }; // why clone?
216
230
  if (opts.rect) {
217
231
  this.rect = Rectangle.Create(opts.rect);
218
232
  }