@odoo/o-spreadsheet 16.0.72 → 16.0.73

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.
@@ -5327,6 +5327,10 @@ const REMOVE_ROWS_ACTION = (env) => {
5327
5327
  });
5328
5328
  };
5329
5329
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
5330
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
5331
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
5332
+ return false;
5333
+ }
5330
5334
  const sheetId = env.model.getters.getActiveSheetId();
5331
5335
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
5332
5336
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -6675,11 +6679,11 @@ class OTRegistry extends Registry {
6675
6679
  * transformation function given
6676
6680
  */
6677
6681
  addTransformation(executed, toTransforms, fn) {
6678
- for (let toTransform of toTransforms) {
6679
- if (!this.content[toTransform]) {
6680
- this.content[toTransform] = new Map();
6681
- }
6682
- this.content[toTransform].set(executed, fn);
6682
+ if (!this.content[executed]) {
6683
+ this.content[executed] = new Map();
6684
+ }
6685
+ for (const toTransform of toTransforms) {
6686
+ this.content[executed].set(toTransform, fn);
6683
6687
  }
6684
6688
  return this;
6685
6689
  }
@@ -6688,7 +6692,7 @@ class OTRegistry extends Registry {
6688
6692
  * that the executed command happened.
6689
6693
  */
6690
6694
  getTransformation(toTransform, executed) {
6691
- return this.content[toTransform] && this.content[toTransform].get(executed);
6695
+ return this.content[executed] && this.content[executed].get(toTransform);
6692
6696
  }
6693
6697
  }
6694
6698
  const otRegistry = new OTRegistry();
@@ -36388,10 +36392,20 @@ function transform(toTransform, executed) {
36388
36392
  */
36389
36393
  function transformAll(toTransform, executed) {
36390
36394
  let transformedCommands = [...toTransform];
36395
+ const possibleTransformations = new Set(otRegistry.getKeys());
36391
36396
  for (const executedCommand of executed) {
36392
- transformedCommands = transformedCommands
36393
- .map((cmd) => transform(cmd, executedCommand))
36394
- .filter(isDefined$1);
36397
+ // If the executed command is not in the registry, we skip it
36398
+ // because we know there won't be any transformation impacting the
36399
+ // commands to transform.
36400
+ if (possibleTransformations.has(executedCommand.type)) {
36401
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
36402
+ const transformed = transform(cmd, executedCommand);
36403
+ if (transformed) {
36404
+ acc.push(transformed);
36405
+ }
36406
+ return acc;
36407
+ }, []);
36408
+ }
36395
36409
  }
36396
36410
  return transformedCommands;
36397
36411
  }
@@ -36851,7 +36865,6 @@ class Session extends EventBus {
36851
36865
  if (this.waitingAck) {
36852
36866
  return;
36853
36867
  }
36854
- this.waitingAck = true;
36855
36868
  this.sendPendingMessage();
36856
36869
  }
36857
36870
  /**
@@ -36881,6 +36894,7 @@ class Session extends EventBus {
36881
36894
  throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
36882
36895
  ${JSON.stringify(message)}`);
36883
36896
  }
36897
+ this.waitingAck = true;
36884
36898
  this.transportService.sendMessage({
36885
36899
  ...message,
36886
36900
  serverRevisionId: this.serverRevisionId,
@@ -43866,6 +43880,6 @@ exports.setTranslationMethod = setTranslationMethod;
43866
43880
  exports.tokenize = tokenize;
43867
43881
 
43868
43882
 
43869
- __info__.version = '16.0.72';
43870
- __info__.date = '2025-06-12T10:45:09.183Z';
43871
- __info__.hash = 'fb0036b';
43883
+ __info__.version = '16.0.73';
43884
+ __info__.date = '2025-06-19T18:25:17.838Z';
43885
+ __info__.hash = '8bc0a8a';
@@ -5323,6 +5323,10 @@ const REMOVE_ROWS_ACTION = (env) => {
5323
5323
  });
5324
5324
  };
5325
5325
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
5326
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
5327
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
5328
+ return false;
5329
+ }
5326
5330
  const sheetId = env.model.getters.getActiveSheetId();
5327
5331
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
5328
5332
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -6671,11 +6675,11 @@ class OTRegistry extends Registry {
6671
6675
  * transformation function given
6672
6676
  */
6673
6677
  addTransformation(executed, toTransforms, fn) {
6674
- for (let toTransform of toTransforms) {
6675
- if (!this.content[toTransform]) {
6676
- this.content[toTransform] = new Map();
6677
- }
6678
- this.content[toTransform].set(executed, fn);
6678
+ if (!this.content[executed]) {
6679
+ this.content[executed] = new Map();
6680
+ }
6681
+ for (const toTransform of toTransforms) {
6682
+ this.content[executed].set(toTransform, fn);
6679
6683
  }
6680
6684
  return this;
6681
6685
  }
@@ -6684,7 +6688,7 @@ class OTRegistry extends Registry {
6684
6688
  * that the executed command happened.
6685
6689
  */
6686
6690
  getTransformation(toTransform, executed) {
6687
- return this.content[toTransform] && this.content[toTransform].get(executed);
6691
+ return this.content[executed] && this.content[executed].get(toTransform);
6688
6692
  }
6689
6693
  }
6690
6694
  const otRegistry = new OTRegistry();
@@ -36384,10 +36388,20 @@ function transform(toTransform, executed) {
36384
36388
  */
36385
36389
  function transformAll(toTransform, executed) {
36386
36390
  let transformedCommands = [...toTransform];
36391
+ const possibleTransformations = new Set(otRegistry.getKeys());
36387
36392
  for (const executedCommand of executed) {
36388
- transformedCommands = transformedCommands
36389
- .map((cmd) => transform(cmd, executedCommand))
36390
- .filter(isDefined$1);
36393
+ // If the executed command is not in the registry, we skip it
36394
+ // because we know there won't be any transformation impacting the
36395
+ // commands to transform.
36396
+ if (possibleTransformations.has(executedCommand.type)) {
36397
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
36398
+ const transformed = transform(cmd, executedCommand);
36399
+ if (transformed) {
36400
+ acc.push(transformed);
36401
+ }
36402
+ return acc;
36403
+ }, []);
36404
+ }
36391
36405
  }
36392
36406
  return transformedCommands;
36393
36407
  }
@@ -36847,7 +36861,6 @@ class Session extends EventBus {
36847
36861
  if (this.waitingAck) {
36848
36862
  return;
36849
36863
  }
36850
- this.waitingAck = true;
36851
36864
  this.sendPendingMessage();
36852
36865
  }
36853
36866
  /**
@@ -36877,6 +36890,7 @@ class Session extends EventBus {
36877
36890
  throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
36878
36891
  ${JSON.stringify(message)}`);
36879
36892
  }
36893
+ this.waitingAck = true;
36880
36894
  this.transportService.sendMessage({
36881
36895
  ...message,
36882
36896
  serverRevisionId: this.serverRevisionId,
@@ -43834,6 +43848,6 @@ function addFunction(functionName, functionDescription) {
43834
43848
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
43835
43849
 
43836
43850
 
43837
- __info__.version = '16.0.72';
43838
- __info__.date = '2025-06-12T10:45:09.183Z';
43839
- __info__.hash = 'fb0036b';
43851
+ __info__.version = '16.0.73';
43852
+ __info__.date = '2025-06-19T18:25:17.838Z';
43853
+ __info__.hash = '8bc0a8a';
@@ -5324,6 +5324,10 @@
5324
5324
  });
5325
5325
  };
5326
5326
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
5327
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
5328
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
5329
+ return false;
5330
+ }
5327
5331
  const sheetId = env.model.getters.getActiveSheetId();
5328
5332
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
5329
5333
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -6672,11 +6676,11 @@
6672
6676
  * transformation function given
6673
6677
  */
6674
6678
  addTransformation(executed, toTransforms, fn) {
6675
- for (let toTransform of toTransforms) {
6676
- if (!this.content[toTransform]) {
6677
- this.content[toTransform] = new Map();
6678
- }
6679
- this.content[toTransform].set(executed, fn);
6679
+ if (!this.content[executed]) {
6680
+ this.content[executed] = new Map();
6681
+ }
6682
+ for (const toTransform of toTransforms) {
6683
+ this.content[executed].set(toTransform, fn);
6680
6684
  }
6681
6685
  return this;
6682
6686
  }
@@ -6685,7 +6689,7 @@
6685
6689
  * that the executed command happened.
6686
6690
  */
6687
6691
  getTransformation(toTransform, executed) {
6688
- return this.content[toTransform] && this.content[toTransform].get(executed);
6692
+ return this.content[executed] && this.content[executed].get(toTransform);
6689
6693
  }
6690
6694
  }
6691
6695
  const otRegistry = new OTRegistry();
@@ -36385,10 +36389,20 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36385
36389
  */
36386
36390
  function transformAll(toTransform, executed) {
36387
36391
  let transformedCommands = [...toTransform];
36392
+ const possibleTransformations = new Set(otRegistry.getKeys());
36388
36393
  for (const executedCommand of executed) {
36389
- transformedCommands = transformedCommands
36390
- .map((cmd) => transform(cmd, executedCommand))
36391
- .filter(isDefined$1);
36394
+ // If the executed command is not in the registry, we skip it
36395
+ // because we know there won't be any transformation impacting the
36396
+ // commands to transform.
36397
+ if (possibleTransformations.has(executedCommand.type)) {
36398
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
36399
+ const transformed = transform(cmd, executedCommand);
36400
+ if (transformed) {
36401
+ acc.push(transformed);
36402
+ }
36403
+ return acc;
36404
+ }, []);
36405
+ }
36392
36406
  }
36393
36407
  return transformedCommands;
36394
36408
  }
@@ -36848,7 +36862,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36848
36862
  if (this.waitingAck) {
36849
36863
  return;
36850
36864
  }
36851
- this.waitingAck = true;
36852
36865
  this.sendPendingMessage();
36853
36866
  }
36854
36867
  /**
@@ -36878,6 +36891,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36878
36891
  throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
36879
36892
  ${JSON.stringify(message)}`);
36880
36893
  }
36894
+ this.waitingAck = true;
36881
36895
  this.transportService.sendMessage({
36882
36896
  ...message,
36883
36897
  serverRevisionId: this.serverRevisionId,
@@ -43865,9 +43879,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43865
43879
  Object.defineProperty(exports, '__esModule', { value: true });
43866
43880
 
43867
43881
 
43868
- __info__.version = '16.0.72';
43869
- __info__.date = '2025-06-12T10:45:09.183Z';
43870
- __info__.hash = 'fb0036b';
43882
+ __info__.version = '16.0.73';
43883
+ __info__.date = '2025-06-19T18:25:17.838Z';
43884
+ __info__.hash = '8bc0a8a';
43871
43885
 
43872
43886
 
43873
43887
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);