@manuscripts/body-editor 2.6.26 → 2.6.27
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 +3 -1
- package/dist/cjs/configs/editor-views.js +4 -0
- package/dist/cjs/lib/utils.js +8 -1
- package/dist/cjs/plugins/elements.js +2 -1
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/author_notes.js +3 -8
- package/dist/cjs/views/award.js +57 -0
- package/dist/cjs/views/awards.js +53 -0
- package/dist/cjs/views/cross_reference.js +1 -4
- package/dist/es/commands.js +3 -1
- package/dist/es/configs/editor-views.js +4 -0
- package/dist/es/lib/utils.js +6 -0
- package/dist/es/plugins/elements.js +2 -1
- package/dist/es/versions.js +1 -1
- package/dist/es/views/author_notes.js +3 -8
- package/dist/es/views/award.js +50 -0
- package/dist/es/views/awards.js +46 -0
- package/dist/es/views/cross_reference.js +1 -4
- package/dist/types/configs/editor-views.d.ts +2 -0
- package/dist/types/lib/utils.d.ts +1 -0
- package/dist/types/versions.d.ts +1 -1
- package/dist/types/views/author_notes.d.ts +0 -1
- package/dist/types/views/award.d.ts +25 -0
- package/dist/types/views/awards.d.ts +25 -0
- package/package.json +2 -2
- package/styles/AdvancedEditor.css +8 -2
package/dist/cjs/commands.js
CHANGED
|
@@ -826,7 +826,9 @@ const ignoreMetaNodeBackspaceCommand = (state) => {
|
|
|
826
826
|
selection.node.type === transform_1.schema.nodes.affiliations ||
|
|
827
827
|
selection.node.type === transform_1.schema.nodes.affiliation ||
|
|
828
828
|
selection.node.type === transform_1.schema.nodes.contributors ||
|
|
829
|
-
selection.node.type === transform_1.schema.nodes.contributor
|
|
829
|
+
selection.node.type === transform_1.schema.nodes.contributor ||
|
|
830
|
+
selection.node.type === transform_1.schema.nodes.awards ||
|
|
831
|
+
selection.node.type === transform_1.schema.nodes.award);
|
|
830
832
|
};
|
|
831
833
|
exports.ignoreMetaNodeBackspaceCommand = ignoreMetaNodeBackspaceCommand;
|
|
832
834
|
const findCutAfter = ($pos) => {
|
|
@@ -20,6 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const affiliations_1 = __importDefault(require("../views/affiliations"));
|
|
22
22
|
const author_notes_1 = __importDefault(require("../views/author_notes"));
|
|
23
|
+
const award_1 = __importDefault(require("../views/award"));
|
|
24
|
+
const awards_1 = __importDefault(require("../views/awards"));
|
|
23
25
|
const bibliography_element_1 = __importDefault(require("../views/bibliography_element"));
|
|
24
26
|
const blockquote_element_editable_1 = __importDefault(require("../views/blockquote_element_editable"));
|
|
25
27
|
const box_element_1 = __importDefault(require("../views/box_element"));
|
|
@@ -90,5 +92,7 @@ exports.default = (props, dispatch) => {
|
|
|
90
92
|
comments: (0, empty_1.default)('comments'),
|
|
91
93
|
supplements: (0, empty_1.default)('supplements'),
|
|
92
94
|
author_notes: (0, author_notes_1.default)(props, dispatch),
|
|
95
|
+
awards: (0, awards_1.default)(props, dispatch),
|
|
96
|
+
award: (0, award_1.default)(props, dispatch),
|
|
93
97
|
};
|
|
94
98
|
};
|
package/dist/cjs/lib/utils.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.isSelectionInNode = exports.isChildOfNodeTypes = exports.findParentElement = exports.findParentSection = exports.findParentNodeWithIdValue = exports.findParentNodeWithId = exports.getChildOfType = exports.getMatchingDescendant = exports.getMatchingChild = exports.iterateChildren = void 0;
|
|
18
|
+
exports.createHeader = exports.isSelectionInNode = exports.isChildOfNodeTypes = exports.findParentElement = exports.findParentSection = exports.findParentNodeWithIdValue = exports.findParentNodeWithId = exports.getChildOfType = exports.getMatchingDescendant = exports.getMatchingChild = exports.iterateChildren = void 0;
|
|
19
19
|
const transform_1 = require("@manuscripts/transform");
|
|
20
20
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
21
21
|
function* iterateChildren(node, recurse = false) {
|
|
@@ -79,3 +79,10 @@ const isSelectionInNode = (state, targetNode) => {
|
|
|
79
79
|
return false;
|
|
80
80
|
};
|
|
81
81
|
exports.isSelectionInNode = isSelectionInNode;
|
|
82
|
+
const createHeader = (typeName, text) => {
|
|
83
|
+
const header = document.createElement('h1');
|
|
84
|
+
header.classList.add(`title-${typeName}`, 'authors-info-header');
|
|
85
|
+
header.textContent = text;
|
|
86
|
+
return header;
|
|
87
|
+
};
|
|
88
|
+
exports.createHeader = createHeader;
|
|
@@ -26,7 +26,8 @@ exports.default = () => {
|
|
|
26
26
|
const decorations = [];
|
|
27
27
|
state.doc.descendants((node, pos, parent) => {
|
|
28
28
|
if (parent &&
|
|
29
|
-
((0, transform_1.isSectionNodeType)(parent.type) ||
|
|
29
|
+
((0, transform_1.isSectionNodeType)(parent.type) ||
|
|
30
|
+
parent.type === transform_1.schema.nodes.body) &&
|
|
30
31
|
node.type !== section) {
|
|
31
32
|
decorations.push(prosemirror_view_1.Decoration.node(pos, pos + node.nodeSize, {}, {
|
|
32
33
|
element: true,
|
package/dist/cjs/versions.js
CHANGED
|
@@ -19,6 +19,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.AuthorNotesView = void 0;
|
|
22
|
+
const utils_1 = require("../lib/utils");
|
|
22
23
|
const block_view_1 = __importDefault(require("./block_view"));
|
|
23
24
|
const creators_1 = require("./creators");
|
|
24
25
|
class AuthorNotesView extends block_view_1.default {
|
|
@@ -55,23 +56,17 @@ class AuthorNotesView extends block_view_1.default {
|
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
};
|
|
58
|
-
this.createHeader = (typeName, text) => {
|
|
59
|
-
const header = document.createElement('h1');
|
|
60
|
-
header.classList.add(`${typeName}-title`, 'block');
|
|
61
|
-
header.textContent = text;
|
|
62
|
-
return header;
|
|
63
|
-
};
|
|
64
59
|
this.createContent = (typeName, nodes) => {
|
|
65
60
|
let isNotEmpty = false;
|
|
66
61
|
if (nodes.length) {
|
|
67
62
|
const container = document.createElement('div');
|
|
68
63
|
container.classList.add(`${typeName}s-container`);
|
|
69
64
|
if (typeName === this.allowedTypes[0]) {
|
|
70
|
-
container.append(
|
|
65
|
+
container.append((0, utils_1.createHeader)(typeName, this.correspondenceHeader));
|
|
71
66
|
}
|
|
72
67
|
else if (!this.genericHeaderIsDisplayed) {
|
|
73
68
|
this.genericHeaderIsDisplayed = true;
|
|
74
|
-
container.append(
|
|
69
|
+
container.append((0, utils_1.createHeader)(typeName, this.genericHeader));
|
|
75
70
|
}
|
|
76
71
|
nodes.forEach((node) => {
|
|
77
72
|
if (node.textContent) {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.AwardView = void 0;
|
|
22
|
+
const block_view_1 = __importDefault(require("./block_view"));
|
|
23
|
+
const creators_1 = require("./creators");
|
|
24
|
+
class AwardView extends block_view_1.default {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.initialise = () => {
|
|
28
|
+
this.createDOM();
|
|
29
|
+
this.contentDOM = this.dom;
|
|
30
|
+
this.updateContents();
|
|
31
|
+
};
|
|
32
|
+
this.updateContents = () => {
|
|
33
|
+
if (!this.contentDOM) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.contentDOM.innerHTML = '';
|
|
37
|
+
this.contentDOM.classList.remove('block-container');
|
|
38
|
+
const notAvailable = 'N/A';
|
|
39
|
+
const { recipient, code, source } = this.node.attrs;
|
|
40
|
+
if (!source)
|
|
41
|
+
return;
|
|
42
|
+
const fragment = document.createDocumentFragment();
|
|
43
|
+
fragment.appendChild(this.createAwardElement('award-source', source));
|
|
44
|
+
fragment.appendChild(this.createAwardElement('award-code', `Grant Number(s): ${code ? code.split(';').join(', ') : notAvailable}`));
|
|
45
|
+
fragment.appendChild(this.createAwardElement('award-recipient', `Recipient: ${recipient ? recipient : notAvailable}`));
|
|
46
|
+
this.contentDOM.appendChild(fragment);
|
|
47
|
+
};
|
|
48
|
+
this.createAwardElement = (className, textContent) => {
|
|
49
|
+
const element = document.createElement('div');
|
|
50
|
+
element.classList.add(className);
|
|
51
|
+
element.textContent = textContent;
|
|
52
|
+
return element;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.AwardView = AwardView;
|
|
57
|
+
exports.default = (0, creators_1.createNodeView)(AwardView);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2024 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.AwardsView = void 0;
|
|
22
|
+
const utils_1 = require("../lib/utils");
|
|
23
|
+
const block_view_1 = __importDefault(require("./block_view"));
|
|
24
|
+
const creators_1 = require("./creators");
|
|
25
|
+
class AwardsView extends block_view_1.default {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.elementType = 'div';
|
|
29
|
+
this.createElement = () => {
|
|
30
|
+
this.wrapper = document.createElement(this.elementType);
|
|
31
|
+
this.wrapper.classList.add('block');
|
|
32
|
+
this.contentDOM = document.createElement(this.elementType);
|
|
33
|
+
this.contentDOM.className = 'block';
|
|
34
|
+
this.wrapper.appendChild(this.contentDOM);
|
|
35
|
+
this.dom.appendChild(this.wrapper);
|
|
36
|
+
};
|
|
37
|
+
this.updateContents = () => {
|
|
38
|
+
if (!this.contentDOM) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.dom.setAttribute('contenteditable', 'false');
|
|
42
|
+
this.contentDOM.setAttribute('contenteditable', 'false');
|
|
43
|
+
if (this.node.content.size !== 0) {
|
|
44
|
+
this.wrapper.innerHTML = '';
|
|
45
|
+
this.wrapper.setAttribute('contenteditable', 'false');
|
|
46
|
+
const header = (0, utils_1.createHeader)(this.node.type.name, 'Funder Information');
|
|
47
|
+
this.wrapper.append(header, this.contentDOM);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.AwardsView = AwardsView;
|
|
53
|
+
exports.default = (0, creators_1.createNodeView)(AwardsView);
|
|
@@ -39,10 +39,7 @@ class CrossReferenceView extends base_node_view_1.BaseNodeView {
|
|
|
39
39
|
var _a;
|
|
40
40
|
const targets = objects_1.objectsKey.getState(this.view.state);
|
|
41
41
|
const attrs = this.node.attrs;
|
|
42
|
-
const classes = [
|
|
43
|
-
'cross-reference',
|
|
44
|
-
...(0, track_changes_utils_1.getChangeClasses)(attrs.dataTracked),
|
|
45
|
-
];
|
|
42
|
+
const classes = ['cross-reference', ...(0, track_changes_utils_1.getChangeClasses)(attrs.dataTracked)];
|
|
46
43
|
this.dom.className = classes.join(' ');
|
|
47
44
|
const label = attrs.rids.length && ((_a = targets.get(attrs.rids[0])) === null || _a === void 0 ? void 0 : _a.label);
|
|
48
45
|
this.dom.textContent = attrs.label || label || '';
|
package/dist/es/commands.js
CHANGED
|
@@ -786,7 +786,9 @@ export const ignoreMetaNodeBackspaceCommand = (state) => {
|
|
|
786
786
|
selection.node.type === schema.nodes.affiliations ||
|
|
787
787
|
selection.node.type === schema.nodes.affiliation ||
|
|
788
788
|
selection.node.type === schema.nodes.contributors ||
|
|
789
|
-
selection.node.type === schema.nodes.contributor
|
|
789
|
+
selection.node.type === schema.nodes.contributor ||
|
|
790
|
+
selection.node.type === schema.nodes.awards ||
|
|
791
|
+
selection.node.type === schema.nodes.award);
|
|
790
792
|
};
|
|
791
793
|
const findCutAfter = ($pos) => {
|
|
792
794
|
if (!$pos.parent.type.spec.isolating) {
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import affiliations from '../views/affiliations';
|
|
17
17
|
import authorNotes from '../views/author_notes';
|
|
18
|
+
import award from '../views/award';
|
|
19
|
+
import awards from '../views/awards';
|
|
18
20
|
import bibliographyElement from '../views/bibliography_element';
|
|
19
21
|
import blockquoteElement from '../views/blockquote_element_editable';
|
|
20
22
|
import boxElement from '../views/box_element';
|
|
@@ -85,5 +87,7 @@ export default (props, dispatch) => {
|
|
|
85
87
|
comments: empty('comments'),
|
|
86
88
|
supplements: empty('supplements'),
|
|
87
89
|
author_notes: authorNotes(props, dispatch),
|
|
90
|
+
awards: awards(props, dispatch),
|
|
91
|
+
award: award(props, dispatch),
|
|
88
92
|
};
|
|
89
93
|
};
|
package/dist/es/lib/utils.js
CHANGED
|
@@ -69,3 +69,9 @@ export const isSelectionInNode = (state, targetNode) => {
|
|
|
69
69
|
}
|
|
70
70
|
return false;
|
|
71
71
|
};
|
|
72
|
+
export const createHeader = (typeName, text) => {
|
|
73
|
+
const header = document.createElement('h1');
|
|
74
|
+
header.classList.add(`title-${typeName}`, 'authors-info-header');
|
|
75
|
+
header.textContent = text;
|
|
76
|
+
return header;
|
|
77
|
+
};
|
|
@@ -24,7 +24,8 @@ export default () => {
|
|
|
24
24
|
const decorations = [];
|
|
25
25
|
state.doc.descendants((node, pos, parent) => {
|
|
26
26
|
if (parent &&
|
|
27
|
-
(isSectionNodeType(parent.type) ||
|
|
27
|
+
(isSectionNodeType(parent.type) ||
|
|
28
|
+
parent.type === schema.nodes.body) &&
|
|
28
29
|
node.type !== section) {
|
|
29
30
|
decorations.push(Decoration.node(pos, pos + node.nodeSize, {}, {
|
|
30
31
|
element: true,
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.6.
|
|
1
|
+
export const VERSION = '2.6.27';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { createHeader } from '../lib/utils';
|
|
16
17
|
import BlockView from './block_view';
|
|
17
18
|
import { createNodeView } from './creators';
|
|
18
19
|
export class AuthorNotesView extends BlockView {
|
|
@@ -49,23 +50,17 @@ export class AuthorNotesView extends BlockView {
|
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
|
-
this.createHeader = (typeName, text) => {
|
|
53
|
-
const header = document.createElement('h1');
|
|
54
|
-
header.classList.add(`${typeName}-title`, 'block');
|
|
55
|
-
header.textContent = text;
|
|
56
|
-
return header;
|
|
57
|
-
};
|
|
58
53
|
this.createContent = (typeName, nodes) => {
|
|
59
54
|
let isNotEmpty = false;
|
|
60
55
|
if (nodes.length) {
|
|
61
56
|
const container = document.createElement('div');
|
|
62
57
|
container.classList.add(`${typeName}s-container`);
|
|
63
58
|
if (typeName === this.allowedTypes[0]) {
|
|
64
|
-
container.append(
|
|
59
|
+
container.append(createHeader(typeName, this.correspondenceHeader));
|
|
65
60
|
}
|
|
66
61
|
else if (!this.genericHeaderIsDisplayed) {
|
|
67
62
|
this.genericHeaderIsDisplayed = true;
|
|
68
|
-
container.append(
|
|
63
|
+
container.append(createHeader(typeName, this.genericHeader));
|
|
69
64
|
}
|
|
70
65
|
nodes.forEach((node) => {
|
|
71
66
|
if (node.textContent) {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import BlockView from './block_view';
|
|
17
|
+
import { createNodeView } from './creators';
|
|
18
|
+
export class AwardView extends BlockView {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.initialise = () => {
|
|
22
|
+
this.createDOM();
|
|
23
|
+
this.contentDOM = this.dom;
|
|
24
|
+
this.updateContents();
|
|
25
|
+
};
|
|
26
|
+
this.updateContents = () => {
|
|
27
|
+
if (!this.contentDOM) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.contentDOM.innerHTML = '';
|
|
31
|
+
this.contentDOM.classList.remove('block-container');
|
|
32
|
+
const notAvailable = 'N/A';
|
|
33
|
+
const { recipient, code, source } = this.node.attrs;
|
|
34
|
+
if (!source)
|
|
35
|
+
return;
|
|
36
|
+
const fragment = document.createDocumentFragment();
|
|
37
|
+
fragment.appendChild(this.createAwardElement('award-source', source));
|
|
38
|
+
fragment.appendChild(this.createAwardElement('award-code', `Grant Number(s): ${code ? code.split(';').join(', ') : notAvailable}`));
|
|
39
|
+
fragment.appendChild(this.createAwardElement('award-recipient', `Recipient: ${recipient ? recipient : notAvailable}`));
|
|
40
|
+
this.contentDOM.appendChild(fragment);
|
|
41
|
+
};
|
|
42
|
+
this.createAwardElement = (className, textContent) => {
|
|
43
|
+
const element = document.createElement('div');
|
|
44
|
+
element.classList.add(className);
|
|
45
|
+
element.textContent = textContent;
|
|
46
|
+
return element;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export default createNodeView(AwardView);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2024 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { createHeader } from '../lib/utils';
|
|
17
|
+
import BlockView from './block_view';
|
|
18
|
+
import { createNodeView } from './creators';
|
|
19
|
+
export class AwardsView extends BlockView {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.elementType = 'div';
|
|
23
|
+
this.createElement = () => {
|
|
24
|
+
this.wrapper = document.createElement(this.elementType);
|
|
25
|
+
this.wrapper.classList.add('block');
|
|
26
|
+
this.contentDOM = document.createElement(this.elementType);
|
|
27
|
+
this.contentDOM.className = 'block';
|
|
28
|
+
this.wrapper.appendChild(this.contentDOM);
|
|
29
|
+
this.dom.appendChild(this.wrapper);
|
|
30
|
+
};
|
|
31
|
+
this.updateContents = () => {
|
|
32
|
+
if (!this.contentDOM) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.dom.setAttribute('contenteditable', 'false');
|
|
36
|
+
this.contentDOM.setAttribute('contenteditable', 'false');
|
|
37
|
+
if (this.node.content.size !== 0) {
|
|
38
|
+
this.wrapper.innerHTML = '';
|
|
39
|
+
this.wrapper.setAttribute('contenteditable', 'false');
|
|
40
|
+
const header = createHeader(this.node.type.name, 'Funder Information');
|
|
41
|
+
this.wrapper.append(header, this.contentDOM);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export default createNodeView(AwardsView);
|
|
@@ -36,10 +36,7 @@ export class CrossReferenceView extends BaseNodeView {
|
|
|
36
36
|
var _a;
|
|
37
37
|
const targets = objectsKey.getState(this.view.state);
|
|
38
38
|
const attrs = this.node.attrs;
|
|
39
|
-
const classes = [
|
|
40
|
-
'cross-reference',
|
|
41
|
-
...getChangeClasses(attrs.dataTracked),
|
|
42
|
-
];
|
|
39
|
+
const classes = ['cross-reference', ...getChangeClasses(attrs.dataTracked)];
|
|
43
40
|
this.dom.className = classes.join(' ');
|
|
44
41
|
const label = attrs.rids.length && ((_a = targets.get(attrs.rids[0])) === null || _a === void 0 ? void 0 : _a.label);
|
|
45
42
|
this.dom.textContent = attrs.label || label || '';
|
|
@@ -372,5 +372,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
372
372
|
dom: HTMLDivElement;
|
|
373
373
|
};
|
|
374
374
|
author_notes: import("../types").NodeViewCreator<import("../views/author_notes").AuthorNotesView>;
|
|
375
|
+
awards: import("../types").NodeViewCreator<import("../views/awards").AwardsView>;
|
|
376
|
+
award: import("../types").NodeViewCreator<import("../views/award").AwardView>;
|
|
375
377
|
};
|
|
376
378
|
export default _default;
|
|
@@ -26,3 +26,4 @@ export declare const findParentSection: (selection: Selection) => import("prosem
|
|
|
26
26
|
export declare const findParentElement: (selection: Selection, validIds?: string[]) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
27
27
|
export declare const isChildOfNodeTypes: (doc: ManuscriptNode, pos: number, parentNodeTypes: NodeType[]) => boolean;
|
|
28
28
|
export declare const isSelectionInNode: (state: EditorState, targetNode: ProseMirrorNode) => boolean;
|
|
29
|
+
export declare const createHeader: (typeName: string, text: string) => HTMLHeadingElement;
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.6.
|
|
1
|
+
export declare const VERSION = "2.6.27";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
|
@@ -26,7 +26,6 @@ export declare class AuthorNotesView extends BlockView<Trackable<AuthorNotesNode
|
|
|
26
26
|
stopEvent: () => boolean;
|
|
27
27
|
createElement: () => void;
|
|
28
28
|
updateContents: () => void;
|
|
29
|
-
createHeader: (typeName: string, text: string) => HTMLHeadingElement;
|
|
30
29
|
createContent: (typeName: string, nodes: ManuscriptNode[]) => HTMLDivElement | null;
|
|
31
30
|
}
|
|
32
31
|
declare const _default: (props: import("./base_node_view").BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<AuthorNotesView>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { AwardNode } from '@manuscripts/transform';
|
|
17
|
+
import { Trackable } from '../types';
|
|
18
|
+
import BlockView from './block_view';
|
|
19
|
+
export declare class AwardView extends BlockView<Trackable<AwardNode>> {
|
|
20
|
+
initialise: () => void;
|
|
21
|
+
updateContents: () => void;
|
|
22
|
+
private createAwardElement;
|
|
23
|
+
}
|
|
24
|
+
declare const _default: (props: import("./base_node_view").BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<AwardView>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2024 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { AwardsNode } from '@manuscripts/transform';
|
|
17
|
+
import BlockView from './block_view';
|
|
18
|
+
export declare class AwardsView extends BlockView<AwardsNode> {
|
|
19
|
+
elementType: string;
|
|
20
|
+
wrapper: HTMLElement;
|
|
21
|
+
createElement: () => void;
|
|
22
|
+
updateContents: () => void;
|
|
23
|
+
}
|
|
24
|
+
declare const _default: (props: import("./base_node_view").BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<AwardsView>;
|
|
25
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "2.6.
|
|
4
|
+
"version": "2.6.27",
|
|
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.25",
|
|
36
36
|
"@manuscripts/track-changes-plugin": "1.8.4",
|
|
37
|
-
"@manuscripts/transform": "3.0.
|
|
37
|
+
"@manuscripts/transform": "3.0.23",
|
|
38
38
|
"@popperjs/core": "^2.11.8",
|
|
39
39
|
"astrocite-eutils": "^0.16.4",
|
|
40
40
|
"codemirror": "^5.58.1",
|
|
@@ -362,8 +362,7 @@ span.comment-marker {
|
|
|
362
362
|
font-weight: 400 !important;
|
|
363
363
|
line-height: 16px !important;
|
|
364
364
|
}
|
|
365
|
-
|
|
366
|
-
.ProseMirror .author-notes-container h1 {
|
|
365
|
+
.ProseMirror h1.authors-info-header {
|
|
367
366
|
color: #353535 !important;
|
|
368
367
|
font-size: 16px !important;
|
|
369
368
|
font-weight: 700 !important;
|
|
@@ -371,9 +370,11 @@ span.comment-marker {
|
|
|
371
370
|
margin: 0 !important;
|
|
372
371
|
}
|
|
373
372
|
|
|
373
|
+
.ProseMirror .block-award,
|
|
374
374
|
.ProseMirror .author-notes-container > div {
|
|
375
375
|
margin-bottom: 16px;
|
|
376
376
|
}
|
|
377
|
+
.ProseMirror .block-award:last-child,
|
|
377
378
|
.ProseMirror .author-notes-container > div:last-child {
|
|
378
379
|
margin-bottom: 0;
|
|
379
380
|
}
|
|
@@ -708,10 +709,15 @@ span.selected-suggestion,
|
|
|
708
709
|
text-decoration: underline;
|
|
709
710
|
}
|
|
710
711
|
.block-contributors,
|
|
712
|
+
.block-author_notes,
|
|
713
|
+
.block-awards,
|
|
711
714
|
.block-affiliations,
|
|
712
715
|
.keywords {
|
|
713
716
|
margin: 15px 0px;
|
|
714
717
|
}
|
|
718
|
+
.block-awards.empty-node {
|
|
719
|
+
display: none;
|
|
720
|
+
}
|
|
715
721
|
.contributors {
|
|
716
722
|
display: flex;
|
|
717
723
|
align-items: flex-start;
|