@manuscripts/body-editor 2.9.1-LEAN-4533.0 → 2.9.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.
@@ -115,4 +115,5 @@ exports.fieldConfigMap = {
115
115
  'comment',
116
116
  'URL',
117
117
  ]),
118
+ literal: new Set(['literal']),
118
119
  };
@@ -62,9 +62,7 @@ exports.default = (props) => {
62
62
  ? track_changes_plugin_1.TrackChangesStatus.viewSnapshots
63
63
  : props.getCapabilities().editWithoutTracking
64
64
  ? track_changes_plugin_1.TrackChangesStatus.disabled
65
- : props.getCapabilities().editArticle && !props.isComparingMode
66
- ? track_changes_plugin_1.TrackChangesStatus.enabled
67
- : track_changes_plugin_1.TrackChangesStatus.viewSnapshots,
65
+ : track_changes_plugin_1.TrackChangesStatus.enabled,
68
66
  }),
69
67
  (0, section_title_1.default)(),
70
68
  (0, tables_cursor_fix_1.default)(),
@@ -97,4 +97,5 @@ exports.bibliographyItemTypes = [
97
97
  ['standard', 'Standard'],
98
98
  ['dataset', 'Dataset'],
99
99
  ['preprint', 'Preprint'],
100
+ ['literal', 'Literal'],
100
101
  ];
@@ -40,14 +40,7 @@ const useEditor = (externalProps) => {
40
40
  const [state, setState] = (0, react_1.useState)(() => (0, ManuscriptsEditor_1.createEditorState)(props));
41
41
  const location = (0, react_router_dom_1.useLocation)();
42
42
  const { collabProvider } = props;
43
- (0, react_1.useEffect)(() => {
44
- if (view.current && props.isComparingMode) {
45
- const newState = (0, ManuscriptsEditor_1.createEditorState)(props);
46
- setState(newState);
47
- view.current.updateState(newState);
48
- }
49
- }, [props.doc, props.isComparingMode]);
50
- if (collabProvider && !props.isComparingMode) {
43
+ if (collabProvider) {
51
44
  collabProvider.onNewSteps(() => __awaiter(void 0, void 0, void 0, function* () {
52
45
  if (state && view.current) {
53
46
  const localVersion = (0, prosemirror_collab_1.getVersion)(view.current.state);
@@ -73,9 +66,7 @@ const useEditor = (externalProps) => {
73
66
  view.current.updateState(nextState);
74
67
  const trackState = track_changes_plugin_1.trackChangesPluginKey.getState(view.current.state);
75
68
  if (collabProvider &&
76
- (!trackState ||
77
- trackState.status !== track_changes_plugin_1.TrackChangesStatus.viewSnapshots) &&
78
- !props.isComparingMode) {
69
+ (!trackState || trackState.status !== track_changes_plugin_1.TrackChangesStatus.viewSnapshots)) {
79
70
  const sendable = (0, prosemirror_collab_1.sendableSteps)(nextState);
80
71
  if (sendable) {
81
72
  collabProvider.sendSteps(sendable.version, sendable.steps, sendable.clientID, false);
@@ -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.9.1-LEAN-4533.0';
4
+ exports.VERSION = '2.9.2';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -135,9 +135,10 @@ class ContributorsView extends block_view_1.default {
135
135
  action: () => this.handleEdit(''),
136
136
  icon: 'Edit',
137
137
  });
138
+ this.contextMenu = (0, ReactSubView_1.default)(this.props, style_guide_1.ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu']);
139
+ return this.contextMenu;
138
140
  }
139
- this.contextMenu = (0, ReactSubView_1.default)(this.props, style_guide_1.ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu']);
140
- return this.contextMenu;
141
+ return undefined;
141
142
  };
142
143
  this.actionGutterButtons = () => {
143
144
  const contextMenu = this.authorContextMenu();
@@ -112,4 +112,5 @@ export const fieldConfigMap = {
112
112
  'comment',
113
113
  'URL',
114
114
  ]),
115
+ literal: new Set(['literal']),
115
116
  };
@@ -57,9 +57,7 @@ export default (props) => {
57
57
  ? TrackChangesStatus.viewSnapshots
58
58
  : props.getCapabilities().editWithoutTracking
59
59
  ? TrackChangesStatus.disabled
60
- : props.getCapabilities().editArticle && !props.isComparingMode
61
- ? TrackChangesStatus.enabled
62
- : TrackChangesStatus.viewSnapshots,
60
+ : TrackChangesStatus.enabled,
63
61
  }),
64
62
  section_title(),
65
63
  table_editing_fix(),
@@ -67,4 +67,5 @@ export const bibliographyItemTypes = [
67
67
  ['standard', 'Standard'],
68
68
  ['dataset', 'Dataset'],
69
69
  ['preprint', 'Preprint'],
70
+ ['literal', 'Literal'],
70
71
  ];
@@ -37,14 +37,7 @@ export const useEditor = (externalProps) => {
37
37
  const [state, setState] = useState(() => createEditorState(props));
38
38
  const location = useLocation();
39
39
  const { collabProvider } = props;
40
- useEffect(() => {
41
- if (view.current && props.isComparingMode) {
42
- const newState = createEditorState(props);
43
- setState(newState);
44
- view.current.updateState(newState);
45
- }
46
- }, [props.doc, props.isComparingMode]);
47
- if (collabProvider && !props.isComparingMode) {
40
+ if (collabProvider) {
48
41
  collabProvider.onNewSteps(() => __awaiter(void 0, void 0, void 0, function* () {
49
42
  if (state && view.current) {
50
43
  const localVersion = getVersion(view.current.state);
@@ -70,9 +63,7 @@ export const useEditor = (externalProps) => {
70
63
  view.current.updateState(nextState);
71
64
  const trackState = trackChangesPluginKey.getState(view.current.state);
72
65
  if (collabProvider &&
73
- (!trackState ||
74
- trackState.status !== TrackChangesStatus.viewSnapshots) &&
75
- !props.isComparingMode) {
66
+ (!trackState || trackState.status !== TrackChangesStatus.viewSnapshots)) {
76
67
  const sendable = sendableSteps(nextState);
77
68
  if (sendable) {
78
69
  collabProvider.sendSteps(sendable.version, sendable.steps, sendable.clientID, false);
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.9.1-LEAN-4533.0';
1
+ export const VERSION = '2.9.2';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -129,9 +129,10 @@ export class ContributorsView extends BlockView {
129
129
  action: () => this.handleEdit(''),
130
130
  icon: 'Edit',
131
131
  });
132
+ this.contextMenu = ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu']);
133
+ return this.contextMenu;
132
134
  }
133
- this.contextMenu = ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu']);
134
- return this.contextMenu;
135
+ return undefined;
135
136
  };
136
137
  this.actionGutterButtons = () => {
137
138
  const contextMenu = this.authorContextMenu();
@@ -49,7 +49,6 @@ export interface EditorProps {
49
49
  collabProvider?: CollabProvider;
50
50
  navigate: NavigateFunction;
51
51
  location: Location;
52
- isComparingMode?: boolean;
53
52
  dispatch?: Dispatch;
54
53
  onEditorClick: (pos: number, node: ManuscriptNode, nodePos: number, event: MouseEvent) => void;
55
54
  lockBody: boolean;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.9.1-LEAN-4533.0";
1
+ export declare const VERSION = "2.9.2";
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.9.1-LEAN-4533.0",
4
+ "version": "2.9.2",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -32,8 +32,8 @@
32
32
  "@manuscripts/json-schema": "2.2.11",
33
33
  "@manuscripts/library": "1.3.14",
34
34
  "@manuscripts/style-guide": "2.1.13",
35
- "@manuscripts/track-changes-plugin": "1.10.8",
36
- "@manuscripts/transform": "3.1.1-LEAN-4533.0",
35
+ "@manuscripts/track-changes-plugin": "1.10.9",
36
+ "@manuscripts/transform": "3.1.2",
37
37
  "@popperjs/core": "^2.11.8",
38
38
  "astrocite-eutils": "^0.16.4",
39
39
  "codemirror": "^5.58.1",
@@ -902,19 +902,6 @@ figure.block:has(.equation.selected-suggestion) {
902
902
  border-color: var(--updated-border-color);
903
903
  }
904
904
 
905
- /* Needed for the snapshot comparison */
906
- .tracking-visible .block-list [data-track-op="insert"][data-track-status="pending"] {
907
- background: var(--inserted-pending-bg-color);
908
- color: var(--inserted-pending-color);
909
- text-decoration: underline;
910
- }
911
- /* Needed for the snapshot comparison */
912
- .tracking-visible .block-list [data-track-op="delete"][data-track-status="pending"] {
913
- background: var(--deleted-pending-bg-color);
914
- color: var(--deleted-color);
915
- text-decoration: line-through;
916
- }
917
-
918
905
  .selected-suggestion.contributor,
919
906
  .selected-suggestion.affiliation {
920
907
  text-decoration: none !important;