@bigbinary/neeto-editor 1.47.131 → 1.47.132

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.
@@ -159,6 +159,17 @@ var transformPastedHTML = function transformPastedHTML(content) {
159
159
  }
160
160
  return doc.body.innerHTML;
161
161
  };
162
+ var handlePaste = function handlePaste(view, event, slice) {
163
+ try {
164
+ view.state.tr.replaceSelection(slice);
165
+ return false;
166
+ } catch (_unused) {
167
+ var _event$clipboardData;
168
+ var text = ((_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData("text/plain")) || slice.content.textBetween(0, slice.content.size, "\n").trim();
169
+ if (text) view.dispatch(view.state.tr.insertText(text).scrollIntoView());
170
+ return true;
171
+ }
172
+ };
162
173
  var buildLevelsFromOptions = function buildLevelsFromOptions(options) {
163
174
  var levels = _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, constants.EDITOR_OPTIONS.H1, 1), constants.EDITOR_OPTIONS.H2, 2), constants.EDITOR_OPTIONS.H3, 3), constants.EDITOR_OPTIONS.H4, 4), constants.EDITOR_OPTIONS.H5, 5), constants.EDITOR_OPTIONS.H6, 6);
164
175
  return Object.entries(levels).filter(function (heading) {
@@ -3494,6 +3505,7 @@ exports.clipboardTextParser = clipboardTextParser;
3494
3505
  exports.getEditorStyles = getEditorStyles;
3495
3506
  exports.getLinkPopoverPosition = getLinkPopoverPosition;
3496
3507
  exports.getSuggestionAppendTo = getSuggestionAppendTo;
3508
+ exports.handlePaste = handlePaste;
3497
3509
  exports.isEditorOverlaysActive = isEditorOverlaysActive;
3498
3510
  exports.isEmojiSuggestionsMenuActive = isEmojiSuggestionsMenuActive;
3499
3511
  exports.setInitialPosition = setInitialPosition;
@@ -3501,4 +3513,4 @@ exports.transformEditorContent = transformEditorContent;
3501
3513
  exports.transformPastedHTML = transformPastedHTML;
3502
3514
  exports.validateAndFormatUrl = validateAndFormatUrl;
3503
3515
  exports.validateUrl = validateUrl;
3504
- //# sourceMappingURL=chunk-CLrHidij.cjs.js.map
3516
+ //# sourceMappingURL=chunk-D86oGQis.cjs.js.map