@odoo/o-spreadsheet 18.3.17 → 18.3.18

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.3.17
6
- * @date 2025-08-21T06:40:44.469Z
7
- * @hash ab02b0c
5
+ * @version 18.3.18
6
+ * @date 2025-08-26T10:14:21.408Z
7
+ * @hash ec2777d
8
8
  */
9
9
 
10
10
  'use strict';
@@ -7105,14 +7105,11 @@ function getPasteZones(target, content) {
7105
7105
  const width = content[0].length, height = content.length;
7106
7106
  return target.map((t) => splitZoneForPaste(t, width, height)).flat();
7107
7107
  }
7108
- function parseOSClipboardContent(content, clipboardId) {
7108
+ function parseOSClipboardContent(content) {
7109
7109
  let spreadsheetContent = undefined;
7110
7110
  if (content[ClipboardMIMEType.Html]) {
7111
7111
  const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
7112
- const oSheetClipboardData = htmlDocument
7113
- .querySelector("div")
7114
- ?.getAttribute("data-osheet-clipboard");
7115
- spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
7112
+ spreadsheetContent = getOSheetDataFromHTML(htmlDocument);
7116
7113
  }
7117
7114
  const textContent = content[ClipboardMIMEType.PlainText] || "";
7118
7115
  let imageBlob = undefined;
@@ -7131,6 +7128,17 @@ function parseOSClipboardContent(content, clipboardId) {
7131
7128
  };
7132
7129
  return osClipboardContent;
7133
7130
  }
7131
+ function getOSheetDataFromHTML(htmlDocument) {
7132
+ const attributes = [...htmlDocument.documentElement.attributes];
7133
+ // Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
7134
+ if (attributes.some((attr) => attr.value.includes("microsoft"))) {
7135
+ return undefined;
7136
+ }
7137
+ const oSheetClipboardData = htmlDocument
7138
+ .querySelector("div")
7139
+ ?.getAttribute("data-osheet-clipboard");
7140
+ return oSheetClipboardData && JSON.parse(oSheetClipboardData);
7141
+ }
7134
7142
  /**
7135
7143
  * Applies each clipboard handler to paste its corresponding data into the target.
7136
7144
  */
@@ -27202,10 +27210,6 @@ class ComboChart extends AbstractChart {
27202
27210
  };
27203
27211
  }
27204
27212
  getDefinitionForExcel() {
27205
- // Excel does not support aggregating labels
27206
- if (this.aggregated) {
27207
- return undefined;
27208
- }
27209
27213
  const dataSets = this.dataSets
27210
27214
  .map((ds) => toExcelDataset(this.getters, ds))
27211
27215
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -28503,10 +28507,6 @@ class ScatterChart extends AbstractChart {
28503
28507
  return new ScatterChart(definition, this.sheetId, this.getters);
28504
28508
  }
28505
28509
  getDefinitionForExcel() {
28506
- // Excel does not support aggregating labels
28507
- if (this.aggregated) {
28508
- return undefined;
28509
- }
28510
28510
  const dataSets = this.dataSets
28511
28511
  .map((ds) => toExcelDataset(this.getters, ds))
28512
28512
  .filter((ds) => ds.range !== "");
@@ -43760,6 +43760,9 @@ class Composer extends owl.Component {
43760
43760
  this.contentHelper.removeSelection();
43761
43761
  }
43762
43762
  onMouseup() {
43763
+ if (this.env.model.getters.isReadonly()) {
43764
+ return;
43765
+ }
43763
43766
  const selection = this.contentHelper.getCurrentSelection();
43764
43767
  if (selection.start !== selection.end) {
43765
43768
  this.props.composerStore.hoverToken(undefined);
@@ -80952,6 +80955,6 @@ exports.tokenColors = tokenColors;
80952
80955
  exports.tokenize = tokenize;
80953
80956
 
80954
80957
 
80955
- __info__.version = "18.3.17";
80956
- __info__.date = "2025-08-21T06:40:44.469Z";
80957
- __info__.hash = "ab02b0c";
80958
+ __info__.version = "18.3.18";
80959
+ __info__.date = "2025-08-26T10:14:21.408Z";
80960
+ __info__.hash = "ec2777d";
@@ -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.3.17
6
- * @date 2025-08-21T06:40:44.469Z
7
- * @hash ab02b0c
5
+ * @version 18.3.18
6
+ * @date 2025-08-26T10:14:21.408Z
7
+ * @hash ec2777d
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -7103,14 +7103,11 @@ function getPasteZones(target, content) {
7103
7103
  const width = content[0].length, height = content.length;
7104
7104
  return target.map((t) => splitZoneForPaste(t, width, height)).flat();
7105
7105
  }
7106
- function parseOSClipboardContent(content, clipboardId) {
7106
+ function parseOSClipboardContent(content) {
7107
7107
  let spreadsheetContent = undefined;
7108
7108
  if (content[ClipboardMIMEType.Html]) {
7109
7109
  const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
7110
- const oSheetClipboardData = htmlDocument
7111
- .querySelector("div")
7112
- ?.getAttribute("data-osheet-clipboard");
7113
- spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
7110
+ spreadsheetContent = getOSheetDataFromHTML(htmlDocument);
7114
7111
  }
7115
7112
  const textContent = content[ClipboardMIMEType.PlainText] || "";
7116
7113
  let imageBlob = undefined;
@@ -7129,6 +7126,17 @@ function parseOSClipboardContent(content, clipboardId) {
7129
7126
  };
7130
7127
  return osClipboardContent;
7131
7128
  }
7129
+ function getOSheetDataFromHTML(htmlDocument) {
7130
+ const attributes = [...htmlDocument.documentElement.attributes];
7131
+ // Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
7132
+ if (attributes.some((attr) => attr.value.includes("microsoft"))) {
7133
+ return undefined;
7134
+ }
7135
+ const oSheetClipboardData = htmlDocument
7136
+ .querySelector("div")
7137
+ ?.getAttribute("data-osheet-clipboard");
7138
+ return oSheetClipboardData && JSON.parse(oSheetClipboardData);
7139
+ }
7132
7140
  /**
7133
7141
  * Applies each clipboard handler to paste its corresponding data into the target.
7134
7142
  */
@@ -27200,10 +27208,6 @@ class ComboChart extends AbstractChart {
27200
27208
  };
27201
27209
  }
27202
27210
  getDefinitionForExcel() {
27203
- // Excel does not support aggregating labels
27204
- if (this.aggregated) {
27205
- return undefined;
27206
- }
27207
27211
  const dataSets = this.dataSets
27208
27212
  .map((ds) => toExcelDataset(this.getters, ds))
27209
27213
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -28501,10 +28505,6 @@ class ScatterChart extends AbstractChart {
28501
28505
  return new ScatterChart(definition, this.sheetId, this.getters);
28502
28506
  }
28503
28507
  getDefinitionForExcel() {
28504
- // Excel does not support aggregating labels
28505
- if (this.aggregated) {
28506
- return undefined;
28507
- }
28508
28508
  const dataSets = this.dataSets
28509
28509
  .map((ds) => toExcelDataset(this.getters, ds))
28510
28510
  .filter((ds) => ds.range !== "");
@@ -43758,6 +43758,9 @@ class Composer extends Component {
43758
43758
  this.contentHelper.removeSelection();
43759
43759
  }
43760
43760
  onMouseup() {
43761
+ if (this.env.model.getters.isReadonly()) {
43762
+ return;
43763
+ }
43761
43764
  const selection = this.contentHelper.getCurrentSelection();
43762
43765
  if (selection.start !== selection.end) {
43763
43766
  this.props.composerStore.hoverToken(undefined);
@@ -80904,6 +80907,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
80904
80907
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, 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 };
80905
80908
 
80906
80909
 
80907
- __info__.version = "18.3.17";
80908
- __info__.date = "2025-08-21T06:40:44.469Z";
80909
- __info__.hash = "ab02b0c";
80910
+ __info__.version = "18.3.18";
80911
+ __info__.date = "2025-08-26T10:14:21.408Z";
80912
+ __info__.hash = "ec2777d";
@@ -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.3.17
6
- * @date 2025-08-21T06:40:44.469Z
7
- * @hash ab02b0c
5
+ * @version 18.3.18
6
+ * @date 2025-08-26T10:14:21.408Z
7
+ * @hash ec2777d
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -7104,14 +7104,11 @@
7104
7104
  const width = content[0].length, height = content.length;
7105
7105
  return target.map((t) => splitZoneForPaste(t, width, height)).flat();
7106
7106
  }
7107
- function parseOSClipboardContent(content, clipboardId) {
7107
+ function parseOSClipboardContent(content) {
7108
7108
  let spreadsheetContent = undefined;
7109
7109
  if (content[ClipboardMIMEType.Html]) {
7110
7110
  const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
7111
- const oSheetClipboardData = htmlDocument
7112
- .querySelector("div")
7113
- ?.getAttribute("data-osheet-clipboard");
7114
- spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
7111
+ spreadsheetContent = getOSheetDataFromHTML(htmlDocument);
7115
7112
  }
7116
7113
  const textContent = content[ClipboardMIMEType.PlainText] || "";
7117
7114
  let imageBlob = undefined;
@@ -7130,6 +7127,17 @@
7130
7127
  };
7131
7128
  return osClipboardContent;
7132
7129
  }
7130
+ function getOSheetDataFromHTML(htmlDocument) {
7131
+ const attributes = [...htmlDocument.documentElement.attributes];
7132
+ // Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
7133
+ if (attributes.some((attr) => attr.value.includes("microsoft"))) {
7134
+ return undefined;
7135
+ }
7136
+ const oSheetClipboardData = htmlDocument
7137
+ .querySelector("div")
7138
+ ?.getAttribute("data-osheet-clipboard");
7139
+ return oSheetClipboardData && JSON.parse(oSheetClipboardData);
7140
+ }
7133
7141
  /**
7134
7142
  * Applies each clipboard handler to paste its corresponding data into the target.
7135
7143
  */
@@ -27201,10 +27209,6 @@ stores.inject(MyMetaStore, storeInstance);
27201
27209
  };
27202
27210
  }
27203
27211
  getDefinitionForExcel() {
27204
- // Excel does not support aggregating labels
27205
- if (this.aggregated) {
27206
- return undefined;
27207
- }
27208
27212
  const dataSets = this.dataSets
27209
27213
  .map((ds) => toExcelDataset(this.getters, ds))
27210
27214
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -28502,10 +28506,6 @@ stores.inject(MyMetaStore, storeInstance);
28502
28506
  return new ScatterChart(definition, this.sheetId, this.getters);
28503
28507
  }
28504
28508
  getDefinitionForExcel() {
28505
- // Excel does not support aggregating labels
28506
- if (this.aggregated) {
28507
- return undefined;
28508
- }
28509
28509
  const dataSets = this.dataSets
28510
28510
  .map((ds) => toExcelDataset(this.getters, ds))
28511
28511
  .filter((ds) => ds.range !== "");
@@ -43759,6 +43759,9 @@ stores.inject(MyMetaStore, storeInstance);
43759
43759
  this.contentHelper.removeSelection();
43760
43760
  }
43761
43761
  onMouseup() {
43762
+ if (this.env.model.getters.isReadonly()) {
43763
+ return;
43764
+ }
43762
43765
  const selection = this.contentHelper.getCurrentSelection();
43763
43766
  if (selection.start !== selection.end) {
43764
43767
  this.props.composerStore.hoverToken(undefined);
@@ -80951,9 +80954,9 @@ stores.inject(MyMetaStore, storeInstance);
80951
80954
  exports.tokenize = tokenize;
80952
80955
 
80953
80956
 
80954
- __info__.version = "18.3.17";
80955
- __info__.date = "2025-08-21T06:40:44.469Z";
80956
- __info__.hash = "ab02b0c";
80957
+ __info__.version = "18.3.18";
80958
+ __info__.date = "2025-08-26T10:14:21.408Z";
80959
+ __info__.hash = "ec2777d";
80957
80960
 
80958
80961
 
80959
80962
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);