@manuscripts/body-editor 1.5.9 → 1.5.10
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 +1 -1
- package/dist/cjs/plugins/sections.js +3 -2
- package/dist/cjs/views/contributors_section.js +2 -3
- package/dist/es/commands.js +1 -1
- package/dist/es/components/outline/OutlineManuscript.js +1 -1
- package/dist/es/plugins/sections.js +3 -2
- package/dist/es/views/contributors_section.js +2 -3
- package/dist/types/views/contributors_section.d.ts +2 -2
- package/package.json +3 -3
package/dist/cjs/commands.js
CHANGED
|
@@ -343,7 +343,7 @@ const insertGraphicalAbstract = (state, dispatch) => {
|
|
|
343
343
|
!(0, transform_1.isInAbstractsSection)(state.selection.$from)) {
|
|
344
344
|
return false;
|
|
345
345
|
}
|
|
346
|
-
if (
|
|
346
|
+
if (!(0, utils_1.getMatchingDescendant)(state.doc, (node) => node.type === state.schema.nodes.graphical_abstract_section)) {
|
|
347
347
|
return false;
|
|
348
348
|
}
|
|
349
349
|
const section = state.schema.nodes.graphical_abstract_section.createAndFill({ category: 'MPSectionCategory:abstract-graphical' }, [
|
|
@@ -33,12 +33,13 @@ const preventTitleEdit = (tr) => {
|
|
|
33
33
|
}
|
|
34
34
|
const hasReplaceAroundSteps = tr.steps.some((step) => step instanceof prosemirror_transform_1.ReplaceAroundStep);
|
|
35
35
|
if (!hasReplaceAroundSteps) {
|
|
36
|
-
tr.steps.forEach((step) => {
|
|
36
|
+
tr.steps.forEach((step, i) => {
|
|
37
37
|
if (!(step instanceof prosemirror_transform_1.ReplaceStep)) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
+
const currentDoc = tr.docs[i];
|
|
40
41
|
step.getMap().forEach((fromA, toA) => {
|
|
41
|
-
|
|
42
|
+
currentDoc.nodesBetween(fromA, toA, (node, nodePos) => {
|
|
42
43
|
if ((0, transform_1.isGraphicalAbstractSectionNode)(node) ||
|
|
43
44
|
(0, transform_1.isKeywordsSectionNode)(node)) {
|
|
44
45
|
node.descendants((childNode, childPos) => {
|
|
@@ -17,9 +17,8 @@ class ContributorsSectionView extends base_node_view_1.BaseNodeView {
|
|
|
17
17
|
this.dom = document.createElement('div');
|
|
18
18
|
this.dom.classList.add('contributors');
|
|
19
19
|
const can = this.props.getCapabilities();
|
|
20
|
-
const { components: {
|
|
21
|
-
this.metadata = (0, ReactSubView_1.default)(this.props,
|
|
22
|
-
allowInvitingAuthors: false,
|
|
20
|
+
const { components: { AuthorsInlineViewContainer }, subscribeStore, } = this.props;
|
|
21
|
+
this.metadata = (0, ReactSubView_1.default)(this.props, AuthorsInlineViewContainer, {
|
|
23
22
|
showAuthorEditButton: true,
|
|
24
23
|
disableEditButton: !can.editMetadata,
|
|
25
24
|
subscribe: subscribeStore,
|
package/dist/es/commands.js
CHANGED
|
@@ -301,7 +301,7 @@ export const insertGraphicalAbstract = (state, dispatch) => {
|
|
|
301
301
|
!isInAbstractsSection(state.selection.$from)) {
|
|
302
302
|
return false;
|
|
303
303
|
}
|
|
304
|
-
if (
|
|
304
|
+
if (!getMatchingDescendant(state.doc, (node) => node.type === state.schema.nodes.graphical_abstract_section)) {
|
|
305
305
|
return false;
|
|
306
306
|
}
|
|
307
307
|
const section = state.schema.nodes.graphical_abstract_section.createAndFill({ category: 'MPSectionCategory:abstract-graphical' }, [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import OutlineIconManuscript from '@manuscripts/assets/react/OutlineIconManuscript';
|
|
17
|
-
import { nodeTitle
|
|
17
|
+
import { nodeTitle } from '@manuscripts/transform';
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { Outline, OutlineItem, OutlineItemArrow, OutlineItemIcon, OutlineItemLink, OutlineItemLinkText, StyledTriangleCollapsed, } from './Outline';
|
|
20
20
|
export const OutlineManuscript = ({ project, manuscript, doc, }) => (React.createElement(Outline, null,
|
|
@@ -31,12 +31,13 @@ const preventTitleEdit = (tr) => {
|
|
|
31
31
|
}
|
|
32
32
|
const hasReplaceAroundSteps = tr.steps.some((step) => step instanceof ReplaceAroundStep);
|
|
33
33
|
if (!hasReplaceAroundSteps) {
|
|
34
|
-
tr.steps.forEach((step) => {
|
|
34
|
+
tr.steps.forEach((step, i) => {
|
|
35
35
|
if (!(step instanceof ReplaceStep)) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
+
const currentDoc = tr.docs[i];
|
|
38
39
|
step.getMap().forEach((fromA, toA) => {
|
|
39
|
-
|
|
40
|
+
currentDoc.nodesBetween(fromA, toA, (node, nodePos) => {
|
|
40
41
|
if (isGraphicalAbstractSectionNode(node) ||
|
|
41
42
|
isKeywordsSectionNode(node)) {
|
|
42
43
|
node.descendants((childNode, childPos) => {
|
|
@@ -11,9 +11,8 @@ export class ContributorsSectionView extends BaseNodeView {
|
|
|
11
11
|
this.dom = document.createElement('div');
|
|
12
12
|
this.dom.classList.add('contributors');
|
|
13
13
|
const can = this.props.getCapabilities();
|
|
14
|
-
const { components: {
|
|
15
|
-
this.metadata = ReactSubView(this.props,
|
|
16
|
-
allowInvitingAuthors: false,
|
|
14
|
+
const { components: { AuthorsInlineViewContainer }, subscribeStore, } = this.props;
|
|
15
|
+
this.metadata = ReactSubView(this.props, AuthorsInlineViewContainer, {
|
|
17
16
|
showAuthorEditButton: true,
|
|
18
17
|
disableEditButton: !can.editMetadata,
|
|
19
18
|
subscribe: subscribeStore,
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { BaseNodeView } from './base_node_view';
|
|
4
4
|
import { EditableBlockProps } from './editable_block';
|
|
5
5
|
export interface ContributorsSectionProps extends EditableBlockProps {
|
|
6
|
-
components: Record<string, React.ComponentType<
|
|
7
|
-
subscribeStore:
|
|
6
|
+
components: Record<string, React.ComponentType<unknown>>;
|
|
7
|
+
subscribeStore: unknown;
|
|
8
8
|
}
|
|
9
9
|
export declare class ContributorsSectionView<PropsType extends ContributorsSectionProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
|
|
10
10
|
private metadata;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.10",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"@manuscripts/assets": "^0.6.4",
|
|
31
31
|
"@manuscripts/json-schema": "2.2.1",
|
|
32
32
|
"@manuscripts/library": "1.2.2",
|
|
33
|
-
"@manuscripts/style-guide": "1.4.
|
|
33
|
+
"@manuscripts/style-guide": "1.4.6",
|
|
34
34
|
"@manuscripts/title-editor": "^1.1.0",
|
|
35
35
|
"@manuscripts/track-changes-plugin": "^1.7.3",
|
|
36
|
-
"@manuscripts/transform": "1.5.
|
|
36
|
+
"@manuscripts/transform": "1.5.5",
|
|
37
37
|
"astrocite-eutils": "^0.16.4",
|
|
38
38
|
"axios": "^1.2.2",
|
|
39
39
|
"codemirror": "^5.58.1",
|