@odoo/o-spreadsheet 16.0.54 → 16.0.56

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.
@@ -9974,6 +9974,9 @@ class ConditionalFormattingPanel extends owl.Component {
9974
9974
  }
9975
9975
  }
9976
9976
  setColorScaleColor(target, color) {
9977
+ if (!isColorValid(color)) {
9978
+ return;
9979
+ }
9977
9980
  const point = this.state.rules.colorScale[target];
9978
9981
  if (point) {
9979
9982
  point.color = Number.parseInt(color.substr(1), 16);
@@ -10685,15 +10688,23 @@ class ChartFigure extends owl.Component {
10685
10688
  ChartFigure.template = "o-spreadsheet-ChartFigure";
10686
10689
  ChartFigure.components = { Menu };
10687
10690
 
10691
+ /**
10692
+ * Start listening to pointer events and apply the given callbacks.
10693
+ *
10694
+ * @returns A function to remove the listeners.
10695
+ */
10688
10696
  function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
10689
- const _onMouseUp = (ev) => {
10690
- onMouseUp(ev);
10697
+ const removeListeners = () => {
10691
10698
  window.removeEventListener("mousedown", onMouseDown);
10692
10699
  window.removeEventListener("mouseup", _onMouseUp);
10693
10700
  window.removeEventListener("dragstart", _onDragStart);
10694
10701
  window.removeEventListener("mousemove", onMouseMove);
10695
10702
  window.removeEventListener("wheel", onMouseMove);
10696
10703
  };
10704
+ const _onMouseUp = (ev) => {
10705
+ onMouseUp(ev);
10706
+ removeListeners();
10707
+ };
10697
10708
  function _onDragStart(ev) {
10698
10709
  ev.preventDefault();
10699
10710
  }
@@ -10702,6 +10713,7 @@ function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
10702
10713
  window.addEventListener("dragstart", _onDragStart);
10703
10714
  window.addEventListener("mousemove", onMouseMove);
10704
10715
  window.addEventListener("wheel", onMouseMove);
10716
+ return removeListeners;
10705
10717
  }
10706
10718
  /**
10707
10719
  * Function to be used during a mousedown event, this function allows to
@@ -18396,13 +18408,12 @@ function tokenizeSymbol(chars) {
18396
18408
  }
18397
18409
  const whiteSpaceRegexp = /\s/;
18398
18410
  function tokenizeSpace(chars) {
18399
- let length = 0;
18411
+ let spaces = "";
18400
18412
  while (chars[0] && chars[0].match(whiteSpaceRegexp)) {
18401
- length++;
18402
- chars.shift();
18413
+ spaces += chars.shift();
18403
18414
  }
18404
- if (length) {
18405
- return { type: "SPACE", value: " ".repeat(length) };
18415
+ if (spaces) {
18416
+ return { type: "SPACE", value: spaces };
18406
18417
  }
18407
18418
  return null;
18408
18419
  }
@@ -20429,11 +20440,11 @@ css /* scss */ `
20429
20440
  }
20430
20441
 
20431
20442
  /* Custom css to highlight topbar composer on focus */
20432
- .o-topbar-toolbar .o-composer-container:focus-within {
20433
- border: 1px solid ${SELECTION_BORDER_COLOR};
20443
+ .o-topbar-toolbar .o-composer-container[active] {
20444
+ border: 1px solid ${SELECTION_BORDER_COLOR} !important;
20434
20445
  }
20435
20446
 
20436
- .o-topbar-toolbar .o-composer-container {
20447
+ .o-topbar-toolbar .o-composer-container[active] {
20437
20448
  z-index: ${ComponentsImportance.TopBarComposer};
20438
20449
  }
20439
20450
  `;
@@ -21382,6 +21393,7 @@ class FiguresContainer extends owl.Component {
21382
21393
  y: 0,
21383
21394
  width: 0,
21384
21395
  height: 0,
21396
+ cancelDnd: undefined,
21385
21397
  });
21386
21398
  }
21387
21399
  setup() {
@@ -21395,11 +21407,24 @@ class FiguresContainer extends owl.Component {
21395
21407
  // new rendering
21396
21408
  this.render();
21397
21409
  });
21410
+ owl.onWillUpdateProps(() => {
21411
+ const sheetId = this.env.model.getters.getActiveSheetId();
21412
+ if (this.dnd.figId && !this.env.model.getters.getFigure(sheetId, this.dnd.figId)) {
21413
+ if (this.dnd.cancelDnd) {
21414
+ this.dnd.cancelDnd();
21415
+ }
21416
+ this.dnd.figId = undefined;
21417
+ this.dnd.cancelDnd = undefined;
21418
+ }
21419
+ });
21398
21420
  }
21399
21421
  getVisibleFigures() {
21400
21422
  const visibleFigures = this.env.model.getters.getVisibleFigures();
21401
21423
  if (this.dnd.figId && !visibleFigures.some((figure) => figure.id === this.dnd.figId)) {
21402
- visibleFigures.push(this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.figId));
21424
+ const draggedFigure = this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.figId);
21425
+ if (draggedFigure) {
21426
+ visibleFigures.push(draggedFigure);
21427
+ }
21403
21428
  }
21404
21429
  return visibleFigures;
21405
21430
  }
@@ -21512,7 +21537,7 @@ class FiguresContainer extends owl.Component {
21512
21537
  this.dnd.figId = undefined;
21513
21538
  this.env.model.dispatch("UPDATE_FIGURE", { sheetId, id: figure.id, x, y });
21514
21539
  };
21515
- startDnd(onMouseMove, onMouseUp);
21540
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
21516
21541
  }
21517
21542
  startResize(figure, dirX, dirY, ev) {
21518
21543
  ev.stopPropagation();
@@ -21566,7 +21591,7 @@ class FiguresContainer extends owl.Component {
21566
21591
  ...update,
21567
21592
  });
21568
21593
  };
21569
- startDnd(onMouseMove, onMouseUp);
21594
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
21570
21595
  }
21571
21596
  getDndFigure() {
21572
21597
  const figure = this.getVisibleFigures().find((fig) => fig.id === this.dnd.figId);
@@ -27935,7 +27960,6 @@ class BordersPlugin extends CorePlugin {
27935
27960
  }
27936
27961
  BordersPlugin.getters = ["getCellBorder"];
27937
27962
 
27938
- const nbspRegexp = new RegExp(String.fromCharCode(160), "g");
27939
27963
  const LINK_STYLE = { textColor: LINK_COLOR };
27940
27964
  /**
27941
27965
  * Core Plugin
@@ -28269,13 +28293,10 @@ class CellPlugin extends CorePlugin {
28269
28293
  return id;
28270
28294
  }
28271
28295
  updateCell(sheetId, col, row, after) {
28272
- var _a;
28273
28296
  const before = this.getters.getCell(sheetId, col, row);
28274
28297
  const hasContent = "content" in after || "formula" in after;
28275
28298
  // Compute the new cell properties
28276
- const afterContent = hasContent
28277
- ? ((_a = after.content) === null || _a === void 0 ? void 0 : _a.replace(nbspRegexp, "")) || ""
28278
- : (before === null || before === void 0 ? void 0 : before.content) || "";
28299
+ const afterContent = (hasContent ? after.content : before === null || before === void 0 ? void 0 : before.content) || "";
28279
28300
  let style;
28280
28301
  if (after.style !== undefined) {
28281
28302
  style = after.style || undefined;
@@ -37159,6 +37180,7 @@ class SheetViewPlugin extends UIPlugin {
37159
37180
  break;
37160
37181
  case "DELETE_SHEET":
37161
37182
  this.cleanViewports();
37183
+ this.sheetsWithDirtyViewports.delete(cmd.sheetId);
37162
37184
  break;
37163
37185
  case "ACTIVATE_SHEET":
37164
37186
  this.setViewports();
@@ -37511,6 +37533,9 @@ class SheetViewPlugin extends UIPlugin {
37511
37533
  };
37512
37534
  }
37513
37535
  resetViewports(sheetId) {
37536
+ if (!this.getters.tryGetSheet(sheetId)) {
37537
+ return;
37538
+ }
37514
37539
  const { xSplit, ySplit } = this.getters.getPaneDivisions(sheetId);
37515
37540
  const nCols = this.getters.getNumberCols(sheetId);
37516
37541
  const nRows = this.getters.getNumberRows(sheetId);
@@ -43459,6 +43484,6 @@ exports.setTranslationMethod = setTranslationMethod;
43459
43484
  exports.tokenize = tokenize;
43460
43485
 
43461
43486
 
43462
- __info__.version = '16.0.54';
43463
- __info__.date = '2024-11-08T12:11:01.946Z';
43464
- __info__.hash = 'fdfa7dc';
43487
+ __info__.version = '16.0.56';
43488
+ __info__.date = '2024-12-19T07:45:47.250Z';
43489
+ __info__.hash = '9d0e335';
@@ -4961,6 +4961,7 @@ interface ColorPickerProps {
4961
4961
  dropdownDirection?: "left" | "right" | "center";
4962
4962
  onColorPicked: (color: Color) => void;
4963
4963
  currentColor: Color;
4964
+ disableNoColor?: boolean;
4964
4965
  }
4965
4966
  declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEnv> {
4966
4967
  static template: string;
@@ -5720,6 +5721,7 @@ interface DndState {
5720
5721
  y: Pixel;
5721
5722
  width: Pixel;
5722
5723
  height: Pixel;
5724
+ cancelDnd: (() => void) | undefined;
5723
5725
  }
5724
5726
  interface Props$e {
5725
5727
  sidePanelIsOpen: Boolean;
@@ -9970,6 +9970,9 @@ class ConditionalFormattingPanel extends Component {
9970
9970
  }
9971
9971
  }
9972
9972
  setColorScaleColor(target, color) {
9973
+ if (!isColorValid(color)) {
9974
+ return;
9975
+ }
9973
9976
  const point = this.state.rules.colorScale[target];
9974
9977
  if (point) {
9975
9978
  point.color = Number.parseInt(color.substr(1), 16);
@@ -10681,15 +10684,23 @@ class ChartFigure extends Component {
10681
10684
  ChartFigure.template = "o-spreadsheet-ChartFigure";
10682
10685
  ChartFigure.components = { Menu };
10683
10686
 
10687
+ /**
10688
+ * Start listening to pointer events and apply the given callbacks.
10689
+ *
10690
+ * @returns A function to remove the listeners.
10691
+ */
10684
10692
  function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
10685
- const _onMouseUp = (ev) => {
10686
- onMouseUp(ev);
10693
+ const removeListeners = () => {
10687
10694
  window.removeEventListener("mousedown", onMouseDown);
10688
10695
  window.removeEventListener("mouseup", _onMouseUp);
10689
10696
  window.removeEventListener("dragstart", _onDragStart);
10690
10697
  window.removeEventListener("mousemove", onMouseMove);
10691
10698
  window.removeEventListener("wheel", onMouseMove);
10692
10699
  };
10700
+ const _onMouseUp = (ev) => {
10701
+ onMouseUp(ev);
10702
+ removeListeners();
10703
+ };
10693
10704
  function _onDragStart(ev) {
10694
10705
  ev.preventDefault();
10695
10706
  }
@@ -10698,6 +10709,7 @@ function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
10698
10709
  window.addEventListener("dragstart", _onDragStart);
10699
10710
  window.addEventListener("mousemove", onMouseMove);
10700
10711
  window.addEventListener("wheel", onMouseMove);
10712
+ return removeListeners;
10701
10713
  }
10702
10714
  /**
10703
10715
  * Function to be used during a mousedown event, this function allows to
@@ -18392,13 +18404,12 @@ function tokenizeSymbol(chars) {
18392
18404
  }
18393
18405
  const whiteSpaceRegexp = /\s/;
18394
18406
  function tokenizeSpace(chars) {
18395
- let length = 0;
18407
+ let spaces = "";
18396
18408
  while (chars[0] && chars[0].match(whiteSpaceRegexp)) {
18397
- length++;
18398
- chars.shift();
18409
+ spaces += chars.shift();
18399
18410
  }
18400
- if (length) {
18401
- return { type: "SPACE", value: " ".repeat(length) };
18411
+ if (spaces) {
18412
+ return { type: "SPACE", value: spaces };
18402
18413
  }
18403
18414
  return null;
18404
18415
  }
@@ -20425,11 +20436,11 @@ css /* scss */ `
20425
20436
  }
20426
20437
 
20427
20438
  /* Custom css to highlight topbar composer on focus */
20428
- .o-topbar-toolbar .o-composer-container:focus-within {
20429
- border: 1px solid ${SELECTION_BORDER_COLOR};
20439
+ .o-topbar-toolbar .o-composer-container[active] {
20440
+ border: 1px solid ${SELECTION_BORDER_COLOR} !important;
20430
20441
  }
20431
20442
 
20432
- .o-topbar-toolbar .o-composer-container {
20443
+ .o-topbar-toolbar .o-composer-container[active] {
20433
20444
  z-index: ${ComponentsImportance.TopBarComposer};
20434
20445
  }
20435
20446
  `;
@@ -21378,6 +21389,7 @@ class FiguresContainer extends Component {
21378
21389
  y: 0,
21379
21390
  width: 0,
21380
21391
  height: 0,
21392
+ cancelDnd: undefined,
21381
21393
  });
21382
21394
  }
21383
21395
  setup() {
@@ -21391,11 +21403,24 @@ class FiguresContainer extends Component {
21391
21403
  // new rendering
21392
21404
  this.render();
21393
21405
  });
21406
+ onWillUpdateProps(() => {
21407
+ const sheetId = this.env.model.getters.getActiveSheetId();
21408
+ if (this.dnd.figId && !this.env.model.getters.getFigure(sheetId, this.dnd.figId)) {
21409
+ if (this.dnd.cancelDnd) {
21410
+ this.dnd.cancelDnd();
21411
+ }
21412
+ this.dnd.figId = undefined;
21413
+ this.dnd.cancelDnd = undefined;
21414
+ }
21415
+ });
21394
21416
  }
21395
21417
  getVisibleFigures() {
21396
21418
  const visibleFigures = this.env.model.getters.getVisibleFigures();
21397
21419
  if (this.dnd.figId && !visibleFigures.some((figure) => figure.id === this.dnd.figId)) {
21398
- visibleFigures.push(this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.figId));
21420
+ const draggedFigure = this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.figId);
21421
+ if (draggedFigure) {
21422
+ visibleFigures.push(draggedFigure);
21423
+ }
21399
21424
  }
21400
21425
  return visibleFigures;
21401
21426
  }
@@ -21508,7 +21533,7 @@ class FiguresContainer extends Component {
21508
21533
  this.dnd.figId = undefined;
21509
21534
  this.env.model.dispatch("UPDATE_FIGURE", { sheetId, id: figure.id, x, y });
21510
21535
  };
21511
- startDnd(onMouseMove, onMouseUp);
21536
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
21512
21537
  }
21513
21538
  startResize(figure, dirX, dirY, ev) {
21514
21539
  ev.stopPropagation();
@@ -21562,7 +21587,7 @@ class FiguresContainer extends Component {
21562
21587
  ...update,
21563
21588
  });
21564
21589
  };
21565
- startDnd(onMouseMove, onMouseUp);
21590
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
21566
21591
  }
21567
21592
  getDndFigure() {
21568
21593
  const figure = this.getVisibleFigures().find((fig) => fig.id === this.dnd.figId);
@@ -27931,7 +27956,6 @@ class BordersPlugin extends CorePlugin {
27931
27956
  }
27932
27957
  BordersPlugin.getters = ["getCellBorder"];
27933
27958
 
27934
- const nbspRegexp = new RegExp(String.fromCharCode(160), "g");
27935
27959
  const LINK_STYLE = { textColor: LINK_COLOR };
27936
27960
  /**
27937
27961
  * Core Plugin
@@ -28265,13 +28289,10 @@ class CellPlugin extends CorePlugin {
28265
28289
  return id;
28266
28290
  }
28267
28291
  updateCell(sheetId, col, row, after) {
28268
- var _a;
28269
28292
  const before = this.getters.getCell(sheetId, col, row);
28270
28293
  const hasContent = "content" in after || "formula" in after;
28271
28294
  // Compute the new cell properties
28272
- const afterContent = hasContent
28273
- ? ((_a = after.content) === null || _a === void 0 ? void 0 : _a.replace(nbspRegexp, "")) || ""
28274
- : (before === null || before === void 0 ? void 0 : before.content) || "";
28295
+ const afterContent = (hasContent ? after.content : before === null || before === void 0 ? void 0 : before.content) || "";
28275
28296
  let style;
28276
28297
  if (after.style !== undefined) {
28277
28298
  style = after.style || undefined;
@@ -37155,6 +37176,7 @@ class SheetViewPlugin extends UIPlugin {
37155
37176
  break;
37156
37177
  case "DELETE_SHEET":
37157
37178
  this.cleanViewports();
37179
+ this.sheetsWithDirtyViewports.delete(cmd.sheetId);
37158
37180
  break;
37159
37181
  case "ACTIVATE_SHEET":
37160
37182
  this.setViewports();
@@ -37507,6 +37529,9 @@ class SheetViewPlugin extends UIPlugin {
37507
37529
  };
37508
37530
  }
37509
37531
  resetViewports(sheetId) {
37532
+ if (!this.getters.tryGetSheet(sheetId)) {
37533
+ return;
37534
+ }
37510
37535
  const { xSplit, ySplit } = this.getters.getPaneDivisions(sheetId);
37511
37536
  const nCols = this.getters.getNumberCols(sheetId);
37512
37537
  const nRows = this.getters.getNumberRows(sheetId);
@@ -43427,6 +43452,6 @@ function addFunction(functionName, functionDescription) {
43427
43452
  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 };
43428
43453
 
43429
43454
 
43430
- __info__.version = '16.0.54';
43431
- __info__.date = '2024-11-08T12:11:01.946Z';
43432
- __info__.hash = 'fdfa7dc';
43455
+ __info__.version = '16.0.56';
43456
+ __info__.date = '2024-12-19T07:45:47.250Z';
43457
+ __info__.hash = '9d0e335';
@@ -9971,6 +9971,9 @@
9971
9971
  }
9972
9972
  }
9973
9973
  setColorScaleColor(target, color) {
9974
+ if (!isColorValid(color)) {
9975
+ return;
9976
+ }
9974
9977
  const point = this.state.rules.colorScale[target];
9975
9978
  if (point) {
9976
9979
  point.color = Number.parseInt(color.substr(1), 16);
@@ -10682,15 +10685,23 @@
10682
10685
  ChartFigure.template = "o-spreadsheet-ChartFigure";
10683
10686
  ChartFigure.components = { Menu };
10684
10687
 
10688
+ /**
10689
+ * Start listening to pointer events and apply the given callbacks.
10690
+ *
10691
+ * @returns A function to remove the listeners.
10692
+ */
10685
10693
  function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
10686
- const _onMouseUp = (ev) => {
10687
- onMouseUp(ev);
10694
+ const removeListeners = () => {
10688
10695
  window.removeEventListener("mousedown", onMouseDown);
10689
10696
  window.removeEventListener("mouseup", _onMouseUp);
10690
10697
  window.removeEventListener("dragstart", _onDragStart);
10691
10698
  window.removeEventListener("mousemove", onMouseMove);
10692
10699
  window.removeEventListener("wheel", onMouseMove);
10693
10700
  };
10701
+ const _onMouseUp = (ev) => {
10702
+ onMouseUp(ev);
10703
+ removeListeners();
10704
+ };
10694
10705
  function _onDragStart(ev) {
10695
10706
  ev.preventDefault();
10696
10707
  }
@@ -10699,6 +10710,7 @@
10699
10710
  window.addEventListener("dragstart", _onDragStart);
10700
10711
  window.addEventListener("mousemove", onMouseMove);
10701
10712
  window.addEventListener("wheel", onMouseMove);
10713
+ return removeListeners;
10702
10714
  }
10703
10715
  /**
10704
10716
  * Function to be used during a mousedown event, this function allows to
@@ -18393,13 +18405,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
18393
18405
  }
18394
18406
  const whiteSpaceRegexp = /\s/;
18395
18407
  function tokenizeSpace(chars) {
18396
- let length = 0;
18408
+ let spaces = "";
18397
18409
  while (chars[0] && chars[0].match(whiteSpaceRegexp)) {
18398
- length++;
18399
- chars.shift();
18410
+ spaces += chars.shift();
18400
18411
  }
18401
- if (length) {
18402
- return { type: "SPACE", value: " ".repeat(length) };
18412
+ if (spaces) {
18413
+ return { type: "SPACE", value: spaces };
18403
18414
  }
18404
18415
  return null;
18405
18416
  }
@@ -20426,11 +20437,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20426
20437
  }
20427
20438
 
20428
20439
  /* Custom css to highlight topbar composer on focus */
20429
- .o-topbar-toolbar .o-composer-container:focus-within {
20430
- border: 1px solid ${SELECTION_BORDER_COLOR};
20440
+ .o-topbar-toolbar .o-composer-container[active] {
20441
+ border: 1px solid ${SELECTION_BORDER_COLOR} !important;
20431
20442
  }
20432
20443
 
20433
- .o-topbar-toolbar .o-composer-container {
20444
+ .o-topbar-toolbar .o-composer-container[active] {
20434
20445
  z-index: ${ComponentsImportance.TopBarComposer};
20435
20446
  }
20436
20447
  `;
@@ -21379,6 +21390,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21379
21390
  y: 0,
21380
21391
  width: 0,
21381
21392
  height: 0,
21393
+ cancelDnd: undefined,
21382
21394
  });
21383
21395
  }
21384
21396
  setup() {
@@ -21392,11 +21404,24 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21392
21404
  // new rendering
21393
21405
  this.render();
21394
21406
  });
21407
+ owl.onWillUpdateProps(() => {
21408
+ const sheetId = this.env.model.getters.getActiveSheetId();
21409
+ if (this.dnd.figId && !this.env.model.getters.getFigure(sheetId, this.dnd.figId)) {
21410
+ if (this.dnd.cancelDnd) {
21411
+ this.dnd.cancelDnd();
21412
+ }
21413
+ this.dnd.figId = undefined;
21414
+ this.dnd.cancelDnd = undefined;
21415
+ }
21416
+ });
21395
21417
  }
21396
21418
  getVisibleFigures() {
21397
21419
  const visibleFigures = this.env.model.getters.getVisibleFigures();
21398
21420
  if (this.dnd.figId && !visibleFigures.some((figure) => figure.id === this.dnd.figId)) {
21399
- visibleFigures.push(this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.figId));
21421
+ const draggedFigure = this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.figId);
21422
+ if (draggedFigure) {
21423
+ visibleFigures.push(draggedFigure);
21424
+ }
21400
21425
  }
21401
21426
  return visibleFigures;
21402
21427
  }
@@ -21509,7 +21534,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21509
21534
  this.dnd.figId = undefined;
21510
21535
  this.env.model.dispatch("UPDATE_FIGURE", { sheetId, id: figure.id, x, y });
21511
21536
  };
21512
- startDnd(onMouseMove, onMouseUp);
21537
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
21513
21538
  }
21514
21539
  startResize(figure, dirX, dirY, ev) {
21515
21540
  ev.stopPropagation();
@@ -21563,7 +21588,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21563
21588
  ...update,
21564
21589
  });
21565
21590
  };
21566
- startDnd(onMouseMove, onMouseUp);
21591
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
21567
21592
  }
21568
21593
  getDndFigure() {
21569
21594
  const figure = this.getVisibleFigures().find((fig) => fig.id === this.dnd.figId);
@@ -27932,7 +27957,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27932
27957
  }
27933
27958
  BordersPlugin.getters = ["getCellBorder"];
27934
27959
 
27935
- const nbspRegexp = new RegExp(String.fromCharCode(160), "g");
27936
27960
  const LINK_STYLE = { textColor: LINK_COLOR };
27937
27961
  /**
27938
27962
  * Core Plugin
@@ -28266,13 +28290,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28266
28290
  return id;
28267
28291
  }
28268
28292
  updateCell(sheetId, col, row, after) {
28269
- var _a;
28270
28293
  const before = this.getters.getCell(sheetId, col, row);
28271
28294
  const hasContent = "content" in after || "formula" in after;
28272
28295
  // Compute the new cell properties
28273
- const afterContent = hasContent
28274
- ? ((_a = after.content) === null || _a === void 0 ? void 0 : _a.replace(nbspRegexp, "")) || ""
28275
- : (before === null || before === void 0 ? void 0 : before.content) || "";
28296
+ const afterContent = (hasContent ? after.content : before === null || before === void 0 ? void 0 : before.content) || "";
28276
28297
  let style;
28277
28298
  if (after.style !== undefined) {
28278
28299
  style = after.style || undefined;
@@ -37156,6 +37177,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37156
37177
  break;
37157
37178
  case "DELETE_SHEET":
37158
37179
  this.cleanViewports();
37180
+ this.sheetsWithDirtyViewports.delete(cmd.sheetId);
37159
37181
  break;
37160
37182
  case "ACTIVATE_SHEET":
37161
37183
  this.setViewports();
@@ -37508,6 +37530,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37508
37530
  };
37509
37531
  }
37510
37532
  resetViewports(sheetId) {
37533
+ if (!this.getters.tryGetSheet(sheetId)) {
37534
+ return;
37535
+ }
37511
37536
  const { xSplit, ySplit } = this.getters.getPaneDivisions(sheetId);
37512
37537
  const nCols = this.getters.getNumberCols(sheetId);
37513
37538
  const nRows = this.getters.getNumberRows(sheetId);
@@ -43458,9 +43483,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43458
43483
  Object.defineProperty(exports, '__esModule', { value: true });
43459
43484
 
43460
43485
 
43461
- __info__.version = '16.0.54';
43462
- __info__.date = '2024-11-08T12:11:01.946Z';
43463
- __info__.hash = 'fdfa7dc';
43486
+ __info__.version = '16.0.56';
43487
+ __info__.date = '2024-12-19T07:45:47.250Z';
43488
+ __info__.hash = '9d0e335';
43464
43489
 
43465
43490
 
43466
43491
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);