@manuscripts/body-editor 3.8.11 → 3.8.12

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.
@@ -79,7 +79,7 @@ exports.default = (props) => {
79
79
  (0, comments_1.default)(),
80
80
  (0, paragraphs_1.default)(),
81
81
  (0, placeholder_1.default)(),
82
- (0, add_subtitle_1.default)(),
82
+ (0, add_subtitle_1.default)(props),
83
83
  (0, translations_1.default)(props),
84
84
  (0, prosemirror_tables_1.tableEditing)(),
85
85
  (0, selected_suggestion_1.default)(),
@@ -31,9 +31,13 @@ const createAddSubtitleButton = (handler) => {
31
31
  });
32
32
  return button;
33
33
  };
34
- exports.default = () => new prosemirror_state_1.Plugin({
34
+ exports.default = (props) => new prosemirror_state_1.Plugin({
35
35
  props: {
36
36
  decorations: (state) => {
37
+ const can = props.getCapabilities();
38
+ if (!can.editArticle) {
39
+ return prosemirror_view_1.DecorationSet.empty;
40
+ }
37
41
  let titleHasContent = false;
38
42
  let titlePos = -1;
39
43
  let hasSubtitles = 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 = '3.8.11';
4
+ exports.VERSION = '3.8.12';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -74,7 +74,7 @@ export default (props) => {
74
74
  comments(),
75
75
  paragraphs(),
76
76
  placeholder(),
77
- add_subtitle(),
77
+ add_subtitle(props),
78
78
  translations(props),
79
79
  tableEditing(),
80
80
  selected_suggestion(),
@@ -29,9 +29,13 @@ const createAddSubtitleButton = (handler) => {
29
29
  });
30
30
  return button;
31
31
  };
32
- export default () => new Plugin({
32
+ export default (props) => new Plugin({
33
33
  props: {
34
34
  decorations: (state) => {
35
+ const can = props.getCapabilities();
36
+ if (!can.editArticle) {
37
+ return DecorationSet.empty;
38
+ }
35
39
  let titleHasContent = false;
36
40
  let titlePos = -1;
37
41
  let hasSubtitles = false;
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.8.11';
1
+ export const VERSION = '3.8.12';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -14,5 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Plugin } from 'prosemirror-state';
17
- declare const _default: () => Plugin<null>;
17
+ import { EditorProps } from '../configs/ManuscriptsEditor';
18
+ declare const _default: (props: EditorProps) => Plugin<null>;
18
19
  export default _default;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.8.11";
1
+ export declare const VERSION = "3.8.12";
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": "3.8.11",
4
+ "version": "3.8.12",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",