@manuscripts/body-editor 1.8.1 → 1.8.3
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.
|
@@ -147,9 +147,10 @@ const CrossReferenceItems = ({ targets, handleSelect, handleCancel, currentTarge
|
|
|
147
147
|
react_1.default.createElement(style_guide_1.ButtonGroup, null,
|
|
148
148
|
react_1.default.createElement(style_guide_1.SecondaryButton, { onClick: handleCancel }, "Cancel"),
|
|
149
149
|
react_1.default.createElement(style_guide_1.PrimaryButton, { onClick: () => {
|
|
150
|
-
var _a;
|
|
150
|
+
var _a, _b;
|
|
151
151
|
return selectedItem &&
|
|
152
|
-
handleSelect(selectedItem, (_a = customTextRef.current) === null || _a === void 0 ? void 0 : _a.value)
|
|
152
|
+
handleSelect(selectedItem, ((_a = customTextRef.current) === null || _a === void 0 ? void 0 : _a.value) ||
|
|
153
|
+
((_b = targets.find(({ id }) => id === selectedItem)) === null || _b === void 0 ? void 0 : _b.label));
|
|
153
154
|
}, disabled: !selectedItem }, "Insert")))));
|
|
154
155
|
};
|
|
155
156
|
exports.CrossReferenceItems = CrossReferenceItems;
|
|
@@ -121,16 +121,14 @@ class FigureElementView extends block_view_1.default {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
deleteSupplementNode(file) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.view.dispatch(tr);
|
|
133
|
-
}
|
|
124
|
+
const tr = this.view.state.tr;
|
|
125
|
+
this.view.state.doc.descendants((node, pos) => {
|
|
126
|
+
if (node.type === transform_1.schema.nodes.supplement &&
|
|
127
|
+
node.attrs.href === file.id) {
|
|
128
|
+
tr.delete(pos, pos + node.nodeSize);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
this.view.dispatch(tr);
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
exports.FigureElementView = FigureElementView;
|
|
@@ -118,8 +118,9 @@ export const CrossReferenceItems = ({ targets, handleSelect, handleCancel, curre
|
|
|
118
118
|
React.createElement(ButtonGroup, null,
|
|
119
119
|
React.createElement(SecondaryButton, { onClick: handleCancel }, "Cancel"),
|
|
120
120
|
React.createElement(PrimaryButton, { onClick: () => {
|
|
121
|
-
var _a;
|
|
121
|
+
var _a, _b;
|
|
122
122
|
return selectedItem &&
|
|
123
|
-
handleSelect(selectedItem, (_a = customTextRef.current) === null || _a === void 0 ? void 0 : _a.value)
|
|
123
|
+
handleSelect(selectedItem, ((_a = customTextRef.current) === null || _a === void 0 ? void 0 : _a.value) ||
|
|
124
|
+
((_b = targets.find(({ id }) => id === selectedItem)) === null || _b === void 0 ? void 0 : _b.label));
|
|
124
125
|
}, disabled: !selectedItem }, "Insert")))));
|
|
125
126
|
};
|
|
@@ -115,16 +115,14 @@ export class FigureElementView extends BlockView {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
deleteSupplementNode(file) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.view.dispatch(tr);
|
|
127
|
-
}
|
|
118
|
+
const tr = this.view.state.tr;
|
|
119
|
+
this.view.state.doc.descendants((node, pos) => {
|
|
120
|
+
if (node.type === schema.nodes.supplement &&
|
|
121
|
+
node.attrs.href === file.id) {
|
|
122
|
+
tr.delete(pos, pos + node.nodeSize);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
this.view.dispatch(tr);
|
|
128
126
|
}
|
|
129
127
|
}
|
|
130
128
|
export default createNodeView(FigureElementView);
|
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.8.
|
|
4
|
+
"version": "1.8.3",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -112,4 +112,4 @@
|
|
|
112
112
|
"@types/react": "^17.0.2",
|
|
113
113
|
"prosemirror-tables": "^1.3.5"
|
|
114
114
|
}
|
|
115
|
-
}
|
|
115
|
+
}
|
|
@@ -839,12 +839,12 @@ Next levels are shifted 'up' by 1
|
|
|
839
839
|
display: inline-flex;
|
|
840
840
|
background: transparent;
|
|
841
841
|
border: 0;
|
|
842
|
+
font-family: 'PT Sans', sans-serif;
|
|
842
843
|
font-size: 1rem;
|
|
843
844
|
text-decoration: none;
|
|
844
845
|
color: inherit;
|
|
845
846
|
outline: none;
|
|
846
|
-
padding: 4px;
|
|
847
|
-
/* margin: 0 6px; */
|
|
847
|
+
padding: 4px 0 4px 4px;
|
|
848
848
|
}
|
|
849
849
|
|
|
850
850
|
.contributor:not(:disabled):hover {
|