@manuscripts/body-editor 1.11.5 → 1.11.6
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.
- package/dist/cjs/commands.js +4 -1
- package/dist/cjs/lib/context-menu.js +4 -3
- package/dist/cjs/plugins/footnotes/index.js +1 -1
- package/dist/es/commands.js +4 -1
- package/dist/es/lib/context-menu.js +4 -3
- package/dist/es/plugins/footnotes/index.js +1 -1
- package/package.json +3 -3
- package/styles/Editor.css +13 -22
package/dist/cjs/commands.js
CHANGED
|
@@ -129,9 +129,12 @@ exports.createBlock = createBlock;
|
|
|
129
129
|
const insertGeneralFootnote = (tableNode, position, view, tableElementFooter) => {
|
|
130
130
|
var _a;
|
|
131
131
|
const { state, dispatch } = view;
|
|
132
|
-
const
|
|
132
|
+
const paragraph = state.schema.nodes.paragraph.create({
|
|
133
133
|
placeholder: 'Add general note here',
|
|
134
134
|
});
|
|
135
|
+
const generalNote = state.schema.nodes.general_table_footnote.create({}, [
|
|
136
|
+
paragraph,
|
|
137
|
+
]);
|
|
135
138
|
const tableColGroup = (0, prosemirror_utils_1.findChildrenByType)(tableNode, transform_1.schema.nodes.table_colgroup)[0];
|
|
136
139
|
const tr = state.tr;
|
|
137
140
|
const pos = (tableElementFooter === null || tableElementFooter === void 0 ? void 0 : tableElementFooter.length)
|
|
@@ -27,6 +27,7 @@ const footnotes_utils_1 = require("../plugins/footnotes/footnotes-utils");
|
|
|
27
27
|
const ReactSubView_1 = __importDefault(require("../views/ReactSubView"));
|
|
28
28
|
const popper_1 = require("./popper");
|
|
29
29
|
const track_changes_utils_1 = require("./track-changes-utils");
|
|
30
|
+
const utils_1 = require("./utils");
|
|
30
31
|
const popper = new popper_1.PopperManager();
|
|
31
32
|
const listTypes = [transform_1.schema.nodes.ordered_list, transform_1.schema.nodes.bullet_list];
|
|
32
33
|
const readonlyTypes = [transform_1.schema.nodes.keywords, transform_1.schema.nodes.bibliography_element];
|
|
@@ -143,7 +144,7 @@ class ContextMenu {
|
|
|
143
144
|
this.addPopperEventListeners();
|
|
144
145
|
};
|
|
145
146
|
this.showEditMenu = (target) => {
|
|
146
|
-
var _a
|
|
147
|
+
var _a;
|
|
147
148
|
const menu = document.createElement('div');
|
|
148
149
|
menu.className = 'menu';
|
|
149
150
|
const $pos = this.resolvePos();
|
|
@@ -179,9 +180,9 @@ class ContextMenu {
|
|
|
179
180
|
const tableElementFooter = (0, prosemirror_utils_1.findChildrenByType)(this.node, transform_1.schema.nodes.table_element_footer);
|
|
180
181
|
let isDeletedOrRejected = false;
|
|
181
182
|
const hasGeneralNote = tableElementFooter.length &&
|
|
182
|
-
((
|
|
183
|
+
(0, utils_1.getChildOfType)(tableElementFooter[0].node, transform_1.schema.nodes.general_table_footnote, true);
|
|
183
184
|
if (hasGeneralNote) {
|
|
184
|
-
const generalFootnote = (
|
|
185
|
+
const generalFootnote = (_a = tableElementFooter[0]) === null || _a === void 0 ? void 0 : _a.node.firstChild;
|
|
185
186
|
if (generalFootnote) {
|
|
186
187
|
isDeletedOrRejected =
|
|
187
188
|
(0, track_changes_utils_1.isDeleted)(generalFootnote) || (0, track_changes_utils_1.isRejectedInsert)(generalFootnote);
|
|
@@ -82,7 +82,7 @@ const deleteFootnoteWidget = (node, props, id, tableElement) => (view, getPos) =
|
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
node.content.forEach((item) => {
|
|
85
|
-
if (item.type === transform_1.schema.nodes.
|
|
85
|
+
if (item.type === transform_1.schema.nodes.general_table_footnote && pos) {
|
|
86
86
|
tr.delete(pos - 1, pos + item.nodeSize + 1);
|
|
87
87
|
}
|
|
88
88
|
});
|
package/dist/es/commands.js
CHANGED
|
@@ -120,9 +120,12 @@ export const createBlock = (nodeType, position, state, dispatch) => {
|
|
|
120
120
|
export const insertGeneralFootnote = (tableNode, position, view, tableElementFooter) => {
|
|
121
121
|
var _a;
|
|
122
122
|
const { state, dispatch } = view;
|
|
123
|
-
const
|
|
123
|
+
const paragraph = state.schema.nodes.paragraph.create({
|
|
124
124
|
placeholder: 'Add general note here',
|
|
125
125
|
});
|
|
126
|
+
const generalNote = state.schema.nodes.general_table_footnote.create({}, [
|
|
127
|
+
paragraph,
|
|
128
|
+
]);
|
|
126
129
|
const tableColGroup = findChildrenByType(tableNode, schema.nodes.table_colgroup)[0];
|
|
127
130
|
const tr = state.tr;
|
|
128
131
|
const pos = (tableElementFooter === null || tableElementFooter === void 0 ? void 0 : tableElementFooter.length)
|
|
@@ -21,6 +21,7 @@ import { buildTableFootnoteLabels } from '../plugins/footnotes/footnotes-utils';
|
|
|
21
21
|
import ReactSubView from '../views/ReactSubView';
|
|
22
22
|
import { PopperManager } from './popper';
|
|
23
23
|
import { isDeleted, isRejectedInsert } from './track-changes-utils';
|
|
24
|
+
import { getChildOfType } from './utils';
|
|
24
25
|
const popper = new PopperManager();
|
|
25
26
|
const listTypes = [schema.nodes.ordered_list, schema.nodes.bullet_list];
|
|
26
27
|
const readonlyTypes = [schema.nodes.keywords, schema.nodes.bibliography_element];
|
|
@@ -136,7 +137,7 @@ export class ContextMenu {
|
|
|
136
137
|
this.addPopperEventListeners();
|
|
137
138
|
};
|
|
138
139
|
this.showEditMenu = (target) => {
|
|
139
|
-
var _a
|
|
140
|
+
var _a;
|
|
140
141
|
const menu = document.createElement('div');
|
|
141
142
|
menu.className = 'menu';
|
|
142
143
|
const $pos = this.resolvePos();
|
|
@@ -172,9 +173,9 @@ export class ContextMenu {
|
|
|
172
173
|
const tableElementFooter = findChildrenByType(this.node, schema.nodes.table_element_footer);
|
|
173
174
|
let isDeletedOrRejected = false;
|
|
174
175
|
const hasGeneralNote = tableElementFooter.length &&
|
|
175
|
-
(
|
|
176
|
+
getChildOfType(tableElementFooter[0].node, schema.nodes.general_table_footnote, true);
|
|
176
177
|
if (hasGeneralNote) {
|
|
177
|
-
const generalFootnote = (
|
|
178
|
+
const generalFootnote = (_a = tableElementFooter[0]) === null || _a === void 0 ? void 0 : _a.node.firstChild;
|
|
178
179
|
if (generalFootnote) {
|
|
179
180
|
isDeletedOrRejected =
|
|
180
181
|
isDeleted(generalFootnote) || isRejectedInsert(generalFootnote);
|
|
@@ -75,7 +75,7 @@ const deleteFootnoteWidget = (node, props, id, tableElement) => (view, getPos) =
|
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
node.content.forEach((item) => {
|
|
78
|
-
if (item.type === schema.nodes.
|
|
78
|
+
if (item.type === schema.nodes.general_table_footnote && pos) {
|
|
79
79
|
tr.delete(pos - 1, pos + item.nodeSize + 1);
|
|
80
80
|
}
|
|
81
81
|
});
|
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": "1.11.
|
|
4
|
+
"version": "1.11.6",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@iarna/word-count": "^1.1.2",
|
|
31
31
|
"@manuscripts/json-schema": "2.2.8",
|
|
32
32
|
"@manuscripts/library": "1.3.7",
|
|
33
|
-
"@manuscripts/style-guide": "1.12.
|
|
33
|
+
"@manuscripts/style-guide": "1.12.14",
|
|
34
34
|
"@manuscripts/track-changes-plugin": "1.7.12",
|
|
35
|
-
"@manuscripts/transform": "2.3.
|
|
35
|
+
"@manuscripts/transform": "2.3.7",
|
|
36
36
|
"astrocite-eutils": "^0.16.4",
|
|
37
37
|
"mathjax-full": "^3.2.2",
|
|
38
38
|
"codemirror": "^5.58.1",
|
package/styles/Editor.css
CHANGED
|
@@ -971,7 +971,8 @@
|
|
|
971
971
|
fill: #353535;
|
|
972
972
|
}
|
|
973
973
|
.ProseMirror .table-footnotes-element > div,
|
|
974
|
-
.ProseMirror .block-footnotes_element > .block > div
|
|
974
|
+
.ProseMirror .block-footnotes_element > .block > div,
|
|
975
|
+
.ProseMirror .general-table-footnote
|
|
975
976
|
{
|
|
976
977
|
position: relative;
|
|
977
978
|
}
|
|
@@ -995,37 +996,27 @@
|
|
|
995
996
|
margin-top: 0px;
|
|
996
997
|
}
|
|
997
998
|
|
|
998
|
-
.ProseMirror .footnote-selected, .table-footer > div:has(> p.footnote-selected) > p {
|
|
999
|
-
background-color: #f2fbfc;
|
|
1000
|
-
padding: 4px;
|
|
1001
|
-
}
|
|
1002
999
|
.table-footer > div {
|
|
1003
1000
|
position: relative;
|
|
1004
1001
|
}
|
|
1005
1002
|
|
|
1006
|
-
.table-
|
|
1007
|
-
padding-bottom:
|
|
1003
|
+
.general-table-footnote > p {
|
|
1004
|
+
padding-bottom: 8px;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.general-table-footnote:has(> p.footnote-selected) > p:last-child {
|
|
1008
|
+
padding-bottom: 0;
|
|
1008
1009
|
}
|
|
1009
1010
|
|
|
1010
1011
|
.ProseMirror .table-footnotes-element .footnote-selected,
|
|
1011
|
-
.ProseMirror .block-footnotes_element .footnote-selected
|
|
1012
|
+
.ProseMirror .block-footnotes_element .footnote-selected,
|
|
1013
|
+
.ProseMirror .general-table-footnote:has(> p.footnote-selected)
|
|
1012
1014
|
{
|
|
1015
|
+
background-color: #f2fbfc;
|
|
1016
|
+
padding: 4px;
|
|
1013
1017
|
border: 1px solid #bce7f6;
|
|
1014
1018
|
}
|
|
1015
|
-
|
|
1016
|
-
border-left: 1px solid #bce7f6;
|
|
1017
|
-
border-right: 1px solid #bce7f6;
|
|
1018
|
-
}
|
|
1019
|
-
.table-footer > div:has(> p.footnote-selected) > p:first-child {
|
|
1020
|
-
border-top: 1px solid #bce7f6;
|
|
1021
|
-
position: relative;
|
|
1022
|
-
}
|
|
1023
|
-
.table-footer > div:has(> p.footnote-selected) > p:last-of-type {
|
|
1024
|
-
border-bottom: 1px solid #bce7f6;
|
|
1025
|
-
}
|
|
1026
|
-
.table-footer > div:has(> p.footnote-selected) > p:last-child {
|
|
1027
|
-
border-bottom: 1px solid #bce7f6;
|
|
1028
|
-
}
|
|
1019
|
+
|
|
1029
1020
|
.ProseMirror .footnote-label {
|
|
1030
1021
|
vertical-align: super;
|
|
1031
1022
|
font-size: 75%;
|