@manuscripts/body-editor 2.8.53 → 2.8.54
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/lib/paste.js +16 -1
- package/dist/cjs/versions.js +1 -1
- package/dist/es/lib/paste.js +17 -2
- package/dist/es/versions.js +1 -1
- package/dist/types/versions.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/lib/paste.js
CHANGED
|
@@ -29,12 +29,27 @@ const removeFirstParagraphIfEmpty = (slice) => {
|
|
|
29
29
|
slice.content = slice.content.cut(firstChild.nodeSize);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
+
const updateInlineFootnoteToNewRids = (slice, footnotesIdsMap) => {
|
|
33
|
+
slice.content.descendants((node) => {
|
|
34
|
+
if (node.type === transform_1.schema.nodes.inline_footnote) {
|
|
35
|
+
node.attrs.rids = node.attrs.rids.map((rid) => footnotesIdsMap.get(rid));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
32
39
|
const removeIDs = (slice) => {
|
|
40
|
+
const footnotesIdsMap = new Map();
|
|
33
41
|
slice.content.descendants((node) => {
|
|
42
|
+
let id = null;
|
|
43
|
+
if (node.type === transform_1.schema.nodes.footnote) {
|
|
44
|
+
const newId = (0, transform_1.generateNodeID)(node.type);
|
|
45
|
+
footnotesIdsMap.set(node.attrs.id, newId);
|
|
46
|
+
id = newId;
|
|
47
|
+
}
|
|
34
48
|
if (node.attrs.id) {
|
|
35
|
-
node.attrs.id =
|
|
49
|
+
node.attrs.id = id;
|
|
36
50
|
}
|
|
37
51
|
});
|
|
52
|
+
updateInlineFootnoteToNewRids(slice, footnotesIdsMap);
|
|
38
53
|
};
|
|
39
54
|
const wrapInSection = (slice) => {
|
|
40
55
|
var _a;
|
package/dist/cjs/versions.js
CHANGED
package/dist/es/lib/paste.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { isElementNodeType, schema, } from '@manuscripts/transform';
|
|
16
|
+
import { generateNodeID, isElementNodeType, schema, } from '@manuscripts/transform';
|
|
17
17
|
import { Fragment, Slice } from 'prosemirror-model';
|
|
18
18
|
import { TextSelection } from 'prosemirror-state';
|
|
19
19
|
import { findParentNode } from 'prosemirror-utils';
|
|
@@ -26,12 +26,27 @@ const removeFirstParagraphIfEmpty = (slice) => {
|
|
|
26
26
|
slice.content = slice.content.cut(firstChild.nodeSize);
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
+
const updateInlineFootnoteToNewRids = (slice, footnotesIdsMap) => {
|
|
30
|
+
slice.content.descendants((node) => {
|
|
31
|
+
if (node.type === schema.nodes.inline_footnote) {
|
|
32
|
+
node.attrs.rids = node.attrs.rids.map((rid) => footnotesIdsMap.get(rid));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
};
|
|
29
36
|
const removeIDs = (slice) => {
|
|
37
|
+
const footnotesIdsMap = new Map();
|
|
30
38
|
slice.content.descendants((node) => {
|
|
39
|
+
let id = null;
|
|
40
|
+
if (node.type === schema.nodes.footnote) {
|
|
41
|
+
const newId = generateNodeID(node.type);
|
|
42
|
+
footnotesIdsMap.set(node.attrs.id, newId);
|
|
43
|
+
id = newId;
|
|
44
|
+
}
|
|
31
45
|
if (node.attrs.id) {
|
|
32
|
-
node.attrs.id =
|
|
46
|
+
node.attrs.id = id;
|
|
33
47
|
}
|
|
34
48
|
});
|
|
49
|
+
updateInlineFootnoteToNewRids(slice, footnotesIdsMap);
|
|
35
50
|
};
|
|
36
51
|
const wrapInSection = (slice) => {
|
|
37
52
|
var _a;
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.8.
|
|
1
|
+
export const VERSION = '2.8.54';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.8.
|
|
1
|
+
export declare const VERSION = "2.8.54";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
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": "2.8.
|
|
4
|
+
"version": "2.8.54",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|