@manuscripts/body-editor 1.9.5 → 1.9.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.
|
@@ -214,7 +214,10 @@ class ContextMenu {
|
|
|
214
214
|
index: tablesFootnoteLabels.get(node.attrs.id),
|
|
215
215
|
}));
|
|
216
216
|
const targetDom = this.view.domAtPos(this.view.state.selection.from);
|
|
217
|
-
|
|
217
|
+
const targetNode = targetDom.node.nodeType === Node.TEXT_NODE
|
|
218
|
+
? targetDom.node.parentNode
|
|
219
|
+
: targetDom.node;
|
|
220
|
+
if (targetNode instanceof Element && this.props) {
|
|
218
221
|
const popperContainer = (0, ReactSubView_1.default)(Object.assign(Object.assign({}, this.props), { dispatch: this.view.dispatch }), style_guide_1.TableFootnotesSelector, {
|
|
219
222
|
notes: footnotes,
|
|
220
223
|
onAdd: () => {
|
|
@@ -251,7 +254,7 @@ class ContextMenu {
|
|
|
251
254
|
(_a = this.props) === null || _a === void 0 ? void 0 : _a.popper.destroy();
|
|
252
255
|
},
|
|
253
256
|
}, this.node, this.getPos, this.view, 'table-footnote-editor');
|
|
254
|
-
(_a = this.props) === null || _a === void 0 ? void 0 : _a.popper.show(
|
|
257
|
+
(_a = this.props) === null || _a === void 0 ? void 0 : _a.popper.show(targetNode, popperContainer, 'bottom-end');
|
|
255
258
|
}
|
|
256
259
|
}
|
|
257
260
|
}));
|
|
@@ -38,7 +38,8 @@ const buildPluginState = (doc) => {
|
|
|
38
38
|
doc.descendants((node, pos, parentNode) => {
|
|
39
39
|
if ((0, transform_1.isInlineFootnoteNode)(node) &&
|
|
40
40
|
parentNode &&
|
|
41
|
-
parentNode.type !== transform_1.schema.nodes.table_cell
|
|
41
|
+
parentNode.type !== transform_1.schema.nodes.table_cell &&
|
|
42
|
+
parentNode.type !== transform_1.schema.nodes.table_header) {
|
|
42
43
|
nodes.push([node, pos]);
|
|
43
44
|
node.attrs.rids.forEach((rid) => {
|
|
44
45
|
labels.set(rid, String(++index));
|
|
@@ -207,7 +207,10 @@ export class ContextMenu {
|
|
|
207
207
|
index: tablesFootnoteLabels.get(node.attrs.id),
|
|
208
208
|
}));
|
|
209
209
|
const targetDom = this.view.domAtPos(this.view.state.selection.from);
|
|
210
|
-
|
|
210
|
+
const targetNode = targetDom.node.nodeType === Node.TEXT_NODE
|
|
211
|
+
? targetDom.node.parentNode
|
|
212
|
+
: targetDom.node;
|
|
213
|
+
if (targetNode instanceof Element && this.props) {
|
|
211
214
|
const popperContainer = ReactSubView(Object.assign(Object.assign({}, this.props), { dispatch: this.view.dispatch }), TableFootnotesSelector, {
|
|
212
215
|
notes: footnotes,
|
|
213
216
|
onAdd: () => {
|
|
@@ -244,7 +247,7 @@ export class ContextMenu {
|
|
|
244
247
|
(_a = this.props) === null || _a === void 0 ? void 0 : _a.popper.destroy();
|
|
245
248
|
},
|
|
246
249
|
}, this.node, this.getPos, this.view, 'table-footnote-editor');
|
|
247
|
-
(_a = this.props) === null || _a === void 0 ? void 0 : _a.popper.show(
|
|
250
|
+
(_a = this.props) === null || _a === void 0 ? void 0 : _a.popper.show(targetNode, popperContainer, 'bottom-end');
|
|
248
251
|
}
|
|
249
252
|
}
|
|
250
253
|
}));
|
|
@@ -32,7 +32,8 @@ export const buildPluginState = (doc) => {
|
|
|
32
32
|
doc.descendants((node, pos, parentNode) => {
|
|
33
33
|
if (isInlineFootnoteNode(node) &&
|
|
34
34
|
parentNode &&
|
|
35
|
-
parentNode.type !== schema.nodes.table_cell
|
|
35
|
+
parentNode.type !== schema.nodes.table_cell &&
|
|
36
|
+
parentNode.type !== schema.nodes.table_header) {
|
|
36
37
|
nodes.push([node, pos]);
|
|
37
38
|
node.attrs.rids.forEach((rid) => {
|
|
38
39
|
labels.set(rid, String(++index));
|
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.9.
|
|
4
|
+
"version": "1.9.6",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|