@odoo/o-spreadsheet 18.0.41 → 18.0.42

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.0.41
6
- * @date 2025-08-21T06:42:14.859Z
7
- * @hash bc6051c
5
+ * @version 18.0.42
6
+ * @date 2025-08-26T10:07:59.958Z
7
+ * @hash 7ad0e33
8
8
  */
9
9
 
10
10
  'use strict';
@@ -6659,15 +6659,22 @@ function parseOSClipboardContent(content) {
6659
6659
  };
6660
6660
  }
6661
6661
  const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
6662
- const oSheetClipboardData = htmlDocument
6663
- .querySelector("div")
6664
- ?.getAttribute("data-osheet-clipboard");
6665
- const spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
6666
6662
  return {
6667
6663
  text: content[ClipboardMIMEType.PlainText],
6668
- data: spreadsheetContent,
6664
+ data: getOSheetDataFromHTML(htmlDocument),
6669
6665
  };
6670
6666
  }
6667
+ function getOSheetDataFromHTML(htmlDocument) {
6668
+ const attributes = [...htmlDocument.documentElement.attributes];
6669
+ // Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
6670
+ if (attributes.some((attr) => attr.value.includes("microsoft"))) {
6671
+ return undefined;
6672
+ }
6673
+ const oSheetClipboardData = htmlDocument
6674
+ .querySelector("div")
6675
+ ?.getAttribute("data-osheet-clipboard");
6676
+ return oSheetClipboardData && JSON.parse(oSheetClipboardData);
6677
+ }
6671
6678
  /**
6672
6679
  * Applies each clipboard handler to paste its corresponding data into the target.
6673
6680
  */
@@ -74673,6 +74680,6 @@ exports.tokenColors = tokenColors;
74673
74680
  exports.tokenize = tokenize;
74674
74681
 
74675
74682
 
74676
- __info__.version = "18.0.41";
74677
- __info__.date = "2025-08-21T06:42:14.859Z";
74678
- __info__.hash = "bc6051c";
74683
+ __info__.version = "18.0.42";
74684
+ __info__.date = "2025-08-26T10:07:59.958Z";
74685
+ __info__.hash = "7ad0e33";
@@ -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.0.41
6
- * @date 2025-08-21T06:42:14.859Z
7
- * @hash bc6051c
5
+ * @version 18.0.42
6
+ * @date 2025-08-26T10:07:59.958Z
7
+ * @hash 7ad0e33
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -6657,15 +6657,22 @@ function parseOSClipboardContent(content) {
6657
6657
  };
6658
6658
  }
6659
6659
  const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
6660
- const oSheetClipboardData = htmlDocument
6661
- .querySelector("div")
6662
- ?.getAttribute("data-osheet-clipboard");
6663
- const spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
6664
6660
  return {
6665
6661
  text: content[ClipboardMIMEType.PlainText],
6666
- data: spreadsheetContent,
6662
+ data: getOSheetDataFromHTML(htmlDocument),
6667
6663
  };
6668
6664
  }
6665
+ function getOSheetDataFromHTML(htmlDocument) {
6666
+ const attributes = [...htmlDocument.documentElement.attributes];
6667
+ // Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
6668
+ if (attributes.some((attr) => attr.value.includes("microsoft"))) {
6669
+ return undefined;
6670
+ }
6671
+ const oSheetClipboardData = htmlDocument
6672
+ .querySelector("div")
6673
+ ?.getAttribute("data-osheet-clipboard");
6674
+ return oSheetClipboardData && JSON.parse(oSheetClipboardData);
6675
+ }
6669
6676
  /**
6670
6677
  * Applies each clipboard handler to paste its corresponding data into the target.
6671
6678
  */
@@ -74628,6 +74635,6 @@ const constants = {
74628
74635
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
74629
74636
 
74630
74637
 
74631
- __info__.version = "18.0.41";
74632
- __info__.date = "2025-08-21T06:42:14.859Z";
74633
- __info__.hash = "bc6051c";
74638
+ __info__.version = "18.0.42";
74639
+ __info__.date = "2025-08-26T10:07:59.958Z";
74640
+ __info__.hash = "7ad0e33";
@@ -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.0.41
6
- * @date 2025-08-21T06:42:14.859Z
7
- * @hash bc6051c
5
+ * @version 18.0.42
6
+ * @date 2025-08-26T10:07:59.958Z
7
+ * @hash 7ad0e33
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -6658,15 +6658,22 @@
6658
6658
  };
6659
6659
  }
6660
6660
  const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
6661
- const oSheetClipboardData = htmlDocument
6662
- .querySelector("div")
6663
- ?.getAttribute("data-osheet-clipboard");
6664
- const spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
6665
6661
  return {
6666
6662
  text: content[ClipboardMIMEType.PlainText],
6667
- data: spreadsheetContent,
6663
+ data: getOSheetDataFromHTML(htmlDocument),
6668
6664
  };
6669
6665
  }
6666
+ function getOSheetDataFromHTML(htmlDocument) {
6667
+ const attributes = [...htmlDocument.documentElement.attributes];
6668
+ // Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
6669
+ if (attributes.some((attr) => attr.value.includes("microsoft"))) {
6670
+ return undefined;
6671
+ }
6672
+ const oSheetClipboardData = htmlDocument
6673
+ .querySelector("div")
6674
+ ?.getAttribute("data-osheet-clipboard");
6675
+ return oSheetClipboardData && JSON.parse(oSheetClipboardData);
6676
+ }
6670
6677
  /**
6671
6678
  * Applies each clipboard handler to paste its corresponding data into the target.
6672
6679
  */
@@ -74672,9 +74679,9 @@ stores.inject(MyMetaStore, storeInstance);
74672
74679
  exports.tokenize = tokenize;
74673
74680
 
74674
74681
 
74675
- __info__.version = "18.0.41";
74676
- __info__.date = "2025-08-21T06:42:14.859Z";
74677
- __info__.hash = "bc6051c";
74682
+ __info__.version = "18.0.42";
74683
+ __info__.date = "2025-08-26T10:07:59.958Z";
74684
+ __info__.hash = "7ad0e33";
74678
74685
 
74679
74686
 
74680
74687
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);