@manuscripts/transform 3.0.19 → 3.0.20

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.
@@ -679,7 +679,7 @@ class JATSExporter {
679
679
  }
680
680
  return graphic;
681
681
  },
682
- figure_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.figure, 'figure'),
682
+ figure_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.figure),
683
683
  footnote: (node) => {
684
684
  const attrs = {};
685
685
  if (node.attrs.id) {
@@ -740,7 +740,7 @@ class JATSExporter {
740
740
  code.textContent = node.attrs.contents;
741
741
  return code;
742
742
  },
743
- listing_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.listing, 'listing'),
743
+ listing_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.listing),
744
744
  manuscript: (node) => ['article', { id: normalizeID(node.attrs.id) }, 0],
745
745
  missing_figure: () => {
746
746
  const graphic = this.document.createElement('graphic');
@@ -912,8 +912,9 @@ class JATSExporter {
912
912
  processChildNodes(element, node, node.type.schema.nodes.section);
913
913
  return element;
914
914
  };
915
- const createFigureElement = (node, nodeName, contentNodeType, figType) => {
915
+ const createFigureElement = (node, nodeName, contentNodeType) => {
916
916
  const element = createElement(node, nodeName);
917
+ const figType = node.attrs.type;
917
918
  if (figType) {
918
919
  element.setAttribute('fig-type', figType);
919
920
  }
@@ -647,7 +647,6 @@ const nodes = [
647
647
  element.removeChild(labelNode);
648
648
  }
649
649
  const attrib = element.querySelector('attrib');
650
- const position = element.getAttribute('position');
651
650
  const attribution = attrib
652
651
  ? {
653
652
  literal: (_a = (0, utils_1.getTrimmedTextContent)(attrib)) !== null && _a !== void 0 ? _a : '',
@@ -656,8 +655,8 @@ const nodes = [
656
655
  return {
657
656
  id: element.getAttribute('id'),
658
657
  label: (_b = (0, utils_1.getTrimmedTextContent)(labelNode)) !== null && _b !== void 0 ? _b : '',
659
- attribution: attribution,
660
- position,
658
+ attribution,
659
+ type: element.getAttribute('fig-type'),
661
660
  };
662
661
  },
663
662
  },
@@ -22,6 +22,7 @@ exports.figureElement = {
22
22
  id: { default: '' },
23
23
  attribution: { default: undefined },
24
24
  dataTracked: { default: null },
25
+ type: { default: undefined },
25
26
  },
26
27
  selectable: false,
27
28
  group: 'block element executable',
@@ -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.19";
4
+ exports.VERSION = "3.0.20";
@@ -671,7 +671,7 @@ export class JATSExporter {
671
671
  }
672
672
  return graphic;
673
673
  },
674
- figure_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.figure, 'figure'),
674
+ figure_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.figure),
675
675
  footnote: (node) => {
676
676
  const attrs = {};
677
677
  if (node.attrs.id) {
@@ -732,7 +732,7 @@ export class JATSExporter {
732
732
  code.textContent = node.attrs.contents;
733
733
  return code;
734
734
  },
735
- listing_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.listing, 'listing'),
735
+ listing_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.listing),
736
736
  manuscript: (node) => ['article', { id: normalizeID(node.attrs.id) }, 0],
737
737
  missing_figure: () => {
738
738
  const graphic = this.document.createElement('graphic');
@@ -904,8 +904,9 @@ export class JATSExporter {
904
904
  processChildNodes(element, node, node.type.schema.nodes.section);
905
905
  return element;
906
906
  };
907
- const createFigureElement = (node, nodeName, contentNodeType, figType) => {
907
+ const createFigureElement = (node, nodeName, contentNodeType) => {
908
908
  const element = createElement(node, nodeName);
909
+ const figType = node.attrs.type;
909
910
  if (figType) {
910
911
  element.setAttribute('fig-type', figType);
911
912
  }
@@ -641,7 +641,6 @@ const nodes = [
641
641
  element.removeChild(labelNode);
642
642
  }
643
643
  const attrib = element.querySelector('attrib');
644
- const position = element.getAttribute('position');
645
644
  const attribution = attrib
646
645
  ? {
647
646
  literal: (_a = getTrimmedTextContent(attrib)) !== null && _a !== void 0 ? _a : '',
@@ -650,8 +649,8 @@ const nodes = [
650
649
  return {
651
650
  id: element.getAttribute('id'),
652
651
  label: (_b = getTrimmedTextContent(labelNode)) !== null && _b !== void 0 ? _b : '',
653
- attribution: attribution,
654
- position,
652
+ attribution,
653
+ type: element.getAttribute('fig-type'),
655
654
  };
656
655
  },
657
656
  },
@@ -19,6 +19,7 @@ export const figureElement = {
19
19
  id: { default: '' },
20
20
  attribution: { default: undefined },
21
21
  dataTracked: { default: null },
22
+ type: { default: undefined },
22
23
  },
23
24
  selectable: false,
24
25
  group: 'block element executable',
@@ -1 +1 @@
1
- export const VERSION = "3.0.19";
1
+ export const VERSION = "3.0.20";
@@ -19,6 +19,7 @@ import { AttributionNode } from './attribution';
19
19
  interface Attrs {
20
20
  id: string;
21
21
  attribution?: AttributionNode;
22
+ type?: string;
22
23
  }
23
24
  export interface FigureElementNode extends ManuscriptNode {
24
25
  attrs: Attrs;
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.19";
1
+ export declare const VERSION = "3.0.20";
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.19",
4
+ "version": "3.0.20",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",