@odoo/o-spreadsheet 17.4.12 → 17.4.13

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 17.4.12
6
- * @date 2024-11-13T15:06:56.109Z
7
- * @hash 5cde4be
5
+ * @version 17.4.13
6
+ * @date 2024-11-22T14:17:01.675Z
7
+ * @hash a5e4e16
8
8
  */
9
9
 
10
10
  'use strict';
@@ -3136,7 +3136,9 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
3136
3136
  return reverseSearch ? numberOfValues - i - 1 : i;
3137
3137
  }
3138
3138
  }
3139
- return reverseSearch ? numberOfValues - closestMatchIndex - 1 : closestMatchIndex;
3139
+ return reverseSearch && closestMatchIndex !== -1
3140
+ ? numberOfValues - closestMatchIndex - 1
3141
+ : closestMatchIndex;
3140
3142
  }
3141
3143
  /**
3142
3144
  * Normalize a value.
@@ -54281,6 +54283,9 @@ class Evaluator {
54281
54283
  }
54282
54284
  for (let i = 0; i < positions.length; ++i) {
54283
54285
  const position = positions[i];
54286
+ if (this.nextPositionsToUpdate.has(position)) {
54287
+ continue;
54288
+ }
54284
54289
  const evaluatedCell = this.computeCell(position);
54285
54290
  if (evaluatedCell !== EMPTY_CELL) {
54286
54291
  this.evaluatedCells.set(position, evaluatedCell);
@@ -54288,6 +54293,9 @@ class Evaluator {
54288
54293
  }
54289
54294
  onIterationEndEvaluationRegistry.getAll().forEach((callback) => callback(this.getters));
54290
54295
  }
54296
+ if (currentIteration >= MAX_ITERATION) {
54297
+ console.warn("Maximum iteration reached while evaluating cells");
54298
+ }
54291
54299
  }
54292
54300
  computeCell(position) {
54293
54301
  const evaluation = this.evaluatedCells.get(position);
@@ -54322,7 +54330,6 @@ class Evaluator {
54322
54330
  }
54323
54331
  finally {
54324
54332
  this.cellsBeingComputed.delete(cellId);
54325
- this.nextPositionsToUpdate.delete(position);
54326
54333
  }
54327
54334
  }
54328
54335
  computeAndSave(position) {
@@ -54373,6 +54380,7 @@ class Evaluator {
54373
54380
  { sheetId, zone: rightPartZone },
54374
54381
  { sheetId, zone: leftColumnZone },
54375
54382
  ]);
54383
+ invalidatedPositions.delete(arrayFormulaPosition);
54376
54384
  this.nextPositionsToUpdate.addMany(invalidatedPositions);
54377
54385
  }
54378
54386
  assertSheetHasEnoughSpaceToSpreadFormulaResult({ sheetId, col, row }, matrixResult) {
@@ -55431,25 +55439,11 @@ class EvaluationDataValidationPlugin extends UIPlugin {
55431
55439
  }
55432
55440
  switch (cmd.type) {
55433
55441
  case "ADD_DATA_VALIDATION_RULE":
55434
- const ranges = cmd.ranges.map((range) => this.getters.getRangeFromRangeData(range));
55435
- if (cmd.rule.criterion.type === "isBoolean") {
55436
- this.setContentToBooleanCells({ ...cmd.rule, ranges });
55437
- }
55438
- delete this.validationResults[cmd.sheetId];
55439
- break;
55440
55442
  case "REMOVE_DATA_VALIDATION_RULE":
55441
55443
  delete this.validationResults[cmd.sheetId];
55442
55444
  break;
55443
55445
  }
55444
55446
  }
55445
- setContentToBooleanCells(rule) {
55446
- for (const position of getCellPositionsInRanges(rule.ranges)) {
55447
- const evaluatedCell = this.getters.getEvaluatedCell(position);
55448
- if (evaluatedCell.type !== CellValueType.boolean) {
55449
- this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
55450
- }
55451
- }
55452
- }
55453
55447
  isDataValidationInvalid(cellPosition) {
55454
55448
  return !this.getValidationResultForCell(cellPosition).isValid;
55455
55449
  }
@@ -57381,7 +57375,7 @@ class Session extends EventBus {
57381
57375
  * Notify the server that the user client left the collaborative session
57382
57376
  */
57383
57377
  async leave(data) {
57384
- if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
57378
+ if (data && Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
57385
57379
  await this.snapshot(data());
57386
57380
  }
57387
57381
  delete this.clients[this.clientId];
@@ -58852,6 +58846,42 @@ class CellComputedStylePlugin extends UIPlugin {
58852
58846
  }
58853
58847
  }
58854
58848
 
58849
+ class DataValidationInsertionPlugin extends UIPlugin {
58850
+ handle(cmd) {
58851
+ switch (cmd.type) {
58852
+ case "ADD_DATA_VALIDATION_RULE":
58853
+ if (cmd.rule.criterion.type === "isBoolean") {
58854
+ const ranges = cmd.ranges.map((range) => this.getters.getRangeFromRangeData(range));
58855
+ for (const position of getCellPositionsInRanges(ranges)) {
58856
+ const cell = this.getters.getCell(position);
58857
+ const evaluatedCell = this.getters.getEvaluatedCell(position);
58858
+ if (!cell?.content) {
58859
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58860
+ // In this case, a cell has been updated in the core plugin but
58861
+ // not yet evaluated. This can occur after a paste operation.
58862
+ }
58863
+ else if (cell?.content && evaluatedCell.type === CellValueType.empty) {
58864
+ let value;
58865
+ if (cell.content.startsWith("=")) {
58866
+ const result = this.getters.evaluateFormula(position.sheetId, cell.content);
58867
+ value = (isMatrix(result) ? result[0][0] : result)?.toString();
58868
+ }
58869
+ else {
58870
+ value = cell.content;
58871
+ }
58872
+ if (!value || !isBoolean(value)) {
58873
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58874
+ }
58875
+ }
58876
+ else if (evaluatedCell.type !== CellValueType.boolean) {
58877
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58878
+ }
58879
+ }
58880
+ }
58881
+ }
58882
+ }
58883
+ }
58884
+
58855
58885
  const genericRepeatsTransforms = [
58856
58886
  repeatSheetDependantCommand,
58857
58887
  repeatTargetDependantCommand,
@@ -61917,7 +61947,8 @@ const featurePluginRegistry = new Registry()
61917
61947
  .add("history", HistoryPlugin)
61918
61948
  .add("data_cleanup", DataCleanupPlugin)
61919
61949
  .add("table_autofill", TableAutofillPlugin)
61920
- .add("table_ui_resize", TableResizeUI);
61950
+ .add("table_ui_resize", TableResizeUI)
61951
+ .add("datavalidation_insert", DataValidationInsertionPlugin);
61921
61952
  // Plugins which have a state, but which should not be shared in collaborative
61922
61953
  const statefulUIPluginRegistry = new Registry()
61923
61954
  .add("selection", GridSelectionPlugin)
@@ -68079,7 +68110,8 @@ class Model extends EventBus {
68079
68110
  this.session.join(this.config.client);
68080
68111
  }
68081
68112
  async leaveSession() {
68082
- await this.session.leave(lazy(() => this.exportData()));
68113
+ const snapshot = this.getters.isReadonly() ? undefined : lazy(() => this.exportData());
68114
+ await this.session.leave(snapshot);
68083
68115
  }
68084
68116
  setupUiPlugin(Plugin) {
68085
68117
  const plugin = new Plugin(this.uiPluginConfig);
@@ -68682,6 +68714,6 @@ exports.tokenColors = tokenColors;
68682
68714
  exports.tokenize = tokenize;
68683
68715
 
68684
68716
 
68685
- __info__.version = "17.4.12";
68686
- __info__.date = "2024-11-13T15:06:56.109Z";
68687
- __info__.hash = "5cde4be";
68717
+ __info__.version = "17.4.13";
68718
+ __info__.date = "2024-11-22T14:17:01.675Z";
68719
+ __info__.hash = "a5e4e16";
@@ -3868,7 +3868,7 @@ declare class Session extends EventBus<CollaborativeEvent> {
3868
3868
  /**
3869
3869
  * Notify the server that the user client left the collaborative session
3870
3870
  */
3871
- leave(data: Lazy<WorkbookData>): Promise<void>;
3871
+ leave(data?: Lazy<WorkbookData>): Promise<void>;
3872
3872
  /**
3873
3873
  * Send a snapshot of the spreadsheet to the collaboration server
3874
3874
  */
@@ -4128,7 +4128,6 @@ declare class EvaluationDataValidationPlugin extends UIPlugin {
4128
4128
  static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "getInvalidDataValidationMessage", "getValidationResultForCellValue", "isCellValidCheckbox", "isDataValidationInvalid"];
4129
4129
  validationResults: Record<UID, SheetValidationResult>;
4130
4130
  handle(cmd: CoreViewCommand): void;
4131
- private setContentToBooleanCells;
4132
4131
  isDataValidationInvalid(cellPosition: CellPosition): boolean;
4133
4132
  getInvalidDataValidationMessage(cellPosition: CellPosition): string | undefined;
4134
4133
  /**
@@ -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 17.4.12
6
- * @date 2024-11-13T15:06:56.109Z
7
- * @hash 5cde4be
5
+ * @version 17.4.13
6
+ * @date 2024-11-22T14:17:01.675Z
7
+ * @hash a5e4e16
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -3134,7 +3134,9 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
3134
3134
  return reverseSearch ? numberOfValues - i - 1 : i;
3135
3135
  }
3136
3136
  }
3137
- return reverseSearch ? numberOfValues - closestMatchIndex - 1 : closestMatchIndex;
3137
+ return reverseSearch && closestMatchIndex !== -1
3138
+ ? numberOfValues - closestMatchIndex - 1
3139
+ : closestMatchIndex;
3138
3140
  }
3139
3141
  /**
3140
3142
  * Normalize a value.
@@ -54279,6 +54281,9 @@ class Evaluator {
54279
54281
  }
54280
54282
  for (let i = 0; i < positions.length; ++i) {
54281
54283
  const position = positions[i];
54284
+ if (this.nextPositionsToUpdate.has(position)) {
54285
+ continue;
54286
+ }
54282
54287
  const evaluatedCell = this.computeCell(position);
54283
54288
  if (evaluatedCell !== EMPTY_CELL) {
54284
54289
  this.evaluatedCells.set(position, evaluatedCell);
@@ -54286,6 +54291,9 @@ class Evaluator {
54286
54291
  }
54287
54292
  onIterationEndEvaluationRegistry.getAll().forEach((callback) => callback(this.getters));
54288
54293
  }
54294
+ if (currentIteration >= MAX_ITERATION) {
54295
+ console.warn("Maximum iteration reached while evaluating cells");
54296
+ }
54289
54297
  }
54290
54298
  computeCell(position) {
54291
54299
  const evaluation = this.evaluatedCells.get(position);
@@ -54320,7 +54328,6 @@ class Evaluator {
54320
54328
  }
54321
54329
  finally {
54322
54330
  this.cellsBeingComputed.delete(cellId);
54323
- this.nextPositionsToUpdate.delete(position);
54324
54331
  }
54325
54332
  }
54326
54333
  computeAndSave(position) {
@@ -54371,6 +54378,7 @@ class Evaluator {
54371
54378
  { sheetId, zone: rightPartZone },
54372
54379
  { sheetId, zone: leftColumnZone },
54373
54380
  ]);
54381
+ invalidatedPositions.delete(arrayFormulaPosition);
54374
54382
  this.nextPositionsToUpdate.addMany(invalidatedPositions);
54375
54383
  }
54376
54384
  assertSheetHasEnoughSpaceToSpreadFormulaResult({ sheetId, col, row }, matrixResult) {
@@ -55429,25 +55437,11 @@ class EvaluationDataValidationPlugin extends UIPlugin {
55429
55437
  }
55430
55438
  switch (cmd.type) {
55431
55439
  case "ADD_DATA_VALIDATION_RULE":
55432
- const ranges = cmd.ranges.map((range) => this.getters.getRangeFromRangeData(range));
55433
- if (cmd.rule.criterion.type === "isBoolean") {
55434
- this.setContentToBooleanCells({ ...cmd.rule, ranges });
55435
- }
55436
- delete this.validationResults[cmd.sheetId];
55437
- break;
55438
55440
  case "REMOVE_DATA_VALIDATION_RULE":
55439
55441
  delete this.validationResults[cmd.sheetId];
55440
55442
  break;
55441
55443
  }
55442
55444
  }
55443
- setContentToBooleanCells(rule) {
55444
- for (const position of getCellPositionsInRanges(rule.ranges)) {
55445
- const evaluatedCell = this.getters.getEvaluatedCell(position);
55446
- if (evaluatedCell.type !== CellValueType.boolean) {
55447
- this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
55448
- }
55449
- }
55450
- }
55451
55445
  isDataValidationInvalid(cellPosition) {
55452
55446
  return !this.getValidationResultForCell(cellPosition).isValid;
55453
55447
  }
@@ -57379,7 +57373,7 @@ class Session extends EventBus {
57379
57373
  * Notify the server that the user client left the collaborative session
57380
57374
  */
57381
57375
  async leave(data) {
57382
- if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
57376
+ if (data && Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
57383
57377
  await this.snapshot(data());
57384
57378
  }
57385
57379
  delete this.clients[this.clientId];
@@ -58850,6 +58844,42 @@ class CellComputedStylePlugin extends UIPlugin {
58850
58844
  }
58851
58845
  }
58852
58846
 
58847
+ class DataValidationInsertionPlugin extends UIPlugin {
58848
+ handle(cmd) {
58849
+ switch (cmd.type) {
58850
+ case "ADD_DATA_VALIDATION_RULE":
58851
+ if (cmd.rule.criterion.type === "isBoolean") {
58852
+ const ranges = cmd.ranges.map((range) => this.getters.getRangeFromRangeData(range));
58853
+ for (const position of getCellPositionsInRanges(ranges)) {
58854
+ const cell = this.getters.getCell(position);
58855
+ const evaluatedCell = this.getters.getEvaluatedCell(position);
58856
+ if (!cell?.content) {
58857
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58858
+ // In this case, a cell has been updated in the core plugin but
58859
+ // not yet evaluated. This can occur after a paste operation.
58860
+ }
58861
+ else if (cell?.content && evaluatedCell.type === CellValueType.empty) {
58862
+ let value;
58863
+ if (cell.content.startsWith("=")) {
58864
+ const result = this.getters.evaluateFormula(position.sheetId, cell.content);
58865
+ value = (isMatrix(result) ? result[0][0] : result)?.toString();
58866
+ }
58867
+ else {
58868
+ value = cell.content;
58869
+ }
58870
+ if (!value || !isBoolean(value)) {
58871
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58872
+ }
58873
+ }
58874
+ else if (evaluatedCell.type !== CellValueType.boolean) {
58875
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58876
+ }
58877
+ }
58878
+ }
58879
+ }
58880
+ }
58881
+ }
58882
+
58853
58883
  const genericRepeatsTransforms = [
58854
58884
  repeatSheetDependantCommand,
58855
58885
  repeatTargetDependantCommand,
@@ -61915,7 +61945,8 @@ const featurePluginRegistry = new Registry()
61915
61945
  .add("history", HistoryPlugin)
61916
61946
  .add("data_cleanup", DataCleanupPlugin)
61917
61947
  .add("table_autofill", TableAutofillPlugin)
61918
- .add("table_ui_resize", TableResizeUI);
61948
+ .add("table_ui_resize", TableResizeUI)
61949
+ .add("datavalidation_insert", DataValidationInsertionPlugin);
61919
61950
  // Plugins which have a state, but which should not be shared in collaborative
61920
61951
  const statefulUIPluginRegistry = new Registry()
61921
61952
  .add("selection", GridSelectionPlugin)
@@ -68077,7 +68108,8 @@ class Model extends EventBus {
68077
68108
  this.session.join(this.config.client);
68078
68109
  }
68079
68110
  async leaveSession() {
68080
- await this.session.leave(lazy(() => this.exportData()));
68111
+ const snapshot = this.getters.isReadonly() ? undefined : lazy(() => this.exportData());
68112
+ await this.session.leave(snapshot);
68081
68113
  }
68082
68114
  setupUiPlugin(Plugin) {
68083
68115
  const plugin = new Plugin(this.uiPluginConfig);
@@ -68637,6 +68669,6 @@ const constants = {
68637
68669
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, 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 };
68638
68670
 
68639
68671
 
68640
- __info__.version = "17.4.12";
68641
- __info__.date = "2024-11-13T15:06:56.109Z";
68642
- __info__.hash = "5cde4be";
68672
+ __info__.version = "17.4.13";
68673
+ __info__.date = "2024-11-22T14:17:01.675Z";
68674
+ __info__.hash = "a5e4e16";
@@ -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 17.4.12
6
- * @date 2024-11-13T15:06:56.109Z
7
- * @hash 5cde4be
5
+ * @version 17.4.13
6
+ * @date 2024-11-22T14:17:01.675Z
7
+ * @hash a5e4e16
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -3135,7 +3135,9 @@
3135
3135
  return reverseSearch ? numberOfValues - i - 1 : i;
3136
3136
  }
3137
3137
  }
3138
- return reverseSearch ? numberOfValues - closestMatchIndex - 1 : closestMatchIndex;
3138
+ return reverseSearch && closestMatchIndex !== -1
3139
+ ? numberOfValues - closestMatchIndex - 1
3140
+ : closestMatchIndex;
3139
3141
  }
3140
3142
  /**
3141
3143
  * Normalize a value.
@@ -54280,6 +54282,9 @@ stores.inject(MyMetaStore, storeInstance);
54280
54282
  }
54281
54283
  for (let i = 0; i < positions.length; ++i) {
54282
54284
  const position = positions[i];
54285
+ if (this.nextPositionsToUpdate.has(position)) {
54286
+ continue;
54287
+ }
54283
54288
  const evaluatedCell = this.computeCell(position);
54284
54289
  if (evaluatedCell !== EMPTY_CELL) {
54285
54290
  this.evaluatedCells.set(position, evaluatedCell);
@@ -54287,6 +54292,9 @@ stores.inject(MyMetaStore, storeInstance);
54287
54292
  }
54288
54293
  onIterationEndEvaluationRegistry.getAll().forEach((callback) => callback(this.getters));
54289
54294
  }
54295
+ if (currentIteration >= MAX_ITERATION) {
54296
+ console.warn("Maximum iteration reached while evaluating cells");
54297
+ }
54290
54298
  }
54291
54299
  computeCell(position) {
54292
54300
  const evaluation = this.evaluatedCells.get(position);
@@ -54321,7 +54329,6 @@ stores.inject(MyMetaStore, storeInstance);
54321
54329
  }
54322
54330
  finally {
54323
54331
  this.cellsBeingComputed.delete(cellId);
54324
- this.nextPositionsToUpdate.delete(position);
54325
54332
  }
54326
54333
  }
54327
54334
  computeAndSave(position) {
@@ -54372,6 +54379,7 @@ stores.inject(MyMetaStore, storeInstance);
54372
54379
  { sheetId, zone: rightPartZone },
54373
54380
  { sheetId, zone: leftColumnZone },
54374
54381
  ]);
54382
+ invalidatedPositions.delete(arrayFormulaPosition);
54375
54383
  this.nextPositionsToUpdate.addMany(invalidatedPositions);
54376
54384
  }
54377
54385
  assertSheetHasEnoughSpaceToSpreadFormulaResult({ sheetId, col, row }, matrixResult) {
@@ -55430,25 +55438,11 @@ stores.inject(MyMetaStore, storeInstance);
55430
55438
  }
55431
55439
  switch (cmd.type) {
55432
55440
  case "ADD_DATA_VALIDATION_RULE":
55433
- const ranges = cmd.ranges.map((range) => this.getters.getRangeFromRangeData(range));
55434
- if (cmd.rule.criterion.type === "isBoolean") {
55435
- this.setContentToBooleanCells({ ...cmd.rule, ranges });
55436
- }
55437
- delete this.validationResults[cmd.sheetId];
55438
- break;
55439
55441
  case "REMOVE_DATA_VALIDATION_RULE":
55440
55442
  delete this.validationResults[cmd.sheetId];
55441
55443
  break;
55442
55444
  }
55443
55445
  }
55444
- setContentToBooleanCells(rule) {
55445
- for (const position of getCellPositionsInRanges(rule.ranges)) {
55446
- const evaluatedCell = this.getters.getEvaluatedCell(position);
55447
- if (evaluatedCell.type !== CellValueType.boolean) {
55448
- this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
55449
- }
55450
- }
55451
- }
55452
55446
  isDataValidationInvalid(cellPosition) {
55453
55447
  return !this.getValidationResultForCell(cellPosition).isValid;
55454
55448
  }
@@ -57380,7 +57374,7 @@ stores.inject(MyMetaStore, storeInstance);
57380
57374
  * Notify the server that the user client left the collaborative session
57381
57375
  */
57382
57376
  async leave(data) {
57383
- if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
57377
+ if (data && Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
57384
57378
  await this.snapshot(data());
57385
57379
  }
57386
57380
  delete this.clients[this.clientId];
@@ -58851,6 +58845,42 @@ stores.inject(MyMetaStore, storeInstance);
58851
58845
  }
58852
58846
  }
58853
58847
 
58848
+ class DataValidationInsertionPlugin extends UIPlugin {
58849
+ handle(cmd) {
58850
+ switch (cmd.type) {
58851
+ case "ADD_DATA_VALIDATION_RULE":
58852
+ if (cmd.rule.criterion.type === "isBoolean") {
58853
+ const ranges = cmd.ranges.map((range) => this.getters.getRangeFromRangeData(range));
58854
+ for (const position of getCellPositionsInRanges(ranges)) {
58855
+ const cell = this.getters.getCell(position);
58856
+ const evaluatedCell = this.getters.getEvaluatedCell(position);
58857
+ if (!cell?.content) {
58858
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58859
+ // In this case, a cell has been updated in the core plugin but
58860
+ // not yet evaluated. This can occur after a paste operation.
58861
+ }
58862
+ else if (cell?.content && evaluatedCell.type === CellValueType.empty) {
58863
+ let value;
58864
+ if (cell.content.startsWith("=")) {
58865
+ const result = this.getters.evaluateFormula(position.sheetId, cell.content);
58866
+ value = (isMatrix(result) ? result[0][0] : result)?.toString();
58867
+ }
58868
+ else {
58869
+ value = cell.content;
58870
+ }
58871
+ if (!value || !isBoolean(value)) {
58872
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58873
+ }
58874
+ }
58875
+ else if (evaluatedCell.type !== CellValueType.boolean) {
58876
+ this.dispatch("UPDATE_CELL", { ...position, content: "FALSE" });
58877
+ }
58878
+ }
58879
+ }
58880
+ }
58881
+ }
58882
+ }
58883
+
58854
58884
  const genericRepeatsTransforms = [
58855
58885
  repeatSheetDependantCommand,
58856
58886
  repeatTargetDependantCommand,
@@ -61916,7 +61946,8 @@ stores.inject(MyMetaStore, storeInstance);
61916
61946
  .add("history", HistoryPlugin)
61917
61947
  .add("data_cleanup", DataCleanupPlugin)
61918
61948
  .add("table_autofill", TableAutofillPlugin)
61919
- .add("table_ui_resize", TableResizeUI);
61949
+ .add("table_ui_resize", TableResizeUI)
61950
+ .add("datavalidation_insert", DataValidationInsertionPlugin);
61920
61951
  // Plugins which have a state, but which should not be shared in collaborative
61921
61952
  const statefulUIPluginRegistry = new Registry()
61922
61953
  .add("selection", GridSelectionPlugin)
@@ -68078,7 +68109,8 @@ stores.inject(MyMetaStore, storeInstance);
68078
68109
  this.session.join(this.config.client);
68079
68110
  }
68080
68111
  async leaveSession() {
68081
- await this.session.leave(lazy(() => this.exportData()));
68112
+ const snapshot = this.getters.isReadonly() ? undefined : lazy(() => this.exportData());
68113
+ await this.session.leave(snapshot);
68082
68114
  }
68083
68115
  setupUiPlugin(Plugin) {
68084
68116
  const plugin = new Plugin(this.uiPluginConfig);
@@ -68681,9 +68713,9 @@ stores.inject(MyMetaStore, storeInstance);
68681
68713
  exports.tokenize = tokenize;
68682
68714
 
68683
68715
 
68684
- __info__.version = "17.4.12";
68685
- __info__.date = "2024-11-13T15:06:56.109Z";
68686
- __info__.hash = "5cde4be";
68716
+ __info__.version = "17.4.13";
68717
+ __info__.date = "2024-11-22T14:17:01.675Z";
68718
+ __info__.hash = "a5e4e16";
68687
68719
 
68688
68720
 
68689
68721
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);