@odoo/o-spreadsheet 19.0.15 → 19.0.16

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.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 19.0.15
6
- * @date 2025-12-26T10:19:23.408Z
7
- * @hash fe625c9
5
+ * @version 19.0.16
6
+ * @date 2026-01-07T16:21:15.857Z
7
+ * @hash 9f3f13a
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -51370,7 +51370,6 @@ stores.inject(MyMetaStore, storeInstance);
51370
51370
  onGridMoved: Function,
51371
51371
  gridOverlayDimensions: String,
51372
51372
  slots: { type: Object, optional: true },
51373
- getGridSize: Function,
51374
51373
  };
51375
51374
  static components = {
51376
51375
  FiguresContainer,
@@ -51389,14 +51388,7 @@ stores.inject(MyMetaStore, storeInstance);
51389
51388
  setup() {
51390
51389
  useCellHovered(this.env, this.gridOverlay);
51391
51390
  const resizeObserver = new ResizeObserver(() => {
51392
- const boundingRect = this.gridOverlayEl.getBoundingClientRect();
51393
- const { width, height } = this.props.getGridSize();
51394
- this.props.onGridResized({
51395
- x: boundingRect.left,
51396
- y: boundingRect.top,
51397
- height: height,
51398
- width: width,
51399
- });
51391
+ this.props.onGridResized();
51400
51392
  });
51401
51393
  owl.onMounted(() => {
51402
51394
  resizeObserver.observe(this.gridOverlayEl);
@@ -61420,7 +61412,8 @@ stores.inject(MyMetaStore, storeInstance);
61420
61412
  });
61421
61413
  return !(rect.width === 0 || rect.height === 0);
61422
61414
  }
61423
- onGridResized({ height, width }) {
61415
+ onGridResized() {
61416
+ const { height, width } = this.props.getGridSize();
61424
61417
  this.env.model.dispatch("RESIZE_SHEETVIEW", {
61425
61418
  width: width - HEADER_WIDTH,
61426
61419
  height: height - HEADER_HEIGHT,
@@ -74418,7 +74411,7 @@ stores.inject(MyMetaStore, storeInstance);
74418
74411
  }
74419
74412
  delete this.clients[this.clientId];
74420
74413
  this.transportService.leave(this.clientId);
74421
- this.transportService.sendMessage({
74414
+ this.sendToTransport({
74422
74415
  type: "CLIENT_LEFT",
74423
74416
  clientId: this.clientId,
74424
74417
  version: MESSAGE_VERSION,
@@ -74432,7 +74425,7 @@ stores.inject(MyMetaStore, storeInstance);
74432
74425
  return;
74433
74426
  }
74434
74427
  const snapshotId = this.uuidGenerator.uuidv4();
74435
- await this.transportService.sendMessage({
74428
+ await this.sendToTransport({
74436
74429
  type: "SNAPSHOT",
74437
74430
  nextRevisionId: snapshotId,
74438
74431
  serverRevisionId: this.serverRevisionId,
@@ -74480,10 +74473,14 @@ stores.inject(MyMetaStore, storeInstance);
74480
74473
  const type = currentPosition ? "CLIENT_MOVED" : "CLIENT_JOINED";
74481
74474
  const client = this.getCurrentClient();
74482
74475
  this.clients[this.clientId] = { ...client, position };
74483
- this.transportService.sendMessage({
74476
+ this.sendToTransport({
74484
74477
  type,
74485
74478
  version: MESSAGE_VERSION,
74486
74479
  client: { ...client, position },
74480
+ }).then(() => {
74481
+ if (this.pendingMessages.length > 0 && !this.waitingAck) {
74482
+ this.sendPendingMessage();
74483
+ }
74487
74484
  });
74488
74485
  }
74489
74486
  /**
@@ -74564,7 +74561,7 @@ stores.inject(MyMetaStore, storeInstance);
74564
74561
  if (client) {
74565
74562
  const { position } = client;
74566
74563
  if (position) {
74567
- this.transportService.sendMessage({
74564
+ this.sendToTransport({
74568
74565
  type: "CLIENT_MOVED",
74569
74566
  version: MESSAGE_VERSION,
74570
74567
  client: { ...client, position },
@@ -74585,6 +74582,10 @@ stores.inject(MyMetaStore, storeInstance);
74585
74582
  }
74586
74583
  this.sendPendingMessage();
74587
74584
  }
74585
+ async sendToTransport(message) {
74586
+ // wrap in an async function to ensure it returns a promise
74587
+ return this.transportService.sendMessage(message);
74588
+ }
74588
74589
  /**
74589
74590
  * Send the next pending message
74590
74591
  */
@@ -74613,9 +74614,14 @@ stores.inject(MyMetaStore, storeInstance);
74613
74614
  ${JSON.stringify(message)}`);
74614
74615
  }
74615
74616
  this.waitingAck = true;
74616
- this.transportService.sendMessage({
74617
+ this.sendToTransport({
74617
74618
  ...message,
74618
74619
  serverRevisionId: this.serverRevisionId,
74620
+ }).catch((e) => {
74621
+ if (!(e instanceof ClientDisconnectedError)) {
74622
+ throw e.cause || e;
74623
+ }
74624
+ this.waitingAck = false;
74619
74625
  });
74620
74626
  }
74621
74627
  acknowledge(message) {
@@ -82121,10 +82127,8 @@ stores.inject(MyMetaStore, storeInstance);
82121
82127
  });
82122
82128
  }
82123
82129
  get gridContainer() {
82124
- const sheetId = this.env.model.getters.getActiveSheetId();
82125
- const { right } = this.env.model.getters.getSheetZone(sheetId);
82126
- const { end } = this.env.model.getters.getColDimensions(sheetId, right);
82127
- return cssPropertiesToCss({ "max-width": `${end}px` });
82130
+ const maxWidth = this.getMaxSheetWidth();
82131
+ return cssPropertiesToCss({ "max-width": `${maxWidth}px` });
82128
82132
  }
82129
82133
  get gridOverlayDimensions() {
82130
82134
  return cssPropertiesToCss({
@@ -82156,10 +82160,12 @@ stores.inject(MyMetaStore, storeInstance);
82156
82160
  onClosePopover() {
82157
82161
  this.cellPopovers.close();
82158
82162
  }
82159
- onGridResized({ height, width }) {
82163
+ onGridResized() {
82164
+ const { height, width } = this.props.getGridSize();
82165
+ const maxWidth = this.getMaxSheetWidth();
82160
82166
  this.env.model.dispatch("RESIZE_SHEETVIEW", {
82161
- width: width,
82162
- height: height,
82167
+ width: Math.min(maxWidth, width),
82168
+ height,
82163
82169
  gridOffsetX: 0,
82164
82170
  gridOffsetY: 0,
82165
82171
  });
@@ -82177,6 +82183,11 @@ stores.inject(MyMetaStore, storeInstance);
82177
82183
  ...this.env.model.getters.getSheetViewDimensionWithHeaders(),
82178
82184
  };
82179
82185
  }
82186
+ getMaxSheetWidth() {
82187
+ const sheetId = this.env.model.getters.getActiveSheetId();
82188
+ const { right } = this.env.model.getters.getSheetZone(sheetId);
82189
+ return this.env.model.getters.getColDimensions(sheetId, right).end;
82190
+ }
82180
82191
  }
82181
82192
 
82182
82193
  css /* scss */ `
@@ -84418,22 +84429,20 @@ stores.inject(MyMetaStore, storeInstance);
84418
84429
  return this.env.model.getters.getVisibleGroupLayers(sheetId, "COL");
84419
84430
  }
84420
84431
  getGridSize() {
84421
- const topBarHeight = this.spreadsheetRef.el
84422
- ?.querySelector(".o-spreadsheet-topbar-wrapper")
84423
- ?.getBoundingClientRect().height || 0;
84424
- const bottomBarHeight = this.spreadsheetRef.el
84425
- ?.querySelector(".o-spreadsheet-bottombar-wrapper")
84426
- ?.getBoundingClientRect().height || 0;
84427
- const gridWidth = this.spreadsheetRef.el?.querySelector(".o-grid")?.getBoundingClientRect().width || 0;
84428
- const gridHeight = (this.spreadsheetRef.el?.getBoundingClientRect().height || 0) -
84429
- (this.spreadsheetRef.el?.querySelector(".o-column-groups")?.getBoundingClientRect().height ||
84430
- 0) -
84431
- topBarHeight -
84432
- bottomBarHeight;
84433
- return {
84434
- width: Math.max(gridWidth - SCROLLBAR_WIDTH, 0),
84435
- height: Math.max(gridHeight - SCROLLBAR_WIDTH, 0),
84436
- };
84432
+ const el = this.spreadsheetRef.el;
84433
+ if (!el) {
84434
+ return { width: 0, height: 0 };
84435
+ }
84436
+ const getHeight = (selector) => el.querySelector(selector)?.getBoundingClientRect().height || 0;
84437
+ const getWidth = (selector) => el.querySelector(selector)?.getBoundingClientRect().width || 0;
84438
+ const rect = el.getBoundingClientRect();
84439
+ const topBarHeight = getHeight(".o-spreadsheet-topbar-wrapper");
84440
+ const bottomBarHeight = getHeight(".o-spreadsheet-bottombar-wrapper");
84441
+ const colGroupHeight = getHeight(".o-column-groups");
84442
+ const gridWidth = getWidth(".o-grid");
84443
+ const width = Math.max(gridWidth - SCROLLBAR_WIDTH, 0);
84444
+ const height = Math.max(rect.height - topBarHeight - bottomBarHeight - colGroupHeight - SCROLLBAR_WIDTH, 0);
84445
+ return { width, height };
84437
84446
  }
84438
84447
  }
84439
84448
 
@@ -84446,7 +84455,7 @@ stores.inject(MyMetaStore, storeInstance);
84446
84455
  if (message.type === "CLIENT_JOINED" ||
84447
84456
  message.type === "CLIENT_LEFT" ||
84448
84457
  message.type === "CLIENT_MOVED") {
84449
- this.transportService.sendMessage(message);
84458
+ await this.transportService.sendMessage(message);
84450
84459
  }
84451
84460
  // ignore all other messages
84452
84461
  }
@@ -89115,9 +89124,9 @@ stores.inject(MyMetaStore, storeInstance);
89115
89124
  exports.tokenize = tokenize;
89116
89125
 
89117
89126
 
89118
- __info__.version = "19.0.15";
89119
- __info__.date = "2025-12-26T10:19:23.408Z";
89120
- __info__.hash = "fe625c9";
89127
+ __info__.version = "19.0.16";
89128
+ __info__.date = "2026-01-07T16:21:15.857Z";
89129
+ __info__.hash = "9f3f13a";
89121
89130
 
89122
89131
 
89123
89132
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);