@manuscripts/transform 4.3.51 → 4.3.53
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/schema/__tests__/docs.js +40 -0
- package/dist/cjs/schema/migration/migration-scripts/4.3.34.js +20 -8
- package/dist/cjs/schema/types.js +18 -0
- package/dist/cjs/version.js +1 -1
- package/dist/es/schema/__tests__/docs.js +40 -0
- package/dist/es/schema/migration/migration-scripts/4.3.34.js +20 -8
- package/dist/es/schema/types.js +17 -0
- package/dist/es/version.js +1 -1
- package/dist/types/schema/types.d.ts +16 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -626,6 +626,46 @@ exports.v2_3_20 = {
|
|
|
626
626
|
},
|
|
627
627
|
],
|
|
628
628
|
},
|
|
629
|
+
{
|
|
630
|
+
type: 'figure_element',
|
|
631
|
+
attrs: {
|
|
632
|
+
id: 'MPFigureElement:ca6dac1a-b6ae-4227-be6e-75119186224b',
|
|
633
|
+
label: '',
|
|
634
|
+
sizeFraction: 0,
|
|
635
|
+
suppressCaption: true,
|
|
636
|
+
suppressTitle: true,
|
|
637
|
+
dataTracked: null,
|
|
638
|
+
},
|
|
639
|
+
content: [
|
|
640
|
+
{
|
|
641
|
+
type: 'figure',
|
|
642
|
+
attrs: {
|
|
643
|
+
id: 'MPFigure:d377ead2-6849-4597-9caa-f3e6b73bb629',
|
|
644
|
+
src: 'chemoji/chemoji8.png',
|
|
645
|
+
contentType: 'image/png',
|
|
646
|
+
dataTracked: null,
|
|
647
|
+
},
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
type: 'figcaption',
|
|
651
|
+
attrs: {
|
|
652
|
+
dataTracked: null,
|
|
653
|
+
},
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
type: 'listing',
|
|
657
|
+
attrs: {
|
|
658
|
+
id: '',
|
|
659
|
+
contents: '',
|
|
660
|
+
language: '',
|
|
661
|
+
languageKey: 'null',
|
|
662
|
+
isExpanded: false,
|
|
663
|
+
isExecuting: false,
|
|
664
|
+
dataTracked: null,
|
|
665
|
+
},
|
|
666
|
+
},
|
|
667
|
+
],
|
|
668
|
+
},
|
|
629
669
|
{
|
|
630
670
|
type: 'table_element',
|
|
631
671
|
attrs: {
|
|
@@ -22,6 +22,24 @@ const CONFIG = {
|
|
|
22
22
|
location: { pos: 'start' },
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
|
+
const getCaptionNode = (nodes, isRequired) => {
|
|
26
|
+
if (nodes.length === 0) {
|
|
27
|
+
return isRequired
|
|
28
|
+
? {
|
|
29
|
+
type: 'caption',
|
|
30
|
+
content: [{ type: 'text_block', attrs: {} }],
|
|
31
|
+
attrs: {},
|
|
32
|
+
}
|
|
33
|
+
: undefined;
|
|
34
|
+
}
|
|
35
|
+
return nodes.reduce((caption, { content }) => ({
|
|
36
|
+
...caption,
|
|
37
|
+
content: [
|
|
38
|
+
...(caption.content || []),
|
|
39
|
+
{ type: 'text_block', content, attrs: {} },
|
|
40
|
+
],
|
|
41
|
+
}), { type: 'caption', content: [], attrs: {} });
|
|
42
|
+
};
|
|
25
43
|
class Migration4334 {
|
|
26
44
|
constructor() {
|
|
27
45
|
this.fromVersion = '4.3.33';
|
|
@@ -34,14 +52,8 @@ class Migration4334 {
|
|
|
34
52
|
}
|
|
35
53
|
const figCaption = node.content.find((n) => n.type === 'figcaption');
|
|
36
54
|
const foundTitle = (figCaption?.content || []).find((n) => n.type === 'caption_title');
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
...caption,
|
|
40
|
-
content: [
|
|
41
|
-
...(caption.content || []),
|
|
42
|
-
{ type: 'text_block', content, attrs: {} },
|
|
43
|
-
],
|
|
44
|
-
}), { type: 'caption', content: [], attrs: {} });
|
|
55
|
+
const captionNodes = (figCaption?.content || []).filter((node) => node.type === 'caption');
|
|
56
|
+
const foundCaption = getCaptionNode(captionNodes, config.caption === 'required');
|
|
45
57
|
const cleanContent = node.content.filter((n) => n.type !== 'figcaption');
|
|
46
58
|
const placeholderTitle = index_1.schema.nodes.caption_title.create().toJSON();
|
|
47
59
|
const placeholderCaption = index_1.schema.nodes.caption.create().toJSON();
|
package/dist/cjs/schema/types.js
CHANGED
|
@@ -15,7 +15,25 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ManuscriptActions = void 0;
|
|
18
19
|
exports.isNodeOfType = isNodeOfType;
|
|
20
|
+
var ManuscriptActions;
|
|
21
|
+
(function (ManuscriptActions) {
|
|
22
|
+
ManuscriptActions["handleSuggestion"] = "handleSuggestion";
|
|
23
|
+
ManuscriptActions["rejectOwnSuggestion"] = "rejectOwnSuggestion";
|
|
24
|
+
ManuscriptActions["handleOwnComments"] = "handleOwnComments";
|
|
25
|
+
ManuscriptActions["handleOthersComments"] = "handleOthersComments";
|
|
26
|
+
ManuscriptActions["resolveOwnComment"] = "resolveOwnComment";
|
|
27
|
+
ManuscriptActions["resolveOthersComment"] = "resolveOthersComment";
|
|
28
|
+
ManuscriptActions["createComment"] = "createComment";
|
|
29
|
+
ManuscriptActions["canEditFiles"] = "canEditFiles";
|
|
30
|
+
ManuscriptActions["editArticle"] = "editArticle";
|
|
31
|
+
ManuscriptActions["formatArticle"] = "formatArticle";
|
|
32
|
+
ManuscriptActions["editMetadata"] = "editMetadata";
|
|
33
|
+
ManuscriptActions["editCitationsAndRefs"] = "editCitationsAndRefs";
|
|
34
|
+
ManuscriptActions["seeEditorToolbar"] = "seeEditorToolbar";
|
|
35
|
+
ManuscriptActions["seeReferencesButtons"] = "seeReferencesButtons";
|
|
36
|
+
})(ManuscriptActions || (exports.ManuscriptActions = ManuscriptActions = {}));
|
|
19
37
|
function isNodeOfType(node, type) {
|
|
20
38
|
return node.type === type;
|
|
21
39
|
}
|
package/dist/cjs/version.js
CHANGED
|
@@ -623,6 +623,46 @@ export const v2_3_20 = {
|
|
|
623
623
|
},
|
|
624
624
|
],
|
|
625
625
|
},
|
|
626
|
+
{
|
|
627
|
+
type: 'figure_element',
|
|
628
|
+
attrs: {
|
|
629
|
+
id: 'MPFigureElement:ca6dac1a-b6ae-4227-be6e-75119186224b',
|
|
630
|
+
label: '',
|
|
631
|
+
sizeFraction: 0,
|
|
632
|
+
suppressCaption: true,
|
|
633
|
+
suppressTitle: true,
|
|
634
|
+
dataTracked: null,
|
|
635
|
+
},
|
|
636
|
+
content: [
|
|
637
|
+
{
|
|
638
|
+
type: 'figure',
|
|
639
|
+
attrs: {
|
|
640
|
+
id: 'MPFigure:d377ead2-6849-4597-9caa-f3e6b73bb629',
|
|
641
|
+
src: 'chemoji/chemoji8.png',
|
|
642
|
+
contentType: 'image/png',
|
|
643
|
+
dataTracked: null,
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
type: 'figcaption',
|
|
648
|
+
attrs: {
|
|
649
|
+
dataTracked: null,
|
|
650
|
+
},
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
type: 'listing',
|
|
654
|
+
attrs: {
|
|
655
|
+
id: '',
|
|
656
|
+
contents: '',
|
|
657
|
+
language: '',
|
|
658
|
+
languageKey: 'null',
|
|
659
|
+
isExpanded: false,
|
|
660
|
+
isExecuting: false,
|
|
661
|
+
dataTracked: null,
|
|
662
|
+
},
|
|
663
|
+
},
|
|
664
|
+
],
|
|
665
|
+
},
|
|
626
666
|
{
|
|
627
667
|
type: 'table_element',
|
|
628
668
|
attrs: {
|
|
@@ -20,6 +20,24 @@ const CONFIG = {
|
|
|
20
20
|
location: { pos: 'start' },
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
|
+
const getCaptionNode = (nodes, isRequired) => {
|
|
24
|
+
if (nodes.length === 0) {
|
|
25
|
+
return isRequired
|
|
26
|
+
? {
|
|
27
|
+
type: 'caption',
|
|
28
|
+
content: [{ type: 'text_block', attrs: {} }],
|
|
29
|
+
attrs: {},
|
|
30
|
+
}
|
|
31
|
+
: undefined;
|
|
32
|
+
}
|
|
33
|
+
return nodes.reduce((caption, { content }) => ({
|
|
34
|
+
...caption,
|
|
35
|
+
content: [
|
|
36
|
+
...(caption.content || []),
|
|
37
|
+
{ type: 'text_block', content, attrs: {} },
|
|
38
|
+
],
|
|
39
|
+
}), { type: 'caption', content: [], attrs: {} });
|
|
40
|
+
};
|
|
23
41
|
class Migration4334 {
|
|
24
42
|
constructor() {
|
|
25
43
|
this.fromVersion = '4.3.33';
|
|
@@ -32,14 +50,8 @@ class Migration4334 {
|
|
|
32
50
|
}
|
|
33
51
|
const figCaption = node.content.find((n) => n.type === 'figcaption');
|
|
34
52
|
const foundTitle = (figCaption?.content || []).find((n) => n.type === 'caption_title');
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
...caption,
|
|
38
|
-
content: [
|
|
39
|
-
...(caption.content || []),
|
|
40
|
-
{ type: 'text_block', content, attrs: {} },
|
|
41
|
-
],
|
|
42
|
-
}), { type: 'caption', content: [], attrs: {} });
|
|
53
|
+
const captionNodes = (figCaption?.content || []).filter((node) => node.type === 'caption');
|
|
54
|
+
const foundCaption = getCaptionNode(captionNodes, config.caption === 'required');
|
|
43
55
|
const cleanContent = node.content.filter((n) => n.type !== 'figcaption');
|
|
44
56
|
const placeholderTitle = schema.nodes.caption_title.create().toJSON();
|
|
45
57
|
const placeholderCaption = schema.nodes.caption.create().toJSON();
|
package/dist/es/schema/types.js
CHANGED
|
@@ -13,6 +13,23 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
export var ManuscriptActions;
|
|
17
|
+
(function (ManuscriptActions) {
|
|
18
|
+
ManuscriptActions["handleSuggestion"] = "handleSuggestion";
|
|
19
|
+
ManuscriptActions["rejectOwnSuggestion"] = "rejectOwnSuggestion";
|
|
20
|
+
ManuscriptActions["handleOwnComments"] = "handleOwnComments";
|
|
21
|
+
ManuscriptActions["handleOthersComments"] = "handleOthersComments";
|
|
22
|
+
ManuscriptActions["resolveOwnComment"] = "resolveOwnComment";
|
|
23
|
+
ManuscriptActions["resolveOthersComment"] = "resolveOthersComment";
|
|
24
|
+
ManuscriptActions["createComment"] = "createComment";
|
|
25
|
+
ManuscriptActions["canEditFiles"] = "canEditFiles";
|
|
26
|
+
ManuscriptActions["editArticle"] = "editArticle";
|
|
27
|
+
ManuscriptActions["formatArticle"] = "formatArticle";
|
|
28
|
+
ManuscriptActions["editMetadata"] = "editMetadata";
|
|
29
|
+
ManuscriptActions["editCitationsAndRefs"] = "editCitationsAndRefs";
|
|
30
|
+
ManuscriptActions["seeEditorToolbar"] = "seeEditorToolbar";
|
|
31
|
+
ManuscriptActions["seeReferencesButtons"] = "seeReferencesButtons";
|
|
32
|
+
})(ManuscriptActions || (ManuscriptActions = {}));
|
|
16
33
|
export function isNodeOfType(node, type) {
|
|
17
34
|
return node.type === type;
|
|
18
35
|
}
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "4.3.
|
|
1
|
+
export const VERSION = "4.3.53";
|
|
@@ -82,6 +82,22 @@ export interface Bundle {
|
|
|
82
82
|
_id: string;
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
+
export declare enum ManuscriptActions {
|
|
86
|
+
handleSuggestion = "handleSuggestion",
|
|
87
|
+
rejectOwnSuggestion = "rejectOwnSuggestion",
|
|
88
|
+
handleOwnComments = "handleOwnComments",
|
|
89
|
+
handleOthersComments = "handleOthersComments",
|
|
90
|
+
resolveOwnComment = "resolveOwnComment",
|
|
91
|
+
resolveOthersComment = "resolveOthersComment",
|
|
92
|
+
createComment = "createComment",
|
|
93
|
+
canEditFiles = "canEditFiles",
|
|
94
|
+
editArticle = "editArticle",
|
|
95
|
+
formatArticle = "formatArticle",
|
|
96
|
+
editMetadata = "editMetadata",
|
|
97
|
+
editCitationsAndRefs = "editCitationsAndRefs",
|
|
98
|
+
seeEditorToolbar = "seeEditorToolbar",
|
|
99
|
+
seeReferencesButtons = "seeReferencesButtons"
|
|
100
|
+
}
|
|
85
101
|
export type MarkRule = ParseRule & {
|
|
86
102
|
mark: Marks | null;
|
|
87
103
|
};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.3.
|
|
1
|
+
export declare const VERSION = "4.3.53";
|
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": "4.3.
|
|
4
|
+
"version": "4.3.53",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|