@odoo/o-spreadsheet 16.3.0-alpha.7 → 16.3.0

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.
@@ -161,13 +161,13 @@ interface Subscription {
161
161
  }
162
162
 
163
163
  declare class SelectiveHistory<T = unknown> {
164
- private applyOperation;
165
- private revertOperation;
166
- private buildEmpty;
167
- private readonly buildTransformation;
168
164
  private HEAD_BRANCH;
169
165
  private HEAD_OPERATION;
170
166
  private tree;
167
+ private readonly applyOperation;
168
+ private readonly revertOperation;
169
+ private readonly buildEmpty;
170
+ private readonly buildTransformation;
171
171
  /**
172
172
  * The selective history is a data structure used to register changes/updates of a state.
173
173
  * Each change/update is called an "operation".
@@ -188,7 +188,13 @@ declare class SelectiveHistory<T = unknown> {
188
188
  * (used for internal implementation)
189
189
  * @param buildTransformation Factory used to build transformations
190
190
  */
191
- constructor(initialOperationId: UID, applyOperation: (data: T) => void, revertOperation: (data: T) => void, buildEmpty: (id: UID) => T, buildTransformation: TransformationFactory<T>);
191
+ constructor(args: {
192
+ initialOperationId: UID;
193
+ applyOperation: (data: T) => void;
194
+ revertOperation: (data: T) => void;
195
+ buildEmpty: (id: UID) => T;
196
+ buildTransformation: TransformationFactory<T>;
197
+ });
192
198
  /**
193
199
  * Return the operation identified by its id.
194
200
  */
@@ -269,7 +275,6 @@ interface CollaborativeEventReceived {
269
275
  }
270
276
  interface UnexpectedRevisionIdEvent {
271
277
  type: "unexpected-revision-id";
272
- revisionId: UID;
273
278
  }
274
279
  interface NewLocalStateUpdateEvent {
275
280
  type: "new-local-state-update";
@@ -669,6 +674,7 @@ interface RemoteRevisionMessage extends AbstractMessage {
669
674
  commands: readonly CoreCommand[];
670
675
  nextRevisionId: UID;
671
676
  serverRevisionId: UID;
677
+ timestamp?: number;
672
678
  }
673
679
  interface RevisionUndoneMessage extends AbstractMessage {
674
680
  type: "REVISION_UNDONE";
@@ -748,6 +754,7 @@ interface TransportService<T = any> {
748
754
 
749
755
  declare class Revision implements RevisionData {
750
756
  readonly rootCommand?: "SNAPSHOT" | Command | "REMOTE" | undefined;
757
+ readonly timestamp?: number | undefined;
751
758
  readonly id: UID;
752
759
  readonly clientId: ClientId;
753
760
  private _commands;
@@ -761,7 +768,7 @@ declare class Revision implements RevisionData {
761
768
  * - clientId: Client who initiated the action
762
769
  * - changes: List of changes applied on the state.
763
770
  */
764
- constructor(id: UID, clientId: ClientId, commands: readonly CoreCommand[], rootCommand?: "SNAPSHOT" | Command | "REMOTE" | undefined, changes?: readonly HistoryChange[]);
771
+ constructor(id: UID, clientId: ClientId, commands: readonly CoreCommand[], rootCommand?: "SNAPSHOT" | Command | "REMOTE" | undefined, changes?: readonly HistoryChange[], timestamp?: number | undefined);
765
772
  setChanges(changes: readonly HistoryChange[]): void;
766
773
  get commands(): readonly CoreCommand[];
767
774
  get changes(): readonly HistoryChange[];
@@ -854,6 +861,7 @@ declare class Session extends EventBus<CollaborativeEvent> {
854
861
  private sendPendingMessage;
855
862
  private acknowledge;
856
863
  private isAlreadyProcessed;
864
+ isWrongServerRevisionId(message: CollaborationMessage): boolean;
857
865
  private dropPendingHistoryMessages;
858
866
  }
859
867
 
@@ -1171,6 +1179,7 @@ declare class Model extends EventBus<any> implements CommandDispatcher {
1171
1179
  private coreGetters;
1172
1180
  uuidGenerator: UuidGenerator;
1173
1181
  private readonly handlers;
1182
+ private readonly uiHandlers;
1174
1183
  private readonly coreHandlers;
1175
1184
  constructor(data?: any, config?: Partial<ModelConfig>, stateUpdateMessages?: StateUpdateMessage[], uuidGenerator?: UuidGenerator, verboseImport?: boolean);
1176
1185
  joinSession(): void;
@@ -1662,9 +1671,9 @@ interface PositionDependentCommand {
1662
1671
  col: number;
1663
1672
  row: number;
1664
1673
  }
1665
- declare const invalidateEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1666
- declare const readonlyAllowedCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1667
- declare const coreTypes: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE">;
1674
+ declare const invalidateEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1675
+ declare const readonlyAllowedCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1676
+ declare const coreTypes: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE">;
1668
1677
  interface UpdateCellCommand extends PositionDependentCommand {
1669
1678
  type: "UPDATE_CELL";
1670
1679
  content?: string;
@@ -1849,9 +1858,12 @@ interface UpdateFilterCommand extends PositionDependentCommand {
1849
1858
  interface SetFormattingCommand extends TargetDependentCommand {
1850
1859
  type: "SET_FORMATTING";
1851
1860
  style?: Style;
1852
- border?: BorderCommand;
1853
1861
  format?: Format;
1854
1862
  }
1863
+ interface SetZoneBordersCommand extends TargetDependentCommand {
1864
+ type: "SET_ZONE_BORDERS";
1865
+ border: BorderData;
1866
+ }
1855
1867
  interface SetBorderCommand extends PositionDependentCommand {
1856
1868
  type: "SET_BORDER";
1857
1869
  border: Border$1 | undefined;
@@ -1869,7 +1881,7 @@ interface CopyCommand {
1869
1881
  interface CutCommand {
1870
1882
  type: "CUT";
1871
1883
  /** Zones to cut. If none were given, will copy the zones in the selection*/
1872
- target?: Zone[];
1884
+ cutTarget?: Zone[];
1873
1885
  }
1874
1886
  interface PasteCommand {
1875
1887
  type: "PASTE";
@@ -2180,8 +2192,8 @@ interface InsertCellCommand {
2180
2192
  }
2181
2193
  interface PasteCFCommand {
2182
2194
  type: "PASTE_CONDITIONAL_FORMAT";
2183
- origin: CellPosition;
2184
- target: CellPosition;
2195
+ originPosition: CellPosition;
2196
+ targetPosition: CellPosition;
2185
2197
  operation: "CUT" | "COPY";
2186
2198
  }
2187
2199
  interface ActivateNextSheetCommand {
@@ -2221,7 +2233,7 @@ UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContent
2221
2233
  /** FIGURES */
2222
2234
  | CreateFigureCommand | DeleteFigureCommand | UpdateFigureCommand
2223
2235
  /** FORMATTING */
2224
- | SetFormattingCommand | ClearFormattingCommand | SetBorderCommand
2236
+ | SetFormattingCommand | ClearFormattingCommand | SetZoneBordersCommand | SetBorderCommand
2225
2237
  /** CHART */
2226
2238
  | CreateChartCommand | UpdateChartCommand
2227
2239
  /** Image */
@@ -2342,7 +2354,8 @@ declare const enum CommandResult {
2342
2354
  MoreThanOneColumnSelected = 88,
2343
2355
  EmptySplitSeparator = 89,
2344
2356
  SplitWillOverwriteContent = 90,
2345
- NoSplitSeparatorInSelection = 91
2357
+ NoSplitSeparatorInSelection = 91,
2358
+ NoActiveSheet = 92
2346
2359
  }
2347
2360
  interface CommandHandler<T> {
2348
2361
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -2468,8 +2481,20 @@ interface CellPosition {
2468
2481
  row: HeaderIndex;
2469
2482
  sheetId: UID;
2470
2483
  }
2471
- declare type BorderStyle = "thin" | "medium" | "thick" | "dashed" | "dotted" | "double";
2472
- declare type BorderDescr = [BorderStyle, Color];
2484
+ declare const borderStyles: readonly ["thin", "medium", "thick", "dashed", "dotted"];
2485
+ declare type BorderStyle = typeof borderStyles[number];
2486
+ declare type BorderDescr = {
2487
+ style: BorderStyle;
2488
+ color: Color;
2489
+ };
2490
+ /**
2491
+ * A complete border(s) data is a set of position-color-style information
2492
+ */
2493
+ declare type BorderData = {
2494
+ position: BorderPosition;
2495
+ color?: Color;
2496
+ style?: BorderStyle;
2497
+ };
2473
2498
  interface Border$1 {
2474
2499
  top?: BorderDescr;
2475
2500
  left?: BorderDescr;
@@ -2536,7 +2561,7 @@ interface PaneDivision {
2536
2561
  /** Represents the number of frozen rows */
2537
2562
  ySplit: number;
2538
2563
  }
2539
- declare type BorderCommand = "all" | "hv" | "h" | "v" | "external" | "left" | "top" | "right" | "bottom" | "clear";
2564
+ declare type BorderPosition = "all" | "hv" | "h" | "v" | "external" | "left" | "top" | "right" | "bottom" | "clear";
2540
2565
  declare type BorderDescription = {
2541
2566
  vertical?: BorderDescr;
2542
2567
  horizontal?: BorderDescr;
@@ -2930,7 +2955,7 @@ interface BordersPluginState {
2930
2955
  * - borders
2931
2956
  */
2932
2957
  declare class BordersPlugin extends CorePlugin<BordersPluginState> implements BordersPluginState {
2933
- static getters: readonly ["getCellBorder"];
2958
+ static getters: readonly ["getCellBorder", "getBordersColors"];
2934
2959
  readonly borders: BordersPluginState["borders"];
2935
2960
  handle(cmd: Command): void;
2936
2961
  /**
@@ -2944,6 +2969,7 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
2944
2969
  */
2945
2970
  private handleAddRows;
2946
2971
  getCellBorder({ sheetId, col, row }: CellPosition): Border$1 | null;
2972
+ getBordersColors(sheetId: UID): Color[];
2947
2973
  /**
2948
2974
  * Ensure border continuity between two columns.
2949
2975
  * If the two columns have the same borders (at each row respectively),
@@ -3519,7 +3545,7 @@ interface SheetState$1 {
3519
3545
  readonly cellPosition: Record<UID, CellPosition | undefined>;
3520
3546
  }
3521
3547
  declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState$1 {
3522
- static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions"];
3548
+ static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones"];
3523
3549
  readonly sheetIdsMapName: Record<string, UID | undefined>;
3524
3550
  readonly orderedSheetIds: UID[];
3525
3551
  readonly sheets: Record<UID, Sheet | undefined>;
@@ -3565,6 +3591,12 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
3565
3591
  * Check if a zone only contains empty cells
3566
3592
  */
3567
3593
  isEmpty(sheetId: UID, zone: Zone): boolean;
3594
+ getCommandZones(cmd: Command): Zone[];
3595
+ /**
3596
+ * Check if zones in the command are well formed and
3597
+ * not outside the sheet.
3598
+ */
3599
+ checkZonesExistInSheet(sheetId: UID, zones: Zone[]): CommandResult;
3568
3600
  private updateCellPosition;
3569
3601
  /**
3570
3602
  * Set the cell at a new position and clear its previous position.
@@ -3658,7 +3690,7 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
3658
3690
  * Check if zones in the command are well formed and
3659
3691
  * not outside the sheet.
3660
3692
  */
3661
- private checkZones;
3693
+ private checkZonesAreInSheet;
3662
3694
  }
3663
3695
 
3664
3696
  /**
@@ -4538,7 +4570,7 @@ declare class UIOptionsPlugin extends UIPlugin {
4538
4570
  declare class SheetUIPlugin extends UIPlugin {
4539
4571
  static getters: readonly ["getCellWidth", "getTextWidth", "getCellText", "getCellMultiLineText", "getColDimensions", "getRowDimensions", "getColRowOffset"];
4540
4572
  private ctx;
4541
- allowDispatch(cmd: LocalCommand): CommandResult;
4573
+ allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
4542
4574
  handle(cmd: Command): void;
4543
4575
  getCellWidth(position: CellPosition): number;
4544
4576
  getTextWidth(text: string, style: Style): Pixel;
@@ -4566,6 +4598,16 @@ declare class SheetUIPlugin extends UIPlugin {
4566
4598
  getColRowOffset(dimension: Dimension, referenceIndex: HeaderIndex, index: HeaderIndex, sheetId?: UID): Pixel;
4567
4599
  private getColMaxWidth;
4568
4600
  private splitWordToSpecificWidth;
4601
+ /**
4602
+ * Check that any "sheetId" in the command matches an existing
4603
+ * sheet.
4604
+ */
4605
+ private checkSheetExists;
4606
+ /**
4607
+ * Check if zones in the command are well formed and
4608
+ * not outside the sheet.
4609
+ */
4610
+ private checkZonesAreInSheet;
4569
4611
  }
4570
4612
 
4571
4613
  /**
@@ -4613,7 +4655,7 @@ declare class ClipboardPlugin extends UIPlugin {
4613
4655
  */
4614
4656
  declare class GridSelectionPlugin extends UIPlugin {
4615
4657
  static layers: LAYERS[];
4616
- static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getSelectedCells", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", "getSheetPosition", "isSelected", "isSingleColSelected", "getElementsFromSelection"];
4658
+ static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getSelectedCells", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", "getSheetPosition", "isSelected", "isSingleColSelected", "getElementsFromSelection", "tryGetActiveSheetId"];
4617
4659
  private gridSelection;
4618
4660
  private selectedFigureId;
4619
4661
  private sheetsData;
@@ -4625,6 +4667,7 @@ declare class GridSelectionPlugin extends UIPlugin {
4625
4667
  handle(cmd: Command): void;
4626
4668
  getActiveSheet(): Readonly<Sheet>;
4627
4669
  getActiveSheetId(): UID;
4670
+ tryGetActiveSheetId(): UID | undefined;
4628
4671
  getActiveCell(): EvaluatedCell;
4629
4672
  getActiveCols(): Set<number>;
4630
4673
  getActiveRows(): Set<number>;
@@ -4932,7 +4975,7 @@ interface ChartBuilder {
4932
4975
  sequence: number;
4933
4976
  }
4934
4977
 
4935
- interface Props$C {
4978
+ interface Props$D {
4936
4979
  ranges: string[];
4937
4980
  hasSingleRange?: boolean;
4938
4981
  required?: boolean;
@@ -4954,7 +4997,7 @@ interface SelectionRange extends Omit<RangeInputValue, "color"> {
4954
4997
  * onSelectionChanged is called every time the input value
4955
4998
  * changes.
4956
4999
  */
4957
- declare class SelectionInput extends Component<Props$C, SpreadsheetChildEnv> {
5000
+ declare class SelectionInput extends Component<Props$D, SpreadsheetChildEnv> {
4958
5001
  static template: string;
4959
5002
  private id;
4960
5003
  private previousRanges;
@@ -4972,6 +5015,7 @@ declare class SelectionInput extends Component<Props$C, SpreadsheetChildEnv> {
4972
5015
  getColor(range: SelectionRange): string;
4973
5016
  private triggerChange;
4974
5017
  onKeydown(ev: KeyboardEvent): void;
5018
+ private extractRanges;
4975
5019
  focus(rangeId: number): void;
4976
5020
  addEmptyInput(): void;
4977
5021
  removeInput(rangeId: number): void;
@@ -4979,12 +5023,12 @@ declare class SelectionInput extends Component<Props$C, SpreadsheetChildEnv> {
4979
5023
  confirm(): void;
4980
5024
  }
4981
5025
 
4982
- interface Props$B {
5026
+ interface Props$C {
4983
5027
  figureId: UID;
4984
5028
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
4985
5029
  updateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
4986
5030
  }
4987
- declare class LineBarPieConfigPanel extends Component<Props$B, SpreadsheetChildEnv> {
5031
+ declare class LineBarPieConfigPanel extends Component<Props$C, SpreadsheetChildEnv> {
4988
5032
  static template: string;
4989
5033
  static components: {
4990
5034
  SelectionInput: typeof SelectionInput;
@@ -5103,7 +5147,7 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5103
5147
  isSameColor(color1: Color, color2: Color): boolean;
5104
5148
  }
5105
5149
 
5106
- interface Props$A {
5150
+ interface Props$B {
5107
5151
  currentColor: string | undefined;
5108
5152
  toggleColorPicker: () => void;
5109
5153
  showColorPicker: boolean;
@@ -5114,7 +5158,7 @@ interface Props$A {
5114
5158
  dropdownMaxHeight?: Pixel;
5115
5159
  class?: string;
5116
5160
  }
5117
- declare class ColorPickerWidget extends Component<Props$A, SpreadsheetChildEnv> {
5161
+ declare class ColorPickerWidget extends Component<Props$B, SpreadsheetChildEnv> {
5118
5162
  static template: string;
5119
5163
  static components: {
5120
5164
  ColorPicker: typeof ColorPicker;
@@ -5126,12 +5170,12 @@ declare class ColorPickerWidget extends Component<Props$A, SpreadsheetChildEnv>
5126
5170
  get colorPickerAnchorRect(): Rect;
5127
5171
  }
5128
5172
 
5129
- interface Props$z {
5173
+ interface Props$A {
5130
5174
  figureId: UID;
5131
5175
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5132
5176
  updateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => CommandResult | CommandResult[];
5133
5177
  }
5134
- declare class LineBarPieDesignPanel extends Component<Props$z, SpreadsheetChildEnv> {
5178
+ declare class LineBarPieDesignPanel extends Component<Props$A, SpreadsheetChildEnv> {
5135
5179
  static template: string;
5136
5180
  static components: {
5137
5181
  ColorPickerWidget: typeof ColorPickerWidget;
@@ -5145,12 +5189,12 @@ declare class LineBarPieDesignPanel extends Component<Props$z, SpreadsheetChildE
5145
5189
  updateSelect(attr: string, ev: any): void;
5146
5190
  }
5147
5191
 
5148
- interface Props$y {
5192
+ interface Props$z {
5149
5193
  figureId: UID;
5150
5194
  definition: GaugeChartDefinition;
5151
5195
  updateChart: (definition: Partial<GaugeChartDefinition>) => DispatchResult;
5152
5196
  }
5153
- declare class GaugeChartConfigPanel extends Component<Props$y, SpreadsheetChildEnv> {
5197
+ declare class GaugeChartConfigPanel extends Component<Props$z, SpreadsheetChildEnv> {
5154
5198
  static template: string;
5155
5199
  static components: {
5156
5200
  SelectionInput: typeof SelectionInput;
@@ -5164,12 +5208,12 @@ declare class GaugeChartConfigPanel extends Component<Props$y, SpreadsheetChildE
5164
5208
  }
5165
5209
 
5166
5210
  declare type GaugeMenu = "backgroundColor" | "sectionColor-lowerColor" | "sectionColor-middleColor" | "sectionColor-upperColor";
5167
- interface Props$x {
5211
+ interface Props$y {
5168
5212
  figureId: UID;
5169
5213
  definition: GaugeChartDefinition;
5170
5214
  updateChart: (definition: Partial<GaugeChartDefinition>) => DispatchResult;
5171
5215
  }
5172
- declare class GaugeChartDesignPanel extends Component<Props$x, SpreadsheetChildEnv> {
5216
+ declare class GaugeChartDesignPanel extends Component<Props$y, SpreadsheetChildEnv> {
5173
5217
  static template: string;
5174
5218
  static components: {
5175
5219
  ColorPickerWidget: typeof ColorPickerWidget;
@@ -5201,12 +5245,12 @@ declare class LineConfigPanel extends LineBarPieConfigPanel {
5201
5245
  onUpdateAggregated(ev: any): void;
5202
5246
  }
5203
5247
 
5204
- interface Props$w {
5248
+ interface Props$x {
5205
5249
  figureId: UID;
5206
5250
  definition: ScorecardChartDefinition;
5207
5251
  updateChart: (definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5208
5252
  }
5209
- declare class ScorecardChartConfigPanel extends Component<Props$w, SpreadsheetChildEnv> {
5253
+ declare class ScorecardChartConfigPanel extends Component<Props$x, SpreadsheetChildEnv> {
5210
5254
  static template: string;
5211
5255
  static components: {
5212
5256
  SelectionInput: typeof SelectionInput;
@@ -5225,12 +5269,12 @@ declare class ScorecardChartConfigPanel extends Component<Props$w, SpreadsheetCh
5225
5269
  }
5226
5270
 
5227
5271
  declare type ColorPickerId = undefined | "backgroundColor" | "baselineColorUp" | "baselineColorDown";
5228
- interface Props$v {
5272
+ interface Props$w {
5229
5273
  figureId: UID;
5230
5274
  definition: ScorecardChartDefinition;
5231
5275
  updateChart: (definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5232
5276
  }
5233
- declare class ScorecardChartDesignPanel extends Component<Props$v, SpreadsheetChildEnv> {
5277
+ declare class ScorecardChartDesignPanel extends Component<Props$w, SpreadsheetChildEnv> {
5234
5278
  static template: string;
5235
5279
  static components: {
5236
5280
  ColorPickerWidget: typeof ColorPickerWidget;
@@ -5371,10 +5415,10 @@ interface AutofillRule {
5371
5415
  sequence: number;
5372
5416
  }
5373
5417
 
5374
- interface Props$u {
5418
+ interface Props$v {
5375
5419
  figure: Figure;
5376
5420
  }
5377
- declare class ChartJsComponent extends Component<Props$u, SpreadsheetChildEnv> {
5421
+ declare class ChartJsComponent extends Component<Props$v, SpreadsheetChildEnv> {
5378
5422
  static template: string;
5379
5423
  private canvas;
5380
5424
  private chart?;
@@ -5386,10 +5430,10 @@ declare class ChartJsComponent extends Component<Props$u, SpreadsheetChildEnv> {
5386
5430
  private updateChartJs;
5387
5431
  }
5388
5432
 
5389
- interface Props$t {
5433
+ interface Props$u {
5390
5434
  figure: Figure;
5391
5435
  }
5392
- declare class ScorecardChart extends Component<Props$t, SpreadsheetChildEnv> {
5436
+ declare class ScorecardChart extends Component<Props$u, SpreadsheetChildEnv> {
5393
5437
  static template: string;
5394
5438
  private ctx;
5395
5439
  get runtime(): ScorecardChartRuntime;
@@ -5421,7 +5465,7 @@ declare class ScorecardChart extends Component<Props$t, SpreadsheetChildEnv> {
5421
5465
  }
5422
5466
 
5423
5467
  declare type MenuItemOrSeparator = Action | "separator";
5424
- interface Props$s {
5468
+ interface Props$t {
5425
5469
  position: DOMCoordinates;
5426
5470
  menuItems: Action[];
5427
5471
  depth: number;
@@ -5437,7 +5481,7 @@ interface MenuState {
5437
5481
  scrollOffset?: Pixel;
5438
5482
  menuItems: Action[];
5439
5483
  }
5440
- declare class Menu extends Component<Props$s, SpreadsheetChildEnv> {
5484
+ declare class Menu extends Component<Props$t, SpreadsheetChildEnv> {
5441
5485
  static template: string;
5442
5486
  static components: {
5443
5487
  Menu: typeof Menu;
@@ -5475,14 +5519,14 @@ declare class Menu extends Component<Props$s, SpreadsheetChildEnv> {
5475
5519
  }
5476
5520
 
5477
5521
  declare type ResizeAnchor = "top left" | "top" | "top right" | "right" | "bottom right" | "bottom" | "bottom left" | "left";
5478
- interface Props$r {
5522
+ interface Props$s {
5479
5523
  figure: Figure;
5480
5524
  style: string;
5481
5525
  onFigureDeleted: () => void;
5482
5526
  onMouseDown: (ev: MouseEvent) => void;
5483
5527
  onClickAnchor(dirX: ResizeDirection, dirY: ResizeDirection, ev: MouseEvent): void;
5484
5528
  }
5485
- declare class FigureComponent extends Component<Props$r, SpreadsheetChildEnv> {
5529
+ declare class FigureComponent extends Component<Props$s, SpreadsheetChildEnv> {
5486
5530
  static template: string;
5487
5531
  static components: {
5488
5532
  Menu: typeof Menu;
@@ -5512,11 +5556,11 @@ declare class FigureComponent extends Component<Props$r, SpreadsheetChildEnv> {
5512
5556
  private openContextMenu;
5513
5557
  }
5514
5558
 
5515
- interface Props$q {
5559
+ interface Props$r {
5516
5560
  figure: Figure;
5517
5561
  onFigureDeleted: () => void;
5518
5562
  }
5519
- declare class ChartFigure extends Component<Props$q, SpreadsheetChildEnv> {
5563
+ declare class ChartFigure extends Component<Props$r, SpreadsheetChildEnv> {
5520
5564
  static template: string;
5521
5565
  static components: {};
5522
5566
  onDoubleClick(): void;
@@ -5524,7 +5568,7 @@ declare class ChartFigure extends Component<Props$q, SpreadsheetChildEnv> {
5524
5568
  get chartComponent(): new (...args: any) => Component;
5525
5569
  }
5526
5570
 
5527
- interface Props$p {
5571
+ interface Props$q {
5528
5572
  isVisible: boolean;
5529
5573
  position: Position;
5530
5574
  }
@@ -5532,13 +5576,13 @@ interface Position {
5532
5576
  top: HeaderIndex;
5533
5577
  left: HeaderIndex;
5534
5578
  }
5535
- interface State$3 {
5579
+ interface State$5 {
5536
5580
  position: Position;
5537
5581
  handler: boolean;
5538
5582
  }
5539
- declare class Autofill extends Component<Props$p, SpreadsheetChildEnv> {
5583
+ declare class Autofill extends Component<Props$q, SpreadsheetChildEnv> {
5540
5584
  static template: string;
5541
- state: State$3;
5585
+ state: State$5;
5542
5586
  get style(): string;
5543
5587
  get handlerStyle(): string;
5544
5588
  get styleNextValue(): string;
@@ -5610,13 +5654,13 @@ declare class Ripple extends Component<RippleProps, SpreadsheetChildEnv> {
5610
5654
  getRippleEffectProps(id: number): RippleEffectProps;
5611
5655
  }
5612
5656
 
5613
- interface Props$o {
5657
+ interface Props$p {
5614
5658
  sheetId: string;
5615
5659
  openContextMenu: (registry: MenuItemRegistry, ev: MouseEvent) => void;
5616
5660
  style?: string;
5617
5661
  onMouseDown: (ev: MouseEvent) => void;
5618
5662
  }
5619
- declare class BottomBarSheet extends Component<Props$o, SpreadsheetChildEnv> {
5663
+ declare class BottomBarSheet extends Component<Props$p, SpreadsheetChildEnv> {
5620
5664
  static template: string;
5621
5665
  static components: {
5622
5666
  Ripple: typeof Ripple;
@@ -5650,11 +5694,11 @@ declare class BottomBarSheet extends Component<Props$o, SpreadsheetChildEnv> {
5650
5694
  get sheetName(): string;
5651
5695
  }
5652
5696
 
5653
- interface Props$n {
5697
+ interface Props$o {
5654
5698
  openContextMenu: (x: number, y: number, registry: MenuItemRegistry) => void;
5655
5699
  closeContextMenu: () => void;
5656
5700
  }
5657
- declare class BottomBarStatistic extends Component<Props$n, SpreadsheetChildEnv> {
5701
+ declare class BottomBarStatistic extends Component<Props$o, SpreadsheetChildEnv> {
5658
5702
  static template: string;
5659
5703
  static components: {
5660
5704
  Ripple: typeof Ripple;
@@ -5676,13 +5720,13 @@ interface SheetState {
5676
5720
  isDnd: boolean;
5677
5721
  sheetDndPositions: Record<UID, number> | undefined;
5678
5722
  }
5679
- interface Props$m {
5723
+ interface Props$n {
5680
5724
  onClick: () => void;
5681
5725
  }
5682
5726
  interface BottomBarMenuState extends MenuState {
5683
5727
  menuId: UID | undefined;
5684
5728
  }
5685
- declare class BottomBar extends Component<Props$m, SpreadsheetChildEnv> {
5729
+ declare class BottomBar extends Component<Props$n, SpreadsheetChildEnv> {
5686
5730
  static template: string;
5687
5731
  static components: {
5688
5732
  Menu: typeof Menu;
@@ -5725,21 +5769,21 @@ declare class BottomBar extends Component<Props$m, SpreadsheetChildEnv> {
5725
5769
  get sheetListMaxScroll(): number;
5726
5770
  }
5727
5771
 
5728
- interface Props$l {
5772
+ interface Props$m {
5729
5773
  position: DOMCoordinates;
5730
5774
  isActive: boolean;
5731
5775
  onClick: () => void;
5732
5776
  }
5733
- declare class FilterIcon extends Component<Props$l, SpreadsheetEnv> {
5777
+ declare class FilterIcon extends Component<Props$m, SpreadsheetEnv> {
5734
5778
  static style: string;
5735
5779
  static template: string;
5736
5780
  get style(): string;
5737
5781
  }
5738
5782
 
5739
- interface Props$k {
5783
+ interface Props$l {
5740
5784
  gridPosition: DOMCoordinates;
5741
5785
  }
5742
- declare class FilterIconsOverlay extends Component<Props$k, SpreadsheetChildEnv> {
5786
+ declare class FilterIconsOverlay extends Component<Props$l, SpreadsheetChildEnv> {
5743
5787
  static style: string;
5744
5788
  static template: string;
5745
5789
  static components: {
@@ -5769,7 +5813,7 @@ interface SnapLine<T extends HFigureAxisType | VFigureAxisType> {
5769
5813
  }
5770
5814
 
5771
5815
  declare type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
5772
- interface Props$j {
5816
+ interface Props$k {
5773
5817
  onFigureDeleted: () => void;
5774
5818
  }
5775
5819
  interface Container {
@@ -5848,7 +5892,7 @@ interface DndState {
5848
5892
  * that occurred during the drag & drop, and to position the figure on the correct pane.
5849
5893
  *
5850
5894
  */
5851
- declare class FiguresContainer extends Component<Props$j, SpreadsheetChildEnv> {
5895
+ declare class FiguresContainer extends Component<Props$k, SpreadsheetChildEnv> {
5852
5896
  static template: string;
5853
5897
  static components: {
5854
5898
  FigureComponent: typeof FigureComponent;
@@ -5880,7 +5924,7 @@ declare class FiguresContainer extends Component<Props$j, SpreadsheetChildEnv> {
5880
5924
  private getSnapLineStyle;
5881
5925
  }
5882
5926
 
5883
- interface Props$i {
5927
+ interface Props$j {
5884
5928
  onCellHovered: (position: Partial<Position$1>) => void;
5885
5929
  onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
5886
5930
  onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: {
@@ -5893,7 +5937,7 @@ interface Props$i {
5893
5937
  gridOverlayDimensions: string;
5894
5938
  onFigureDeleted: () => void;
5895
5939
  }
5896
- declare class GridOverlay extends Component<Props$i, SpreadsheetChildEnv> {
5940
+ declare class GridOverlay extends Component<Props$j, SpreadsheetChildEnv> {
5897
5941
  static template: string;
5898
5942
  static components: {
5899
5943
  FiguresContainer: typeof FiguresContainer;
@@ -5915,13 +5959,13 @@ declare class GridOverlay extends Component<Props$i, SpreadsheetChildEnv> {
5915
5959
  private getCartesianCoordinates;
5916
5960
  }
5917
5961
 
5918
- interface Props$h {
5962
+ interface Props$i {
5919
5963
  hoveredCell: Partial<Position$1>;
5920
5964
  gridRect: Rect;
5921
5965
  onClosePopover: () => void;
5922
5966
  onMouseWheel: (ev: WheelEvent) => void;
5923
5967
  }
5924
- declare class GridPopover extends Component<Props$h, SpreadsheetChildEnv> {
5968
+ declare class GridPopover extends Component<Props$i, SpreadsheetChildEnv> {
5925
5969
  static template: string;
5926
5970
  static components: {
5927
5971
  Popover: typeof Popover;
@@ -5932,7 +5976,7 @@ declare class GridPopover extends Component<Props$h, SpreadsheetChildEnv> {
5932
5976
 
5933
5977
  declare type ScrollDirection = "horizontal" | "vertical";
5934
5978
 
5935
- interface Props$g {
5979
+ interface Props$h {
5936
5980
  width: Pixel;
5937
5981
  height: Pixel;
5938
5982
  direction: ScrollDirection;
@@ -5940,7 +5984,7 @@ interface Props$g {
5940
5984
  offset: Pixel;
5941
5985
  onScroll: (offset: Pixel) => void;
5942
5986
  }
5943
- declare class ScrollBar extends Component<Props$g> {
5987
+ declare class ScrollBar extends Component<Props$h> {
5944
5988
  static template: string;
5945
5989
  static defaultProps: {
5946
5990
  width: number;
@@ -5954,10 +5998,10 @@ declare class ScrollBar extends Component<Props$g> {
5954
5998
  onScroll(ev: any): void;
5955
5999
  }
5956
6000
 
5957
- interface Props$f {
6001
+ interface Props$g {
5958
6002
  leftOffset: number;
5959
6003
  }
5960
- declare class HorizontalScrollBar extends Component<Props$f, SpreadsheetChildEnv> {
6004
+ declare class HorizontalScrollBar extends Component<Props$g, SpreadsheetChildEnv> {
5961
6005
  static components: {
5962
6006
  ScrollBar: typeof ScrollBar;
5963
6007
  };
@@ -5977,10 +6021,10 @@ declare class HorizontalScrollBar extends Component<Props$f, SpreadsheetChildEnv
5977
6021
  onScroll(offset: any): void;
5978
6022
  }
5979
6023
 
5980
- interface Props$e {
6024
+ interface Props$f {
5981
6025
  topOffset: number;
5982
6026
  }
5983
- declare class VerticalScrollBar extends Component<Props$e, SpreadsheetChildEnv> {
6027
+ declare class VerticalScrollBar extends Component<Props$f, SpreadsheetChildEnv> {
5984
6028
  static components: {
5985
6029
  ScrollBar: typeof ScrollBar;
5986
6030
  };
@@ -6000,7 +6044,7 @@ declare class VerticalScrollBar extends Component<Props$e, SpreadsheetChildEnv>
6000
6044
  onScroll(offset: any): void;
6001
6045
  }
6002
6046
 
6003
- interface Props$d {
6047
+ interface Props$e {
6004
6048
  }
6005
6049
  interface ClickableCell {
6006
6050
  coordinates: Rect;
@@ -6008,7 +6052,7 @@ interface ClickableCell {
6008
6052
  action: (position: CellPosition, env: SpreadsheetChildEnv) => void;
6009
6053
  tKey: string;
6010
6054
  }
6011
- declare class SpreadsheetDashboard extends Component<Props$d, SpreadsheetChildEnv> {
6055
+ declare class SpreadsheetDashboard extends Component<Props$e, SpreadsheetChildEnv> {
6012
6056
  static template: string;
6013
6057
  static components: {
6014
6058
  GridOverlay: typeof GridOverlay;
@@ -6044,17 +6088,17 @@ declare class SpreadsheetDashboard extends Component<Props$d, SpreadsheetChildEn
6044
6088
  private getGridRect;
6045
6089
  }
6046
6090
 
6047
- interface Props$c {
6091
+ interface Props$d {
6048
6092
  component: string;
6049
6093
  panelProps: any;
6050
6094
  onCloseSidePanel: () => void;
6051
6095
  }
6052
- interface State$2 {
6096
+ interface State$4 {
6053
6097
  panel: SidePanelContent;
6054
6098
  }
6055
- declare class SidePanel extends Component<Props$c, SpreadsheetChildEnv> {
6099
+ declare class SidePanel extends Component<Props$d, SpreadsheetChildEnv> {
6056
6100
  static template: string;
6057
- state: State$2;
6101
+ state: State$4;
6058
6102
  setup(): void;
6059
6103
  getTitle(): string;
6060
6104
  }
@@ -6161,17 +6205,6 @@ declare const fillColor: ActionSpec;
6161
6205
  declare const formatCF: ActionSpec;
6162
6206
  declare const paintFormat: ActionSpec;
6163
6207
  declare const clearFormat: ActionSpec;
6164
- declare const borders: ActionSpec;
6165
- declare const bordersAll: ActionSpec;
6166
- declare const bordersInner: ActionSpec;
6167
- declare const bordersHorizontal: ActionSpec;
6168
- declare const bordersVertical: ActionSpec;
6169
- declare const bordersExternal: ActionSpec;
6170
- declare const bordersLeft: ActionSpec;
6171
- declare const bordersTop: ActionSpec;
6172
- declare const bordersRight: ActionSpec;
6173
- declare const bordersBottom: ActionSpec;
6174
- declare const bordersClear: ActionSpec;
6175
6208
 
6176
6209
  declare const ACTION_FORMAT_formatNumberAutomatic: typeof formatNumberAutomatic;
6177
6210
  declare const ACTION_FORMAT_formatNumberNumber: typeof formatNumberNumber;
@@ -6209,17 +6242,6 @@ declare const ACTION_FORMAT_fillColor: typeof fillColor;
6209
6242
  declare const ACTION_FORMAT_formatCF: typeof formatCF;
6210
6243
  declare const ACTION_FORMAT_paintFormat: typeof paintFormat;
6211
6244
  declare const ACTION_FORMAT_clearFormat: typeof clearFormat;
6212
- declare const ACTION_FORMAT_borders: typeof borders;
6213
- declare const ACTION_FORMAT_bordersAll: typeof bordersAll;
6214
- declare const ACTION_FORMAT_bordersInner: typeof bordersInner;
6215
- declare const ACTION_FORMAT_bordersHorizontal: typeof bordersHorizontal;
6216
- declare const ACTION_FORMAT_bordersVertical: typeof bordersVertical;
6217
- declare const ACTION_FORMAT_bordersExternal: typeof bordersExternal;
6218
- declare const ACTION_FORMAT_bordersLeft: typeof bordersLeft;
6219
- declare const ACTION_FORMAT_bordersTop: typeof bordersTop;
6220
- declare const ACTION_FORMAT_bordersRight: typeof bordersRight;
6221
- declare const ACTION_FORMAT_bordersBottom: typeof bordersBottom;
6222
- declare const ACTION_FORMAT_bordersClear: typeof bordersClear;
6223
6245
  declare namespace ACTION_FORMAT {
6224
6246
  export {
6225
6247
  ACTION_FORMAT_formatNumberAutomatic as formatNumberAutomatic,
@@ -6258,17 +6280,6 @@ declare namespace ACTION_FORMAT {
6258
6280
  ACTION_FORMAT_formatCF as formatCF,
6259
6281
  ACTION_FORMAT_paintFormat as paintFormat,
6260
6282
  ACTION_FORMAT_clearFormat as clearFormat,
6261
- ACTION_FORMAT_borders as borders,
6262
- ACTION_FORMAT_bordersAll as bordersAll,
6263
- ACTION_FORMAT_bordersInner as bordersInner,
6264
- ACTION_FORMAT_bordersHorizontal as bordersHorizontal,
6265
- ACTION_FORMAT_bordersVertical as bordersVertical,
6266
- ACTION_FORMAT_bordersExternal as bordersExternal,
6267
- ACTION_FORMAT_bordersLeft as bordersLeft,
6268
- ACTION_FORMAT_bordersTop as bordersTop,
6269
- ACTION_FORMAT_bordersRight as bordersRight,
6270
- ACTION_FORMAT_bordersBottom as bordersBottom,
6271
- ACTION_FORMAT_bordersClear as bordersClear,
6272
6283
  };
6273
6284
  }
6274
6285
 
@@ -6335,14 +6346,14 @@ declare namespace ACTION_VIEW {
6335
6346
  };
6336
6347
  }
6337
6348
 
6338
- interface Props$b {
6349
+ interface Props$c {
6339
6350
  action: ActionSpec;
6340
6351
  hasTriangleDownIcon?: boolean;
6341
6352
  selectedColor?: string;
6342
6353
  class?: string;
6343
6354
  onClick?: (ev: MouseEvent) => void;
6344
6355
  }
6345
- declare class ActionButton extends Component<Props$b, SpreadsheetChildEnv> {
6356
+ declare class ActionButton extends Component<Props$c, SpreadsheetChildEnv> {
6346
6357
  static template: string;
6347
6358
  private actionButton;
6348
6359
  setup(): void;
@@ -6355,6 +6366,71 @@ declare class ActionButton extends Component<Props$b, SpreadsheetChildEnv> {
6355
6366
  get buttonStyle(): string;
6356
6367
  }
6357
6368
 
6369
+ declare type Tool = "borderColorTool" | "borderTypeTool";
6370
+ interface State$3 {
6371
+ activeTool: Tool | undefined;
6372
+ }
6373
+ interface BorderEditorProps {
6374
+ class?: string;
6375
+ currentBorderColor: Color;
6376
+ currentBorderStyle: BorderStyle;
6377
+ currentBorderPosition: BorderPosition | undefined;
6378
+ onBorderColorPicked: (color: Color) => void;
6379
+ onBorderStylePicked: (style: BorderStyle) => void;
6380
+ onBorderPositionPicked: (position: BorderPosition) => void;
6381
+ maxHeight?: Pixel;
6382
+ anchorRect: Rect;
6383
+ }
6384
+ declare class BorderEditor extends Component<BorderEditorProps, SpreadsheetChildEnv> {
6385
+ static template: string;
6386
+ static components: {
6387
+ ColorPickerWidget: typeof ColorPickerWidget;
6388
+ Popover: typeof Popover;
6389
+ };
6390
+ BORDER_POSITIONS: [BorderPosition, string][][];
6391
+ lineStyleButtonRef: {
6392
+ el: HTMLElement | null;
6393
+ };
6394
+ borderStyles: readonly ["thin", "medium", "thick", "dashed", "dotted"];
6395
+ state: State$3;
6396
+ toggleDropdownTool(tool: Tool): void;
6397
+ closeDropdown(): void;
6398
+ setBorderPosition(position: BorderPosition): void;
6399
+ setBorderColor(color: Color): void;
6400
+ setBorderStyle(style: BorderStyle): void;
6401
+ get lineStylePickerPopoverProps(): PopoverProps;
6402
+ get popoverProps(): PopoverProps;
6403
+ get lineStylePickerAnchorRect(): Rect;
6404
+ }
6405
+
6406
+ interface Props$b {
6407
+ toggleBorderEditor: () => void;
6408
+ showBorderEditor: boolean;
6409
+ disabled?: boolean;
6410
+ dropdownMaxHeight?: Pixel;
6411
+ class?: string;
6412
+ }
6413
+ interface State$2 {
6414
+ currentColor: Color;
6415
+ currentStyle: BorderStyle;
6416
+ currentPosition: BorderPosition | undefined;
6417
+ }
6418
+ declare class BorderEditorWidget extends Component<Props$b, SpreadsheetChildEnv> {
6419
+ static template: string;
6420
+ static components: {
6421
+ BorderEditor: typeof BorderEditor;
6422
+ };
6423
+ borderEditorButtonRef: {
6424
+ el: HTMLElement | null;
6425
+ };
6426
+ state: State$2;
6427
+ get borderEditorAnchorRect(): Rect;
6428
+ onBorderPositionPicked(position: BorderPosition): void;
6429
+ onBorderColorPicked(color: Color): void;
6430
+ onBorderStylePicked(style: BorderStyle): void;
6431
+ private updateBorder;
6432
+ }
6433
+
6358
6434
  interface Props$a {
6359
6435
  values: AutocompleteValue[];
6360
6436
  selectedIndex: number;
@@ -6396,7 +6472,24 @@ declare class ContentEditableHelper {
6396
6472
  start: number;
6397
6473
  end: number;
6398
6474
  };
6399
- private findSizeBeforeElement;
6475
+ /**
6476
+ * Computes the text 'index' inside this.el based on the currently selected node and its offset.
6477
+ * The selected node is either a Text node or an Element node.
6478
+ *
6479
+ * case 1 -Text node:
6480
+ * the offset is the number of characters from the start of the node. We have to add this offset to the
6481
+ * content length of all previous nodes.
6482
+ *
6483
+ * case 2 - Element node:
6484
+ * the offset is the number of child nodes before the selected node. We have to add the content length of
6485
+ * all the bnodes prior to the selected node as well as the content of the child node before the offset.
6486
+ *
6487
+ * See the MDN documentation for more details.
6488
+ * https://developer.mozilla.org/en-US/docs/Web/API/Range/startOffset
6489
+ * https://developer.mozilla.org/en-US/docs/Web/API/Range/endOffset
6490
+ *
6491
+ */
6492
+ private findSelectionIndex;
6400
6493
  private getStartAndEndSelection;
6401
6494
  getText(): string;
6402
6495
  }
@@ -6573,6 +6666,7 @@ declare class TopBar extends Component<Props$6, SpreadsheetChildEnv> {
6573
6666
  TopBarComposer: typeof TopBarComposer;
6574
6667
  FontSizeEditor: typeof FontSizeEditor;
6575
6668
  ActionButton: typeof ActionButton;
6669
+ BorderEditorWidget: typeof BorderEditorWidget;
6576
6670
  };
6577
6671
  state: State;
6578
6672
  isSelectingMenu: boolean;