@manuscripts/transform 3.0.35 → 3.0.36

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.
@@ -560,6 +560,8 @@ class JATSExporter {
560
560
  if (mimeSubtype) {
561
561
  mediaElement.setAttribute('mime-subtype', node.attrs.mimeSubtype);
562
562
  }
563
+ appendLabels(mediaElement, node);
564
+ appendChildNodeOfType(mediaElement, node, node.type.schema.nodes.figcaption);
563
565
  return mediaElement;
564
566
  },
565
567
  awards: () => ['funding-group', 0],
@@ -24,6 +24,7 @@ const labelledNodeTypes = [
24
24
  schema_1.schema.nodes.equation_element,
25
25
  schema_1.schema.nodes.listing_element,
26
26
  schema_1.schema.nodes.box_element,
27
+ schema_1.schema.nodes.embed,
27
28
  ];
28
29
  const excludedTypes = [schema_1.schema.nodes.graphical_abstract_section];
29
30
  const chooseLabel = (nodeType) => {
@@ -437,7 +437,7 @@ class JATSDOMParser {
437
437
  {
438
438
  tag: 'caption',
439
439
  node: 'figcaption',
440
- context: 'figure_element/|table_element/',
440
+ context: 'figure_element/|table_element/|embed/',
441
441
  getContent: (node, schema) => {
442
442
  const element = node;
443
443
  const content = [];
@@ -26,7 +26,7 @@ const createSectionGroup = (type, createElement) => {
26
26
  return sec;
27
27
  };
28
28
  const addMissingCaptions = (doc, createElement) => {
29
- const elements = doc.querySelectorAll('fig, table-wrap');
29
+ const elements = doc.querySelectorAll('fig, table-wrap, media');
30
30
  for (const element of elements) {
31
31
  let caption = element.querySelector('caption');
32
32
  if (!caption) {
@@ -17,6 +17,7 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.isEmbedNode = exports.embed = void 0;
19
19
  exports.embed = {
20
+ content: "figcaption",
20
21
  attrs: {
21
22
  id: { default: '' },
22
23
  dataTracked: { default: null },
@@ -37,6 +37,7 @@ exports.nodeNames = new Map([
37
37
  [schema_1.schema.nodes.table_header, 'Table Header'],
38
38
  [schema_1.schema.nodes.general_table_footnote, 'General Table note'],
39
39
  [schema_1.schema.nodes.table_element_footer, 'Table Footer'],
40
+ [schema_1.schema.nodes.embed, 'Media'],
40
41
  [schema_1.schema.nodes.equation, 'Equation'],
41
42
  [schema_1.schema.nodes.inline_equation, 'Inline Equation'],
42
43
  [schema_1.schema.nodes.inline_footnote, 'Footnote Reference'],
@@ -60,6 +60,7 @@ const nodeTitle = (node) => {
60
60
  case nodes.footnote:
61
61
  case nodes.pullquote_element:
62
62
  return snippetOfNodeType(node, nodes.paragraph);
63
+ case nodes.embed:
63
64
  case nodes.figure_element:
64
65
  case nodes.table_element:
65
66
  case nodes.equation_element:
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "3.0.35";
4
+ exports.VERSION = "3.0.36";
@@ -552,6 +552,8 @@ export class JATSExporter {
552
552
  if (mimeSubtype) {
553
553
  mediaElement.setAttribute('mime-subtype', node.attrs.mimeSubtype);
554
554
  }
555
+ appendLabels(mediaElement, node);
556
+ appendChildNodeOfType(mediaElement, node, node.type.schema.nodes.figcaption);
555
557
  return mediaElement;
556
558
  },
557
559
  awards: () => ['funding-group', 0],
@@ -21,6 +21,7 @@ const labelledNodeTypes = [
21
21
  schema.nodes.equation_element,
22
22
  schema.nodes.listing_element,
23
23
  schema.nodes.box_element,
24
+ schema.nodes.embed,
24
25
  ];
25
26
  const excludedTypes = [schema.nodes.graphical_abstract_section];
26
27
  const chooseLabel = (nodeType) => {
@@ -434,7 +434,7 @@ export class JATSDOMParser {
434
434
  {
435
435
  tag: 'caption',
436
436
  node: 'figcaption',
437
- context: 'figure_element/|table_element/',
437
+ context: 'figure_element/|table_element/|embed/',
438
438
  getContent: (node, schema) => {
439
439
  const element = node;
440
440
  const content = [];
@@ -23,7 +23,7 @@ const createSectionGroup = (type, createElement) => {
23
23
  return sec;
24
24
  };
25
25
  export const addMissingCaptions = (doc, createElement) => {
26
- const elements = doc.querySelectorAll('fig, table-wrap');
26
+ const elements = doc.querySelectorAll('fig, table-wrap, media');
27
27
  for (const element of elements) {
28
28
  let caption = element.querySelector('caption');
29
29
  if (!caption) {
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export const embed = {
17
+ content: "figcaption",
17
18
  attrs: {
18
19
  id: { default: '' },
19
20
  dataTracked: { default: null },
@@ -34,6 +34,7 @@ export const nodeNames = new Map([
34
34
  [schema.nodes.table_header, 'Table Header'],
35
35
  [schema.nodes.general_table_footnote, 'General Table note'],
36
36
  [schema.nodes.table_element_footer, 'Table Footer'],
37
+ [schema.nodes.embed, 'Media'],
37
38
  [schema.nodes.equation, 'Equation'],
38
39
  [schema.nodes.inline_equation, 'Inline Equation'],
39
40
  [schema.nodes.inline_footnote, 'Footnote Reference'],
@@ -57,6 +57,7 @@ export const nodeTitle = (node) => {
57
57
  case nodes.footnote:
58
58
  case nodes.pullquote_element:
59
59
  return snippetOfNodeType(node, nodes.paragraph);
60
+ case nodes.embed:
60
61
  case nodes.figure_element:
61
62
  case nodes.table_element:
62
63
  case nodes.equation_element:
@@ -1 +1 @@
1
- export const VERSION = "3.0.35";
1
+ export const VERSION = "3.0.36";
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.35";
1
+ export declare const VERSION = "3.0.36";
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": "3.0.35",
4
+ "version": "3.0.36",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",