@manuscripts/body-editor 3.12.4 → 3.12.6
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 +4 -5
- package/dist/cjs/components/affiliations/AffiliationsModal.js +1 -3
- package/dist/cjs/components/keywords/AddKeywordInline.js +2 -2
- package/dist/cjs/components/outline/DraggableTree.js +4 -4
- package/dist/cjs/components/toolbar/helpers.js +7 -13
- package/dist/cjs/components/toolbar/type-selector/TypeSelector.js +5 -5
- package/dist/cjs/components/views/FootnotesSelector.js +2 -2
- package/dist/cjs/lib/track-changes-utils.js +3 -140
- package/dist/cjs/lib/utils.js +1 -1
- package/dist/cjs/lib/view.js +2 -1
- package/dist/cjs/menus.js +2 -2
- package/dist/cjs/plugins/affiliations.js +2 -2
- package/dist/cjs/plugins/objects.js +3 -6
- package/dist/cjs/plugins/persist.js +2 -4
- package/dist/cjs/plugins/search-replace/lib.js +2 -2
- package/dist/cjs/plugins/section_category.js +10 -43
- package/dist/cjs/plugins/section_title/autocompletion.js +2 -2
- package/dist/cjs/plugins/section_title/index.js +2 -5
- package/dist/cjs/plugins/selected-suggestion.js +1 -2
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/affiliations.js +4 -4
- package/dist/cjs/views/award.js +2 -2
- package/dist/cjs/views/base_node_view.js +3 -3
- package/dist/cjs/views/bibliography_element.js +3 -3
- package/dist/cjs/views/block_view.js +2 -2
- package/dist/cjs/views/citation_editable.js +3 -3
- package/dist/cjs/views/contributors.js +4 -4
- package/dist/cjs/views/creators.js +2 -2
- package/dist/cjs/views/figure_editable.js +5 -5
- package/dist/cjs/views/footnote.js +5 -5
- package/dist/cjs/views/general_table_footnote.js +4 -4
- package/dist/cjs/views/inline_footnote.js +3 -3
- package/dist/cjs/views/keyword.js +2 -2
- package/dist/cjs/views/keyword_group.js +2 -2
- package/dist/cjs/views/link_editable.js +2 -2
- package/dist/cjs/views/quote_image_editable.js +4 -4
- package/dist/es/commands.js +1 -2
- package/dist/es/components/affiliations/AffiliationsModal.js +1 -3
- package/dist/es/components/authors/AuthorsModal.js +1 -1
- package/dist/es/components/keywords/AddKeywordInline.js +1 -1
- package/dist/es/components/outline/DraggableTree.js +1 -1
- package/dist/es/components/toolbar/helpers.js +4 -9
- package/dist/es/components/toolbar/type-selector/TypeSelector.js +1 -1
- package/dist/es/components/views/FootnotesSelector.js +1 -1
- package/dist/es/lib/track-changes-utils.js +3 -128
- package/dist/es/lib/utils.js +1 -1
- package/dist/es/lib/view.js +2 -1
- package/dist/es/menus.js +2 -2
- package/dist/es/plugins/affiliations.js +1 -1
- package/dist/es/plugins/objects.js +3 -6
- package/dist/es/plugins/persist.js +3 -5
- package/dist/es/plugins/search-replace/lib.js +1 -1
- package/dist/es/plugins/section_category.js +10 -43
- package/dist/es/plugins/section_title/autocompletion.js +1 -1
- package/dist/es/plugins/section_title/index.js +2 -5
- package/dist/es/plugins/selected-suggestion.js +1 -2
- package/dist/es/versions.js +1 -1
- package/dist/es/views/affiliations.js +1 -1
- package/dist/es/views/award.js +1 -1
- package/dist/es/views/base_node_view.js +1 -1
- package/dist/es/views/bibliography_element.js +1 -1
- package/dist/es/views/block_view.js +1 -1
- package/dist/es/views/citation_editable.js +1 -1
- package/dist/es/views/contributors.js +1 -1
- package/dist/es/views/creators.js +1 -1
- package/dist/es/views/figure_editable.js +1 -1
- package/dist/es/views/footnote.js +1 -1
- package/dist/es/views/general_table_footnote.js +1 -1
- package/dist/es/views/inline_footnote.js +1 -1
- package/dist/es/views/keyword.js +1 -1
- package/dist/es/views/keyword_group.js +1 -1
- package/dist/es/views/link_editable.js +1 -1
- package/dist/es/views/quote_image_editable.js +1 -1
- package/dist/types/components/toolbar/helpers.d.ts +0 -1
- package/dist/types/lib/track-changes-utils.d.ts +2 -15
- package/dist/types/lib/utils.d.ts +1 -1
- package/dist/types/versions.d.ts +1 -1
- package/package.json +3 -3
- package/dist/cjs/lib/filtered-document.js +0 -49
- package/dist/es/lib/filtered-document.js +0 -44
- package/dist/types/lib/filtered-document.d.ts +0 -18
|
@@ -4,8 +4,8 @@ exports.hasAutoCompletionSlack = hasAutoCompletionSlack;
|
|
|
4
4
|
exports.checkForCompletion = checkForCompletion;
|
|
5
5
|
const transform_1 = require("@manuscripts/transform");
|
|
6
6
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
7
|
-
const track_changes_utils_1 = require("../../lib/track-changes-utils");
|
|
8
7
|
const editor_props_1 = require("../editor-props");
|
|
8
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
9
9
|
function cursorAtTheEndOfText(state, nodeSize, nodePos) {
|
|
10
10
|
const { from, to } = state.selection;
|
|
11
11
|
return from === to && to === nodePos + nodeSize - 1;
|
|
@@ -14,7 +14,7 @@ const isUpperCase = (test) => test === test.toUpperCase() && test.length > 1;
|
|
|
14
14
|
function hasAutoCompletionSlack(node, category) {
|
|
15
15
|
const titles = category.titles;
|
|
16
16
|
if (titles.length && node.textContent) {
|
|
17
|
-
const actualTextContent = (0,
|
|
17
|
+
const actualTextContent = (0, track_changes_plugin_1.getActualTextContent)(node.content);
|
|
18
18
|
const title = titles.find((t) => t.toLowerCase().startsWith(actualTextContent.toLowerCase()));
|
|
19
19
|
if (title) {
|
|
20
20
|
const suggestionPart = title.slice(actualTextContent.length);
|
|
@@ -5,14 +5,11 @@ const transform_1 = require("@manuscripts/transform");
|
|
|
5
5
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
6
6
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
7
7
|
const prosemirror_view_1 = require("prosemirror-view");
|
|
8
|
-
const filtered_document_1 = require("../../lib/filtered-document");
|
|
9
8
|
const autocompletion_1 = require("./autocompletion");
|
|
9
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
10
10
|
exports.sectionTitleKey = new prosemirror_state_1.PluginKey('sectionNumbering');
|
|
11
11
|
const calculateSectionLevels = (node, startPos, sectionNumberMap, numbering = [0]) => {
|
|
12
|
-
node.forEach((childNode, offset) => {
|
|
13
|
-
if ((0, filtered_document_1.isMoved)(childNode)) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
12
|
+
(0, track_changes_plugin_1.clear)(node).forEach((childNode, offset) => {
|
|
16
13
|
if (childNode.type === transform_1.schema.nodes.section ||
|
|
17
14
|
childNode.type === transform_1.schema.nodes.box_element) {
|
|
18
15
|
numbering[numbering.length - 1] += 1;
|
|
@@ -6,7 +6,6 @@ const transform_1 = require("@manuscripts/transform");
|
|
|
6
6
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
7
7
|
const prosemirror_view_1 = require("prosemirror-view");
|
|
8
8
|
const commands_1 = require("../commands");
|
|
9
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
10
9
|
const selection_1 = require("../selection");
|
|
11
10
|
exports.selectedSuggestionKey = new prosemirror_state_1.PluginKey('selected-suggestion');
|
|
12
11
|
const EMPTY = {
|
|
@@ -102,7 +101,7 @@ const buildTextDecoration = (doc, selection) => {
|
|
|
102
101
|
let suggestion = getTrackedMark(node)?.attrs.dataTracked;
|
|
103
102
|
if (!suggestion) {
|
|
104
103
|
for (const mark of node.marks) {
|
|
105
|
-
if ((0,
|
|
104
|
+
if ((0, track_changes_plugin_1.isTracked)(mark)) {
|
|
106
105
|
suggestion = mark.attrs.dataTracked[0];
|
|
107
106
|
}
|
|
108
107
|
}
|
package/dist/cjs/versions.js
CHANGED
|
@@ -20,13 +20,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.AffiliationsView = void 0;
|
|
22
22
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
23
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
23
24
|
const transform_1 = require("@manuscripts/transform");
|
|
24
25
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
25
26
|
const AffiliationsModal_1 = require("../components/affiliations/AffiliationsModal");
|
|
26
27
|
const icons_1 = require("../icons");
|
|
27
28
|
const authors_1 = require("../lib/authors");
|
|
28
29
|
const comments_1 = require("../lib/comments");
|
|
29
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
30
30
|
const view_1 = require("../lib/view");
|
|
31
31
|
const affiliations_1 = require("../plugins/affiliations");
|
|
32
32
|
const selected_suggestion_1 = require("../plugins/selected-suggestion");
|
|
@@ -48,7 +48,7 @@ class AffiliationsView extends block_view_1.default {
|
|
|
48
48
|
if (!node || !pos) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
if (!(0,
|
|
51
|
+
if (!(0, track_changes_plugin_1.isDeleted)(node)) {
|
|
52
52
|
this.showContextMenu(affiliation);
|
|
53
53
|
}
|
|
54
54
|
const view = this.view;
|
|
@@ -140,7 +140,7 @@ class AffiliationsView extends block_view_1.default {
|
|
|
140
140
|
this.selectNode = () => {
|
|
141
141
|
const selectedMarker = document.querySelector('.comment-marker.selected-comment');
|
|
142
142
|
this.dom.classList.add('ProseMirror-selectednode');
|
|
143
|
-
if (!(0,
|
|
143
|
+
if (!(0, track_changes_plugin_1.isDeleted)(this.node) && !selectedMarker) {
|
|
144
144
|
this.handleEdit('', true);
|
|
145
145
|
}
|
|
146
146
|
};
|
|
@@ -194,7 +194,7 @@ class AffiliationsView extends block_view_1.default {
|
|
|
194
194
|
const element = document.createElement('div');
|
|
195
195
|
element.classList.add('affiliation');
|
|
196
196
|
element.id = attrs.id;
|
|
197
|
-
(0,
|
|
197
|
+
(0, track_changes_plugin_1.addTrackChangesAttributes)(attrs, element);
|
|
198
198
|
const marker = document.createElement('span');
|
|
199
199
|
if (index) {
|
|
200
200
|
marker.classList.add('affiliation-label');
|
package/dist/cjs/views/award.js
CHANGED
|
@@ -23,11 +23,11 @@ const style_guide_1 = require("@manuscripts/style-guide");
|
|
|
23
23
|
const transform_1 = require("@manuscripts/transform");
|
|
24
24
|
const AwardModal_1 = require("../components/awards/AwardModal");
|
|
25
25
|
const DeleteAwardDiaolog_1 = require("../components/awards/DeleteAwardDiaolog");
|
|
26
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
27
26
|
const view_1 = require("../lib/view");
|
|
28
27
|
const block_view_1 = __importDefault(require("./block_view"));
|
|
29
28
|
const creators_1 = require("./creators");
|
|
30
29
|
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
30
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
31
31
|
class AwardView extends block_view_1.default {
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
@@ -52,7 +52,7 @@ class AwardView extends block_view_1.default {
|
|
|
52
52
|
};
|
|
53
53
|
this.awardContextMenu = () => {
|
|
54
54
|
const can = this.props.getCapabilities();
|
|
55
|
-
if (!can.editArticle || (0,
|
|
55
|
+
if (!can.editArticle || (0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
56
56
|
return undefined;
|
|
57
57
|
}
|
|
58
58
|
const componentProps = {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.BaseNodeView = void 0;
|
|
19
|
-
const
|
|
19
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
20
20
|
class BaseNodeView {
|
|
21
21
|
constructor(props, node, view, getPos) {
|
|
22
22
|
this.props = props;
|
|
@@ -49,8 +49,8 @@ class BaseNodeView {
|
|
|
49
49
|
this.handleTrackChanges();
|
|
50
50
|
}
|
|
51
51
|
handleTrackChanges() {
|
|
52
|
-
(0,
|
|
53
|
-
(0,
|
|
52
|
+
(0, track_changes_plugin_1.addTrackChangesAttributes)(this.node.attrs, this.dom);
|
|
53
|
+
(0, track_changes_plugin_1.addTrackChangesClassNames)(this.node.attrs, this.dom);
|
|
54
54
|
}
|
|
55
55
|
selectNode() {
|
|
56
56
|
this.dom.classList.add('ProseMirror-selectednode');
|
|
@@ -27,7 +27,6 @@ const comments_1 = require("../lib/comments");
|
|
|
27
27
|
const navigation_utils_1 = require("../lib/navigation-utils");
|
|
28
28
|
const doc_1 = require("../lib/doc");
|
|
29
29
|
const dompurify_1 = require("../lib/dompurify");
|
|
30
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
31
30
|
const view_1 = require("../lib/view");
|
|
32
31
|
const bibliography_1 = require("../plugins/bibliography");
|
|
33
32
|
const comments_2 = require("../plugins/comments");
|
|
@@ -35,6 +34,7 @@ const selected_suggestion_1 = require("../plugins/selected-suggestion");
|
|
|
35
34
|
const block_view_1 = __importDefault(require("./block_view"));
|
|
36
35
|
const creators_1 = require("./creators");
|
|
37
36
|
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
37
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
38
38
|
class BibliographyElementBlockView extends block_view_1.default {
|
|
39
39
|
constructor() {
|
|
40
40
|
super(...arguments);
|
|
@@ -220,8 +220,8 @@ class BibliographyElementBlockView extends block_view_1.default {
|
|
|
220
220
|
element.tabIndex = 0;
|
|
221
221
|
const comment = (0, comments_1.createCommentMarker)('div', id);
|
|
222
222
|
element.prepend(comment);
|
|
223
|
-
(0,
|
|
224
|
-
(0,
|
|
223
|
+
(0, track_changes_plugin_1.addTrackChangesAttributes)(node.attrs, element);
|
|
224
|
+
(0, track_changes_plugin_1.addTrackChangesClassNames)(node.attrs, element);
|
|
225
225
|
wrapper.append(element);
|
|
226
226
|
}
|
|
227
227
|
if (!bibliography.length) {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
19
18
|
const base_node_view_1 = require("./base_node_view");
|
|
19
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
20
20
|
class BlockView extends base_node_view_1.BaseNodeView {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
@@ -35,7 +35,7 @@ class BlockView extends base_node_view_1.BaseNodeView {
|
|
|
35
35
|
this.updatePlaceholder();
|
|
36
36
|
}
|
|
37
37
|
handleTrackChanges() {
|
|
38
|
-
(0,
|
|
38
|
+
(0, track_changes_plugin_1.addTrackChangesAttributes)(this.node.attrs, this.dom);
|
|
39
39
|
}
|
|
40
40
|
updateClasses() {
|
|
41
41
|
if (!this.contentDOM) {
|
|
@@ -20,6 +20,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.CitationEditableView = void 0;
|
|
22
22
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
23
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
23
24
|
const transform_1 = require("@manuscripts/transform");
|
|
24
25
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
25
26
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
@@ -28,7 +29,6 @@ const CitationViewer_1 = require("../components/references/CitationViewer");
|
|
|
28
29
|
const comments_1 = require("../lib/comments");
|
|
29
30
|
const crossref_1 = require("../lib/crossref");
|
|
30
31
|
const navigation_utils_1 = require("../lib/navigation-utils");
|
|
31
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
32
32
|
const view_1 = require("../lib/view");
|
|
33
33
|
const bibliography_1 = require("../plugins/bibliography");
|
|
34
34
|
const citation_1 = require("./citation");
|
|
@@ -53,7 +53,7 @@ class CitationEditableView extends citation_1.CitationView {
|
|
|
53
53
|
this.dom.classList.contains('inconsistency-highlight')) {
|
|
54
54
|
this.showPopper();
|
|
55
55
|
}
|
|
56
|
-
else if (!(0,
|
|
56
|
+
else if (!(0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
57
57
|
const attrs = this.node.attrs;
|
|
58
58
|
if (attrs.rids.length) {
|
|
59
59
|
this.showContextMenu(fromKeyboard);
|
|
@@ -63,7 +63,7 @@ class CitationEditableView extends citation_1.CitationView {
|
|
|
63
63
|
this.selectNode = () => {
|
|
64
64
|
this.dom.classList.add('ProseMirror-selectednode');
|
|
65
65
|
if (this.can.seeReferencesButtons &&
|
|
66
|
-
!(0,
|
|
66
|
+
!(0, track_changes_plugin_1.isDeleted)(this.node) &&
|
|
67
67
|
!this.dom.classList.contains('inconsistency-highlight')) {
|
|
68
68
|
const attrs = this.node.attrs;
|
|
69
69
|
if (!attrs.rids.length) {
|
|
@@ -20,13 +20,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.ContributorsView = void 0;
|
|
22
22
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
23
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
23
24
|
const transform_1 = require("@manuscripts/transform");
|
|
24
25
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
25
26
|
const AuthorsModal_1 = require("../components/authors/AuthorsModal");
|
|
26
27
|
const authors_1 = require("../lib/authors");
|
|
27
28
|
const comments_1 = require("../lib/comments");
|
|
28
29
|
const navigation_utils_1 = require("../lib/navigation-utils");
|
|
29
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
30
30
|
const utils_1 = require("../lib/utils");
|
|
31
31
|
const view_1 = require("../lib/view");
|
|
32
32
|
const affiliations_1 = require("../plugins/affiliations");
|
|
@@ -43,7 +43,7 @@ class ContributorsView extends block_view_1.default {
|
|
|
43
43
|
this.selectNode = () => {
|
|
44
44
|
const selectedMarker = document.querySelector('.comment-marker.selected-comment');
|
|
45
45
|
this.dom.classList.add('ProseMirror-selectednode');
|
|
46
|
-
if (!(0,
|
|
46
|
+
if (!(0, track_changes_plugin_1.isDeleted)(this.node) && !selectedMarker) {
|
|
47
47
|
this.handleEdit('', true);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
@@ -90,7 +90,7 @@ class ContributorsView extends block_view_1.default {
|
|
|
90
90
|
container.setAttribute('id', attrs.id);
|
|
91
91
|
container.setAttribute('contenteditable', 'false');
|
|
92
92
|
container.tabIndex = index === 0 ? 0 : -1;
|
|
93
|
-
(0,
|
|
93
|
+
(0, track_changes_plugin_1.addTrackChangesAttributes)(attrs, container);
|
|
94
94
|
const name = (0, authors_1.authorLabel)(attrs);
|
|
95
95
|
container.innerHTML =
|
|
96
96
|
attrs.isCorresponding && attrs.email
|
|
@@ -188,7 +188,7 @@ class ContributorsView extends block_view_1.default {
|
|
|
188
188
|
if (!node || !pos) {
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
|
-
if (!(0,
|
|
191
|
+
if (!(0, track_changes_plugin_1.isDeleted)(node)) {
|
|
192
192
|
this.showContextMenu(author);
|
|
193
193
|
}
|
|
194
194
|
const view = this.view;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.createNodeOrElementView = exports.createNodeView = exports.createEditableNodeView = void 0;
|
|
19
|
-
const
|
|
19
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
20
20
|
const createEditableNodeView = (type) => (props, dispatch) => (node, view, getPos, decorations) => {
|
|
21
21
|
const nodeView = new type({ ...props, dispatch }, node, view, getPos, decorations);
|
|
22
22
|
nodeView.initialise();
|
|
@@ -39,7 +39,7 @@ const createNodeOrElementView = (type, tagName, callback) => (props) => (node, v
|
|
|
39
39
|
if (node.attrs.id) {
|
|
40
40
|
dom.id = node.attrs.id;
|
|
41
41
|
}
|
|
42
|
-
(0,
|
|
42
|
+
(0, track_changes_plugin_1.addTrackChangesAttributes)(node.attrs, dom);
|
|
43
43
|
const nodeView = {
|
|
44
44
|
dom,
|
|
45
45
|
contentDOM: dom,
|
|
@@ -20,9 +20,9 @@ const transform_1 = require("@manuscripts/transform");
|
|
|
20
20
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
21
21
|
const icons_1 = require("../icons");
|
|
22
22
|
const media_1 = require("../lib/media");
|
|
23
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
24
23
|
const creators_1 = require("./creators");
|
|
25
24
|
const figure_1 = require("./figure");
|
|
25
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
26
26
|
class FigureEditableView extends figure_1.FigureView {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
@@ -89,7 +89,7 @@ class FigureEditableView extends figure_1.FigureView {
|
|
|
89
89
|
setupDragAndDrop() {
|
|
90
90
|
this.container.draggable = true;
|
|
91
91
|
this.container.addEventListener('dragstart', () => {
|
|
92
|
-
if (this.node.attrs.id && !(0,
|
|
92
|
+
if (this.node.attrs.id && !(0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
93
93
|
this.handleDragStart();
|
|
94
94
|
}
|
|
95
95
|
});
|
|
@@ -190,7 +190,7 @@ class FigureEditableView extends figure_1.FigureView {
|
|
|
190
190
|
: file
|
|
191
191
|
? this.createUnsupportedFormat(file.name)
|
|
192
192
|
: this.createPlaceholder();
|
|
193
|
-
if (can.uploadFile && !(0,
|
|
193
|
+
if (can.uploadFile && !(0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
194
194
|
(0, media_1.addInteractionHandlers)(img, this.upload, 'image/*');
|
|
195
195
|
}
|
|
196
196
|
this.container.innerHTML = '';
|
|
@@ -205,7 +205,7 @@ class FigureEditableView extends figure_1.FigureView {
|
|
|
205
205
|
const parent = $pos.parent;
|
|
206
206
|
if (this.props.getCapabilities()?.editArticle &&
|
|
207
207
|
parent.type === transform_1.schema.nodes.figure_element &&
|
|
208
|
-
!(0,
|
|
208
|
+
!(0, track_changes_plugin_1.isDeleted)(this.node) &&
|
|
209
209
|
this.countFigures() > 1) {
|
|
210
210
|
const dragHandle = document.createElement('div');
|
|
211
211
|
dragHandle.className = 'drag-handler';
|
|
@@ -221,7 +221,7 @@ class FigureEditableView extends figure_1.FigureView {
|
|
|
221
221
|
const parent = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)(this.view.state.doc.resolve(this.getPos()), transform_1.schema.nodes.figure_element);
|
|
222
222
|
let count = 0;
|
|
223
223
|
parent?.node.descendants((node) => {
|
|
224
|
-
if (node.type === transform_1.schema.nodes.figure && !(0,
|
|
224
|
+
if (node.type === transform_1.schema.nodes.figure && !(0, track_changes_plugin_1.isDeleted)(node)) {
|
|
225
225
|
count++;
|
|
226
226
|
}
|
|
227
227
|
});
|
|
@@ -20,6 +20,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.FootnoteView = void 0;
|
|
22
22
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
23
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
23
24
|
const transform_1 = require("@manuscripts/transform");
|
|
24
25
|
const lodash_1 = require("lodash");
|
|
25
26
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
@@ -27,7 +28,6 @@ const prosemirror_utils_1 = require("prosemirror-utils");
|
|
|
27
28
|
const DeleteFootnoteDialog_1 = require("../components/views/DeleteFootnoteDialog");
|
|
28
29
|
const icons_1 = require("../icons");
|
|
29
30
|
const footnotes_1 = require("../lib/footnotes");
|
|
30
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
31
31
|
const base_node_view_1 = require("./base_node_view");
|
|
32
32
|
const creators_1 = require("./creators");
|
|
33
33
|
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
@@ -111,7 +111,7 @@ class FootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
111
111
|
tr.delete(pos, pos + this.node.nodeSize);
|
|
112
112
|
if (element &&
|
|
113
113
|
getEffectiveChildCount(element.node) <= 1 &&
|
|
114
|
-
!(0,
|
|
114
|
+
!(0, track_changes_plugin_1.isPendingInsert)(this.node)) {
|
|
115
115
|
tr.delete(tr.mapping.map(element.pos), tr.mapping.map(element.pos + element.node.nodeSize));
|
|
116
116
|
}
|
|
117
117
|
};
|
|
@@ -123,7 +123,7 @@ class FootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
const marker = document.createElement('span');
|
|
126
|
-
if (!(0,
|
|
126
|
+
if (!(0, track_changes_plugin_1.isDeleted)(this.node) && fn.unusedFootnoteIDs.has(id)) {
|
|
127
127
|
marker.classList.add('uncited-footnote');
|
|
128
128
|
marker.innerHTML = icons_1.alertIcon;
|
|
129
129
|
}
|
|
@@ -154,7 +154,7 @@ class FootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
154
154
|
icon: 'Scroll',
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
if (can.editArticle && !(0,
|
|
157
|
+
if (can.editArticle && !(0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
158
158
|
componentProps.actions.push({
|
|
159
159
|
label: 'Delete',
|
|
160
160
|
action: () => this.handleDeleteClick(),
|
|
@@ -170,7 +170,7 @@ const getEffectiveChildCount = (node) => {
|
|
|
170
170
|
let count = 0;
|
|
171
171
|
for (let i = 0; i < node.childCount; i++) {
|
|
172
172
|
const child = node.child(i);
|
|
173
|
-
if (!(0,
|
|
173
|
+
if (!(0, track_changes_plugin_1.isDeleted)(child)) {
|
|
174
174
|
count++;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -23,10 +23,10 @@ const style_guide_1 = require("@manuscripts/style-guide");
|
|
|
23
23
|
const transform_1 = require("@manuscripts/transform");
|
|
24
24
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
25
25
|
const DeleteFootnoteDialog_1 = require("../components/views/DeleteFootnoteDialog");
|
|
26
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
27
26
|
const base_node_view_1 = require("./base_node_view");
|
|
28
27
|
const creators_1 = require("./creators");
|
|
29
28
|
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
29
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
30
30
|
class GeneralTableFootnoteView extends base_node_view_1.BaseNodeView {
|
|
31
31
|
constructor() {
|
|
32
32
|
super(...arguments);
|
|
@@ -63,12 +63,12 @@ class GeneralTableFootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
63
63
|
const $pos = this.view.state.doc.resolve(pos);
|
|
64
64
|
const footer = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, transform_1.schema.nodes.table_element_footer);
|
|
65
65
|
const element = (0, prosemirror_utils_1.findChildrenByType)(footer.node, transform_1.schema.nodes.general_table_footnote)[0];
|
|
66
|
-
if (element && !(0,
|
|
66
|
+
if (element && !(0, track_changes_plugin_1.isDeleted)(element.node)) {
|
|
67
67
|
const from = tr.mapping.map(pos);
|
|
68
68
|
const to = tr.mapping.map(from + this.node.nodeSize);
|
|
69
69
|
tr.delete(from, to);
|
|
70
70
|
}
|
|
71
|
-
if (footer.node.childCount <= 1 && !(0,
|
|
71
|
+
if (footer.node.childCount <= 1 && !(0, track_changes_plugin_1.isPendingInsert)(element.node)) {
|
|
72
72
|
const from = tr.mapping.map(footer.pos);
|
|
73
73
|
const to = tr.mapping.map(from + footer.node.nodeSize);
|
|
74
74
|
tr.delete(from, to);
|
|
@@ -86,7 +86,7 @@ class GeneralTableFootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
86
86
|
const componentProps = {
|
|
87
87
|
actions: [],
|
|
88
88
|
};
|
|
89
|
-
if (!(0,
|
|
89
|
+
if (!(0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
90
90
|
componentProps.actions.push({
|
|
91
91
|
label: 'Delete',
|
|
92
92
|
action: () => this.handleDeleteClick(),
|
|
@@ -25,10 +25,10 @@ const commands_1 = require("../commands");
|
|
|
25
25
|
const FootnotesSelector_1 = require("../components/views/FootnotesSelector");
|
|
26
26
|
const navigation_utils_1 = require("../lib/navigation-utils");
|
|
27
27
|
const footnotes_1 = require("../lib/footnotes");
|
|
28
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
29
28
|
const base_node_view_1 = require("./base_node_view");
|
|
30
29
|
const creators_1 = require("./creators");
|
|
31
30
|
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
31
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
32
32
|
class InlineFootnoteView extends base_node_view_1.BaseNodeView {
|
|
33
33
|
constructor() {
|
|
34
34
|
super(...arguments);
|
|
@@ -63,7 +63,7 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
63
63
|
this.props.popper.show(this.dom, (0, ReactSubView_1.default)(this.props, style_guide_1.ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu']), 'right-start', false);
|
|
64
64
|
};
|
|
65
65
|
this.handleClick = () => {
|
|
66
|
-
if ((0,
|
|
66
|
+
if ((0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
this.showContextMenu();
|
|
@@ -174,7 +174,7 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
174
174
|
if (rids.length) {
|
|
175
175
|
tr.setNodeAttribute(pos, 'rids', rids);
|
|
176
176
|
}
|
|
177
|
-
else if ((0,
|
|
177
|
+
else if ((0, track_changes_plugin_1.isPendingInsert)(this.node)) {
|
|
178
178
|
tr.delete(pos, pos + this.node.nodeSize);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -25,7 +25,7 @@ const navigation_utils_1 = require("../lib/navigation-utils");
|
|
|
25
25
|
const base_node_view_1 = require("./base_node_view");
|
|
26
26
|
const creators_1 = require("./creators");
|
|
27
27
|
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
28
|
-
const
|
|
28
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
29
29
|
const deleteIcon = '<svg width="8px" height="8px" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg">\n' +
|
|
30
30
|
' <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n' +
|
|
31
31
|
' <g fill="#6E6E6E">\n' +
|
|
@@ -72,7 +72,7 @@ class KeywordView extends base_node_view_1.BaseNodeView {
|
|
|
72
72
|
const parent = this.view.state.doc.resolve(pos).parent;
|
|
73
73
|
for (let i = 0; i < parent.childCount; i++) {
|
|
74
74
|
const child = parent.child(i);
|
|
75
|
-
if (!(0,
|
|
75
|
+
if (!(0, track_changes_plugin_1.isDeleted)(child)) {
|
|
76
76
|
return child === this.node;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -21,10 +21,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
exports.KeywordGroupView = void 0;
|
|
22
22
|
const AddKeywordInline_1 = require("../components/keywords/AddKeywordInline");
|
|
23
23
|
const navigation_utils_1 = require("../lib/navigation-utils");
|
|
24
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
25
24
|
const block_view_1 = __importDefault(require("./block_view"));
|
|
26
25
|
const creators_1 = require("./creators");
|
|
27
26
|
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
27
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
28
28
|
class KeywordGroupView extends block_view_1.default {
|
|
29
29
|
constructor() {
|
|
30
30
|
super(...arguments);
|
|
@@ -69,7 +69,7 @@ class KeywordGroupView extends block_view_1.default {
|
|
|
69
69
|
if (!keyword) {
|
|
70
70
|
continue;
|
|
71
71
|
}
|
|
72
|
-
if (!(0,
|
|
72
|
+
if (!(0, track_changes_plugin_1.isDeleted)(child) && !firstFocusableFound) {
|
|
73
73
|
keyword.tabIndex = 0;
|
|
74
74
|
firstFocusableFound = true;
|
|
75
75
|
}
|
|
@@ -22,11 +22,11 @@ exports.LinkEditableView = void 0;
|
|
|
22
22
|
const transform_1 = require("@manuscripts/transform");
|
|
23
23
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
24
24
|
const LinkForm_1 = require("../components/views/LinkForm");
|
|
25
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
26
25
|
const url_1 = require("../lib/url");
|
|
27
26
|
const creators_1 = require("./creators");
|
|
28
27
|
const link_1 = require("./link");
|
|
29
28
|
const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
29
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
30
30
|
class LinkEditableView extends link_1.LinkView {
|
|
31
31
|
constructor() {
|
|
32
32
|
super(...arguments);
|
|
@@ -41,7 +41,7 @@ class LinkEditableView extends link_1.LinkView {
|
|
|
41
41
|
this.dom.addEventListener('click', this.handleClick);
|
|
42
42
|
};
|
|
43
43
|
this.selectNode = () => {
|
|
44
|
-
if (!(0,
|
|
44
|
+
if (!(0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
45
45
|
this.showForm();
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.QuoteImageEditableView = void 0;
|
|
19
|
+
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
19
20
|
const icons_1 = require("../icons");
|
|
20
|
-
const track_changes_utils_1 = require("../lib/track-changes-utils");
|
|
21
21
|
const creators_1 = require("./creators");
|
|
22
22
|
const figure_editable_1 = require("./figure_editable");
|
|
23
23
|
class QuoteImageEditableView extends figure_editable_1.FigureEditableView {
|
|
@@ -61,11 +61,11 @@ class QuoteImageEditableView extends figure_editable_1.FigureEditableView {
|
|
|
61
61
|
}
|
|
62
62
|
updateContents() {
|
|
63
63
|
super.updateContents();
|
|
64
|
-
if (!(0,
|
|
64
|
+
if (!(0, track_changes_plugin_1.isDeleted)(this.node)) {
|
|
65
65
|
this.container.appendChild(this.closeButton);
|
|
66
66
|
}
|
|
67
|
-
(0,
|
|
68
|
-
(0,
|
|
67
|
+
(0, track_changes_plugin_1.addTrackChangesAttributes)(this.node.attrs, this.dom);
|
|
68
|
+
(0, track_changes_plugin_1.addTrackChangesClassNames)(this.node.attrs, this.dom);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
exports.QuoteImageEditableView = QuoteImageEditableView;
|
package/dist/es/commands.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
|
16
|
+
import { isDeleted, skipTracking } from '@manuscripts/track-changes-plugin';
|
|
17
17
|
import { generateNodeID, isElementNodeType, isListNode, isSectionNodeType, isTableElementNode, schema, } from '@manuscripts/transform';
|
|
18
18
|
import { Fragment, NodeRange, Slice, } from 'prosemirror-model';
|
|
19
19
|
import { wrapInList } from 'prosemirror-schema-list';
|
|
@@ -26,7 +26,6 @@ import { findAbstractsNode, findBackmatter, findBibliographySection, findBody, f
|
|
|
26
26
|
import { createFootnote, findFootnotesContainerNode, getFootnotesElementState, } from './lib/footnotes';
|
|
27
27
|
import { findWordBoundaries, isNodeOfType, nearestAncestor, } from './lib/helpers';
|
|
28
28
|
import { templateAllows } from './lib/template';
|
|
29
|
-
import { isDeleted } from './lib/track-changes-utils';
|
|
30
29
|
import { findInsertionPosition, findParentNodeWithId, getChildOfType, getInsertPos, isBodyLocked, } from './lib/utils';
|
|
31
30
|
import { expandAccessibilitySection } from './plugins/accessibility_element';
|
|
32
31
|
import { setCommentSelection } from './plugins/comments';
|
|
@@ -215,9 +215,7 @@ export const AffiliationsModal = ({ authors: $authors, affiliations: $affiliatio
|
|
|
215
215
|
const author = authors.find((a) => a.id === authorId);
|
|
216
216
|
return {
|
|
217
217
|
id: authorId,
|
|
218
|
-
label: author
|
|
219
|
-
? `${author.given} ${author.family}`
|
|
220
|
-
: '',
|
|
218
|
+
label: author ? `${author.given} ${author.family}` : '',
|
|
221
219
|
};
|
|
222
220
|
})
|
|
223
221
|
.filter((author) => author.label);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { AddIcon, AddInstitutionIcon, AddRoleIcon, AuthorPlaceholderIcon, CloseButton, ModalBody, ModalContainer, ModalHeader, ModalSidebar, ModalSidebarHeader, ModalSidebarTitle, outlineStyle, ScrollableModalContent, SidebarContent, StyledModal, InspectorTabs, InspectorTabPanel, InspectorTabList, InspectorTab, InspectorTabPanels, } from '@manuscripts/style-guide';
|
|
17
|
-
import { generateNodeID, schema
|
|
17
|
+
import { generateNodeID, schema } from '@manuscripts/transform';
|
|
18
18
|
import { cloneDeep, isEqual, omit } from 'lodash';
|
|
19
19
|
import React, { useCallback, useEffect, useReducer, useRef, useState, } from 'react';
|
|
20
20
|
import styled from 'styled-components';
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Category, Dialog, PlusIcon } from '@manuscripts/style-guide';
|
|
17
|
+
import { isDeleted } from '@manuscripts/track-changes-plugin';
|
|
17
18
|
import { generateNodeID, schema, } from '@manuscripts/transform';
|
|
18
19
|
import { TextSelection } from 'prosemirror-state';
|
|
19
20
|
import React, { useCallback, useEffect, useRef, useState, } from 'react';
|
|
20
21
|
import styled from 'styled-components';
|
|
21
|
-
import { isDeleted } from '../../lib/track-changes-utils';
|
|
22
22
|
const AddNewKeyword = styled.div `
|
|
23
23
|
position: relative;
|
|
24
24
|
display: inline-block;
|
|
@@ -5,11 +5,11 @@ import React, { useRef, useState } from 'react';
|
|
|
5
5
|
import { useDrag, useDrop } from 'react-dnd';
|
|
6
6
|
import { ContextMenu } from '../../lib/context-menu';
|
|
7
7
|
import { getDropSide } from '../../lib/dnd';
|
|
8
|
-
import { isDeleted } from '../../lib/track-changes-utils';
|
|
9
8
|
import { isBodyLocked } from '../../lib/utils';
|
|
10
9
|
import { nodeTypeIcon } from '../../node-type-icons';
|
|
11
10
|
import { sectionTitleKey } from '../../plugins/section_title';
|
|
12
11
|
import { Outline, OutlineItem, OutlineItemArrow, OutlineItemIcon, OutlineItemLink, OutlineItemLinkText, OutlineItemNoArrow, OutlineItemPlaceholder, } from './Outline';
|
|
12
|
+
import { isDeleted } from '@manuscripts/track-changes-plugin';
|
|
13
13
|
const excludedTypes = [
|
|
14
14
|
schema.nodes.table,
|
|
15
15
|
schema.nodes.figure,
|