@bigbinary/neeto-editor 1.45.8-beta.1 → 1.45.8

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 CHANGED
@@ -4,7 +4,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import * as React from 'react';
6
6
  import React__default, { memo, useEffect, useState, useRef, useCallback, createElement, forwardRef, useImperativeHandle } from 'react';
7
- import { E as Extension, a as Mark, m as mergeAttributes, b as markInputRule, c as markPasteRule, D as DecorationSet, d as Decoration, g as getMarkAttributes, N as Node, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, e as callOrReturn, f as getExtensionField, i as isNodeSelection, n as nodeInputRule, h as findChildren, j as NodeViewWrapper, l as NodeViewContent, R as ReactNodeViewRenderer, P as PasteRule, v as validateUrl, o as escapeForRegEx, p as ReactRenderer, q as EmojiPickerMenu, r as emojiPickerApi, s as liftTarget, u as combineTransactionSteps, x as getChangedRanges, y as findChildrenInRange, z as getMarksBetween, A as getAttributes, I as InputRule, B as highlightFocussedNode, C as resetFocussedNode, F as findParentNodeClosestToPos, G as BubbleMenu, H as getLinkPopoverPosition, J as getMarkType, K as getMarkRange, L as useEditor, O as useEditorState, M as Menu$3, Q as EditorContent, S as MediaUploader, T as EmbedOption, U as EditorView } from './chunk-B449VRb0.js';
7
+ import { E as Extension, a as Mark, m as mergeAttributes, b as markInputRule, c as markPasteRule, D as DecorationSet, d as Decoration, g as getMarkAttributes, N as Node, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, e as callOrReturn, f as getExtensionField, i as isNodeSelection, n as nodeInputRule, h as findChildren, j as NodeViewWrapper, l as NodeViewContent, R as ReactNodeViewRenderer, P as PasteRule, v as validateUrl, o as escapeForRegEx, p as ReactRenderer, q as EmojiPickerMenu, r as emojiPickerApi, s as liftTarget, u as combineTransactionSteps, x as getChangedRanges, y as findChildrenInRange, z as getMarksBetween, A as getAttributes, I as InputRule, B as highlightFocussedNode, C as resetFocussedNode, F as findParentNodeClosestToPos, G as BubbleMenu, H as getLinkPopoverPosition, J as getMarkType, K as getMarkRange, L as useEditor, O as useEditorState, M as Menu$3, Q as EditorContent, S as MediaUploader, T as EmbedOption, U as EditorView } from './chunk-DmpsWhQd.js';
8
8
  import classnames from 'classnames';
9
9
  import { C as COMBINED_REGEX, D as DIRECT_UPLOAD_ENDPOINT, a as EDITOR_OPTIONS, E as EDITOR_SIZES } from './chunk-vOLrvB3A.js';
10
10
  import { isNotPresent, isNotEmpty, isPresent, noop as noop$1, slugify } from '@bigbinary/neeto-cist';
@@ -13,7 +13,7 @@ import Label from '@bigbinary/neetoui/Label';
13
13
  import { is, intersection, difference, union, mergeRight, isEmpty as isEmpty$1, isNil, assoc, equals } from 'ramda';
14
14
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
15
15
  import { n } from './chunk-DmrvuTKK.js';
16
- import { P as Plugin, o as PluginKey, b as Slice, F as Fragment$1, T as TextSelection, S as Selection, d as dropPoint, N as NodeSelection, s as Mapping$1, M as Mark$1, e as MarkType, R as ReplaceError, u as SelectionRange, L as LINK_VALIDATION_SCHEMA, v as validateAndFormatUrl, w as getEditorStyles, x as clipboardTextParser, y as setInitialPosition, q as DEFAULT_EDITOR_OPTIONS } from './chunk-JuLeeW25.js';
16
+ import { P as Plugin, o as PluginKey, b as Slice, F as Fragment$1, T as TextSelection, S as Selection, d as dropPoint, N as NodeSelection, s as Mapping$1, M as Mark$1, e as MarkType, R as ReplaceError, u as SelectionRange, L as LINK_VALIDATION_SCHEMA, v as validateAndFormatUrl, w as getEditorStyles, x as clipboardTextParser, y as transformPastedHTML, z as setInitialPosition, q as DEFAULT_EDITOR_OPTIONS } from './chunk-DYi5Rp_k.js';
17
17
  import * as Y from 'yjs';
18
18
  import { UndoManager, Item as Item$1, ContentType, Text as Text$2, XmlElement } from 'yjs';
19
19
  import Down from '@bigbinary/neeto-icons/Down';
@@ -10578,25 +10578,12 @@ var ImageExtension = Node.create({
10578
10578
  props: {
10579
10579
  handleDOMEvents: {
10580
10580
  paste: function paste(view, event) {
10581
- var _event$clipboardData, _event$clipboardData2;
10581
+ var _event$clipboardData;
10582
10582
  var _view$state = view.state,
10583
10583
  schema = _view$state.schema,
10584
10584
  pos = _view$state.selection.$anchor.pos;
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;
10585
+ var hasFiles = (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 || (_event$clipboardData = _event$clipboardData.files) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.length;
10592
10586
  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
- }
10600
10587
  var images = Array.from(event.clipboardData.files).filter(function (file) {
10601
10588
  return /image/i.test(file.type);
10602
10589
  });
@@ -19698,7 +19685,8 @@ var Editor = function Editor(_ref, ref) {
19698
19685
  }),
19699
19686
  "data-cy": "neeto-editor-content"
19700
19687
  }, ariaAttributes), contentAttributes),
19701
- clipboardTextParser: clipboardTextParser
19688
+ clipboardTextParser: clipboardTextParser,
19689
+ transformPastedHTML: transformPastedHTML
19702
19690
  },
19703
19691
  parseOptions: {
19704
19692
  preserveWhitespace: true