@odoo/o-spreadsheet 18.5.0-alpha.0 → 18.5.0-alpha.1

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 18.5.0-alpha.0
6
- * @date 2025-06-24T12:26:38.163Z
7
- * @hash ed0f325
5
+ * @version 18.5.0-alpha.1
6
+ * @date 2025-06-27T09:12:49.245Z
7
+ * @hash 756e75b
8
8
  */
9
9
 
10
10
  'use strict';
@@ -26510,6 +26510,51 @@ cellAnimationRegistry.add("textFadeOut", {
26510
26510
  Object.assign(animatedBox.style, style);
26511
26511
  },
26512
26512
  });
26513
+ cellAnimationRegistry.add("iconFadeIn", {
26514
+ id: "iconFadeIn",
26515
+ easingFn: "easeInCubic",
26516
+ hasAnimation: (oldBox, newBox) => {
26517
+ return Boolean((!oldBox?.icons?.left && newBox?.icons?.left) ||
26518
+ (!oldBox?.icons?.right && newBox?.icons?.right) ||
26519
+ (!oldBox?.icons?.center && newBox?.icons?.center));
26520
+ },
26521
+ updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26522
+ const iconOpacity = EASING_FN[this.easingFn](progress);
26523
+ if (animatedBox.icons.left && newBox.icons.left && !oldBox.icons.left) {
26524
+ animatedBox.icons.left.opacity = iconOpacity;
26525
+ }
26526
+ if (animatedBox.icons.right && newBox.icons.right && !oldBox.icons.right) {
26527
+ animatedBox.icons.right.opacity = iconOpacity;
26528
+ }
26529
+ if (animatedBox.icons.center && newBox.icons.center && !oldBox.icons.center) {
26530
+ animatedBox.icons.center.opacity = iconOpacity;
26531
+ }
26532
+ },
26533
+ });
26534
+ cellAnimationRegistry.add("iconFadeOut", {
26535
+ id: "iconFadeOut",
26536
+ easingFn: "easeOutCubic",
26537
+ hasAnimation: (oldBox, newBox) => {
26538
+ return Boolean((oldBox?.icons?.left && !newBox?.icons?.left) ||
26539
+ (oldBox?.icons?.right && !newBox?.icons?.right) ||
26540
+ (oldBox?.icons?.center && !newBox?.icons?.center));
26541
+ },
26542
+ updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26543
+ const iconOpacity = 1 - EASING_FN[this.easingFn](progress);
26544
+ if (!animatedBox.icons) {
26545
+ animatedBox.icons = {};
26546
+ }
26547
+ if (oldBox.icons.left && !newBox.icons.left) {
26548
+ animatedBox.icons.left = { ...oldBox.icons.left, opacity: iconOpacity };
26549
+ }
26550
+ if (oldBox.icons.right && !newBox.icons.right) {
26551
+ animatedBox.icons.right = { ...oldBox.icons.right, opacity: iconOpacity };
26552
+ }
26553
+ if (oldBox.icons.center && !newBox.icons.center) {
26554
+ animatedBox.icons.center = { ...oldBox.icons.center, opacity: iconOpacity };
26555
+ }
26556
+ },
26557
+ });
26513
26558
  cellAnimationRegistry.add("textChange", {
26514
26559
  id: "textChange",
26515
26560
  easingFn: "easeOutCubic",
@@ -26518,7 +26563,7 @@ cellAnimationRegistry.add("textChange", {
26518
26563
  const newText = newBox?.content?.textLines?.join("\n");
26519
26564
  // Note: here, we also animate changes to icons layout (margins/size change, or icon appearing/disappearing)
26520
26565
  // because a change to the icon layout will impact where the text is positioned.
26521
- return (Boolean(oldText && newText && oldText !== newText) || hasIconLayoutChange(newBox, oldBox));
26566
+ return Boolean(oldText && newText && (oldText !== newText || hasIconLayoutChange(newBox, oldBox)));
26522
26567
  },
26523
26568
  updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26524
26569
  const value = EASING_FN[this.easingFn](progress);
@@ -26533,7 +26578,7 @@ cellAnimationRegistry.add("textChange", {
26533
26578
  height: newBox.height,
26534
26579
  style: { ...newBox.style },
26535
26580
  skipCellGridLines: true,
26536
- content: newBox.content,
26581
+ content: newBox.content ? { ...newBox.content } : undefined,
26537
26582
  clipRect: newBox.clipRect || {
26538
26583
  ...newBox,
26539
26584
  // large width to avoid clipping the text it it didn't have a clipRect before,
@@ -26553,7 +26598,7 @@ cellAnimationRegistry.add("textChange", {
26553
26598
  height: newBox.height,
26554
26599
  style: { ...oldBox.style },
26555
26600
  skipCellGridLines: true,
26556
- content: oldBox.content,
26601
+ content: oldBox.content ? { ...oldBox.content } : undefined,
26557
26602
  clipRect: oldBox.clipRect || {
26558
26603
  ...newBox,
26559
26604
  x: Math.max(0, newBox.x - (oldBox.content?.width || 0)),
@@ -32665,7 +32710,7 @@ class AbstractComposerStore extends SpreadsheetStore {
32665
32710
  }
32666
32711
  captureSelection(zone, col, row) {
32667
32712
  this.model.selection.capture(this, {
32668
- cell: { col: col || zone.left, row: row || zone.right },
32713
+ cell: { col: col ?? zone.left, row: row ?? zone.right },
32669
32714
  zone,
32670
32715
  }, {
32671
32716
  handleEvent: this.handleEvent.bind(this),
@@ -47945,6 +47990,7 @@ class GridRenderer extends SpreadsheetStore {
47945
47990
  continue;
47946
47991
  }
47947
47992
  ctx.save();
47993
+ ctx.globalAlpha = icon.opacity ?? 1;
47948
47994
  ctx.beginPath();
47949
47995
  const clipRect = icon.clipRect || box;
47950
47996
  ctx.rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
@@ -52333,6 +52379,9 @@ class ConditionalFormattingPanel extends owl.Component {
52333
52379
  this.switchToList();
52334
52380
  }
52335
52381
  }
52382
+ else if (!this.editedCF) {
52383
+ this.switchToList();
52384
+ }
52336
52385
  });
52337
52386
  }
52338
52387
  get conditionalFormats() {
@@ -68432,9 +68481,9 @@ autofillModifiersRegistry
68432
68481
  .add("ALPHANUMERIC_INCREMENT_MODIFIER", {
68433
68482
  apply: (rule, data) => {
68434
68483
  rule.current += rule.increment;
68435
- const content = `${rule.prefix}${rule.current
68436
- .toString()
68437
- .padStart(rule.numberPostfixLength || 0, "0")}`;
68484
+ let value = Math.abs(rule.current).toString();
68485
+ value = "0".repeat(Math.max(rule.numberPostfixLength - value.length, 0)) + value;
68486
+ const content = `${rule.prefix}${value}`;
68438
68487
  return {
68439
68488
  cellData: {
68440
68489
  border: data.border,
@@ -68552,6 +68601,7 @@ const autofillRulesRegistry = new Registry();
68552
68601
  const numberPostfixRegExp = /(\d+)$/;
68553
68602
  const stringPrefixRegExp = /^(.*\D+)/;
68554
68603
  const alphaNumericValueRegExp = /^(.*\D+)(\d+)$/;
68604
+ const leadingZerosRegex = /^0*/;
68555
68605
  /**
68556
68606
  * Get the consecutive evaluated cells that can pass the filter function (e.g. certain type filter).
68557
68607
  * Return the one which contains the given cell
@@ -68683,12 +68733,18 @@ autofillRulesRegistry
68683
68733
  generateRule: (cell, cells, direction) => {
68684
68734
  const numberPostfix = parseInt(cell.content.match(numberPostfixRegExp)[0]);
68685
68735
  const prefix = cell.content.match(stringPrefixRegExp)[0];
68686
- const numberPostfixLength = cell.content.length - prefix.length;
68687
68736
  const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === CellValueType.text &&
68688
- alphaNumericValueRegExp.test(evaluatedCell.value)) // get consecutive alphanumeric cells, no matter what the prefix is
68737
+ alphaNumericValueRegExp.test(evaluatedCell.value))
68738
+ // get consecutive alphanumeric cells, no matter what the prefix is
68689
68739
  .filter((cell) => prefix === (cell.value ?? "").toString().match(stringPrefixRegExp)[0])
68690
- .map((cell) => parseInt((cell.value ?? "").toString().match(numberPostfixRegExp)[0]));
68691
- let increment = calculateIncrementBasedOnGroup(group);
68740
+ .map((cell) => (cell.value ?? "").toString().match(numberPostfixRegExp)[0]);
68741
+ // find the length of number with the most leading zeros
68742
+ const mostLeadingZeros = group.reduce((candidate, current) => {
68743
+ const currentLength = current.match(leadingZerosRegex)[0].length;
68744
+ return currentLength > candidate[1] ? [current, currentLength] : candidate;
68745
+ }, [group[0], 0]);
68746
+ const numberPostfixLength = mostLeadingZeros[1] ? mostLeadingZeros[0].length : 0;
68747
+ let increment = calculateIncrementBasedOnGroup(group.map((x) => parseInt(x)));
68692
68748
  if (["up", "left"].includes(direction) && group.length === 1) {
68693
68749
  increment = -increment;
68694
68750
  }
@@ -80983,26 +81039,28 @@ class SelectionStreamProcessorImpl {
80983
81039
  bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
80984
81040
  };
80985
81041
  };
80986
- const { col: refCol, row: refRow } = this.getReferencePosition();
81042
+ const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
81043
+ const { col: refCol, row: refRow } = refCell;
80987
81044
  // check if we can shrink selection
80988
81045
  let n = 0;
80989
81046
  while (result !== null) {
80990
81047
  n++;
80991
81048
  if (deltaCol < 0) {
80992
81049
  const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
80993
- result = refCol <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
81050
+ result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
80994
81051
  }
80995
81052
  if (deltaCol > 0) {
80996
81053
  const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
80997
- result = left + n <= refCol ? expand({ top, left: newLeft, bottom, right }) : null;
81054
+ result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
80998
81055
  }
80999
81056
  if (deltaRow < 0) {
81000
81057
  const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
81001
- result = refRow <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
81058
+ result =
81059
+ refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
81002
81060
  }
81003
81061
  if (deltaRow > 0) {
81004
81062
  const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
81005
- result = top + n <= refRow ? expand({ top: newTop, left, bottom, right }) : null;
81063
+ result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
81006
81064
  }
81007
81065
  result = result ? reorderZone(result) : result;
81008
81066
  if (result && !isEqual(result, anchor.zone)) {
@@ -81232,18 +81290,26 @@ class SelectionStreamProcessorImpl {
81232
81290
  * If the anchor is hidden, browses from left to right and top to bottom to
81233
81291
  * find a visible cell.
81234
81292
  */
81235
- getReferencePosition() {
81293
+ getReferenceAnchor() {
81236
81294
  const sheetId = this.getters.getActiveSheetId();
81237
81295
  const anchor = this.anchor;
81238
81296
  const { left, right, top, bottom } = anchor.zone;
81239
81297
  const { col: anchorCol, row: anchorRow } = anchor.cell;
81298
+ const col = this.getters.isColHidden(sheetId, anchorCol)
81299
+ ? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
81300
+ : anchorCol;
81301
+ const row = this.getters.isRowHidden(sheetId, anchorRow)
81302
+ ? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
81303
+ : anchorRow;
81304
+ const zone = this.getters.expandZone(sheetId, {
81305
+ left: col,
81306
+ right: col,
81307
+ top: row,
81308
+ bottom: row,
81309
+ });
81240
81310
  return {
81241
- col: this.getters.isColHidden(sheetId, anchorCol)
81242
- ? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
81243
- : anchorCol,
81244
- row: this.getters.isRowHidden(sheetId, anchorRow)
81245
- ? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
81246
- : anchorRow,
81311
+ cell: { col, row },
81312
+ zone,
81247
81313
  };
81248
81314
  }
81249
81315
  deltaToTarget(position, direction, step) {
@@ -84465,6 +84531,6 @@ exports.tokenColors = tokenColors;
84465
84531
  exports.tokenize = tokenize;
84466
84532
 
84467
84533
 
84468
- __info__.version = "18.5.0-alpha.0";
84469
- __info__.date = "2025-06-24T12:26:38.163Z";
84470
- __info__.hash = "ed0f325";
84534
+ __info__.version = "18.5.0-alpha.1";
84535
+ __info__.date = "2025-06-27T09:12:49.245Z";
84536
+ __info__.hash = "756e75b";
@@ -6571,6 +6571,7 @@ type RenderingBorder = {
6571
6571
  };
6572
6572
  type RenderingGridIcon = GridIcon & {
6573
6573
  clipRect?: Rect;
6574
+ opacity?: number;
6574
6575
  };
6575
6576
  interface RenderingBox {
6576
6577
  id: string;
@@ -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 18.5.0-alpha.0
6
- * @date 2025-06-24T12:26:38.163Z
7
- * @hash ed0f325
5
+ * @version 18.5.0-alpha.1
6
+ * @date 2025-06-27T09:12:49.245Z
7
+ * @hash 756e75b
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, useExternalListener, onWillUpdateProps, onWillStart, onWillPatch, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -26508,6 +26508,51 @@ cellAnimationRegistry.add("textFadeOut", {
26508
26508
  Object.assign(animatedBox.style, style);
26509
26509
  },
26510
26510
  });
26511
+ cellAnimationRegistry.add("iconFadeIn", {
26512
+ id: "iconFadeIn",
26513
+ easingFn: "easeInCubic",
26514
+ hasAnimation: (oldBox, newBox) => {
26515
+ return Boolean((!oldBox?.icons?.left && newBox?.icons?.left) ||
26516
+ (!oldBox?.icons?.right && newBox?.icons?.right) ||
26517
+ (!oldBox?.icons?.center && newBox?.icons?.center));
26518
+ },
26519
+ updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26520
+ const iconOpacity = EASING_FN[this.easingFn](progress);
26521
+ if (animatedBox.icons.left && newBox.icons.left && !oldBox.icons.left) {
26522
+ animatedBox.icons.left.opacity = iconOpacity;
26523
+ }
26524
+ if (animatedBox.icons.right && newBox.icons.right && !oldBox.icons.right) {
26525
+ animatedBox.icons.right.opacity = iconOpacity;
26526
+ }
26527
+ if (animatedBox.icons.center && newBox.icons.center && !oldBox.icons.center) {
26528
+ animatedBox.icons.center.opacity = iconOpacity;
26529
+ }
26530
+ },
26531
+ });
26532
+ cellAnimationRegistry.add("iconFadeOut", {
26533
+ id: "iconFadeOut",
26534
+ easingFn: "easeOutCubic",
26535
+ hasAnimation: (oldBox, newBox) => {
26536
+ return Boolean((oldBox?.icons?.left && !newBox?.icons?.left) ||
26537
+ (oldBox?.icons?.right && !newBox?.icons?.right) ||
26538
+ (oldBox?.icons?.center && !newBox?.icons?.center));
26539
+ },
26540
+ updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26541
+ const iconOpacity = 1 - EASING_FN[this.easingFn](progress);
26542
+ if (!animatedBox.icons) {
26543
+ animatedBox.icons = {};
26544
+ }
26545
+ if (oldBox.icons.left && !newBox.icons.left) {
26546
+ animatedBox.icons.left = { ...oldBox.icons.left, opacity: iconOpacity };
26547
+ }
26548
+ if (oldBox.icons.right && !newBox.icons.right) {
26549
+ animatedBox.icons.right = { ...oldBox.icons.right, opacity: iconOpacity };
26550
+ }
26551
+ if (oldBox.icons.center && !newBox.icons.center) {
26552
+ animatedBox.icons.center = { ...oldBox.icons.center, opacity: iconOpacity };
26553
+ }
26554
+ },
26555
+ });
26511
26556
  cellAnimationRegistry.add("textChange", {
26512
26557
  id: "textChange",
26513
26558
  easingFn: "easeOutCubic",
@@ -26516,7 +26561,7 @@ cellAnimationRegistry.add("textChange", {
26516
26561
  const newText = newBox?.content?.textLines?.join("\n");
26517
26562
  // Note: here, we also animate changes to icons layout (margins/size change, or icon appearing/disappearing)
26518
26563
  // because a change to the icon layout will impact where the text is positioned.
26519
- return (Boolean(oldText && newText && oldText !== newText) || hasIconLayoutChange(newBox, oldBox));
26564
+ return Boolean(oldText && newText && (oldText !== newText || hasIconLayoutChange(newBox, oldBox)));
26520
26565
  },
26521
26566
  updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26522
26567
  const value = EASING_FN[this.easingFn](progress);
@@ -26531,7 +26576,7 @@ cellAnimationRegistry.add("textChange", {
26531
26576
  height: newBox.height,
26532
26577
  style: { ...newBox.style },
26533
26578
  skipCellGridLines: true,
26534
- content: newBox.content,
26579
+ content: newBox.content ? { ...newBox.content } : undefined,
26535
26580
  clipRect: newBox.clipRect || {
26536
26581
  ...newBox,
26537
26582
  // large width to avoid clipping the text it it didn't have a clipRect before,
@@ -26551,7 +26596,7 @@ cellAnimationRegistry.add("textChange", {
26551
26596
  height: newBox.height,
26552
26597
  style: { ...oldBox.style },
26553
26598
  skipCellGridLines: true,
26554
- content: oldBox.content,
26599
+ content: oldBox.content ? { ...oldBox.content } : undefined,
26555
26600
  clipRect: oldBox.clipRect || {
26556
26601
  ...newBox,
26557
26602
  x: Math.max(0, newBox.x - (oldBox.content?.width || 0)),
@@ -32663,7 +32708,7 @@ class AbstractComposerStore extends SpreadsheetStore {
32663
32708
  }
32664
32709
  captureSelection(zone, col, row) {
32665
32710
  this.model.selection.capture(this, {
32666
- cell: { col: col || zone.left, row: row || zone.right },
32711
+ cell: { col: col ?? zone.left, row: row ?? zone.right },
32667
32712
  zone,
32668
32713
  }, {
32669
32714
  handleEvent: this.handleEvent.bind(this),
@@ -47943,6 +47988,7 @@ class GridRenderer extends SpreadsheetStore {
47943
47988
  continue;
47944
47989
  }
47945
47990
  ctx.save();
47991
+ ctx.globalAlpha = icon.opacity ?? 1;
47946
47992
  ctx.beginPath();
47947
47993
  const clipRect = icon.clipRect || box;
47948
47994
  ctx.rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
@@ -52331,6 +52377,9 @@ class ConditionalFormattingPanel extends Component {
52331
52377
  this.switchToList();
52332
52378
  }
52333
52379
  }
52380
+ else if (!this.editedCF) {
52381
+ this.switchToList();
52382
+ }
52334
52383
  });
52335
52384
  }
52336
52385
  get conditionalFormats() {
@@ -68430,9 +68479,9 @@ autofillModifiersRegistry
68430
68479
  .add("ALPHANUMERIC_INCREMENT_MODIFIER", {
68431
68480
  apply: (rule, data) => {
68432
68481
  rule.current += rule.increment;
68433
- const content = `${rule.prefix}${rule.current
68434
- .toString()
68435
- .padStart(rule.numberPostfixLength || 0, "0")}`;
68482
+ let value = Math.abs(rule.current).toString();
68483
+ value = "0".repeat(Math.max(rule.numberPostfixLength - value.length, 0)) + value;
68484
+ const content = `${rule.prefix}${value}`;
68436
68485
  return {
68437
68486
  cellData: {
68438
68487
  border: data.border,
@@ -68550,6 +68599,7 @@ const autofillRulesRegistry = new Registry();
68550
68599
  const numberPostfixRegExp = /(\d+)$/;
68551
68600
  const stringPrefixRegExp = /^(.*\D+)/;
68552
68601
  const alphaNumericValueRegExp = /^(.*\D+)(\d+)$/;
68602
+ const leadingZerosRegex = /^0*/;
68553
68603
  /**
68554
68604
  * Get the consecutive evaluated cells that can pass the filter function (e.g. certain type filter).
68555
68605
  * Return the one which contains the given cell
@@ -68681,12 +68731,18 @@ autofillRulesRegistry
68681
68731
  generateRule: (cell, cells, direction) => {
68682
68732
  const numberPostfix = parseInt(cell.content.match(numberPostfixRegExp)[0]);
68683
68733
  const prefix = cell.content.match(stringPrefixRegExp)[0];
68684
- const numberPostfixLength = cell.content.length - prefix.length;
68685
68734
  const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === CellValueType.text &&
68686
- alphaNumericValueRegExp.test(evaluatedCell.value)) // get consecutive alphanumeric cells, no matter what the prefix is
68735
+ alphaNumericValueRegExp.test(evaluatedCell.value))
68736
+ // get consecutive alphanumeric cells, no matter what the prefix is
68687
68737
  .filter((cell) => prefix === (cell.value ?? "").toString().match(stringPrefixRegExp)[0])
68688
- .map((cell) => parseInt((cell.value ?? "").toString().match(numberPostfixRegExp)[0]));
68689
- let increment = calculateIncrementBasedOnGroup(group);
68738
+ .map((cell) => (cell.value ?? "").toString().match(numberPostfixRegExp)[0]);
68739
+ // find the length of number with the most leading zeros
68740
+ const mostLeadingZeros = group.reduce((candidate, current) => {
68741
+ const currentLength = current.match(leadingZerosRegex)[0].length;
68742
+ return currentLength > candidate[1] ? [current, currentLength] : candidate;
68743
+ }, [group[0], 0]);
68744
+ const numberPostfixLength = mostLeadingZeros[1] ? mostLeadingZeros[0].length : 0;
68745
+ let increment = calculateIncrementBasedOnGroup(group.map((x) => parseInt(x)));
68690
68746
  if (["up", "left"].includes(direction) && group.length === 1) {
68691
68747
  increment = -increment;
68692
68748
  }
@@ -80981,26 +81037,28 @@ class SelectionStreamProcessorImpl {
80981
81037
  bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
80982
81038
  };
80983
81039
  };
80984
- const { col: refCol, row: refRow } = this.getReferencePosition();
81040
+ const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
81041
+ const { col: refCol, row: refRow } = refCell;
80985
81042
  // check if we can shrink selection
80986
81043
  let n = 0;
80987
81044
  while (result !== null) {
80988
81045
  n++;
80989
81046
  if (deltaCol < 0) {
80990
81047
  const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
80991
- result = refCol <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
81048
+ result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
80992
81049
  }
80993
81050
  if (deltaCol > 0) {
80994
81051
  const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
80995
- result = left + n <= refCol ? expand({ top, left: newLeft, bottom, right }) : null;
81052
+ result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
80996
81053
  }
80997
81054
  if (deltaRow < 0) {
80998
81055
  const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
80999
- result = refRow <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
81056
+ result =
81057
+ refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
81000
81058
  }
81001
81059
  if (deltaRow > 0) {
81002
81060
  const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
81003
- result = top + n <= refRow ? expand({ top: newTop, left, bottom, right }) : null;
81061
+ result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
81004
81062
  }
81005
81063
  result = result ? reorderZone(result) : result;
81006
81064
  if (result && !isEqual(result, anchor.zone)) {
@@ -81230,18 +81288,26 @@ class SelectionStreamProcessorImpl {
81230
81288
  * If the anchor is hidden, browses from left to right and top to bottom to
81231
81289
  * find a visible cell.
81232
81290
  */
81233
- getReferencePosition() {
81291
+ getReferenceAnchor() {
81234
81292
  const sheetId = this.getters.getActiveSheetId();
81235
81293
  const anchor = this.anchor;
81236
81294
  const { left, right, top, bottom } = anchor.zone;
81237
81295
  const { col: anchorCol, row: anchorRow } = anchor.cell;
81296
+ const col = this.getters.isColHidden(sheetId, anchorCol)
81297
+ ? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
81298
+ : anchorCol;
81299
+ const row = this.getters.isRowHidden(sheetId, anchorRow)
81300
+ ? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
81301
+ : anchorRow;
81302
+ const zone = this.getters.expandZone(sheetId, {
81303
+ left: col,
81304
+ right: col,
81305
+ top: row,
81306
+ bottom: row,
81307
+ });
81238
81308
  return {
81239
- col: this.getters.isColHidden(sheetId, anchorCol)
81240
- ? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
81241
- : anchorCol,
81242
- row: this.getters.isRowHidden(sheetId, anchorRow)
81243
- ? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
81244
- : anchorRow,
81309
+ cell: { col, row },
81310
+ zone,
81245
81311
  };
81246
81312
  }
81247
81313
  deltaToTarget(position, direction, step) {
@@ -84415,6 +84481,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
84415
84481
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
84416
84482
 
84417
84483
 
84418
- __info__.version = "18.5.0-alpha.0";
84419
- __info__.date = "2025-06-24T12:26:38.163Z";
84420
- __info__.hash = "ed0f325";
84484
+ __info__.version = "18.5.0-alpha.1";
84485
+ __info__.date = "2025-06-27T09:12:49.245Z";
84486
+ __info__.hash = "756e75b";