@manuscripts/body-editor 2.8.77-LEAN-4558.2 → 2.8.78

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.
@@ -106,12 +106,7 @@ const AuthorDetailsForm = ({ values, onChange, onSave, actionsRef, isEmailRequir
106
106
  react_1.default.createElement(CheckboxContainer, null,
107
107
  react_1.default.createElement(style_guide_1.CheckboxLabel, { disabled: !isAuthor },
108
108
  react_1.default.createElement(formik_1.Field, { name: 'isCorresponding' }, (props) => (react_1.default.createElement(style_guide_1.CheckboxField, Object.assign({ id: 'isCorresponding', checked: props.field.value, disabled: !isAuthor }, props.field)))),
109
- react_1.default.createElement(exports.LabelText, null, "Corresponding Author")),
110
- react_1.default.createElement(style_guide_1.CheckboxLabel, null,
111
- react_1.default.createElement(formik_1.Field, { name: 'role', type: 'checkbox' }, (props) => (react_1.default.createElement(style_guide_1.CheckboxField, { name: 'role', checked: isAuthor, onChange: (e) => {
112
- formik.setFieldValue(props.field.name, e.target.checked ? 'author' : 'other', false);
113
- } }))),
114
- react_1.default.createElement(exports.LabelText, null, "Include in Authors List"))),
109
+ react_1.default.createElement(exports.LabelText, null, "Corresponding Author"))),
115
110
  react_1.default.createElement(OrcidContainer, null,
116
111
  react_1.default.createElement(style_guide_1.TextFieldLabel, null,
117
112
  react_1.default.createElement(exports.LabelText, null, "ORCID"),
@@ -54,7 +54,7 @@ const isHeaderCellSelected = (state) => {
54
54
  }
55
55
  return (((_a = state.doc.nodeAt(state.selection.from)) === null || _a === void 0 ? void 0 : _a.type) === transform_1.schema.nodes.table_header);
56
56
  };
57
- const TableChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) => (react_1.default.createElement(style_guide_1.Dialog, { isOpen: isOpen, category: style_guide_1.Category.confirmation, header: "This change can't be tracked", message: "This action won't be marked as change. Do you want to continue?", actions: {
57
+ const TableChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) => (react_1.default.createElement(style_guide_1.Dialog, { isOpen: isOpen, category: style_guide_1.Category.confirmation, header: "This change can't be tracked", message: "This action won't be marked as chnage. Do you want to continue?", actions: {
58
58
  primary: { action: primaryAction, title: 'Ok' },
59
59
  secondary: { action: secondaryAction, title: 'Cancel' },
60
60
  } }));
@@ -57,11 +57,11 @@ exports.default = (props) => {
57
57
  (0, track_changes_plugin_1.trackChangesPlugin)({
58
58
  userID: props.userID,
59
59
  debug: props.debug,
60
- initialStatus: props.isViewingMode
61
- ? track_changes_plugin_1.TrackChangesStatus.viewSnapshots
62
- : props.getCapabilities().editWithoutTracking
63
- ? track_changes_plugin_1.TrackChangesStatus.disabled
64
- : track_changes_plugin_1.TrackChangesStatus.enabled,
60
+ initialStatus: props.getCapabilities().editWithoutTracking
61
+ ? track_changes_plugin_1.TrackChangesStatus.disabled
62
+ : props.getCapabilities().editArticle
63
+ ? track_changes_plugin_1.TrackChangesStatus.enabled
64
+ : track_changes_plugin_1.TrackChangesStatus.viewSnapshots,
65
65
  }),
66
66
  (0, section_title_1.default)(),
67
67
  (0, tables_cursor_fix_1.default)(),
@@ -77,7 +77,7 @@ const useEditor = (externalProps) => {
77
77
  }, 250, !tr.isGeneric || !tr.docChanged || !tr.getMeta(search_replace_1.searchReplaceKey));
78
78
  return nextState;
79
79
  }, []);
80
- const isViewingMode = props.isViewingMode;
80
+ const canEdit = props.getCapabilities().editArticle;
81
81
  const onRender = (0, react_1.useCallback)((el) => {
82
82
  if (!el) {
83
83
  return;
@@ -85,7 +85,7 @@ const useEditor = (externalProps) => {
85
85
  const freshState = (0, ManuscriptsEditor_1.createEditorState)(props);
86
86
  view.current = (0, ManuscriptsEditor_1.createEditorView)(props, el, freshState || state, dispatch);
87
87
  setState(view.current.state);
88
- }, [isViewingMode]);
88
+ }, [canEdit]);
89
89
  const isCommandValid = (0, react_1.useCallback)((command) => command(state), [state]);
90
90
  const doCommand = (0, react_1.useCallback)((command) => command(state, dispatch, view.current), [state, dispatch]);
91
91
  const replaceState = (0, react_1.useCallback)((state) => {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MATHJAX_VERSION = exports.VERSION = void 0;
4
- exports.VERSION = '2.8.77-LEAN-4558.2';
4
+ exports.VERSION = '2.8.78';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -77,12 +77,7 @@ export const AuthorDetailsForm = ({ values, onChange, onSave, actionsRef, isEmai
77
77
  React.createElement(CheckboxContainer, null,
78
78
  React.createElement(CheckboxLabel, { disabled: !isAuthor },
79
79
  React.createElement(Field, { name: 'isCorresponding' }, (props) => (React.createElement(CheckboxField, Object.assign({ id: 'isCorresponding', checked: props.field.value, disabled: !isAuthor }, props.field)))),
80
- React.createElement(LabelText, null, "Corresponding Author")),
81
- React.createElement(CheckboxLabel, null,
82
- React.createElement(Field, { name: 'role', type: 'checkbox' }, (props) => (React.createElement(CheckboxField, { name: 'role', checked: isAuthor, onChange: (e) => {
83
- formik.setFieldValue(props.field.name, e.target.checked ? 'author' : 'other', false);
84
- } }))),
85
- React.createElement(LabelText, null, "Include in Authors List"))),
80
+ React.createElement(LabelText, null, "Corresponding Author"))),
86
81
  React.createElement(OrcidContainer, null,
87
82
  React.createElement(TextFieldLabel, null,
88
83
  React.createElement(LabelText, null, "ORCID"),
@@ -25,7 +25,7 @@ const isHeaderCellSelected = (state) => {
25
25
  }
26
26
  return (((_a = state.doc.nodeAt(state.selection.from)) === null || _a === void 0 ? void 0 : _a.type) === schema.nodes.table_header);
27
27
  };
28
- const TableChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) => (React.createElement(Dialog, { isOpen: isOpen, category: Category.confirmation, header: "This change can't be tracked", message: "This action won't be marked as change. Do you want to continue?", actions: {
28
+ const TableChangeWarningDialog = ({ isOpen, primaryAction, secondaryAction }) => (React.createElement(Dialog, { isOpen: isOpen, category: Category.confirmation, header: "This change can't be tracked", message: "This action won't be marked as chnage. Do you want to continue?", actions: {
29
29
  primary: { action: primaryAction, title: 'Ok' },
30
30
  secondary: { action: secondaryAction, title: 'Cancel' },
31
31
  } }));
@@ -52,11 +52,11 @@ export default (props) => {
52
52
  trackChangesPlugin({
53
53
  userID: props.userID,
54
54
  debug: props.debug,
55
- initialStatus: props.isViewingMode
56
- ? TrackChangesStatus.viewSnapshots
57
- : props.getCapabilities().editWithoutTracking
58
- ? TrackChangesStatus.disabled
59
- : TrackChangesStatus.enabled,
55
+ initialStatus: props.getCapabilities().editWithoutTracking
56
+ ? TrackChangesStatus.disabled
57
+ : props.getCapabilities().editArticle
58
+ ? TrackChangesStatus.enabled
59
+ : TrackChangesStatus.viewSnapshots,
60
60
  }),
61
61
  section_title(),
62
62
  table_editing_fix(),
@@ -74,7 +74,7 @@ export const useEditor = (externalProps) => {
74
74
  }, 250, !tr.isGeneric || !tr.docChanged || !tr.getMeta(searchReplaceKey));
75
75
  return nextState;
76
76
  }, []);
77
- const isViewingMode = props.isViewingMode;
77
+ const canEdit = props.getCapabilities().editArticle;
78
78
  const onRender = useCallback((el) => {
79
79
  if (!el) {
80
80
  return;
@@ -82,7 +82,7 @@ export const useEditor = (externalProps) => {
82
82
  const freshState = createEditorState(props);
83
83
  view.current = createEditorView(props, el, freshState || state, dispatch);
84
84
  setState(view.current.state);
85
- }, [isViewingMode]);
85
+ }, [canEdit]);
86
86
  const isCommandValid = useCallback((command) => command(state), [state]);
87
87
  const doCommand = useCallback((command) => command(state, dispatch, view.current), [state, dispatch]);
88
88
  const replaceState = useCallback((state) => {
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.8.77-LEAN-4558.2';
1
+ export const VERSION = '2.8.78';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -52,7 +52,6 @@ export interface EditorProps {
52
52
  dispatch?: Dispatch;
53
53
  onEditorClick: (pos: number, node: ManuscriptNode, nodePos: number, event: MouseEvent) => void;
54
54
  lockBody: boolean;
55
- isViewingMode?: boolean;
56
55
  }
57
56
  export type ExternalProps = Omit<EditorProps, 'popper' | 'dispatch'>;
58
57
  export declare const createEditorState: (props: EditorProps) => EditorState;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.8.77-LEAN-4558.2";
1
+ export declare const VERSION = "2.8.78";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/body-editor",
3
3
  "description": "Prosemirror components for editing and viewing manuscripts",
4
- "version": "2.8.77-LEAN-4558.2",
4
+ "version": "2.8.78",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",