@manuscripts/transform 3.0.4 → 3.0.5-LEAN-3933.1

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.
@@ -795,7 +795,15 @@ const nodes = [
795
795
  tag: 'sec',
796
796
  node: 'section',
797
797
  getAttrs: (node) => {
798
+ var _a, _b;
798
799
  const element = node;
800
+ const grandParentNodeName = (_b = (_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.nodeName.toLowerCase();
801
+ if (grandParentNodeName !== 'body') {
802
+ return {
803
+ id: element.getAttribute('id'),
804
+ category: 'MPSectionCategory:subsection',
805
+ };
806
+ }
799
807
  return {
800
808
  id: element.getAttribute('id'),
801
809
  category: (0, transformer_1.chooseSectionCategory)(element),
@@ -203,6 +203,8 @@ const chooseSectionCategoryByType = (secType) => {
203
203
  return 'MPSectionCategory:ethics-statement';
204
204
  case 'box-element':
205
205
  return 'MPSectionCategory:box-element';
206
+ case 'subsection':
207
+ return 'MPSectionCategory:subsection';
206
208
  default:
207
209
  return undefined;
208
210
  }
@@ -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.4";
4
+ exports.VERSION = "3.0.5-LEAN-3933.1";
@@ -789,7 +789,15 @@ const nodes = [
789
789
  tag: 'sec',
790
790
  node: 'section',
791
791
  getAttrs: (node) => {
792
+ var _a, _b;
792
793
  const element = node;
794
+ const grandParentNodeName = (_b = (_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.nodeName.toLowerCase();
795
+ if (grandParentNodeName !== 'body') {
796
+ return {
797
+ id: element.getAttribute('id'),
798
+ category: 'MPSectionCategory:subsection',
799
+ };
800
+ }
793
801
  return {
794
802
  id: element.getAttribute('id'),
795
803
  category: chooseSectionCategory(element),
@@ -192,6 +192,8 @@ export const chooseSectionCategoryByType = (secType) => {
192
192
  return 'MPSectionCategory:ethics-statement';
193
193
  case 'box-element':
194
194
  return 'MPSectionCategory:box-element';
195
+ case 'subsection':
196
+ return 'MPSectionCategory:subsection';
195
197
  default:
196
198
  return undefined;
197
199
  }
@@ -1 +1 @@
1
- export const VERSION = "3.0.4";
1
+ export const VERSION = "3.0.5-LEAN-3933.1";
@@ -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;
@@ -17,8 +17,8 @@ import { Element } from '@manuscripts/json-schema';
17
17
  import { SectionGroupType } from '../lib/section-group-type';
18
18
  import { ManuscriptNode, ManuscriptNodeType } from '../schema';
19
19
  export declare const isAnySectionNode: (node: ManuscriptNode) => boolean;
20
- export type SectionCategory = 'MPSectionCategory:abstract' | 'MPSectionCategory:abstract-teaser' | 'MPSectionCategory:abstract-graphical' | 'MPSectionCategory:acknowledgement' | 'MPSectionCategory:availability' | 'MPSectionCategory:bibliography' | 'MPSectionCategory:conclusions' | 'MPSectionCategory:discussion' | 'MPSectionCategory:endnotes' | 'MPSectionCategory:introduction' | 'MPSectionCategory:keywords' | 'MPSectionCategory:materials-method' | 'MPSectionCategory:results' | 'MPSectionCategory:toc' | 'MPSectionCategory:floating-element' | 'MPSectionCategory:appendices' | 'MPSectionCategory:competing-interests' | 'MPSectionCategory:financial-disclosure' | 'MPSectionCategory:con' | 'MPSectionCategory:deceased' | 'MPSectionCategory:equal' | 'MPSectionCategory:present-address' | 'MPSectionCategory:presented-at' | 'MPSectionCategory:previously-at' | 'MPSectionCategory:supplementary-material' | 'MPSectionCategory:supported-by' | 'MPSectionCategory:ethics-statement' | 'MPSectionCategory:box-element';
21
- export type SecType = 'abstract' | 'abstract-teaser' | 'abstract-graphical' | 'acknowledgments' | 'availability' | 'bibliography' | 'conclusions' | 'data-availability' | 'discussion' | 'endnotes' | 'intro' | 'keywords' | 'materials' | 'methods' | 'results' | 'toc' | 'floating-element' | 'appendices' | 'competing-interests' | 'financial-disclosure' | 'con' | 'deceased' | 'equal' | 'present-address' | 'presented-at' | 'previously-at' | 'supplementary-material' | 'supported-by' | 'ethics-statement' | 'box-element';
20
+ export type SectionCategory = 'MPSectionCategory:abstract' | 'MPSectionCategory:abstract-teaser' | 'MPSectionCategory:abstract-graphical' | 'MPSectionCategory:acknowledgement' | 'MPSectionCategory:availability' | 'MPSectionCategory:bibliography' | 'MPSectionCategory:conclusions' | 'MPSectionCategory:discussion' | 'MPSectionCategory:endnotes' | 'MPSectionCategory:introduction' | 'MPSectionCategory:keywords' | 'MPSectionCategory:materials-method' | 'MPSectionCategory:results' | 'MPSectionCategory:toc' | 'MPSectionCategory:floating-element' | 'MPSectionCategory:appendices' | 'MPSectionCategory:competing-interests' | 'MPSectionCategory:financial-disclosure' | 'MPSectionCategory:con' | 'MPSectionCategory:deceased' | 'MPSectionCategory:equal' | 'MPSectionCategory:present-address' | 'MPSectionCategory:presented-at' | 'MPSectionCategory:previously-at' | 'MPSectionCategory:supplementary-material' | 'MPSectionCategory:supported-by' | 'MPSectionCategory:ethics-statement' | 'MPSectionCategory:box-element' | 'MPSectionCategory:subsection';
21
+ export type SecType = 'abstract' | 'abstract-teaser' | 'abstract-graphical' | 'acknowledgments' | 'availability' | 'bibliography' | 'conclusions' | 'data-availability' | 'discussion' | 'endnotes' | 'intro' | 'keywords' | 'materials' | 'methods' | 'results' | 'toc' | 'floating-element' | 'appendices' | 'competing-interests' | 'financial-disclosure' | 'con' | 'deceased' | 'equal' | 'present-address' | 'presented-at' | 'previously-at' | 'supplementary-material' | 'supported-by' | 'ethics-statement' | 'box-element' | 'subsection';
22
22
  export declare const chooseSectionNodeType: (category?: SectionCategory) => ManuscriptNodeType;
23
23
  export declare const chooseSectionLableName: (type?: SecType) => string;
24
24
  export declare const guessSectionCategory: (elements: Element[]) => SectionCategory | undefined;
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.4";
1
+ export declare const VERSION = "3.0.5-LEAN-3933.1";
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.4",
4
+ "version": "3.0.5-LEAN-3933.1",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",