@manuscripts/body-editor 3.7.0 → 3.7.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.
@@ -34,6 +34,14 @@ const placeholderWidget = (placeholder) => (view, getPos) => {
34
34
  });
35
35
  return element;
36
36
  };
37
+ const backmatterWidget = (direction) => {
38
+ const element = document.createElement('div');
39
+ element.className = 'backmatter-border-placeholder';
40
+ const line = document.createElement('div');
41
+ line.className = direction;
42
+ element.appendChild(line);
43
+ return element;
44
+ };
37
45
  const getParagraphPlaceholderText = (parent, node) => {
38
46
  if (!parent) {
39
47
  return;
@@ -100,6 +108,16 @@ exports.default = () => new prosemirror_state_1.Plugin({
100
108
  }));
101
109
  }
102
110
  }
111
+ else if (node.type === transform_1.schema.nodes.backmatter) {
112
+ decorations.push(prosemirror_view_1.Decoration.widget(pos + 1, backmatterWidget('top')));
113
+ const nextNode = parent && parent.nodeAt(pos + node.nodeSize);
114
+ if (nextNode &&
115
+ (nextNode.type === transform_1.schema.nodes.supplements ||
116
+ nextNode.type === transform_1.schema.nodes.hero_image ||
117
+ nextNode.type === transform_1.schema.nodes.attachments)) {
118
+ decorations.push(prosemirror_view_1.Decoration.widget(pos + node.nodeSize - 1, backmatterWidget('bottom')));
119
+ }
120
+ }
103
121
  });
104
122
  return prosemirror_view_1.DecorationSet.create(state.doc, decorations);
105
123
  },
@@ -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.7.0';
4
+ exports.VERSION = '3.7.2';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -17,6 +17,7 @@ class AccessibilityElementView extends block_view_1.default {
17
17
  this.dom = document.createElement('div');
18
18
  this.dom.classList.add('accessibility_element');
19
19
  const label = document.createElement('label');
20
+ label.contentEditable = 'false';
20
21
  label.className = 'accessibility_element_label';
21
22
  label.innerText =
22
23
  this.node.type === transform_1.schema.nodes.long_desc
@@ -74,7 +74,7 @@ class BlockView extends base_node_view_1.BaseNodeView {
74
74
  this.dom.appendChild(this.gutter[className]);
75
75
  }
76
76
  gutterButtons() {
77
- return [];
77
+ return [document.createElement('div')];
78
78
  }
79
79
  actionGutterButtons() {
80
80
  return [];
@@ -110,17 +110,14 @@ class ImageElementView extends block_view_1.default {
110
110
  }
111
111
  createDOM() {
112
112
  super.createDOM();
113
- this.dom.setAttribute('contenteditable', 'false');
114
113
  }
115
114
  createElement() {
116
115
  this.container = document.createElement('div');
117
116
  this.container.classList.add('block');
118
- this.container.setAttribute('contenteditable', 'false');
119
117
  this.dom.appendChild(this.container);
120
118
  this.subcontainer = document.createElement('div');
121
119
  this.subcontainer.classList.add('figure-block-group');
122
120
  this.contentDOM = document.createElement('div');
123
- this.contentDOM.setAttribute('contenteditable', 'false');
124
121
  this.contentDOM.setAttribute('id', this.node.attrs.id);
125
122
  this.contentDOM.classList.add('figure-block');
126
123
  this.subcontainer.appendChild(this.contentDOM);
@@ -258,6 +255,7 @@ class ImageElementView extends block_view_1.default {
258
255
  }
259
256
  else {
260
257
  this.extLinkEditorContainer = document.createElement('div');
258
+ this.extLinkEditorContainer.contentEditable = 'false';
261
259
  this.extLinkEditorContainer.classList.add('ext-link-editor-container');
262
260
  }
263
261
  if (!this.isEditingExtLink && !this.node.attrs.extLink) {
@@ -32,6 +32,14 @@ const placeholderWidget = (placeholder) => (view, getPos) => {
32
32
  });
33
33
  return element;
34
34
  };
35
+ const backmatterWidget = (direction) => {
36
+ const element = document.createElement('div');
37
+ element.className = 'backmatter-border-placeholder';
38
+ const line = document.createElement('div');
39
+ line.className = direction;
40
+ element.appendChild(line);
41
+ return element;
42
+ };
35
43
  const getParagraphPlaceholderText = (parent, node) => {
36
44
  if (!parent) {
37
45
  return;
@@ -98,6 +106,16 @@ export default () => new Plugin({
98
106
  }));
99
107
  }
100
108
  }
109
+ else if (node.type === schema.nodes.backmatter) {
110
+ decorations.push(Decoration.widget(pos + 1, backmatterWidget('top')));
111
+ const nextNode = parent && parent.nodeAt(pos + node.nodeSize);
112
+ if (nextNode &&
113
+ (nextNode.type === schema.nodes.supplements ||
114
+ nextNode.type === schema.nodes.hero_image ||
115
+ nextNode.type === schema.nodes.attachments)) {
116
+ decorations.push(Decoration.widget(pos + node.nodeSize - 1, backmatterWidget('bottom')));
117
+ }
118
+ }
101
119
  });
102
120
  return DecorationSet.create(state.doc, decorations);
103
121
  },
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.7.0';
1
+ export const VERSION = '3.7.2';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -11,6 +11,7 @@ export class AccessibilityElementView extends BlockView {
11
11
  this.dom = document.createElement('div');
12
12
  this.dom.classList.add('accessibility_element');
13
13
  const label = document.createElement('label');
14
+ label.contentEditable = 'false';
14
15
  label.className = 'accessibility_element_label';
15
16
  label.innerText =
16
17
  this.node.type === schema.nodes.long_desc
@@ -72,7 +72,7 @@ export default class BlockView extends BaseNodeView {
72
72
  this.dom.appendChild(this.gutter[className]);
73
73
  }
74
74
  gutterButtons() {
75
- return [];
75
+ return [document.createElement('div')];
76
76
  }
77
77
  actionGutterButtons() {
78
78
  return [];
@@ -104,17 +104,14 @@ export class ImageElementView extends BlockView {
104
104
  }
105
105
  createDOM() {
106
106
  super.createDOM();
107
- this.dom.setAttribute('contenteditable', 'false');
108
107
  }
109
108
  createElement() {
110
109
  this.container = document.createElement('div');
111
110
  this.container.classList.add('block');
112
- this.container.setAttribute('contenteditable', 'false');
113
111
  this.dom.appendChild(this.container);
114
112
  this.subcontainer = document.createElement('div');
115
113
  this.subcontainer.classList.add('figure-block-group');
116
114
  this.contentDOM = document.createElement('div');
117
- this.contentDOM.setAttribute('contenteditable', 'false');
118
115
  this.contentDOM.setAttribute('id', this.node.attrs.id);
119
116
  this.contentDOM.classList.add('figure-block');
120
117
  this.subcontainer.appendChild(this.contentDOM);
@@ -252,6 +249,7 @@ export class ImageElementView extends BlockView {
252
249
  }
253
250
  else {
254
251
  this.extLinkEditorContainer = document.createElement('div');
252
+ this.extLinkEditorContainer.contentEditable = 'false';
255
253
  this.extLinkEditorContainer.classList.add('ext-link-editor-container');
256
254
  }
257
255
  if (!this.isEditingExtLink && !this.node.attrs.extLink) {
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.7.0";
1
+ export declare const VERSION = "3.7.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": "3.7.0",
4
+ "version": "3.7.2",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -40,7 +40,7 @@
40
40
  "@manuscripts/json-schema": "2.2.12",
41
41
  "@manuscripts/style-guide": "3.3.5",
42
42
  "@manuscripts/track-changes-plugin": "2.2.0",
43
- "@manuscripts/transform": "4.3.8",
43
+ "@manuscripts/transform": "4.3.9",
44
44
  "@popperjs/core": "2.11.8",
45
45
  "citeproc": "2.4.63",
46
46
  "codemirror": "5.65.19",
@@ -71,17 +71,26 @@
71
71
  font-size: 13.5pt;
72
72
  }
73
73
 
74
- .ProseMirror div.backmatter:not(.empty-node)::before,
75
- .ProseMirror div.abstracts:not(.empty-node)::after {
76
- content: '';
77
- border-bottom: 1px dashed #c9c9c9;
78
- display: block;
79
- margin: 11pt 49pt;
74
+ .ProseMirror .backmatter .backmatter-border-placeholder {
75
+ width: 100%;
76
+ height: 49pt;
77
+ display: flex;
78
+ align-items: center;
80
79
  }
81
- .ProseMirror div.backmatter .block-section_title h1 {
82
- font-size: 13.5pt;
83
- color: #6e6e6e;
80
+
81
+ .ProseMirror .backmatter .backmatter-border-placeholder div {
82
+ flex: 1;
83
+ margin: 0 52px;
84
+ }
85
+
86
+ .ProseMirror .backmatter .backmatter-border-placeholder .top {
87
+ border-top: 1px dashed #c9c9c9;
84
88
  }
89
+
90
+ .ProseMirror .backmatter .backmatter-border-placeholder .bottom {
91
+ border-bottom: 1px solid #e2e2e2;
92
+ }
93
+
85
94
  .completion-bearer {
86
95
  pointer-events: none;
87
96
  }
@@ -111,8 +120,6 @@
111
120
  border: 1px solid #f2f2f2;
112
121
  border-radius: 4px;
113
122
 
114
- padding: 8px;
115
- gap: 8px !important;
116
123
 
117
124
  grid-template-columns: repeat(3, auto) !important;
118
125
  grid-template-rows: repeat(1, minmax(min-content, max-content)) [caption listing] auto !important;
@@ -128,7 +135,6 @@
128
135
  border-radius: 4px;
129
136
  position: relative;
130
137
  padding: 8px;
131
- gap: 8px !important;
132
138
 
133
139
  grid-template-columns: repeat(3, auto) !important;
134
140
  grid-template-rows: repeat(1, minmax(min-content, max-content)) [caption listing] auto !important;
@@ -138,7 +144,6 @@
138
144
  border: none;
139
145
  border-radius: 0;
140
146
  position: static;
141
- padding: 0;
142
147
  margin: 0 !important;
143
148
  grid-template-columns: auto;
144
149
  grid-template-rows: auto;
@@ -653,11 +658,6 @@ span.comment-marker {
653
658
  display: none;
654
659
  }
655
660
 
656
- .ProseMirror
657
- div.backmatter:has(:only-child.bibliography > .empty-node)::before {
658
- border-bottom: none;
659
- }
660
-
661
661
  .ProseMirror .keywords h1 {
662
662
  font-size: 12px;
663
663
  font-style: italic;
@@ -1595,10 +1595,6 @@ th:hover > .table-context-menu-button,
1595
1595
  display: block;
1596
1596
  }
1597
1597
 
1598
- .ProseMirror .ext-link-editor-container {
1599
- position: static;
1600
- width: 100%;
1601
- }
1602
1598
  .ProseMirror .ext-link-editor-placeholder-container {
1603
1599
  font-size: 0;
1604
1600
  }
@@ -1714,13 +1710,6 @@ th:hover > .table-context-menu-button,
1714
1710
  width: 100%;
1715
1711
  }
1716
1712
 
1717
- .ProseMirror div.backmatter:has(+ .block-container.block-hero_image)::after {
1718
- content: '';
1719
- display: block;
1720
- border-bottom: 1px solid #e2e2e2;
1721
- margin: 0 35pt 32px 35pt;
1722
- }
1723
-
1724
1713
  .panel-header {
1725
1714
  display: flex;
1726
1715
  justify-content: space-between;
@@ -1735,6 +1724,7 @@ th:hover > .table-context-menu-button,
1735
1724
 
1736
1725
  .hero-image-container .figure-block {
1737
1726
  border: none !important;
1727
+ padding: 8px;
1738
1728
  }
1739
1729
 
1740
1730
  .hero-image-container .position-menu {
package/styles/Editor.css CHANGED
@@ -685,6 +685,10 @@
685
685
  padding: 0 !important;
686
686
  }
687
687
 
688
+ .ProseMirror .action-gutter:empty {
689
+ display: none;
690
+ }
691
+
688
692
  .ProseMirror .action-gutter {
689
693
  position: relative;
690
694
  display: flex;
@@ -1253,14 +1257,6 @@
1253
1257
  font-style: normal;
1254
1258
  }
1255
1259
 
1256
- /* Horizontal line before supplements block */
1257
- .ProseMirror div.backmatter:has(+ .block-container.block-supplements)::after {
1258
- content: '';
1259
- display: block;
1260
- border-bottom: 1px solid #e2e2e2;
1261
- margin: 0 35pt 32px 35pt;
1262
- }
1263
-
1264
1260
  .ProseMirror .supplement-item.drop-target-above,
1265
1261
  .ProseMirror .supplement-item.drop-target-below {
1266
1262
  border: 2px dotted #20aedf !important;