@manuscripts/body-editor 2.2.13-LEAN-4021.0 → 2.2.13
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/components/outline/DraggableTree.js +6 -2
- package/dist/cjs/components/views/TableCellContextMenu.js +1 -5
- package/dist/cjs/versions.js +1 -1
- package/dist/es/components/outline/DraggableTree.js +6 -2
- package/dist/es/components/views/TableCellContextMenu.js +1 -5
- package/dist/es/versions.js +1 -1
- package/dist/types/versions.d.ts +1 -1
- package/package.json +2 -2
|
@@ -55,6 +55,11 @@ const isExcluded = (nodeType) => {
|
|
|
55
55
|
const isChildrenExcluded = (nodeType) => {
|
|
56
56
|
return childrenExcludedTypes.includes(nodeType);
|
|
57
57
|
};
|
|
58
|
+
const isAbstractOrBackmatter = (item) => {
|
|
59
|
+
return (item.parent &&
|
|
60
|
+
(item.parent.type === transform_1.schema.nodes.abstracts ||
|
|
61
|
+
item.parent.type === transform_1.schema.nodes.backmatter));
|
|
62
|
+
};
|
|
58
63
|
const isManuscriptNode = (node) => {
|
|
59
64
|
return (node === null || node === void 0 ? void 0 : node.type) === transform_1.schema.nodes.manuscript;
|
|
60
65
|
};
|
|
@@ -111,8 +116,7 @@ const DraggableTree = ({ tree, view, depth, can, }) => {
|
|
|
111
116
|
const [{ isOver }, dropRef] = (0, react_dnd_1.useDrop)({
|
|
112
117
|
accept: 'outline',
|
|
113
118
|
canDrop(item, monitor) {
|
|
114
|
-
if (
|
|
115
|
-
item.node.type === transform_1.schema.nodes.bibliography_section) {
|
|
119
|
+
if (isAbstractOrBackmatter(item) || isAbstractOrBackmatter(tree)) {
|
|
116
120
|
return false;
|
|
117
121
|
}
|
|
118
122
|
if (!ref.current) {
|
|
@@ -29,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.ContextMenu = void 0;
|
|
30
30
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
31
31
|
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
32
|
-
const transform_1 = require("@manuscripts/transform");
|
|
33
32
|
const prosemirror_tables_1 = require("prosemirror-tables");
|
|
34
33
|
const react_1 = __importStar(require("react"));
|
|
35
34
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
@@ -59,19 +58,16 @@ const ColumnChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) =
|
|
|
59
58
|
},
|
|
60
59
|
} }));
|
|
61
60
|
const ContextMenu = ({ view, close, onCancelColumnDialog }) => {
|
|
62
|
-
var _a;
|
|
63
61
|
const runCommand = (command, noTracking) => {
|
|
64
62
|
command(view.state, (tr) => view.dispatch((noTracking && (0, track_changes_plugin_1.skipTracking)(tr)) || tr));
|
|
65
63
|
close();
|
|
66
64
|
};
|
|
67
65
|
const [columnAction, setColumnAction] = (0, react_1.useState)();
|
|
68
|
-
const isHeaderCellSelected = ((_a = view.state.doc.nodeAt(view.state.selection.from)) === null || _a === void 0 ? void 0 : _a.type) ===
|
|
69
|
-
transform_1.schema.nodes.table_header;
|
|
70
66
|
const isCellSelectionMerged = (0, prosemirror_tables_1.mergeCells)(view.state);
|
|
71
67
|
const isCellSelectionSplittable = (0, prosemirror_tables_1.splitCell)(view.state);
|
|
72
68
|
const { rows, columns } = getSelectedCellsCount(view.state);
|
|
73
69
|
return (react_1.default.createElement(MenuDropdownList, { className: 'table-ctx' },
|
|
74
|
-
react_1.default.createElement(ActionButton, {
|
|
70
|
+
react_1.default.createElement(ActionButton, { onClick: () => runCommand((0, commands_1.addRows)('top')) },
|
|
75
71
|
react_1.default.createElement(style_guide_1.PlusIcon, null),
|
|
76
72
|
" Insert ",
|
|
77
73
|
rows,
|
package/dist/cjs/versions.js
CHANGED
|
@@ -29,6 +29,11 @@ const isExcluded = (nodeType) => {
|
|
|
29
29
|
const isChildrenExcluded = (nodeType) => {
|
|
30
30
|
return childrenExcludedTypes.includes(nodeType);
|
|
31
31
|
};
|
|
32
|
+
const isAbstractOrBackmatter = (item) => {
|
|
33
|
+
return (item.parent &&
|
|
34
|
+
(item.parent.type === schema.nodes.abstracts ||
|
|
35
|
+
item.parent.type === schema.nodes.backmatter));
|
|
36
|
+
};
|
|
32
37
|
const isManuscriptNode = (node) => {
|
|
33
38
|
return (node === null || node === void 0 ? void 0 : node.type) === schema.nodes.manuscript;
|
|
34
39
|
};
|
|
@@ -84,8 +89,7 @@ export const DraggableTree = ({ tree, view, depth, can, }) => {
|
|
|
84
89
|
const [{ isOver }, dropRef] = useDrop({
|
|
85
90
|
accept: 'outline',
|
|
86
91
|
canDrop(item, monitor) {
|
|
87
|
-
if (
|
|
88
|
-
item.node.type === schema.nodes.bibliography_section) {
|
|
92
|
+
if (isAbstractOrBackmatter(item) || isAbstractOrBackmatter(tree)) {
|
|
89
93
|
return false;
|
|
90
94
|
}
|
|
91
95
|
if (!ref.current) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Category, DeleteIcon, Dialog, IconTextButton, PlusIcon, } from '@manuscripts/style-guide';
|
|
2
2
|
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
|
3
|
-
import { schema } from '@manuscripts/transform';
|
|
4
3
|
import { CellSelection, deleteColumn, deleteRow, mergeCells, selectedRect, splitCell, } from 'prosemirror-tables';
|
|
5
4
|
import React, { useState } from 'react';
|
|
6
5
|
import styled from 'styled-components';
|
|
@@ -30,19 +29,16 @@ const ColumnChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) =
|
|
|
30
29
|
},
|
|
31
30
|
} }));
|
|
32
31
|
export const ContextMenu = ({ view, close, onCancelColumnDialog }) => {
|
|
33
|
-
var _a;
|
|
34
32
|
const runCommand = (command, noTracking) => {
|
|
35
33
|
command(view.state, (tr) => view.dispatch((noTracking && skipTracking(tr)) || tr));
|
|
36
34
|
close();
|
|
37
35
|
};
|
|
38
36
|
const [columnAction, setColumnAction] = useState();
|
|
39
|
-
const isHeaderCellSelected = ((_a = view.state.doc.nodeAt(view.state.selection.from)) === null || _a === void 0 ? void 0 : _a.type) ===
|
|
40
|
-
schema.nodes.table_header;
|
|
41
37
|
const isCellSelectionMerged = mergeCells(view.state);
|
|
42
38
|
const isCellSelectionSplittable = splitCell(view.state);
|
|
43
39
|
const { rows, columns } = getSelectedCellsCount(view.state);
|
|
44
40
|
return (React.createElement(MenuDropdownList, { className: 'table-ctx' },
|
|
45
|
-
React.createElement(ActionButton, {
|
|
41
|
+
React.createElement(ActionButton, { onClick: () => runCommand(addRows('top')) },
|
|
46
42
|
React.createElement(PlusIcon, null),
|
|
47
43
|
" Insert ",
|
|
48
44
|
rows,
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.2.13
|
|
1
|
+
export const VERSION = '2.2.13';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.2.13
|
|
1
|
+
export declare const VERSION = "2.2.13";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
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": "2.2.13
|
|
4
|
+
"version": "2.2.13",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@manuscripts/library": "1.3.11",
|
|
35
35
|
"@manuscripts/style-guide": "2.0.21",
|
|
36
36
|
"@manuscripts/track-changes-plugin": "1.7.23",
|
|
37
|
-
"@manuscripts/transform": "3.0.
|
|
37
|
+
"@manuscripts/transform": "3.0.1",
|
|
38
38
|
"@popperjs/core": "^2.11.8",
|
|
39
39
|
"astrocite-eutils": "^0.16.4",
|
|
40
40
|
"codemirror": "^5.58.1",
|