@manuscripts/body-editor 2.0.36-LEAN-3883.0 → 2.0.36

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.
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.autoComplete = exports.mergeCellsWithSpace = exports.addColumns = exports.addRows = exports.insertTableFootnote = exports.addInlineComment = exports.addNodeComment = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreMetaNodeBackspaceCommand = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.insertTOCSection = exports.insertBibliographySection = exports.insertList = exports.insertKeywords = exports.insertContributors = exports.insertAbstract = exports.insertBackMatterSection = exports.insertSection = exports.insertGraphicalAbstract = exports.insertInlineFootnote = exports.insertFootnote = exports.createFootnote = exports.insertInlineEquation = exports.insertCrossReference = exports.insertInlineCitation = exports.insertLink = exports.insertSectionLabel = exports.findPosBeforeFirstSubsection = exports.insertBreak = exports.deleteBlock = exports.insertBlock = exports.insertSupplement = exports.insertFigure = exports.insertGeneralFootnote = exports.createBlock = exports.createSelection = exports.canInsert = exports.blockActive = exports.isNodeSelection = exports.markActive = void 0;
18
+ exports.mergeCellsWithSpace = exports.addColumns = exports.addRows = exports.insertTableFootnote = exports.addInlineComment = exports.addNodeComment = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreMetaNodeBackspaceCommand = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.insertTOCSection = exports.insertBibliographySection = exports.insertList = exports.insertKeywords = exports.insertContributors = exports.insertAbstract = exports.insertBackMatterSection = exports.insertSection = exports.insertGraphicalAbstract = exports.insertInlineFootnote = exports.insertFootnote = exports.createFootnote = exports.insertInlineEquation = exports.insertCrossReference = exports.insertInlineCitation = exports.insertLink = exports.insertSectionLabel = exports.findPosBeforeFirstSubsection = exports.insertBreak = exports.deleteBlock = exports.insertBlock = exports.insertSupplement = exports.insertFigure = exports.insertGeneralFootnote = exports.createBlock = exports.createSelection = exports.canInsert = exports.blockActive = exports.isNodeSelection = exports.markActive = void 0;
19
19
  const json_schema_1 = require("@manuscripts/json-schema");
20
20
  const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
21
21
  const transform_1 = require("@manuscripts/transform");
@@ -28,14 +28,12 @@ const prosemirror_utils_1 = require("prosemirror-utils");
28
28
  const comments_1 = require("./lib/comments");
29
29
  const doc_1 = require("./lib/doc");
30
30
  const helpers_1 = require("./lib/helpers");
31
- const section_titles_1 = require("./lib/section-titles");
32
31
  const track_changes_utils_1 = require("./lib/track-changes-utils");
33
32
  const utils_1 = require("./lib/utils");
34
33
  const comments_2 = require("./plugins/comments");
35
34
  const editor_props_1 = require("./plugins/editor-props");
36
35
  const footnotes_1 = require("./plugins/footnotes");
37
36
  const footnotes_utils_1 = require("./plugins/footnotes/footnotes-utils");
38
- const autocompletion_1 = require("./plugins/section_title/autocompletion");
39
37
  const markActive = (type) => (state) => {
40
38
  const { from, $from, to, empty } = state.selection;
41
39
  return empty
@@ -474,6 +472,16 @@ const insertSection = (subsection = false) => (state, dispatch, view) => {
474
472
  return true;
475
473
  };
476
474
  exports.insertSection = insertSection;
475
+ const sectionTitles = new Map([
476
+ ['MPSectionCategory:acknowledgement', 'Acknowledgments'],
477
+ ['MPSectionCategory:availability', 'Availability'],
478
+ ['MPSectionCategory:competing-interests', 'COI Statement'],
479
+ ['MPSectionCategory:con', 'Contributed-by information'],
480
+ ['MPSectionCategory:ethics-statement', 'Ethics Statement'],
481
+ ['MPSectionCategory:financial-disclosure', 'Financial Disclosure'],
482
+ ['MPSectionCategory:supplementary-material', 'Supplementary Material'],
483
+ ['MPSectionCategory:supported-by', 'Supported By'],
484
+ ]);
477
485
  const insertBackMatterSection = (category) => (state, dispatch, view) => {
478
486
  const backmatter = (0, doc_1.findBackmatter)(state.doc);
479
487
  const sections = (0, prosemirror_utils_1.findChildrenByType)(backmatter.node, transform_1.schema.nodes.section);
@@ -491,7 +499,7 @@ const insertBackMatterSection = (category) => (state, dispatch, view) => {
491
499
  const node = transform_1.schema.nodes.section.createAndFill({
492
500
  category,
493
501
  }, [
494
- transform_1.schema.nodes.section_title.create({}, transform_1.schema.text(section_titles_1.sectionTitles.get(category) || '')),
502
+ transform_1.schema.nodes.section_title.create({}, transform_1.schema.text(sectionTitles.get(category) || '')),
495
503
  ]);
496
504
  const tr = state.tr.insert(pos, node);
497
505
  if (dispatch) {
@@ -1118,13 +1126,3 @@ function mergeCellsWithSpace(state, dispatch) {
1118
1126
  return true;
1119
1127
  }
1120
1128
  exports.mergeCellsWithSpace = mergeCellsWithSpace;
1121
- const autoComplete = (state, dispatch) => {
1122
- const autocompleteText = (0, autocompletion_1.checkForCompletion)(state);
1123
- if (autocompleteText) {
1124
- const tr = state.tr.insertText(autocompleteText, state.selection.from);
1125
- dispatch && dispatch(tr);
1126
- return true;
1127
- }
1128
- return false;
1129
- };
1130
- exports.autoComplete = autoComplete;
@@ -39,7 +39,6 @@ const customKeymap = {
39
39
  'Mod-Alt-=': (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.superscript),
40
40
  'Mod-Alt--': (0, prosemirror_commands_1.toggleMark)(transform_1.schema.marks.subscript),
41
41
  'Ctrl->': (0, prosemirror_commands_1.wrapIn)(transform_1.schema.nodes.blockquote),
42
- Enter: (0, prosemirror_commands_1.chainCommands)(commands_1.autoComplete, prosemirror_commands_1.newlineInCode, prosemirror_commands_1.createParagraphNear, prosemirror_commands_1.liftEmptyBlock, prosemirror_commands_1.splitBlock),
43
42
  'Shift-Mod-Enter': (0, commands_1.insertSection)(true),
44
43
  'Mod-Enter': (0, prosemirror_commands_1.chainCommands)(prosemirror_commands_1.exitCode, (0, commands_1.insertSection)()),
45
44
  'Shift-Enter': (0, prosemirror_commands_1.chainCommands)(prosemirror_commands_1.exitCode, commands_1.insertBreak),
@@ -4,9 +4,7 @@ exports.sectionTitleKey = void 0;
4
4
  const transform_1 = require("@manuscripts/transform");
5
5
  const prosemirror_state_1 = require("prosemirror-state");
6
6
  const prosemirror_utils_1 = require("prosemirror-utils");
7
- const prosemirror_view_1 = require("prosemirror-view");
8
- const track_changes_utils_1 = require("../../lib/track-changes-utils");
9
- const autocompletion_1 = require("./autocompletion");
7
+ const track_changes_utils_1 = require("../lib/track-changes-utils");
10
8
  exports.sectionTitleKey = new prosemirror_state_1.PluginKey('sectionNumbering');
11
9
  const calculateSectionLevels = (node, startPos, sectionNumberMap, numbering = [0]) => {
12
10
  node.forEach((childNode, offset) => {
@@ -37,21 +35,6 @@ const getPluginState = (doc) => {
37
35
  exports.default = () => {
38
36
  return new prosemirror_state_1.Plugin({
39
37
  key: exports.sectionTitleKey,
40
- props: {
41
- decorations(state) {
42
- const text = (0, autocompletion_1.checkForCompletion)(state);
43
- if (text) {
44
- const decoration = prosemirror_view_1.Decoration.widget(state.selection.from, () => {
45
- const node = document.createElement('span');
46
- node.classList.add('completion-bearer');
47
- node.dataset.suggest = text;
48
- return node;
49
- });
50
- return prosemirror_view_1.DecorationSet.create(state.doc, [decoration]);
51
- }
52
- return prosemirror_view_1.DecorationSet.empty;
53
- },
54
- },
55
38
  state: {
56
39
  init: (_, state) => {
57
40
  return getPluginState(state.doc);
@@ -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.36-LEAN-3883.0';
4
+ exports.VERSION = '2.0.36';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -25,14 +25,12 @@ import { findChildrenByType, findParentNodeOfType, hasParentNodeOfType, } from '
25
25
  import { getCommentKey, getCommentRange } from './lib/comments';
26
26
  import { findBackmatter, findBibliographySection, findBody, insertSupplementsNode, } from './lib/doc';
27
27
  import { findWordBoundaries, isNodeOfType, nearestAncestor, } from './lib/helpers';
28
- import { sectionTitles } from './lib/section-titles';
29
28
  import { isDeleted, isRejectedInsert } from './lib/track-changes-utils';
30
29
  import { findParentNodeWithId, getChildOfType, getMatchingChild, } from './lib/utils';
31
30
  import { setCommentSelection } from './plugins/comments';
32
31
  import { getEditorProps } from './plugins/editor-props';
33
32
  import { footnotesKey } from './plugins/footnotes';
34
33
  import { getNewFootnotePos } from './plugins/footnotes/footnotes-utils';
35
- import { checkForCompletion } from './plugins/section_title/autocompletion';
36
34
  export const markActive = (type) => (state) => {
37
35
  const { from, $from, to, empty } = state.selection;
38
36
  return empty
@@ -448,6 +446,16 @@ export const insertSection = (subsection = false) => (state, dispatch, view) =>
448
446
  }
449
447
  return true;
450
448
  };
449
+ const sectionTitles = new Map([
450
+ ['MPSectionCategory:acknowledgement', 'Acknowledgments'],
451
+ ['MPSectionCategory:availability', 'Availability'],
452
+ ['MPSectionCategory:competing-interests', 'COI Statement'],
453
+ ['MPSectionCategory:con', 'Contributed-by information'],
454
+ ['MPSectionCategory:ethics-statement', 'Ethics Statement'],
455
+ ['MPSectionCategory:financial-disclosure', 'Financial Disclosure'],
456
+ ['MPSectionCategory:supplementary-material', 'Supplementary Material'],
457
+ ['MPSectionCategory:supported-by', 'Supported By'],
458
+ ]);
451
459
  export const insertBackMatterSection = (category) => (state, dispatch, view) => {
452
460
  const backmatter = findBackmatter(state.doc);
453
461
  const sections = findChildrenByType(backmatter.node, schema.nodes.section);
@@ -1071,12 +1079,3 @@ export function mergeCellsWithSpace(state, dispatch) {
1071
1079
  }
1072
1080
  return true;
1073
1081
  }
1074
- export const autoComplete = (state, dispatch) => {
1075
- const autocompleteText = checkForCompletion(state);
1076
- if (autocompleteText) {
1077
- const tr = state.tr.insertText(autocompleteText, state.selection.from);
1078
- dispatch && dispatch(tr);
1079
- return true;
1080
- }
1081
- return false;
1082
- };
@@ -14,11 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { schema } from '@manuscripts/transform';
17
- import { chainCommands, createParagraphNear, exitCode, joinDown, joinUp, lift, liftEmptyBlock, newlineInCode, splitBlock, toggleMark, wrapIn, } from 'prosemirror-commands';
17
+ import { chainCommands, exitCode, joinDown, joinUp, lift, toggleMark, wrapIn, } from 'prosemirror-commands';
18
18
  import { redo, undo } from 'prosemirror-history';
19
19
  import { undoInputRule } from 'prosemirror-inputrules';
20
20
  import { goToNextCell } from 'prosemirror-tables';
21
- import { autoComplete, ignoreAtomBlockNodeBackward, ignoreAtomBlockNodeForward, ignoreMetaNodeBackspaceCommand, insertBlock, insertBreak, insertCrossReference, insertInlineCitation, insertInlineEquation, insertSection, selectAllIsolating, } from '../commands';
21
+ import { ignoreAtomBlockNodeBackward, ignoreAtomBlockNodeForward, ignoreMetaNodeBackspaceCommand, insertBlock, insertBreak, insertCrossReference, insertInlineCitation, insertInlineEquation, insertSection, selectAllIsolating, } from '../commands';
22
22
  const customKeymap = {
23
23
  Backspace: chainCommands(undoInputRule, ignoreAtomBlockNodeBackward, ignoreMetaNodeBackspaceCommand),
24
24
  Delete: ignoreAtomBlockNodeForward,
@@ -37,7 +37,6 @@ const customKeymap = {
37
37
  'Mod-Alt-=': toggleMark(schema.marks.superscript),
38
38
  'Mod-Alt--': toggleMark(schema.marks.subscript),
39
39
  'Ctrl->': wrapIn(schema.nodes.blockquote),
40
- Enter: chainCommands(autoComplete, newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock),
41
40
  'Shift-Mod-Enter': insertSection(true),
42
41
  'Mod-Enter': chainCommands(exitCode, insertSection()),
43
42
  'Shift-Enter': chainCommands(exitCode, insertBreak),
@@ -1,9 +1,7 @@
1
1
  import { schema } from '@manuscripts/transform';
2
2
  import { Plugin, PluginKey } from 'prosemirror-state';
3
3
  import { findChildrenByType } from 'prosemirror-utils';
4
- import { Decoration, DecorationSet } from 'prosemirror-view';
5
- import { isRejectedInsert } from '../../lib/track-changes-utils';
6
- import { checkForCompletion } from './autocompletion';
4
+ import { isRejectedInsert } from '../lib/track-changes-utils';
7
5
  export const sectionTitleKey = new PluginKey('sectionNumbering');
8
6
  const calculateSectionLevels = (node, startPos, sectionNumberMap, numbering = [0]) => {
9
7
  node.forEach((childNode, offset) => {
@@ -34,21 +32,6 @@ const getPluginState = (doc) => {
34
32
  export default () => {
35
33
  return new Plugin({
36
34
  key: sectionTitleKey,
37
- props: {
38
- decorations(state) {
39
- const text = checkForCompletion(state);
40
- if (text) {
41
- const decoration = Decoration.widget(state.selection.from, () => {
42
- const node = document.createElement('span');
43
- node.classList.add('completion-bearer');
44
- node.dataset.suggest = text;
45
- return node;
46
- });
47
- return DecorationSet.create(state.doc, [decoration]);
48
- }
49
- return DecorationSet.empty;
50
- },
51
- },
52
35
  state: {
53
36
  init: (_, state) => {
54
37
  return getPluginState(state.doc);
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.0.36-LEAN-3883.0';
1
+ export const VERSION = '2.0.36';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -70,5 +70,4 @@ export declare const insertTableFootnote: (tableElementNode: ManuscriptNode, pos
70
70
  export declare const addRows: (direction: 'top' | 'bottom') => (state: EditorState, dispatch?: ((tr: Transaction) => void) | undefined) => boolean;
71
71
  export declare const addColumns: (direction: 'right' | 'left') => (state: EditorState, dispatch?: ((tr: Transaction) => void) | undefined) => boolean;
72
72
  export declare function mergeCellsWithSpace(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
73
- export declare const autoComplete: (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
74
73
  export {};
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.0.36-LEAN-3883.0";
1
+ export declare const VERSION = "2.0.36";
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.36-LEAN-3883.0",
4
+ "version": "2.0.36",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -32,9 +32,9 @@
32
32
  "@iarna/word-count": "^1.1.2",
33
33
  "@manuscripts/json-schema": "2.2.11",
34
34
  "@manuscripts/library": "1.3.11",
35
- "@manuscripts/style-guide": "2.0.12-LEAN-3883.1",
35
+ "@manuscripts/style-guide": "2.0.12",
36
36
  "@manuscripts/track-changes-plugin": "1.7.17",
37
- "@manuscripts/transform": "2.3.29",
37
+ "@manuscripts/transform": "2.3.30",
38
38
  "@popperjs/core": "^2.11.8",
39
39
  "astrocite-eutils": "^0.16.4",
40
40
  "codemirror": "^5.58.1",
@@ -1,15 +1,20 @@
1
1
  .ProseMirror
2
2
  > div.body
3
- section:not(.toc)
4
- .block-section_title
3
+ section:not(.toc)
4
+ .block-section_title
5
5
  h1.empty-node[data-placeholder]::before {
6
6
  content: attr(data-section-number) '. ' attr(data-placeholder);
7
7
  }
8
8
 
9
- .ProseMirror > div.body section:not(.toc) .block-section_title h1::before {
9
+ .ProseMirror
10
+ > div.body
11
+ section:not(.toc)
12
+ .block-section_title
13
+ h1::before {
10
14
  content: attr(data-section-number) '. ';
11
15
  }
12
16
 
17
+
13
18
  .ProseMirror > div .block-section_title > h1 {
14
19
  font-size: 16pt !important;
15
20
  font-style: normal !important;
@@ -34,6 +39,8 @@
34
39
  font-size: 13.5pt !important;
35
40
  }
36
41
 
42
+
43
+
37
44
  .ProseMirror div.backmatter::before {
38
45
  content: '';
39
46
  border-bottom: 1px dashed #c9c9c9;
@@ -44,15 +51,6 @@
44
51
  font-size: 13.5pt !important;
45
52
  color: #6e6e6e !important;
46
53
  }
47
- .completion-bearer {
48
- pointer-events: none;
49
- }
50
- .block-section_title .completion-bearer:after {
51
- content: attr(data-suggest);
52
- opacity: 0.5;
53
- pointer-events: none;
54
- font-style: italic;
55
- }
56
54
 
57
55
  .ProseMirror p.block {
58
56
  font-size: 12pt !important;
@@ -156,8 +154,8 @@
156
154
  position: static;
157
155
  }
158
156
 
159
- .comment-marker.selected-comment > svg > path,
160
- .comment-marker:active > svg > path {
157
+
158
+ .comment-marker.selected-comment > svg > path, .comment-marker:active > svg > path {
161
159
  stroke: #f7b314;
162
160
  fill: #ffe0b2;
163
161
  }
@@ -172,8 +170,7 @@
172
170
  position: relative;
173
171
  }
174
172
 
175
- .block > div.comment-marker,
176
- .figure-block > div.comment-marker {
173
+ .block > div.comment-marker, .figure-block > div.comment-marker {
177
174
  top: -25px;
178
175
  left: 100%;
179
176
  }
@@ -212,7 +209,7 @@ span.comment-marker {
212
209
  top: 12px;
213
210
  }
214
211
 
215
- .comment-marker[data-count='0'] {
212
+ .comment-marker[data-count="0"] {
216
213
  display: none;
217
214
  }
218
215
 
@@ -224,7 +221,7 @@ span.comment-marker {
224
221
  content: attr(data-count);
225
222
  top: 8px;
226
223
  left: 8px;
227
- background-color: #f7b314;
224
+ background-color: #F7B314;
228
225
  border-radius: 50%;
229
226
  width: 12px;
230
227
  height: 12px;
@@ -292,7 +289,7 @@ span.comment-marker {
292
289
  font-size: 16px !important;
293
290
  font-weight: 700 !important;
294
291
  line-height: 24px !important;
295
- margin: 0 !important;
292
+ margin: 0 !important
296
293
  }
297
294
 
298
295
  .keywords .keyword {
@@ -307,7 +304,7 @@ span.comment-marker {
307
304
  position: relative;
308
305
  cursor: default;
309
306
  padding: 4px 8px;
310
- border: 1px solid #c9c9c9;
307
+ border: 1px solid #C9C9C9;
311
308
  margin-top: 10px;
312
309
  margin-bottom: 4px;
313
310
  }
@@ -373,7 +370,7 @@ span.comment-marker {
373
370
 
374
371
  .keywords .keyword-group-container {
375
372
  position: relative;
376
- margin: 0 0 36px !important;
373
+ margin: 0 0 36px !important;
377
374
  }
378
375
 
379
376
  .keywords .keyword-group {
@@ -447,8 +444,8 @@ span.comment-marker {
447
444
  --inserted-pending-bg-color: #e6ffdb;
448
445
  --inserted-pending-color: #01872e;
449
446
  --accepted-bg-color: #e2e2e2;
450
- --deleted-color: #f35143;
451
- --deleted-pending-bg-color: #fff1f0;
447
+ --deleted-color: #F35143;
448
+ --deleted-pending-bg-color: #FFF1F0;
452
449
  --highlight-bg-color: #ffeebf;
453
450
  --common-color: #353535;
454
451
  --selected-pending-background-color: #ddf3fa;
@@ -477,28 +474,22 @@ span.selected-suggestion,
477
474
  span.accepted .selected-suggestion,
478
475
  .accepted .selected-suggestion > .block-container .block,
479
476
  .accepted .selected-suggestion:not(:has(> .block-container)),
480
- .selected-suggestion[data-track-status='accepted'],
481
- .selected-suggestion > .block-container .block.accepted,
482
- .selected-suggestion
483
- > .block-container
484
- .block:has([data-track-status='accepted']),
485
- .selected-suggestion:not(:has(> .block-container)):has(
486
- [data-track-status='accepted']
487
- ) {
477
+ .selected-suggestion[data-track-status="accepted"],
478
+ .selected-suggestion > .block-container .block.accepted,
479
+ .selected-suggestion > .block-container .block:has([data-track-status='accepted']),
480
+ .selected-suggestion:not(:has(> .block-container)):has([data-track-status='accepted']) {
488
481
  background-color: var(--selected-accepted-background-color) !important;
489
482
  border-width: 2px 0 2px 0 !important;
490
- border-color: #c9c9c9 !important;
483
+ border-color: #C9C9C9 !important;
491
484
  border-radius: 3px !important;
492
485
  border-style: solid !important;
493
486
  }
494
487
 
495
- .block-bullet_list .selected-suggestion p,
496
- .block-ordered_list .selected-suggestion p {
488
+ .block-bullet_list .selected-suggestion p, .block-ordered_list .selected-suggestion p {
497
489
  margin: 0;
498
490
  }
499
491
 
500
- .block-bullet_list .selected-suggestion,
501
- .block-ordered_list .selected-suggestion {
492
+ .block-bullet_list .selected-suggestion, .block-ordered_list .selected-suggestion {
502
493
  margin: 16px 0;
503
494
  }
504
495
 
@@ -510,10 +501,7 @@ span.accepted .selected-suggestion,
510
501
  }
511
502
 
512
503
  .ProseMirror .selected-suggestion .inserted.pending,
513
- .ProseMirror
514
- .selected-suggestion
515
- [data-track-op='insert'][data-track-status='pending']
516
- .block,
504
+ .ProseMirror .selected-suggestion [data-track-op='insert'][data-track-status='pending'] .block,
517
505
  .ProseMirror .selected-suggestion .deleted.pending {
518
506
  background-color: var(--selected-pending-background-color) !important;
519
507
  color: var(--common-color) !important;
@@ -556,11 +544,7 @@ span.accepted .selected-suggestion,
556
544
  .ProseMirror .inserted.pending:has(.selected-suggestion),
557
545
  .ProseMirror .deleted.pending:has(.selected-suggestion),
558
546
  .ProseMirror .selected-suggestion .highlight,
559
- .ProseMirror
560
- .selected-suggestion
561
- .graphical-abstract:has(
562
- [data-track-status='pending'][data-track-op='insert']
563
- ) {
547
+ .ProseMirror .selected-suggestion .graphical-abstract:has([data-track-status='pending'][data-track-op='insert']) {
564
548
  background: transparent !important;
565
549
  color: var(--common-color);
566
550
  text-decoration: none;
@@ -599,7 +583,7 @@ span.accepted .selected-suggestion,
599
583
  .affiliation[data-track-status='pending'][data-track-op='delete'] {
600
584
  text-decoration: line-through;
601
585
  color: var(--deleted-color);
602
- background-color: var(--deleted-pending-bg-color);
586
+ background-color: var(--deleted-pending-bg-color)
603
587
  }
604
588
 
605
589
  .contributor[data-track-op='delete']:not([data-track-status='rejected']),
@@ -613,9 +597,7 @@ span.accepted .selected-suggestion,
613
597
  color: var(--inserted-pending-color);
614
598
  text-decoration: underline;
615
599
  }
616
- .block-contributors,
617
- .block-affiliations,
618
- .keywords {
600
+ .block-contributors, .block-affiliations, .keywords {
619
601
  margin: 15px 0px;
620
602
  }
621
603
  .contributors {
@@ -716,6 +698,7 @@ span.accepted .selected-suggestion,
716
698
  margin: 1rem 64px 0;
717
699
  font-size: 12px;
718
700
  color: #6e6e6e;
701
+
719
702
  }
720
703
 
721
704
  * {
@@ -753,9 +736,7 @@ span.accepted .selected-suggestion,
753
736
  z-index: 10;
754
737
  }
755
738
 
756
- .ProseMirror td:hover > .table-context-menu-button,
757
- th:hover > .table-context-menu-button,
758
- .open-context-menu {
739
+ .ProseMirror td:hover > .table-context-menu-button, th:hover > .table-context-menu-button, .open-context-menu {
759
740
  visibility: visible !important;
760
741
  }
761
742
 
@@ -780,7 +761,7 @@ th:hover > .table-context-menu-button,
780
761
  }
781
762
 
782
763
  .section-category-button:not(.assigned) path {
783
- fill: #ffe0b2;
764
+ fill: #FFE0B2;
784
765
  }
785
766
 
786
767
  .section-category-button.assigned:after {
@@ -790,8 +771,8 @@ th:hover > .table-context-menu-button,
790
771
  content: '';
791
772
  height: 8px;
792
773
  width: 4px;
793
- border-bottom: 2px solid #36b260;
794
- border-right: 2px solid #36b260;
774
+ border-bottom: 2px solid #36B260;
775
+ border-right: 2px solid #36B260;
795
776
  transform: rotate(45deg);
796
777
  }
797
778
 
@@ -800,8 +781,8 @@ th:hover > .table-context-menu-button,
800
781
  }
801
782
  .section-category.menu {
802
783
  border-radius: 8px;
803
- border: 1px solid #e2e2e2;
804
- box-shadow: 0px 4px 9px 0px rgba(0, 0, 0, 0.3);
784
+ border: 1px solid #E2E2E2;
785
+ box-shadow: 0px 4px 9px 0px rgba(0, 0, 0, 0.30);
805
786
  }
806
787
 
807
788
  .section-category.menu .menu-item {
@@ -828,8 +809,8 @@ th:hover > .table-context-menu-button,
828
809
  content: '';
829
810
  height: 10px;
830
811
  width: 5px;
831
- border-bottom: 2px solid #36b260;
832
- border-right: 2px solid #36b260;
812
+ border-bottom: 2px solid #36B260;
813
+ border-right: 2px solid #36B260;
833
814
  transform: rotate(45deg);
834
815
  }
835
816
 
@@ -845,16 +826,16 @@ th:hover > .table-context-menu-button,
845
826
  display: flex;
846
827
  align-items: center;
847
828
  border-radius: 6px;
848
- background: #e2e2e2;
829
+ background: #E2E2E2;
849
830
  font-size: 12px;
850
831
  font-style: normal;
851
832
  font-weight: 400;
852
- color: #353535;
833
+ color: #353535;
853
834
  line-height: 16px;
854
835
  }
855
836
 
856
837
  .section-category.tooltip span {
857
- color: #353535;
838
+ color: #353535;
858
839
  font-size: 12px;
859
840
  font-style: normal;
860
841
  font-weight: 700;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- /*!
3
- * © 2019 Atypon Systems LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.sectionTitles = void 0;
19
- exports.sectionTitles = new Map([
20
- ['MPSectionCategory:acknowledgement', 'Acknowledgments'],
21
- ['MPSectionCategory:availability', 'Availability'],
22
- ['MPSectionCategory:competing-interests', 'COI Statement'],
23
- ['MPSectionCategory:con', 'Contributed-by information'],
24
- ['MPSectionCategory:ethics-statement', 'Ethics Statement'],
25
- ['MPSectionCategory:financial-disclosure', 'Financial Disclosure'],
26
- ['MPSectionCategory:supplementary-material', 'Supplementary Material'],
27
- ['MPSectionCategory:supported-by', 'Supported By'],
28
- ]);
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkForCompletion = exports.hasAutoCompletionSlack = void 0;
4
- const transform_1 = require("@manuscripts/transform");
5
- const prosemirror_utils_1 = require("prosemirror-utils");
6
- const section_titles_1 = require("../../lib/section-titles");
7
- function cursorAtTheEndOfText(state, nodeSize, nodePos) {
8
- const { from, to } = state.selection;
9
- return from === to && to === nodePos + nodeSize - 1;
10
- }
11
- function hasAutoCompletionSlack(parentSection, titleSection) {
12
- const category = parentSection.attrs.category;
13
- const title = section_titles_1.sectionTitles.get(category);
14
- if (category &&
15
- title &&
16
- titleSection.textContent &&
17
- title.startsWith(titleSection.textContent)) {
18
- const suggestionText = title.slice(titleSection.textContent.length);
19
- return suggestionText;
20
- }
21
- else {
22
- return '';
23
- }
24
- }
25
- exports.hasAutoCompletionSlack = hasAutoCompletionSlack;
26
- function checkForCompletion(state) {
27
- const section = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)(state.selection.$from, transform_1.schema.nodes.section);
28
- const title = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)(state.selection.$from, transform_1.schema.nodes.section_title);
29
- if (section &&
30
- title &&
31
- cursorAtTheEndOfText(state, title.node.nodeSize, title.pos)) {
32
- const text = hasAutoCompletionSlack(section.node, title.node);
33
- return text;
34
- }
35
- return '';
36
- }
37
- exports.checkForCompletion = checkForCompletion;
@@ -1,25 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export const sectionTitles = new Map([
17
- ['MPSectionCategory:acknowledgement', 'Acknowledgments'],
18
- ['MPSectionCategory:availability', 'Availability'],
19
- ['MPSectionCategory:competing-interests', 'COI Statement'],
20
- ['MPSectionCategory:con', 'Contributed-by information'],
21
- ['MPSectionCategory:ethics-statement', 'Ethics Statement'],
22
- ['MPSectionCategory:financial-disclosure', 'Financial Disclosure'],
23
- ['MPSectionCategory:supplementary-material', 'Supplementary Material'],
24
- ['MPSectionCategory:supported-by', 'Supported By'],
25
- ]);
@@ -1,32 +0,0 @@
1
- import { schema, } from '@manuscripts/transform';
2
- import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
3
- import { sectionTitles } from '../../lib/section-titles';
4
- function cursorAtTheEndOfText(state, nodeSize, nodePos) {
5
- const { from, to } = state.selection;
6
- return from === to && to === nodePos + nodeSize - 1;
7
- }
8
- export function hasAutoCompletionSlack(parentSection, titleSection) {
9
- const category = parentSection.attrs.category;
10
- const title = sectionTitles.get(category);
11
- if (category &&
12
- title &&
13
- titleSection.textContent &&
14
- title.startsWith(titleSection.textContent)) {
15
- const suggestionText = title.slice(titleSection.textContent.length);
16
- return suggestionText;
17
- }
18
- else {
19
- return '';
20
- }
21
- }
22
- export function checkForCompletion(state) {
23
- const section = findParentNodeOfTypeClosestToPos(state.selection.$from, schema.nodes.section);
24
- const title = findParentNodeOfTypeClosestToPos(state.selection.$from, schema.nodes.section_title);
25
- if (section &&
26
- title &&
27
- cursorAtTheEndOfText(state, title.node.nodeSize, title.pos)) {
28
- const text = hasAutoCompletionSlack(section.node, title.node);
29
- return text;
30
- }
31
- return '';
32
- }
@@ -1,17 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { SectionCategory } from '@manuscripts/transform';
17
- export declare const sectionTitles: Map<SectionCategory, string>;
@@ -1,4 +0,0 @@
1
- import { SectionNode, SectionTitleNode } from '@manuscripts/transform';
2
- import { EditorState } from 'prosemirror-state';
3
- export declare function hasAutoCompletionSlack(parentSection: SectionNode, titleSection: SectionTitleNode): string;
4
- export declare function checkForCompletion(state: EditorState): string;