@manuscripts/body-editor 1.10.1 → 1.10.2-LEAN-3519.0
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 +8 -21
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];
|
|
@@ -142,7 +143,7 @@ class ContextMenu {
|
|
|
142
143
|
this.addPopperEventListeners();
|
|
143
144
|
};
|
|
144
145
|
this.showEditMenu = (target) => {
|
|
145
|
-
var _a
|
|
146
|
+
var _a;
|
|
146
147
|
const menu = document.createElement('div');
|
|
147
148
|
menu.className = 'menu';
|
|
148
149
|
const $pos = this.resolvePos();
|
|
@@ -178,9 +179,9 @@ class ContextMenu {
|
|
|
178
179
|
const tableElementFooter = (0, prosemirror_utils_1.findChildrenByType)(this.node, transform_1.schema.nodes.table_element_footer);
|
|
179
180
|
let isDeletedOrRejected = false;
|
|
180
181
|
const hasGeneralNote = tableElementFooter.length &&
|
|
181
|
-
((
|
|
182
|
+
(0, utils_1.getChildOfType)(tableElementFooter[0].node, transform_1.schema.nodes.general_table_footnote, true);
|
|
182
183
|
if (hasGeneralNote) {
|
|
183
|
-
const generalFootnote = (
|
|
184
|
+
const generalFootnote = (_a = tableElementFooter[0]) === null || _a === void 0 ? void 0 : _a.node.firstChild;
|
|
184
185
|
if (generalFootnote) {
|
|
185
186
|
isDeletedOrRejected =
|
|
186
187
|
(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];
|
|
@@ -135,7 +136,7 @@ export class ContextMenu {
|
|
|
135
136
|
this.addPopperEventListeners();
|
|
136
137
|
};
|
|
137
138
|
this.showEditMenu = (target) => {
|
|
138
|
-
var _a
|
|
139
|
+
var _a;
|
|
139
140
|
const menu = document.createElement('div');
|
|
140
141
|
menu.className = 'menu';
|
|
141
142
|
const $pos = this.resolvePos();
|
|
@@ -171,9 +172,9 @@ export class ContextMenu {
|
|
|
171
172
|
const tableElementFooter = findChildrenByType(this.node, schema.nodes.table_element_footer);
|
|
172
173
|
let isDeletedOrRejected = false;
|
|
173
174
|
const hasGeneralNote = tableElementFooter.length &&
|
|
174
|
-
(
|
|
175
|
+
getChildOfType(tableElementFooter[0].node, schema.nodes.general_table_footnote, true);
|
|
175
176
|
if (hasGeneralNote) {
|
|
176
|
-
const generalFootnote = (
|
|
177
|
+
const generalFootnote = (_a = tableElementFooter[0]) === null || _a === void 0 ? void 0 : _a.node.firstChild;
|
|
177
178
|
if (generalFootnote) {
|
|
178
179
|
isDeletedOrRejected =
|
|
179
180
|
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.10.
|
|
4
|
+
"version": "1.10.2-LEAN-3519.0",
|
|
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.7",
|
|
32
32
|
"@manuscripts/library": "^1.3.6",
|
|
33
|
-
"@manuscripts/style-guide": "1.12.
|
|
33
|
+
"@manuscripts/style-guide": "1.12.9-LEAN-3519.0",
|
|
34
34
|
"@manuscripts/track-changes-plugin": "1.7.11",
|
|
35
|
-
"@manuscripts/transform": "2.3.
|
|
35
|
+
"@manuscripts/transform": "2.3.5-LEAN-3519.0",
|
|
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,23 @@
|
|
|
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-
|
|
1003
|
+
.general-table-footnote > p {
|
|
1007
1004
|
padding-bottom: 10px;
|
|
1008
1005
|
}
|
|
1009
1006
|
|
|
1010
1007
|
.ProseMirror .table-footnotes-element .footnote-selected,
|
|
1011
|
-
.ProseMirror .block-footnotes_element .footnote-selected
|
|
1008
|
+
.ProseMirror .block-footnotes_element .footnote-selected,
|
|
1009
|
+
.ProseMirror .general-table-footnote:has(> p.footnote-selected)
|
|
1012
1010
|
{
|
|
1011
|
+
background-color: #f2fbfc;
|
|
1012
|
+
padding: 4px;
|
|
1013
1013
|
border: 1px solid #bce7f6;
|
|
1014
1014
|
}
|
|
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
|
-
}
|
|
1015
|
+
|
|
1029
1016
|
.ProseMirror .footnote-label {
|
|
1030
1017
|
vertical-align: super;
|
|
1031
1018
|
font-size: 75%;
|