@manuscripts/body-editor 1.6.15-LEAN-3289-0 → 1.6.16
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 -7
- package/dist/es/commands.js +4 -7
- package/package.json +1 -1
- package/styles/Editor.css +18 -8
package/dist/cjs/commands.js
CHANGED
|
@@ -287,9 +287,9 @@ const insertInlineFootnote = (kind) => (state, dispatch) => {
|
|
|
287
287
|
});
|
|
288
288
|
const tr = state.tr;
|
|
289
289
|
tr.insert(insertedAt, node);
|
|
290
|
-
const
|
|
290
|
+
const elements = (0, prosemirror_utils_1.findChildrenByType)(tr.doc, transform_1.schema.nodes.footnotes_element);
|
|
291
291
|
let selectionPos;
|
|
292
|
-
if (!
|
|
292
|
+
if (!elements.length) {
|
|
293
293
|
const section = state.schema.nodes.footnotes_section.create({}, [
|
|
294
294
|
state.schema.nodes.section_title.create({}, state.schema.text('Notes')),
|
|
295
295
|
state.schema.nodes.footnotes_element.create({}, footnote),
|
|
@@ -299,11 +299,8 @@ const insertInlineFootnote = (kind) => (state, dispatch) => {
|
|
|
299
299
|
selectionPos = backmatter.pos + section.nodeSize - 3;
|
|
300
300
|
}
|
|
301
301
|
else {
|
|
302
|
-
const
|
|
303
|
-
const pos =
|
|
304
|
-
footnoteElement[0].pos +
|
|
305
|
-
footnoteElement[0].node.nodeSize -
|
|
306
|
-
1;
|
|
302
|
+
const element = elements[0];
|
|
303
|
+
const pos = element.pos + element.node.nodeSize - 1;
|
|
307
304
|
tr.insert(pos, footnote);
|
|
308
305
|
selectionPos = pos + 2;
|
|
309
306
|
}
|
package/dist/es/commands.js
CHANGED
|
@@ -269,9 +269,9 @@ export const insertInlineFootnote = (kind) => (state, dispatch) => {
|
|
|
269
269
|
});
|
|
270
270
|
const tr = state.tr;
|
|
271
271
|
tr.insert(insertedAt, node);
|
|
272
|
-
const
|
|
272
|
+
const elements = findChildrenByType(tr.doc, schema.nodes.footnotes_element);
|
|
273
273
|
let selectionPos;
|
|
274
|
-
if (!
|
|
274
|
+
if (!elements.length) {
|
|
275
275
|
const section = state.schema.nodes.footnotes_section.create({}, [
|
|
276
276
|
state.schema.nodes.section_title.create({}, state.schema.text('Notes')),
|
|
277
277
|
state.schema.nodes.footnotes_element.create({}, footnote),
|
|
@@ -281,11 +281,8 @@ export const insertInlineFootnote = (kind) => (state, dispatch) => {
|
|
|
281
281
|
selectionPos = backmatter.pos + section.nodeSize - 3;
|
|
282
282
|
}
|
|
283
283
|
else {
|
|
284
|
-
const
|
|
285
|
-
const pos =
|
|
286
|
-
footnoteElement[0].pos +
|
|
287
|
-
footnoteElement[0].node.nodeSize -
|
|
288
|
-
1;
|
|
284
|
+
const element = elements[0];
|
|
285
|
+
const pos = element.pos + element.node.nodeSize - 1;
|
|
289
286
|
tr.insert(pos, footnote);
|
|
290
287
|
selectionPos = pos + 2;
|
|
291
288
|
}
|
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.6.
|
|
4
|
+
"version": "1.6.16",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
package/styles/Editor.css
CHANGED
|
@@ -941,9 +941,6 @@
|
|
|
941
941
|
|
|
942
942
|
.ProseMirror .table-footer {
|
|
943
943
|
font-size: 14px;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
.ProseMirror .table-footer .footnote-element:first-child {
|
|
947
944
|
padding-top: 8px;
|
|
948
945
|
}
|
|
949
946
|
|
|
@@ -969,17 +966,31 @@
|
|
|
969
966
|
margin-right: 4px;
|
|
970
967
|
}
|
|
971
968
|
|
|
972
|
-
.ProseMirror .table-footer
|
|
969
|
+
.ProseMirror .table-footer p {
|
|
973
970
|
margin-bottom: 0px;
|
|
974
971
|
margin-top: 0px;
|
|
975
972
|
}
|
|
976
973
|
|
|
974
|
+
.ProseMirror .table-footer .footnote-selected, .table-footer > div:has(> p.footnote-selected) > p {
|
|
975
|
+
background-color: #f2fbfc;
|
|
976
|
+
padding: 4px;
|
|
977
|
+
}
|
|
978
|
+
.table-footer > div > p {
|
|
979
|
+
padding-bottom: 10px;
|
|
980
|
+
}
|
|
977
981
|
.ProseMirror .table-footer .footnote-element .footnote-selected {
|
|
978
|
-
padding: 8px 0 8px 0;
|
|
979
982
|
border: 1px solid #bce7f6;
|
|
980
|
-
background-color: #f2fbfc;
|
|
981
983
|
}
|
|
982
|
-
|
|
984
|
+
.table-footer > div:has(> p.footnote-selected) > p {
|
|
985
|
+
border-left: 1px solid #bce7f6;
|
|
986
|
+
border-right: 1px solid #bce7f6;
|
|
987
|
+
}
|
|
988
|
+
.table-footer > div:has(> p.footnote-selected) > p:first-child {
|
|
989
|
+
border-top: 1px solid #bce7f6;
|
|
990
|
+
}
|
|
991
|
+
.table-footer > div:has(> p.footnote-selected) > p:last-child {
|
|
992
|
+
border-bottom: 1px solid #bce7f6;
|
|
993
|
+
}
|
|
983
994
|
.ProseMirror .footnote-label {
|
|
984
995
|
vertical-align: super;
|
|
985
996
|
font-size: 75%;
|
|
@@ -1006,4 +1017,3 @@
|
|
|
1006
1017
|
div[style*="background-color: rgba(249, 2, 2, 0.53)"] {
|
|
1007
1018
|
background-color: #ffe08b !important;
|
|
1008
1019
|
}
|
|
1009
|
-
|