@trebco/treb 27.12.0 → 27.12.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.
package/dist/treb.d.ts CHANGED
@@ -1381,7 +1381,7 @@ export declare type LoadSource = "drag-and-drop" | "local-file" | "network-file"
1381
1381
  * EmbeddedSheetEvent is a discriminated union. Switch on the `type` field
1382
1382
  * of the event.
1383
1383
  */
1384
- export type EmbeddedSheetEvent = DocumentChangeEvent | DocumentResetEvent | DocumentLoadEvent | DataChangeEvent | FocusViewEvent | SelectionEvent | ResizeEvent;
1384
+ export type EmbeddedSheetEvent = DocumentChangeEvent | DocumentResetEvent | DocumentLoadEvent | ViewChangeEvent | DataChangeEvent | FocusViewEvent | SelectionEvent | ResizeEvent;
1385
1385
 
1386
1386
  /**
1387
1387
  * options when inserting a table into a sheet
@@ -1411,6 +1411,15 @@ export interface ResizeEvent {
1411
1411
  }
1412
1412
  export declare type LoadType = "treb" | "csv" | "xlsx";
1413
1413
 
1414
+ /**
1415
+ * This event is sent when the view changes -- at the moment, that only
1416
+ * means the view scale has been changed. We might use it in the future
1417
+ * for other things.
1418
+ */
1419
+ export interface ViewChangeEvent {
1420
+ type: 'view-change';
1421
+ }
1422
+
1414
1423
  /**
1415
1424
  * This event is sent when a document is loaded, and also on undo. The
1416
1425
  * source field can help determine if it was triggered by an undo operation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trebco/treb",
3
- "version": "27.12.0",
3
+ "version": "27.12.2",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "homepage": "https://treb.app",
6
6
  "repository": {
@@ -308,7 +308,8 @@ export class EmbeddedSpreadsheet {
308
308
  /** loaded language model, if any */
309
309
  protected language_model?: LanguageModel;
310
310
 
311
- protected events = new EventSource<{type: string}>();
311
+ /** FIXME: fix type (needs to be extensible) */
312
+ protected events = new EventSource<{ type: string }>();
312
313
 
313
314
  /**
314
315
  * automatic/manual
@@ -198,6 +198,7 @@ export type EmbeddedSheetEvent
198
198
  = DocumentChangeEvent
199
199
  | DocumentResetEvent
200
200
  | DocumentLoadEvent
201
+ | ViewChangeEvent
201
202
  | DataChangeEvent
202
203
  | FocusViewEvent
203
204
  | SelectionEvent
@@ -328,6 +328,11 @@ export class OverlayEditor extends Editor<ResetSelectionEvent> {
328
328
  this.edit_node.spellcheck = false;
329
329
  }
330
330
 
331
+ // move the rect before monkeying with the selection, otherwise we
332
+ // get jumpy scrolling behavior in scrolled contexts.
333
+
334
+ rect.ApplyStyle(this.container_node);
335
+
331
336
  this.autocomplete?.ResetBlock();
332
337
  this.selection = gridselection;
333
338
 
@@ -343,7 +348,6 @@ export class OverlayEditor extends Editor<ResetSelectionEvent> {
343
348
 
344
349
  }
345
350
 
346
- rect.ApplyStyle(this.container_node);
347
351
  this.editing = true;
348
352
 
349
353
  Promise.resolve().then(() => {