@atlaskit/editor-core 187.8.7 → 187.8.11
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/CHANGELOG.md +14 -0
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +4 -4
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +5 -5
- package/dist/cjs/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/list/actions/conversions.js +5 -5
- package/dist/cjs/plugins/list/actions/indent-list-items-selected.js +11 -11
- package/dist/cjs/plugins/list/actions/join-list-items-forward.js +6 -6
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +6 -7
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +3 -4
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +3 -4
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +2 -2
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +2 -2
- package/dist/cjs/plugins/list/actions/merge-lists.js +3 -3
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +11 -11
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +2 -2
- package/dist/cjs/plugins/list/commands/indent-list.js +6 -7
- package/dist/cjs/plugins/list/commands/index.js +8 -10
- package/dist/cjs/plugins/list/commands/join-list-item-forward.js +5 -5
- package/dist/cjs/plugins/list/commands/listBackspace.js +13 -14
- package/dist/cjs/plugins/list/commands/outdent-list.js +4 -3
- package/dist/cjs/plugins/list/pm-plugins/main.js +5 -6
- package/dist/cjs/plugins/list/utils/analytics.js +1 -35
- package/dist/cjs/plugins/list/utils/indentation.js +2 -20
- package/dist/cjs/plugins/list/utils/node.js +2 -106
- package/dist/cjs/plugins/list/utils/selection.js +3 -54
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +2 -2
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +17 -18
- package/dist/cjs/plugins/text-formatting/index.js +23 -21
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +48 -54
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +28 -33
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/cjs/utils/commands.js +3 -109
- package/dist/cjs/utils/document.js +1 -26
- package/dist/cjs/utils/index.js +0 -6
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/es2019/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/list/actions/conversions.js +2 -2
- package/dist/es2019/plugins/list/actions/indent-list-items-selected.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-forward.js +1 -1
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +1 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +1 -1
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +1 -1
- package/dist/es2019/plugins/list/actions/merge-lists.js +1 -1
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +3 -3
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +1 -1
- package/dist/es2019/plugins/list/commands/indent-list.js +3 -4
- package/dist/es2019/plugins/list/commands/index.js +4 -5
- package/dist/es2019/plugins/list/commands/join-list-item-forward.js +1 -1
- package/dist/es2019/plugins/list/commands/listBackspace.js +1 -2
- package/dist/es2019/plugins/list/commands/outdent-list.js +3 -2
- package/dist/es2019/plugins/list/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/list/utils/analytics.js +0 -36
- package/dist/es2019/plugins/list/utils/indentation.js +0 -18
- package/dist/es2019/plugins/list/utils/node.js +3 -89
- package/dist/es2019/plugins/list/utils/selection.js +1 -52
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/es2019/plugins/text-formatting/index.js +15 -10
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +20 -18
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +11 -12
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/es2019/utils/commands.js +2 -102
- package/dist/es2019/utils/document.js +1 -26
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/esm/plugins/block-type/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/esm/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/list/actions/conversions.js +2 -2
- package/dist/esm/plugins/list/actions/indent-list-items-selected.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-forward.js +1 -1
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +1 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +1 -1
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +1 -1
- package/dist/esm/plugins/list/actions/merge-lists.js +1 -1
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +3 -3
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +1 -1
- package/dist/esm/plugins/list/commands/indent-list.js +3 -4
- package/dist/esm/plugins/list/commands/index.js +4 -5
- package/dist/esm/plugins/list/commands/join-list-item-forward.js +1 -1
- package/dist/esm/plugins/list/commands/listBackspace.js +1 -2
- package/dist/esm/plugins/list/commands/outdent-list.js +3 -2
- package/dist/esm/plugins/list/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/list/utils/analytics.js +0 -32
- package/dist/esm/plugins/list/utils/indentation.js +0 -17
- package/dist/esm/plugins/list/utils/node.js +3 -81
- package/dist/esm/plugins/list/utils/selection.js +3 -51
- package/dist/esm/plugins/tasks-and-decisions/commands.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/esm/plugins/text-formatting/index.js +23 -21
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +48 -54
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +26 -31
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/esm/utils/commands.js +2 -100
- package/dist/esm/utils/document.js +1 -26
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins/list/actions/join-list-items-forward.d.ts +1 -1
- package/dist/types/plugins/list/commands/indent-list.d.ts +2 -1
- package/dist/types/plugins/list/commands/index.d.ts +2 -1
- package/dist/types/plugins/list/commands/join-list-item-forward.d.ts +1 -1
- package/dist/types/plugins/list/commands/listBackspace.d.ts +1 -1
- package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types/plugins/list/utils/analytics.d.ts +2 -4
- package/dist/types/plugins/list/utils/indentation.d.ts +0 -5
- package/dist/types/plugins/list/utils/node.d.ts +2 -17
- package/dist/types/plugins/list/utils/selection.d.ts +1 -12
- package/dist/types/plugins/text-formatting/pm-plugins/input-rule.d.ts +2 -1
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +2 -2
- package/dist/types/utils/commands.d.ts +3 -32
- package/dist/types/utils/document.d.ts +0 -4
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-forward.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/indent-list.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/commands/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/commands/join-list-item-forward.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/listBackspace.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/utils/analytics.d.ts +2 -4
- package/dist/types-ts4.5/plugins/list/utils/indentation.d.ts +0 -5
- package/dist/types-ts4.5/plugins/list/utils/node.d.ts +2 -17
- package/dist/types-ts4.5/plugins/list/utils/selection.d.ts +1 -12
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/input-rule.d.ts +2 -1
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +2 -2
- package/dist/types-ts4.5/utils/commands.d.ts +3 -38
- package/dist/types-ts4.5/utils/document.d.ts +0 -4
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/package.json +2 -2
- package/report.api.md +0 -3
- package/tmp/api-report-tmp.d.ts +0 -3
- package/dist/cjs/plugins/list/utils/replace-content.js +0 -24
- package/dist/cjs/utils/prosemirror/autojoin.js +0 -68
- package/dist/es2019/plugins/list/utils/replace-content.js +0 -18
- package/dist/es2019/utils/prosemirror/autojoin.js +0 -57
- package/dist/esm/plugins/list/utils/replace-content.js +0 -17
- package/dist/esm/utils/prosemirror/autojoin.js +0 -63
- package/dist/types/plugins/list/utils/replace-content.d.ts +0 -8
- package/dist/types/utils/prosemirror/autojoin.d.ts +0 -13
- package/dist/types-ts4.5/plugins/list/utils/replace-content.d.ts +0 -8
- package/dist/types-ts4.5/utils/prosemirror/autojoin.d.ts +0 -13
|
@@ -9,7 +9,6 @@ exports.getChangedNodes = getChangedNodes;
|
|
|
9
9
|
exports.getChangedNodesIn = getChangedNodesIn;
|
|
10
10
|
exports.getChildBreakoutModes = getChildBreakoutModes;
|
|
11
11
|
exports.getNodesCount = getNodesCount;
|
|
12
|
-
exports.hasVisibleContent = hasVisibleContent;
|
|
13
12
|
exports.isInEmptyLine = isInEmptyLine;
|
|
14
13
|
exports.isNodeEmpty = isNodeEmpty;
|
|
15
14
|
exports.isSelectionEndOfParagraph = void 0;
|
|
@@ -17,32 +16,8 @@ exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
|
17
16
|
exports.processRawFragmentValue = processRawFragmentValue;
|
|
18
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
18
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
20
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
21
19
|
var _nodeWidth = require("./node-width");
|
|
22
|
-
|
|
23
|
-
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
24
|
-
*/
|
|
25
|
-
function hasVisibleContent(node) {
|
|
26
|
-
var isInlineNodeHasVisibleContent = function isInlineNodeHasVisibleContent(inlineNode) {
|
|
27
|
-
return inlineNode.isText ? !!inlineNode.textContent.trim() : inlineNode.type.name !== 'hardBreak';
|
|
28
|
-
};
|
|
29
|
-
if (node.isInline) {
|
|
30
|
-
return isInlineNodeHasVisibleContent(node);
|
|
31
|
-
} else if (node.isBlock && (node.isLeaf || node.isAtom)) {
|
|
32
|
-
return true;
|
|
33
|
-
} else if (!node.childCount) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
for (var _index = 0; _index < node.childCount; _index++) {
|
|
37
|
-
var child = node.child(_index);
|
|
38
|
-
var invisibleNodeTypes = ['paragraph', 'text', 'hardBreak'];
|
|
39
|
-
if (!invisibleNodeTypes.includes(child.type.name) || hasVisibleContent(child)) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
|
|
20
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
46
21
|
/**
|
|
47
22
|
* Checks if a node has any content. Ignores node that only contain empty block nodes.
|
|
48
23
|
*/
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -30,12 +30,6 @@ Object.defineProperty(exports, "getNodesCount", {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
exports.hasOpenEnd = void 0;
|
|
33
|
-
Object.defineProperty(exports, "hasVisibleContent", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function get() {
|
|
36
|
-
return _document.hasVisibleContent;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
33
|
Object.defineProperty(exports, "insideTable", {
|
|
40
34
|
enumerable: true,
|
|
41
35
|
get: function get() {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.8.
|
|
9
|
+
var version = "187.8.11";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/index.js
CHANGED
|
@@ -42,7 +42,7 @@ export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } f
|
|
|
42
42
|
export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded } from './plugins/mobile-dimensions/commands';
|
|
43
43
|
|
|
44
44
|
// Used in editor-test-helpers and mobile bridge
|
|
45
|
-
export { setTextSelection, dedupe, getNodesCount, measurements
|
|
45
|
+
export { setTextSelection, dedupe, getNodesCount, measurements } from './utils';
|
|
46
46
|
export { getListCommands } from './utils/list-commands';
|
|
47
47
|
export { ReactEditorView, BaseReactEditorView } from './create-editor';
|
|
48
48
|
export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
|
-
import {
|
|
4
|
+
import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { isSelectionEndOfParagraph } from '../../../utils';
|
|
6
6
|
export const newlinePreserveMarksKey = new PluginKey('newlinePreserveMarksPlugin');
|
|
7
7
|
const isSelectionAligned = state => !!state.selection.$to.parent.marks.find(m => m.type === state.schema.marks.alignment);
|
|
@@ -5,7 +5,7 @@ import * as commands from '../../../commands';
|
|
|
5
5
|
import * as blockTypes from '../types';
|
|
6
6
|
import { keymap } from '../../../utils/keymap';
|
|
7
7
|
import { cleanUpAtTheStartOfDocument, deleteAndMoveCursor, deleteBlockContent, insertBlockTypesWithAnalytics } from '../commands';
|
|
8
|
-
import { deleteEmptyParagraphAndMoveBlockUp } from '
|
|
8
|
+
import { deleteEmptyParagraphAndMoveBlockUp } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { INPUT_METHOD } from '../../analytics';
|
|
10
10
|
import { isNodeAWrappingBlockNode } from '../utils';
|
|
11
11
|
const backspace = chainCommands(cleanUpAtTheStartOfDocument, deleteBlockContent(isNodeAWrappingBlockNode), deleteAndMoveCursor);
|
|
@@ -3,7 +3,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { getCursor } from '../../../utils';
|
|
6
|
-
import {
|
|
6
|
+
import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { isCursorBeforeClosingCharacter, isClosingCharacter } from '../ide-ux/paired-character-handling';
|
|
8
8
|
import { getAutoClosingBracketInfo, shouldAutoCloseBracket } from '../ide-ux/bracket-handling';
|
|
9
9
|
import { getAutoClosingQuoteInfo, shouldAutoCloseQuote } from '../ide-ux/quote-handling';
|
|
@@ -3,7 +3,7 @@ import { TextSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
5
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import {
|
|
6
|
+
import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { createSelectionClickHandler } from '../../selection/utils';
|
|
8
8
|
import { fixColumnSizes, fixColumnStructure, getSelectedLayout } from '../actions';
|
|
9
9
|
import { pluginKey } from './plugin-key';
|
|
@@ -2,8 +2,8 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import { NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { findWrapping } from '@atlaskit/editor-prosemirror/transform';
|
|
4
4
|
import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { isEmptyParagraph, isListNode } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { joinSiblingLists } from '@atlaskit/editor-common/lists';
|
|
7
7
|
import { findFirstParentListNode } from '../utils/find';
|
|
8
8
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
9
9
|
export function convertListType({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Selection, TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import {
|
|
3
|
+
import { normalizeListItemsSelection } from '@atlaskit/editor-common/lists';
|
|
4
4
|
import { findFirstParentListItemNode } from '../utils/find';
|
|
5
|
-
import {
|
|
5
|
+
import { isListItemNode, isListNode } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
7
7
|
export const indentListItemsSelected = tr => {
|
|
8
8
|
const originalSelection = tr.selection;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LIST_TEXT_SCENARIOS } from '../../analytics';
|
|
2
|
-
import { isParagraphNode, isListNode, isListItemNode } from '
|
|
2
|
+
import { isParagraphNode, isListNode, isListItemNode } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { isPosInsideList, isPosInsideParagraph } from '../utils/selection';
|
|
4
4
|
import { joinParagrapWithList, joinSiblingListItems, joinNestedListWithParentListItem, joinListItemWithParentNestedList, joinListItemWithParagraph } from './join-list-items-scenarios';
|
|
5
5
|
export const calcJoinListScenario = (walkNode, $head) => {
|
package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { insertContentDeleteRange } from '
|
|
1
|
+
import { insertContentDeleteRange, isListNode } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { isListNode } from '../../utils/node';
|
|
4
3
|
// Case for when a users selection is at the end of a paragraph, the paragraph
|
|
5
4
|
// is followed by a list, and they delete forward
|
|
6
5
|
export const joinListItemWithParagraph = ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { insertContentDeleteRange } from '
|
|
2
|
-
import { isListNode } from '
|
|
1
|
+
import { insertContentDeleteRange } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { isListNode } from '@atlaskit/editor-common/utils';
|
|
3
3
|
//Case for two adjacent list items with the first being of greater indentation
|
|
4
4
|
export const joinListItemWithParentNestedList = ({
|
|
5
5
|
tr,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { insertContentDeleteRange } from '
|
|
2
|
-
import { isListNode } from '
|
|
1
|
+
import { insertContentDeleteRange } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { isListNode } from '@atlaskit/editor-common/utils';
|
|
3
3
|
//Case for two adjacent list items with the first being of lower indentation
|
|
4
4
|
export const joinNestedListWithParentListItem = ({
|
|
5
5
|
tr,
|
package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { insertContentDeleteRange } from '
|
|
1
|
+
import { insertContentDeleteRange } from '@atlaskit/editor-common/utils';
|
|
2
2
|
//Case for two adjacent nodes with the first being a list item and the last being a paragraph
|
|
3
3
|
export const joinParagrapWithList = ({
|
|
4
4
|
tr,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Selection, TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { NodeRange, Slice, Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { liftTarget, ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
-
import { getOrderFromOrderedListNode } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import {
|
|
4
|
+
import { getOrderFromOrderedListNode, isListNode, isListItemNode } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { joinSiblingLists, JoinDirection, normalizeListItemsSelection } from '@atlaskit/editor-common/lists';
|
|
6
6
|
import { findFirstParentListItemNode, findRootParentListNode } from '../utils/find';
|
|
7
|
-
import {
|
|
7
|
+
import { createListNodeRange } from '../utils/selection';
|
|
8
8
|
import { GapCursorSelection } from '../../selection/gap-cursor-selection';
|
|
9
9
|
import { storeRestartListsAttributes, getRestartListsAttributes } from '../utils/analytics';
|
|
10
10
|
import { OUTDENT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, Slice, NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { ReplaceAroundStep, findWrapping, canSplit } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
import { autoJoinTr } from '
|
|
3
|
+
import { autoJoinTr } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { GapCursorSelection } from '../../selection/gap-cursor-selection';
|
|
5
5
|
import { isWrappingPossible } from '../utils/selection';
|
|
6
6
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { hasValidListIndentationLevel } from '
|
|
2
|
+
import { hasValidListIndentationLevel, getListItemAttributes, getCommonListAnalyticsAttributes } from '@atlaskit/editor-common/lists';
|
|
3
3
|
import { indentListItemsSelected as indentListAction } from '../actions/indent-list-items-selected';
|
|
4
|
-
import { isBulletList } from '
|
|
4
|
+
import { isBulletList } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { findFirstParentListNode } from '../utils/find';
|
|
6
6
|
import { MAX_NESTED_LIST_INDENTATION } from '../types';
|
|
7
|
-
import { isInsideListItem, isInsideTableCell
|
|
8
|
-
import { getCommonListAnalyticsAttributes } from '../utils/analytics';
|
|
7
|
+
import { isInsideListItem, isInsideTableCell } from '../utils/selection';
|
|
9
8
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
10
9
|
export const indentList = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD) => {
|
|
11
10
|
return function (state, dispatch) {
|
|
@@ -2,22 +2,21 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
2
2
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import * as baseCommand from '@atlaskit/editor-prosemirror/commands';
|
|
4
4
|
import { findPositionOfNodeBefore, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { hasVisibleContent } from '
|
|
6
|
-
import {
|
|
7
|
-
import { filterCommands as filter } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { filterCommand as filter, hasVisibleContent, isEmptySelectionAtStart } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { isFirstChildOfParent, findCutBefore } from '../../../utils/commands';
|
|
8
7
|
import { sanitiseMarksInSelection } from '../../../utils';
|
|
8
|
+
import { getCommonListAnalyticsAttributes } from '@atlaskit/editor-common/lists';
|
|
9
9
|
import { liftFollowingList, liftTextSelectionList, liftNodeSelectionList } from '../transforms';
|
|
10
10
|
import { GapCursorSelection } from '../../selection/gap-cursor-selection';
|
|
11
11
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
12
|
import { isInsideListItem, canJoinToPreviousListItem, selectionContainsList } from '../utils/selection';
|
|
13
|
-
import { getCommonListAnalyticsAttributes } from '../utils/analytics';
|
|
14
13
|
import { listBackspace } from './listBackspace';
|
|
15
14
|
import { joinListItemForward } from './join-list-item-forward';
|
|
16
15
|
import { convertListType } from '../actions/conversions';
|
|
17
16
|
import { wrapInListAndJoin } from '../actions/wrap-and-join-lists';
|
|
18
17
|
import { outdentList } from './outdent-list';
|
|
19
18
|
import { indentList } from './indent-list';
|
|
20
|
-
import { moveTargetIntoList } from '
|
|
19
|
+
import { moveTargetIntoList } from '@atlaskit/editor-common/lists';
|
|
21
20
|
export { outdentList, indentList };
|
|
22
21
|
export const enterKeyCommand = editorAnalyticsAPI => featureFlags => (state, dispatch) => {
|
|
23
22
|
const {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEmptySelectionAtEnd, walkNextNode } from '
|
|
1
|
+
import { isEmptySelectionAtEnd, walkNextNode } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, DELETE_DIRECTION } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { calcJoinListScenario } from '../actions/join-list-items-forward';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { insertContentDeleteRange, isEmptySelectionAtStart, walkPrevNode } from '
|
|
1
|
+
import { insertContentDeleteRange, isEmptySelectionAtStart, walkPrevNode, isListNode, isParagraphNode } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, DELETE_DIRECTION, LIST_TEXT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { isListNode, isParagraphNode } from '@atlaskit/editor-common/utils';
|
|
5
4
|
import { isPosInsideList, isPosInsideParagraph } from '../utils/selection';
|
|
6
5
|
//Cases below refer to the cases found in this document: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1146954996/List+Backspace+and+Delete+Behaviour
|
|
7
6
|
//Case for two adjacent list items of the same indentation
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { getCommonListAnalyticsAttributes } from '@atlaskit/editor-common/lists';
|
|
1
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, OUTDENT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import { isInsideListItem, isInsideTableCell } from '../utils/selection';
|
|
3
|
-
import { isBulletList } from '
|
|
4
|
+
import { isBulletList } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { findFirstParentListNode } from '../utils/find';
|
|
5
|
-
import {
|
|
6
|
+
import { getRestartListsAttributes } from '../utils/analytics';
|
|
6
7
|
import { outdentListItemsSelected as outdentListAction } from '../actions/outdent-list-items-selected';
|
|
7
8
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
8
9
|
export const outdentList = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD, featureFlags) => {
|
|
@@ -3,7 +3,7 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { isWrappingPossible } from '../utils/selection';
|
|
6
|
-
import { isListNode } from '
|
|
6
|
+
import { isListNode } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { pluginFactory } from '../../../utils/plugin-state-factory';
|
|
8
8
|
import { setGapCursorSelection } from '../../../utils';
|
|
9
9
|
import { Side } from '@atlaskit/editor-common/selection';
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
import { isListItemNode, isListNode } from '@atlaskit/editor-common/utils';
|
|
2
|
-
import { getListItemAttributes } from './selection';
|
|
3
|
-
export const getCommonListAnalyticsAttributes = state => {
|
|
4
|
-
const {
|
|
5
|
-
selection: {
|
|
6
|
-
$from,
|
|
7
|
-
$to
|
|
8
|
-
}
|
|
9
|
-
} = state;
|
|
10
|
-
const fromAttrs = getListItemAttributes($from);
|
|
11
|
-
const toAttrs = getListItemAttributes($to);
|
|
12
|
-
return {
|
|
13
|
-
itemIndexAtSelectionStart: fromAttrs.itemIndex,
|
|
14
|
-
itemIndexAtSelectionEnd: toAttrs.itemIndex,
|
|
15
|
-
indentLevelAtSelectionStart: fromAttrs.indentLevel,
|
|
16
|
-
indentLevelAtSelectionEnd: toAttrs.indentLevel,
|
|
17
|
-
itemsInSelection: countListItemsInSelection(state)
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export const countListItemsInSelection = state => {
|
|
21
|
-
const {
|
|
22
|
-
from,
|
|
23
|
-
to
|
|
24
|
-
} = state.selection;
|
|
25
|
-
if (from === to) {
|
|
26
|
-
return 1;
|
|
27
|
-
}
|
|
28
|
-
let count = 0;
|
|
29
|
-
const listSlice = state.doc.cut(from, to);
|
|
30
|
-
listSlice.content.nodesBetween(0, listSlice.content.size, (node, pos, parent, index) => {
|
|
31
|
-
if (parent && isListItemNode(parent) && !isListNode(node) && index === 0) {
|
|
32
|
-
count++;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return count;
|
|
36
|
-
};
|
|
37
1
|
export const RESTART_LISTS_ANALYTICS_KEY = 'restartListsAnalytics';
|
|
38
2
|
export const getRestartListsAttributes = tr => {
|
|
39
3
|
var _tr$getMeta;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { numberNestedLists } from './selection';
|
|
2
1
|
import { isListItemNode, isListNode } from '@atlaskit/editor-common/utils';
|
|
3
2
|
|
|
4
3
|
// This will return (depth - 1) for root list parent of a list.
|
|
@@ -14,21 +13,4 @@ export const getListLiftTarget = resPos => {
|
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
return target - 1;
|
|
17
|
-
};
|
|
18
|
-
export const hasValidListIndentationLevel = ({
|
|
19
|
-
tr,
|
|
20
|
-
maxIndentation
|
|
21
|
-
}) => {
|
|
22
|
-
const initialIndentationLevel = numberNestedLists(tr.selection.$from);
|
|
23
|
-
let currentIndentationLevel;
|
|
24
|
-
let currentPos = tr.selection.$to.pos;
|
|
25
|
-
do {
|
|
26
|
-
const resolvedPos = tr.doc.resolve(currentPos);
|
|
27
|
-
currentIndentationLevel = numberNestedLists(resolvedPos);
|
|
28
|
-
if (currentIndentationLevel > maxIndentation) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
currentPos++;
|
|
32
|
-
} while (currentIndentationLevel >= initialIndentationLevel);
|
|
33
|
-
return true;
|
|
34
16
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function isListNodeValidContent(node) {
|
|
2
|
+
import { isListItemNode } from '@atlaskit/editor-common/utils';
|
|
3
|
+
export function isListNodeValidContent(node) {
|
|
5
4
|
const {
|
|
6
5
|
bulletList
|
|
7
6
|
} = node.type.schema.nodes;
|
|
@@ -10,89 +9,4 @@ function isListNodeValidContent(node) {
|
|
|
10
9
|
}
|
|
11
10
|
const listFragment = Fragment.from(bulletList.createAndFill());
|
|
12
11
|
return !isListItemNode(node) && node.type.validContent(listFragment);
|
|
13
|
-
}
|
|
14
|
-
export let JoinDirection = /*#__PURE__*/function (JoinDirection) {
|
|
15
|
-
JoinDirection[JoinDirection["LEFT"] = 1] = "LEFT";
|
|
16
|
-
JoinDirection[JoinDirection["RIGHT"] = -1] = "RIGHT";
|
|
17
|
-
return JoinDirection;
|
|
18
|
-
}({});
|
|
19
|
-
export const joinSiblingLists = ({
|
|
20
|
-
tr,
|
|
21
|
-
direction,
|
|
22
|
-
forceListType
|
|
23
|
-
}) => {
|
|
24
|
-
const result = {
|
|
25
|
-
orderedList: 0,
|
|
26
|
-
bulletList: 0
|
|
27
|
-
};
|
|
28
|
-
const {
|
|
29
|
-
doc,
|
|
30
|
-
selection: {
|
|
31
|
-
$from,
|
|
32
|
-
$to
|
|
33
|
-
},
|
|
34
|
-
selection
|
|
35
|
-
} = tr;
|
|
36
|
-
const range = $from.blockRange($to, isListNodeValidContent);
|
|
37
|
-
if (!range) {
|
|
38
|
-
return result;
|
|
39
|
-
}
|
|
40
|
-
const rootListNode = doc.nodeAt(range.start);
|
|
41
|
-
const from = isListNode(rootListNode) ? range.start : 0;
|
|
42
|
-
const to = isListNode(rootListNode) ? range.end : tr.doc.content.size;
|
|
43
|
-
const joins = [];
|
|
44
|
-
doc.nodesBetween(from, to, (node, pos, parent) => {
|
|
45
|
-
const resolvedPos = doc.resolve(pos);
|
|
46
|
-
const {
|
|
47
|
-
nodeBefore,
|
|
48
|
-
nodeAfter
|
|
49
|
-
} = resolvedPos;
|
|
50
|
-
if (!nodeBefore || !nodeAfter || !isListNode(nodeBefore) || !isListNode(nodeAfter)) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const isNestedList = isListItemNode(parent);
|
|
54
|
-
if (!isNestedList && nodeBefore.type !== nodeAfter.type && !forceListType) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const index = resolvedPos.index();
|
|
58
|
-
const positionPreviousNode = resolvedPos.posAtIndex(index - 1);
|
|
59
|
-
const positionCurrentNode = resolvedPos.posAtIndex(index);
|
|
60
|
-
|
|
61
|
-
// If the previous node is part of the selection, OR
|
|
62
|
-
// If the previous node is not part of the selection and the previous node has the same list type that we’re converting to
|
|
63
|
-
const joinBefore = positionPreviousNode >= from || nodeBefore.type === forceListType;
|
|
64
|
-
if (forceListType) {
|
|
65
|
-
if (joinBefore) {
|
|
66
|
-
tr.setNodeMarkup(positionPreviousNode, forceListType);
|
|
67
|
-
}
|
|
68
|
-
tr.setNodeMarkup(positionCurrentNode, forceListType);
|
|
69
|
-
}
|
|
70
|
-
if (isNestedList && nodeBefore.type !== nodeAfter.type) {
|
|
71
|
-
const nodeType = direction === JoinDirection.RIGHT ? nodeAfter.type : nodeBefore.type;
|
|
72
|
-
tr.setNodeMarkup(positionPreviousNode, nodeType);
|
|
73
|
-
}
|
|
74
|
-
if (joinBefore) {
|
|
75
|
-
joins.push(pos);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
if (selection.empty && rootListNode && isListNode(rootListNode)) {
|
|
79
|
-
const resolvedPos = doc.resolve(range.start + rootListNode.nodeSize);
|
|
80
|
-
const {
|
|
81
|
-
nodeBefore,
|
|
82
|
-
nodeAfter
|
|
83
|
-
} = resolvedPos;
|
|
84
|
-
if (nodeBefore && nodeAfter && isListNode(nodeBefore) && isListNode(nodeAfter) && nodeAfter.type === nodeBefore.type) {
|
|
85
|
-
joins.push(resolvedPos.pos);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
for (let i = joins.length - 1; i >= 0; i--) {
|
|
89
|
-
const listNode = tr.doc.nodeAt(joins[i]);
|
|
90
|
-
const listName = listNode === null || listNode === void 0 ? void 0 : listNode.type.name;
|
|
91
|
-
if (listName && (listName === 'orderedList' || listName === 'bulletList')) {
|
|
92
|
-
const amount = result[listName] || 0;
|
|
93
|
-
result[listName] = amount + 1;
|
|
94
|
-
}
|
|
95
|
-
tr.join(joins[i]);
|
|
96
|
-
}
|
|
97
|
-
return result;
|
|
98
|
-
};
|
|
12
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { findWrapping } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
-
import {
|
|
3
|
-
import { findParentNodeClosestToPos, findParentNodeOfType, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
+
import { findParentNodeOfType, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
3
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
5
4
|
import { isListItemNode, isListNode, isParagraphNode } from '@atlaskit/editor-common/utils';
|
|
6
5
|
export const isPosInsideParagraph = $pos => {
|
|
@@ -82,56 +81,6 @@ export const selectionContainsList = tr => {
|
|
|
82
81
|
});
|
|
83
82
|
return foundListNode;
|
|
84
83
|
};
|
|
85
|
-
export const numberNestedLists = resolvedPos => {
|
|
86
|
-
let count = 0;
|
|
87
|
-
for (let i = resolvedPos.depth - 1; i > 0; i--) {
|
|
88
|
-
const node = resolvedPos.node(i);
|
|
89
|
-
if (isListNode(node)) {
|
|
90
|
-
count += 1;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return count;
|
|
94
|
-
};
|
|
95
|
-
export const getListItemAttributes = $pos => {
|
|
96
|
-
const indentLevel = numberNestedLists($pos) - 1;
|
|
97
|
-
const itemAtPos = findParentNodeClosestToPos($pos, isListItemNode);
|
|
98
|
-
|
|
99
|
-
// Get the index of the current item relative to parent (parent is at item depth - 1)
|
|
100
|
-
const itemIndex = $pos.index(itemAtPos ? itemAtPos.depth - 1 : undefined);
|
|
101
|
-
return {
|
|
102
|
-
indentLevel,
|
|
103
|
-
itemIndex
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
export const normalizeListItemsSelection = ({
|
|
107
|
-
selection,
|
|
108
|
-
doc
|
|
109
|
-
}) => {
|
|
110
|
-
if (selection.empty) {
|
|
111
|
-
return selection;
|
|
112
|
-
}
|
|
113
|
-
const {
|
|
114
|
-
$from,
|
|
115
|
-
$to
|
|
116
|
-
} = selection;
|
|
117
|
-
if (selection instanceof NodeSelection) {
|
|
118
|
-
const head = resolvePositionToStartOfListItem($from);
|
|
119
|
-
return new TextSelection(head, head);
|
|
120
|
-
}
|
|
121
|
-
const head = resolvePositionToStartOfListItem($from);
|
|
122
|
-
const anchor = resolvePositionToEndOfListItem($to);
|
|
123
|
-
return new TextSelection(anchor, head);
|
|
124
|
-
};
|
|
125
|
-
const resolvePositionToStartOfListItem = $pos => {
|
|
126
|
-
const fromRange = $pos.blockRange($pos, isListItemNode);
|
|
127
|
-
const fromPosition = fromRange && $pos.textOffset === 0 && fromRange.end - 1 === $pos.pos ? Selection.near($pos.doc.resolve(fromRange.end + 1), 1).$from : $pos;
|
|
128
|
-
return fromPosition;
|
|
129
|
-
};
|
|
130
|
-
const resolvePositionToEndOfListItem = $pos => {
|
|
131
|
-
const toRange = $pos.blockRange($pos, isListItemNode);
|
|
132
|
-
const toPosition = toRange && $pos.textOffset === 0 && toRange.start + 1 === $pos.pos ? Selection.near($pos.doc.resolve(toRange.start - 1), -1).$to : $pos;
|
|
133
|
-
return toPosition;
|
|
134
|
-
};
|
|
135
84
|
export const createListNodeRange = ({
|
|
136
85
|
selection
|
|
137
86
|
}) => {
|
|
@@ -6,7 +6,7 @@ import { uuid } from '@atlaskit/adf-schema';
|
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD, USER_CONTEXT } from '../analytics';
|
|
7
7
|
import { GapCursorSelection } from '../selection/gap-cursor-selection';
|
|
8
8
|
import { stateKey as taskDecisionStateKey } from './pm-plugins/plugin-key';
|
|
9
|
-
import { autoJoinTr } from '
|
|
9
|
+
import { autoJoinTr } from '@atlaskit/editor-common/utils';
|
|
10
10
|
const getContextData = (contextProvider = {}) => {
|
|
11
11
|
const {
|
|
12
12
|
objectId,
|
|
@@ -4,8 +4,7 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { uuid } from '@atlaskit/adf-schema';
|
|
7
|
-
import { isEmptySelectionAtStart, deleteEmptyParagraphAndMoveBlockUp, isEmptySelectionAtEnd } from '
|
|
8
|
-
import { filterCommands as filter } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { filterCommand as filter, isEmptySelectionAtStart, deleteEmptyParagraphAndMoveBlockUp, isEmptySelectionAtEnd } from '@atlaskit/editor-common/utils';
|
|
9
8
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, withAnalytics } from '../../analytics';
|
|
10
9
|
import { insertTaskDecisionWithAnalytics } from '../commands';
|
|
11
10
|
import { joinAtCut, liftSelection, wrapSelectionInTaskList } from './commands';
|