@manuscripts/body-editor 2.2.2-LEAN-4012.1 → 2.2.2-LEAN-3966.0
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 +15 -35
- package/dist/cjs/components/authors/AuthorsModal.js +4 -0
- package/dist/cjs/components/keywords/AddKeywordInline.js +2 -2
- package/dist/cjs/plugins/toc.js +1 -2
- package/dist/cjs/versions.js +1 -1
- package/dist/es/commands.js +16 -35
- package/dist/es/components/authors/AuthorsModal.js +4 -0
- package/dist/es/components/keywords/AddKeywordInline.js +1 -1
- package/dist/es/plugins/toc.js +2 -3
- package/dist/es/versions.js +1 -1
- package/dist/types/commands.d.ts +0 -1
- package/dist/types/versions.d.ts +1 -1
- package/package.json +2 -2
package/dist/cjs/commands.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.autoComplete = exports.mergeCellsWithSpace = exports.addColumns = exports.addRows = exports.insertTableFootnote = exports.addInlineComment = exports.addNodeComment = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreMetaNodeBackspaceCommand = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.insertTOCSection = exports.insertBibliographySection = exports.insertList = exports.insertKeywords = exports.insertContributors = exports.insertAbstract = exports.insertBackMatterSection = exports.insertSection = exports.insertGraphicalAbstract = exports.insertInlineFootnote = exports.insertFootnote = exports.createFootnote = exports.insertInlineEquation = exports.insertCrossReference = exports.insertInlineCitation = exports.insertLink = exports.insertSectionLabel = exports.findPosBeforeFirstSubsection = exports.insertBreak = exports.deleteBlock = exports.insertBlock = exports.insertSupplement = exports.insertTable = exports.insertFigure = exports.insertGeneralFootnote = exports.
|
|
18
|
+
exports.autoComplete = exports.mergeCellsWithSpace = exports.addColumns = exports.addRows = exports.insertTableFootnote = exports.addInlineComment = exports.addNodeComment = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreMetaNodeBackspaceCommand = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.insertTOCSection = exports.insertBibliographySection = exports.insertList = exports.insertKeywords = exports.insertContributors = exports.insertAbstract = exports.insertBackMatterSection = exports.insertSection = exports.insertGraphicalAbstract = exports.insertInlineFootnote = exports.insertFootnote = exports.createFootnote = exports.insertInlineEquation = exports.insertCrossReference = exports.insertInlineCitation = exports.insertLink = exports.insertSectionLabel = exports.findPosBeforeFirstSubsection = exports.insertBreak = exports.deleteBlock = exports.insertBlock = exports.insertSupplement = exports.insertTable = exports.insertFigure = exports.insertGeneralFootnote = exports.createBlock = exports.createSelection = exports.canInsert = exports.blockActive = exports.isNodeSelection = exports.markActive = void 0;
|
|
19
19
|
const json_schema_1 = require("@manuscripts/json-schema");
|
|
20
20
|
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
21
21
|
const transform_1 = require("@manuscripts/transform");
|
|
@@ -131,11 +131,6 @@ const createBlock = (nodeType, position, state, dispatch, attrs) => {
|
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
exports.createBlock = createBlock;
|
|
134
|
-
const undoFootnoteDelete = (tr, footnote, position) => {
|
|
135
|
-
const updatedAttrs = Object.assign(Object.assign({}, footnote.node.attrs), { dataTracked: null });
|
|
136
|
-
tr.setNodeMarkup(position, undefined, updatedAttrs, footnote.node.marks);
|
|
137
|
-
};
|
|
138
|
-
exports.undoFootnoteDelete = undoFootnoteDelete;
|
|
139
134
|
const insertGeneralFootnote = (tableElementNode, position, view, tableElementFooter) => {
|
|
140
135
|
const { state, dispatch } = view;
|
|
141
136
|
const paragraph = state.schema.nodes.paragraph.create({
|
|
@@ -154,16 +149,11 @@ const insertGeneralFootnote = (tableElementNode, position, view, tableElementFoo
|
|
|
154
149
|
? table.pos + table.node.nodeSize
|
|
155
150
|
: tableColGroup.pos + tableColGroup.node.nodeSize);
|
|
156
151
|
if (tableElementFooter === null || tableElementFooter === void 0 ? void 0 : tableElementFooter.length) {
|
|
157
|
-
if ((0, track_changes_utils_1.isDeleted)(tableElementFooter[0].node) ||
|
|
158
|
-
(0, track_changes_utils_1.isRejectedInsert)(tableElementFooter[0].node)) {
|
|
159
|
-
const tableElementFooterPos = tr.mapping.map(position + tableElementFooter[0].pos + 1);
|
|
160
|
-
(0, exports.undoFootnoteDelete)(tr, tableElementFooter[0], tableElementFooterPos);
|
|
161
|
-
}
|
|
162
152
|
tr.insert(pos, generalNote);
|
|
163
153
|
}
|
|
164
154
|
else {
|
|
165
155
|
const tableElementFooter = transform_1.schema.nodes.table_element_footer.create({
|
|
166
|
-
id: (0, transform_1.
|
|
156
|
+
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.table_element_footer),
|
|
167
157
|
}, [generalNote]);
|
|
168
158
|
tr.insert(pos, tableElementFooter);
|
|
169
159
|
}
|
|
@@ -333,8 +323,8 @@ const insertLink = (state, dispatch) => {
|
|
|
333
323
|
};
|
|
334
324
|
exports.insertLink = insertLink;
|
|
335
325
|
const insertInlineCitation = (state, dispatch) => {
|
|
336
|
-
const node =
|
|
337
|
-
id: (0, transform_1.
|
|
326
|
+
const node = transform_1.schema.nodes.citation.create({
|
|
327
|
+
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.citation),
|
|
338
328
|
rids: [],
|
|
339
329
|
selectedText: selectedText(),
|
|
340
330
|
});
|
|
@@ -375,8 +365,8 @@ const insertInlineEquation = (state, dispatch) => {
|
|
|
375
365
|
};
|
|
376
366
|
exports.insertInlineEquation = insertInlineEquation;
|
|
377
367
|
const createFootnote = (state, kind) => {
|
|
378
|
-
return
|
|
379
|
-
id: (0, transform_1.
|
|
368
|
+
return transform_1.schema.nodes.footnote.createAndFill({
|
|
369
|
+
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.footnote),
|
|
380
370
|
kind,
|
|
381
371
|
});
|
|
382
372
|
};
|
|
@@ -408,10 +398,8 @@ const insertFootnote = (state, tr, footnote) => {
|
|
|
408
398
|
else {
|
|
409
399
|
const footnoteElement = (0, prosemirror_utils_1.findChildrenByType)(footnotesSection.node, transform_1.schema.nodes.footnotes_element).pop();
|
|
410
400
|
if (footnoteElement) {
|
|
411
|
-
if ((0, track_changes_utils_1.isDeleted)(footnoteElement.node)
|
|
412
|
-
(0, track_changes_utils_1.isRejectedInsert)(footnoteElement.node)) {
|
|
401
|
+
if ((0, track_changes_utils_1.isDeleted)(footnoteElement.node)) {
|
|
413
402
|
const footnoteElementPos = footnotesSection.pos + footnoteElement.pos + 1;
|
|
414
|
-
(0, exports.undoFootnoteDelete)(tr, footnoteElement, footnoteElementPos);
|
|
415
403
|
const updatedAttrs = Object.assign(Object.assign({}, footnoteElement.node.attrs), { dataTracked: null });
|
|
416
404
|
tr.setNodeMarkup(footnoteElementPos, undefined, updatedAttrs, footnoteElement.node.marks);
|
|
417
405
|
}
|
|
@@ -913,7 +901,7 @@ const addNodeComment = (node, state, dispatch) => {
|
|
|
913
901
|
const props = (0, editor_props_1.getEditorProps)(state);
|
|
914
902
|
const contribution = (0, json_schema_1.buildContribution)(props.userID);
|
|
915
903
|
const attrs = {
|
|
916
|
-
id: (0, transform_1.
|
|
904
|
+
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.comment),
|
|
917
905
|
contents: '',
|
|
918
906
|
target: node.attrs.id,
|
|
919
907
|
contributions: [contribution],
|
|
@@ -944,7 +932,7 @@ const addInlineComment = (state, dispatch) => {
|
|
|
944
932
|
const props = (0, editor_props_1.getEditorProps)(state);
|
|
945
933
|
const contribution = (0, json_schema_1.buildContribution)(props.userID);
|
|
946
934
|
const attrs = {
|
|
947
|
-
id: (0, transform_1.
|
|
935
|
+
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.comment),
|
|
948
936
|
contents: '',
|
|
949
937
|
target: node.attrs.id,
|
|
950
938
|
contributions: [contribution],
|
|
@@ -989,8 +977,8 @@ exports.addInlineComment = addInlineComment;
|
|
|
989
977
|
const insertTableFootnote = (tableElementNode, position, view, inlineFootnote) => {
|
|
990
978
|
const { state, dispatch } = view;
|
|
991
979
|
const tr = state.tr;
|
|
992
|
-
const footnote =
|
|
993
|
-
id: (0, transform_1.
|
|
980
|
+
const footnote = transform_1.schema.nodes.footnote.createAndFill({
|
|
981
|
+
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.footnote),
|
|
994
982
|
kind: 'footnote',
|
|
995
983
|
});
|
|
996
984
|
const insertedAt = state.selection.to;
|
|
@@ -1015,12 +1003,9 @@ const insertTableFootnote = (tableElementNode, position, view, inlineFootnote) =
|
|
|
1015
1003
|
}
|
|
1016
1004
|
let insertionPos = position;
|
|
1017
1005
|
const footnotesElement = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.footnotes_element).pop();
|
|
1018
|
-
if (footnotesElement
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
const footnotesElementPos = tr.mapping.map(position + footnotesElement.pos + 1);
|
|
1022
|
-
(0, exports.undoFootnoteDelete)(tr, footnotesElement, footnotesElementPos);
|
|
1023
|
-
}
|
|
1006
|
+
if (footnotesElement &&
|
|
1007
|
+
!(0, track_changes_utils_1.isDeleted)(footnotesElement.node) &&
|
|
1008
|
+
!(0, track_changes_utils_1.isRejectedInsert)(footnotesElement.node)) {
|
|
1024
1009
|
const footnotePos = (0, footnotes_1.getNewFootnotePos)(footnotesElement, footnoteIndex);
|
|
1025
1010
|
insertionPos = tr.mapping.map(position + footnotePos);
|
|
1026
1011
|
tr.insert(insertionPos, footnote);
|
|
@@ -1029,18 +1014,13 @@ const insertTableFootnote = (tableElementNode, position, view, inlineFootnote) =
|
|
|
1029
1014
|
const footnoteElement = state.schema.nodes.footnotes_element.create({}, footnote);
|
|
1030
1015
|
const tableElementFooter = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.table_element_footer)[0];
|
|
1031
1016
|
if (tableElementFooter) {
|
|
1032
|
-
if ((0, track_changes_utils_1.isDeleted)(tableElementFooter.node) ||
|
|
1033
|
-
(0, track_changes_utils_1.isRejectedInsert)(tableElementFooter.node)) {
|
|
1034
|
-
const tableElementFooterPos = tr.mapping.map(position + tableElementFooter.pos + 1);
|
|
1035
|
-
(0, exports.undoFootnoteDelete)(tr, tableElementFooter, tableElementFooterPos);
|
|
1036
|
-
}
|
|
1037
1017
|
const pos = tableElementFooter.pos;
|
|
1038
1018
|
insertionPos = position + pos + tableElementFooter.node.nodeSize;
|
|
1039
1019
|
tr.insert(tr.mapping.map(insertionPos), footnoteElement);
|
|
1040
1020
|
}
|
|
1041
1021
|
else {
|
|
1042
1022
|
const tableElementFooter = transform_1.schema.nodes.table_element_footer.create({
|
|
1043
|
-
id: (0, transform_1.
|
|
1023
|
+
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.table_element_footer),
|
|
1044
1024
|
}, [footnoteElement]);
|
|
1045
1025
|
const tableColGroup = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.table_colgroup)[0];
|
|
1046
1026
|
const table = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.table)[0];
|
|
@@ -93,6 +93,8 @@ const normalize = (author) => ({
|
|
|
93
93
|
isJointContributor: author.isJointContributor || false,
|
|
94
94
|
userID: '',
|
|
95
95
|
invitationID: '',
|
|
96
|
+
footnote: author.footnote || [],
|
|
97
|
+
corresp: author.corresp || [],
|
|
96
98
|
});
|
|
97
99
|
const AuthorsModal = ({ authors: $authors, affiliations: $affiliations, author, onSaveAuthor, onDeleteAuthor, onSaveAffiliation, }) => {
|
|
98
100
|
const [isOpen, setOpen] = (0, react_1.useState)(true);
|
|
@@ -162,6 +164,8 @@ const AuthorsModal = ({ authors: $authors, affiliations: $affiliations, author,
|
|
|
162
164
|
isJointContributor: false,
|
|
163
165
|
userID: '',
|
|
164
166
|
invitationID: '',
|
|
167
|
+
corresp: [],
|
|
168
|
+
footnote: [],
|
|
165
169
|
};
|
|
166
170
|
onSaveAuthor(author);
|
|
167
171
|
setSelection(author);
|
|
@@ -27,8 +27,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.AddKeywordInline = void 0;
|
|
30
|
+
const json_schema_1 = require("@manuscripts/json-schema");
|
|
30
31
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
31
|
-
const transform_1 = require("@manuscripts/transform");
|
|
32
32
|
const react_1 = __importStar(require("react"));
|
|
33
33
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
34
34
|
const track_changes_utils_1 = require("../../lib/track-changes-utils");
|
|
@@ -130,7 +130,7 @@ const AddKeywordInline = ({ viewProps, getUpdatedNode }) => {
|
|
|
130
130
|
setNewKeyword('');
|
|
131
131
|
};
|
|
132
132
|
const handleAddKeyword = () => {
|
|
133
|
-
const keyword = (0,
|
|
133
|
+
const keyword = (0, json_schema_1.buildKeyword)(newKeyword);
|
|
134
134
|
if (!isExistingKeyword() && isValidNewKeyword()) {
|
|
135
135
|
const node = getUpdatedNode();
|
|
136
136
|
const keywordNode = node.type.schema.nodes.keyword.create({
|
package/dist/cjs/plugins/toc.js
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.tocKey = void 0;
|
|
19
|
-
const json_schema_1 = require("@manuscripts/json-schema");
|
|
20
19
|
const transform_1 = require("@manuscripts/transform");
|
|
21
20
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
22
21
|
const utils_1 = require("../lib/utils");
|
|
@@ -67,7 +66,7 @@ exports.default = () => {
|
|
|
67
66
|
nodesToUpdate.push({
|
|
68
67
|
node,
|
|
69
68
|
pos,
|
|
70
|
-
id: node.attrs.id || (0, transform_1.
|
|
69
|
+
id: node.attrs.id || (0, transform_1.generateNodeID)(transform_1.schema.nodes.toc_element),
|
|
71
70
|
contents,
|
|
72
71
|
});
|
|
73
72
|
}
|
package/dist/cjs/versions.js
CHANGED
package/dist/es/commands.js
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { buildContribution
|
|
16
|
+
import { buildContribution } from '@manuscripts/json-schema';
|
|
17
17
|
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
|
18
|
-
import {
|
|
18
|
+
import { generateNodeID, isElementNodeType, isFootnoteNode, isListNode, isParagraphNode, isSectionNodeType, schema, } from '@manuscripts/transform';
|
|
19
19
|
import { Fragment, NodeRange, } from 'prosemirror-model';
|
|
20
20
|
import { wrapInList } from 'prosemirror-schema-list';
|
|
21
21
|
import { NodeSelection, TextSelection, } from 'prosemirror-state';
|
|
@@ -122,10 +122,6 @@ export const createBlock = (nodeType, position, state, dispatch, attrs) => {
|
|
|
122
122
|
dispatch(tr.setSelection(selection).scrollIntoView());
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
|
-
export const undoFootnoteDelete = (tr, footnote, position) => {
|
|
126
|
-
const updatedAttrs = Object.assign(Object.assign({}, footnote.node.attrs), { dataTracked: null });
|
|
127
|
-
tr.setNodeMarkup(position, undefined, updatedAttrs, footnote.node.marks);
|
|
128
|
-
};
|
|
129
125
|
export const insertGeneralFootnote = (tableElementNode, position, view, tableElementFooter) => {
|
|
130
126
|
const { state, dispatch } = view;
|
|
131
127
|
const paragraph = state.schema.nodes.paragraph.create({
|
|
@@ -144,16 +140,11 @@ export const insertGeneralFootnote = (tableElementNode, position, view, tableEle
|
|
|
144
140
|
? table.pos + table.node.nodeSize
|
|
145
141
|
: tableColGroup.pos + tableColGroup.node.nodeSize);
|
|
146
142
|
if (tableElementFooter === null || tableElementFooter === void 0 ? void 0 : tableElementFooter.length) {
|
|
147
|
-
if (isDeleted(tableElementFooter[0].node) ||
|
|
148
|
-
isRejectedInsert(tableElementFooter[0].node)) {
|
|
149
|
-
const tableElementFooterPos = tr.mapping.map(position + tableElementFooter[0].pos + 1);
|
|
150
|
-
undoFootnoteDelete(tr, tableElementFooter[0], tableElementFooterPos);
|
|
151
|
-
}
|
|
152
143
|
tr.insert(pos, generalNote);
|
|
153
144
|
}
|
|
154
145
|
else {
|
|
155
146
|
const tableElementFooter = schema.nodes.table_element_footer.create({
|
|
156
|
-
id:
|
|
147
|
+
id: generateNodeID(schema.nodes.table_element_footer),
|
|
157
148
|
}, [generalNote]);
|
|
158
149
|
tr.insert(pos, tableElementFooter);
|
|
159
150
|
}
|
|
@@ -313,8 +304,8 @@ export const insertLink = (state, dispatch) => {
|
|
|
313
304
|
return true;
|
|
314
305
|
};
|
|
315
306
|
export const insertInlineCitation = (state, dispatch) => {
|
|
316
|
-
const node =
|
|
317
|
-
id:
|
|
307
|
+
const node = schema.nodes.citation.create({
|
|
308
|
+
id: generateNodeID(schema.nodes.citation),
|
|
318
309
|
rids: [],
|
|
319
310
|
selectedText: selectedText(),
|
|
320
311
|
});
|
|
@@ -352,8 +343,8 @@ export const insertInlineEquation = (state, dispatch) => {
|
|
|
352
343
|
return true;
|
|
353
344
|
};
|
|
354
345
|
export const createFootnote = (state, kind) => {
|
|
355
|
-
return
|
|
356
|
-
id:
|
|
346
|
+
return schema.nodes.footnote.createAndFill({
|
|
347
|
+
id: generateNodeID(schema.nodes.footnote),
|
|
357
348
|
kind,
|
|
358
349
|
});
|
|
359
350
|
};
|
|
@@ -384,10 +375,8 @@ export const insertFootnote = (state, tr, footnote) => {
|
|
|
384
375
|
else {
|
|
385
376
|
const footnoteElement = findChildrenByType(footnotesSection.node, schema.nodes.footnotes_element).pop();
|
|
386
377
|
if (footnoteElement) {
|
|
387
|
-
if (isDeleted(footnoteElement.node)
|
|
388
|
-
isRejectedInsert(footnoteElement.node)) {
|
|
378
|
+
if (isDeleted(footnoteElement.node)) {
|
|
389
379
|
const footnoteElementPos = footnotesSection.pos + footnoteElement.pos + 1;
|
|
390
|
-
undoFootnoteDelete(tr, footnoteElement, footnoteElementPos);
|
|
391
380
|
const updatedAttrs = Object.assign(Object.assign({}, footnoteElement.node.attrs), { dataTracked: null });
|
|
392
381
|
tr.setNodeMarkup(footnoteElementPos, undefined, updatedAttrs, footnoteElement.node.marks);
|
|
393
382
|
}
|
|
@@ -870,7 +859,7 @@ export const addNodeComment = (node, state, dispatch) => {
|
|
|
870
859
|
const props = getEditorProps(state);
|
|
871
860
|
const contribution = buildContribution(props.userID);
|
|
872
861
|
const attrs = {
|
|
873
|
-
id:
|
|
862
|
+
id: generateNodeID(schema.nodes.comment),
|
|
874
863
|
contents: '',
|
|
875
864
|
target: node.attrs.id,
|
|
876
865
|
contributions: [contribution],
|
|
@@ -900,7 +889,7 @@ export const addInlineComment = (state, dispatch) => {
|
|
|
900
889
|
const props = getEditorProps(state);
|
|
901
890
|
const contribution = buildContribution(props.userID);
|
|
902
891
|
const attrs = {
|
|
903
|
-
id:
|
|
892
|
+
id: generateNodeID(schema.nodes.comment),
|
|
904
893
|
contents: '',
|
|
905
894
|
target: node.attrs.id,
|
|
906
895
|
contributions: [contribution],
|
|
@@ -944,8 +933,8 @@ export const addInlineComment = (state, dispatch) => {
|
|
|
944
933
|
export const insertTableFootnote = (tableElementNode, position, view, inlineFootnote) => {
|
|
945
934
|
const { state, dispatch } = view;
|
|
946
935
|
const tr = state.tr;
|
|
947
|
-
const footnote =
|
|
948
|
-
id:
|
|
936
|
+
const footnote = schema.nodes.footnote.createAndFill({
|
|
937
|
+
id: generateNodeID(schema.nodes.footnote),
|
|
949
938
|
kind: 'footnote',
|
|
950
939
|
});
|
|
951
940
|
const insertedAt = state.selection.to;
|
|
@@ -970,12 +959,9 @@ export const insertTableFootnote = (tableElementNode, position, view, inlineFoot
|
|
|
970
959
|
}
|
|
971
960
|
let insertionPos = position;
|
|
972
961
|
const footnotesElement = findChildrenByType(tableElementNode, schema.nodes.footnotes_element).pop();
|
|
973
|
-
if (footnotesElement
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
const footnotesElementPos = tr.mapping.map(position + footnotesElement.pos + 1);
|
|
977
|
-
undoFootnoteDelete(tr, footnotesElement, footnotesElementPos);
|
|
978
|
-
}
|
|
962
|
+
if (footnotesElement &&
|
|
963
|
+
!isDeleted(footnotesElement.node) &&
|
|
964
|
+
!isRejectedInsert(footnotesElement.node)) {
|
|
979
965
|
const footnotePos = getNewFootnotePos(footnotesElement, footnoteIndex);
|
|
980
966
|
insertionPos = tr.mapping.map(position + footnotePos);
|
|
981
967
|
tr.insert(insertionPos, footnote);
|
|
@@ -984,18 +970,13 @@ export const insertTableFootnote = (tableElementNode, position, view, inlineFoot
|
|
|
984
970
|
const footnoteElement = state.schema.nodes.footnotes_element.create({}, footnote);
|
|
985
971
|
const tableElementFooter = findChildrenByType(tableElementNode, schema.nodes.table_element_footer)[0];
|
|
986
972
|
if (tableElementFooter) {
|
|
987
|
-
if (isDeleted(tableElementFooter.node) ||
|
|
988
|
-
isRejectedInsert(tableElementFooter.node)) {
|
|
989
|
-
const tableElementFooterPos = tr.mapping.map(position + tableElementFooter.pos + 1);
|
|
990
|
-
undoFootnoteDelete(tr, tableElementFooter, tableElementFooterPos);
|
|
991
|
-
}
|
|
992
973
|
const pos = tableElementFooter.pos;
|
|
993
974
|
insertionPos = position + pos + tableElementFooter.node.nodeSize;
|
|
994
975
|
tr.insert(tr.mapping.map(insertionPos), footnoteElement);
|
|
995
976
|
}
|
|
996
977
|
else {
|
|
997
978
|
const tableElementFooter = schema.nodes.table_element_footer.create({
|
|
998
|
-
id:
|
|
979
|
+
id: generateNodeID(schema.nodes.table_element_footer),
|
|
999
980
|
}, [footnoteElement]);
|
|
1000
981
|
const tableColGroup = findChildrenByType(tableElementNode, schema.nodes.table_colgroup)[0];
|
|
1001
982
|
const table = findChildrenByType(tableElementNode, schema.nodes.table)[0];
|
|
@@ -64,6 +64,8 @@ const normalize = (author) => ({
|
|
|
64
64
|
isJointContributor: author.isJointContributor || false,
|
|
65
65
|
userID: '',
|
|
66
66
|
invitationID: '',
|
|
67
|
+
footnote: author.footnote || [],
|
|
68
|
+
corresp: author.corresp || [],
|
|
67
69
|
});
|
|
68
70
|
export const AuthorsModal = ({ authors: $authors, affiliations: $affiliations, author, onSaveAuthor, onDeleteAuthor, onSaveAffiliation, }) => {
|
|
69
71
|
const [isOpen, setOpen] = useState(true);
|
|
@@ -133,6 +135,8 @@ export const AuthorsModal = ({ authors: $authors, affiliations: $affiliations, a
|
|
|
133
135
|
isJointContributor: false,
|
|
134
136
|
userID: '',
|
|
135
137
|
invitationID: '',
|
|
138
|
+
corresp: [],
|
|
139
|
+
footnote: [],
|
|
136
140
|
};
|
|
137
141
|
onSaveAuthor(author);
|
|
138
142
|
setSelection(author);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { buildKeyword } from '@manuscripts/json-schema';
|
|
1
2
|
import { Category, Dialog, PlusIcon } from '@manuscripts/style-guide';
|
|
2
|
-
import { buildKeyword, } from '@manuscripts/transform';
|
|
3
3
|
import React, { useCallback, useEffect, useRef, useState, } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { isDeleted, isRejectedInsert } from '../../lib/track-changes-utils';
|
package/dist/es/plugins/toc.js
CHANGED
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { generateID, isSectionNodeType, isTOCSectionNode, schema, } from '@manuscripts/transform';
|
|
16
|
+
import { generateNodeID, isSectionNodeType, isTOCSectionNode, schema, } from '@manuscripts/transform';
|
|
18
17
|
import { NodeSelection, Plugin, PluginKey } from 'prosemirror-state';
|
|
19
18
|
import { iterateChildren } from '../lib/utils';
|
|
20
19
|
export const tocKey = new PluginKey('toc');
|
|
@@ -64,7 +63,7 @@ export default () => {
|
|
|
64
63
|
nodesToUpdate.push({
|
|
65
64
|
node,
|
|
66
65
|
pos,
|
|
67
|
-
id: node.attrs.id ||
|
|
66
|
+
id: node.attrs.id || generateNodeID(schema.nodes.toc_element),
|
|
68
67
|
contents,
|
|
69
68
|
});
|
|
70
69
|
}
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.2.2-LEAN-
|
|
1
|
+
export const VERSION = '2.2.2-LEAN-3966.0';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
package/dist/types/commands.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ export declare const blockActive: (type: ManuscriptNodeType) => (state: Manuscri
|
|
|
27
27
|
export declare const canInsert: (type: ManuscriptNodeType) => (state: ManuscriptEditorState) => boolean;
|
|
28
28
|
export declare const createSelection: (nodeType: ManuscriptNodeType, position: number, doc: ManuscriptNode) => Selection;
|
|
29
29
|
export declare const createBlock: (nodeType: ManuscriptNodeType, position: number, state: ManuscriptEditorState, dispatch?: Dispatch, attrs?: Attrs) => void;
|
|
30
|
-
export declare const undoFootnoteDelete: (tr: Transaction, footnote: NodeWithPos, position: number) => void;
|
|
31
30
|
export declare const insertGeneralFootnote: (tableElementNode: ManuscriptNode, position: number, view: ManuscriptEditorView, tableElementFooter?: NodeWithPos[]) => void;
|
|
32
31
|
export declare const insertFigure: (file: FileAttachment, state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
|
33
32
|
export declare const insertTable: (config: TableConfig, state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.2.2-LEAN-
|
|
1
|
+
export declare const VERSION = "2.2.2-LEAN-3966.0";
|
|
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.2-LEAN-
|
|
4
|
+
"version": "2.2.2-LEAN-3966.0",
|
|
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.19",
|
|
36
36
|
"@manuscripts/track-changes-plugin": "1.7.22",
|
|
37
|
-
"@manuscripts/transform": "2.6.
|
|
37
|
+
"@manuscripts/transform": "2.6.1-LEAN-3966.1",
|
|
38
38
|
"@popperjs/core": "^2.11.8",
|
|
39
39
|
"astrocite-eutils": "^0.16.4",
|
|
40
40
|
"codemirror": "^5.58.1",
|