@odoo/o-spreadsheet 17.0.42 → 17.0.44

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 17.0.42
6
- * @date 2024-11-28T09:02:39.394Z
7
- * @hash aa06a38
5
+ * @version 17.0.44
6
+ * @date 2024-12-19T07:46:10.942Z
7
+ * @hash 820f3cf
8
8
  */
9
9
 
10
10
  'use strict';
@@ -706,6 +706,7 @@ function removeFalsyAttributes(obj) {
706
706
  * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes
707
707
  */
708
708
  const whiteSpaceSpecialCharacters = [
709
+ " ",
709
710
  "\t",
710
711
  "\f",
711
712
  "\v",
@@ -720,17 +721,15 @@ const whiteSpaceSpecialCharacters = [
720
721
  String.fromCharCode(parseInt("3000", 16)),
721
722
  String.fromCharCode(parseInt("feff", 16)),
722
723
  ];
723
- const whiteSpaceRegexp = new RegExp(whiteSpaceSpecialCharacters.join("|") + "|(\r\n|\r|\n)", "g");
724
+ const whiteSpaceRegexp = new RegExp(whiteSpaceSpecialCharacters.join("|"), "g");
725
+ const newLineRegexp = /(\r\n|\r)/g;
724
726
  /**
725
- * Replace all the special spaces in a string (non-breaking, tabs, ...) by normal spaces, and all the
726
- * different newlines types by \n.
727
+ * Replace all different newlines characters by \n
727
728
  */
728
- function replaceSpecialSpaces(text) {
729
+ function replaceNewLines(text) {
729
730
  if (!text)
730
731
  return "";
731
- if (!whiteSpaceRegexp.test(text))
732
- return text;
733
- return text.replace(whiteSpaceRegexp, (match, newLine) => (newLine ? NEWLINE : " "));
732
+ return text.replace(newLineRegexp, NEWLINE);
734
733
  }
735
734
  /**
736
735
  * Determine if the numbers are consecutive.
@@ -7473,7 +7472,7 @@ LinkDisplay.props = {
7473
7472
  const POSTFIX_UNARY_OPERATORS = ["%"];
7474
7473
  const OPERATORS = "+,-,*,/,:,=,<>,>=,>,<=,<,^,&".split(",").concat(POSTFIX_UNARY_OPERATORS);
7475
7474
  function tokenize(str, locale = DEFAULT_LOCALE) {
7476
- str = replaceSpecialSpaces(str);
7475
+ str = replaceNewLines(str);
7477
7476
  const chars = new TokenizingChars(str);
7478
7477
  const result = [];
7479
7478
  while (!chars.isOver()) {
@@ -7620,12 +7619,12 @@ function tokenizeSpace(chars) {
7620
7619
  if (length) {
7621
7620
  return { type: "SPACE", value: NEWLINE.repeat(length) };
7622
7621
  }
7623
- while (chars.current === " ") {
7624
- length++;
7625
- chars.shift();
7622
+ let spaces = "";
7623
+ while (chars.current && chars.current.match(whiteSpaceRegexp)) {
7624
+ spaces += chars.shift();
7626
7625
  }
7627
- if (length) {
7628
- return { type: "SPACE", value: " ".repeat(length) };
7626
+ if (spaces) {
7627
+ return { type: "SPACE", value: spaces };
7629
7628
  }
7630
7629
  return null;
7631
7630
  }
@@ -19442,6 +19441,18 @@ const TEXT = {
19442
19441
  },
19443
19442
  isExported: true,
19444
19443
  };
19444
+ // -----------------------------------------------------------------------------
19445
+ // VALUE
19446
+ // -----------------------------------------------------------------------------
19447
+ const VALUE = {
19448
+ description: _t("Converts a string to a numeric value."),
19449
+ args: [arg("value (number)", _t("the string to be converted"))],
19450
+ returns: ["NUMBER"],
19451
+ compute: function (value) {
19452
+ return toNumber(value, this.locale);
19453
+ },
19454
+ isExported: true,
19455
+ };
19445
19456
 
19446
19457
  var text = /*#__PURE__*/Object.freeze({
19447
19458
  __proto__: null,
@@ -19464,7 +19475,8 @@ var text = /*#__PURE__*/Object.freeze({
19464
19475
  TEXT: TEXT,
19465
19476
  TEXTJOIN: TEXTJOIN,
19466
19477
  TRIM: TRIM,
19467
- UPPER: UPPER
19478
+ UPPER: UPPER,
19479
+ VALUE: VALUE
19468
19480
  });
19469
19481
 
19470
19482
  // -----------------------------------------------------------------------------
@@ -21807,15 +21819,23 @@ class BarConfigPanel extends LineBarPieConfigPanel {
21807
21819
  }
21808
21820
  }
21809
21821
 
21822
+ /**
21823
+ * Start listening to pointer events and apply the given callbacks.
21824
+ *
21825
+ * @returns A function to remove the listeners.
21826
+ */
21810
21827
  function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
21811
- const _onMouseUp = (ev) => {
21812
- onMouseUp(ev);
21828
+ const removeListeners = () => {
21813
21829
  window.removeEventListener("mousedown", onMouseDown);
21814
21830
  window.removeEventListener("mouseup", _onMouseUp);
21815
21831
  window.removeEventListener("dragstart", _onDragStart);
21816
21832
  window.removeEventListener("mousemove", onMouseMove);
21817
21833
  window.removeEventListener("wheel", onMouseMove);
21818
21834
  };
21835
+ const _onMouseUp = (ev) => {
21836
+ onMouseUp(ev);
21837
+ removeListeners();
21838
+ };
21819
21839
  function _onDragStart(ev) {
21820
21840
  ev.preventDefault();
21821
21841
  }
@@ -21827,6 +21847,7 @@ function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
21827
21847
  // preventDefault() is not allowed in passive event handler.
21828
21848
  // https://chromestatus.com/feature/6662647093133312
21829
21849
  window.addEventListener("wheel", onMouseMove, { passive: false });
21850
+ return removeListeners;
21830
21851
  }
21831
21852
  /**
21832
21853
  * Function to be used during a mousedown event, this function allows to
@@ -28000,6 +28021,7 @@ class FiguresContainer extends owl.Component {
28000
28021
  draggedFigure: undefined,
28001
28022
  horizontalSnap: undefined,
28002
28023
  verticalSnap: undefined,
28024
+ cancelDnd: undefined,
28003
28025
  });
28004
28026
  setup() {
28005
28027
  owl.onMounted(() => {
@@ -28012,12 +28034,28 @@ class FiguresContainer extends owl.Component {
28012
28034
  // new rendering
28013
28035
  this.render();
28014
28036
  });
28037
+ owl.onWillUpdateProps(() => {
28038
+ const sheetId = this.env.model.getters.getActiveSheetId();
28039
+ const draggedFigureId = this.dnd.draggedFigure?.id;
28040
+ if (draggedFigureId && !this.env.model.getters.getFigure(sheetId, draggedFigureId)) {
28041
+ if (this.dnd.cancelDnd) {
28042
+ this.dnd.cancelDnd();
28043
+ }
28044
+ this.dnd.draggedFigure = undefined;
28045
+ this.dnd.horizontalSnap = undefined;
28046
+ this.dnd.verticalSnap = undefined;
28047
+ this.dnd.cancelDnd = undefined;
28048
+ }
28049
+ });
28015
28050
  }
28016
28051
  getVisibleFigures() {
28017
28052
  const visibleFigures = this.env.model.getters.getVisibleFigures();
28018
28053
  if (this.dnd.draggedFigure &&
28019
28054
  !visibleFigures.some((figure) => figure.id === this.dnd.draggedFigure?.id)) {
28020
- visibleFigures.push(this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.draggedFigure?.id));
28055
+ const draggedFigure = this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.draggedFigure?.id);
28056
+ if (draggedFigure) {
28057
+ visibleFigures.push(draggedFigure);
28058
+ }
28021
28059
  }
28022
28060
  return visibleFigures;
28023
28061
  }
@@ -28136,7 +28174,7 @@ class FiguresContainer extends owl.Component {
28136
28174
  this.dnd.verticalSnap = undefined;
28137
28175
  this.env.model.dispatch("UPDATE_FIGURE", { sheetId, id: figure.id, x, y });
28138
28176
  };
28139
- startDnd(onMouseMove, onMouseUp);
28177
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
28140
28178
  }
28141
28179
  /**
28142
28180
  * Initialize the resize of a figure with mouse movements
@@ -28184,7 +28222,7 @@ class FiguresContainer extends owl.Component {
28184
28222
  this.dnd.horizontalSnap = undefined;
28185
28223
  this.dnd.verticalSnap = undefined;
28186
28224
  };
28187
- startDnd(onMouseMove, onMouseUp);
28225
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
28188
28226
  }
28189
28227
  getOtherFigures(figId) {
28190
28228
  return this.getVisibleFigures().filter((f) => f.id !== figId);
@@ -31480,7 +31518,7 @@ function extractStyle(cell, data) {
31480
31518
  vertical: style.verticalAlign
31481
31519
  ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
31482
31520
  : undefined,
31483
- wrapText: style.wrapping === "wrap",
31521
+ wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
31484
31522
  },
31485
31523
  };
31486
31524
  styles.font["strike"] = !!style?.strikethrough || undefined;
@@ -31909,9 +31947,8 @@ function convertRows(sheet, numberOfRows) {
31909
31947
  }
31910
31948
  return rows;
31911
31949
  }
31912
- /** Remove newlines (\n) in shared strings, We do not support them */
31913
31950
  function convertSharedStrings(xlsxSharedStrings) {
31914
- return xlsxSharedStrings.map((str) => str.replace(/\n/g, ""));
31951
+ return xlsxSharedStrings.map(replaceNewLines);
31915
31952
  }
31916
31953
  function convertCells(sheet, data, sheetDims, warningManager) {
31917
31954
  const cells = {};
@@ -32702,15 +32739,10 @@ class XlsxMiscExtractor extends XlsxBaseExtractor {
32702
32739
  getSharedStrings() {
32703
32740
  return this.mapOnElements({ parent: this.rootFile.file.xml, query: "si" }, (ssElement) => {
32704
32741
  // Shared string can either be a simple text, or a rich text (text with formatting, possibly in multiple parts)
32705
- if (ssElement.children[0].tagName === "t") {
32706
- return this.extractTextContent(ssElement) || "";
32707
- }
32708
32742
  // We don't support rich text formatting, we'll only extract the text
32709
- else {
32710
- return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
32711
- return this.extractTextContent(textElement) || "";
32712
- }).join("");
32713
- }
32743
+ return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
32744
+ return this.extractTextContent(textElement) || "";
32745
+ }).join("");
32714
32746
  });
32715
32747
  }
32716
32748
  }
@@ -36083,7 +36115,7 @@ class CellPlugin extends CorePlugin {
36083
36115
  const before = this.getters.getCell({ sheetId, col, row });
36084
36116
  const hasContent = "content" in after || "formula" in after;
36085
36117
  // Compute the new cell properties
36086
- const afterContent = hasContent ? replaceSpecialSpaces(after?.content) : before?.content || "";
36118
+ const afterContent = hasContent ? replaceNewLines(after?.content) : before?.content || "";
36087
36119
  let style;
36088
36120
  if (after.style !== undefined) {
36089
36121
  style = after.style || undefined;
@@ -50903,6 +50935,7 @@ class SheetViewPlugin extends UIPlugin {
50903
50935
  break;
50904
50936
  case "DELETE_SHEET":
50905
50937
  this.cleanViewports();
50938
+ this.sheetsWithDirtyViewports.delete(cmd.sheetId);
50906
50939
  break;
50907
50940
  case "ACTIVATE_SHEET":
50908
50941
  this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
@@ -52850,7 +52883,7 @@ class ActionButton extends owl.Component {
52850
52883
  setup() {
52851
52884
  owl.onWillUpdateProps((nextProps) => {
52852
52885
  if (nextProps.action !== this.props.action) {
52853
- this.actionButton = createAction(this.props.action);
52886
+ this.actionButton = createAction(nextProps.action);
52854
52887
  }
52855
52888
  });
52856
52889
  }
@@ -53124,7 +53157,6 @@ css /* scss */ `
53124
53157
  height: fit-content;
53125
53158
  margin-top: -1px;
53126
53159
  border: 1px solid;
53127
- z-index: ${ComponentsImportance.TopBarComposer};
53128
53160
 
53129
53161
  .o-composer:empty:not(:focus):not(.active)::before {
53130
53162
  content: url("data:image/svg+xml,${encodeURIComponent(FX_SVG)}");
@@ -53158,6 +53190,7 @@ class TopBarComposer extends owl.Component {
53158
53190
  }
53159
53191
  return cssPropertiesToCss({
53160
53192
  "border-color": SELECTION_BORDER_COLOR,
53193
+ "z-index": String(ComponentsImportance.TopBarComposer),
53161
53194
  });
53162
53195
  }
53163
53196
  }
@@ -56960,7 +56993,12 @@ function createSharedStrings(strings) {
56960
56993
  ["count", strings.length],
56961
56994
  ["uniqueCount", strings.length],
56962
56995
  ];
56963
- const stringNodes = strings.map((string) => escapeXml /*xml*/ `<si><t>${string}</t></si>`);
56996
+ const stringNodes = strings.map((string) => {
56997
+ if (string.trim() !== string) {
56998
+ return escapeXml /*xml*/ `<si><t xml:space="preserve">${string}</t></si>`;
56999
+ }
57000
+ return escapeXml /*xml*/ `<si><t>${string}</t></si>`;
57001
+ });
56964
57002
  const xml = escapeXml /*xml*/ `
56965
57003
  <sst ${formatAttributes(namespaces)}>
56966
57004
  ${joinXmlNodes(stringNodes)}
@@ -57671,6 +57709,6 @@ exports.setTranslationMethod = setTranslationMethod;
57671
57709
  exports.tokenize = tokenize;
57672
57710
 
57673
57711
 
57674
- __info__.version = "17.0.42";
57675
- __info__.date = "2024-11-28T09:02:39.394Z";
57676
- __info__.hash = "aa06a38";
57712
+ __info__.version = "17.0.44";
57713
+ __info__.date = "2024-12-19T07:46:10.942Z";
57714
+ __info__.hash = "820f3cf";
@@ -6386,6 +6386,7 @@ interface DndState {
6386
6386
  draggedFigure?: Figure;
6387
6387
  horizontalSnap?: Snap<HFigureAxisType>;
6388
6388
  verticalSnap?: Snap<VFigureAxisType>;
6389
+ cancelDnd: (() => void) | undefined;
6389
6390
  }
6390
6391
  /**
6391
6392
  * Each figure ⭐ is positioned inside a container `div` placed and sized
@@ -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 17.0.42
6
- * @date 2024-11-28T09:02:39.394Z
7
- * @hash aa06a38
5
+ * @version 17.0.44
6
+ * @date 2024-12-19T07:46:10.942Z
7
+ * @hash 820f3cf
8
8
  */
9
9
 
10
10
  import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
@@ -704,6 +704,7 @@ function removeFalsyAttributes(obj) {
704
704
  * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes
705
705
  */
706
706
  const whiteSpaceSpecialCharacters = [
707
+ " ",
707
708
  "\t",
708
709
  "\f",
709
710
  "\v",
@@ -718,17 +719,15 @@ const whiteSpaceSpecialCharacters = [
718
719
  String.fromCharCode(parseInt("3000", 16)),
719
720
  String.fromCharCode(parseInt("feff", 16)),
720
721
  ];
721
- const whiteSpaceRegexp = new RegExp(whiteSpaceSpecialCharacters.join("|") + "|(\r\n|\r|\n)", "g");
722
+ const whiteSpaceRegexp = new RegExp(whiteSpaceSpecialCharacters.join("|"), "g");
723
+ const newLineRegexp = /(\r\n|\r)/g;
722
724
  /**
723
- * Replace all the special spaces in a string (non-breaking, tabs, ...) by normal spaces, and all the
724
- * different newlines types by \n.
725
+ * Replace all different newlines characters by \n
725
726
  */
726
- function replaceSpecialSpaces(text) {
727
+ function replaceNewLines(text) {
727
728
  if (!text)
728
729
  return "";
729
- if (!whiteSpaceRegexp.test(text))
730
- return text;
731
- return text.replace(whiteSpaceRegexp, (match, newLine) => (newLine ? NEWLINE : " "));
730
+ return text.replace(newLineRegexp, NEWLINE);
732
731
  }
733
732
  /**
734
733
  * Determine if the numbers are consecutive.
@@ -7471,7 +7470,7 @@ LinkDisplay.props = {
7471
7470
  const POSTFIX_UNARY_OPERATORS = ["%"];
7472
7471
  const OPERATORS = "+,-,*,/,:,=,<>,>=,>,<=,<,^,&".split(",").concat(POSTFIX_UNARY_OPERATORS);
7473
7472
  function tokenize(str, locale = DEFAULT_LOCALE) {
7474
- str = replaceSpecialSpaces(str);
7473
+ str = replaceNewLines(str);
7475
7474
  const chars = new TokenizingChars(str);
7476
7475
  const result = [];
7477
7476
  while (!chars.isOver()) {
@@ -7618,12 +7617,12 @@ function tokenizeSpace(chars) {
7618
7617
  if (length) {
7619
7618
  return { type: "SPACE", value: NEWLINE.repeat(length) };
7620
7619
  }
7621
- while (chars.current === " ") {
7622
- length++;
7623
- chars.shift();
7620
+ let spaces = "";
7621
+ while (chars.current && chars.current.match(whiteSpaceRegexp)) {
7622
+ spaces += chars.shift();
7624
7623
  }
7625
- if (length) {
7626
- return { type: "SPACE", value: " ".repeat(length) };
7624
+ if (spaces) {
7625
+ return { type: "SPACE", value: spaces };
7627
7626
  }
7628
7627
  return null;
7629
7628
  }
@@ -19440,6 +19439,18 @@ const TEXT = {
19440
19439
  },
19441
19440
  isExported: true,
19442
19441
  };
19442
+ // -----------------------------------------------------------------------------
19443
+ // VALUE
19444
+ // -----------------------------------------------------------------------------
19445
+ const VALUE = {
19446
+ description: _t("Converts a string to a numeric value."),
19447
+ args: [arg("value (number)", _t("the string to be converted"))],
19448
+ returns: ["NUMBER"],
19449
+ compute: function (value) {
19450
+ return toNumber(value, this.locale);
19451
+ },
19452
+ isExported: true,
19453
+ };
19443
19454
 
19444
19455
  var text = /*#__PURE__*/Object.freeze({
19445
19456
  __proto__: null,
@@ -19462,7 +19473,8 @@ var text = /*#__PURE__*/Object.freeze({
19462
19473
  TEXT: TEXT,
19463
19474
  TEXTJOIN: TEXTJOIN,
19464
19475
  TRIM: TRIM,
19465
- UPPER: UPPER
19476
+ UPPER: UPPER,
19477
+ VALUE: VALUE
19466
19478
  });
19467
19479
 
19468
19480
  // -----------------------------------------------------------------------------
@@ -21805,15 +21817,23 @@ class BarConfigPanel extends LineBarPieConfigPanel {
21805
21817
  }
21806
21818
  }
21807
21819
 
21820
+ /**
21821
+ * Start listening to pointer events and apply the given callbacks.
21822
+ *
21823
+ * @returns A function to remove the listeners.
21824
+ */
21808
21825
  function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
21809
- const _onMouseUp = (ev) => {
21810
- onMouseUp(ev);
21826
+ const removeListeners = () => {
21811
21827
  window.removeEventListener("mousedown", onMouseDown);
21812
21828
  window.removeEventListener("mouseup", _onMouseUp);
21813
21829
  window.removeEventListener("dragstart", _onDragStart);
21814
21830
  window.removeEventListener("mousemove", onMouseMove);
21815
21831
  window.removeEventListener("wheel", onMouseMove);
21816
21832
  };
21833
+ const _onMouseUp = (ev) => {
21834
+ onMouseUp(ev);
21835
+ removeListeners();
21836
+ };
21817
21837
  function _onDragStart(ev) {
21818
21838
  ev.preventDefault();
21819
21839
  }
@@ -21825,6 +21845,7 @@ function startDnd(onMouseMove, onMouseUp, onMouseDown = () => { }) {
21825
21845
  // preventDefault() is not allowed in passive event handler.
21826
21846
  // https://chromestatus.com/feature/6662647093133312
21827
21847
  window.addEventListener("wheel", onMouseMove, { passive: false });
21848
+ return removeListeners;
21828
21849
  }
21829
21850
  /**
21830
21851
  * Function to be used during a mousedown event, this function allows to
@@ -27998,6 +28019,7 @@ class FiguresContainer extends Component {
27998
28019
  draggedFigure: undefined,
27999
28020
  horizontalSnap: undefined,
28000
28021
  verticalSnap: undefined,
28022
+ cancelDnd: undefined,
28001
28023
  });
28002
28024
  setup() {
28003
28025
  onMounted(() => {
@@ -28010,12 +28032,28 @@ class FiguresContainer extends Component {
28010
28032
  // new rendering
28011
28033
  this.render();
28012
28034
  });
28035
+ onWillUpdateProps(() => {
28036
+ const sheetId = this.env.model.getters.getActiveSheetId();
28037
+ const draggedFigureId = this.dnd.draggedFigure?.id;
28038
+ if (draggedFigureId && !this.env.model.getters.getFigure(sheetId, draggedFigureId)) {
28039
+ if (this.dnd.cancelDnd) {
28040
+ this.dnd.cancelDnd();
28041
+ }
28042
+ this.dnd.draggedFigure = undefined;
28043
+ this.dnd.horizontalSnap = undefined;
28044
+ this.dnd.verticalSnap = undefined;
28045
+ this.dnd.cancelDnd = undefined;
28046
+ }
28047
+ });
28013
28048
  }
28014
28049
  getVisibleFigures() {
28015
28050
  const visibleFigures = this.env.model.getters.getVisibleFigures();
28016
28051
  if (this.dnd.draggedFigure &&
28017
28052
  !visibleFigures.some((figure) => figure.id === this.dnd.draggedFigure?.id)) {
28018
- visibleFigures.push(this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.draggedFigure?.id));
28053
+ const draggedFigure = this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.draggedFigure?.id);
28054
+ if (draggedFigure) {
28055
+ visibleFigures.push(draggedFigure);
28056
+ }
28019
28057
  }
28020
28058
  return visibleFigures;
28021
28059
  }
@@ -28134,7 +28172,7 @@ class FiguresContainer extends Component {
28134
28172
  this.dnd.verticalSnap = undefined;
28135
28173
  this.env.model.dispatch("UPDATE_FIGURE", { sheetId, id: figure.id, x, y });
28136
28174
  };
28137
- startDnd(onMouseMove, onMouseUp);
28175
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
28138
28176
  }
28139
28177
  /**
28140
28178
  * Initialize the resize of a figure with mouse movements
@@ -28182,7 +28220,7 @@ class FiguresContainer extends Component {
28182
28220
  this.dnd.horizontalSnap = undefined;
28183
28221
  this.dnd.verticalSnap = undefined;
28184
28222
  };
28185
- startDnd(onMouseMove, onMouseUp);
28223
+ this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
28186
28224
  }
28187
28225
  getOtherFigures(figId) {
28188
28226
  return this.getVisibleFigures().filter((f) => f.id !== figId);
@@ -31478,7 +31516,7 @@ function extractStyle(cell, data) {
31478
31516
  vertical: style.verticalAlign
31479
31517
  ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
31480
31518
  : undefined,
31481
- wrapText: style.wrapping === "wrap",
31519
+ wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
31482
31520
  },
31483
31521
  };
31484
31522
  styles.font["strike"] = !!style?.strikethrough || undefined;
@@ -31907,9 +31945,8 @@ function convertRows(sheet, numberOfRows) {
31907
31945
  }
31908
31946
  return rows;
31909
31947
  }
31910
- /** Remove newlines (\n) in shared strings, We do not support them */
31911
31948
  function convertSharedStrings(xlsxSharedStrings) {
31912
- return xlsxSharedStrings.map((str) => str.replace(/\n/g, ""));
31949
+ return xlsxSharedStrings.map(replaceNewLines);
31913
31950
  }
31914
31951
  function convertCells(sheet, data, sheetDims, warningManager) {
31915
31952
  const cells = {};
@@ -32700,15 +32737,10 @@ class XlsxMiscExtractor extends XlsxBaseExtractor {
32700
32737
  getSharedStrings() {
32701
32738
  return this.mapOnElements({ parent: this.rootFile.file.xml, query: "si" }, (ssElement) => {
32702
32739
  // Shared string can either be a simple text, or a rich text (text with formatting, possibly in multiple parts)
32703
- if (ssElement.children[0].tagName === "t") {
32704
- return this.extractTextContent(ssElement) || "";
32705
- }
32706
32740
  // We don't support rich text formatting, we'll only extract the text
32707
- else {
32708
- return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
32709
- return this.extractTextContent(textElement) || "";
32710
- }).join("");
32711
- }
32741
+ return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
32742
+ return this.extractTextContent(textElement) || "";
32743
+ }).join("");
32712
32744
  });
32713
32745
  }
32714
32746
  }
@@ -36081,7 +36113,7 @@ class CellPlugin extends CorePlugin {
36081
36113
  const before = this.getters.getCell({ sheetId, col, row });
36082
36114
  const hasContent = "content" in after || "formula" in after;
36083
36115
  // Compute the new cell properties
36084
- const afterContent = hasContent ? replaceSpecialSpaces(after?.content) : before?.content || "";
36116
+ const afterContent = hasContent ? replaceNewLines(after?.content) : before?.content || "";
36085
36117
  let style;
36086
36118
  if (after.style !== undefined) {
36087
36119
  style = after.style || undefined;
@@ -50901,6 +50933,7 @@ class SheetViewPlugin extends UIPlugin {
50901
50933
  break;
50902
50934
  case "DELETE_SHEET":
50903
50935
  this.cleanViewports();
50936
+ this.sheetsWithDirtyViewports.delete(cmd.sheetId);
50904
50937
  break;
50905
50938
  case "ACTIVATE_SHEET":
50906
50939
  this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
@@ -52848,7 +52881,7 @@ class ActionButton extends Component {
52848
52881
  setup() {
52849
52882
  onWillUpdateProps((nextProps) => {
52850
52883
  if (nextProps.action !== this.props.action) {
52851
- this.actionButton = createAction(this.props.action);
52884
+ this.actionButton = createAction(nextProps.action);
52852
52885
  }
52853
52886
  });
52854
52887
  }
@@ -53122,7 +53155,6 @@ css /* scss */ `
53122
53155
  height: fit-content;
53123
53156
  margin-top: -1px;
53124
53157
  border: 1px solid;
53125
- z-index: ${ComponentsImportance.TopBarComposer};
53126
53158
 
53127
53159
  .o-composer:empty:not(:focus):not(.active)::before {
53128
53160
  content: url("data:image/svg+xml,${encodeURIComponent(FX_SVG)}");
@@ -53156,6 +53188,7 @@ class TopBarComposer extends Component {
53156
53188
  }
53157
53189
  return cssPropertiesToCss({
53158
53190
  "border-color": SELECTION_BORDER_COLOR,
53191
+ "z-index": String(ComponentsImportance.TopBarComposer),
53159
53192
  });
53160
53193
  }
53161
53194
  }
@@ -56958,7 +56991,12 @@ function createSharedStrings(strings) {
56958
56991
  ["count", strings.length],
56959
56992
  ["uniqueCount", strings.length],
56960
56993
  ];
56961
- const stringNodes = strings.map((string) => escapeXml /*xml*/ `<si><t>${string}</t></si>`);
56994
+ const stringNodes = strings.map((string) => {
56995
+ if (string.trim() !== string) {
56996
+ return escapeXml /*xml*/ `<si><t xml:space="preserve">${string}</t></si>`;
56997
+ }
56998
+ return escapeXml /*xml*/ `<si><t>${string}</t></si>`;
56999
+ });
56962
57000
  const xml = escapeXml /*xml*/ `
56963
57001
  <sst ${formatAttributes(namespaces)}>
56964
57002
  ${joinXmlNodes(stringNodes)}
@@ -57634,6 +57672,6 @@ const constants = {
57634
57672
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
57635
57673
 
57636
57674
 
57637
- __info__.version = "17.0.42";
57638
- __info__.date = "2024-11-28T09:02:39.394Z";
57639
- __info__.hash = "aa06a38";
57675
+ __info__.version = "17.0.44";
57676
+ __info__.date = "2024-12-19T07:46:10.942Z";
57677
+ __info__.hash = "820f3cf";