@manuscripts/body-editor 1.5.8 → 1.5.9-LEAN-2702
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/classes/collabProvider.js +21 -0
- package/dist/cjs/commands.js +2 -2
- package/dist/cjs/components/outline/DraggableTree.js +31 -30
- package/dist/cjs/components/outline/ManuscriptOutline.js +2 -13
- package/dist/cjs/components/outline/OutlineManuscript.js +2 -9
- package/dist/cjs/configs/editor-plugins.js +6 -1
- package/dist/cjs/configs/editor-views.js +4 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/lib/use-do-with-debounce.js +23 -0
- package/dist/cjs/node-type-icons.js +1 -4
- package/dist/cjs/useEditor.js +41 -2
- package/dist/cjs/views/contributors_section.js +36 -0
- package/dist/cjs/views/title.js +37 -0
- package/dist/cjs/views/title_editable.js +20 -0
- package/dist/es/classes/collabProvider.js +17 -0
- package/dist/es/commands.js +2 -2
- package/dist/es/components/outline/DraggableTree.js +32 -31
- package/dist/es/components/outline/ManuscriptOutline.js +2 -13
- package/dist/es/components/outline/OutlineManuscript.js +4 -11
- package/dist/es/configs/editor-plugins.js +6 -1
- package/dist/es/configs/editor-views.js +4 -0
- package/dist/es/index.js +1 -0
- package/dist/es/lib/use-do-with-debounce.js +19 -0
- package/dist/es/node-type-icons.js +1 -4
- package/dist/es/useEditor.js +41 -2
- package/dist/es/views/contributors_section.js +29 -0
- package/dist/es/views/title.js +33 -0
- package/dist/es/views/title_editable.js +18 -0
- package/dist/types/classes/collabProvider.d.ts +27 -0
- package/dist/types/components/outline/DraggableTree.d.ts +0 -1
- package/dist/types/components/outline/OutlineManuscript.d.ts +2 -0
- package/dist/types/configs/ManuscriptsEditor.d.ts +2 -0
- package/dist/types/configs/editor-plugins.d.ts +2 -0
- package/dist/types/configs/editor-views.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/use-do-with-debounce.d.ts +1 -0
- package/dist/types/useEditor.d.ts +2 -1
- package/dist/types/views/contributors_section.d.ts +17 -0
- package/dist/types/views/title.d.ts +24 -0
- package/dist/types/views/title_editable.d.ts +18 -0
- package/package.json +7 -6
- package/styles/AdvancedEditor.css +24 -0
- package/styles/Editor.css +8 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CollabProvider = void 0;
|
|
19
|
+
class CollabProvider {
|
|
20
|
+
}
|
|
21
|
+
exports.CollabProvider = CollabProvider;
|
package/dist/cjs/commands.js
CHANGED
|
@@ -343,7 +343,7 @@ const insertGraphicalAbstract = (state, dispatch) => {
|
|
|
343
343
|
!(0, transform_1.isInAbstractsSection)(state.selection.$from)) {
|
|
344
344
|
return false;
|
|
345
345
|
}
|
|
346
|
-
if ((0, utils_1.getMatchingDescendant)(state.doc, (node) => node.type === state.schema.nodes.graphical_abstract_section)) {
|
|
346
|
+
if (!(0, utils_1.getMatchingDescendant)(state.doc, (node) => node.type === state.schema.nodes.graphical_abstract_section)) {
|
|
347
347
|
return false;
|
|
348
348
|
}
|
|
349
349
|
const section = state.schema.nodes.graphical_abstract_section.createAndFill({ category: 'MPSectionCategory:abstract-graphical' }, [
|
|
@@ -393,7 +393,7 @@ const insertFootnotesSection = (state, dispatch) => {
|
|
|
393
393
|
};
|
|
394
394
|
exports.insertFootnotesSection = insertFootnotesSection;
|
|
395
395
|
const insertBibliographySection = (state, dispatch) => {
|
|
396
|
-
if ((0, utils_1.
|
|
396
|
+
if ((0, utils_1.getMatchingDescendant)(state.doc, (node) => node.type === state.schema.nodes.bibliography_section)) {
|
|
397
397
|
return false;
|
|
398
398
|
}
|
|
399
399
|
const section = state.schema.nodes.bibliography_section.createAndFill({}, [
|
|
@@ -34,23 +34,25 @@ const track_changes_utils_1 = require("../../lib/track-changes-utils");
|
|
|
34
34
|
const node_type_icons_1 = require("../../node-type-icons");
|
|
35
35
|
const section_title_1 = require("../../views/section_title");
|
|
36
36
|
const Outline_1 = require("./Outline");
|
|
37
|
+
const excludedTypes = [
|
|
38
|
+
transform_1.schema.nodes.table,
|
|
39
|
+
transform_1.schema.nodes.figure,
|
|
40
|
+
transform_1.schema.nodes.footnotes_element,
|
|
41
|
+
transform_1.schema.nodes.bibliography_element,
|
|
42
|
+
transform_1.schema.nodes.keywords_section,
|
|
43
|
+
transform_1.schema.nodes.affiliations_section,
|
|
44
|
+
transform_1.schema.nodes.contributors_section,
|
|
45
|
+
transform_1.schema.nodes.title,
|
|
46
|
+
];
|
|
47
|
+
const childrenExcludedTypes = [
|
|
48
|
+
transform_1.schema.nodes.pullquote_element,
|
|
49
|
+
transform_1.schema.nodes.blockquote_element,
|
|
50
|
+
];
|
|
37
51
|
const isExcluded = (nodeType) => {
|
|
38
|
-
const { nodes } = nodeType.schema;
|
|
39
|
-
const excludedTypes = [
|
|
40
|
-
nodes.table,
|
|
41
|
-
nodes.figure,
|
|
42
|
-
nodes.footnotes_element,
|
|
43
|
-
nodes.bibliography_element,
|
|
44
|
-
nodes.keywords_section,
|
|
45
|
-
nodes.affiliations_section,
|
|
46
|
-
nodes.contributors_section,
|
|
47
|
-
];
|
|
48
52
|
return excludedTypes.includes(nodeType);
|
|
49
53
|
};
|
|
50
54
|
const isChildrenExcluded = (nodeType) => {
|
|
51
|
-
|
|
52
|
-
const excludedTypes = [nodes.pullquote_element, nodes.blockquote_element];
|
|
53
|
-
return excludedTypes.includes(nodeType);
|
|
55
|
+
return childrenExcludedTypes.includes(nodeType);
|
|
54
56
|
};
|
|
55
57
|
const buildTree = ({ node, pos, index, selected, parent, }) => {
|
|
56
58
|
const items = [];
|
|
@@ -136,23 +138,22 @@ class Tree extends React.Component {
|
|
|
136
138
|
if (isRejectedItem || node.attrs.id === 'META_SECTION') {
|
|
137
139
|
return null;
|
|
138
140
|
}
|
|
139
|
-
return connectDropTarget(React.createElement("div", null,
|
|
140
|
-
React.createElement(Outline_1.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
React.createElement(Outline_1.
|
|
144
|
-
|
|
145
|
-
React.createElement(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
React.createElement(Outline_1.OutlineDropPreview, { depth: depth, style: this.bottomPreviewStyles(mightDrop, dragPosition) }))));
|
|
141
|
+
return connectDropTarget(React.createElement("div", null, node.type.name !== 'titles' && (React.createElement(Outline_1.Outline, { style: this.outlineStyles(isDragging) },
|
|
142
|
+
React.createElement(Outline_1.OutlineDropPreview, { depth: depth, style: this.topPreviewStyles(mightDrop, dragPosition) }),
|
|
143
|
+
!(0, section_title_1.isSpecialSection)(node) && (React.createElement(React.Fragment, null, connectDragSource(React.createElement("div", null,
|
|
144
|
+
React.createElement(Outline_1.OutlineItem, { isSelected: isSelected, depth: depth, onContextMenu: this.handleContextMenu },
|
|
145
|
+
items.length ? (React.createElement(Outline_1.OutlineItemArrow, { onClick: this.toggle }, open ? (React.createElement(Outline_1.StyledTriangleExpanded, null)) : (React.createElement(Outline_1.StyledTriangleCollapsed, null)))) : (React.createElement(Outline_1.OutlineItemNoArrow, null)),
|
|
146
|
+
React.createElement(Outline_1.OutlineItemLink, { to: `#${node.attrs.id || ''}` },
|
|
147
|
+
connectDragPreview(React.createElement("span", { style: {
|
|
148
|
+
display: 'inline-flex',
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
} },
|
|
151
|
+
React.createElement(Outline_1.OutlineItemIcon, null, (0, node_type_icons_1.nodeTypeIcon)(node.type)))),
|
|
152
|
+
React.createElement(Outline_1.OutlineItemLinkText, { className: `outline-text-${node.type.name} ${isDeletedItem && 'deleted'}` }, this.itemText(node)))))))),
|
|
153
|
+
items.length ? (React.createElement("div", { style: {
|
|
154
|
+
display: open || (0, section_title_1.isSpecialSection)(node) ? '' : 'none',
|
|
155
|
+
} }, items.map((subtree) => (React.createElement(DraggableTree, Object.assign({}, this.props, { key: subtree.node.attrs.id, tree: subtree, view: view, depth: (0, section_title_1.isSpecialSection)(node) ? depth : depth + 1 })))))) : null,
|
|
156
|
+
React.createElement(Outline_1.OutlineDropPreview, { depth: depth, style: this.bottomPreviewStyles(mightDrop, dragPosition) })))));
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
const dragSource = (0, react_dnd_1.DragSource)('outline', {
|
|
@@ -39,7 +39,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.ManuscriptOutline = void 0;
|
|
42
|
-
const title_editor_1 = require("@manuscripts/title-editor");
|
|
43
42
|
const react_1 = __importStar(require("react"));
|
|
44
43
|
const use_debounce_1 = require("../hooks/use-debounce");
|
|
45
44
|
const DraggableTree_1 = __importStar(require("./DraggableTree"));
|
|
@@ -49,24 +48,14 @@ const ManuscriptOutline = (props) => {
|
|
|
49
48
|
const debouncedProps = (0, use_debounce_1.useDebounce)(props, 500);
|
|
50
49
|
(0, react_1.useEffect)(() => {
|
|
51
50
|
var _a;
|
|
52
|
-
const { doc, view,
|
|
51
|
+
const { doc, view, selected } = debouncedProps;
|
|
53
52
|
if (doc) {
|
|
54
|
-
const
|
|
53
|
+
const tree = (0, DraggableTree_1.buildTree)({
|
|
55
54
|
node: doc,
|
|
56
55
|
pos: 0,
|
|
57
56
|
index: 0,
|
|
58
57
|
selected,
|
|
59
58
|
});
|
|
60
|
-
const node = (0, title_editor_1.parse)(manuscript.title || '');
|
|
61
|
-
const tree = {
|
|
62
|
-
node,
|
|
63
|
-
requirementsNode: doc,
|
|
64
|
-
pos: 0,
|
|
65
|
-
endPos: 0,
|
|
66
|
-
index: 0,
|
|
67
|
-
isSelected: !selected,
|
|
68
|
-
items,
|
|
69
|
-
};
|
|
70
59
|
setValues({ tree, view, editArticle: !!((_a = props.capabilities) === null || _a === void 0 ? void 0 : _a.editArticle) });
|
|
71
60
|
}
|
|
72
61
|
else {
|
|
@@ -20,22 +20,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.OutlineManuscript = void 0;
|
|
22
22
|
const OutlineIconManuscript_1 = __importDefault(require("@manuscripts/assets/react/OutlineIconManuscript"));
|
|
23
|
-
const title_editor_1 = require("@manuscripts/title-editor");
|
|
24
23
|
const transform_1 = require("@manuscripts/transform");
|
|
25
24
|
const react_1 = __importDefault(require("react"));
|
|
26
25
|
const Outline_1 = require("./Outline");
|
|
27
|
-
const
|
|
28
|
-
const node = (0, title_editor_1.parse)(value, {
|
|
29
|
-
topNode: title_editor_1.schema.nodes.title.create(),
|
|
30
|
-
});
|
|
31
|
-
return node.textContent;
|
|
32
|
-
};
|
|
33
|
-
const OutlineManuscript = ({ project, manuscript, }) => (react_1.default.createElement(Outline_1.Outline, null,
|
|
26
|
+
const OutlineManuscript = ({ project, manuscript, doc, }) => (react_1.default.createElement(Outline_1.Outline, null,
|
|
34
27
|
react_1.default.createElement(Outline_1.OutlineItem, { isSelected: false, depth: 0 },
|
|
35
28
|
react_1.default.createElement(Outline_1.OutlineItemLink, { to: `/projects/${project._id}/manuscripts/${manuscript._id}` },
|
|
36
29
|
react_1.default.createElement(Outline_1.OutlineItemArrow, null,
|
|
37
30
|
react_1.default.createElement(Outline_1.StyledTriangleCollapsed, null)),
|
|
38
31
|
react_1.default.createElement(Outline_1.OutlineItemIcon, null,
|
|
39
32
|
react_1.default.createElement(OutlineIconManuscript_1.default, null)),
|
|
40
|
-
react_1.default.createElement(Outline_1.OutlineItemLinkText, { className: 'outline-text-title' },
|
|
33
|
+
react_1.default.createElement(Outline_1.OutlineItemLinkText, { className: 'outline-text-title' }, (0, transform_1.nodeTitle)(doc))))));
|
|
41
34
|
exports.OutlineManuscript = OutlineManuscript;
|
|
@@ -20,6 +20,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
require("prosemirror-gapcursor/style/gapcursor.css");
|
|
22
22
|
require("prosemirror-tables/style/tables.css");
|
|
23
|
+
const prosemirror_collab_1 = require("prosemirror-collab");
|
|
23
24
|
const prosemirror_dropcursor_1 = require("prosemirror-dropcursor");
|
|
24
25
|
const prosemirror_history_1 = require("prosemirror-history");
|
|
25
26
|
const prosemirror_tables_1 = require("prosemirror-tables");
|
|
@@ -42,7 +43,7 @@ const tracking_mark_1 = __importDefault(require("../plugins/tracking-mark"));
|
|
|
42
43
|
const rules_1 = __importDefault(require("../rules"));
|
|
43
44
|
exports.default = (props) => {
|
|
44
45
|
const plugins = props.plugins || [];
|
|
45
|
-
|
|
46
|
+
const allPlugins = [
|
|
46
47
|
rules_1.default,
|
|
47
48
|
...keys_1.default,
|
|
48
49
|
(0, prosemirror_dropcursor_1.dropCursor)(),
|
|
@@ -65,6 +66,10 @@ exports.default = (props) => {
|
|
|
65
66
|
(0, track_changes_ui_1.default)(props),
|
|
66
67
|
(0, tracking_mark_1.default)(),
|
|
67
68
|
];
|
|
69
|
+
if (props.collabProvider) {
|
|
70
|
+
allPlugins.push((0, prosemirror_collab_1.collab)({ version: props.collabProvider.currentVersion }));
|
|
71
|
+
}
|
|
72
|
+
return allPlugins;
|
|
68
73
|
};
|
|
69
74
|
document.execCommand('enableObjectResizing', false, 'false');
|
|
70
75
|
document.execCommand('enableInlineTableEditing', false, 'false');
|
|
@@ -23,6 +23,7 @@ const bibliography_item_editable_1 = __importDefault(require("../views/bibliogra
|
|
|
23
23
|
const blockquote_element_editable_1 = __importDefault(require("../views/blockquote_element_editable"));
|
|
24
24
|
const bullet_list_editable_1 = __importDefault(require("../views/bullet_list_editable"));
|
|
25
25
|
const citation_editable_1 = __importDefault(require("../views/citation_editable"));
|
|
26
|
+
const contributors_section_1 = __importDefault(require("../views/contributors_section"));
|
|
26
27
|
const cross_reference_editable_1 = __importDefault(require("../views/cross_reference_editable"));
|
|
27
28
|
const equation_editable_1 = __importDefault(require("../views/equation_editable"));
|
|
28
29
|
const equation_element_editable_1 = __importDefault(require("../views/equation_element_editable"));
|
|
@@ -46,15 +47,18 @@ const pullquote_element_editable_1 = __importDefault(require("../views/pullquote
|
|
|
46
47
|
const section_label_1 = __importDefault(require("../views/section_label"));
|
|
47
48
|
const section_title_editable_1 = __importDefault(require("../views/section_title_editable"));
|
|
48
49
|
const table_element_editable_1 = __importDefault(require("../views/table_element_editable"));
|
|
50
|
+
const title_editable_1 = __importDefault(require("../views/title_editable"));
|
|
49
51
|
const toc_element_editable_1 = __importDefault(require("../views/toc_element_editable"));
|
|
50
52
|
exports.default = (props, dispatch) => {
|
|
51
53
|
return {
|
|
54
|
+
title: (0, title_editable_1.default)(props, dispatch),
|
|
52
55
|
bibliography_item: (0, bibliography_item_editable_1.default)(props),
|
|
53
56
|
bibliography_element: (0, bibliography_element_editable_1.default)(props),
|
|
54
57
|
blockquote_element: (0, blockquote_element_editable_1.default)(props),
|
|
55
58
|
bullet_list: (0, bullet_list_editable_1.default)(props),
|
|
56
59
|
citation: (0, citation_editable_1.default)(props),
|
|
57
60
|
cross_reference: (0, cross_reference_editable_1.default)(props),
|
|
61
|
+
contributors_section: (0, contributors_section_1.default)(props, dispatch),
|
|
58
62
|
equation: (0, equation_editable_1.default)(props),
|
|
59
63
|
equation_element: (0, equation_element_editable_1.default)(props),
|
|
60
64
|
figure: (0, figure_editable_1.default)(props, dispatch),
|
package/dist/cjs/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.ManuscriptsEditor = exports.useEditor = exports.isHighlightComment = exports.isThereSelector = exports.commentScroll = exports.toolbar = exports.PopperManager = exports.getMenus = exports.ManuscriptToolbar = exports.OutlineManuscript = exports.OutlineItemIcon = exports.ManuscriptOutline = exports.DialogNames = exports.DialogController = void 0;
|
|
35
|
+
exports.ManuscriptsEditor = exports.useEditor = exports.isHighlightComment = exports.isThereSelector = exports.commentScroll = exports.toolbar = exports.PopperManager = exports.CollabProvider = exports.getMenus = exports.ManuscriptToolbar = exports.OutlineManuscript = exports.OutlineItemIcon = exports.ManuscriptOutline = exports.DialogNames = exports.DialogController = void 0;
|
|
36
36
|
__exportStar(require("./citation-sources"), exports);
|
|
37
37
|
__exportStar(require("./commands"), exports);
|
|
38
38
|
__exportStar(require("./components/application-menu"), exports);
|
|
@@ -49,6 +49,8 @@ var ManuscriptToolbar_1 = require("./components/toolbar/ManuscriptToolbar");
|
|
|
49
49
|
Object.defineProperty(exports, "ManuscriptToolbar", { enumerable: true, get: function () { return ManuscriptToolbar_1.ManuscriptToolbar; } });
|
|
50
50
|
var menus_1 = require("./menus");
|
|
51
51
|
Object.defineProperty(exports, "getMenus", { enumerable: true, get: function () { return __importDefault(menus_1).default; } });
|
|
52
|
+
var collabProvider_1 = require("./classes/collabProvider");
|
|
53
|
+
Object.defineProperty(exports, "CollabProvider", { enumerable: true, get: function () { return collabProvider_1.CollabProvider; } });
|
|
52
54
|
var popper_1 = require("./lib/popper");
|
|
53
55
|
Object.defineProperty(exports, "PopperManager", { enumerable: true, get: function () { return popper_1.PopperManager; } });
|
|
54
56
|
var toolbar_1 = require("./toolbar");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDoWithDebounce = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useDoWithDebounce = () => {
|
|
6
|
+
const debounced = (0, react_1.useRef)(() => undefined);
|
|
7
|
+
const timeout = (0, react_1.useRef)();
|
|
8
|
+
const doWithDebounce = (fn, interval = 1000, flush = false) => {
|
|
9
|
+
debounced.current = fn;
|
|
10
|
+
if (flush) {
|
|
11
|
+
fn();
|
|
12
|
+
debounced.current = () => undefined;
|
|
13
|
+
window.clearTimeout(timeout.current);
|
|
14
|
+
}
|
|
15
|
+
window.clearTimeout(timeout.current);
|
|
16
|
+
timeout.current = window.setTimeout(() => {
|
|
17
|
+
debounced.current();
|
|
18
|
+
timeout.current = 0;
|
|
19
|
+
}, interval);
|
|
20
|
+
};
|
|
21
|
+
return doWithDebounce;
|
|
22
|
+
};
|
|
23
|
+
exports.useDoWithDebounce = useDoWithDebounce;
|
|
@@ -29,11 +29,11 @@ const OutlineIconSection_1 = __importDefault(require("@manuscripts/assets/react/
|
|
|
29
29
|
const OutlineIconTable_1 = __importDefault(require("@manuscripts/assets/react/OutlineIconTable"));
|
|
30
30
|
const OutlineIconUnorderedList_1 = __importDefault(require("@manuscripts/assets/react/OutlineIconUnorderedList"));
|
|
31
31
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
32
|
-
const title_editor_1 = require("@manuscripts/title-editor");
|
|
33
32
|
const transform_1 = require("@manuscripts/transform");
|
|
34
33
|
const react_1 = __importDefault(require("react"));
|
|
35
34
|
const { nodes } = transform_1.schema;
|
|
36
35
|
const icons = new Map([
|
|
36
|
+
[nodes.manuscript, OutlineIconManuscript_1.default],
|
|
37
37
|
[nodes.bibliography_section, OutlineIconSection_1.default],
|
|
38
38
|
[nodes.blockquote_element, style_guide_1.BlockQuoteIcon],
|
|
39
39
|
[nodes.bullet_list, OutlineIconUnorderedList_1.default],
|
|
@@ -52,9 +52,6 @@ const icons = new Map([
|
|
|
52
52
|
[nodes.footnotes_section, OutlineIconSection_1.default],
|
|
53
53
|
]);
|
|
54
54
|
const nodeTypeIcon = (nodeType) => {
|
|
55
|
-
if (nodeType === title_editor_1.schema.nodes.title) {
|
|
56
|
-
return react_1.default.createElement(OutlineIconManuscript_1.default, null);
|
|
57
|
-
}
|
|
58
55
|
const Icon = icons.get(nodeType);
|
|
59
56
|
return Icon ? react_1.default.createElement(Icon, null) : null;
|
|
60
57
|
};
|
package/dist/cjs/useEditor.js
CHANGED
|
@@ -14,23 +14,62 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
17
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
28
|
+
const prosemirror_collab_1 = require("prosemirror-collab");
|
|
18
29
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
19
30
|
const react_1 = require("react");
|
|
20
31
|
const react_router_dom_1 = require("react-router-dom");
|
|
32
|
+
const use_do_with_debounce_1 = require("./lib/use-do-with-debounce");
|
|
21
33
|
const bibliography_1 = require("./plugins/bibliography");
|
|
22
|
-
const useEditor = (initialState, createView) => {
|
|
34
|
+
const useEditor = (initialState, createView, editorProps) => {
|
|
23
35
|
const view = (0, react_1.useRef)();
|
|
24
36
|
const [state, setState] = (0, react_1.useState)(initialState);
|
|
25
37
|
const [viewElement, setViewElement] = (0, react_1.useState)(null);
|
|
26
38
|
const history = (0, react_router_dom_1.useHistory)();
|
|
39
|
+
const { collabProvider } = editorProps;
|
|
40
|
+
if (collabProvider) {
|
|
41
|
+
collabProvider.onNewSteps((newVersion, steps, clientIDs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
if (state && view.current) {
|
|
43
|
+
const localVersion = (0, prosemirror_collab_1.getVersion)(view.current.state);
|
|
44
|
+
const since = yield collabProvider.stepsSince(localVersion);
|
|
45
|
+
if ((since === null || since === void 0 ? void 0 : since.steps) && since.clientIDs) {
|
|
46
|
+
view.current.dispatch((0, prosemirror_collab_1.receiveTransaction)(view.current.state, since === null || since === void 0 ? void 0 : since.steps, since.clientIDs));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
console.warn('Inconsistent new steps event from the authority.');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
const debounce = (0, use_do_with_debounce_1.useDoWithDebounce)();
|
|
27
55
|
const dispatch = (0, react_1.useCallback)((tr) => {
|
|
28
56
|
if (!view.current) {
|
|
29
57
|
return state;
|
|
30
58
|
}
|
|
31
59
|
const nextState = view.current.state.apply(tr);
|
|
32
60
|
view.current.updateState(nextState);
|
|
33
|
-
|
|
61
|
+
const trackState = track_changes_plugin_1.trackChangesPluginKey.getState(view.current.state);
|
|
62
|
+
if (collabProvider &&
|
|
63
|
+
trackState &&
|
|
64
|
+
trackState.status !== track_changes_plugin_1.TrackChangesStatus.viewSnapshots) {
|
|
65
|
+
const sendable = (0, prosemirror_collab_1.sendableSteps)(nextState);
|
|
66
|
+
if (sendable) {
|
|
67
|
+
collabProvider.sendSteps(sendable.version, sendable.steps, sendable.clientID);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
debounce(() => {
|
|
71
|
+
setState(nextState);
|
|
72
|
+
}, 1000, !tr.isGeneric);
|
|
34
73
|
return state;
|
|
35
74
|
}, []);
|
|
36
75
|
const replaceView = (state, createView) => {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ContributorsSectionView = void 0;
|
|
7
|
+
const base_node_view_1 = require("./base_node_view");
|
|
8
|
+
const creators_1 = require("./creators");
|
|
9
|
+
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
10
|
+
class ContributorsSectionView extends base_node_view_1.BaseNodeView {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.initialise = () => {
|
|
14
|
+
this.createDOM();
|
|
15
|
+
};
|
|
16
|
+
this.createDOM = () => {
|
|
17
|
+
this.dom = document.createElement('div');
|
|
18
|
+
this.dom.classList.add('contributors');
|
|
19
|
+
const can = this.props.getCapabilities();
|
|
20
|
+
const { components: { MetadataContainer }, subscribeStore, } = this.props;
|
|
21
|
+
this.metadata = (0, ReactSubView_1.default)(this.props, MetadataContainer, {
|
|
22
|
+
allowInvitingAuthors: false,
|
|
23
|
+
showAuthorEditButton: true,
|
|
24
|
+
disableEditButton: !can.editMetadata,
|
|
25
|
+
subscribe: subscribeStore,
|
|
26
|
+
}, this.node, this.getPos, this.view, 'metadata-container');
|
|
27
|
+
if (this.metadata) {
|
|
28
|
+
this.dom.appendChild(this.metadata);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
this.ignoreMutation = () => true;
|
|
32
|
+
this.stopEvent = () => true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ContributorsSectionView = ContributorsSectionView;
|
|
36
|
+
exports.default = (0, creators_1.createNodeView)(ContributorsSectionView);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TitleView = void 0;
|
|
19
|
+
const base_node_view_1 = require("./base_node_view");
|
|
20
|
+
const creators_1 = require("./creators");
|
|
21
|
+
class TitleView extends base_node_view_1.BaseNodeView {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.initialise = () => {
|
|
25
|
+
this.createDOM();
|
|
26
|
+
};
|
|
27
|
+
this.createDOM = () => {
|
|
28
|
+
this.dom = document.createElement('div');
|
|
29
|
+
this.dom.classList.add('manuscript-title');
|
|
30
|
+
this.contentDOM = document.createElement('div');
|
|
31
|
+
this.contentDOM.classList.add('article-titles');
|
|
32
|
+
this.dom.appendChild(this.contentDOM);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.TitleView = TitleView;
|
|
37
|
+
exports.default = (0, creators_1.createNodeView)(TitleView);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const creators_1 = require("./creators");
|
|
19
|
+
const title_1 = require("./title");
|
|
20
|
+
exports.default = (0, creators_1.createEditableNodeView)(title_1.TitleView);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export class CollabProvider {
|
|
17
|
+
}
|
package/dist/es/commands.js
CHANGED
|
@@ -301,7 +301,7 @@ export const insertGraphicalAbstract = (state, dispatch) => {
|
|
|
301
301
|
!isInAbstractsSection(state.selection.$from)) {
|
|
302
302
|
return false;
|
|
303
303
|
}
|
|
304
|
-
if (getMatchingDescendant(state.doc, (node) => node.type === state.schema.nodes.graphical_abstract_section)) {
|
|
304
|
+
if (!getMatchingDescendant(state.doc, (node) => node.type === state.schema.nodes.graphical_abstract_section)) {
|
|
305
305
|
return false;
|
|
306
306
|
}
|
|
307
307
|
const section = state.schema.nodes.graphical_abstract_section.createAndFill({ category: 'MPSectionCategory:abstract-graphical' }, [
|
|
@@ -348,7 +348,7 @@ export const insertFootnotesSection = (state, dispatch) => {
|
|
|
348
348
|
return true;
|
|
349
349
|
};
|
|
350
350
|
export const insertBibliographySection = (state, dispatch) => {
|
|
351
|
-
if (
|
|
351
|
+
if (getMatchingDescendant(state.doc, (node) => node.type === state.schema.nodes.bibliography_section)) {
|
|
352
352
|
return false;
|
|
353
353
|
}
|
|
354
354
|
const section = state.schema.nodes.bibliography_section.createAndFill({}, [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isElementNodeType, nodeTitle, nodeTitlePlaceholder, } from '@manuscripts/transform';
|
|
1
|
+
import { isElementNodeType, nodeTitle, nodeTitlePlaceholder, schema, } from '@manuscripts/transform';
|
|
2
2
|
import { Fragment } from 'prosemirror-model';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { DragSource, DropTarget, } from 'react-dnd';
|
|
@@ -8,23 +8,25 @@ import { isDeleted, isRejectedInsert } from '../../lib/track-changes-utils';
|
|
|
8
8
|
import { nodeTypeIcon } from '../../node-type-icons';
|
|
9
9
|
import { isSpecialSection } from '../../views/section_title';
|
|
10
10
|
import { Outline, OutlineDropPreview, OutlineItem, OutlineItemArrow, OutlineItemIcon, OutlineItemLink, OutlineItemLinkText, OutlineItemNoArrow, OutlineItemPlaceholder, StyledTriangleCollapsed, StyledTriangleExpanded, } from './Outline';
|
|
11
|
+
const excludedTypes = [
|
|
12
|
+
schema.nodes.table,
|
|
13
|
+
schema.nodes.figure,
|
|
14
|
+
schema.nodes.footnotes_element,
|
|
15
|
+
schema.nodes.bibliography_element,
|
|
16
|
+
schema.nodes.keywords_section,
|
|
17
|
+
schema.nodes.affiliations_section,
|
|
18
|
+
schema.nodes.contributors_section,
|
|
19
|
+
schema.nodes.title,
|
|
20
|
+
];
|
|
21
|
+
const childrenExcludedTypes = [
|
|
22
|
+
schema.nodes.pullquote_element,
|
|
23
|
+
schema.nodes.blockquote_element,
|
|
24
|
+
];
|
|
11
25
|
const isExcluded = (nodeType) => {
|
|
12
|
-
const { nodes } = nodeType.schema;
|
|
13
|
-
const excludedTypes = [
|
|
14
|
-
nodes.table,
|
|
15
|
-
nodes.figure,
|
|
16
|
-
nodes.footnotes_element,
|
|
17
|
-
nodes.bibliography_element,
|
|
18
|
-
nodes.keywords_section,
|
|
19
|
-
nodes.affiliations_section,
|
|
20
|
-
nodes.contributors_section,
|
|
21
|
-
];
|
|
22
26
|
return excludedTypes.includes(nodeType);
|
|
23
27
|
};
|
|
24
28
|
const isChildrenExcluded = (nodeType) => {
|
|
25
|
-
|
|
26
|
-
const excludedTypes = [nodes.pullquote_element, nodes.blockquote_element];
|
|
27
|
-
return excludedTypes.includes(nodeType);
|
|
29
|
+
return childrenExcludedTypes.includes(nodeType);
|
|
28
30
|
};
|
|
29
31
|
export const buildTree = ({ node, pos, index, selected, parent, }) => {
|
|
30
32
|
const items = [];
|
|
@@ -109,23 +111,22 @@ class Tree extends React.Component {
|
|
|
109
111
|
if (isRejectedItem || node.attrs.id === 'META_SECTION') {
|
|
110
112
|
return null;
|
|
111
113
|
}
|
|
112
|
-
return connectDropTarget(React.createElement("div", null,
|
|
113
|
-
React.createElement(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
React.createElement(
|
|
117
|
-
|
|
118
|
-
React.createElement(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
React.createElement(OutlineDropPreview, { depth: depth, style: this.bottomPreviewStyles(mightDrop, dragPosition) }))));
|
|
114
|
+
return connectDropTarget(React.createElement("div", null, node.type.name !== 'titles' && (React.createElement(Outline, { style: this.outlineStyles(isDragging) },
|
|
115
|
+
React.createElement(OutlineDropPreview, { depth: depth, style: this.topPreviewStyles(mightDrop, dragPosition) }),
|
|
116
|
+
!isSpecialSection(node) && (React.createElement(React.Fragment, null, connectDragSource(React.createElement("div", null,
|
|
117
|
+
React.createElement(OutlineItem, { isSelected: isSelected, depth: depth, onContextMenu: this.handleContextMenu },
|
|
118
|
+
items.length ? (React.createElement(OutlineItemArrow, { onClick: this.toggle }, open ? (React.createElement(StyledTriangleExpanded, null)) : (React.createElement(StyledTriangleCollapsed, null)))) : (React.createElement(OutlineItemNoArrow, null)),
|
|
119
|
+
React.createElement(OutlineItemLink, { to: `#${node.attrs.id || ''}` },
|
|
120
|
+
connectDragPreview(React.createElement("span", { style: {
|
|
121
|
+
display: 'inline-flex',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
} },
|
|
124
|
+
React.createElement(OutlineItemIcon, null, nodeTypeIcon(node.type)))),
|
|
125
|
+
React.createElement(OutlineItemLinkText, { className: `outline-text-${node.type.name} ${isDeletedItem && 'deleted'}` }, this.itemText(node)))))))),
|
|
126
|
+
items.length ? (React.createElement("div", { style: {
|
|
127
|
+
display: open || isSpecialSection(node) ? '' : 'none',
|
|
128
|
+
} }, items.map((subtree) => (React.createElement(DraggableTree, Object.assign({}, this.props, { key: subtree.node.attrs.id, tree: subtree, view: view, depth: isSpecialSection(node) ? depth : depth + 1 })))))) : null,
|
|
129
|
+
React.createElement(OutlineDropPreview, { depth: depth, style: this.bottomPreviewStyles(mightDrop, dragPosition) })))));
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
const dragSource = DragSource('outline', {
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { parse } from '@manuscripts/title-editor';
|
|
17
16
|
import React, { useEffect, useState } from 'react';
|
|
18
17
|
import { useDebounce } from '../hooks/use-debounce';
|
|
19
18
|
import DraggableTree, { buildTree } from './DraggableTree';
|
|
@@ -23,24 +22,14 @@ export const ManuscriptOutline = (props) => {
|
|
|
23
22
|
const debouncedProps = useDebounce(props, 500);
|
|
24
23
|
useEffect(() => {
|
|
25
24
|
var _a;
|
|
26
|
-
const { doc, view,
|
|
25
|
+
const { doc, view, selected } = debouncedProps;
|
|
27
26
|
if (doc) {
|
|
28
|
-
const
|
|
27
|
+
const tree = buildTree({
|
|
29
28
|
node: doc,
|
|
30
29
|
pos: 0,
|
|
31
30
|
index: 0,
|
|
32
31
|
selected,
|
|
33
32
|
});
|
|
34
|
-
const node = parse(manuscript.title || '');
|
|
35
|
-
const tree = {
|
|
36
|
-
node,
|
|
37
|
-
requirementsNode: doc,
|
|
38
|
-
pos: 0,
|
|
39
|
-
endPos: 0,
|
|
40
|
-
index: 0,
|
|
41
|
-
isSelected: !selected,
|
|
42
|
-
items,
|
|
43
|
-
};
|
|
44
33
|
setValues({ tree, view, editArticle: !!((_a = props.capabilities) === null || _a === void 0 ? void 0 : _a.editArticle) });
|
|
45
34
|
}
|
|
46
35
|
else {
|
|
@@ -14,21 +14,14 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import OutlineIconManuscript from '@manuscripts/assets/react/OutlineIconManuscript';
|
|
17
|
-
import {
|
|
18
|
-
import { nodeTitlePlaceholder } from '@manuscripts/transform';
|
|
17
|
+
import { nodeTitle } from '@manuscripts/transform';
|
|
19
18
|
import React from 'react';
|
|
20
|
-
import { Outline, OutlineItem, OutlineItemArrow, OutlineItemIcon, OutlineItemLink, OutlineItemLinkText,
|
|
21
|
-
const
|
|
22
|
-
const node = parse(value, {
|
|
23
|
-
topNode: schema.nodes.title.create(),
|
|
24
|
-
});
|
|
25
|
-
return node.textContent;
|
|
26
|
-
};
|
|
27
|
-
export const OutlineManuscript = ({ project, manuscript, }) => (React.createElement(Outline, null,
|
|
19
|
+
import { Outline, OutlineItem, OutlineItemArrow, OutlineItemIcon, OutlineItemLink, OutlineItemLinkText, StyledTriangleCollapsed, } from './Outline';
|
|
20
|
+
export const OutlineManuscript = ({ project, manuscript, doc, }) => (React.createElement(Outline, null,
|
|
28
21
|
React.createElement(OutlineItem, { isSelected: false, depth: 0 },
|
|
29
22
|
React.createElement(OutlineItemLink, { to: `/projects/${project._id}/manuscripts/${manuscript._id}` },
|
|
30
23
|
React.createElement(OutlineItemArrow, null,
|
|
31
24
|
React.createElement(StyledTriangleCollapsed, null)),
|
|
32
25
|
React.createElement(OutlineItemIcon, null,
|
|
33
26
|
React.createElement(OutlineIconManuscript, null)),
|
|
34
|
-
React.createElement(OutlineItemLinkText, { className: 'outline-text-title' },
|
|
27
|
+
React.createElement(OutlineItemLinkText, { className: 'outline-text-title' }, nodeTitle(doc))))));
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import 'prosemirror-gapcursor/style/gapcursor.css';
|
|
17
17
|
import 'prosemirror-tables/style/tables.css';
|
|
18
|
+
import { collab } from 'prosemirror-collab';
|
|
18
19
|
import { dropCursor } from 'prosemirror-dropcursor';
|
|
19
20
|
import { history } from 'prosemirror-history';
|
|
20
21
|
import { tableEditing } from 'prosemirror-tables';
|
|
@@ -37,7 +38,7 @@ import tracking_mark from '../plugins/tracking-mark';
|
|
|
37
38
|
import rules from '../rules';
|
|
38
39
|
export default (props) => {
|
|
39
40
|
const plugins = props.plugins || [];
|
|
40
|
-
|
|
41
|
+
const allPlugins = [
|
|
41
42
|
rules,
|
|
42
43
|
...keys,
|
|
43
44
|
dropCursor(),
|
|
@@ -60,6 +61,10 @@ export default (props) => {
|
|
|
60
61
|
track_changes_ui(props),
|
|
61
62
|
tracking_mark(),
|
|
62
63
|
];
|
|
64
|
+
if (props.collabProvider) {
|
|
65
|
+
allPlugins.push(collab({ version: props.collabProvider.currentVersion }));
|
|
66
|
+
}
|
|
67
|
+
return allPlugins;
|
|
63
68
|
};
|
|
64
69
|
document.execCommand('enableObjectResizing', false, 'false');
|
|
65
70
|
document.execCommand('enableInlineTableEditing', false, 'false');
|
|
@@ -18,6 +18,7 @@ import bibliographyItem from '../views/bibliography_item_editable';
|
|
|
18
18
|
import blockquoteElement from '../views/blockquote_element_editable';
|
|
19
19
|
import bulletList from '../views/bullet_list_editable';
|
|
20
20
|
import citation from '../views/citation_editable';
|
|
21
|
+
import contributorsSection from '../views/contributors_section';
|
|
21
22
|
import crossReference from '../views/cross_reference_editable';
|
|
22
23
|
import equation from '../views/equation_editable';
|
|
23
24
|
import equationElement from '../views/equation_element_editable';
|
|
@@ -41,15 +42,18 @@ import pullquoteElement from '../views/pullquote_element_editable';
|
|
|
41
42
|
import sectionLabel from '../views/section_label';
|
|
42
43
|
import sectionTitle from '../views/section_title_editable';
|
|
43
44
|
import tableElement from '../views/table_element_editable';
|
|
45
|
+
import title from '../views/title_editable';
|
|
44
46
|
import tocElement from '../views/toc_element_editable';
|
|
45
47
|
export default (props, dispatch) => {
|
|
46
48
|
return {
|
|
49
|
+
title: title(props, dispatch),
|
|
47
50
|
bibliography_item: bibliographyItem(props),
|
|
48
51
|
bibliography_element: bibliographyElement(props),
|
|
49
52
|
blockquote_element: blockquoteElement(props),
|
|
50
53
|
bullet_list: bulletList(props),
|
|
51
54
|
citation: citation(props),
|
|
52
55
|
cross_reference: crossReference(props),
|
|
56
|
+
contributors_section: contributorsSection(props, dispatch),
|
|
53
57
|
equation: equation(props),
|
|
54
58
|
equation_element: equationElement(props),
|
|
55
59
|
figure: figure(props, dispatch),
|
package/dist/es/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export { OutlineItemIcon } from './components/outline/Outline';
|
|
|
22
22
|
export { OutlineManuscript } from './components/outline/OutlineManuscript';
|
|
23
23
|
export { ManuscriptToolbar, } from './components/toolbar/ManuscriptToolbar';
|
|
24
24
|
export { default as getMenus } from './menus';
|
|
25
|
+
export { CollabProvider } from './classes/collabProvider';
|
|
25
26
|
export { PopperManager } from './lib/popper';
|
|
26
27
|
export { toolbar } from './toolbar';
|
|
27
28
|
export * from './plugins/highlight';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
export const useDoWithDebounce = () => {
|
|
3
|
+
const debounced = useRef(() => undefined);
|
|
4
|
+
const timeout = useRef();
|
|
5
|
+
const doWithDebounce = (fn, interval = 1000, flush = false) => {
|
|
6
|
+
debounced.current = fn;
|
|
7
|
+
if (flush) {
|
|
8
|
+
fn();
|
|
9
|
+
debounced.current = () => undefined;
|
|
10
|
+
window.clearTimeout(timeout.current);
|
|
11
|
+
}
|
|
12
|
+
window.clearTimeout(timeout.current);
|
|
13
|
+
timeout.current = window.setTimeout(() => {
|
|
14
|
+
debounced.current();
|
|
15
|
+
timeout.current = 0;
|
|
16
|
+
}, interval);
|
|
17
|
+
};
|
|
18
|
+
return doWithDebounce;
|
|
19
|
+
};
|
|
@@ -23,11 +23,11 @@ import SectionIcon from '@manuscripts/assets/react/OutlineIconSection';
|
|
|
23
23
|
import TableIcon from '@manuscripts/assets/react/OutlineIconTable';
|
|
24
24
|
import BulletListIcon from '@manuscripts/assets/react/OutlineIconUnorderedList';
|
|
25
25
|
import { BlockQuoteIcon, PullQuoteIcon } from '@manuscripts/style-guide';
|
|
26
|
-
import { schema as titleSchema } from '@manuscripts/title-editor';
|
|
27
26
|
import { schema } from '@manuscripts/transform';
|
|
28
27
|
import React from 'react';
|
|
29
28
|
const { nodes } = schema;
|
|
30
29
|
const icons = new Map([
|
|
30
|
+
[nodes.manuscript, ManuscriptIcon],
|
|
31
31
|
[nodes.bibliography_section, SectionIcon],
|
|
32
32
|
[nodes.blockquote_element, BlockQuoteIcon],
|
|
33
33
|
[nodes.bullet_list, BulletListIcon],
|
|
@@ -46,9 +46,6 @@ const icons = new Map([
|
|
|
46
46
|
[nodes.footnotes_section, SectionIcon],
|
|
47
47
|
]);
|
|
48
48
|
export const nodeTypeIcon = (nodeType) => {
|
|
49
|
-
if (nodeType === titleSchema.nodes.title) {
|
|
50
|
-
return React.createElement(ManuscriptIcon, null);
|
|
51
|
-
}
|
|
52
49
|
const Icon = icons.get(nodeType);
|
|
53
50
|
return Icon ? React.createElement(Icon, null) : null;
|
|
54
51
|
};
|
package/dist/es/useEditor.js
CHANGED
|
@@ -13,22 +13,61 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
import { trackChangesPluginKey, TrackChangesStatus, } from '@manuscripts/track-changes-plugin';
|
|
26
|
+
import { getVersion, receiveTransaction, sendableSteps, } from 'prosemirror-collab';
|
|
16
27
|
import { NodeSelection, TextSelection, } from 'prosemirror-state';
|
|
17
28
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
18
29
|
import { useHistory } from 'react-router-dom';
|
|
30
|
+
import { useDoWithDebounce } from './lib/use-do-with-debounce';
|
|
19
31
|
import { bibliographyKey } from './plugins/bibliography';
|
|
20
|
-
const useEditor = (initialState, createView) => {
|
|
32
|
+
const useEditor = (initialState, createView, editorProps) => {
|
|
21
33
|
const view = useRef();
|
|
22
34
|
const [state, setState] = useState(initialState);
|
|
23
35
|
const [viewElement, setViewElement] = useState(null);
|
|
24
36
|
const history = useHistory();
|
|
37
|
+
const { collabProvider } = editorProps;
|
|
38
|
+
if (collabProvider) {
|
|
39
|
+
collabProvider.onNewSteps((newVersion, steps, clientIDs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
if (state && view.current) {
|
|
41
|
+
const localVersion = getVersion(view.current.state);
|
|
42
|
+
const since = yield collabProvider.stepsSince(localVersion);
|
|
43
|
+
if ((since === null || since === void 0 ? void 0 : since.steps) && since.clientIDs) {
|
|
44
|
+
view.current.dispatch(receiveTransaction(view.current.state, since === null || since === void 0 ? void 0 : since.steps, since.clientIDs));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
console.warn('Inconsistent new steps event from the authority.');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
const debounce = useDoWithDebounce();
|
|
25
53
|
const dispatch = useCallback((tr) => {
|
|
26
54
|
if (!view.current) {
|
|
27
55
|
return state;
|
|
28
56
|
}
|
|
29
57
|
const nextState = view.current.state.apply(tr);
|
|
30
58
|
view.current.updateState(nextState);
|
|
31
|
-
|
|
59
|
+
const trackState = trackChangesPluginKey.getState(view.current.state);
|
|
60
|
+
if (collabProvider &&
|
|
61
|
+
trackState &&
|
|
62
|
+
trackState.status !== TrackChangesStatus.viewSnapshots) {
|
|
63
|
+
const sendable = sendableSteps(nextState);
|
|
64
|
+
if (sendable) {
|
|
65
|
+
collabProvider.sendSteps(sendable.version, sendable.steps, sendable.clientID);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
debounce(() => {
|
|
69
|
+
setState(nextState);
|
|
70
|
+
}, 1000, !tr.isGeneric);
|
|
32
71
|
return state;
|
|
33
72
|
}, []);
|
|
34
73
|
const replaceView = (state, createView) => {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseNodeView } from './base_node_view';
|
|
2
|
+
import { createNodeView } from './creators';
|
|
3
|
+
import ReactSubView from './ReactSubView';
|
|
4
|
+
export class ContributorsSectionView extends BaseNodeView {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.initialise = () => {
|
|
8
|
+
this.createDOM();
|
|
9
|
+
};
|
|
10
|
+
this.createDOM = () => {
|
|
11
|
+
this.dom = document.createElement('div');
|
|
12
|
+
this.dom.classList.add('contributors');
|
|
13
|
+
const can = this.props.getCapabilities();
|
|
14
|
+
const { components: { MetadataContainer }, subscribeStore, } = this.props;
|
|
15
|
+
this.metadata = ReactSubView(this.props, MetadataContainer, {
|
|
16
|
+
allowInvitingAuthors: false,
|
|
17
|
+
showAuthorEditButton: true,
|
|
18
|
+
disableEditButton: !can.editMetadata,
|
|
19
|
+
subscribe: subscribeStore,
|
|
20
|
+
}, this.node, this.getPos, this.view, 'metadata-container');
|
|
21
|
+
if (this.metadata) {
|
|
22
|
+
this.dom.appendChild(this.metadata);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
this.ignoreMutation = () => true;
|
|
26
|
+
this.stopEvent = () => true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export default createNodeView(ContributorsSectionView);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { BaseNodeView } from './base_node_view';
|
|
17
|
+
import { createNodeView } from './creators';
|
|
18
|
+
export class TitleView extends BaseNodeView {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.initialise = () => {
|
|
22
|
+
this.createDOM();
|
|
23
|
+
};
|
|
24
|
+
this.createDOM = () => {
|
|
25
|
+
this.dom = document.createElement('div');
|
|
26
|
+
this.dom.classList.add('manuscript-title');
|
|
27
|
+
this.contentDOM = document.createElement('div');
|
|
28
|
+
this.contentDOM.classList.add('article-titles');
|
|
29
|
+
this.dom.appendChild(this.contentDOM);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export default createNodeView(TitleView);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { createEditableNodeView } from './creators';
|
|
17
|
+
import { TitleView } from './title';
|
|
18
|
+
export default createEditableNodeView(TitleView);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Step } from 'prosemirror-transform';
|
|
17
|
+
export declare abstract class CollabProvider {
|
|
18
|
+
currentVersion: number;
|
|
19
|
+
protected newStepsListener: (version: number, steps: Step[], clientIDs: number[]) => void;
|
|
20
|
+
abstract sendSteps(version: number, steps: readonly Step[], clientID: string | number): Promise<void>;
|
|
21
|
+
abstract onNewSteps(listener: CollabProvider['newStepsListener']): void;
|
|
22
|
+
abstract stepsSince(version: number): Promise<{
|
|
23
|
+
steps: Step[];
|
|
24
|
+
clientIDs: number[];
|
|
25
|
+
version: number;
|
|
26
|
+
} | undefined>;
|
|
27
|
+
}
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Manuscript, Project } from '@manuscripts/json-schema';
|
|
17
|
+
import { ManuscriptNode } from '@manuscripts/transform';
|
|
17
18
|
import React from 'react';
|
|
18
19
|
interface Props {
|
|
19
20
|
project: Project;
|
|
20
21
|
manuscript: Manuscript;
|
|
22
|
+
doc: ManuscriptNode;
|
|
21
23
|
}
|
|
22
24
|
export declare const OutlineManuscript: React.FunctionComponent<Props>;
|
|
23
25
|
export {};
|
|
@@ -22,6 +22,7 @@ import { History } from 'history';
|
|
|
22
22
|
import { EditorState, Plugin } from 'prosemirror-state';
|
|
23
23
|
import React from 'react';
|
|
24
24
|
import { DefaultTheme } from 'styled-components';
|
|
25
|
+
import { CollabProvider } from '../classes/collabProvider';
|
|
25
26
|
import { PopperManager } from '../lib/popper';
|
|
26
27
|
import { CreateView } from '../useEditor';
|
|
27
28
|
export type CSLProps = {
|
|
@@ -64,6 +65,7 @@ export interface EditorProps {
|
|
|
64
65
|
environment?: string;
|
|
65
66
|
setCiteprocCitations: (citations: Map<string, string>) => void;
|
|
66
67
|
getCiteprocCitations: () => Map<string, string>;
|
|
68
|
+
collabProvider?: CollabProvider;
|
|
67
69
|
}
|
|
68
70
|
declare const _default: {
|
|
69
71
|
createState: (props: EditorProps) => EditorState;
|
|
@@ -20,6 +20,7 @@ import { CitationProvider } from '@manuscripts/library';
|
|
|
20
20
|
import { Capabilities } from '@manuscripts/style-guide';
|
|
21
21
|
import { Build, ManuscriptSchema } from '@manuscripts/transform';
|
|
22
22
|
import { Plugin } from 'prosemirror-state';
|
|
23
|
+
import { CollabProvider } from '../classes/collabProvider';
|
|
23
24
|
import { PopperManager } from '../lib/popper';
|
|
24
25
|
import { CSLProps } from './ManuscriptsEditor';
|
|
25
26
|
interface PluginProps {
|
|
@@ -37,6 +38,7 @@ interface PluginProps {
|
|
|
37
38
|
cslProps: CSLProps;
|
|
38
39
|
popper: PopperManager;
|
|
39
40
|
setCiteprocCitations: (citations: Map<string, string>) => void;
|
|
41
|
+
collabProvider?: CollabProvider;
|
|
40
42
|
}
|
|
41
43
|
declare const _default: (props: PluginProps) => any[];
|
|
42
44
|
export default _default;
|
|
@@ -23,6 +23,7 @@ type EditorProps = EditableBlockProps & CitationEditableProps & FigureProps & Ke
|
|
|
23
23
|
theme: DefaultTheme;
|
|
24
24
|
};
|
|
25
25
|
declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
26
|
+
title: import("../types").NodeViewCreator<import("../views/title").TitleView<any>>;
|
|
26
27
|
bibliography_item: import("../types").NodeViewCreator<import("../views/bibliography_item").BibliographyItemView<any>>;
|
|
27
28
|
bibliography_element: import("../types").NodeViewCreator<{
|
|
28
29
|
gutterButtons: () => HTMLElement[];
|
|
@@ -140,6 +141,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
140
141
|
} & import("../views/bullet_list").BulletListView<any>>;
|
|
141
142
|
citation: import("../types").NodeViewCreator<import("../views/citation_editable").CitationEditableView>;
|
|
142
143
|
cross_reference: import("../types").NodeViewCreator<import("../views/cross_reference_editable").CrossReferenceEditableView>;
|
|
144
|
+
contributors_section: import("../types").NodeViewCreator<import("../views/contributors_section").ContributorsSectionView<any>>;
|
|
143
145
|
equation: import("../types").NodeViewCreator<import("../views/equation_editable").EquationEditableView>;
|
|
144
146
|
equation_element: import("../types").NodeViewCreator<{
|
|
145
147
|
gutterButtons: () => HTMLElement[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { OutlineManuscript } from './components/outline/OutlineManuscript';
|
|
|
23
23
|
export { ManuscriptToolbar, ToolbarButtonConfig, } from './components/toolbar/ManuscriptToolbar';
|
|
24
24
|
export { default as getMenus } from './menus';
|
|
25
25
|
export { ChangeReceiver } from './types';
|
|
26
|
+
export { CollabProvider } from './classes/collabProvider';
|
|
26
27
|
export { PopperManager } from './lib/popper';
|
|
27
28
|
export { toolbar } from './toolbar';
|
|
28
29
|
export * from './plugins/highlight';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDoWithDebounce: () => (fn: () => void, interval?: number, flush?: boolean) => void;
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Command, EditorState, Transaction } from 'prosemirror-state';
|
|
17
17
|
import { EditorView } from 'prosemirror-view';
|
|
18
|
+
import { EditorProps } from './configs/ManuscriptsEditor';
|
|
18
19
|
export type CreateView = (element: HTMLDivElement, state: EditorState, dispatch: (tr: Transaction) => EditorState) => EditorView;
|
|
19
|
-
declare const useEditor: (initialState: EditorState, createView: CreateView) => {
|
|
20
|
+
declare const useEditor: (initialState: EditorState, createView: CreateView, editorProps: EditorProps) => {
|
|
20
21
|
state: EditorState;
|
|
21
22
|
onRender: (el: HTMLDivElement | null) => void;
|
|
22
23
|
isCommandValid: (command: Command) => boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ManuscriptNodeView } from '@manuscripts/transform';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseNodeView } from './base_node_view';
|
|
4
|
+
import { EditableBlockProps } from './editable_block';
|
|
5
|
+
export interface ContributorsSectionProps extends EditableBlockProps {
|
|
6
|
+
components: Record<string, React.ComponentType<unknown>>;
|
|
7
|
+
subscribeStore: unknown;
|
|
8
|
+
}
|
|
9
|
+
export declare class ContributorsSectionView<PropsType extends ContributorsSectionProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
|
|
10
|
+
private metadata;
|
|
11
|
+
initialise: () => void;
|
|
12
|
+
protected createDOM: () => void;
|
|
13
|
+
ignoreMutation: () => boolean;
|
|
14
|
+
stopEvent: () => boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: (props: import("./base_node_view").BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<ContributorsSectionView<any>>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { ManuscriptNodeView } from '@manuscripts/transform';
|
|
17
|
+
import { BaseNodeProps, BaseNodeView } from './base_node_view';
|
|
18
|
+
export declare class TitleView<PropsType extends BaseNodeProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
|
|
19
|
+
contentDOM: HTMLElement;
|
|
20
|
+
initialise: () => void;
|
|
21
|
+
protected createDOM: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: (props: BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<TitleView<any>>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { TitleView } from './title';
|
|
17
|
+
declare const _default: (props: import("./editable_block").EditableBlockProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<TitleView<any>>;
|
|
18
|
+
export default _default;
|
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.5.
|
|
4
|
+
"version": "1.5.9-LEAN-2702",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@iarna/word-count": "^1.1.2",
|
|
30
30
|
"@manuscripts/assets": "^0.6.4",
|
|
31
|
-
"@manuscripts/json-schema": "
|
|
32
|
-
"@manuscripts/library": "1.2.
|
|
33
|
-
"@manuscripts/style-guide": "
|
|
31
|
+
"@manuscripts/json-schema": "2.2.1",
|
|
32
|
+
"@manuscripts/library": "1.2.2",
|
|
33
|
+
"@manuscripts/style-guide": "1.4.5",
|
|
34
34
|
"@manuscripts/title-editor": "^1.1.0",
|
|
35
35
|
"@manuscripts/track-changes-plugin": "^1.7.3",
|
|
36
|
-
"@manuscripts/transform": "1.5.
|
|
36
|
+
"@manuscripts/transform": "1.5.4",
|
|
37
37
|
"astrocite-eutils": "^0.16.4",
|
|
38
38
|
"axios": "^1.2.2",
|
|
39
39
|
"codemirror": "^5.58.1",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"lodash-es": "^4.17.21",
|
|
45
45
|
"popper.js": "^1.16.1",
|
|
46
46
|
"pretty-bytes": "^6.0.0",
|
|
47
|
+
"prosemirror-collab": "^1.3.1",
|
|
47
48
|
"prosemirror-commands": "^1.5.0",
|
|
48
49
|
"prosemirror-dropcursor": "^1.6.1",
|
|
49
50
|
"prosemirror-history": "^1.3.0",
|
|
@@ -70,8 +71,8 @@
|
|
|
70
71
|
"@babel/preset-env": "^7.20.2",
|
|
71
72
|
"@babel/preset-react": "^7.18.6",
|
|
72
73
|
"@babel/preset-typescript": "^7.18.6",
|
|
73
|
-
"@manuscripts/eslint-config": "^0.5.1",
|
|
74
74
|
"@inline-svg-unique-id/react": "^1.2.3",
|
|
75
|
+
"@manuscripts/eslint-config": "^0.5.1",
|
|
75
76
|
"@types/codemirror": "^5.60.5",
|
|
76
77
|
"@types/dompurify": "^2.4.0",
|
|
77
78
|
"@types/enzyme": "^3.10.12",
|
|
@@ -730,3 +730,27 @@ Next levels are shifted 'up' by 1
|
|
|
730
730
|
.citation-wrapper:hover .track-changes-review {
|
|
731
731
|
display: inline-block;
|
|
732
732
|
}
|
|
733
|
+
|
|
734
|
+
.contributors {
|
|
735
|
+
white-space: initial;
|
|
736
|
+
margin-bottom: 24px;
|
|
737
|
+
margin-top: 24px;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.contributors .tools-panel {
|
|
741
|
+
position: initial;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.contributors table {
|
|
745
|
+
line-height: initial;
|
|
746
|
+
width: inherit;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.contributors tr th, .contributors tr td {
|
|
750
|
+
border: none !important;
|
|
751
|
+
background: none !important;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.contributors th, .contributors td {
|
|
755
|
+
padding: initial;
|
|
756
|
+
}
|
package/styles/Editor.css
CHANGED