@manuscripts/transform 3.0.15-LEAN-4146.4 → 3.0.18

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.
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.addCaptionsToFigures = exports.fixTables = exports.orderTableFootnote = exports.moveReferencesToBackmatter = exports.createSupplementaryMaterialsSection = exports.createKeywordsSection = exports.moveCaptionsToEnd = exports.createBackmatter = exports.createAbstracts = exports.createBody = exports.createBoxedElementSection = exports.moveAbstracts = exports.moveAffiliations = exports.moveContributors = exports.moveAwards = exports.moveAuthorNotes = exports.moveTitle = exports.ensureSection = void 0;
18
+ exports.fixTables = exports.orderTableFootnote = exports.moveReferencesToBackmatter = exports.createSupplementaryMaterialsSection = exports.createKeywordsSection = exports.moveCaptionsToEnd = exports.createBackmatter = exports.createAbstracts = exports.createBody = exports.createBoxedElementSection = exports.moveAbstracts = exports.moveAffiliations = exports.moveContributors = exports.moveAwards = exports.moveAuthorNotes = exports.moveTitle = exports.ensureSection = void 0;
19
19
  const deafults_1 = require("../../lib/deafults");
20
20
  const section_group_type_1 = require("../../lib/section-group-type");
21
21
  const transformer_1 = require("../../transformer");
@@ -116,8 +116,12 @@ exports.moveAbstracts = moveAbstracts;
116
116
  const createBoxedElementSection = (body, createElement) => {
117
117
  const boxedTexts = body.querySelectorAll('boxed-text');
118
118
  for (const boxedText of boxedTexts) {
119
+ const boxElementId = boxedText.getAttribute('id');
119
120
  const boxElementSec = createElement('sec');
120
121
  boxElementSec.setAttribute('sec-type', 'box-element');
122
+ if (boxElementId) {
123
+ boxElementSec.setAttribute('id', boxElementId);
124
+ }
121
125
  const title = createElement('title');
122
126
  title.textContent = 'BoxElement';
123
127
  boxElementSec.append(title);
@@ -395,22 +399,3 @@ const fixTables = (doc, body, createElement) => {
395
399
  });
396
400
  };
397
401
  exports.fixTables = fixTables;
398
- const addCaptionsToFigures = (doc, createElement) => {
399
- const figs = doc.querySelectorAll('fig');
400
- figs.forEach((fig) => {
401
- var _a;
402
- const caption = fig.querySelector('caption');
403
- if (!caption) {
404
- const caption = createElement('caption');
405
- const title = createElement('title');
406
- caption.appendChild(title);
407
- fig.appendChild(caption);
408
- }
409
- const title = fig.querySelector('caption > title');
410
- if (!title) {
411
- const title = createElement('title');
412
- (_a = fig.querySelector('caption')) === null || _a === void 0 ? void 0 : _a.appendChild(title);
413
- }
414
- });
415
- };
416
- exports.addCaptionsToFigures = addCaptionsToFigures;
@@ -28,7 +28,6 @@ const processJATS = (doc) => {
28
28
  if (!front) {
29
29
  return;
30
30
  }
31
- (0, jats_transformations_1.addCaptionsToFigures)(doc, createElement);
32
31
  (0, jats_transformations_1.moveTitle)(front, createElement);
33
32
  (0, jats_transformations_1.moveContributors)(front, createElement);
34
33
  (0, jats_transformations_1.moveAffiliations)(front, createElement);
@@ -46,7 +46,6 @@ exports.caption = {
46
46
  if (!captionNode.textContent) {
47
47
  attrs.class = `${attrs.class} placeholder`;
48
48
  }
49
- attrs.contenteditable = 'true';
50
49
  return ['p', attrs, 0];
51
50
  },
52
51
  };
@@ -45,7 +45,6 @@ exports.captionTitle = {
45
45
  if (!captionTitleNode.textContent) {
46
46
  attrs.class = `${attrs.class} placeholder`;
47
47
  }
48
- attrs.contenteditable = 'true';
49
48
  return ['label', attrs, 0];
50
49
  },
51
50
  };
@@ -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.15-LEAN-4146.4";
4
+ exports.VERSION = "3.0.18";
@@ -106,8 +106,12 @@ export const moveAbstracts = (doc, group, createElement) => {
106
106
  export const createBoxedElementSection = (body, createElement) => {
107
107
  const boxedTexts = body.querySelectorAll('boxed-text');
108
108
  for (const boxedText of boxedTexts) {
109
+ const boxElementId = boxedText.getAttribute('id');
109
110
  const boxElementSec = createElement('sec');
110
111
  boxElementSec.setAttribute('sec-type', 'box-element');
112
+ if (boxElementId) {
113
+ boxElementSec.setAttribute('id', boxElementId);
114
+ }
111
115
  const title = createElement('title');
112
116
  title.textContent = 'BoxElement';
113
117
  boxElementSec.append(title);
@@ -375,21 +379,3 @@ export const fixTables = (doc, body, createElement) => {
375
379
  }
376
380
  });
377
381
  };
378
- export const addCaptionsToFigures = (doc, createElement) => {
379
- const figs = doc.querySelectorAll('fig');
380
- figs.forEach((fig) => {
381
- var _a;
382
- const caption = fig.querySelector('caption');
383
- if (!caption) {
384
- const caption = createElement('caption');
385
- const title = createElement('title');
386
- caption.appendChild(title);
387
- fig.appendChild(caption);
388
- }
389
- const title = fig.querySelector('caption > title');
390
- if (!title) {
391
- const title = createElement('title');
392
- (_a = fig.querySelector('caption')) === null || _a === void 0 ? void 0 : _a.appendChild(title);
393
- }
394
- });
395
- };
@@ -17,7 +17,7 @@ import { markComments } from './jats-comments';
17
17
  import { jatsDOMParser } from './jats-dom-parser';
18
18
  import { parseJournal } from './jats-journal-meta-parser';
19
19
  import { updateDocumentIDs } from './jats-parser-utils';
20
- import { addCaptionsToFigures, createAbstracts, createBackmatter, createBody, createBoxedElementSection, createKeywordsSection, createSupplementaryMaterialsSection, ensureSection, fixTables, moveAffiliations, moveAuthorNotes, moveAwards, moveCaptionsToEnd, moveContributors, moveReferencesToBackmatter, moveTitle, orderTableFootnote, } from './jats-transformations';
20
+ import { createAbstracts, createBackmatter, createBody, createBoxedElementSection, createKeywordsSection, createSupplementaryMaterialsSection, ensureSection, fixTables, moveAffiliations, moveAuthorNotes, moveAwards, moveCaptionsToEnd, moveContributors, moveReferencesToBackmatter, moveTitle, orderTableFootnote, } from './jats-transformations';
21
21
  const processJATS = (doc) => {
22
22
  const createElement = createElementFn(doc);
23
23
  markComments(doc);
@@ -25,7 +25,6 @@ const processJATS = (doc) => {
25
25
  if (!front) {
26
26
  return;
27
27
  }
28
- addCaptionsToFigures(doc, createElement);
29
28
  moveTitle(front, createElement);
30
29
  moveContributors(front, createElement);
31
30
  moveAffiliations(front, createElement);
@@ -43,7 +43,6 @@ export const caption = {
43
43
  if (!captionNode.textContent) {
44
44
  attrs.class = `${attrs.class} placeholder`;
45
45
  }
46
- attrs.contenteditable = 'true';
47
46
  return ['p', attrs, 0];
48
47
  },
49
48
  };
@@ -42,7 +42,6 @@ export const captionTitle = {
42
42
  if (!captionTitleNode.textContent) {
43
43
  attrs.class = `${attrs.class} placeholder`;
44
44
  }
45
- attrs.contenteditable = 'true';
46
45
  return ['label', attrs, 0];
47
46
  },
48
47
  };
@@ -1 +1 @@
1
- export const VERSION = "3.0.15-LEAN-4146.4";
1
+ export const VERSION = "3.0.18";
@@ -31,4 +31,3 @@ export declare const createSupplementaryMaterialsSection: (document: Document, b
31
31
  export declare const moveReferencesToBackmatter: (body: Element, back: Element, createElement: CreateElement) => void;
32
32
  export declare const orderTableFootnote: (doc: Document, body: Element) => void;
33
33
  export declare const fixTables: (doc: Document, body: Element, createElement: CreateElement) => void;
34
- export declare const addCaptionsToFigures: (doc: Document, createElement: CreateElement) => void;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export declare const TABLE_CELL_STYLES: readonly ["backgroundColor", "border-top", "border-right", "border-bottom", "border-left", "verticalAlign", "textAlign"];
17
- export type TableCellStyleKey = (typeof TABLE_CELL_STYLES)[number];
17
+ export type TableCellStyleKey = typeof TABLE_CELL_STYLES[number];
18
18
  export declare const serializeTableCellStyles: (styles: {
19
19
  backgroundColor?: string | null | undefined;
20
20
  "border-top"?: string | null | undefined;
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.15-LEAN-4146.4";
1
+ export declare const VERSION = "3.0.18";
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.15-LEAN-4146.4",
4
+ "version": "3.0.18",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",