@manuscripts/body-editor 1.6.11 → 1.6.12
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/cjs/commands.js +57 -1
- package/dist/cjs/components/toolbar/LevelSelector.js +2 -2
- package/dist/cjs/index.js +4 -9
- package/dist/cjs/keys/list.js +9 -9
- package/dist/cjs/lib/context-menu.js +81 -163
- package/dist/cjs/menus.js +353 -405
- package/dist/cjs/toolbar.js +30 -34
- package/dist/cjs/views/editable_block.js +12 -4
- package/dist/es/commands.js +57 -2
- package/dist/es/components/toolbar/LevelSelector.js +2 -2
- package/dist/es/index.js +2 -4
- package/dist/es/keys/list.js +7 -7
- package/dist/es/lib/context-menu.js +81 -163
- package/dist/es/menus.js +353 -405
- package/dist/es/toolbar.js +31 -35
- package/dist/es/views/editable_block.js +13 -5
- package/dist/types/commands.d.ts +1 -0
- package/dist/types/components/toolbar/LevelSelector.d.ts +2 -2
- package/dist/types/configs/editor-views.d.ts +14 -14
- package/dist/types/index.d.ts +2 -4
- package/dist/types/keys/list.d.ts +1 -1
- package/dist/types/lib/context-menu.d.ts +0 -7
- package/dist/types/menus.d.ts +2 -3
- package/dist/types/toolbar.d.ts +18 -1
- package/dist/types/views/bibliography_element_editable.d.ts +1 -1
- package/dist/types/views/blockquote_element_editable.d.ts +1 -1
- package/dist/types/views/bullet_list_editable.d.ts +1 -1
- package/dist/types/views/editable_block.d.ts +1 -1
- package/dist/types/views/equation_element_editable.d.ts +1 -1
- package/dist/types/views/figure_element_editable.d.ts +1 -1
- package/dist/types/views/footnote_editable.d.ts +1 -1
- package/dist/types/views/footnotes_element_editable.d.ts +1 -1
- package/dist/types/views/listing_element_editable.d.ts +1 -1
- package/dist/types/views/ordered_list_editable.d.ts +1 -1
- package/dist/types/views/paragraph_editable.d.ts +1 -1
- package/dist/types/views/placeholder_element_editable.d.ts +1 -1
- package/dist/types/views/pullquote_element_editable.d.ts +1 -1
- package/dist/types/views/section_title_editable.d.ts +1 -1
- package/dist/types/views/table_element_editable.d.ts +1 -1
- package/dist/types/views/toc_element_editable.d.ts +1 -1
- package/package.json +2 -4
- package/dist/cjs/components/application-menu/ApplicationMenu.js +0 -63
- package/dist/cjs/components/application-menu/MenuItemContainer.js +0 -127
- package/dist/cjs/components/application-menu/Shortcut.js +0 -63
- package/dist/cjs/components/application-menu/index.js +0 -22
- package/dist/cjs/components/application-menu/menuState.js +0 -49
- package/dist/cjs/components/application-menu/types.js +0 -17
- package/dist/cjs/components/application-menu/useApplicationMenus.js +0 -154
- package/dist/cjs/components/dialog/TableCellBorderOptions.js +0 -64
- package/dist/cjs/components/dialog/TableCellOptions.js +0 -50
- package/dist/cjs/components/dialog/TableOptions.js +0 -31
- package/dist/cjs/components/dialog/commands.js +0 -185
- package/dist/cjs/components/dialog/index.js +0 -26
- package/dist/cjs/components/dialog/shared.js +0 -48
- package/dist/cjs/components/dialog/types.js +0 -9
- package/dist/cjs/components/toolbar/ListStyleSelector.js +0 -150
- package/dist/cjs/components/toolbar/ManuscriptToolbar.js +0 -104
- package/dist/cjs/components/toolbar/OrderListSelector.js +0 -103
- package/dist/cjs/views/EditableBlock.js +0 -37
- package/dist/es/components/application-menu/ApplicationMenu.js +0 -56
- package/dist/es/components/application-menu/MenuItemContainer.js +0 -120
- package/dist/es/components/application-menu/Shortcut.js +0 -56
- package/dist/es/components/application-menu/index.js +0 -17
- package/dist/es/components/application-menu/menuState.js +0 -44
- package/dist/es/components/application-menu/types.js +0 -16
- package/dist/es/components/application-menu/useApplicationMenus.js +0 -148
- package/dist/es/components/dialog/TableCellBorderOptions.js +0 -36
- package/dist/es/components/dialog/TableCellOptions.js +0 -22
- package/dist/es/components/dialog/TableOptions.js +0 -26
- package/dist/es/components/dialog/commands.js +0 -177
- package/dist/es/components/dialog/index.js +0 -18
- package/dist/es/components/dialog/shared.js +0 -21
- package/dist/es/components/dialog/types.js +0 -6
- package/dist/es/components/toolbar/ListStyleSelector.js +0 -120
- package/dist/es/components/toolbar/ManuscriptToolbar.js +0 -97
- package/dist/es/components/toolbar/OrderListSelector.js +0 -72
- package/dist/es/views/EditableBlock.js +0 -29
- package/dist/types/components/application-menu/ApplicationMenu.d.ts +0 -24
- package/dist/types/components/application-menu/MenuItemContainer.d.ts +0 -27
- package/dist/types/components/application-menu/Shortcut.d.ts +0 -26
- package/dist/types/components/application-menu/index.d.ts +0 -18
- package/dist/types/components/application-menu/menuState.d.ts +0 -18
- package/dist/types/components/application-menu/types.d.ts +0 -47
- package/dist/types/components/application-menu/useApplicationMenus.d.ts +0 -12
- package/dist/types/components/dialog/TableCellBorderOptions.d.ts +0 -9
- package/dist/types/components/dialog/TableCellOptions.d.ts +0 -4
- package/dist/types/components/dialog/TableOptions.d.ts +0 -4
- package/dist/types/components/dialog/commands.d.ts +0 -28
- package/dist/types/components/dialog/index.d.ts +0 -4
- package/dist/types/components/dialog/shared.d.ts +0 -16
- package/dist/types/components/dialog/types.d.ts +0 -16
- package/dist/types/components/toolbar/ListStyleSelector.d.ts +0 -36
- package/dist/types/components/toolbar/ManuscriptToolbar.d.ts +0 -50
- package/dist/types/components/toolbar/OrderListSelector.d.ts +0 -14
- package/dist/types/views/EditableBlock.d.ts +0 -19
package/dist/cjs/toolbar.js
CHANGED
|
@@ -21,32 +21,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
exports.toolbar = void 0;
|
|
22
22
|
const transform_1 = require("@manuscripts/transform");
|
|
23
23
|
const prosemirror_commands_1 = require("prosemirror-commands");
|
|
24
|
-
const prosemirror_schema_list_1 = require("prosemirror-schema-list");
|
|
25
24
|
const commands_1 = require("./commands");
|
|
26
|
-
const OrderListSelector_1 = require("./components/toolbar/OrderListSelector");
|
|
27
25
|
const icons_1 = __importDefault(require("./icons"));
|
|
28
|
-
const list_1 = require("./keys/list");
|
|
29
26
|
exports.toolbar = {
|
|
30
27
|
style: {
|
|
31
28
|
bold: {
|
|
32
29
|
title: 'Toggle bold',
|
|
33
30
|
content: icons_1.default.bold,
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
isActive: (0, commands_1.markActive)(transform_1.schema.marks.bold),
|
|
32
|
+
isEnabled: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.bold),
|
|
36
33
|
run: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.bold),
|
|
37
34
|
},
|
|
38
35
|
italic: {
|
|
39
36
|
title: 'Toggle italic',
|
|
40
37
|
content: icons_1.default.italic,
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
isActive: (0, commands_1.markActive)(transform_1.schema.marks.italic),
|
|
39
|
+
isEnabled: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.italic),
|
|
43
40
|
run: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.italic),
|
|
44
41
|
},
|
|
45
42
|
underline: {
|
|
46
43
|
title: 'Toggle underline',
|
|
47
44
|
content: icons_1.default.underline,
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
isActive: (0, commands_1.markActive)(transform_1.schema.marks.underline),
|
|
46
|
+
isEnabled: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.underline),
|
|
50
47
|
run: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.underline),
|
|
51
48
|
},
|
|
52
49
|
},
|
|
@@ -54,15 +51,15 @@ exports.toolbar = {
|
|
|
54
51
|
subscript: {
|
|
55
52
|
title: 'Toggle subscript',
|
|
56
53
|
content: icons_1.default.subscript,
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
isActive: (0, commands_1.markActive)(transform_1.schema.marks.subscript),
|
|
55
|
+
isEnabled: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.subscript),
|
|
59
56
|
run: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.subscript),
|
|
60
57
|
},
|
|
61
58
|
superscript: {
|
|
62
59
|
title: 'Toggle superscript',
|
|
63
60
|
content: icons_1.default.superscript,
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
isActive: (0, commands_1.markActive)(transform_1.schema.marks.superscript),
|
|
62
|
+
isEnabled: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.superscript),
|
|
66
63
|
run: (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.superscript),
|
|
67
64
|
},
|
|
68
65
|
},
|
|
@@ -70,31 +67,36 @@ exports.toolbar = {
|
|
|
70
67
|
bullet_list: {
|
|
71
68
|
title: 'Wrap in bullet list',
|
|
72
69
|
content: icons_1.default.bullet_list,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
run: (0,
|
|
70
|
+
isActive: (0, commands_1.blockActive)(transform_1.schema.nodes.bullet_list),
|
|
71
|
+
isEnabled: (0, commands_1.insertList)(transform_1.schema.nodes.bullet_list),
|
|
72
|
+
run: (0, commands_1.insertList)(transform_1.schema.nodes.bullet_list),
|
|
76
73
|
},
|
|
77
74
|
ordered_list: {
|
|
78
75
|
title: 'Wrap in ordered list',
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
content: icons_1.default.ordered_list,
|
|
77
|
+
isActive: (0, commands_1.blockActive)(transform_1.schema.nodes.ordered_list),
|
|
78
|
+
isEnabled: (0, commands_1.insertList)(transform_1.schema.nodes.ordered_list, 'order'),
|
|
79
|
+
run: (0, commands_1.insertList)(transform_1.schema.nodes.ordered_list, 'order'),
|
|
80
|
+
options: {
|
|
81
|
+
order: (0, commands_1.insertList)(transform_1.schema.nodes.ordered_list, 'order'),
|
|
82
|
+
'alpha-upper': (0, commands_1.insertList)(transform_1.schema.nodes.ordered_list, 'alpha-upper'),
|
|
83
|
+
'alpha-lower': (0, commands_1.insertList)(transform_1.schema.nodes.ordered_list, 'alpha-lower'),
|
|
84
|
+
'roman-upper': (0, commands_1.insertList)(transform_1.schema.nodes.ordered_list, 'roman-upper'),
|
|
85
|
+
'roman-lower': (0, commands_1.insertList)(transform_1.schema.nodes.ordered_list, 'roman-lower'),
|
|
86
|
+
},
|
|
85
87
|
},
|
|
86
88
|
},
|
|
87
89
|
inline: {
|
|
88
90
|
citation: {
|
|
89
91
|
title: 'Insert citation',
|
|
90
92
|
content: icons_1.default.citation,
|
|
91
|
-
|
|
93
|
+
isEnabled: (0, commands_1.canInsert)(transform_1.schema.nodes.citation),
|
|
92
94
|
run: commands_1.insertInlineCitation,
|
|
93
95
|
},
|
|
94
|
-
|
|
96
|
+
comment: {
|
|
95
97
|
title: 'Insert comment',
|
|
96
98
|
content: icons_1.default.highlight,
|
|
97
|
-
|
|
99
|
+
isEnabled: (0, commands_1.canInsert)(transform_1.schema.nodes.highlight_marker),
|
|
98
100
|
run: commands_1.addComment,
|
|
99
101
|
},
|
|
100
102
|
},
|
|
@@ -102,26 +104,20 @@ exports.toolbar = {
|
|
|
102
104
|
figure_element: {
|
|
103
105
|
title: 'Insert figure',
|
|
104
106
|
content: icons_1.default.figure_element,
|
|
105
|
-
|
|
107
|
+
isEnabled: (0, commands_1.canInsert)(transform_1.schema.nodes.figure_element),
|
|
106
108
|
run: (0, commands_1.insertBlock)(transform_1.schema.nodes.figure_element),
|
|
107
109
|
},
|
|
108
110
|
table_element: {
|
|
109
111
|
title: 'Insert table',
|
|
110
112
|
content: icons_1.default.table_element,
|
|
111
|
-
|
|
113
|
+
isEnabled: (0, commands_1.canInsert)(transform_1.schema.nodes.table_element),
|
|
112
114
|
run: (0, commands_1.insertBlock)(transform_1.schema.nodes.table_element),
|
|
113
115
|
},
|
|
114
116
|
equation_element: {
|
|
115
117
|
title: 'Insert equation',
|
|
116
118
|
content: icons_1.default.equation_element,
|
|
117
|
-
|
|
119
|
+
isEnabled: (0, commands_1.canInsert)(transform_1.schema.nodes.equation_element),
|
|
118
120
|
run: (0, commands_1.insertBlock)(transform_1.schema.nodes.equation_element),
|
|
119
121
|
},
|
|
120
|
-
listing_element: {
|
|
121
|
-
title: 'Insert listing',
|
|
122
|
-
content: icons_1.default.listing_element,
|
|
123
|
-
enable: (0, commands_1.canInsert)(transform_1.schema.nodes.listing_element),
|
|
124
|
-
run: (0, commands_1.insertBlock)(transform_1.schema.nodes.listing_element),
|
|
125
|
-
},
|
|
126
122
|
},
|
|
127
123
|
};
|
|
@@ -26,13 +26,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.EditableBlock = void 0;
|
|
28
28
|
const transform_1 = require("@manuscripts/transform");
|
|
29
|
+
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
29
30
|
const context_menu_1 = require("../lib/context-menu");
|
|
30
31
|
const isNotNull = (a) => a !== null;
|
|
32
|
+
const hasParent = ($pos, type) => {
|
|
33
|
+
return !!(0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, type);
|
|
34
|
+
};
|
|
31
35
|
const EditableBlock = (Base) => {
|
|
32
36
|
return class extends Base {
|
|
33
37
|
constructor() {
|
|
34
38
|
super(...arguments);
|
|
35
|
-
this.gutterButtons = () => [this.createAddButton(
|
|
39
|
+
this.gutterButtons = () => [this.createAddButton(), this.createEditButton()].filter(isNotNull);
|
|
36
40
|
this.actionGutterButtons = () => [this.createSyncWarningButton()].filter(isNotNull);
|
|
37
41
|
this.createSyncWarningButton = () => {
|
|
38
42
|
var _a;
|
|
@@ -68,13 +72,17 @@ const EditableBlock = (Base) => {
|
|
|
68
72
|
});
|
|
69
73
|
return warningButton;
|
|
70
74
|
};
|
|
71
|
-
this.createAddButton = (
|
|
75
|
+
this.createAddButton = () => {
|
|
72
76
|
var _a;
|
|
73
|
-
const $pos = this.view.state.doc.resolve(this.getPos());
|
|
74
77
|
const hasAccess = (_a = this.props.getCapabilities()) === null || _a === void 0 ? void 0 : _a.editArticle;
|
|
75
|
-
if (!hasAccess
|
|
78
|
+
if (!hasAccess) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const $pos = this.view.state.doc.resolve(this.getPos());
|
|
82
|
+
if (hasParent($pos, transform_1.schema.nodes.keywords)) {
|
|
76
83
|
return null;
|
|
77
84
|
}
|
|
85
|
+
const after = !hasParent($pos, transform_1.schema.nodes.bibliography_section);
|
|
78
86
|
const button = document.createElement('a');
|
|
79
87
|
button.classList.add('add-block');
|
|
80
88
|
button.classList.add(after ? 'add-block-after' : 'add-block-before');
|
package/dist/es/commands.js
CHANGED
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
17
|
-
import {
|
|
17
|
+
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
|
18
|
+
import { buildComment, buildInlineMathFragment, generateID, isElementNodeType, isInBibliographySection, isListNode, isSectionNodeType, schema, } from '@manuscripts/transform';
|
|
18
19
|
import { NodeRange } from 'prosemirror-model';
|
|
20
|
+
import { wrapInList } from 'prosemirror-schema-list';
|
|
19
21
|
import { NodeSelection, TextSelection, } from 'prosemirror-state';
|
|
20
22
|
import { findWrapping } from 'prosemirror-transform';
|
|
21
|
-
import { findChildrenByType, findParentNodeOfType } from 'prosemirror-utils';
|
|
23
|
+
import { findChildrenByType, findParentNodeOfType, } from 'prosemirror-utils';
|
|
24
|
+
import { skipCommandTracking } from './keys/list';
|
|
22
25
|
import { isNodeOfType, nearestAncestor } from './lib/helpers';
|
|
23
26
|
import { findParentNodeWithId, getChildOfType } from './lib/utils';
|
|
24
27
|
import { commentAnnotation } from './plugins/comment_annotation';
|
|
@@ -319,6 +322,58 @@ export const insertSection = (subsection = false) => (state, dispatch) => {
|
|
|
319
322
|
}
|
|
320
323
|
return true;
|
|
321
324
|
};
|
|
325
|
+
const findSelectedList = findParentNodeOfType([
|
|
326
|
+
schema.nodes.ordered_list,
|
|
327
|
+
schema.nodes.bullet_list,
|
|
328
|
+
]);
|
|
329
|
+
const findRootList = ($pos) => {
|
|
330
|
+
for (let i = 0; i <= $pos.depth; i++) {
|
|
331
|
+
const node = $pos.node(i);
|
|
332
|
+
if (isListNode(node)) {
|
|
333
|
+
const pos = $pos.start(i);
|
|
334
|
+
return {
|
|
335
|
+
node,
|
|
336
|
+
pos,
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
const findListsAtSameLevel = (doc, list) => {
|
|
342
|
+
const $pos = doc.resolve(list.pos + 1);
|
|
343
|
+
const root = findRootList($pos);
|
|
344
|
+
if (!root) {
|
|
345
|
+
return [list];
|
|
346
|
+
}
|
|
347
|
+
const target = $pos.depth;
|
|
348
|
+
const lists = [];
|
|
349
|
+
root.node.descendants((node, pos) => {
|
|
350
|
+
const $pos = doc.resolve(root.pos + pos + 1);
|
|
351
|
+
if ($pos.depth === target && isListNode(node)) {
|
|
352
|
+
lists.push({ node, pos: $pos.before(target) });
|
|
353
|
+
}
|
|
354
|
+
return $pos.depth <= target;
|
|
355
|
+
});
|
|
356
|
+
return lists;
|
|
357
|
+
};
|
|
358
|
+
export const insertList = (type, style) => (state, dispatch) => {
|
|
359
|
+
const list = findSelectedList(state.selection);
|
|
360
|
+
if (list) {
|
|
361
|
+
if (!dispatch) {
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
const nodes = findListsAtSameLevel(state.doc, list);
|
|
365
|
+
const tr = state.tr;
|
|
366
|
+
for (const { node, pos } of nodes) {
|
|
367
|
+
tr.setNodeMarkup(pos, type, Object.assign(Object.assign({}, node.attrs), { listStyleType: style }), node.marks);
|
|
368
|
+
}
|
|
369
|
+
dispatch(skipTracking(tr));
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
const command = wrapInList(type, { listStyleType: style });
|
|
374
|
+
return skipCommandTracking(command)(state, dispatch);
|
|
375
|
+
}
|
|
376
|
+
};
|
|
322
377
|
export const insertBibliographySection = (state, dispatch) => {
|
|
323
378
|
return false;
|
|
324
379
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ©
|
|
2
|
+
* © 2024 Atypon Systems LLC
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -320,7 +320,7 @@ const buildOptions = (state, dispatch, view) => {
|
|
|
320
320
|
}));
|
|
321
321
|
return [{ options: typeOptions }, { options: sectionOptions }];
|
|
322
322
|
}
|
|
323
|
-
case
|
|
323
|
+
case schema.nodes.bullet_list: {
|
|
324
324
|
return [
|
|
325
325
|
{
|
|
326
326
|
options: [
|
package/dist/es/index.js
CHANGED
|
@@ -15,16 +15,14 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export * from './citation-sources';
|
|
17
17
|
export * from './commands';
|
|
18
|
-
export * from './components/application-menu';
|
|
19
|
-
export { DialogController, DialogNames } from './components/dialog';
|
|
20
18
|
export { ManuscriptOutline } from './components/outline/ManuscriptOutline';
|
|
21
19
|
export { OutlineItemIcon } from './components/outline/Outline';
|
|
22
20
|
export { OutlineManuscript } from './components/outline/OutlineManuscript';
|
|
23
|
-
export {
|
|
21
|
+
export { LevelSelector } from './components/toolbar/LevelSelector';
|
|
24
22
|
export * from './menus';
|
|
25
23
|
export { CollabProvider } from './classes/collabProvider';
|
|
26
24
|
export { PopperManager } from './lib/popper';
|
|
27
|
-
export
|
|
25
|
+
export * from './toolbar';
|
|
28
26
|
export * from './plugins/highlight';
|
|
29
27
|
export { commentScroll, isThereSelector, isHighlightComment, } from './plugins/comment_annotation';
|
|
30
28
|
export * from './lib/utils';
|
package/dist/es/keys/list.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
|
17
17
|
import { schema } from '@manuscripts/transform';
|
|
18
18
|
import { liftListItem, sinkListItem, splitListItem, wrapInList, } from 'prosemirror-schema-list';
|
|
19
|
-
export const
|
|
19
|
+
export const skipCommandTracking = (command) => (state, dispatch) => {
|
|
20
20
|
command(state, (tr) => {
|
|
21
21
|
if (dispatch) {
|
|
22
22
|
skipTracking(tr);
|
|
@@ -45,11 +45,11 @@ const liftToOuterList = (itemType) => {
|
|
|
45
45
|
};
|
|
46
46
|
const listKeymap = {
|
|
47
47
|
Enter: splitListItem(schema.nodes.list_item),
|
|
48
|
-
'Mod-[':
|
|
49
|
-
'Mod-]':
|
|
50
|
-
'Mod-Alt-o':
|
|
51
|
-
'Mod-Alt-k':
|
|
52
|
-
'Shift-Tab':
|
|
53
|
-
Tab:
|
|
48
|
+
'Mod-[': skipCommandTracking(liftToOuterList(schema.nodes.list_item)),
|
|
49
|
+
'Mod-]': skipCommandTracking(sinkListItem(schema.nodes.list_item)),
|
|
50
|
+
'Mod-Alt-o': skipCommandTracking(wrapInList(schema.nodes.ordered_list)),
|
|
51
|
+
'Mod-Alt-k': skipCommandTracking(wrapInList(schema.nodes.bullet_list)),
|
|
52
|
+
'Shift-Tab': skipCommandTracking(liftToOuterList(schema.nodes.list_item)),
|
|
53
|
+
Tab: skipCommandTracking(sinkListItem(schema.nodes.list_item)),
|
|
54
54
|
};
|
|
55
55
|
export default listKeymap;
|