@manuscripts/transform 2.1.7-LEAN-3321 → 2.1.8
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/jats/importer/jats-body-transformations.js +10 -24
- package/dist/cjs/schema/nodes/table_col.js +2 -0
- package/dist/cjs/schema/nodes/table_element_footer.js +1 -2
- package/dist/es/jats/importer/jats-body-transformations.js +10 -24
- package/dist/es/schema/nodes/table_col.js +2 -0
- package/dist/es/schema/nodes/table_element_footer.js +1 -2
- package/dist/types/schema/nodes/table_col.d.ts +4 -4
- package/package.json +1 -1
|
@@ -202,34 +202,20 @@ exports.jatsBodyTransformations = {
|
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
204
|
moveFootnotes(doc, group, createElement) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
];
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
for (const footnote of footnotes) {
|
|
212
|
-
const type = footnote.getAttribute('fn-type');
|
|
213
|
-
if (!type) {
|
|
205
|
+
var _a;
|
|
206
|
+
const footnotes = Array.from(doc.querySelectorAll('fn:not(table-wrap-foot fn, author-notes fn)'));
|
|
207
|
+
let footnotesSection = doc.querySelector('sec[sec-type="endnotes"]');
|
|
208
|
+
const containingGroup = (footnotesSection === null || footnotesSection === void 0 ? void 0 : footnotesSection.querySelector('fn-group')) || createElement('fn-group');
|
|
209
|
+
footnotes.forEach((footnote) => {
|
|
210
|
+
if (!footnote.getAttribute('fn-type')) {
|
|
214
211
|
containingGroup.appendChild(footnote);
|
|
215
212
|
}
|
|
216
|
-
}
|
|
213
|
+
});
|
|
217
214
|
if (!footnotesSection && containingGroup.innerHTML) {
|
|
218
|
-
|
|
219
|
-
group.append(section);
|
|
215
|
+
footnotesSection = this.createFootnotesSection([containingGroup], createElement);
|
|
220
216
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
];
|
|
224
|
-
regularFootnoteGroups = regularFootnoteGroups.filter((group) => {
|
|
225
|
-
return group.childElementCount === 0
|
|
226
|
-
? false
|
|
227
|
-
: !group.querySelector('fn[fn-type]');
|
|
228
|
-
});
|
|
229
|
-
if (regularFootnoteGroups.length > 0) {
|
|
230
|
-
regularFootnoteGroups.map((g) => removeNodeFromParent(g));
|
|
231
|
-
const footnotes = this.createFootnotesSection(regularFootnoteGroups, createElement);
|
|
232
|
-
group.appendChild(footnotes);
|
|
217
|
+
if (footnotesSection) {
|
|
218
|
+
group.insertBefore(footnotesSection, ((_a = group.firstChild) === null || _a === void 0 ? void 0 : _a.nextSibling) || group.firstChild);
|
|
233
219
|
}
|
|
234
220
|
},
|
|
235
221
|
moveCaptionsToEnd(body) {
|
|
@@ -19,6 +19,7 @@ exports.tableCol = exports.tableColGroup = void 0;
|
|
|
19
19
|
exports.tableColGroup = {
|
|
20
20
|
content: 'table_col+',
|
|
21
21
|
group: 'block',
|
|
22
|
+
tableRole: 'colgroup',
|
|
22
23
|
parseDOM: [
|
|
23
24
|
{
|
|
24
25
|
tag: 'colgroup',
|
|
@@ -33,6 +34,7 @@ exports.tableCol = {
|
|
|
33
34
|
width: { default: '' },
|
|
34
35
|
},
|
|
35
36
|
group: 'block',
|
|
37
|
+
tableRole: 'col',
|
|
36
38
|
parseDOM: [
|
|
37
39
|
{
|
|
38
40
|
tag: 'col',
|
|
@@ -19,9 +19,8 @@ exports.tableElementFooter = void 0;
|
|
|
19
19
|
exports.tableElementFooter = {
|
|
20
20
|
attrs: {
|
|
21
21
|
id: { default: '' },
|
|
22
|
-
dataTracked: { default: null }
|
|
23
22
|
},
|
|
24
|
-
content: '(paragraph | footnotes_element)
|
|
23
|
+
content: '(paragraph | footnotes_element)+',
|
|
25
24
|
group: 'block element',
|
|
26
25
|
toDOM: () => ['table-wrap-foot', 0],
|
|
27
26
|
};
|
|
@@ -199,34 +199,20 @@ export const jatsBodyTransformations = {
|
|
|
199
199
|
}
|
|
200
200
|
},
|
|
201
201
|
moveFootnotes(doc, group, createElement) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
];
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
for (const footnote of footnotes) {
|
|
209
|
-
const type = footnote.getAttribute('fn-type');
|
|
210
|
-
if (!type) {
|
|
202
|
+
var _a;
|
|
203
|
+
const footnotes = Array.from(doc.querySelectorAll('fn:not(table-wrap-foot fn, author-notes fn)'));
|
|
204
|
+
let footnotesSection = doc.querySelector('sec[sec-type="endnotes"]');
|
|
205
|
+
const containingGroup = (footnotesSection === null || footnotesSection === void 0 ? void 0 : footnotesSection.querySelector('fn-group')) || createElement('fn-group');
|
|
206
|
+
footnotes.forEach((footnote) => {
|
|
207
|
+
if (!footnote.getAttribute('fn-type')) {
|
|
211
208
|
containingGroup.appendChild(footnote);
|
|
212
209
|
}
|
|
213
|
-
}
|
|
210
|
+
});
|
|
214
211
|
if (!footnotesSection && containingGroup.innerHTML) {
|
|
215
|
-
|
|
216
|
-
group.append(section);
|
|
212
|
+
footnotesSection = this.createFootnotesSection([containingGroup], createElement);
|
|
217
213
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
];
|
|
221
|
-
regularFootnoteGroups = regularFootnoteGroups.filter((group) => {
|
|
222
|
-
return group.childElementCount === 0
|
|
223
|
-
? false
|
|
224
|
-
: !group.querySelector('fn[fn-type]');
|
|
225
|
-
});
|
|
226
|
-
if (regularFootnoteGroups.length > 0) {
|
|
227
|
-
regularFootnoteGroups.map((g) => removeNodeFromParent(g));
|
|
228
|
-
const footnotes = this.createFootnotesSection(regularFootnoteGroups, createElement);
|
|
229
|
-
group.appendChild(footnotes);
|
|
214
|
+
if (footnotesSection) {
|
|
215
|
+
group.insertBefore(footnotesSection, ((_a = group.firstChild) === null || _a === void 0 ? void 0 : _a.nextSibling) || group.firstChild);
|
|
230
216
|
}
|
|
231
217
|
},
|
|
232
218
|
moveCaptionsToEnd(body) {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
export const tableColGroup = {
|
|
17
17
|
content: 'table_col+',
|
|
18
18
|
group: 'block',
|
|
19
|
+
tableRole: 'colgroup',
|
|
19
20
|
parseDOM: [
|
|
20
21
|
{
|
|
21
22
|
tag: 'colgroup',
|
|
@@ -30,6 +31,7 @@ export const tableCol = {
|
|
|
30
31
|
width: { default: '' },
|
|
31
32
|
},
|
|
32
33
|
group: 'block',
|
|
34
|
+
tableRole: 'col',
|
|
33
35
|
parseDOM: [
|
|
34
36
|
{
|
|
35
37
|
tag: 'col',
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
export const tableElementFooter = {
|
|
17
17
|
attrs: {
|
|
18
18
|
id: { default: '' },
|
|
19
|
-
dataTracked: { default: null }
|
|
20
19
|
},
|
|
21
|
-
content: '(paragraph | footnotes_element)
|
|
20
|
+
content: '(paragraph | footnotes_element)+',
|
|
22
21
|
group: 'block element',
|
|
23
22
|
toDOM: () => ['table-wrap-foot', 0],
|
|
24
23
|
};
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import { ManuscriptNode, TableNodeSpec } from '../types';
|
|
17
|
+
export type TableColGroupNode = ManuscriptNode;
|
|
18
18
|
export interface TableColNode extends ManuscriptNode {
|
|
19
19
|
attrs: {
|
|
20
20
|
width: string;
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
export declare const tableColGroup:
|
|
24
|
-
export declare const tableCol:
|
|
23
|
+
export declare const tableColGroup: TableNodeSpec;
|
|
24
|
+
export declare const tableCol: TableNodeSpec;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/transform",
|
|
3
3
|
"description": "ProseMirror transformer for Manuscripts applications",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.8",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|