@manuscripts/body-editor 1.9.21-LEAN-3632.0 → 1.9.21
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/keys/list.js
CHANGED
|
@@ -19,6 +19,7 @@ exports.skipCommandTracking = void 0;
|
|
|
19
19
|
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
20
20
|
const transform_1 = require("@manuscripts/transform");
|
|
21
21
|
const prosemirror_commands_1 = require("prosemirror-commands");
|
|
22
|
+
const prosemirror_inputrules_1 = require("prosemirror-inputrules");
|
|
22
23
|
const prosemirror_schema_list_1 = require("prosemirror-schema-list");
|
|
23
24
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
24
25
|
const skipCommandTracking = (command) => (state, dispatch) => {
|
|
@@ -64,6 +65,6 @@ const listKeymap = {
|
|
|
64
65
|
'Mod-Alt-k': (0, exports.skipCommandTracking)((0, prosemirror_schema_list_1.wrapInList)(transform_1.schema.nodes.bullet_list)),
|
|
65
66
|
'Shift-Tab': (0, exports.skipCommandTracking)(liftToOuterList(transform_1.schema.nodes.list_item)),
|
|
66
67
|
Tab: (0, exports.skipCommandTracking)((0, prosemirror_schema_list_1.sinkListItem)(transform_1.schema.nodes.list_item)),
|
|
67
|
-
Backspace: (0, exports.skipCommandTracking)(listItemBackward),
|
|
68
|
+
Backspace: (0, exports.skipCommandTracking)((0, prosemirror_commands_1.chainCommands)(prosemirror_inputrules_1.undoInputRule, listItemBackward, prosemirror_commands_1.deleteSelection)),
|
|
68
69
|
};
|
|
69
70
|
exports.default = listKeymap;
|
|
@@ -26,6 +26,7 @@ const prosemirror_state_1 = require("prosemirror-state");
|
|
|
26
26
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
27
27
|
const prosemirror_view_1 = require("prosemirror-view");
|
|
28
28
|
const assets_1 = require("../../assets");
|
|
29
|
+
const commands_1 = require("../../commands");
|
|
29
30
|
const DeleteFootnoteDialog_1 = require("../../components/views/DeleteFootnoteDialog");
|
|
30
31
|
const utils_1 = require("../../lib/utils");
|
|
31
32
|
const ReactSubView_1 = __importDefault(require("../../views/ReactSubView"));
|
|
@@ -233,7 +234,7 @@ exports.default = (props) => {
|
|
|
233
234
|
const can = props.getCapabilities();
|
|
234
235
|
if (targetNode && can.editArticle) {
|
|
235
236
|
const parent = (0, utils_1.findParentNodeWithIdValue)(state.selection);
|
|
236
|
-
if (parent) {
|
|
237
|
+
if (parent && (0, commands_1.isTextSelection)(state.selection)) {
|
|
237
238
|
decorations.push(prosemirror_view_1.Decoration.node(parent.pos, parent.pos + parent.node.nodeSize, {
|
|
238
239
|
class: 'footnote-selected',
|
|
239
240
|
}));
|
package/dist/es/keys/list.js
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
|
17
17
|
import { schema } from '@manuscripts/transform';
|
|
18
|
-
import { joinBackward } from 'prosemirror-commands';
|
|
18
|
+
import { chainCommands, deleteSelection, joinBackward, } from 'prosemirror-commands';
|
|
19
|
+
import { undoInputRule } from 'prosemirror-inputrules';
|
|
19
20
|
import { liftListItem, sinkListItem, splitListItem, wrapInList, } from 'prosemirror-schema-list';
|
|
20
21
|
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
21
22
|
export const skipCommandTracking = (command) => (state, dispatch) => {
|
|
@@ -60,6 +61,6 @@ const listKeymap = {
|
|
|
60
61
|
'Mod-Alt-k': skipCommandTracking(wrapInList(schema.nodes.bullet_list)),
|
|
61
62
|
'Shift-Tab': skipCommandTracking(liftToOuterList(schema.nodes.list_item)),
|
|
62
63
|
Tab: skipCommandTracking(sinkListItem(schema.nodes.list_item)),
|
|
63
|
-
Backspace: skipCommandTracking(listItemBackward),
|
|
64
|
+
Backspace: skipCommandTracking(chainCommands(undoInputRule, listItemBackward, deleteSelection)),
|
|
64
65
|
};
|
|
65
66
|
export default listKeymap;
|
|
@@ -20,6 +20,7 @@ import { NodeSelection, Plugin, PluginKey, TextSelection, } from 'prosemirror-st
|
|
|
20
20
|
import { findParentNodeClosestToPos, findParentNodeOfType, } from 'prosemirror-utils';
|
|
21
21
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
22
22
|
import { alertIcon, deleteIcon } from '../../assets';
|
|
23
|
+
import { isTextSelection } from '../../commands';
|
|
23
24
|
import { DeleteFootnoteDialog, } from '../../components/views/DeleteFootnoteDialog';
|
|
24
25
|
import { findParentNodeWithIdValue, getChildOfType } from '../../lib/utils';
|
|
25
26
|
import ReactSubView from '../../views/ReactSubView';
|
|
@@ -225,7 +226,7 @@ export default (props) => {
|
|
|
225
226
|
const can = props.getCapabilities();
|
|
226
227
|
if (targetNode && can.editArticle) {
|
|
227
228
|
const parent = findParentNodeWithIdValue(state.selection);
|
|
228
|
-
if (parent) {
|
|
229
|
+
if (parent && isTextSelection(state.selection)) {
|
|
229
230
|
decorations.push(Decoration.node(parent.pos, parent.pos + parent.node.nodeSize, {
|
|
230
231
|
class: 'footnote-selected',
|
|
231
232
|
}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "1.9.21
|
|
4
|
+
"version": "1.9.21",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -111,4 +111,4 @@
|
|
|
111
111
|
"@types/react": "^17.0.2",
|
|
112
112
|
"prosemirror-tables": "^1.3.5"
|
|
113
113
|
}
|
|
114
|
-
}
|
|
114
|
+
}
|