@odoo/o-spreadsheet 17.2.10 → 17.2.12

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.12
7
+ * @date 2024-06-21T19:58:15.248Z
8
+ * @hash 1aaacc4
9
9
  */
10
10
 
11
11
  'use strict';
@@ -8881,10 +8881,8 @@ class ComposerStore extends SpreadsheetStore {
8881
8881
  const refRange = this.getters.getRangeFromSheetXC(activeSheetId, xc);
8882
8882
  return isEqual(this.getters.expandZone(activeSheetId, refRange.zone), oldZone);
8883
8883
  });
8884
- // this function assumes that the previous range is always found because
8885
- // it's called when changing a highlight, which exists by definition
8886
8884
  if (!previousRefToken) {
8887
- throw new Error("Previous range not found");
8885
+ return;
8888
8886
  }
8889
8887
  const previousRange = this.getters.getRangeFromSheetXC(activeSheetId, previousRefToken.value);
8890
8888
  this.selectionStart = previousRefToken.start;
@@ -21845,7 +21843,7 @@ class Popover extends owl.Component {
21845
21843
  if (!anchor)
21846
21844
  return;
21847
21845
  const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
21848
- const elDims = {
21846
+ let elDims = {
21849
21847
  width: el.getBoundingClientRect().width,
21850
21848
  height: el.getBoundingClientRect().height,
21851
21849
  };
@@ -21853,7 +21851,14 @@ class Popover extends owl.Component {
21853
21851
  const popoverPositionHelper = this.props.positioning === "BottomLeft"
21854
21852
  ? new BottomLeftPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect)
21855
21853
  : new TopRightPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect);
21856
- 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);
21857
21862
  for (const property of Object.keys(style)) {
21858
21863
  el.style[property] = style[property];
21859
21864
  }
@@ -21916,8 +21921,6 @@ class PopoverPositionContext {
21916
21921
  const shouldRenderAtRight = this.shouldRenderAtRight(elDims.width);
21917
21922
  verticalOffset = shouldRenderAtBottom ? verticalOffset : -verticalOffset;
21918
21923
  const cssProperties = {
21919
- "max-height": maxHeight + "px",
21920
- "max-width": maxWidth + "px",
21921
21924
  top: this.getTopCoordinate(actualHeight, shouldRenderAtBottom) -
21922
21925
  this.spreadsheetOffset.y -
21923
21926
  verticalOffset +
@@ -29212,13 +29215,17 @@ class SelectMenu extends owl.Component {
29212
29215
  class: { type: String, optional: true },
29213
29216
  };
29214
29217
  static components = { Menu };
29218
+ menuId = new UuidGenerator().uuidv4();
29215
29219
  selectRef = owl.useRef("select");
29216
29220
  selectRect = useAbsoluteBoundingRect(this.selectRef);
29217
29221
  state = owl.useState({
29218
29222
  isMenuOpen: false,
29219
29223
  });
29220
- onClick() {
29221
- this.state.isMenuOpen = true;
29224
+ onClick(ev) {
29225
+ if (ev.closedMenuId === this.menuId) {
29226
+ return;
29227
+ }
29228
+ this.state.isMenuOpen = !this.state.isMenuOpen;
29222
29229
  }
29223
29230
  onMenuClosed() {
29224
29231
  this.state.isMenuOpen = false;
@@ -29226,7 +29233,7 @@ class SelectMenu extends owl.Component {
29226
29233
  get menuPosition() {
29227
29234
  return {
29228
29235
  x: this.selectRect.x,
29229
- y: this.selectRect.y,
29236
+ y: this.selectRect.y + this.selectRect.height,
29230
29237
  };
29231
29238
  }
29232
29239
  }
@@ -30166,9 +30173,9 @@ class FindAndReplacePanel extends owl.Component {
30166
30173
  static props = {
30167
30174
  onCloseSidePanel: Function,
30168
30175
  };
30169
- dataRange = "";
30170
30176
  searchInput = owl.useRef("searchInput");
30171
30177
  store;
30178
+ state;
30172
30179
  get hasSearchResult() {
30173
30180
  return this.store.selectedMatchIndex !== null;
30174
30181
  }
@@ -30198,6 +30205,7 @@ class FindAndReplacePanel extends owl.Component {
30198
30205
  }
30199
30206
  setup() {
30200
30207
  this.store = useLocalStore(FindAndReplaceStore);
30208
+ this.state = owl.useState({ dataRange: "" });
30201
30209
  owl.onMounted(() => this.searchInput.el?.focus());
30202
30210
  }
30203
30211
  onFocusSearch() {
@@ -30234,13 +30242,13 @@ class FindAndReplacePanel extends owl.Component {
30234
30242
  this.store.updateSearchOptions({ searchScope });
30235
30243
  }
30236
30244
  onSearchRangeChanged(ranges) {
30237
- this.dataRange = ranges[0];
30245
+ this.state.dataRange = ranges[0];
30238
30246
  }
30239
30247
  updateDataRange() {
30240
- if (!this.dataRange || this.searchOptions.searchScope !== "specificRange") {
30248
+ if (!this.state.dataRange || this.searchOptions.searchScope !== "specificRange") {
30241
30249
  return;
30242
30250
  }
30243
- 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);
30244
30252
  this.store.updateSearchOptions({ specificRange });
30245
30253
  }
30246
30254
  }
@@ -33528,7 +33536,7 @@ class FiguresContainer extends owl.Component {
33528
33536
  });
33529
33537
  }
33530
33538
  getContainerRect(container) {
33531
- const { width: viewWidth, height: viewHeight } = this.env.model.getters.getMainViewportRect();
33539
+ const { width: viewWidth, height: viewHeight } = this.env.model.getters.getSheetViewDimension();
33532
33540
  const { x: viewportX, y: viewportY } = this.env.model.getters.getMainViewportCoordinates();
33533
33541
  const x = ["bottomRight", "topRight"].includes(container) ? viewportX : 0;
33534
33542
  const width = viewWidth - x;
@@ -50291,7 +50299,10 @@ class Session extends EventBus {
50291
50299
  /**
50292
50300
  * Notify the server that the user client left the collaborative session
50293
50301
  */
50294
- leave() {
50302
+ leave(data) {
50303
+ if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
50304
+ this.snapshot(data);
50305
+ }
50295
50306
  delete this.clients[this.clientId];
50296
50307
  this.transportService.leave(this.clientId);
50297
50308
  this.transportService.sendMessage({
@@ -50304,6 +50315,9 @@ class Session extends EventBus {
50304
50315
  * Send a snapshot of the spreadsheet to the collaboration server
50305
50316
  */
50306
50317
  snapshot(data) {
50318
+ if (this.pendingMessages.length !== 0) {
50319
+ return;
50320
+ }
50307
50321
  const snapshotId = this.uuidGenerator.uuidv4();
50308
50322
  this.transportService.sendMessage({
50309
50323
  type: "SNAPSHOT",
@@ -60216,7 +60230,7 @@ class Model extends EventBus {
60216
60230
  this.session.join(this.config.client);
60217
60231
  }
60218
60232
  leaveSession() {
60219
- this.session.leave();
60233
+ this.session.leave(this.exportData());
60220
60234
  }
60221
60235
  setupUiPlugin(Plugin) {
60222
60236
  const plugin = new Plugin(this.uiPluginConfig);
@@ -60770,6 +60784,6 @@ exports.tokenColors = tokenColors;
60770
60784
  exports.tokenize = tokenize;
60771
60785
 
60772
60786
 
60773
- __info__.version = "17.2.10";
60774
- __info__.date = "2024-06-10T09:38:54.354Z";
60775
- __info__.hash = "14317ee";
60787
+ __info__.version = "17.2.12";
60788
+ __info__.date = "2024-06-21T19:58:15.248Z";
60789
+ __info__.hash = "1aaacc4";
@@ -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.12
7
+ * @date 2024-06-21T19:58:15.248Z
8
+ * @hash 1aaacc4
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';
@@ -8879,10 +8879,8 @@ class ComposerStore extends SpreadsheetStore {
8879
8879
  const refRange = this.getters.getRangeFromSheetXC(activeSheetId, xc);
8880
8880
  return isEqual(this.getters.expandZone(activeSheetId, refRange.zone), oldZone);
8881
8881
  });
8882
- // this function assumes that the previous range is always found because
8883
- // it's called when changing a highlight, which exists by definition
8884
8882
  if (!previousRefToken) {
8885
- throw new Error("Previous range not found");
8883
+ return;
8886
8884
  }
8887
8885
  const previousRange = this.getters.getRangeFromSheetXC(activeSheetId, previousRefToken.value);
8888
8886
  this.selectionStart = previousRefToken.start;
@@ -21843,7 +21841,7 @@ class Popover extends Component {
21843
21841
  if (!anchor)
21844
21842
  return;
21845
21843
  const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
21846
- const elDims = {
21844
+ let elDims = {
21847
21845
  width: el.getBoundingClientRect().width,
21848
21846
  height: el.getBoundingClientRect().height,
21849
21847
  };
@@ -21851,7 +21849,14 @@ class Popover extends Component {
21851
21849
  const popoverPositionHelper = this.props.positioning === "BottomLeft"
21852
21850
  ? new BottomLeftPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect)
21853
21851
  : new TopRightPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect);
21854
- const style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21852
+ el.style["max-height"] = popoverPositionHelper.getMaxHeight(elDims.height) + "px";
21853
+ el.style["max-width"] = popoverPositionHelper.getMaxWidth(elDims.width) + "px";
21854
+ // Re-compute the dimensions after setting the max-width and max-height
21855
+ elDims = {
21856
+ width: el.getBoundingClientRect().width,
21857
+ height: el.getBoundingClientRect().height,
21858
+ };
21859
+ let style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21855
21860
  for (const property of Object.keys(style)) {
21856
21861
  el.style[property] = style[property];
21857
21862
  }
@@ -21914,8 +21919,6 @@ class PopoverPositionContext {
21914
21919
  const shouldRenderAtRight = this.shouldRenderAtRight(elDims.width);
21915
21920
  verticalOffset = shouldRenderAtBottom ? verticalOffset : -verticalOffset;
21916
21921
  const cssProperties = {
21917
- "max-height": maxHeight + "px",
21918
- "max-width": maxWidth + "px",
21919
21922
  top: this.getTopCoordinate(actualHeight, shouldRenderAtBottom) -
21920
21923
  this.spreadsheetOffset.y -
21921
21924
  verticalOffset +
@@ -29210,13 +29213,17 @@ class SelectMenu extends Component {
29210
29213
  class: { type: String, optional: true },
29211
29214
  };
29212
29215
  static components = { Menu };
29216
+ menuId = new UuidGenerator().uuidv4();
29213
29217
  selectRef = useRef("select");
29214
29218
  selectRect = useAbsoluteBoundingRect(this.selectRef);
29215
29219
  state = useState({
29216
29220
  isMenuOpen: false,
29217
29221
  });
29218
- onClick() {
29219
- this.state.isMenuOpen = true;
29222
+ onClick(ev) {
29223
+ if (ev.closedMenuId === this.menuId) {
29224
+ return;
29225
+ }
29226
+ this.state.isMenuOpen = !this.state.isMenuOpen;
29220
29227
  }
29221
29228
  onMenuClosed() {
29222
29229
  this.state.isMenuOpen = false;
@@ -29224,7 +29231,7 @@ class SelectMenu extends Component {
29224
29231
  get menuPosition() {
29225
29232
  return {
29226
29233
  x: this.selectRect.x,
29227
- y: this.selectRect.y,
29234
+ y: this.selectRect.y + this.selectRect.height,
29228
29235
  };
29229
29236
  }
29230
29237
  }
@@ -30164,9 +30171,9 @@ class FindAndReplacePanel extends Component {
30164
30171
  static props = {
30165
30172
  onCloseSidePanel: Function,
30166
30173
  };
30167
- dataRange = "";
30168
30174
  searchInput = useRef("searchInput");
30169
30175
  store;
30176
+ state;
30170
30177
  get hasSearchResult() {
30171
30178
  return this.store.selectedMatchIndex !== null;
30172
30179
  }
@@ -30196,6 +30203,7 @@ class FindAndReplacePanel extends Component {
30196
30203
  }
30197
30204
  setup() {
30198
30205
  this.store = useLocalStore(FindAndReplaceStore);
30206
+ this.state = useState({ dataRange: "" });
30199
30207
  onMounted(() => this.searchInput.el?.focus());
30200
30208
  }
30201
30209
  onFocusSearch() {
@@ -30232,13 +30240,13 @@ class FindAndReplacePanel extends Component {
30232
30240
  this.store.updateSearchOptions({ searchScope });
30233
30241
  }
30234
30242
  onSearchRangeChanged(ranges) {
30235
- this.dataRange = ranges[0];
30243
+ this.state.dataRange = ranges[0];
30236
30244
  }
30237
30245
  updateDataRange() {
30238
- if (!this.dataRange || this.searchOptions.searchScope !== "specificRange") {
30246
+ if (!this.state.dataRange || this.searchOptions.searchScope !== "specificRange") {
30239
30247
  return;
30240
30248
  }
30241
- const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.dataRange);
30249
+ const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
30242
30250
  this.store.updateSearchOptions({ specificRange });
30243
30251
  }
30244
30252
  }
@@ -33526,7 +33534,7 @@ class FiguresContainer extends Component {
33526
33534
  });
33527
33535
  }
33528
33536
  getContainerRect(container) {
33529
- const { width: viewWidth, height: viewHeight } = this.env.model.getters.getMainViewportRect();
33537
+ const { width: viewWidth, height: viewHeight } = this.env.model.getters.getSheetViewDimension();
33530
33538
  const { x: viewportX, y: viewportY } = this.env.model.getters.getMainViewportCoordinates();
33531
33539
  const x = ["bottomRight", "topRight"].includes(container) ? viewportX : 0;
33532
33540
  const width = viewWidth - x;
@@ -50289,7 +50297,10 @@ class Session extends EventBus {
50289
50297
  /**
50290
50298
  * Notify the server that the user client left the collaborative session
50291
50299
  */
50292
- leave() {
50300
+ leave(data) {
50301
+ if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
50302
+ this.snapshot(data);
50303
+ }
50293
50304
  delete this.clients[this.clientId];
50294
50305
  this.transportService.leave(this.clientId);
50295
50306
  this.transportService.sendMessage({
@@ -50302,6 +50313,9 @@ class Session extends EventBus {
50302
50313
  * Send a snapshot of the spreadsheet to the collaboration server
50303
50314
  */
50304
50315
  snapshot(data) {
50316
+ if (this.pendingMessages.length !== 0) {
50317
+ return;
50318
+ }
50305
50319
  const snapshotId = this.uuidGenerator.uuidv4();
50306
50320
  this.transportService.sendMessage({
50307
50321
  type: "SNAPSHOT",
@@ -60214,7 +60228,7 @@ class Model extends EventBus {
60214
60228
  this.session.join(this.config.client);
60215
60229
  }
60216
60230
  leaveSession() {
60217
- this.session.leave();
60231
+ this.session.leave(this.exportData());
60218
60232
  }
60219
60233
  setupUiPlugin(Plugin) {
60220
60234
  const plugin = new Plugin(this.uiPluginConfig);
@@ -60727,6 +60741,6 @@ const constants = {
60727
60741
  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
60742
 
60729
60743
 
60730
- __info__.version = "17.2.10";
60731
- __info__.date = "2024-06-10T09:38:54.354Z";
60732
- __info__.hash = "14317ee";
60744
+ __info__.version = "17.2.12";
60745
+ __info__.date = "2024-06-21T19:58:15.248Z";
60746
+ __info__.hash = "1aaacc4";
@@ -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.12
7
+ * @date 2024-06-21T19:58:15.248Z
8
+ * @hash 1aaacc4
9
9
  */
10
10
 
11
11
  (function (exports, owl) {
@@ -8880,10 +8880,8 @@ stores.inject(MyMetaStore, storeInstance);
8880
8880
  const refRange = this.getters.getRangeFromSheetXC(activeSheetId, xc);
8881
8881
  return isEqual(this.getters.expandZone(activeSheetId, refRange.zone), oldZone);
8882
8882
  });
8883
- // this function assumes that the previous range is always found because
8884
- // it's called when changing a highlight, which exists by definition
8885
8883
  if (!previousRefToken) {
8886
- throw new Error("Previous range not found");
8884
+ return;
8887
8885
  }
8888
8886
  const previousRange = this.getters.getRangeFromSheetXC(activeSheetId, previousRefToken.value);
8889
8887
  this.selectionStart = previousRefToken.start;
@@ -21844,7 +21842,7 @@ stores.inject(MyMetaStore, storeInstance);
21844
21842
  if (!anchor)
21845
21843
  return;
21846
21844
  const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
21847
- const elDims = {
21845
+ let elDims = {
21848
21846
  width: el.getBoundingClientRect().width,
21849
21847
  height: el.getBoundingClientRect().height,
21850
21848
  };
@@ -21852,7 +21850,14 @@ stores.inject(MyMetaStore, storeInstance);
21852
21850
  const popoverPositionHelper = this.props.positioning === "BottomLeft"
21853
21851
  ? new BottomLeftPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect)
21854
21852
  : new TopRightPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect);
21855
- const style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21853
+ el.style["max-height"] = popoverPositionHelper.getMaxHeight(elDims.height) + "px";
21854
+ el.style["max-width"] = popoverPositionHelper.getMaxWidth(elDims.width) + "px";
21855
+ // Re-compute the dimensions after setting the max-width and max-height
21856
+ elDims = {
21857
+ width: el.getBoundingClientRect().width,
21858
+ height: el.getBoundingClientRect().height,
21859
+ };
21860
+ let style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
21856
21861
  for (const property of Object.keys(style)) {
21857
21862
  el.style[property] = style[property];
21858
21863
  }
@@ -21915,8 +21920,6 @@ stores.inject(MyMetaStore, storeInstance);
21915
21920
  const shouldRenderAtRight = this.shouldRenderAtRight(elDims.width);
21916
21921
  verticalOffset = shouldRenderAtBottom ? verticalOffset : -verticalOffset;
21917
21922
  const cssProperties = {
21918
- "max-height": maxHeight + "px",
21919
- "max-width": maxWidth + "px",
21920
21923
  top: this.getTopCoordinate(actualHeight, shouldRenderAtBottom) -
21921
21924
  this.spreadsheetOffset.y -
21922
21925
  verticalOffset +
@@ -29211,13 +29214,17 @@ stores.inject(MyMetaStore, storeInstance);
29211
29214
  class: { type: String, optional: true },
29212
29215
  };
29213
29216
  static components = { Menu };
29217
+ menuId = new UuidGenerator().uuidv4();
29214
29218
  selectRef = owl.useRef("select");
29215
29219
  selectRect = useAbsoluteBoundingRect(this.selectRef);
29216
29220
  state = owl.useState({
29217
29221
  isMenuOpen: false,
29218
29222
  });
29219
- onClick() {
29220
- this.state.isMenuOpen = true;
29223
+ onClick(ev) {
29224
+ if (ev.closedMenuId === this.menuId) {
29225
+ return;
29226
+ }
29227
+ this.state.isMenuOpen = !this.state.isMenuOpen;
29221
29228
  }
29222
29229
  onMenuClosed() {
29223
29230
  this.state.isMenuOpen = false;
@@ -29225,7 +29232,7 @@ stores.inject(MyMetaStore, storeInstance);
29225
29232
  get menuPosition() {
29226
29233
  return {
29227
29234
  x: this.selectRect.x,
29228
- y: this.selectRect.y,
29235
+ y: this.selectRect.y + this.selectRect.height,
29229
29236
  };
29230
29237
  }
29231
29238
  }
@@ -30165,9 +30172,9 @@ stores.inject(MyMetaStore, storeInstance);
30165
30172
  static props = {
30166
30173
  onCloseSidePanel: Function,
30167
30174
  };
30168
- dataRange = "";
30169
30175
  searchInput = owl.useRef("searchInput");
30170
30176
  store;
30177
+ state;
30171
30178
  get hasSearchResult() {
30172
30179
  return this.store.selectedMatchIndex !== null;
30173
30180
  }
@@ -30197,6 +30204,7 @@ stores.inject(MyMetaStore, storeInstance);
30197
30204
  }
30198
30205
  setup() {
30199
30206
  this.store = useLocalStore(FindAndReplaceStore);
30207
+ this.state = owl.useState({ dataRange: "" });
30200
30208
  owl.onMounted(() => this.searchInput.el?.focus());
30201
30209
  }
30202
30210
  onFocusSearch() {
@@ -30233,13 +30241,13 @@ stores.inject(MyMetaStore, storeInstance);
30233
30241
  this.store.updateSearchOptions({ searchScope });
30234
30242
  }
30235
30243
  onSearchRangeChanged(ranges) {
30236
- this.dataRange = ranges[0];
30244
+ this.state.dataRange = ranges[0];
30237
30245
  }
30238
30246
  updateDataRange() {
30239
- if (!this.dataRange || this.searchOptions.searchScope !== "specificRange") {
30247
+ if (!this.state.dataRange || this.searchOptions.searchScope !== "specificRange") {
30240
30248
  return;
30241
30249
  }
30242
- const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.dataRange);
30250
+ const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
30243
30251
  this.store.updateSearchOptions({ specificRange });
30244
30252
  }
30245
30253
  }
@@ -33527,7 +33535,7 @@ stores.inject(MyMetaStore, storeInstance);
33527
33535
  });
33528
33536
  }
33529
33537
  getContainerRect(container) {
33530
- const { width: viewWidth, height: viewHeight } = this.env.model.getters.getMainViewportRect();
33538
+ const { width: viewWidth, height: viewHeight } = this.env.model.getters.getSheetViewDimension();
33531
33539
  const { x: viewportX, y: viewportY } = this.env.model.getters.getMainViewportCoordinates();
33532
33540
  const x = ["bottomRight", "topRight"].includes(container) ? viewportX : 0;
33533
33541
  const width = viewWidth - x;
@@ -50290,7 +50298,10 @@ stores.inject(MyMetaStore, storeInstance);
50290
50298
  /**
50291
50299
  * Notify the server that the user client left the collaborative session
50292
50300
  */
50293
- leave() {
50301
+ leave(data) {
50302
+ if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
50303
+ this.snapshot(data);
50304
+ }
50294
50305
  delete this.clients[this.clientId];
50295
50306
  this.transportService.leave(this.clientId);
50296
50307
  this.transportService.sendMessage({
@@ -50303,6 +50314,9 @@ stores.inject(MyMetaStore, storeInstance);
50303
50314
  * Send a snapshot of the spreadsheet to the collaboration server
50304
50315
  */
50305
50316
  snapshot(data) {
50317
+ if (this.pendingMessages.length !== 0) {
50318
+ return;
50319
+ }
50306
50320
  const snapshotId = this.uuidGenerator.uuidv4();
50307
50321
  this.transportService.sendMessage({
50308
50322
  type: "SNAPSHOT",
@@ -60215,7 +60229,7 @@ stores.inject(MyMetaStore, storeInstance);
60215
60229
  this.session.join(this.config.client);
60216
60230
  }
60217
60231
  leaveSession() {
60218
- this.session.leave();
60232
+ this.session.leave(this.exportData());
60219
60233
  }
60220
60234
  setupUiPlugin(Plugin) {
60221
60235
  const plugin = new Plugin(this.uiPluginConfig);
@@ -60769,9 +60783,9 @@ stores.inject(MyMetaStore, storeInstance);
60769
60783
  exports.tokenize = tokenize;
60770
60784
 
60771
60785
 
60772
- __info__.version = "17.2.10";
60773
- __info__.date = "2024-06-10T09:38:54.354Z";
60774
- __info__.hash = "14317ee";
60786
+ __info__.version = "17.2.12";
60787
+ __info__.date = "2024-06-21T19:58:15.248Z";
60788
+ __info__.hash = "1aaacc4";
60775
60789
 
60776
60790
 
60777
60791
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);