@manuscripts/body-editor 2.0.43-LEAN-3840.2 → 2.0.44
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 +1 -1
- package/dist/cjs/lib/doc.js +3 -2
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/footnote.js +0 -1
- package/dist/cjs/views/inline_footnote.js +5 -11
- package/dist/es/commands.js +1 -1
- package/dist/es/lib/doc.js +3 -2
- package/dist/es/versions.js +1 -1
- package/dist/es/views/footnote.js +0 -1
- package/dist/es/views/inline_footnote.js +6 -12
- package/dist/types/versions.d.ts +1 -1
- package/package.json +3 -3
package/dist/cjs/commands.js
CHANGED
|
@@ -196,7 +196,7 @@ const insertTable = (config, state, dispatch) => {
|
|
|
196
196
|
};
|
|
197
197
|
exports.insertTable = insertTable;
|
|
198
198
|
const insertSupplement = (file, state, dispatch) => {
|
|
199
|
-
const supplement = transform_1.schema.nodes.supplement.
|
|
199
|
+
const supplement = transform_1.schema.nodes.supplement.createAndFill({
|
|
200
200
|
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.supplement),
|
|
201
201
|
href: file.id,
|
|
202
202
|
});
|
package/dist/cjs/lib/doc.js
CHANGED
|
@@ -11,9 +11,10 @@ const insertSupplementsNode = (tr) => {
|
|
|
11
11
|
}
|
|
12
12
|
const abstracts = (0, exports.findAbstractsNode)(doc);
|
|
13
13
|
const pos = abstracts.pos - 1;
|
|
14
|
-
|
|
14
|
+
const supplementsNode = transform_1.schema.nodes.supplements.createAndFill();
|
|
15
|
+
tr.insert(pos, supplementsNode);
|
|
15
16
|
return {
|
|
16
|
-
node:
|
|
17
|
+
node: supplementsNode,
|
|
17
18
|
pos,
|
|
18
19
|
};
|
|
19
20
|
};
|
package/dist/cjs/versions.js
CHANGED
|
@@ -35,7 +35,6 @@ const setTCClasses = (node, dom) => {
|
|
|
35
35
|
const lastChange = dataTracked[dataTracked.length - 1];
|
|
36
36
|
const changeClasses = (0, track_changes_utils_1.getChangeClasses)([lastChange]);
|
|
37
37
|
dom.classList.add(...changeClasses);
|
|
38
|
-
dom.setAttribute('id', node.attrs.id);
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
40
|
exports.setTCClasses = setTCClasses;
|
|
@@ -88,15 +88,9 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
88
88
|
const fnState = footnotes_2.footnotesKey.getState(this.view.state);
|
|
89
89
|
if (fnState) {
|
|
90
90
|
this.activateModal({
|
|
91
|
-
notes: Array.from(fnState.unusedFootnotes.values()).
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
acc.push({
|
|
95
|
-
node,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
return acc;
|
|
99
|
-
}, []),
|
|
91
|
+
notes: Array.from(fnState.unusedFootnotes.values()).map((n) => ({
|
|
92
|
+
node: n[0],
|
|
93
|
+
})),
|
|
100
94
|
onCancel: () => {
|
|
101
95
|
const { tr } = this.view.state;
|
|
102
96
|
if (!this.node.attrs.rids.length) {
|
|
@@ -121,12 +115,12 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
121
115
|
return false;
|
|
122
116
|
};
|
|
123
117
|
this.updateContents = () => {
|
|
124
|
-
const attrs =
|
|
118
|
+
const attrs = this.node.attrs;
|
|
125
119
|
this.dom.setAttribute('rids', attrs.rids.join(','));
|
|
126
120
|
this.dom.setAttribute('contents', attrs.contents);
|
|
127
121
|
this.dom.className = [
|
|
128
122
|
'footnote',
|
|
129
|
-
...(0, track_changes_utils_1.getChangeClasses)(
|
|
123
|
+
...(0, track_changes_utils_1.getChangeClasses)(attrs.dataTracked),
|
|
130
124
|
].join(' ');
|
|
131
125
|
if (this.isSelected() &&
|
|
132
126
|
(!attrs.rids || !attrs.rids.length) &&
|
package/dist/es/commands.js
CHANGED
|
@@ -184,7 +184,7 @@ export const insertTable = (config, state, dispatch) => {
|
|
|
184
184
|
return true;
|
|
185
185
|
};
|
|
186
186
|
export const insertSupplement = (file, state, dispatch) => {
|
|
187
|
-
const supplement = schema.nodes.supplement.
|
|
187
|
+
const supplement = schema.nodes.supplement.createAndFill({
|
|
188
188
|
id: generateNodeID(schema.nodes.supplement),
|
|
189
189
|
href: file.id,
|
|
190
190
|
});
|
package/dist/es/lib/doc.js
CHANGED
|
@@ -8,9 +8,10 @@ export const insertSupplementsNode = (tr) => {
|
|
|
8
8
|
}
|
|
9
9
|
const abstracts = findAbstractsNode(doc);
|
|
10
10
|
const pos = abstracts.pos - 1;
|
|
11
|
-
|
|
11
|
+
const supplementsNode = schema.nodes.supplements.createAndFill();
|
|
12
|
+
tr.insert(pos, supplementsNode);
|
|
12
13
|
return {
|
|
13
|
-
node:
|
|
14
|
+
node: supplementsNode,
|
|
14
15
|
pos,
|
|
15
16
|
};
|
|
16
17
|
};
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.0.
|
|
1
|
+
export const VERSION = '2.0.44';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -28,7 +28,6 @@ export const setTCClasses = (node, dom) => {
|
|
|
28
28
|
const lastChange = dataTracked[dataTracked.length - 1];
|
|
29
29
|
const changeClasses = getChangeClasses([lastChange]);
|
|
30
30
|
dom.classList.add(...changeClasses);
|
|
31
|
-
dom.setAttribute('id', node.attrs.id);
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
export default createNodeOrElementView(FootnoteView, 'div', setTCClasses);
|
|
@@ -20,7 +20,7 @@ import { findChildrenByType, findParentNodeClosestToPos, } from 'prosemirror-uti
|
|
|
20
20
|
import { createFootnote, insertFootnote, insertTableFootnote, } from '../commands';
|
|
21
21
|
import { FootnotesSelector } from '../components/views/FootnotesSelector';
|
|
22
22
|
import { buildTableFootnoteLabels } from '../lib/footnotes';
|
|
23
|
-
import {
|
|
23
|
+
import { getChangeClasses, isDeleted, isPendingInsert, isRejectedInsert, } from '../lib/track-changes-utils';
|
|
24
24
|
import { footnotesKey } from '../plugins/footnotes';
|
|
25
25
|
import { BaseNodeView } from './base_node_view';
|
|
26
26
|
import { createNodeView } from './creators';
|
|
@@ -82,15 +82,9 @@ export class InlineFootnoteView extends BaseNodeView {
|
|
|
82
82
|
const fnState = footnotesKey.getState(this.view.state);
|
|
83
83
|
if (fnState) {
|
|
84
84
|
this.activateModal({
|
|
85
|
-
notes: Array.from(fnState.unusedFootnotes.values()).
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
acc.push({
|
|
89
|
-
node,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
return acc;
|
|
93
|
-
}, []),
|
|
85
|
+
notes: Array.from(fnState.unusedFootnotes.values()).map((n) => ({
|
|
86
|
+
node: n[0],
|
|
87
|
+
})),
|
|
94
88
|
onCancel: () => {
|
|
95
89
|
const { tr } = this.view.state;
|
|
96
90
|
if (!this.node.attrs.rids.length) {
|
|
@@ -115,12 +109,12 @@ export class InlineFootnoteView extends BaseNodeView {
|
|
|
115
109
|
return false;
|
|
116
110
|
};
|
|
117
111
|
this.updateContents = () => {
|
|
118
|
-
const attrs =
|
|
112
|
+
const attrs = this.node.attrs;
|
|
119
113
|
this.dom.setAttribute('rids', attrs.rids.join(','));
|
|
120
114
|
this.dom.setAttribute('contents', attrs.contents);
|
|
121
115
|
this.dom.className = [
|
|
122
116
|
'footnote',
|
|
123
|
-
...getChangeClasses(
|
|
117
|
+
...getChangeClasses(attrs.dataTracked),
|
|
124
118
|
].join(' ');
|
|
125
119
|
if (this.isSelected() &&
|
|
126
120
|
(!attrs.rids || !attrs.rids.length) &&
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.
|
|
1
|
+
export declare const VERSION = "2.0.44";
|
|
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.0.
|
|
4
|
+
"version": "2.0.44",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@manuscripts/json-schema": "2.2.11",
|
|
34
34
|
"@manuscripts/library": "1.3.11",
|
|
35
35
|
"@manuscripts/style-guide": "2.0.19",
|
|
36
|
-
"@manuscripts/track-changes-plugin": "1.7.
|
|
36
|
+
"@manuscripts/track-changes-plugin": "1.7.17",
|
|
37
37
|
"@manuscripts/transform": "2.3.31",
|
|
38
38
|
"@popperjs/core": "^2.11.8",
|
|
39
39
|
"astrocite-eutils": "^0.16.4",
|
|
@@ -116,4 +116,4 @@
|
|
|
116
116
|
"engines": {
|
|
117
117
|
"node": ">=20.16.0"
|
|
118
118
|
}
|
|
119
|
-
}
|
|
119
|
+
}
|