@manuscripts/article-editor 3.1.47-LEAN-3893.0 → 3.1.47-LEAN-3958.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/track-changes/TrackChangesPanel.js +1 -1
- package/dist/cjs/components/track-changes/TrackChangesPanel.js.map +1 -1
- package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js +3 -3
- package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
- package/dist/cjs/components/track-changes/suggestion-list/SuggestionSnippet.js +114 -98
- package/dist/cjs/components/track-changes/suggestion-list/SuggestionSnippet.js.map +1 -1
- package/dist/cjs/components/track-changes/utils.js +1 -3
- package/dist/cjs/components/track-changes/utils.js.map +1 -1
- package/dist/cjs/lib/fonts.js +4 -0
- package/dist/cjs/lib/fonts.js.map +1 -1
- package/dist/cjs/lib/utils.js +108 -3
- package/dist/cjs/lib/utils.js.map +1 -1
- package/dist/es/components/track-changes/TrackChangesPanel.js +2 -2
- package/dist/es/components/track-changes/TrackChangesPanel.js.map +1 -1
- package/dist/es/components/track-changes/suggestion-list/Suggestion.js +3 -3
- package/dist/es/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
- package/dist/es/components/track-changes/suggestion-list/SuggestionSnippet.js +117 -101
- package/dist/es/components/track-changes/suggestion-list/SuggestionSnippet.js.map +1 -1
- package/dist/es/components/track-changes/utils.js +2 -4
- package/dist/es/components/track-changes/utils.js.map +1 -1
- package/dist/es/lib/fonts.js +4 -0
- package/dist/es/lib/fonts.js.map +1 -1
- package/dist/es/lib/utils.js +98 -2
- package/dist/es/lib/utils.js.map +1 -1
- package/dist/types/components/track-changes/suggestion-list/SuggestionSnippet.d.ts +0 -11
- package/dist/types/lib/fonts.d.ts +3 -0
- package/dist/types/lib/utils.d.ts +9 -0
- package/package.json +4 -5
- package/dist/cjs/lib/footnotes.js +0 -49
- package/dist/cjs/lib/footnotes.js.map +0 -1
- package/dist/es/lib/footnotes.js +0 -43
- package/dist/es/lib/footnotes.js.map +0 -1
- package/dist/types/lib/footnotes.d.ts +0 -15
@@ -9,14 +9,14 @@
|
|
9
9
|
*
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
|
-
import {
|
12
|
+
import { renderMath } from '@manuscripts/body-editor';
|
13
|
+
import { CHANGE_STATUS, ChangeSet, } from '@manuscripts/track-changes-plugin';
|
13
14
|
import { schema } from '@manuscripts/transform';
|
14
|
-
import
|
15
|
-
import React, { useEffect, useState } from 'react';
|
15
|
+
import purify from 'dompurify';
|
16
|
+
import React, { useEffect, useRef, useState } from 'react';
|
16
17
|
import styled from 'styled-components';
|
17
|
-
import { getFootnoteText, getInlineFootnoteContent, } from '../../../lib/footnotes';
|
18
18
|
import { changeOperationAlias } from '../../../lib/tracking';
|
19
|
-
import { getParentNode } from '../../../lib/utils';
|
19
|
+
import { getAffiliationTextContent, getContributorTextContent, getEquationContent, getFigureLabel, getFootnoteText, getInlineFootnoteContent, getNodeTextContent, getParentNode, getTextContentFromBibliography, } from '../../../lib/utils';
|
20
20
|
import { useStore } from '../../../store';
|
21
21
|
export const SuggestionSnippet = ({ suggestion, }) => {
|
22
22
|
const [{ doc, view }] = useStore((store) => ({
|
@@ -24,113 +24,130 @@ export const SuggestionSnippet = ({ suggestion, }) => {
|
|
24
24
|
doc: store.doc,
|
25
25
|
}));
|
26
26
|
const [snippet, setSnippet] = useState(null);
|
27
|
-
const [message, setMessage] = useState('');
|
28
27
|
const { dataTracked } = suggestion;
|
28
|
+
const contentRef = useRef(null);
|
29
|
+
const isContainLaTeX = (text) => {
|
30
|
+
const latexPattern = /(\$|\\\(|\\\[|\\begin\{|\\[a-zA-Z]+(\{.*?\})?)/;
|
31
|
+
return latexPattern.test(text);
|
32
|
+
};
|
33
|
+
useEffect(() => {
|
34
|
+
if (contentRef.current && snippet?.content) {
|
35
|
+
contentRef.current.innerHTML =
|
36
|
+
purify.sanitize(': ' + snippet.content) || '';
|
37
|
+
if (isContainLaTeX(snippet.content)) {
|
38
|
+
renderMath(contentRef.current);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}, [snippet?.content]);
|
29
42
|
useEffect(() => {
|
30
43
|
const getSnippetData = () => {
|
31
44
|
if (ChangeSet.isTextChange(suggestion)) {
|
32
|
-
const
|
33
|
-
|
34
|
-
return {
|
35
|
-
snippet: {
|
36
|
-
operation: changeOperationAlias(dataTracked.operation),
|
37
|
-
nodeName: parentNode.type.name || suggestion.nodeType.name,
|
38
|
-
content: suggestion.text,
|
39
|
-
},
|
40
|
-
message: '',
|
41
|
-
};
|
42
|
-
}
|
43
|
-
else {
|
44
|
-
return { snippet: null, message: suggestion.text };
|
45
|
-
}
|
46
|
-
}
|
47
|
-
if (ChangeSet.isNodeChange(suggestion) &&
|
48
|
-
suggestion.dataTracked.operation === CHANGE_OPERATION.node_split) {
|
49
|
-
return { snippet: null, message: `Split ${suggestion.node.type.name}` };
|
50
|
-
}
|
51
|
-
if (ChangeSet.isNodeChange(suggestion) &&
|
52
|
-
suggestion.dataTracked.operation === CHANGE_OPERATION.wrap_with_node) {
|
45
|
+
const parentNodeName = getParentNode(view.state, suggestion.from)?.type
|
46
|
+
.name;
|
53
47
|
return {
|
54
|
-
snippet:
|
55
|
-
|
56
|
-
.
|
57
|
-
|
48
|
+
snippet: {
|
49
|
+
operation: changeOperationAlias(dataTracked.operation),
|
50
|
+
nodeName: parentNodeName || suggestion.nodeType.name,
|
51
|
+
content: suggestion.text,
|
52
|
+
},
|
58
53
|
};
|
59
54
|
}
|
60
|
-
if (ChangeSet.isNodeChange(suggestion)
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
55
|
+
else if (ChangeSet.isNodeChange(suggestion) ||
|
56
|
+
ChangeSet.isNodeAttrChange(suggestion)) {
|
57
|
+
switch (suggestion.node.type) {
|
58
|
+
case schema.nodes.inline_footnote:
|
59
|
+
return {
|
60
|
+
snippet: {
|
61
|
+
operation: changeOperationAlias(dataTracked.operation),
|
62
|
+
nodeName: suggestion.node.type.spec.name,
|
63
|
+
content: getInlineFootnoteContent(doc, suggestion.node.attrs),
|
64
|
+
},
|
65
|
+
};
|
66
|
+
case schema.nodes.footnote:
|
67
|
+
return {
|
68
|
+
snippet: {
|
69
|
+
operation: changeOperationAlias(dataTracked.operation),
|
70
|
+
nodeName: suggestion.node.type.name,
|
71
|
+
content: getFootnoteText(view.state, suggestion.node),
|
72
|
+
},
|
73
|
+
};
|
74
|
+
case schema.nodes.contributor:
|
75
|
+
return {
|
76
|
+
snippet: {
|
77
|
+
operation: changeOperationAlias(dataTracked.operation),
|
78
|
+
nodeName: suggestion.node.type.name,
|
79
|
+
content: getContributorTextContent(suggestion.node, suggestion.oldAttrs),
|
80
|
+
},
|
81
|
+
};
|
82
|
+
case schema.nodes.affiliation:
|
83
|
+
return {
|
84
|
+
snippet: {
|
85
|
+
operation: changeOperationAlias(dataTracked.operation),
|
86
|
+
nodeName: suggestion.node.type.name,
|
87
|
+
content: getAffiliationTextContent(suggestion.node, suggestion.oldAttrs),
|
88
|
+
},
|
89
|
+
};
|
90
|
+
case schema.nodes.citation:
|
91
|
+
return {
|
92
|
+
snippet: {
|
93
|
+
operation: changeOperationAlias(dataTracked.operation),
|
94
|
+
nodeName: suggestion.node.type.name,
|
95
|
+
content: getTextContentFromBibliography(view.state, suggestion.node.attrs.rids[0]),
|
96
|
+
},
|
97
|
+
};
|
98
|
+
case schema.nodes.bibliography_item:
|
99
|
+
return {
|
100
|
+
snippet: {
|
101
|
+
operation: changeOperationAlias(dataTracked.operation),
|
102
|
+
nodeName: suggestion.node.type.spec.name,
|
103
|
+
content: getTextContentFromBibliography(view.state, suggestion.node.attrs.id),
|
104
|
+
},
|
105
|
+
};
|
106
|
+
case schema.nodes.figure_element:
|
107
|
+
case schema.nodes.table_element: {
|
108
|
+
return {
|
109
|
+
snippet: {
|
110
|
+
operation: changeOperationAlias(dataTracked.operation),
|
111
|
+
nodeName: suggestion.node.type.spec.name,
|
112
|
+
content: getFigureLabel(view.state, suggestion.node),
|
113
|
+
},
|
114
|
+
};
|
115
|
+
}
|
116
|
+
case schema.nodes.inline_equation:
|
117
|
+
case schema.nodes.equation_element: {
|
118
|
+
console.log('suggestion.node', suggestion);
|
119
|
+
return {
|
120
|
+
snippet: {
|
121
|
+
operation: changeOperationAlias(dataTracked.operation),
|
122
|
+
nodeName: suggestion.node.type.spec.name,
|
123
|
+
content: getEquationContent(suggestion.node),
|
124
|
+
},
|
125
|
+
};
|
126
|
+
}
|
127
|
+
default:
|
128
|
+
return {
|
129
|
+
snippet: {
|
130
|
+
operation: changeOperationAlias(dataTracked.operation),
|
131
|
+
nodeName: suggestion.node.type.spec.name || suggestion.node.type.name,
|
132
|
+
content: getNodeTextContent(suggestion.node),
|
133
|
+
},
|
134
|
+
};
|
118
135
|
}
|
119
136
|
}
|
120
|
-
return {
|
137
|
+
return {
|
138
|
+
snippet: { operation: '', nodeName: '', content: 'Unknown change!' },
|
139
|
+
};
|
121
140
|
};
|
122
|
-
const { snippet: newSnippet
|
141
|
+
const { snippet: newSnippet } = getSnippetData();
|
123
142
|
setSnippet(newSnippet);
|
124
|
-
setMessage(newMessage);
|
125
143
|
}, [suggestion, doc, view.state, dataTracked.operation]);
|
126
|
-
return (React.createElement(SnippetText, { isRejected: dataTracked.status === CHANGE_STATUS.rejected },
|
127
|
-
React.createElement(
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
snippet
|
132
|
-
|
133
|
-
React.createElement(Content, null, parse(snippet.content)))) : dataTracked.operation === CHANGE_OPERATION.delete ? (React.createElement("del", null, message)) : (message)));
|
144
|
+
return (React.createElement(SnippetText, { isRejected: dataTracked.status === CHANGE_STATUS.rejected },
|
145
|
+
React.createElement(React.Fragment, null,
|
146
|
+
React.createElement(Operation, { color: dataTracked.operation },
|
147
|
+
snippet?.operation,
|
148
|
+
":"),
|
149
|
+
React.createElement(NodeName, null, snippet?.nodeName),
|
150
|
+
React.createElement(Content, { ref: contentRef }))));
|
134
151
|
};
|
135
152
|
const SnippetText = styled.div `
|
136
153
|
font-size: ${(props) => props.theme.font.size.small};
|
@@ -169,7 +186,6 @@ const NodeName = styled.span `
|
|
169
186
|
font-size: 12px;
|
170
187
|
font-weight: bold;
|
171
188
|
line-height: 16px;
|
172
|
-
margin-right: 3.2px;
|
173
189
|
`;
|
174
190
|
const Content = styled.span `
|
175
191
|
color: #353535;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SuggestionSnippet.js","sourceRoot":"","sources":["../../../../../src/components/track-changes/suggestion-list/SuggestionSnippet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,
|
1
|
+
{"version":3,"file":"SuggestionSnippet.js","sourceRoot":"","sources":["../../../../../src/components/track-changes/suggestion-list/SuggestionSnippet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EACL,aAAa,EACb,SAAS,GAGV,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,MAAM,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KAAK,QAAQ;YACX,OAAO,SAAS,CAAA;QAClB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAA;QAClB,KAAK,WAAW;YACd,OAAO,SAAS,CAAA;QAClB;YACE,OAAO,SAAS,CAAA;KACnB;AACH,CAAC;CACF,CAAA;AAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;CAO3B,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;CAM1B,CAAA"}
|
@@ -9,7 +9,7 @@
|
|
9
9
|
*
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
|
-
import {
|
12
|
+
import { trackCommands, } from '@manuscripts/track-changes-plugin';
|
13
13
|
import { NodeSelection, TextSelection } from 'prosemirror-state';
|
14
14
|
export const setSelectedSuggestion = (suggestion, getState) => {
|
15
15
|
const editor = getState().editor;
|
@@ -28,9 +28,7 @@ export const setSelectedSuggestion = (suggestion, getState) => {
|
|
28
28
|
};
|
29
29
|
export const setChangeStatus = (change, status, execCmd) => {
|
30
30
|
const ids = [change.id];
|
31
|
-
if (change.type === 'node-change'
|
32
|
-
!(change.dataTracked.operation === CHANGE_OPERATION.node_split &&
|
33
|
-
status === CHANGE_STATUS.rejected)) {
|
31
|
+
if (change.type === 'node-change') {
|
34
32
|
change.children.forEach((child) => {
|
35
33
|
ids.push(child.id);
|
36
34
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/track-changes/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/track-changes/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,aAAa,GAEd,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAW,aAAa,EAAE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/es/lib/fonts.js
CHANGED
@@ -12,4 +12,8 @@
|
|
12
12
|
import '@fontsource/lato';
|
13
13
|
import '@fontsource/pt-sans';
|
14
14
|
import '@fontsource/pt-serif';
|
15
|
+
// Importing specific weights
|
16
|
+
import '@fontsource/lato/300.css';
|
17
|
+
import '@fontsource/lato/400.css';
|
18
|
+
import '@fontsource/lato/700.css';
|
15
19
|
//# sourceMappingURL=fonts.js.map
|
package/dist/es/lib/fonts.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../src/lib/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,kBAAkB,CAAA;AACzB,OAAO,qBAAqB,CAAA;AAC5B,OAAO,sBAAsB,CAAA"}
|
1
|
+
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../src/lib/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,kBAAkB,CAAA;AACzB,OAAO,qBAAqB,CAAA;AAC5B,OAAO,sBAAsB,CAAA;AAC7B,6BAA6B;AAC7B,OAAO,0BAA0B,CAAA;AACjC,OAAO,0BAA0B,CAAA;AACjC,OAAO,0BAA0B,CAAA"}
|
package/dist/es/lib/utils.js
CHANGED
@@ -1,6 +1,17 @@
|
|
1
|
+
/*!
|
2
|
+
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
+
*
|
4
|
+
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
+
*
|
6
|
+
* The Original Code is manuscripts-frontend.
|
7
|
+
*
|
8
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
+
*
|
10
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
11
|
+
*/
|
12
|
+
import { schema, } from '@manuscripts/transform';
|
1
13
|
export const getNodeTextContent = (node) => {
|
2
14
|
let textContent = '';
|
3
|
-
// Traverse the node and its descendants
|
4
15
|
node.forEach((child) => {
|
5
16
|
if (child.isText) {
|
6
17
|
// If the child is a text node, add its text content
|
@@ -13,6 +24,52 @@ export const getNodeTextContent = (node) => {
|
|
13
24
|
});
|
14
25
|
return textContent;
|
15
26
|
};
|
27
|
+
export const getContributorTextContent = (node, oldAttrs) => {
|
28
|
+
let textContent = '';
|
29
|
+
textContent += `${node.attrs.bibliographicName.given} ${node.attrs.bibliographicName.family}`;
|
30
|
+
if (oldAttrs) {
|
31
|
+
textContent =
|
32
|
+
`${oldAttrs.bibliographicName.given} ${oldAttrs.bibliographicName.family} to ` +
|
33
|
+
textContent;
|
34
|
+
}
|
35
|
+
return textContent;
|
36
|
+
};
|
37
|
+
export const getAffiliationTextContent = (node, oldAttrs) => {
|
38
|
+
let textContent = '';
|
39
|
+
textContent += `${node.attrs.institution}`;
|
40
|
+
if (oldAttrs) {
|
41
|
+
textContent = `${oldAttrs.institution} to ` + textContent;
|
42
|
+
}
|
43
|
+
return textContent;
|
44
|
+
};
|
45
|
+
export const findBibliographyById = (doc, id) => {
|
46
|
+
let bibNode = null;
|
47
|
+
doc.descendants((node) => {
|
48
|
+
if (node.type === schema.nodes.bibliography_item && node.attrs.id === id) {
|
49
|
+
bibNode = node;
|
50
|
+
return false; // stop traversal
|
51
|
+
}
|
52
|
+
if (bibNode) {
|
53
|
+
return false;
|
54
|
+
}
|
55
|
+
return true; // continue traversal
|
56
|
+
});
|
57
|
+
return bibNode;
|
58
|
+
};
|
59
|
+
export const getTextContentFromBibliography = (state, id) => {
|
60
|
+
const bib = findPluginByKey(state, 'bibliography')?.getState(state);
|
61
|
+
const [meta, bibliography] = bib.provider.makeBibliography();
|
62
|
+
const selectedBib = meta.entry_ids.findIndex((entry) => entry[0] == id);
|
63
|
+
const parser = new DOMParser();
|
64
|
+
const textContent = parser.parseFromString(bibliography[selectedBib], 'text/html').body.textContent;
|
65
|
+
return textContent ? textContent : '';
|
66
|
+
};
|
67
|
+
export const getFigureLabel = (state, node) => {
|
68
|
+
const objectsPlugin = findPluginByKey(state, 'objects');
|
69
|
+
const pluginState = objectsPlugin?.getState(state);
|
70
|
+
const target = pluginState?.get(node.attrs.id);
|
71
|
+
return target?.label || '';
|
72
|
+
};
|
16
73
|
export const findPluginByKey = (state, keyName) => {
|
17
74
|
for (let i = 0; i < state.plugins.length; i++) {
|
18
75
|
const plugin = state.plugins[i];
|
@@ -22,11 +79,50 @@ export const findPluginByKey = (state, keyName) => {
|
|
22
79
|
}
|
23
80
|
return null;
|
24
81
|
};
|
82
|
+
export const getEquationContent = (node) => {
|
83
|
+
if (node.firstChild && node.type === schema.nodes.equation_element) {
|
84
|
+
return node.firstChild.attrs.contents;
|
85
|
+
}
|
86
|
+
else if (node) {
|
87
|
+
return node.attrs.contents;
|
88
|
+
}
|
89
|
+
return '';
|
90
|
+
};
|
91
|
+
export const findFootnoteById = (doc, id) => {
|
92
|
+
let footnoteNode = null;
|
93
|
+
doc.descendants((node) => {
|
94
|
+
if (node.type === schema.nodes.footnote && node.attrs.id === id) {
|
95
|
+
footnoteNode = node;
|
96
|
+
return false;
|
97
|
+
}
|
98
|
+
if (footnoteNode) {
|
99
|
+
return false;
|
100
|
+
}
|
101
|
+
return true;
|
102
|
+
});
|
103
|
+
return footnoteNode;
|
104
|
+
};
|
105
|
+
export const getInlineFootnoteContent = (doc, attrs) => {
|
106
|
+
let footnote = null;
|
107
|
+
if (attrs.rids && attrs.rids.length > 0) {
|
108
|
+
footnote = findFootnoteById(doc, attrs.rids[0]);
|
109
|
+
}
|
110
|
+
return `<sup class="footnote-decoration">${attrs.contents ? attrs.contents : ''}</sup>${footnote ? footnote.textContent : ''}`;
|
111
|
+
};
|
112
|
+
export const getFootnoteText = (state, node) => {
|
113
|
+
const footnotesPlugin = findPluginByKey(state, 'footnotes');
|
114
|
+
const pluginState = footnotesPlugin?.getState(state);
|
115
|
+
let decorationText = '';
|
116
|
+
if (pluginState) {
|
117
|
+
decorationText = pluginState.labels.get(node.attrs.id);
|
118
|
+
}
|
119
|
+
return `<sup class="footnote-decoration">${decorationText ? decorationText : ''}</sup>${getNodeTextContent(node)}`;
|
120
|
+
};
|
25
121
|
export const getParentNode = (state, pos) => {
|
26
122
|
const resolvedPos = state.doc.resolve(pos);
|
27
123
|
for (let depth = resolvedPos.depth; depth > 0; depth--) {
|
28
124
|
const parent = resolvedPos.node(depth);
|
29
|
-
if (parent.
|
125
|
+
if (parent.isText === false) {
|
30
126
|
return parent;
|
31
127
|
}
|
32
128
|
}
|
package/dist/es/lib/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAGL,MAAM,GACP,MAAM,wBAAwB,CAAA;AAM/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAoB,EAAE,EAAE;IACzD,IAAI,WAAW,GAAG,EAAE,CAAA;IACpB,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,IAAI,KAAK,CAAC,MAAM,EAAE;YAChB,oDAAoD;YACpD,WAAW,IAAI,KAAK,CAAC,IAAI,CAAA;SAC1B;aAAM;YACL,oEAAoE;YACpE,WAAW,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAA;SACzC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;A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OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
@@ -1,14 +1,3 @@
|
|
1
|
-
/*!
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
3
|
-
*
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
5
|
-
*
|
6
|
-
* The Original Code is manuscripts-frontend.
|
7
|
-
*
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
9
|
-
*
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
11
|
-
*/
|
12
1
|
import { TrackedChange } from '@manuscripts/track-changes-plugin';
|
13
2
|
import React from 'react';
|
14
3
|
export declare const SuggestionSnippet: React.FC<{
|
@@ -15,6 +15,15 @@ interface ExtendedPlugin extends Plugin {
|
|
15
15
|
key: string;
|
16
16
|
}
|
17
17
|
export declare const getNodeTextContent: (node: ManuscriptNode) => string;
|
18
|
+
export declare const getContributorTextContent: (node: ManuscriptNode, oldAttrs: Record<any, any> | undefined) => string;
|
19
|
+
export declare const getAffiliationTextContent: (node: ManuscriptNode, oldAttrs: Record<any, any> | undefined) => string;
|
20
|
+
export declare const findBibliographyById: (doc: ManuscriptNode, id: string) => ManuscriptNode | null;
|
21
|
+
export declare const getTextContentFromBibliography: (state: ManuscriptEditorState, id: string) => string;
|
22
|
+
export declare const getFigureLabel: (state: ManuscriptEditorState, node: ManuscriptNode) => any;
|
18
23
|
export declare const findPluginByKey: (state: ManuscriptEditorState, keyName: string) => ExtendedPlugin | null;
|
24
|
+
export declare const getEquationContent: (node: ManuscriptNode) => any;
|
25
|
+
export declare const findFootnoteById: (doc: ManuscriptNode, id: string) => ManuscriptNode | null;
|
26
|
+
export declare const getInlineFootnoteContent: (doc: ManuscriptNode, attrs: Record<any, any>) => string;
|
27
|
+
export declare const getFootnoteText: (state: ManuscriptEditorState, node: ManuscriptNode) => string;
|
19
28
|
export declare const getParentNode: (state: EditorState, pos: number) => import("prosemirror-model").Node | null;
|
20
29
|
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@manuscripts/article-editor",
|
3
|
-
"version": "3.1.47-LEAN-
|
3
|
+
"version": "3.1.47-LEAN-3958.2",
|
4
4
|
"license": "CPAL-1.0",
|
5
5
|
"description": "React components for editing and viewing manuscripts",
|
6
6
|
"repository": "github:Atypon-OpenSource/manuscripts-article-editor",
|
@@ -35,18 +35,17 @@
|
|
35
35
|
"@fontsource/lato": "^4.5.10",
|
36
36
|
"@fontsource/pt-sans": "^4.5.11",
|
37
37
|
"@fontsource/pt-serif": "^4.5.11",
|
38
|
-
"@manuscripts/body-editor": "2.0.57-LEAN-
|
38
|
+
"@manuscripts/body-editor": "2.0.57-LEAN-3958.1",
|
39
39
|
"@manuscripts/json-schema": "2.2.11",
|
40
40
|
"@manuscripts/library": "1.3.11",
|
41
41
|
"@manuscripts/style-guide": "2.0.19",
|
42
|
-
"@manuscripts/track-changes-plugin": "1.7.
|
43
|
-
"@manuscripts/transform": "2.3.36",
|
42
|
+
"@manuscripts/track-changes-plugin": "1.7.22",
|
43
|
+
"@manuscripts/transform": "2.3.36-LEAN-3958.0",
|
44
44
|
"@popperjs/core": "^2.11.8",
|
45
45
|
"@reach/tabs": "^0.18.0",
|
46
46
|
"@types/use-sync-external-store": "^0.0.6",
|
47
47
|
"autotrack": "^2.4.1",
|
48
48
|
"axios": "^1.6.7",
|
49
|
-
"html-react-parser": "^5.1.16",
|
50
49
|
"http-status-codes": "^2.2.0",
|
51
50
|
"jwt-decode": "^3.1.2",
|
52
51
|
"lodash": "^4.17.21",
|
@@ -1,49 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*!
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
4
|
-
*
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
6
|
-
*
|
7
|
-
* The Original Code is manuscripts-frontend.
|
8
|
-
*
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
10
|
-
*
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
12
|
-
*/
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.getFootnoteText = exports.getInlineFootnoteContent = exports.findFootnoteById = void 0;
|
15
|
-
const utils_1 = require("./utils");
|
16
|
-
const findFootnoteById = (doc, id) => {
|
17
|
-
let footnoteNode = null;
|
18
|
-
doc.descendants((node) => {
|
19
|
-
if (node.type.name === 'footnote' && node.attrs.id === id) {
|
20
|
-
footnoteNode = node;
|
21
|
-
return false; // stop traversal
|
22
|
-
}
|
23
|
-
if (footnoteNode) {
|
24
|
-
return false;
|
25
|
-
}
|
26
|
-
return true; // continue traversal
|
27
|
-
});
|
28
|
-
return footnoteNode;
|
29
|
-
};
|
30
|
-
exports.findFootnoteById = findFootnoteById;
|
31
|
-
const getInlineFootnoteContent = (doc, attrs) => {
|
32
|
-
let footnote = null;
|
33
|
-
if (attrs.rids && attrs.rids.length > 0) {
|
34
|
-
footnote = (0, exports.findFootnoteById)(doc, attrs.rids[0]);
|
35
|
-
}
|
36
|
-
return `<sup class="footnote-decoration">${attrs.contents ? attrs.contents : ''}</sup>${footnote ? footnote.textContent : ''}`;
|
37
|
-
};
|
38
|
-
exports.getInlineFootnoteContent = getInlineFootnoteContent;
|
39
|
-
const getFootnoteText = (state, node) => {
|
40
|
-
const footnotesPlugin = (0, utils_1.findPluginByKey)(state, 'footnotes');
|
41
|
-
const pluginState = footnotesPlugin?.getState(state);
|
42
|
-
let decorationText = '';
|
43
|
-
if (pluginState) {
|
44
|
-
decorationText = pluginState.labels.get(node.attrs.id);
|
45
|
-
}
|
46
|
-
return `<sup class="footnote-decoration">${decorationText ? decorationText : ''}</sup>${(0, utils_1.getNodeTextContent)(node)}`;
|
47
|
-
};
|
48
|
-
exports.getFootnoteText = getFootnoteText;
|
49
|
-
//# sourceMappingURL=footnotes.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"footnotes.js","sourceRoot":"","sources":["../../../src/lib/footnotes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,mCAA6D;AAEtD,MAAM,gBAAgB,GAAG,CAC9B,GAAmB,EACnB,EAAU,EACa,EAAE;IACzB,IAAI,YAAY,GAA0B,IAAI,CAAA;IAE9C,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;QACvB,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE;YACzD,YAAY,GAAG,IAAI,CAAA;YACnB,OAAO,KAAK,CAAA,CAAC,iBAAiB;SAC/B;QACD,IAAI,YAAY,EAAE;YAChB,OAAO,KAAK,CAAA;SACb;QACD,OAAO,IAAI,CAAA,CAAC,qBAAqB;IACnC,CAAC,CAAC,CAAA;IACF,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AAjBY,QAAA,gBAAgB,oBAiB5B;AAEM,MAAM,wBAAwB,GAAG,CACtC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