@odoo/o-spreadsheet 17.2.10 → 17.2.11

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.
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.10
7
- * @date 2024-06-10T09:38:54.354Z
8
- * @hash 14317ee
6
+ * @version 17.2.11
7
+ * @date 2024-06-14T10:03:05.033Z
8
+ * @hash 7704cc4
9
9
  */
10
10
 
11
11
  'use strict';
@@ -21845,7 +21845,7 @@ class Popover extends owl.Component {
21845
21845
  if (!anchor)
21846
21846
  return;
21847
21847
  const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
21848
- const elDims = {
21848
+ let elDims = {
21849
21849
  width: el.getBoundingClientRect().width,
21850
21850
  height: el.getBoundingClientRect().height,
21851
21851
  };
@@ -21853,7 +21853,14 @@ class Popover extends owl.Component {
21853
21853
  const popoverPositionHelper = this.props.positioning === "BottomLeft"
21854
21854
  ? new BottomLeftPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect)
21855
21855
  : new TopRightPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect);
21856
- const style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21856
+ el.style["max-height"] = popoverPositionHelper.getMaxHeight(elDims.height) + "px";
21857
+ el.style["max-width"] = popoverPositionHelper.getMaxWidth(elDims.width) + "px";
21858
+ // Re-compute the dimensions after setting the max-width and max-height
21859
+ elDims = {
21860
+ width: el.getBoundingClientRect().width,
21861
+ height: el.getBoundingClientRect().height,
21862
+ };
21863
+ let style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21857
21864
  for (const property of Object.keys(style)) {
21858
21865
  el.style[property] = style[property];
21859
21866
  }
@@ -21916,8 +21923,6 @@ class PopoverPositionContext {
21916
21923
  const shouldRenderAtRight = this.shouldRenderAtRight(elDims.width);
21917
21924
  verticalOffset = shouldRenderAtBottom ? verticalOffset : -verticalOffset;
21918
21925
  const cssProperties = {
21919
- "max-height": maxHeight + "px",
21920
- "max-width": maxWidth + "px",
21921
21926
  top: this.getTopCoordinate(actualHeight, shouldRenderAtBottom) -
21922
21927
  this.spreadsheetOffset.y -
21923
21928
  verticalOffset +
@@ -29212,13 +29217,17 @@ class SelectMenu extends owl.Component {
29212
29217
  class: { type: String, optional: true },
29213
29218
  };
29214
29219
  static components = { Menu };
29220
+ menuId = new UuidGenerator().uuidv4();
29215
29221
  selectRef = owl.useRef("select");
29216
29222
  selectRect = useAbsoluteBoundingRect(this.selectRef);
29217
29223
  state = owl.useState({
29218
29224
  isMenuOpen: false,
29219
29225
  });
29220
- onClick() {
29221
- this.state.isMenuOpen = true;
29226
+ onClick(ev) {
29227
+ if (ev.closedMenuId === this.menuId) {
29228
+ return;
29229
+ }
29230
+ this.state.isMenuOpen = !this.state.isMenuOpen;
29222
29231
  }
29223
29232
  onMenuClosed() {
29224
29233
  this.state.isMenuOpen = false;
@@ -29226,7 +29235,7 @@ class SelectMenu extends owl.Component {
29226
29235
  get menuPosition() {
29227
29236
  return {
29228
29237
  x: this.selectRect.x,
29229
- y: this.selectRect.y,
29238
+ y: this.selectRect.y + this.selectRect.height,
29230
29239
  };
29231
29240
  }
29232
29241
  }
@@ -30166,9 +30175,9 @@ class FindAndReplacePanel extends owl.Component {
30166
30175
  static props = {
30167
30176
  onCloseSidePanel: Function,
30168
30177
  };
30169
- dataRange = "";
30170
30178
  searchInput = owl.useRef("searchInput");
30171
30179
  store;
30180
+ state;
30172
30181
  get hasSearchResult() {
30173
30182
  return this.store.selectedMatchIndex !== null;
30174
30183
  }
@@ -30198,6 +30207,7 @@ class FindAndReplacePanel extends owl.Component {
30198
30207
  }
30199
30208
  setup() {
30200
30209
  this.store = useLocalStore(FindAndReplaceStore);
30210
+ this.state = owl.useState({ dataRange: "" });
30201
30211
  owl.onMounted(() => this.searchInput.el?.focus());
30202
30212
  }
30203
30213
  onFocusSearch() {
@@ -30234,13 +30244,13 @@ class FindAndReplacePanel extends owl.Component {
30234
30244
  this.store.updateSearchOptions({ searchScope });
30235
30245
  }
30236
30246
  onSearchRangeChanged(ranges) {
30237
- this.dataRange = ranges[0];
30247
+ this.state.dataRange = ranges[0];
30238
30248
  }
30239
30249
  updateDataRange() {
30240
- if (!this.dataRange || this.searchOptions.searchScope !== "specificRange") {
30250
+ if (!this.state.dataRange || this.searchOptions.searchScope !== "specificRange") {
30241
30251
  return;
30242
30252
  }
30243
- const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.dataRange);
30253
+ const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
30244
30254
  this.store.updateSearchOptions({ specificRange });
30245
30255
  }
30246
30256
  }
@@ -33528,7 +33538,7 @@ class FiguresContainer extends owl.Component {
33528
33538
  });
33529
33539
  }
33530
33540
  getContainerRect(container) {
33531
- const { width: viewWidth, height: viewHeight } = this.env.model.getters.getMainViewportRect();
33541
+ const { width: viewWidth, height: viewHeight } = this.env.model.getters.getSheetViewDimension();
33532
33542
  const { x: viewportX, y: viewportY } = this.env.model.getters.getMainViewportCoordinates();
33533
33543
  const x = ["bottomRight", "topRight"].includes(container) ? viewportX : 0;
33534
33544
  const width = viewWidth - x;
@@ -50291,7 +50301,10 @@ class Session extends EventBus {
50291
50301
  /**
50292
50302
  * Notify the server that the user client left the collaborative session
50293
50303
  */
50294
- leave() {
50304
+ leave(data) {
50305
+ if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
50306
+ this.snapshot(data);
50307
+ }
50295
50308
  delete this.clients[this.clientId];
50296
50309
  this.transportService.leave(this.clientId);
50297
50310
  this.transportService.sendMessage({
@@ -50304,6 +50317,9 @@ class Session extends EventBus {
50304
50317
  * Send a snapshot of the spreadsheet to the collaboration server
50305
50318
  */
50306
50319
  snapshot(data) {
50320
+ if (this.pendingMessages.length !== 0) {
50321
+ return;
50322
+ }
50307
50323
  const snapshotId = this.uuidGenerator.uuidv4();
50308
50324
  this.transportService.sendMessage({
50309
50325
  type: "SNAPSHOT",
@@ -60216,7 +60232,7 @@ class Model extends EventBus {
60216
60232
  this.session.join(this.config.client);
60217
60233
  }
60218
60234
  leaveSession() {
60219
- this.session.leave();
60235
+ this.session.leave(this.exportData());
60220
60236
  }
60221
60237
  setupUiPlugin(Plugin) {
60222
60238
  const plugin = new Plugin(this.uiPluginConfig);
@@ -60770,6 +60786,6 @@ exports.tokenColors = tokenColors;
60770
60786
  exports.tokenize = tokenize;
60771
60787
 
60772
60788
 
60773
- __info__.version = "17.2.10";
60774
- __info__.date = "2024-06-10T09:38:54.354Z";
60775
- __info__.hash = "14317ee";
60789
+ __info__.version = "17.2.11";
60790
+ __info__.date = "2024-06-14T10:03:05.033Z";
60791
+ __info__.hash = "7704cc4";
@@ -3440,7 +3440,7 @@ declare class Session extends EventBus<CollaborativeEvent> {
3440
3440
  /**
3441
3441
  * Notify the server that the user client left the collaborative session
3442
3442
  */
3443
- leave(): void;
3443
+ leave(data: WorkbookData): void;
3444
3444
  /**
3445
3445
  * Send a snapshot of the spreadsheet to the collaboration server
3446
3446
  */
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.10
7
- * @date 2024-06-10T09:38:54.354Z
8
- * @hash 14317ee
6
+ * @version 17.2.11
7
+ * @date 2024-06-14T10:03:05.033Z
8
+ * @hash 7704cc4
9
9
  */
10
10
 
11
11
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw } from '@odoo/owl';
@@ -21843,7 +21843,7 @@ class Popover extends Component {
21843
21843
  if (!anchor)
21844
21844
  return;
21845
21845
  const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
21846
- const elDims = {
21846
+ let elDims = {
21847
21847
  width: el.getBoundingClientRect().width,
21848
21848
  height: el.getBoundingClientRect().height,
21849
21849
  };
@@ -21851,7 +21851,14 @@ class Popover extends Component {
21851
21851
  const popoverPositionHelper = this.props.positioning === "BottomLeft"
21852
21852
  ? new BottomLeftPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect)
21853
21853
  : new TopRightPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect);
21854
- const style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21854
+ el.style["max-height"] = popoverPositionHelper.getMaxHeight(elDims.height) + "px";
21855
+ el.style["max-width"] = popoverPositionHelper.getMaxWidth(elDims.width) + "px";
21856
+ // Re-compute the dimensions after setting the max-width and max-height
21857
+ elDims = {
21858
+ width: el.getBoundingClientRect().width,
21859
+ height: el.getBoundingClientRect().height,
21860
+ };
21861
+ let style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21855
21862
  for (const property of Object.keys(style)) {
21856
21863
  el.style[property] = style[property];
21857
21864
  }
@@ -21914,8 +21921,6 @@ class PopoverPositionContext {
21914
21921
  const shouldRenderAtRight = this.shouldRenderAtRight(elDims.width);
21915
21922
  verticalOffset = shouldRenderAtBottom ? verticalOffset : -verticalOffset;
21916
21923
  const cssProperties = {
21917
- "max-height": maxHeight + "px",
21918
- "max-width": maxWidth + "px",
21919
21924
  top: this.getTopCoordinate(actualHeight, shouldRenderAtBottom) -
21920
21925
  this.spreadsheetOffset.y -
21921
21926
  verticalOffset +
@@ -29210,13 +29215,17 @@ class SelectMenu extends Component {
29210
29215
  class: { type: String, optional: true },
29211
29216
  };
29212
29217
  static components = { Menu };
29218
+ menuId = new UuidGenerator().uuidv4();
29213
29219
  selectRef = useRef("select");
29214
29220
  selectRect = useAbsoluteBoundingRect(this.selectRef);
29215
29221
  state = useState({
29216
29222
  isMenuOpen: false,
29217
29223
  });
29218
- onClick() {
29219
- this.state.isMenuOpen = true;
29224
+ onClick(ev) {
29225
+ if (ev.closedMenuId === this.menuId) {
29226
+ return;
29227
+ }
29228
+ this.state.isMenuOpen = !this.state.isMenuOpen;
29220
29229
  }
29221
29230
  onMenuClosed() {
29222
29231
  this.state.isMenuOpen = false;
@@ -29224,7 +29233,7 @@ class SelectMenu extends Component {
29224
29233
  get menuPosition() {
29225
29234
  return {
29226
29235
  x: this.selectRect.x,
29227
- y: this.selectRect.y,
29236
+ y: this.selectRect.y + this.selectRect.height,
29228
29237
  };
29229
29238
  }
29230
29239
  }
@@ -30164,9 +30173,9 @@ class FindAndReplacePanel extends Component {
30164
30173
  static props = {
30165
30174
  onCloseSidePanel: Function,
30166
30175
  };
30167
- dataRange = "";
30168
30176
  searchInput = useRef("searchInput");
30169
30177
  store;
30178
+ state;
30170
30179
  get hasSearchResult() {
30171
30180
  return this.store.selectedMatchIndex !== null;
30172
30181
  }
@@ -30196,6 +30205,7 @@ class FindAndReplacePanel extends Component {
30196
30205
  }
30197
30206
  setup() {
30198
30207
  this.store = useLocalStore(FindAndReplaceStore);
30208
+ this.state = useState({ dataRange: "" });
30199
30209
  onMounted(() => this.searchInput.el?.focus());
30200
30210
  }
30201
30211
  onFocusSearch() {
@@ -30232,13 +30242,13 @@ class FindAndReplacePanel extends Component {
30232
30242
  this.store.updateSearchOptions({ searchScope });
30233
30243
  }
30234
30244
  onSearchRangeChanged(ranges) {
30235
- this.dataRange = ranges[0];
30245
+ this.state.dataRange = ranges[0];
30236
30246
  }
30237
30247
  updateDataRange() {
30238
- if (!this.dataRange || this.searchOptions.searchScope !== "specificRange") {
30248
+ if (!this.state.dataRange || this.searchOptions.searchScope !== "specificRange") {
30239
30249
  return;
30240
30250
  }
30241
- const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.dataRange);
30251
+ const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
30242
30252
  this.store.updateSearchOptions({ specificRange });
30243
30253
  }
30244
30254
  }
@@ -33526,7 +33536,7 @@ class FiguresContainer extends Component {
33526
33536
  });
33527
33537
  }
33528
33538
  getContainerRect(container) {
33529
- const { width: viewWidth, height: viewHeight } = this.env.model.getters.getMainViewportRect();
33539
+ const { width: viewWidth, height: viewHeight } = this.env.model.getters.getSheetViewDimension();
33530
33540
  const { x: viewportX, y: viewportY } = this.env.model.getters.getMainViewportCoordinates();
33531
33541
  const x = ["bottomRight", "topRight"].includes(container) ? viewportX : 0;
33532
33542
  const width = viewWidth - x;
@@ -50289,7 +50299,10 @@ class Session extends EventBus {
50289
50299
  /**
50290
50300
  * Notify the server that the user client left the collaborative session
50291
50301
  */
50292
- leave() {
50302
+ leave(data) {
50303
+ if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
50304
+ this.snapshot(data);
50305
+ }
50293
50306
  delete this.clients[this.clientId];
50294
50307
  this.transportService.leave(this.clientId);
50295
50308
  this.transportService.sendMessage({
@@ -50302,6 +50315,9 @@ class Session extends EventBus {
50302
50315
  * Send a snapshot of the spreadsheet to the collaboration server
50303
50316
  */
50304
50317
  snapshot(data) {
50318
+ if (this.pendingMessages.length !== 0) {
50319
+ return;
50320
+ }
50305
50321
  const snapshotId = this.uuidGenerator.uuidv4();
50306
50322
  this.transportService.sendMessage({
50307
50323
  type: "SNAPSHOT",
@@ -60214,7 +60230,7 @@ class Model extends EventBus {
60214
60230
  this.session.join(this.config.client);
60215
60231
  }
60216
60232
  leaveSession() {
60217
- this.session.leave();
60233
+ this.session.leave(this.exportData());
60218
60234
  }
60219
60235
  setupUiPlugin(Plugin) {
60220
60236
  const plugin = new Plugin(this.uiPluginConfig);
@@ -60727,6 +60743,6 @@ const constants = {
60727
60743
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
60728
60744
 
60729
60745
 
60730
- __info__.version = "17.2.10";
60731
- __info__.date = "2024-06-10T09:38:54.354Z";
60732
- __info__.hash = "14317ee";
60746
+ __info__.version = "17.2.11";
60747
+ __info__.date = "2024-06-14T10:03:05.033Z";
60748
+ __info__.hash = "7704cc4";
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.10
7
- * @date 2024-06-10T09:38:54.354Z
8
- * @hash 14317ee
6
+ * @version 17.2.11
7
+ * @date 2024-06-14T10:03:05.033Z
8
+ * @hash 7704cc4
9
9
  */
10
10
 
11
11
  (function (exports, owl) {
@@ -21844,7 +21844,7 @@ stores.inject(MyMetaStore, storeInstance);
21844
21844
  if (!anchor)
21845
21845
  return;
21846
21846
  const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
21847
- const elDims = {
21847
+ let elDims = {
21848
21848
  width: el.getBoundingClientRect().width,
21849
21849
  height: el.getBoundingClientRect().height,
21850
21850
  };
@@ -21852,7 +21852,14 @@ stores.inject(MyMetaStore, storeInstance);
21852
21852
  const popoverPositionHelper = this.props.positioning === "BottomLeft"
21853
21853
  ? new BottomLeftPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect)
21854
21854
  : new TopRightPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect);
21855
- const style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21855
+ el.style["max-height"] = popoverPositionHelper.getMaxHeight(elDims.height) + "px";
21856
+ el.style["max-width"] = popoverPositionHelper.getMaxWidth(elDims.width) + "px";
21857
+ // Re-compute the dimensions after setting the max-width and max-height
21858
+ elDims = {
21859
+ width: el.getBoundingClientRect().width,
21860
+ height: el.getBoundingClientRect().height,
21861
+ };
21862
+ let style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21856
21863
  for (const property of Object.keys(style)) {
21857
21864
  el.style[property] = style[property];
21858
21865
  }
@@ -21915,8 +21922,6 @@ stores.inject(MyMetaStore, storeInstance);
21915
21922
  const shouldRenderAtRight = this.shouldRenderAtRight(elDims.width);
21916
21923
  verticalOffset = shouldRenderAtBottom ? verticalOffset : -verticalOffset;
21917
21924
  const cssProperties = {
21918
- "max-height": maxHeight + "px",
21919
- "max-width": maxWidth + "px",
21920
21925
  top: this.getTopCoordinate(actualHeight, shouldRenderAtBottom) -
21921
21926
  this.spreadsheetOffset.y -
21922
21927
  verticalOffset +
@@ -29211,13 +29216,17 @@ stores.inject(MyMetaStore, storeInstance);
29211
29216
  class: { type: String, optional: true },
29212
29217
  };
29213
29218
  static components = { Menu };
29219
+ menuId = new UuidGenerator().uuidv4();
29214
29220
  selectRef = owl.useRef("select");
29215
29221
  selectRect = useAbsoluteBoundingRect(this.selectRef);
29216
29222
  state = owl.useState({
29217
29223
  isMenuOpen: false,
29218
29224
  });
29219
- onClick() {
29220
- this.state.isMenuOpen = true;
29225
+ onClick(ev) {
29226
+ if (ev.closedMenuId === this.menuId) {
29227
+ return;
29228
+ }
29229
+ this.state.isMenuOpen = !this.state.isMenuOpen;
29221
29230
  }
29222
29231
  onMenuClosed() {
29223
29232
  this.state.isMenuOpen = false;
@@ -29225,7 +29234,7 @@ stores.inject(MyMetaStore, storeInstance);
29225
29234
  get menuPosition() {
29226
29235
  return {
29227
29236
  x: this.selectRect.x,
29228
- y: this.selectRect.y,
29237
+ y: this.selectRect.y + this.selectRect.height,
29229
29238
  };
29230
29239
  }
29231
29240
  }
@@ -30165,9 +30174,9 @@ stores.inject(MyMetaStore, storeInstance);
30165
30174
  static props = {
30166
30175
  onCloseSidePanel: Function,
30167
30176
  };
30168
- dataRange = "";
30169
30177
  searchInput = owl.useRef("searchInput");
30170
30178
  store;
30179
+ state;
30171
30180
  get hasSearchResult() {
30172
30181
  return this.store.selectedMatchIndex !== null;
30173
30182
  }
@@ -30197,6 +30206,7 @@ stores.inject(MyMetaStore, storeInstance);
30197
30206
  }
30198
30207
  setup() {
30199
30208
  this.store = useLocalStore(FindAndReplaceStore);
30209
+ this.state = owl.useState({ dataRange: "" });
30200
30210
  owl.onMounted(() => this.searchInput.el?.focus());
30201
30211
  }
30202
30212
  onFocusSearch() {
@@ -30233,13 +30243,13 @@ stores.inject(MyMetaStore, storeInstance);
30233
30243
  this.store.updateSearchOptions({ searchScope });
30234
30244
  }
30235
30245
  onSearchRangeChanged(ranges) {
30236
- this.dataRange = ranges[0];
30246
+ this.state.dataRange = ranges[0];
30237
30247
  }
30238
30248
  updateDataRange() {
30239
- if (!this.dataRange || this.searchOptions.searchScope !== "specificRange") {
30249
+ if (!this.state.dataRange || this.searchOptions.searchScope !== "specificRange") {
30240
30250
  return;
30241
30251
  }
30242
- const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.dataRange);
30252
+ const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
30243
30253
  this.store.updateSearchOptions({ specificRange });
30244
30254
  }
30245
30255
  }
@@ -33527,7 +33537,7 @@ stores.inject(MyMetaStore, storeInstance);
33527
33537
  });
33528
33538
  }
33529
33539
  getContainerRect(container) {
33530
- const { width: viewWidth, height: viewHeight } = this.env.model.getters.getMainViewportRect();
33540
+ const { width: viewWidth, height: viewHeight } = this.env.model.getters.getSheetViewDimension();
33531
33541
  const { x: viewportX, y: viewportY } = this.env.model.getters.getMainViewportCoordinates();
33532
33542
  const x = ["bottomRight", "topRight"].includes(container) ? viewportX : 0;
33533
33543
  const width = viewWidth - x;
@@ -50290,7 +50300,10 @@ stores.inject(MyMetaStore, storeInstance);
50290
50300
  /**
50291
50301
  * Notify the server that the user client left the collaborative session
50292
50302
  */
50293
- leave() {
50303
+ leave(data) {
50304
+ if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
50305
+ this.snapshot(data);
50306
+ }
50294
50307
  delete this.clients[this.clientId];
50295
50308
  this.transportService.leave(this.clientId);
50296
50309
  this.transportService.sendMessage({
@@ -50303,6 +50316,9 @@ stores.inject(MyMetaStore, storeInstance);
50303
50316
  * Send a snapshot of the spreadsheet to the collaboration server
50304
50317
  */
50305
50318
  snapshot(data) {
50319
+ if (this.pendingMessages.length !== 0) {
50320
+ return;
50321
+ }
50306
50322
  const snapshotId = this.uuidGenerator.uuidv4();
50307
50323
  this.transportService.sendMessage({
50308
50324
  type: "SNAPSHOT",
@@ -60215,7 +60231,7 @@ stores.inject(MyMetaStore, storeInstance);
60215
60231
  this.session.join(this.config.client);
60216
60232
  }
60217
60233
  leaveSession() {
60218
- this.session.leave();
60234
+ this.session.leave(this.exportData());
60219
60235
  }
60220
60236
  setupUiPlugin(Plugin) {
60221
60237
  const plugin = new Plugin(this.uiPluginConfig);
@@ -60769,9 +60785,9 @@ stores.inject(MyMetaStore, storeInstance);
60769
60785
  exports.tokenize = tokenize;
60770
60786
 
60771
60787
 
60772
- __info__.version = "17.2.10";
60773
- __info__.date = "2024-06-10T09:38:54.354Z";
60774
- __info__.hash = "14317ee";
60788
+ __info__.version = "17.2.11";
60789
+ __info__.date = "2024-06-14T10:03:05.033Z";
60790
+ __info__.hash = "7704cc4";
60775
60791
 
60776
60792
 
60777
60793
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);