@manuscripts/body-editor 3.9.7 → 3.9.8

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.
@@ -703,6 +703,9 @@ const findSelectedList = (selection) => (selection instanceof prosemirror_state_
703
703
  }) ||
704
704
  (0, prosemirror_utils_1.findParentNodeOfType)([transform_1.schema.nodes.list])(selection);
705
705
  const insertGraphicalAbstract = (category) => (state, dispatch, view) => {
706
+ if (!category) {
707
+ return false;
708
+ }
706
709
  const abstracts = (0, doc_1.findAbstractsNode)(state.doc);
707
710
  const sections = (0, prosemirror_utils_1.findChildrenByType)(abstracts.node, transform_1.schema.nodes.graphical_abstract_section);
708
711
  if (sections.some((s) => s.node.attrs.category === category.id)) {
package/dist/cjs/menus.js CHANGED
@@ -533,8 +533,8 @@ const getEditorMenus = (editor) => {
533
533
  {
534
534
  id: 'insert-graphical-abstract',
535
535
  label: 'Graphical Abstract',
536
- isEnabled: isCommandValid((0, commands_1.insertAbstractSection)(graphicalAbstractSection)),
537
- run: doCommand((0, commands_1.insertAbstractSection)(graphicalAbstractSection)),
536
+ isEnabled: isCommandValid((0, commands_1.insertGraphicalAbstract)(graphicalAbstractSection)),
537
+ run: doCommand((0, commands_1.insertGraphicalAbstract)(graphicalAbstractSection)),
538
538
  isHidden: !graphicalAbstractSection ||
539
539
  !(0, template_1.templateAllows)(state, transform_1.schema.nodes.graphical_abstract_section),
540
540
  },
@@ -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.9.7';
4
+ exports.VERSION = '3.9.8';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -669,6 +669,9 @@ const findSelectedList = (selection) => (selection instanceof NodeSelection &&
669
669
  }) ||
670
670
  findParentNodeOfType([schema.nodes.list])(selection);
671
671
  export const insertGraphicalAbstract = (category) => (state, dispatch, view) => {
672
+ if (!category) {
673
+ return false;
674
+ }
672
675
  const abstracts = findAbstractsNode(state.doc);
673
676
  const sections = findChildrenByType(abstracts.node, schema.nodes.graphical_abstract_section);
674
677
  if (sections.some((s) => s.node.attrs.category === category.id)) {
package/dist/es/menus.js CHANGED
@@ -530,8 +530,8 @@ export const getEditorMenus = (editor) => {
530
530
  {
531
531
  id: 'insert-graphical-abstract',
532
532
  label: 'Graphical Abstract',
533
- isEnabled: isCommandValid(insertAbstractSection(graphicalAbstractSection)),
534
- run: doCommand(insertAbstractSection(graphicalAbstractSection)),
533
+ isEnabled: isCommandValid(insertGraphicalAbstract(graphicalAbstractSection)),
534
+ run: doCommand(insertGraphicalAbstract(graphicalAbstractSection)),
535
535
  isHidden: !graphicalAbstractSection ||
536
536
  !templateAllows(state, schema.nodes.graphical_abstract_section),
537
537
  },
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.9.7';
1
+ export const VERSION = '3.9.8';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -53,7 +53,7 @@ export declare const insertBoxElement: (state: ManuscriptEditorState, dispatch?:
53
53
  export declare const insertSection: (subsection?: boolean) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
54
54
  export declare const insertAbstractSection: (category?: SectionCategory) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
55
55
  export declare const insertBackmatterSection: (category: SectionCategory) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
56
- export declare const insertGraphicalAbstract: (category: SectionCategory) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
56
+ export declare const insertGraphicalAbstract: (category?: SectionCategory) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
57
57
  export declare const insertContributors: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
58
58
  export declare const insertAffiliation: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
59
59
  export declare const insertAward: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.9.7";
1
+ export declare const VERSION = "3.9.8";
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.9.7",
4
+ "version": "3.9.8",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",