@bigbinary/neeto-editor 1.45.8 → 1.45.10
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.
- package/dist/Editor.js +18 -5
- package/dist/Editor.js.map +1 -1
- package/dist/EditorContent.js +1 -1
- package/dist/EditorContent.js.map +1 -1
- package/dist/cjs/Editor.cjs.js +18 -5
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/EditorContent.cjs.js +1 -1
- package/dist/cjs/EditorContent.cjs.js.map +1 -1
- package/dist/editor-stats.html +1 -1
- package/package.json +1 -1
package/dist/Editor.js
CHANGED
|
@@ -8458,7 +8458,7 @@ var CodeBlockComponent = function CodeBlockComponent(_ref) {
|
|
|
8458
8458
|
return document.body;
|
|
8459
8459
|
},
|
|
8460
8460
|
buttonSize: "small",
|
|
8461
|
-
buttonStyle: "
|
|
8461
|
+
buttonStyle: "tertiary",
|
|
8462
8462
|
icon: Down,
|
|
8463
8463
|
label: ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.language) || t("neetoEditor.common.auto"),
|
|
8464
8464
|
strategy: "fixed",
|
|
@@ -8489,12 +8489,12 @@ var CodeBlockComponent = function CodeBlockComponent(_ref) {
|
|
|
8489
8489
|
})]
|
|
8490
8490
|
}), /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
8491
8491
|
size: "small",
|
|
8492
|
-
style: "
|
|
8492
|
+
style: "tertiary",
|
|
8493
8493
|
value: node === null || node === void 0 || (_node$content = node.content) === null || _node$content === void 0 || (_node$content = _node$content.content[0]) === null || _node$content === void 0 ? void 0 : _node$content.text
|
|
8494
8494
|
}), showHighlightButton && /*#__PURE__*/jsx(Button, {
|
|
8495
8495
|
icon: Highlight$1,
|
|
8496
8496
|
size: "small",
|
|
8497
|
-
style: "
|
|
8497
|
+
style: "tertiary",
|
|
8498
8498
|
tooltipProps: {
|
|
8499
8499
|
content: t("neetoEditor.menu.highlight")
|
|
8500
8500
|
},
|
|
@@ -10578,12 +10578,25 @@ var ImageExtension = Node.create({
|
|
|
10578
10578
|
props: {
|
|
10579
10579
|
handleDOMEvents: {
|
|
10580
10580
|
paste: function paste(view, event) {
|
|
10581
|
-
var _event$clipboardData;
|
|
10581
|
+
var _event$clipboardData, _event$clipboardData2;
|
|
10582
10582
|
var _view$state = view.state,
|
|
10583
10583
|
schema = _view$state.schema,
|
|
10584
10584
|
pos = _view$state.selection.$anchor.pos;
|
|
10585
|
-
|
|
10585
|
+
|
|
10586
|
+
// Microsoft Excel and a few other products might copy content as
|
|
10587
|
+
// both `text/plain` and `text/html`. If `text/plain` exists,
|
|
10588
|
+
// an early return will ensure that it fallbacks to tiptap's
|
|
10589
|
+
// default paste behavior.
|
|
10590
|
+
var text = event === null || event === void 0 || (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData("text/plain");
|
|
10591
|
+
var hasFiles = (_event$clipboardData2 = event.clipboardData) === null || _event$clipboardData2 === void 0 || (_event$clipboardData2 = _event$clipboardData2.files) === null || _event$clipboardData2 === void 0 ? void 0 : _event$clipboardData2.length;
|
|
10586
10592
|
if (!hasFiles) return;
|
|
10593
|
+
if (hasFiles && text) {
|
|
10594
|
+
var _DOMParser$parseFromS;
|
|
10595
|
+
event.preventDefault();
|
|
10596
|
+
var plainText = (_DOMParser$parseFromS = new DOMParser().parseFromString(text, "text/html").body.textContent) !== null && _DOMParser$parseFromS !== void 0 ? _DOMParser$parseFromS : "";
|
|
10597
|
+
view.pasteText(plainText);
|
|
10598
|
+
return;
|
|
10599
|
+
}
|
|
10587
10600
|
var images = Array.from(event.clipboardData.files).filter(function (file) {
|
|
10588
10601
|
return /image/i.test(file.type);
|
|
10589
10602
|
});
|