@manuscripts/body-editor 2.0.24 → 2.0.25

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.
@@ -450,6 +450,16 @@ const insertSection = (subsection = false) => (state, dispatch, view) => {
450
450
  return true;
451
451
  };
452
452
  exports.insertSection = insertSection;
453
+ const sectionTitles = new Map([
454
+ ['MPSectionCategory:acknowledgement', 'Acknowledgments'],
455
+ ['MPSectionCategory:availability', 'Availability'],
456
+ ['MPSectionCategory:competing-interests', 'COI Statement'],
457
+ ['MPSectionCategory:con', 'Contributed-by information'],
458
+ ['MPSectionCategory:ethics-statement', 'Ethics Statement'],
459
+ ['MPSectionCategory:financial-disclosure', 'Financial Disclosure'],
460
+ ['MPSectionCategory:supplementary-material', 'Supplementary Material'],
461
+ ['MPSectionCategory:supported-by', 'Supported By'],
462
+ ]);
453
463
  const insertBackMatterSection = (category) => (state, dispatch, view) => {
454
464
  const backmatter = (0, doc_1.findBackmatter)(state.doc);
455
465
  const sections = (0, prosemirror_utils_1.findChildrenByType)(backmatter.node, transform_1.schema.nodes.section);
@@ -466,7 +476,9 @@ const insertBackMatterSection = (category) => (state, dispatch, view) => {
466
476
  }
467
477
  const node = transform_1.schema.nodes.section.createAndFill({
468
478
  category,
469
- });
479
+ }, [
480
+ transform_1.schema.nodes.section_title.create({}, transform_1.schema.text(sectionTitles.get(category) || '')),
481
+ ]);
470
482
  const tr = state.tr.insert(pos, node);
471
483
  if (dispatch) {
472
484
  const selection = prosemirror_state_1.TextSelection.create(tr.doc, pos);
@@ -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.0.24';
4
+ exports.VERSION = '2.0.25';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -425,6 +425,16 @@ export const insertSection = (subsection = false) => (state, dispatch, view) =>
425
425
  }
426
426
  return true;
427
427
  };
428
+ const sectionTitles = new Map([
429
+ ['MPSectionCategory:acknowledgement', 'Acknowledgments'],
430
+ ['MPSectionCategory:availability', 'Availability'],
431
+ ['MPSectionCategory:competing-interests', 'COI Statement'],
432
+ ['MPSectionCategory:con', 'Contributed-by information'],
433
+ ['MPSectionCategory:ethics-statement', 'Ethics Statement'],
434
+ ['MPSectionCategory:financial-disclosure', 'Financial Disclosure'],
435
+ ['MPSectionCategory:supplementary-material', 'Supplementary Material'],
436
+ ['MPSectionCategory:supported-by', 'Supported By'],
437
+ ]);
428
438
  export const insertBackMatterSection = (category) => (state, dispatch, view) => {
429
439
  const backmatter = findBackmatter(state.doc);
430
440
  const sections = findChildrenByType(backmatter.node, schema.nodes.section);
@@ -441,7 +451,9 @@ export const insertBackMatterSection = (category) => (state, dispatch, view) =>
441
451
  }
442
452
  const node = schema.nodes.section.createAndFill({
443
453
  category,
444
- });
454
+ }, [
455
+ schema.nodes.section_title.create({}, schema.text(sectionTitles.get(category) || '')),
456
+ ]);
445
457
  const tr = state.tr.insert(pos, node);
446
458
  if (dispatch) {
447
459
  const selection = TextSelection.create(tr.doc, pos);
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.0.24';
1
+ export const VERSION = '2.0.25';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { TableConfig } from '@manuscripts/style-guide';
17
- import { FootnoteNode, InlineFootnoteNode, ManuscriptEditorState, ManuscriptEditorView, ManuscriptMarkType, ManuscriptNode, ManuscriptNodeType, ManuscriptTransaction } from '@manuscripts/transform';
17
+ import { FootnoteNode, InlineFootnoteNode, ManuscriptEditorState, ManuscriptEditorView, ManuscriptMarkType, ManuscriptNode, ManuscriptNodeType, ManuscriptTransaction, SectionCategory } from '@manuscripts/transform';
18
18
  import { Attrs, ResolvedPos } from 'prosemirror-model';
19
19
  import { EditorState, NodeSelection, Selection, TextSelection, Transaction } from 'prosemirror-state';
20
20
  import { NodeWithPos } from 'prosemirror-utils';
@@ -44,7 +44,7 @@ export declare const insertFootnote: (state: ManuscriptEditorState, tr: Transact
44
44
  export declare const insertInlineFootnote: (kind: 'footnote' | 'endnote') => (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
45
45
  export declare const insertGraphicalAbstract: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
46
46
  export declare const insertSection: (subsection?: boolean) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
47
- export declare const insertBackMatterSection: (category: string) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
47
+ export declare const insertBackMatterSection: (category: SectionCategory) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
48
48
  export declare const insertAbstract: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
49
49
  export declare const insertContributors: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
50
50
  export declare const insertKeywords: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.0.24";
1
+ export declare const VERSION = "2.0.25";
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.0.24",
4
+ "version": "2.0.25",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",