@bigbinary/neeto-editor 1.47.103 → 1.47.104

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.
@@ -6703,10 +6703,19 @@ var isEmojiSuggestionsMenuActive = function isEmojiSuggestionsMenuActive() {
6703
6703
  var transformPastedHTML = function transformPastedHTML(content) {
6704
6704
  var contentWithoutBr = content.replaceAll("<br />", "<p></p>");
6705
6705
  var doc = new DOMParser().parseFromString(contentWithoutBr, "text/html");
6706
- doc.querySelectorAll("[style]").forEach(function (el) {
6707
- el.style.color = "";
6708
- el.style.backgroundColor = "";
6709
- });
6706
+
6707
+ // ProseMirror tags clipboard output from any TipTap/ProseMirror editor with
6708
+ // `data-pm-slice`. When present, the paste is coming from another
6709
+ // neeto-editor instance and we preserve the author's color choices. When
6710
+ // absent, the source is external (Word, websites, customer messages) and we
6711
+ // strip inline colors so foreign theming does not bleed into the editor.
6712
+ var isInternalPaste = doc.querySelector("[data-pm-slice]") !== null;
6713
+ if (!isInternalPaste) {
6714
+ doc.querySelectorAll("[style]").forEach(function (el) {
6715
+ el.style.color = "";
6716
+ el.style.backgroundColor = "";
6717
+ });
6718
+ }
6710
6719
  return doc.body.innerHTML;
6711
6720
  };
6712
6721
  var buildLevelsFromOptions = function buildLevelsFromOptions(options) {
@@ -6754,4 +6763,4 @@ exports.setInitialPosition = setInitialPosition;
6754
6763
  exports.transformEditorContent = transformEditorContent;
6755
6764
  exports.transformPastedHTML = transformPastedHTML;
6756
6765
  exports.validateAndFormatUrl = validateAndFormatUrl;
6757
- //# sourceMappingURL=chunk-BWXzVFnj.cjs.js.map
6766
+ //# sourceMappingURL=chunk-CLeV8Bxb.cjs.js.map