@manuscripts/body-editor 1.8.7-LEAN-2746.1 → 1.9.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
CHANGED
|
@@ -59,10 +59,7 @@ const blockActive = (type) => (state) => {
|
|
|
59
59
|
};
|
|
60
60
|
exports.blockActive = blockActive;
|
|
61
61
|
const canInsert = (type) => (state) => {
|
|
62
|
-
const { $from
|
|
63
|
-
if ($from.node().type === transform_1.schema.nodes.title && $from.pos === $to.pos) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
62
|
+
const { $from } = state.selection;
|
|
66
63
|
for (let d = $from.depth; d >= 0; d--) {
|
|
67
64
|
const index = $from.index(d);
|
|
68
65
|
if ($from.node(d).canReplaceWith(index, index, type)) {
|
|
@@ -53,17 +53,11 @@ exports.default = (props) => {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
const hasCommentChange = !!tr.steps.find((s) => {
|
|
56
|
-
var _a, _b
|
|
56
|
+
var _a, _b;
|
|
57
57
|
if (s instanceof prosemirror_transform_1.ReplaceStep) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
((_b = newState.doc.nodeAt(s.from)) === null || _b === void 0 ? void 0 : _b.type) ===
|
|
62
|
-
transform_1.schema.nodes.highlight_marker);
|
|
63
|
-
}
|
|
64
|
-
return (((_c = oldState.doc.nodeAt(s.from)) === null || _c === void 0 ? void 0 : _c.type) === transform_1.schema.nodes.comment ||
|
|
65
|
-
((_d = oldState.doc.nodeAt(s.from)) === null || _d === void 0 ? void 0 : _d.type) ===
|
|
66
|
-
transform_1.schema.nodes.highlight_marker);
|
|
58
|
+
return s.slice.size > 0
|
|
59
|
+
? ((_a = newState.doc.nodeAt(s.from + 1)) === null || _a === void 0 ? void 0 : _a.type) === transform_1.schema.nodes.comment
|
|
60
|
+
: ((_b = oldState.doc.nodeAt(s.from)) === null || _b === void 0 ? void 0 : _b.type) === transform_1.schema.nodes.comment;
|
|
67
61
|
}
|
|
68
62
|
});
|
|
69
63
|
if (hasCommentChange) {
|
package/dist/es/commands.js
CHANGED
|
@@ -53,10 +53,7 @@ export const blockActive = (type) => (state) => {
|
|
|
53
53
|
return false;
|
|
54
54
|
};
|
|
55
55
|
export const canInsert = (type) => (state) => {
|
|
56
|
-
const { $from
|
|
57
|
-
if ($from.node().type === schema.nodes.title && $from.pos === $to.pos) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
56
|
+
const { $from } = state.selection;
|
|
60
57
|
for (let d = $from.depth; d >= 0; d--) {
|
|
61
58
|
const index = $from.index(d);
|
|
62
59
|
if ($from.node(d).canReplaceWith(index, index, type)) {
|
|
@@ -47,17 +47,11 @@ export default (props) => {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
const hasCommentChange = !!tr.steps.find((s) => {
|
|
50
|
-
var _a, _b
|
|
50
|
+
var _a, _b;
|
|
51
51
|
if (s instanceof ReplaceStep) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
((_b = newState.doc.nodeAt(s.from)) === null || _b === void 0 ? void 0 : _b.type) ===
|
|
56
|
-
schema.nodes.highlight_marker);
|
|
57
|
-
}
|
|
58
|
-
return (((_c = oldState.doc.nodeAt(s.from)) === null || _c === void 0 ? void 0 : _c.type) === schema.nodes.comment ||
|
|
59
|
-
((_d = oldState.doc.nodeAt(s.from)) === null || _d === void 0 ? void 0 : _d.type) ===
|
|
60
|
-
schema.nodes.highlight_marker);
|
|
52
|
+
return s.slice.size > 0
|
|
53
|
+
? ((_a = newState.doc.nodeAt(s.from + 1)) === null || _a === void 0 ? void 0 : _a.type) === schema.nodes.comment
|
|
54
|
+
: ((_b = oldState.doc.nodeAt(s.from)) === null || _b === void 0 ? void 0 : _b.type) === schema.nodes.comment;
|
|
61
55
|
}
|
|
62
56
|
});
|
|
63
57
|
if (hasCommentChange) {
|
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.
|
|
4
|
+
"version": "1.9.0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@manuscripts/assets": "^0.6.4",
|
|
32
32
|
"@manuscripts/json-schema": "^2.2.7",
|
|
33
33
|
"@manuscripts/library": "^1.3.6",
|
|
34
|
-
"@manuscripts/style-guide": "1.
|
|
34
|
+
"@manuscripts/style-guide": "1.12.0",
|
|
35
35
|
"@manuscripts/track-changes-plugin": "1.7.10",
|
|
36
|
-
"@manuscripts/transform": "2.
|
|
36
|
+
"@manuscripts/transform": "2.3.0",
|
|
37
37
|
"astrocite-eutils": "^0.16.4",
|
|
38
38
|
"axios": "^1.6.7",
|
|
39
39
|
"mathjax-full": "^3.2.2",
|