@odoo/o-spreadsheet 17.0.3 → 17.0.5

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.
@@ -776,7 +776,7 @@ interface TransportService<T = any> {
776
776
  }
777
777
 
778
778
  declare class Revision implements RevisionData {
779
- readonly rootCommand?: Command | "SNAPSHOT" | "REMOTE" | undefined;
779
+ readonly rootCommand?: Command | undefined;
780
780
  readonly timestamp?: number | undefined;
781
781
  readonly id: UID;
782
782
  readonly clientId: ClientId;
@@ -791,7 +791,7 @@ declare class Revision implements RevisionData {
791
791
  * - clientId: Client who initiated the action
792
792
  * - changes: List of changes applied on the state.
793
793
  */
794
- constructor(id: UID, clientId: ClientId, commands: readonly CoreCommand[], rootCommand?: Command | "SNAPSHOT" | "REMOTE" | undefined, changes?: readonly HistoryChange[], timestamp?: number | undefined);
794
+ constructor(id: UID, clientId: ClientId, commands: readonly CoreCommand[], rootCommand?: Command | undefined, changes?: readonly HistoryChange[], timestamp?: number | undefined);
795
795
  setChanges(changes: readonly HistoryChange[]): void;
796
796
  get commands(): readonly CoreCommand[];
797
797
  get changes(): readonly HistoryChange[];
@@ -820,6 +820,7 @@ declare class Session extends EventBus<CollaborativeEvent> {
820
820
  private isReplayingInitialRevisions;
821
821
  private processedRevisions;
822
822
  private uuidGenerator;
823
+ private lastLocalOperation;
823
824
  /**
824
825
  * Manages the collaboration between multiple users on the same spreadsheet.
825
826
  * It can forward local state changes to other users to ensure they all eventually
@@ -861,9 +862,9 @@ declare class Session extends EventBus<CollaborativeEvent> {
861
862
  getRevisionId(): UID;
862
863
  isFullySynchronized(): boolean;
863
864
  /**
864
- * Get the last local revision whose root command isn't in the given list of ignored commands
865
+ * Get the last local revision
865
866
  * */
866
- getLastLocalNonEmptyRevision(ignoredRootCommands: CommandTypes[]): Revision | undefined;
867
+ getLastLocalNonEmptyRevision(): Revision | undefined;
867
868
  private _move;
868
869
  /**
869
870
  * Handles messages received from other clients in the collaborative
@@ -1769,6 +1770,7 @@ interface MoveColumnsRowsCommand extends HeadersDependentCommand {
1769
1770
  type: "MOVE_COLUMNS_ROWS";
1770
1771
  base: HeaderIndex;
1771
1772
  elements: HeaderIndex[];
1773
+ position: "before" | "after";
1772
1774
  }
1773
1775
  interface ResizeColumnsRowsCommand extends HeadersDependentCommand {
1774
1776
  type: "RESIZE_COLUMNS_ROWS";
@@ -2499,7 +2501,8 @@ declare const enum CommandResult {
2499
2501
  InvalidDataValidationCriterionValue = "InvalidDataValidationCriterionValue",
2500
2502
  InvalidNumberOfCriterionValues = "InvalidNumberOfCriterionValues",
2501
2503
  BlockingValidationRule = "BlockingValidationRule",
2502
- InvalidCopyPasteSelection = "InvalidCopyPasteSelection"
2504
+ InvalidCopyPasteSelection = "InvalidCopyPasteSelection",
2505
+ NoChanges = "NoChanges"
2503
2506
  }
2504
2507
  interface CommandHandler<T> {
2505
2508
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -3231,7 +3234,8 @@ interface BordersPluginState {
3231
3234
  declare class BordersPlugin extends CorePlugin<BordersPluginState> implements BordersPluginState {
3232
3235
  static getters: readonly ["getCellBorder", "getBordersColors"];
3233
3236
  readonly borders: BordersPluginState["borders"];
3234
- handle(cmd: Command): void;
3237
+ allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.NoChanges;
3238
+ handle(cmd: CoreCommand): void;
3235
3239
  /**
3236
3240
  * Move borders according to the inserted columns.
3237
3241
  * Ensure borders continuity.
@@ -3329,6 +3333,7 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
3329
3333
  * Compute the borders to add to the given zone merged.
3330
3334
  */
3331
3335
  private addBordersToMerge;
3336
+ private checkBordersUnchanged;
3332
3337
  import(data: WorkbookData): void;
3333
3338
  export(data: WorkbookData): void;
3334
3339
  exportForExcel(data: ExcelWorkbookData): void;
@@ -3353,7 +3358,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3353
3358
  };
3354
3359
  };
3355
3360
  adaptRanges(applyChange: ApplyRangeChange, sheetId?: UID): void;
3356
- allowDispatch(cmd: CoreCommand): CommandResult;
3361
+ allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
3357
3362
  handle(cmd: CoreCommand): void;
3358
3363
  /**
3359
3364
  * Set a format to all the cells in a zone
@@ -3427,6 +3432,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3427
3432
  private createFormulaCellWithDependencies;
3428
3433
  private createErrorFormula;
3429
3434
  private checkCellOutOfSheet;
3435
+ private checkUselessClearCell;
3430
3436
  }
3431
3437
 
3432
3438
  /**
@@ -4057,15 +4063,6 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
4057
4063
  */
4058
4064
  private moveCellOnRowsDeletion;
4059
4065
  private updateRowsStructureOnDeletion;
4060
- /**
4061
- * Update the rows of the sheet after an addition:
4062
- * - Rename the rows
4063
- *
4064
- * @param sheet Sheet on which the deletion occurs
4065
- * @param addedRow Index of the added row
4066
- * @param rowsToAdd Number of the rows to add
4067
- */
4068
- private updateRowsStructureOnAddition;
4069
4066
  /**
4070
4067
  * Add empty rows at the end of the rows
4071
4068
  *
@@ -4087,11 +4084,9 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
4087
4084
  }
4088
4085
 
4089
4086
  declare class EvaluationPlugin extends UIPlugin {
4090
- private config;
4091
- static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "getSpreadPositionsOf"];
4087
+ static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "getSpreadPositionsOf", "getArrayFormulaSpreadingOn"];
4092
4088
  private shouldRebuildDependenciesGraph;
4093
4089
  private evaluator;
4094
- private compilationParams;
4095
4090
  private positionsToUpdate;
4096
4091
  constructor(config: UIPluginConfig);
4097
4092
  beforeHandle(cmd: Command): void;
@@ -4114,6 +4109,7 @@ declare class EvaluationPlugin extends UIPlugin {
4114
4109
  getEvaluatedCells(sheetId: UID): Record<UID, EvaluatedCell>;
4115
4110
  getEvaluatedCellsInZone(sheetId: UID, zone: Zone): EvaluatedCell[];
4116
4111
  getSpreadPositionsOf(position: CellPosition): CellPosition[];
4112
+ getArrayFormulaSpreadingOn(position: CellPosition): CellPosition | undefined;
4117
4113
  exportForExcel(data: ExcelWorkbookData): void;
4118
4114
  /**
4119
4115
  * Returns the corresponding formula cell of a given cell
@@ -4121,7 +4117,6 @@ declare class EvaluationPlugin extends UIPlugin {
4121
4117
  * formula of the array formula that spreads to the cell
4122
4118
  */
4123
4119
  getCorrespondingFormulaCell(position: CellPosition): FormulaCell | undefined;
4124
- private getCompilationParameters;
4125
4120
  }
4126
4121
 
4127
4122
  interface CustomColorState {
@@ -7447,6 +7442,7 @@ interface ResizerState {
7447
7442
  draggerShadowThickness: number;
7448
7443
  delta: number;
7449
7444
  base: number;
7445
+ position: "before" | "after";
7450
7446
  }
7451
7447
  interface ResizerProps {
7452
7448
  onOpenContextMenu: (type: ContextMenuType, x: Pixel, y: Pixel) => void;