@manuscripts/transform 3.0.57 → 3.0.59

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.
@@ -819,11 +819,12 @@ class JATSExporter {
819
819
  pullquote_element: (node) => {
820
820
  var _a;
821
821
  let type = 'pullquote';
822
- if (((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.type) === schema_1.schema.nodes.figure) {
822
+ if (((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.type) === schema_1.schema.nodes.quote_image) {
823
823
  type = 'quote-with-image';
824
824
  }
825
825
  return ['disp-quote', { 'content-type': type }, 0];
826
826
  },
827
+ quote_image: (node) => createGraphic(node),
827
828
  graphical_abstract_section: (node) => {
828
829
  const attrs = {
829
830
  id: normalizeID(node.attrs.id),
@@ -549,6 +549,12 @@ class JATSDOMParser {
549
549
  };
550
550
  },
551
551
  },
552
+ {
553
+ tag: 'graphic',
554
+ node: 'quote_image',
555
+ context: 'pullquote_element/',
556
+ getAttrs: this.getFigureAttrs,
557
+ },
552
558
  {
553
559
  tag: 'ext-link',
554
560
  node: 'link',
@@ -92,6 +92,7 @@ const paragraph_1 = require("./nodes/paragraph");
92
92
  const placeholder_1 = require("./nodes/placeholder");
93
93
  const placeholder_element_1 = require("./nodes/placeholder_element");
94
94
  const pullquote_element_1 = require("./nodes/pullquote_element");
95
+ const quote_image_1 = require("./nodes/quote_image");
95
96
  const section_1 = require("./nodes/section");
96
97
  const section_label_1 = require("./nodes/section_label");
97
98
  const section_title_1 = require("./nodes/section_title");
@@ -172,6 +173,7 @@ __exportStar(require("./nodes/alt_title"), exports);
172
173
  __exportStar(require("./nodes/alt_titles_section"), exports);
173
174
  __exportStar(require("./nodes/alt_text"), exports);
174
175
  __exportStar(require("./nodes/long_desc"), exports);
176
+ __exportStar(require("./nodes/quote_image"), exports);
175
177
  exports.schema = new prosemirror_model_1.Schema({
176
178
  marks: {
177
179
  bold: marks_1.bold,
@@ -265,5 +267,6 @@ exports.schema = new prosemirror_model_1.Schema({
265
267
  alt_titles: alt_titles_section_1.altTitlesSection,
266
268
  alt_text: alt_text_1.altText,
267
269
  long_desc: long_desc_1.longDesc,
270
+ quote_image: quote_image_1.quoteImage,
268
271
  },
269
272
  });
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.isPullquoteElement = exports.pullquoteElement = void 0;
19
19
  const json_schema_1 = require("@manuscripts/json-schema");
20
20
  exports.pullquoteElement = {
21
- content: 'figure? paragraph+ attribution',
21
+ content: 'quote_image? paragraph+ attribution',
22
22
  attrs: {
23
23
  id: { default: '' },
24
24
  placeholder: { default: '' },
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2019 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.quoteImage = void 0;
19
+ exports.quoteImage = {
20
+ attrs: {
21
+ id: { default: '' },
22
+ src: { default: '' },
23
+ dataTracked: { default: null },
24
+ },
25
+ selectable: false,
26
+ group: 'block',
27
+ parseDOM: [
28
+ {
29
+ tag: 'figure',
30
+ context: 'pullquote_element/',
31
+ getAttrs: (dom) => {
32
+ const element = dom;
33
+ return {
34
+ id: element.getAttribute('id'),
35
+ src: element.getAttribute('src'),
36
+ };
37
+ },
38
+ },
39
+ ],
40
+ toDOM: (node) => {
41
+ const imageNode = node;
42
+ return [
43
+ 'figure',
44
+ {
45
+ class: 'pullquote-figure',
46
+ id: imageNode.attrs.id,
47
+ },
48
+ ];
49
+ },
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.57";
4
+ exports.VERSION = "3.0.59";
@@ -811,11 +811,12 @@ export class JATSExporter {
811
811
  pullquote_element: (node) => {
812
812
  var _a;
813
813
  let type = 'pullquote';
814
- if (((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.type) === schema.nodes.figure) {
814
+ if (((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.type) === schema.nodes.quote_image) {
815
815
  type = 'quote-with-image';
816
816
  }
817
817
  return ['disp-quote', { 'content-type': type }, 0];
818
818
  },
819
+ quote_image: (node) => createGraphic(node),
819
820
  graphical_abstract_section: (node) => {
820
821
  const attrs = {
821
822
  id: normalizeID(node.attrs.id),
@@ -546,6 +546,12 @@ export class JATSDOMParser {
546
546
  };
547
547
  },
548
548
  },
549
+ {
550
+ tag: 'graphic',
551
+ node: 'quote_image',
552
+ context: 'pullquote_element/',
553
+ getAttrs: this.getFigureAttrs,
554
+ },
549
555
  {
550
556
  tag: 'ext-link',
551
557
  node: 'link',
@@ -75,6 +75,7 @@ import { paragraph } from './nodes/paragraph';
75
75
  import { placeholder } from './nodes/placeholder';
76
76
  import { placeholderElement } from './nodes/placeholder_element';
77
77
  import { pullquoteElement } from './nodes/pullquote_element';
78
+ import { quoteImage } from './nodes/quote_image';
78
79
  import { section } from './nodes/section';
79
80
  import { sectionLabel } from './nodes/section_label';
80
81
  import { sectionTitle } from './nodes/section_title';
@@ -155,6 +156,7 @@ export * from './nodes/alt_title';
155
156
  export * from './nodes/alt_titles_section';
156
157
  export * from './nodes/alt_text';
157
158
  export * from './nodes/long_desc';
159
+ export * from './nodes/quote_image';
158
160
  export const schema = new Schema({
159
161
  marks: {
160
162
  bold,
@@ -248,5 +250,6 @@ export const schema = new Schema({
248
250
  alt_titles: altTitlesSection,
249
251
  alt_text: altText,
250
252
  long_desc: longDesc,
253
+ quote_image: quoteImage,
251
254
  },
252
255
  });
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ObjectTypes } from '@manuscripts/json-schema';
17
17
  export const pullquoteElement = {
18
- content: 'figure? paragraph+ attribution',
18
+ content: 'quote_image? paragraph+ attribution',
19
19
  attrs: {
20
20
  id: { default: '' },
21
21
  placeholder: { default: '' },
@@ -0,0 +1,47 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export const quoteImage = {
17
+ attrs: {
18
+ id: { default: '' },
19
+ src: { default: '' },
20
+ dataTracked: { default: null },
21
+ },
22
+ selectable: false,
23
+ group: 'block',
24
+ parseDOM: [
25
+ {
26
+ tag: 'figure',
27
+ context: 'pullquote_element/',
28
+ getAttrs: (dom) => {
29
+ const element = dom;
30
+ return {
31
+ id: element.getAttribute('id'),
32
+ src: element.getAttribute('src'),
33
+ };
34
+ },
35
+ },
36
+ ],
37
+ toDOM: (node) => {
38
+ const imageNode = node;
39
+ return [
40
+ 'figure',
41
+ {
42
+ class: 'pullquote-figure',
43
+ id: imageNode.attrs.id,
44
+ },
45
+ ];
46
+ },
47
+ };
@@ -1 +1 @@
1
- export const VERSION = "3.0.57";
1
+ export const VERSION = "3.0.59";
@@ -84,4 +84,5 @@ export * from './nodes/alt_title';
84
84
  export * from './nodes/alt_titles_section';
85
85
  export * from './nodes/alt_text';
86
86
  export * from './nodes/long_desc';
87
+ export * from './nodes/quote_image';
87
88
  export declare const schema: Schema<Nodes, Marks>;
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { NodeSpec } from 'prosemirror-model';
17
+ import { ManuscriptNode } from '../types';
18
+ export interface QuoteImageAttrs {
19
+ id: string;
20
+ src: string;
21
+ type: string;
22
+ }
23
+ export interface QuoteImageNode extends ManuscriptNode {
24
+ attrs: QuoteImageAttrs;
25
+ }
26
+ export declare const quoteImage: NodeSpec;
@@ -17,7 +17,7 @@ import { Fragment, Mark as ProsemirrorMark, MarkType, Node as ProsemirrorNode, N
17
17
  import { EditorState, NodeSelection, Plugin, TextSelection, Transaction } from 'prosemirror-state';
18
18
  import { EditorView, NodeView } from 'prosemirror-view';
19
19
  export type Marks = 'bold' | 'code' | 'italic' | 'smallcaps' | 'strikethrough' | 'styled' | 'subscript' | 'superscript' | 'underline' | 'tracked_insert' | 'tracked_delete';
20
- export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'list' | 'caption' | 'caption_title' | 'comment' | 'comments' | 'citation' | 'cross_reference' | 'doc' | 'equation' | 'equation_element' | 'figcaption' | 'figure' | 'graphical_abstract_section' | 'figure_element' | 'footnote' | 'footnotes_element' | 'footnotes_section' | 'hard_break' | 'highlight_marker' | 'inline_equation' | 'inline_footnote' | 'keyword' | 'keywords_element' | 'keyword_group' | 'keywords' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'abstracts' | 'body' | 'backmatter' | 'missing_figure' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'table_header' | 'text' | 'text_block' | 'affiliation' | 'contributor' | 'table_element_footer' | 'title' | 'affiliations' | 'contributors' | 'supplements' | 'supplement' | 'author_notes' | 'corresp' | 'general_table_footnote' | 'box_element' | 'awards' | 'award' | 'embed' | 'image_element' | 'attachment' | 'attachments' | 'alt_title' | 'alt_text' | 'alt_titles' | 'long_desc';
20
+ export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'quote_image' | 'list' | 'caption' | 'caption_title' | 'comment' | 'comments' | 'citation' | 'cross_reference' | 'doc' | 'equation' | 'equation_element' | 'figcaption' | 'figure' | 'graphical_abstract_section' | 'figure_element' | 'footnote' | 'footnotes_element' | 'footnotes_section' | 'hard_break' | 'highlight_marker' | 'inline_equation' | 'inline_footnote' | 'keyword' | 'keywords_element' | 'keyword_group' | 'keywords' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'abstracts' | 'body' | 'backmatter' | 'missing_figure' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'table_header' | 'text' | 'text_block' | 'affiliation' | 'contributor' | 'table_element_footer' | 'title' | 'affiliations' | 'contributors' | 'supplements' | 'supplement' | 'author_notes' | 'corresp' | 'general_table_footnote' | 'box_element' | 'awards' | 'award' | 'embed' | 'image_element' | 'attachment' | 'attachments' | 'alt_title' | 'alt_text' | 'alt_titles' | 'long_desc';
21
21
  export type ManuscriptSchema = Schema<Nodes, Marks>;
22
22
  export type ManuscriptEditorState = EditorState;
23
23
  export type ManuscriptEditorView = EditorView;
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.57";
1
+ export declare const VERSION = "3.0.59";
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.57",
4
+ "version": "3.0.59",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",