@manuscripts/transform 2.1.9 → 2.1.10-LEAN-3321
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-dom-parser.js +1 -0
- package/dist/cjs/jats/jats-exporter.js +8 -1
- package/dist/cjs/schema/nodes/list.js +3 -0
- package/dist/cjs/schema/nodes/table_col.js +0 -2
- package/dist/cjs/schema/nodes/table_element_footer.js +2 -1
- package/dist/cjs/transformer/decode.js +1 -0
- package/dist/cjs/transformer/encode.js +1 -0
- package/dist/es/jats/importer/jats-body-dom-parser.js +1 -0
- package/dist/es/jats/jats-exporter.js +8 -1
- package/dist/es/schema/nodes/list.js +3 -0
- package/dist/es/schema/nodes/table_col.js +0 -2
- package/dist/es/schema/nodes/table_element_footer.js +2 -1
- package/dist/es/transformer/decode.js +1 -0
- package/dist/es/transformer/encode.js +1 -0
- package/dist/types/schema/nodes/list.d.ts +1 -0
- package/dist/types/schema/nodes/table_col.d.ts +4 -4
- package/package.json +3 -3
|
@@ -639,7 +639,14 @@ class JATSExporter {
|
|
|
639
639
|
0,
|
|
640
640
|
],
|
|
641
641
|
blockquote_element: () => ['disp-quote', { 'content-type': 'quote' }, 0],
|
|
642
|
-
bullet_list: () =>
|
|
642
|
+
bullet_list: (node) => {
|
|
643
|
+
var _a;
|
|
644
|
+
return [
|
|
645
|
+
'list',
|
|
646
|
+
{ 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'bullet' },
|
|
647
|
+
0,
|
|
648
|
+
];
|
|
649
|
+
},
|
|
643
650
|
caption: () => ['p', 0],
|
|
644
651
|
caption_title: (node) => {
|
|
645
652
|
if (!node.textContent) {
|
|
@@ -25,6 +25,7 @@ exports.bulletList = {
|
|
|
25
25
|
id: { default: '' },
|
|
26
26
|
paragraphStyle: { default: '' },
|
|
27
27
|
dataTracked: { default: null },
|
|
28
|
+
listStyleType: { default: null },
|
|
28
29
|
},
|
|
29
30
|
parseDOM: [
|
|
30
31
|
{
|
|
@@ -33,6 +34,7 @@ exports.bulletList = {
|
|
|
33
34
|
const dom = p;
|
|
34
35
|
return {
|
|
35
36
|
id: dom.getAttribute('id'),
|
|
37
|
+
listStyleType: dom.getAttribute('list-type'),
|
|
36
38
|
};
|
|
37
39
|
},
|
|
38
40
|
},
|
|
@@ -44,6 +46,7 @@ exports.bulletList = {
|
|
|
44
46
|
'ul',
|
|
45
47
|
{
|
|
46
48
|
id: bulletListNode.attrs.id,
|
|
49
|
+
'list-type': bulletListNode.attrs.listStyleType,
|
|
47
50
|
class: (0, attributes_1.buildElementClass)(bulletListNode.attrs),
|
|
48
51
|
'data-object-type': json_schema_1.ObjectTypes.ListElement,
|
|
49
52
|
},
|
|
@@ -19,7 +19,6 @@ exports.tableCol = exports.tableColGroup = void 0;
|
|
|
19
19
|
exports.tableColGroup = {
|
|
20
20
|
content: 'table_col+',
|
|
21
21
|
group: 'block',
|
|
22
|
-
tableRole: 'colgroup',
|
|
23
22
|
parseDOM: [
|
|
24
23
|
{
|
|
25
24
|
tag: 'colgroup',
|
|
@@ -34,7 +33,6 @@ exports.tableCol = {
|
|
|
34
33
|
width: { default: '' },
|
|
35
34
|
},
|
|
36
35
|
group: 'block',
|
|
37
|
-
tableRole: 'col',
|
|
38
36
|
parseDOM: [
|
|
39
37
|
{
|
|
40
38
|
tag: 'col',
|
|
@@ -19,8 +19,9 @@ exports.tableElementFooter = void 0;
|
|
|
19
19
|
exports.tableElementFooter = {
|
|
20
20
|
attrs: {
|
|
21
21
|
id: { default: '' },
|
|
22
|
+
dataTracked: { default: null }
|
|
22
23
|
},
|
|
23
|
-
content: '(paragraph | footnotes_element)
|
|
24
|
+
content: '(paragraph | footnotes_element)*',
|
|
24
25
|
group: 'block element',
|
|
25
26
|
toDOM: () => ['table-wrap-foot', 0],
|
|
26
27
|
};
|
|
@@ -399,6 +399,7 @@ class Decoder {
|
|
|
399
399
|
return this.parseContents(model.contents || '<ul></ul>', undefined, this.getComments(model), {
|
|
400
400
|
topNode: schema_1.schema.nodes.bullet_list.create({
|
|
401
401
|
id: model._id,
|
|
402
|
+
listStyleType: model.listStyleType,
|
|
402
403
|
paragraphStyle: model.paragraphStyle,
|
|
403
404
|
}),
|
|
404
405
|
});
|
|
@@ -631,7 +631,14 @@ export class JATSExporter {
|
|
|
631
631
|
0,
|
|
632
632
|
],
|
|
633
633
|
blockquote_element: () => ['disp-quote', { 'content-type': 'quote' }, 0],
|
|
634
|
-
bullet_list: () =>
|
|
634
|
+
bullet_list: (node) => {
|
|
635
|
+
var _a;
|
|
636
|
+
return [
|
|
637
|
+
'list',
|
|
638
|
+
{ 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'bullet' },
|
|
639
|
+
0,
|
|
640
|
+
];
|
|
641
|
+
},
|
|
635
642
|
caption: () => ['p', 0],
|
|
636
643
|
caption_title: (node) => {
|
|
637
644
|
if (!node.textContent) {
|
|
@@ -22,6 +22,7 @@ export const bulletList = {
|
|
|
22
22
|
id: { default: '' },
|
|
23
23
|
paragraphStyle: { default: '' },
|
|
24
24
|
dataTracked: { default: null },
|
|
25
|
+
listStyleType: { default: null },
|
|
25
26
|
},
|
|
26
27
|
parseDOM: [
|
|
27
28
|
{
|
|
@@ -30,6 +31,7 @@ export const bulletList = {
|
|
|
30
31
|
const dom = p;
|
|
31
32
|
return {
|
|
32
33
|
id: dom.getAttribute('id'),
|
|
34
|
+
listStyleType: dom.getAttribute('list-type'),
|
|
33
35
|
};
|
|
34
36
|
},
|
|
35
37
|
},
|
|
@@ -41,6 +43,7 @@ export const bulletList = {
|
|
|
41
43
|
'ul',
|
|
42
44
|
{
|
|
43
45
|
id: bulletListNode.attrs.id,
|
|
46
|
+
'list-type': bulletListNode.attrs.listStyleType,
|
|
44
47
|
class: buildElementClass(bulletListNode.attrs),
|
|
45
48
|
'data-object-type': ObjectTypes.ListElement,
|
|
46
49
|
},
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
export const tableColGroup = {
|
|
17
17
|
content: 'table_col+',
|
|
18
18
|
group: 'block',
|
|
19
|
-
tableRole: 'colgroup',
|
|
20
19
|
parseDOM: [
|
|
21
20
|
{
|
|
22
21
|
tag: 'colgroup',
|
|
@@ -31,7 +30,6 @@ export const tableCol = {
|
|
|
31
30
|
width: { default: '' },
|
|
32
31
|
},
|
|
33
32
|
group: 'block',
|
|
34
|
-
tableRole: 'col',
|
|
35
33
|
parseDOM: [
|
|
36
34
|
{
|
|
37
35
|
tag: 'col',
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
export const tableElementFooter = {
|
|
17
17
|
attrs: {
|
|
18
18
|
id: { default: '' },
|
|
19
|
+
dataTracked: { default: null }
|
|
19
20
|
},
|
|
20
|
-
content: '(paragraph | footnotes_element)
|
|
21
|
+
content: '(paragraph | footnotes_element)*',
|
|
21
22
|
group: 'block element',
|
|
22
23
|
toDOM: () => ['table-wrap-foot', 0],
|
|
23
24
|
};
|
|
@@ -390,6 +390,7 @@ export class Decoder {
|
|
|
390
390
|
return this.parseContents(model.contents || '<ul></ul>', undefined, this.getComments(model), {
|
|
391
391
|
topNode: schema.nodes.bullet_list.create({
|
|
392
392
|
id: model._id,
|
|
393
|
+
listStyleType: model.listStyleType,
|
|
393
394
|
paragraphStyle: model.paragraphStyle,
|
|
394
395
|
}),
|
|
395
396
|
});
|
|
@@ -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 { NodeSpec } from 'prosemirror-model';
|
|
17
|
+
import { ManuscriptNode } from '../types';
|
|
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: NodeSpec;
|
|
24
|
+
export declare const tableCol: NodeSpec;
|
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.10-LEAN-3321",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"version": "yarn build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@manuscripts/json-schema": "^2.2.
|
|
33
|
-
"@manuscripts/library": "^1.3.
|
|
32
|
+
"@manuscripts/json-schema": "^2.2.7",
|
|
33
|
+
"@manuscripts/library": "^1.3.6",
|
|
34
34
|
"debug": "^4.3.4",
|
|
35
35
|
"jszip": "^3.10.1",
|
|
36
36
|
"mime": "^3.0.0",
|