@atlaskit/editor-plugin-list 1.0.0 → 1.1.2
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 +18 -0
- package/dist/cjs/actions/outdent-list-items-selected.js +1 -3
- package/dist/cjs/commands/indent-list.js +12 -14
- package/dist/cjs/commands/index.js +26 -27
- package/dist/cjs/commands/outdent-list.js +13 -14
- package/dist/cjs/plugin.js +8 -4
- package/dist/cjs/pm-plugins/keymap.js +4 -4
- package/dist/cjs/utils/selection.js +14 -14
- package/dist/es2019/actions/outdent-list-items-selected.js +1 -3
- package/dist/es2019/commands/indent-list.js +13 -14
- package/dist/es2019/commands/index.js +19 -23
- package/dist/es2019/commands/outdent-list.js +14 -14
- package/dist/es2019/plugin.js +6 -4
- package/dist/es2019/pm-plugins/keymap.js +5 -5
- package/dist/es2019/utils/selection.js +12 -12
- package/dist/esm/actions/outdent-list-items-selected.js +1 -3
- package/dist/esm/commands/indent-list.js +12 -14
- package/dist/esm/commands/index.js +26 -27
- package/dist/esm/commands/outdent-list.js +13 -14
- package/dist/esm/plugin.js +9 -5
- package/dist/esm/pm-plugins/keymap.js +5 -5
- package/dist/esm/utils/selection.js +14 -14
- package/dist/types/actions/outdent-list-items-selected.d.ts +2 -2
- package/dist/types/commands/indent-list.d.ts +2 -2
- package/dist/types/commands/index.d.ts +4 -5
- package/dist/types/commands/outdent-list.d.ts +2 -2
- package/dist/types/types.d.ts +15 -16
- package/dist/types/utils/selection.d.ts +4 -4
- package/dist/types-ts4.5/actions/outdent-list-items-selected.d.ts +2 -2
- package/dist/types-ts4.5/commands/indent-list.d.ts +2 -2
- package/dist/types-ts4.5/commands/index.d.ts +4 -5
- package/dist/types-ts4.5/commands/outdent-list.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +16 -14
- package/dist/types-ts4.5/utils/selection.d.ts +4 -4
- package/package.json +3 -4
- package/report.api.md +14 -22
- package/tmp/api-report-tmp.d.ts +0 -80
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, OUTDENT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { getCommonListAnalyticsAttributes } from '@atlaskit/editor-common/lists';
|
|
3
|
+
import { PassiveTransaction } from '@atlaskit/editor-common/preset';
|
|
3
4
|
import { isBulletList } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
5
6
|
import { outdentListItemsSelected as outdentListAction } from '../actions/outdent-list-items-selected';
|
|
@@ -7,28 +8,30 @@ import { getRestartListsAttributes } from '../utils/analytics';
|
|
|
7
8
|
import { findFirstParentListNode } from '../utils/find';
|
|
8
9
|
import { isInsideListItem, isInsideTableCell } from '../utils/selection';
|
|
9
10
|
export const outdentList = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD, featureFlags) => {
|
|
10
|
-
return function (
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
return function ({
|
|
12
|
+
tr
|
|
13
|
+
}) {
|
|
14
|
+
if (!isInsideListItem(tr)) {
|
|
15
|
+
return null;
|
|
13
16
|
}
|
|
14
17
|
const {
|
|
15
18
|
$from
|
|
16
|
-
} =
|
|
19
|
+
} = tr.selection;
|
|
17
20
|
const parentListNode = findFirstParentListNode($from);
|
|
18
21
|
if (!parentListNode) {
|
|
19
22
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
20
|
-
return
|
|
23
|
+
return new PassiveTransaction();
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
// Save the history, so it could undo/revert to the same state before the outdent, see https://product-fabric.atlassian.net/browse/ED-14753
|
|
24
|
-
closeHistory(
|
|
27
|
+
closeHistory(tr);
|
|
25
28
|
const actionSubjectId = isBulletList(parentListNode.node) ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
26
|
-
let customTr =
|
|
27
|
-
outdentListAction(customTr,
|
|
29
|
+
let customTr = tr;
|
|
30
|
+
outdentListAction(customTr, featureFlags);
|
|
28
31
|
if (!customTr || !customTr.docChanged) {
|
|
29
32
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
30
33
|
// If inside table cell and can't outdent list, then let it handle by table keymap
|
|
31
|
-
return !isInsideTableCell(
|
|
34
|
+
return !isInsideTableCell(customTr) ? new PassiveTransaction() : null;
|
|
32
35
|
}
|
|
33
36
|
const restartListsAttributes = {};
|
|
34
37
|
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists) {
|
|
@@ -47,14 +50,11 @@ export const outdentList = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEY
|
|
|
47
50
|
actionSubjectId,
|
|
48
51
|
eventType: EVENT_TYPE.TRACK,
|
|
49
52
|
attributes: {
|
|
50
|
-
...getCommonListAnalyticsAttributes(
|
|
53
|
+
...getCommonListAnalyticsAttributes(customTr),
|
|
51
54
|
...restartListsAttributes,
|
|
52
55
|
inputMethod
|
|
53
56
|
}
|
|
54
57
|
})(customTr);
|
|
55
|
-
|
|
56
|
-
dispatch(customTr);
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
58
|
+
return customTr;
|
|
59
59
|
};
|
|
60
60
|
};
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -22,13 +22,15 @@ export const listPlugin = (options, api) => {
|
|
|
22
22
|
return {
|
|
23
23
|
name: 'list',
|
|
24
24
|
actions: {
|
|
25
|
-
indentList: indentList(editorAnalyticsAPI),
|
|
26
|
-
outdentList: outdentList(editorAnalyticsAPI),
|
|
27
|
-
toggleOrderedList: toggleOrderedListCommand(editorAnalyticsAPI),
|
|
28
|
-
toggleBulletList: toggleBulletListCommand(editorAnalyticsAPI),
|
|
29
25
|
isInsideListItem,
|
|
30
26
|
findRootParentListNode
|
|
31
27
|
},
|
|
28
|
+
commands: {
|
|
29
|
+
indentList: indentList(editorAnalyticsAPI),
|
|
30
|
+
outdentList: inputMethod => outdentList(editorAnalyticsAPI)(inputMethod, featureFlags),
|
|
31
|
+
toggleOrderedList: toggleOrderedListCommand(editorAnalyticsAPI),
|
|
32
|
+
toggleBulletList: toggleBulletListCommand(editorAnalyticsAPI)
|
|
33
|
+
},
|
|
32
34
|
getSharedState: editorState => {
|
|
33
35
|
if (!editorState) {
|
|
34
36
|
return undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { backspace, bindKeymapWithCommand, deleteKey, enter, findKeyMapForBrowser, findShortcutByKeymap, forwardDelete, indentList, outdentList, toggleBulletList, toggleOrderedList } from '@atlaskit/editor-common/keymaps';
|
|
2
|
+
import { backspace, bindKeymapWithCommand, bindKeymapWithEditorCommand, deleteKey, enter, findKeyMapForBrowser, findShortcutByKeymap, forwardDelete, indentList, outdentList, toggleBulletList, toggleOrderedList } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { backspaceKeyCommand, deleteKeyCommand, enterKeyCommand, indentList as indentListCommand, outdentList as outdentListCommand, toggleList } from '../commands';
|
|
5
5
|
export function keymapPlugin(featureFlags, editorAnalyticsAPI) {
|
|
6
6
|
const list = {};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
bindKeymapWithEditorCommand(findShortcutByKeymap(toggleOrderedList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'orderedList'), list);
|
|
8
|
+
bindKeymapWithEditorCommand(findShortcutByKeymap(toggleBulletList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'bulletList'), list);
|
|
9
|
+
bindKeymapWithEditorCommand(indentList.common, indentListCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
|
|
10
|
+
bindKeymapWithEditorCommand(outdentList.common, outdentListCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, featureFlags), list);
|
|
11
11
|
bindKeymapWithCommand(enter.common, enterKeyCommand(editorAnalyticsAPI)(featureFlags), list);
|
|
12
12
|
bindKeymapWithCommand(backspace.common, backspaceKeyCommand(editorAnalyticsAPI)(featureFlags), list);
|
|
13
13
|
bindKeymapWithCommand(deleteKey.common, deleteKeyCommand(editorAnalyticsAPI), list);
|
|
@@ -32,32 +32,32 @@ export const isWrappingPossible = (nodeType, selection) => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
// canOutdent
|
|
35
|
-
export const isInsideListItem =
|
|
35
|
+
export const isInsideListItem = tr => {
|
|
36
36
|
const {
|
|
37
37
|
parent
|
|
38
|
-
} =
|
|
38
|
+
} = tr.selection.$from;
|
|
39
39
|
const {
|
|
40
40
|
listItem
|
|
41
|
-
} =
|
|
42
|
-
if (
|
|
41
|
+
} = tr.doc.type.schema.nodes;
|
|
42
|
+
if (tr.selection instanceof GapCursorSelection) {
|
|
43
43
|
return isListItemNode(parent);
|
|
44
44
|
}
|
|
45
|
-
return hasParentNodeOfType(listItem)(
|
|
45
|
+
return hasParentNodeOfType(listItem)(tr.selection) && isParagraphNode(parent);
|
|
46
46
|
};
|
|
47
|
-
export const isInsideTableCell =
|
|
47
|
+
export const isInsideTableCell = tr => {
|
|
48
48
|
const {
|
|
49
49
|
tableCell,
|
|
50
50
|
tableHeader
|
|
51
|
-
} =
|
|
52
|
-
return !!findParentNodeOfType([tableCell, tableHeader])(
|
|
51
|
+
} = tr.doc.type.schema.nodes;
|
|
52
|
+
return !!findParentNodeOfType([tableCell, tableHeader])(tr.selection);
|
|
53
53
|
};
|
|
54
|
-
export const canJoinToPreviousListItem =
|
|
54
|
+
export const canJoinToPreviousListItem = tr => {
|
|
55
55
|
const {
|
|
56
56
|
$from
|
|
57
|
-
} =
|
|
58
|
-
const $before =
|
|
57
|
+
} = tr.selection;
|
|
58
|
+
const $before = tr.doc.resolve($from.pos - 1);
|
|
59
59
|
let nodeBefore = $before ? $before.nodeBefore : null;
|
|
60
|
-
if (
|
|
60
|
+
if (tr.selection instanceof GapCursorSelection) {
|
|
61
61
|
nodeBefore = $from.nodeBefore;
|
|
62
62
|
}
|
|
63
63
|
return isListNode(nodeBefore);
|
|
@@ -11,7 +11,7 @@ import { liftTarget, ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-pro
|
|
|
11
11
|
import { getRestartListsAttributes, storeRestartListsAttributes } from '../utils/analytics';
|
|
12
12
|
import { findFirstParentListItemNode, findRootParentListNode } from '../utils/find';
|
|
13
13
|
import { createListNodeRange } from '../utils/selection';
|
|
14
|
-
export var outdentListItemsSelected = function outdentListItemsSelected(tr,
|
|
14
|
+
export var outdentListItemsSelected = function outdentListItemsSelected(tr, featureFlags) {
|
|
15
15
|
var originalSelection = tr.selection;
|
|
16
16
|
var normalizedSelection = normalizeListItemsSelection({
|
|
17
17
|
selection: tr.selection,
|
|
@@ -46,7 +46,6 @@ export var outdentListItemsSelected = function outdentListItemsSelected(tr, stat
|
|
|
46
46
|
extractListItemsRangeFromList({
|
|
47
47
|
tr: tr,
|
|
48
48
|
range: mappedRange,
|
|
49
|
-
state: state,
|
|
50
49
|
featureFlags: featureFlags
|
|
51
50
|
});
|
|
52
51
|
hasNormalizedToPositionLiftedOut = hasNormalizedToPositionLiftedOut || oldTo >= range.from && oldTo < range.to;
|
|
@@ -168,7 +167,6 @@ var outdentRangeToParentList = function outdentRangeToParentList(_ref2) {
|
|
|
168
167
|
var extractListItemsRangeFromList = function extractListItemsRangeFromList(_ref3) {
|
|
169
168
|
var tr = _ref3.tr,
|
|
170
169
|
range = _ref3.range,
|
|
171
|
-
state = _ref3.state,
|
|
172
170
|
featureFlags = _ref3.featureFlags;
|
|
173
171
|
var list = range.parent;
|
|
174
172
|
var $start = tr.doc.resolve(range.start);
|
|
@@ -3,6 +3,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getCommonListAnalyticsAttributes, getListItemAttributes, hasValidListIndentationLevel } from '@atlaskit/editor-common/lists';
|
|
6
|
+
import { PassiveTransaction } from '@atlaskit/editor-common/preset';
|
|
6
7
|
import { isBulletList } from '@atlaskit/editor-common/utils';
|
|
7
8
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
8
9
|
import { indentListItemsSelected as indentListAction } from '../actions/indent-list-items-selected';
|
|
@@ -12,13 +13,13 @@ import { isInsideListItem, isInsideTableCell } from '../utils/selection';
|
|
|
12
13
|
export var indentList = function indentList(editorAnalyticsAPI) {
|
|
13
14
|
return function () {
|
|
14
15
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
15
|
-
return function (
|
|
16
|
-
var tr =
|
|
17
|
-
|
|
16
|
+
return function (_ref) {
|
|
17
|
+
var tr = _ref.tr;
|
|
18
|
+
var $from = tr.selection.$from;
|
|
18
19
|
|
|
19
20
|
// don't indent if selection is not inside a list
|
|
20
|
-
if (!isInsideListItem(
|
|
21
|
-
return
|
|
21
|
+
if (!isInsideListItem(tr)) {
|
|
22
|
+
return null;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
// Save the history, so it could undo/revert to the same state before the indent, see https://product-fabric.atlassian.net/browse/ED-14753
|
|
@@ -26,12 +27,12 @@ export var indentList = function indentList(editorAnalyticsAPI) {
|
|
|
26
27
|
var firstListItemSelectedAttributes = getListItemAttributes($from);
|
|
27
28
|
var parentListNode = findFirstParentListNode($from);
|
|
28
29
|
if (!parentListNode || firstListItemSelectedAttributes && firstListItemSelectedAttributes.indentLevel === 0 && firstListItemSelectedAttributes.itemIndex === 0) {
|
|
29
|
-
if (isInsideTableCell(
|
|
30
|
+
if (isInsideTableCell(tr)) {
|
|
30
31
|
// dont consume tab, as table-keymap should move cursor to next cell
|
|
31
|
-
return
|
|
32
|
+
return null;
|
|
32
33
|
} else {
|
|
33
34
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
34
|
-
return
|
|
35
|
+
return new PassiveTransaction();
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
var currentListNode = parentListNode.node;
|
|
@@ -43,21 +44,18 @@ export var indentList = function indentList(editorAnalyticsAPI) {
|
|
|
43
44
|
});
|
|
44
45
|
if (maximimunNestedLevelReached || !tr.docChanged) {
|
|
45
46
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
46
|
-
return
|
|
47
|
+
return new PassiveTransaction();
|
|
47
48
|
}
|
|
48
49
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
49
50
|
action: ACTION.INDENTED,
|
|
50
51
|
actionSubject: ACTION_SUBJECT.LIST,
|
|
51
52
|
actionSubjectId: actionSubjectId,
|
|
52
53
|
eventType: EVENT_TYPE.TRACK,
|
|
53
|
-
attributes: _objectSpread(_objectSpread({}, getCommonListAnalyticsAttributes(
|
|
54
|
+
attributes: _objectSpread(_objectSpread({}, getCommonListAnalyticsAttributes(tr)), {}, {
|
|
54
55
|
inputMethod: inputMethod
|
|
55
56
|
})
|
|
56
57
|
})(tr);
|
|
57
|
-
|
|
58
|
-
dispatch(tr);
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
58
|
+
return tr;
|
|
61
59
|
};
|
|
62
60
|
};
|
|
63
61
|
};
|
|
@@ -4,6 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { findCutBefore } from '@atlaskit/editor-common/commands';
|
|
6
6
|
import { getCommonListAnalyticsAttributes, moveTargetIntoList } from '@atlaskit/editor-common/lists';
|
|
7
|
+
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
7
8
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
8
9
|
import { filterCommand as filter, hasVisibleContent, isEmptySelectionAtStart } from '@atlaskit/editor-common/utils';
|
|
9
10
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
@@ -35,7 +36,7 @@ export var enterKeyCommand = function enterKeyCommand(editorAnalyticsAPI) {
|
|
|
35
36
|
/** Check if the wrapper has any visible content */
|
|
36
37
|
var wrapperHasContent = hasVisibleContent(wrapper);
|
|
37
38
|
if (!wrapperHasContent) {
|
|
38
|
-
return outdentList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, featureFlags)(state, dispatch);
|
|
39
|
+
return editorCommandToPMCommand(outdentList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, featureFlags))(state, dispatch);
|
|
39
40
|
} else if (!hasParentNodeOfType(codeBlock)(selection)) {
|
|
40
41
|
return splitListItem(listItem)(state, dispatch);
|
|
41
42
|
}
|
|
@@ -53,10 +54,14 @@ export var backspaceKeyCommand = function backspaceKeyCommand(editorAnalyticsAPI
|
|
|
53
54
|
// directly to an empty list item above, or outdent this node
|
|
54
55
|
filter([isEmptySelectionAtStart,
|
|
55
56
|
// list items might have multiple paragraphs; only do this at the first one
|
|
56
|
-
isFirstChildOfParent,
|
|
57
|
+
isFirstChildOfParent, function (state) {
|
|
58
|
+
return isInsideListItem(state.tr);
|
|
59
|
+
}], chainCommands(deletePreviousEmptyListItem, editorCommandToPMCommand(outdentList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, featureFlags)))),
|
|
57
60
|
// if we're just inside a paragraph node (or gapcursor is shown) and backspace, then try to join
|
|
58
61
|
// the text to the previous list item, if one exists
|
|
59
|
-
filter([isEmptySelectionAtStart,
|
|
62
|
+
filter([isEmptySelectionAtStart, function (state) {
|
|
63
|
+
return canJoinToPreviousListItem(state.tr);
|
|
64
|
+
}], joinToPreviousListItem))(state, dispatch);
|
|
60
65
|
};
|
|
61
66
|
};
|
|
62
67
|
};
|
|
@@ -93,13 +98,13 @@ function untoggleSelectedList(tr) {
|
|
|
93
98
|
}
|
|
94
99
|
export var toggleList = function toggleList(editorAnalyticsAPI) {
|
|
95
100
|
return function (inputMethod, listType) {
|
|
96
|
-
return function (
|
|
97
|
-
var tr =
|
|
101
|
+
return function (_ref) {
|
|
102
|
+
var tr = _ref.tr;
|
|
98
103
|
var listInsideSelection = selectionContainsList(tr);
|
|
99
|
-
var listNodeType =
|
|
104
|
+
var listNodeType = tr.doc.type.schema.nodes[listType];
|
|
100
105
|
var actionSubjectId = listType === 'bulletList' ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
101
106
|
if (listInsideSelection) {
|
|
102
|
-
var selection =
|
|
107
|
+
var selection = tr.selection;
|
|
103
108
|
|
|
104
109
|
// for gap cursor or node selection - list is expected 1 level up (listItem -> list)
|
|
105
110
|
// for text selection - list is expected 2 levels up (paragraph -> listItem -> list)
|
|
@@ -108,22 +113,19 @@ export var toggleList = function toggleList(editorAnalyticsAPI) {
|
|
|
108
113
|
var toNode = selection.$to.node(selection.$to.depth - positionDiff);
|
|
109
114
|
var transformedFrom = listInsideSelection.type.name === 'bulletList' ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
110
115
|
if ((fromNode === null || fromNode === void 0 ? void 0 : fromNode.type.name) === listType && (toNode === null || toNode === void 0 ? void 0 : toNode.type.name) === listType) {
|
|
111
|
-
var
|
|
112
|
-
untoggleSelectedList(
|
|
116
|
+
var commonAttributes = getCommonListAnalyticsAttributes(tr);
|
|
117
|
+
untoggleSelectedList(tr);
|
|
113
118
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
114
119
|
action: ACTION.CONVERTED,
|
|
115
120
|
actionSubject: ACTION_SUBJECT.LIST,
|
|
116
121
|
actionSubjectId: ACTION_SUBJECT_ID.TEXT,
|
|
117
122
|
eventType: EVENT_TYPE.TRACK,
|
|
118
|
-
attributes: _objectSpread(_objectSpread({},
|
|
123
|
+
attributes: _objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
119
124
|
transformedFrom: transformedFrom,
|
|
120
125
|
inputMethod: inputMethod
|
|
121
126
|
})
|
|
122
|
-
})(
|
|
123
|
-
|
|
124
|
-
dispatch(_tr2);
|
|
125
|
-
}
|
|
126
|
-
return true;
|
|
127
|
+
})(tr);
|
|
128
|
+
return tr;
|
|
127
129
|
}
|
|
128
130
|
convertListType({
|
|
129
131
|
tr: tr,
|
|
@@ -134,7 +136,7 @@ export var toggleList = function toggleList(editorAnalyticsAPI) {
|
|
|
134
136
|
actionSubject: ACTION_SUBJECT.LIST,
|
|
135
137
|
actionSubjectId: actionSubjectId,
|
|
136
138
|
eventType: EVENT_TYPE.TRACK,
|
|
137
|
-
attributes: _objectSpread(_objectSpread({}, getCommonListAnalyticsAttributes(
|
|
139
|
+
attributes: _objectSpread(_objectSpread({}, getCommonListAnalyticsAttributes(tr)), {}, {
|
|
138
140
|
transformedFrom: transformedFrom,
|
|
139
141
|
inputMethod: inputMethod
|
|
140
142
|
})
|
|
@@ -158,25 +160,22 @@ export var toggleList = function toggleList(editorAnalyticsAPI) {
|
|
|
158
160
|
// If document wasn't changed, return false from the command to indicate that the
|
|
159
161
|
// editing action failed
|
|
160
162
|
if (!tr.docChanged) {
|
|
161
|
-
return
|
|
163
|
+
return null;
|
|
162
164
|
}
|
|
163
|
-
|
|
164
|
-
dispatch(tr);
|
|
165
|
-
}
|
|
166
|
-
return true;
|
|
165
|
+
return tr;
|
|
167
166
|
};
|
|
168
167
|
};
|
|
169
168
|
};
|
|
170
169
|
export var toggleBulletList = function toggleBulletList(editorAnalyticsAPI) {
|
|
171
|
-
return function (
|
|
172
|
-
var inputMethod = arguments.length >
|
|
173
|
-
return toggleList(editorAnalyticsAPI)(inputMethod, 'bulletList')
|
|
170
|
+
return function () {
|
|
171
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.TOOLBAR;
|
|
172
|
+
return toggleList(editorAnalyticsAPI)(inputMethod, 'bulletList');
|
|
174
173
|
};
|
|
175
174
|
};
|
|
176
175
|
export var toggleOrderedList = function toggleOrderedList(editorAnalyticsAPI) {
|
|
177
|
-
return function (
|
|
178
|
-
var inputMethod = arguments.length >
|
|
179
|
-
return toggleList(editorAnalyticsAPI)(inputMethod, 'orderedList')
|
|
176
|
+
return function () {
|
|
177
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.TOOLBAR;
|
|
178
|
+
return toggleList(editorAnalyticsAPI)(inputMethod, 'orderedList');
|
|
180
179
|
};
|
|
181
180
|
};
|
|
182
181
|
|
|
@@ -3,6 +3,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, OUTDENT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getCommonListAnalyticsAttributes } from '@atlaskit/editor-common/lists';
|
|
6
|
+
import { PassiveTransaction } from '@atlaskit/editor-common/preset';
|
|
6
7
|
import { isBulletList } from '@atlaskit/editor-common/utils';
|
|
7
8
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
8
9
|
import { outdentListItemsSelected as outdentListAction } from '../actions/outdent-list-items-selected';
|
|
@@ -13,26 +14,27 @@ export var outdentList = function outdentList(editorAnalyticsAPI) {
|
|
|
13
14
|
return function () {
|
|
14
15
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
15
16
|
var featureFlags = arguments.length > 1 ? arguments[1] : undefined;
|
|
16
|
-
return function (
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
return function (_ref) {
|
|
18
|
+
var tr = _ref.tr;
|
|
19
|
+
if (!isInsideListItem(tr)) {
|
|
20
|
+
return null;
|
|
19
21
|
}
|
|
20
|
-
var $from =
|
|
22
|
+
var $from = tr.selection.$from;
|
|
21
23
|
var parentListNode = findFirstParentListNode($from);
|
|
22
24
|
if (!parentListNode) {
|
|
23
25
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
24
|
-
return
|
|
26
|
+
return new PassiveTransaction();
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
// Save the history, so it could undo/revert to the same state before the outdent, see https://product-fabric.atlassian.net/browse/ED-14753
|
|
28
|
-
closeHistory(
|
|
30
|
+
closeHistory(tr);
|
|
29
31
|
var actionSubjectId = isBulletList(parentListNode.node) ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
30
|
-
var customTr =
|
|
31
|
-
outdentListAction(customTr,
|
|
32
|
+
var customTr = tr;
|
|
33
|
+
outdentListAction(customTr, featureFlags);
|
|
32
34
|
if (!customTr || !customTr.docChanged) {
|
|
33
35
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
34
36
|
// If inside table cell and can't outdent list, then let it handle by table keymap
|
|
35
|
-
return !isInsideTableCell(
|
|
37
|
+
return !isInsideTableCell(customTr) ? new PassiveTransaction() : null;
|
|
36
38
|
}
|
|
37
39
|
var restartListsAttributes = {};
|
|
38
40
|
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists) {
|
|
@@ -49,14 +51,11 @@ export var outdentList = function outdentList(editorAnalyticsAPI) {
|
|
|
49
51
|
actionSubject: ACTION_SUBJECT.LIST,
|
|
50
52
|
actionSubjectId: actionSubjectId,
|
|
51
53
|
eventType: EVENT_TYPE.TRACK,
|
|
52
|
-
attributes: _objectSpread(_objectSpread(_objectSpread({}, getCommonListAnalyticsAttributes(
|
|
54
|
+
attributes: _objectSpread(_objectSpread(_objectSpread({}, getCommonListAnalyticsAttributes(customTr)), restartListsAttributes), {}, {
|
|
53
55
|
inputMethod: inputMethod
|
|
54
56
|
})
|
|
55
57
|
})(customTr);
|
|
56
|
-
|
|
57
|
-
dispatch(customTr);
|
|
58
|
-
}
|
|
59
|
-
return true;
|
|
58
|
+
return customTr;
|
|
60
59
|
};
|
|
61
60
|
};
|
|
62
61
|
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
4
4
|
import { toggleBulletList, toggleOrderedList, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { listMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { IconList, IconListNumber } from '@atlaskit/editor-common/quick-insert';
|
|
7
|
-
import { indentList, outdentList, toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './commands';
|
|
7
|
+
import { indentList, outdentList as _outdentList, toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './commands';
|
|
8
8
|
import inputRulePlugin from './pm-plugins/input-rules';
|
|
9
9
|
import keymapPlugin from './pm-plugins/keymap';
|
|
10
10
|
import { createPlugin, pluginKey as listPluginKey } from './pm-plugins/main';
|
|
@@ -22,13 +22,17 @@ export var listPlugin = function listPlugin(options, api) {
|
|
|
22
22
|
return {
|
|
23
23
|
name: 'list',
|
|
24
24
|
actions: {
|
|
25
|
-
indentList: indentList(editorAnalyticsAPI),
|
|
26
|
-
outdentList: outdentList(editorAnalyticsAPI),
|
|
27
|
-
toggleOrderedList: toggleOrderedListCommand(editorAnalyticsAPI),
|
|
28
|
-
toggleBulletList: toggleBulletListCommand(editorAnalyticsAPI),
|
|
29
25
|
isInsideListItem: isInsideListItem,
|
|
30
26
|
findRootParentListNode: findRootParentListNode
|
|
31
27
|
},
|
|
28
|
+
commands: {
|
|
29
|
+
indentList: indentList(editorAnalyticsAPI),
|
|
30
|
+
outdentList: function outdentList(inputMethod) {
|
|
31
|
+
return _outdentList(editorAnalyticsAPI)(inputMethod, featureFlags);
|
|
32
|
+
},
|
|
33
|
+
toggleOrderedList: toggleOrderedListCommand(editorAnalyticsAPI),
|
|
34
|
+
toggleBulletList: toggleBulletListCommand(editorAnalyticsAPI)
|
|
35
|
+
},
|
|
32
36
|
getSharedState: function getSharedState(editorState) {
|
|
33
37
|
if (!editorState) {
|
|
34
38
|
return undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { backspace, bindKeymapWithCommand, deleteKey, enter, findKeyMapForBrowser, findShortcutByKeymap, forwardDelete, indentList, outdentList, toggleBulletList, toggleOrderedList } from '@atlaskit/editor-common/keymaps';
|
|
2
|
+
import { backspace, bindKeymapWithCommand, bindKeymapWithEditorCommand, deleteKey, enter, findKeyMapForBrowser, findShortcutByKeymap, forwardDelete, indentList, outdentList, toggleBulletList, toggleOrderedList } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { backspaceKeyCommand, deleteKeyCommand, enterKeyCommand, indentList as indentListCommand, outdentList as outdentListCommand, toggleList } from '../commands';
|
|
5
5
|
export function keymapPlugin(featureFlags, editorAnalyticsAPI) {
|
|
6
6
|
var list = {};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
bindKeymapWithEditorCommand(findShortcutByKeymap(toggleOrderedList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'orderedList'), list);
|
|
8
|
+
bindKeymapWithEditorCommand(findShortcutByKeymap(toggleBulletList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'bulletList'), list);
|
|
9
|
+
bindKeymapWithEditorCommand(indentList.common, indentListCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
|
|
10
|
+
bindKeymapWithEditorCommand(outdentList.common, outdentListCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, featureFlags), list);
|
|
11
11
|
bindKeymapWithCommand(enter.common, enterKeyCommand(editorAnalyticsAPI)(featureFlags), list);
|
|
12
12
|
bindKeymapWithCommand(backspace.common, backspaceKeyCommand(editorAnalyticsAPI)(featureFlags), list);
|
|
13
13
|
bindKeymapWithCommand(deleteKey.common, deleteKeyCommand(editorAnalyticsAPI), list);
|
|
@@ -30,25 +30,25 @@ export var isWrappingPossible = function isWrappingPossible(nodeType, selection)
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
// canOutdent
|
|
33
|
-
export var isInsideListItem = function isInsideListItem(
|
|
34
|
-
var parent =
|
|
35
|
-
var listItem =
|
|
36
|
-
if (
|
|
33
|
+
export var isInsideListItem = function isInsideListItem(tr) {
|
|
34
|
+
var parent = tr.selection.$from.parent;
|
|
35
|
+
var listItem = tr.doc.type.schema.nodes.listItem;
|
|
36
|
+
if (tr.selection instanceof GapCursorSelection) {
|
|
37
37
|
return isListItemNode(parent);
|
|
38
38
|
}
|
|
39
|
-
return hasParentNodeOfType(listItem)(
|
|
39
|
+
return hasParentNodeOfType(listItem)(tr.selection) && isParagraphNode(parent);
|
|
40
40
|
};
|
|
41
|
-
export var isInsideTableCell = function isInsideTableCell(
|
|
42
|
-
var
|
|
43
|
-
tableCell =
|
|
44
|
-
tableHeader =
|
|
45
|
-
return !!findParentNodeOfType([tableCell, tableHeader])(
|
|
41
|
+
export var isInsideTableCell = function isInsideTableCell(tr) {
|
|
42
|
+
var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
|
|
43
|
+
tableCell = _tr$doc$type$schema$n.tableCell,
|
|
44
|
+
tableHeader = _tr$doc$type$schema$n.tableHeader;
|
|
45
|
+
return !!findParentNodeOfType([tableCell, tableHeader])(tr.selection);
|
|
46
46
|
};
|
|
47
|
-
export var canJoinToPreviousListItem = function canJoinToPreviousListItem(
|
|
48
|
-
var $from =
|
|
49
|
-
var $before =
|
|
47
|
+
export var canJoinToPreviousListItem = function canJoinToPreviousListItem(tr) {
|
|
48
|
+
var $from = tr.selection.$from;
|
|
49
|
+
var $before = tr.doc.resolve($from.pos - 1);
|
|
50
50
|
var nodeBefore = $before ? $before.nodeBefore : null;
|
|
51
|
-
if (
|
|
51
|
+
if (tr.selection instanceof GapCursorSelection) {
|
|
52
52
|
nodeBefore = $from.nodeBefore;
|
|
53
53
|
}
|
|
54
54
|
return isListNode(nodeBefore);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const outdentListItemsSelected: (tr: Transaction,
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare const outdentListItemsSelected: (tr: Transaction, featureFlags: FeatureFlags) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
4
4
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
5
|
-
export declare const indentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) =>
|
|
5
|
+
export declare const indentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => EditorCommand;
|
|
6
6
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { Command, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Command, EditorCommand, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { NodeType, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
5
|
import { indentList } from './indent-list';
|
|
7
6
|
import { outdentList } from './outdent-list';
|
|
8
7
|
export { outdentList, indentList };
|
|
@@ -11,6 +10,6 @@ export declare const enterKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI |
|
|
|
11
10
|
export declare const backspaceKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (featureFlags: FeatureFlags) => Command;
|
|
12
11
|
export declare const deleteKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
13
12
|
export declare const rootListDepth: (pos: ResolvedPos, nodes: Record<string, NodeType>) => number | undefined;
|
|
14
|
-
export declare const toggleList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod, listType: 'bulletList' | 'orderedList') =>
|
|
15
|
-
export declare const toggleBulletList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (
|
|
16
|
-
export declare const toggleOrderedList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (
|
|
13
|
+
export declare const toggleList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod, listType: 'bulletList' | 'orderedList') => EditorCommand;
|
|
14
|
+
export declare const toggleBulletList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => EditorCommand;
|
|
15
|
+
export declare const toggleOrderedList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => EditorCommand;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EditorCommand, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
5
|
-
export declare const outdentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod | undefined, featureFlags: FeatureFlags) =>
|
|
5
|
+
export declare const outdentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod | undefined, featureFlags: FeatureFlags) => EditorCommand;
|
|
6
6
|
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type
|
|
2
|
+
import type { EditorCommand, FeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
5
5
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import type {
|
|
7
|
-
import type { DecorationSet
|
|
6
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
9
9
|
export declare const MAX_NESTED_LIST_INDENTATION = 6;
|
|
10
10
|
export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
11
|
-
export type IndentList = (inputMethod: InputMethod) =>
|
|
12
|
-
export type OutdentList = (inputMethod: InputMethod
|
|
13
|
-
export type ToggleOrderedList = (
|
|
14
|
-
export type ToggleBulletList = (
|
|
15
|
-
export type IsInsideListItem = (
|
|
11
|
+
export type IndentList = (inputMethod: InputMethod) => EditorCommand;
|
|
12
|
+
export type OutdentList = (inputMethod: InputMethod) => EditorCommand;
|
|
13
|
+
export type ToggleOrderedList = (inputMethod: InputMethod) => EditorCommand;
|
|
14
|
+
export type ToggleBulletList = (inputMethod: InputMethod) => EditorCommand;
|
|
15
|
+
export type IsInsideListItem = (tr: Transaction) => boolean;
|
|
16
16
|
export type FindRootParentListNode = ($pos: ResolvedPos) => ResolvedPos | null;
|
|
17
17
|
export interface ListState {
|
|
18
18
|
bulletListActive: boolean;
|
|
@@ -23,17 +23,16 @@ export interface ListState {
|
|
|
23
23
|
}
|
|
24
24
|
export type ListPlugin = NextEditorPlugin<'list', {
|
|
25
25
|
pluginConfiguration: ListPluginOptions | undefined;
|
|
26
|
-
dependencies: [
|
|
27
|
-
typeof featureFlagsPlugin,
|
|
28
|
-
OptionalPlugin<typeof analyticsPlugin>
|
|
29
|
-
];
|
|
26
|
+
dependencies: [FeatureFlagsPlugin, OptionalPlugin<AnalyticsPlugin>];
|
|
30
27
|
actions: {
|
|
28
|
+
isInsideListItem: IsInsideListItem;
|
|
29
|
+
findRootParentListNode: FindRootParentListNode;
|
|
30
|
+
};
|
|
31
|
+
commands: {
|
|
31
32
|
indentList: IndentList;
|
|
32
33
|
outdentList: OutdentList;
|
|
33
34
|
toggleOrderedList: ToggleOrderedList;
|
|
34
35
|
toggleBulletList: ToggleBulletList;
|
|
35
|
-
isInsideListItem: IsInsideListItem;
|
|
36
|
-
findRootParentListNode: FindRootParentListNode;
|
|
37
36
|
};
|
|
38
37
|
sharedState: ListState | undefined;
|
|
39
38
|
}>;
|