@manuscripts/transform 3.0.64 → 3.0.65

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.
@@ -963,7 +963,10 @@ class JATSExporter {
963
963
  const createBoxElement = (node) => {
964
964
  const element = createElement(node, 'boxed-text');
965
965
  appendLabels(element, node);
966
- appendChildNodeOfType(element, node, node.type.schema.nodes.figcaption);
966
+ const child = node.firstChild;
967
+ if ((child === null || child === void 0 ? void 0 : child.type) === schema_1.schema.nodes.figcaption) {
968
+ appendChildNodeOfType(element, node, node.type.schema.nodes.figcaption);
969
+ }
967
970
  processChildNodes(element, node, node.type.schema.nodes.section);
968
971
  return element;
969
972
  };
@@ -51,6 +51,12 @@ const buildTargets = (node) => {
51
51
  if (parent && excludedTypes.includes(parent.type)) {
52
52
  return;
53
53
  }
54
+ if (node.type === schema_1.schema.nodes.box_element) {
55
+ const child = node.firstChild;
56
+ if (!child || child.type !== schema_1.schema.nodes.figcaption) {
57
+ return;
58
+ }
59
+ }
54
60
  const label = buildLabel(node.type);
55
61
  targets.set(node.attrs.id, {
56
62
  type: node.type.name,
@@ -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.64";
4
+ exports.VERSION = "3.0.65";
@@ -955,7 +955,10 @@ export class JATSExporter {
955
955
  const createBoxElement = (node) => {
956
956
  const element = createElement(node, 'boxed-text');
957
957
  appendLabels(element, node);
958
- appendChildNodeOfType(element, node, node.type.schema.nodes.figcaption);
958
+ const child = node.firstChild;
959
+ if ((child === null || child === void 0 ? void 0 : child.type) === schema.nodes.figcaption) {
960
+ appendChildNodeOfType(element, node, node.type.schema.nodes.figcaption);
961
+ }
959
962
  processChildNodes(element, node, node.type.schema.nodes.section);
960
963
  return element;
961
964
  };
@@ -48,6 +48,12 @@ export const buildTargets = (node) => {
48
48
  if (parent && excludedTypes.includes(parent.type)) {
49
49
  return;
50
50
  }
51
+ if (node.type === schema.nodes.box_element) {
52
+ const child = node.firstChild;
53
+ if (!child || child.type !== schema.nodes.figcaption) {
54
+ return;
55
+ }
56
+ }
51
57
  const label = buildLabel(node.type);
52
58
  targets.set(node.attrs.id, {
53
59
  type: node.type.name,
@@ -1 +1 @@
1
- export const VERSION = "3.0.64";
1
+ export const VERSION = "3.0.65";
@@ -15,11 +15,10 @@
15
15
  */
16
16
  import { NodeSpec } from 'prosemirror-model';
17
17
  import { ManuscriptNode } from '../types';
18
- interface Attrs {
18
+ export interface BoxElementAttrs {
19
19
  id: string;
20
20
  }
21
21
  export interface BoxElementNode extends ManuscriptNode {
22
- attrs: Attrs;
22
+ attrs: BoxElementAttrs;
23
23
  }
24
24
  export declare const box_element: NodeSpec;
25
- export {};
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.64";
1
+ export declare const VERSION = "3.0.65";
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.64",
4
+ "version": "3.0.65",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",