@bigbinary/neeto-editor 1.39.7 → 1.39.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 +41 -6
- package/dist/Editor.js.map +1 -1
- package/dist/FormikEditor.js +2 -2
- package/dist/Menu.js +2 -2
- package/dist/{chunk-7fc1f9b9.js → chunk-6e497ab8.js} +2 -2
- package/dist/{chunk-7fc1f9b9.js.map → chunk-6e497ab8.js.map} +1 -1
- package/dist/{chunk-e876ad10.js → chunk-d17f73d0.js} +2 -2
- package/dist/{chunk-e876ad10.js.map → chunk-d17f73d0.js.map} +1 -1
- package/dist/cjs/Editor.cjs.js +39 -4
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/editor-stats.html +1 -1
- package/dist/index.js +2 -2
- package/dist/utils.js +1 -1
- package/package.json +1 -1
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, forwardRef, useCallback, useImperativeHandle } from 'react';
|
|
7
|
-
import { E as Extension, a as Mark, m as mergeAttributes, b as markInputRule, c as markPasteRule, g as getMarkAttributes, N as Node, D as DecorationSet, d as Decoration, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, e as callOrReturn, f as getExtensionField, n as nodeInputRule, h as findChildren, i as NodeViewWrapper, j as NodeViewContent, R as ReactNodeViewRenderer, P as PasteRule, v as validateUrl, l as escapeForRegEx, o as ReactRenderer, p as EmojiPickerMenu, q as emojiPickerApi, r as combineTransactionSteps, s as getChangedRanges, u as findChildrenInRange, x as getMarksBetween, y as getAttributes, I as InputRule, z as highlightFocussedNode, A as resetFocussedNode, B as findParentNodeClosestToPos, C as BubbleMenu, F as getLinkPopoverPosition, G as getMarkType, H as getMarkRange, J as useEditor, M as Menu$3, K as EditorContent, L as MediaUploader, O as EmbedOption, Q as EditorView } from './chunk-
|
|
7
|
+
import { E as Extension, a as Mark, m as mergeAttributes, b as markInputRule, c as markPasteRule, g as getMarkAttributes, N as Node, D as DecorationSet, d as Decoration, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, e as callOrReturn, f as getExtensionField, n as nodeInputRule, h as findChildren, i as NodeViewWrapper, j as NodeViewContent, R as ReactNodeViewRenderer, P as PasteRule, v as validateUrl, l as escapeForRegEx, o as ReactRenderer, p as EmojiPickerMenu, q as emojiPickerApi, r as combineTransactionSteps, s as getChangedRanges, u as findChildrenInRange, x as getMarksBetween, y as getAttributes, I as InputRule, z as highlightFocussedNode, A as resetFocussedNode, B as findParentNodeClosestToPos, C as BubbleMenu, F as getLinkPopoverPosition, G as getMarkType, H as getMarkRange, J as useEditor, M as Menu$3, K as EditorContent, L as MediaUploader, O as EmbedOption, Q as EditorView } from './chunk-6e497ab8.js';
|
|
8
8
|
import classnames from 'classnames';
|
|
9
9
|
import { C as COMBINED_REGEX, D as DIRECT_UPLOAD_ENDPOINT, E as EDITOR_OPTIONS } from './chunk-edd8b9fe.js';
|
|
10
10
|
import { isNotPresent, isNotEmpty, isPresent, noop as noop$1, slugify } from '@bigbinary/neeto-cist';
|
|
@@ -12,7 +12,7 @@ import { useOnClickOutside, useFuncDebounce } from '@bigbinary/neeto-commons-fro
|
|
|
12
12
|
import { Dropdown, Input, Button, Spinner, Modal, Toastr, Avatar, Typography, Checkbox, Label } from '@bigbinary/neetoui';
|
|
13
13
|
import { is, isNil, mergeRight, isEmpty as isEmpty$1, assoc, equals } from 'ramda';
|
|
14
14
|
import { n } from './chunk-15c449f1.js';
|
|
15
|
-
import { P as Plugin, b as PluginKey, T as TextSelection, d as dropPoint, S as Selection, N as NodeSelection, F as Fragment, c as Slice, M as Mapping, e as SelectionRange, f as Transform, L as LINK_VALIDATION_SCHEMA, v as validateAndFormatUrl, g as getEditorStyles, h as clipboardTextParser, s as setInitialPosition, D as DEFAULT_EDITOR_OPTIONS } from './chunk-
|
|
15
|
+
import { P as Plugin, b as PluginKey, T as TextSelection, d as dropPoint, S as Selection, N as NodeSelection, F as Fragment, c as Slice, M as Mapping, l as liftTarget, e as SelectionRange, f as Transform, L as LINK_VALIDATION_SCHEMA, v as validateAndFormatUrl, g as getEditorStyles, h as clipboardTextParser, s as setInitialPosition, D as DEFAULT_EDITOR_OPTIONS } from './chunk-d17f73d0.js';
|
|
16
16
|
import { Down, MenuHorizontal, Close, Paragraph as Paragraph$1, TextH1, TextH2, Text as Text$2, ListNumber, ListDot, ImageUpload, Video, Blockquote as Blockquote$1, CodeBlock as CodeBlock$2, Smiley, Minus, MediaVideo, Notes, Column, InsertRow, InsertColumn, DeleteRow, DeleteColumn, MergeSplit, ToggleHeaderRow, DeleteTable } from '@bigbinary/neeto-icons';
|
|
17
17
|
import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardButton';
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
@@ -7863,16 +7863,51 @@ var KeyboardShortcuts = function KeyboardShortcuts(_ref) {
|
|
|
7863
7863
|
return true;
|
|
7864
7864
|
}
|
|
7865
7865
|
return false;
|
|
7866
|
+
},
|
|
7867
|
+
// To fix the issue with backspace on the empty list item moving the focus to the block on top.
|
|
7868
|
+
// https://github.com/ueberdosis/tiptap/issues/2829#issuecomment-1511064298
|
|
7869
|
+
Backspace: function Backspace() {
|
|
7870
|
+
return _this.editor.commands.command(function (_ref2) {
|
|
7871
|
+
var tr = _ref2.tr;
|
|
7872
|
+
var selection = tr.selection,
|
|
7873
|
+
doc = tr.doc;
|
|
7874
|
+
var $cursor = selection.$cursor;
|
|
7875
|
+
var depth = $cursor === null || $cursor === void 0 ? void 0 : $cursor.depth;
|
|
7876
|
+
if ($cursor && depth >= 3 &&
|
|
7877
|
+
// At least the structure is doc -> orderedList/bulletList -> listItem -> paragraph
|
|
7878
|
+
$cursor.parent.type.name === "paragraph" &&
|
|
7879
|
+
// The cursor is inside a paragraph.
|
|
7880
|
+
$cursor.parentOffset === 0 &&
|
|
7881
|
+
// The cursor is at the beginning of the paragraph.
|
|
7882
|
+
$cursor.node(depth - 1).type.name === "listItem" &&
|
|
7883
|
+
// The paragraph is inside a listItem.
|
|
7884
|
+
$cursor.index(depth - 1) === 0 &&
|
|
7885
|
+
// The paragraph is at the beginning of the listItem.
|
|
7886
|
+
$cursor.index(depth - 2) === 0 // The listItem is at the beginning of the list.
|
|
7887
|
+
) {
|
|
7888
|
+
var listItemNode = $cursor.node(depth - 1);
|
|
7889
|
+
var listItemPos = $cursor.before(depth - 1);
|
|
7890
|
+
var $contentBegin = doc.resolve(listItemPos + 1);
|
|
7891
|
+
var $contentEnd = doc.resolve(listItemPos + listItemNode.nodeSize - 1);
|
|
7892
|
+
var range = $contentBegin.blockRange($contentEnd);
|
|
7893
|
+
var target = liftTarget(range);
|
|
7894
|
+
if (target !== null) {
|
|
7895
|
+
tr.lift(range, target);
|
|
7896
|
+
return true;
|
|
7897
|
+
}
|
|
7898
|
+
}
|
|
7899
|
+
return false;
|
|
7900
|
+
});
|
|
7866
7901
|
}
|
|
7867
7902
|
}, shortcuts);
|
|
7868
7903
|
}
|
|
7869
7904
|
});
|
|
7870
7905
|
};
|
|
7871
7906
|
var KeyboardShortcuts$1 = {
|
|
7872
|
-
configure: function configure(
|
|
7873
|
-
var onSubmit =
|
|
7874
|
-
shortcuts =
|
|
7875
|
-
isBlockQuoteActive =
|
|
7907
|
+
configure: function configure(_ref3) {
|
|
7908
|
+
var onSubmit = _ref3.onSubmit,
|
|
7909
|
+
shortcuts = _ref3.shortcuts,
|
|
7910
|
+
isBlockQuoteActive = _ref3.isBlockQuoteActive;
|
|
7876
7911
|
return KeyboardShortcuts({
|
|
7877
7912
|
onSubmit: onSubmit,
|
|
7878
7913
|
shortcuts: shortcuts,
|