@manuscripts/transform 1.0.0
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.
- package/LICENSE +201 -0
- package/README.md +193 -0
- package/dist/cjs/errors.js +17 -0
- package/dist/cjs/index.js +27 -0
- package/dist/cjs/jats/importer/index.js +24 -0
- package/dist/cjs/jats/importer/jats-body-dom-parser.js +650 -0
- package/dist/cjs/jats/importer/jats-body-transformations.js +269 -0
- package/dist/cjs/jats/importer/jats-comments.js +131 -0
- package/dist/cjs/jats/importer/jats-front-parser.js +341 -0
- package/dist/cjs/jats/importer/jats-journal-meta-parser.js +77 -0
- package/dist/cjs/jats/importer/jats-parser-utils.js +145 -0
- package/dist/cjs/jats/importer/jats-reference-parser.js +180 -0
- package/dist/cjs/jats/importer/parse-jats-article.js +237 -0
- package/dist/cjs/jats/index.js +40 -0
- package/dist/cjs/jats/jats-exporter.js +1569 -0
- package/dist/cjs/jats/jats-versions.js +41 -0
- package/dist/cjs/lib/attributes.js +26 -0
- package/dist/cjs/lib/html.js +48 -0
- package/dist/cjs/lib/styled-content.js +28 -0
- package/dist/cjs/lib/table-cell-styles.js +52 -0
- package/dist/cjs/lib/utils.js +66 -0
- package/dist/cjs/mathjax/index.js +41 -0
- package/dist/cjs/mathjax/mathjax-packages.js +20 -0
- package/dist/cjs/mathjax/mathml-to-svg.js +56 -0
- package/dist/cjs/mathjax/tex-to-mathml.js +49 -0
- package/dist/cjs/mathjax/tex-to-svg.js +59 -0
- package/dist/cjs/schema/groups.js +31 -0
- package/dist/cjs/schema/index.js +195 -0
- package/dist/cjs/schema/marks.js +159 -0
- package/dist/cjs/schema/nodes/attribution.js +32 -0
- package/dist/cjs/schema/nodes/bibliography_element.js +44 -0
- package/dist/cjs/schema/nodes/bibliography_item.js +101 -0
- package/dist/cjs/schema/nodes/bibliography_section.js +46 -0
- package/dist/cjs/schema/nodes/blockquote_element.js +62 -0
- package/dist/cjs/schema/nodes/caption.js +52 -0
- package/dist/cjs/schema/nodes/caption_title.js +51 -0
- package/dist/cjs/schema/nodes/citation.js +52 -0
- package/dist/cjs/schema/nodes/comment.js +26 -0
- package/dist/cjs/schema/nodes/cross_reference.js +58 -0
- package/dist/cjs/schema/nodes/doc.js +21 -0
- package/dist/cjs/schema/nodes/equation.js +55 -0
- package/dist/cjs/schema/nodes/equation_element.js +52 -0
- package/dist/cjs/schema/nodes/figcaption.js +31 -0
- package/dist/cjs/schema/nodes/figure.js +52 -0
- package/dist/cjs/schema/nodes/figure_element.js +78 -0
- package/dist/cjs/schema/nodes/footnote.js +67 -0
- package/dist/cjs/schema/nodes/footnotes_element.js +54 -0
- package/dist/cjs/schema/nodes/footnotes_section.js +45 -0
- package/dist/cjs/schema/nodes/graphical_abstract_section.js +46 -0
- package/dist/cjs/schema/nodes/hard_break.js +30 -0
- package/dist/cjs/schema/nodes/highlight_marker.js +53 -0
- package/dist/cjs/schema/nodes/inline_equation.js +58 -0
- package/dist/cjs/schema/nodes/inline_footnote.js +51 -0
- package/dist/cjs/schema/nodes/keywords_element.js +52 -0
- package/dist/cjs/schema/nodes/keywords_section.js +46 -0
- package/dist/cjs/schema/nodes/link.js +61 -0
- package/dist/cjs/schema/nodes/list.js +121 -0
- package/dist/cjs/schema/nodes/listing.js +73 -0
- package/dist/cjs/schema/nodes/listing_element.js +52 -0
- package/dist/cjs/schema/nodes/manuscript.js +46 -0
- package/dist/cjs/schema/nodes/missing_figure.js +50 -0
- package/dist/cjs/schema/nodes/paragraph.js +63 -0
- package/dist/cjs/schema/nodes/placeholder.js +49 -0
- package/dist/cjs/schema/nodes/placeholder_element.js +48 -0
- package/dist/cjs/schema/nodes/pullquote_element.js +65 -0
- package/dist/cjs/schema/nodes/section.js +94 -0
- package/dist/cjs/schema/nodes/section_label.js +30 -0
- package/dist/cjs/schema/nodes/section_title.js +48 -0
- package/dist/cjs/schema/nodes/table.js +70 -0
- package/dist/cjs/schema/nodes/table_col.js +57 -0
- package/dist/cjs/schema/nodes/table_element.js +62 -0
- package/dist/cjs/schema/nodes/table_row.js +123 -0
- package/dist/cjs/schema/nodes/text.js +21 -0
- package/dist/cjs/schema/nodes/toc_element.js +52 -0
- package/dist/cjs/schema/nodes/toc_section.js +46 -0
- package/dist/cjs/schema/types.js +17 -0
- package/dist/cjs/tests.js +30 -0
- package/dist/cjs/transformer/builders.js +305 -0
- package/dist/cjs/transformer/bundles-data.js +36 -0
- package/dist/cjs/transformer/bundles.js +32 -0
- package/dist/cjs/transformer/decode.js +619 -0
- package/dist/cjs/transformer/document-object-types.js +31 -0
- package/dist/cjs/transformer/encode.js +545 -0
- package/dist/cjs/transformer/filename.js +27 -0
- package/dist/cjs/transformer/footnote-category.js +20 -0
- package/dist/cjs/transformer/footnotes-order.js +59 -0
- package/dist/cjs/transformer/highlight-markers.js +126 -0
- package/dist/cjs/transformer/html.js +414 -0
- package/dist/cjs/transformer/id.js +28 -0
- package/dist/cjs/transformer/index.js +54 -0
- package/dist/cjs/transformer/labels.js +85 -0
- package/dist/cjs/transformer/manuscript-dependencies.js +74 -0
- package/dist/cjs/transformer/model-map.js +26 -0
- package/dist/cjs/transformer/models.js +17 -0
- package/dist/cjs/transformer/node-names.js +42 -0
- package/dist/cjs/transformer/node-title.js +87 -0
- package/dist/cjs/transformer/node-types.js +62 -0
- package/dist/cjs/transformer/object-types.js +57 -0
- package/dist/cjs/transformer/project-bundle.js +86 -0
- package/dist/cjs/transformer/section-category.js +222 -0
- package/dist/cjs/transformer/serializer.js +23 -0
- package/dist/cjs/transformer/shared-data.js +31 -0
- package/dist/cjs/transformer/tei-grobid-importer.js +121 -0
- package/dist/cjs/transformer/timestamp.js +20 -0
- package/dist/cjs/transformer/update-identifiers.js +93 -0
- package/dist/cjs/types.js +2 -0
- package/dist/es/errors.js +12 -0
- package/dist/es/index.js +9 -0
- package/dist/es/jats/importer/index.js +16 -0
- package/dist/es/jats/importer/jats-body-dom-parser.js +644 -0
- package/dist/es/jats/importer/jats-body-transformations.js +266 -0
- package/dist/es/jats/importer/jats-comments.js +124 -0
- package/dist/es/jats/importer/jats-front-parser.js +335 -0
- package/dist/es/jats/importer/jats-journal-meta-parser.js +70 -0
- package/dist/es/jats/importer/jats-parser-utils.js +139 -0
- package/dist/es/jats/importer/jats-reference-parser.js +177 -0
- package/dist/es/jats/importer/parse-jats-article.js +229 -0
- package/dist/es/jats/index.js +18 -0
- package/dist/es/jats/jats-exporter.js +1561 -0
- package/dist/es/jats/jats-versions.js +36 -0
- package/dist/es/lib/attributes.js +22 -0
- package/dist/es/lib/html.js +43 -0
- package/dist/es/lib/styled-content.js +23 -0
- package/dist/es/lib/table-cell-styles.js +47 -0
- package/dist/es/lib/utils.js +59 -0
- package/dist/es/mathjax/index.js +12 -0
- package/dist/es/mathjax/mathjax-packages.js +17 -0
- package/dist/es/mathjax/mathml-to-svg.js +52 -0
- package/dist/es/mathjax/tex-to-mathml.js +45 -0
- package/dist/es/mathjax/tex-to-svg.js +55 -0
- package/dist/es/schema/groups.js +27 -0
- package/dist/es/schema/index.js +178 -0
- package/dist/es/schema/marks.js +156 -0
- package/dist/es/schema/nodes/attribution.js +29 -0
- package/dist/es/schema/nodes/bibliography_element.js +41 -0
- package/dist/es/schema/nodes/bibliography_item.js +98 -0
- package/dist/es/schema/nodes/bibliography_section.js +42 -0
- package/dist/es/schema/nodes/blockquote_element.js +58 -0
- package/dist/es/schema/nodes/caption.js +49 -0
- package/dist/es/schema/nodes/caption_title.js +48 -0
- package/dist/es/schema/nodes/citation.js +48 -0
- package/dist/es/schema/nodes/comment.js +23 -0
- package/dist/es/schema/nodes/cross_reference.js +55 -0
- package/dist/es/schema/nodes/doc.js +18 -0
- package/dist/es/schema/nodes/equation.js +52 -0
- package/dist/es/schema/nodes/equation_element.js +49 -0
- package/dist/es/schema/nodes/figcaption.js +28 -0
- package/dist/es/schema/nodes/figure.js +49 -0
- package/dist/es/schema/nodes/figure_element.js +74 -0
- package/dist/es/schema/nodes/footnote.js +63 -0
- package/dist/es/schema/nodes/footnotes_element.js +50 -0
- package/dist/es/schema/nodes/footnotes_section.js +41 -0
- package/dist/es/schema/nodes/graphical_abstract_section.js +42 -0
- package/dist/es/schema/nodes/hard_break.js +27 -0
- package/dist/es/schema/nodes/highlight_marker.js +49 -0
- package/dist/es/schema/nodes/inline_equation.js +55 -0
- package/dist/es/schema/nodes/inline_footnote.js +47 -0
- package/dist/es/schema/nodes/keywords_element.js +49 -0
- package/dist/es/schema/nodes/keywords_section.js +42 -0
- package/dist/es/schema/nodes/link.js +58 -0
- package/dist/es/schema/nodes/list.js +117 -0
- package/dist/es/schema/nodes/listing.js +69 -0
- package/dist/es/schema/nodes/listing_element.js +49 -0
- package/dist/es/schema/nodes/manuscript.js +43 -0
- package/dist/es/schema/nodes/missing_figure.js +47 -0
- package/dist/es/schema/nodes/paragraph.js +59 -0
- package/dist/es/schema/nodes/placeholder.js +46 -0
- package/dist/es/schema/nodes/placeholder_element.js +45 -0
- package/dist/es/schema/nodes/pullquote_element.js +61 -0
- package/dist/es/schema/nodes/section.js +90 -0
- package/dist/es/schema/nodes/section_label.js +26 -0
- package/dist/es/schema/nodes/section_title.js +44 -0
- package/dist/es/schema/nodes/table.js +67 -0
- package/dist/es/schema/nodes/table_col.js +54 -0
- package/dist/es/schema/nodes/table_element.js +59 -0
- package/dist/es/schema/nodes/table_row.js +120 -0
- package/dist/es/schema/nodes/text.js +18 -0
- package/dist/es/schema/nodes/toc_element.js +49 -0
- package/dist/es/schema/nodes/toc_section.js +42 -0
- package/dist/es/schema/types.js +16 -0
- package/dist/es/tests.js +28 -0
- package/dist/es/transformer/builders.js +261 -0
- package/dist/es/transformer/bundles-data.js +8 -0
- package/dist/es/transformer/bundles.js +27 -0
- package/dist/es/transformer/decode.js +608 -0
- package/dist/es/transformer/document-object-types.js +28 -0
- package/dist/es/transformer/encode.js +535 -0
- package/dist/es/transformer/filename.js +23 -0
- package/dist/es/transformer/footnote-category.js +16 -0
- package/dist/es/transformer/footnotes-order.js +53 -0
- package/dist/es/transformer/highlight-markers.js +120 -0
- package/dist/es/transformer/html.js +407 -0
- package/dist/es/transformer/id.js +23 -0
- package/dist/es/transformer/index.js +38 -0
- package/dist/es/transformer/labels.js +81 -0
- package/dist/es/transformer/manuscript-dependencies.js +64 -0
- package/dist/es/transformer/model-map.js +22 -0
- package/dist/es/transformer/models.js +16 -0
- package/dist/es/transformer/node-names.js +39 -0
- package/dist/es/transformer/node-title.js +82 -0
- package/dist/es/transformer/node-types.js +55 -0
- package/dist/es/transformer/object-types.js +52 -0
- package/dist/es/transformer/project-bundle.js +77 -0
- package/dist/es/transformer/section-category.js +210 -0
- package/dist/es/transformer/serializer.js +17 -0
- package/dist/es/transformer/shared-data.js +1 -0
- package/dist/es/transformer/tei-grobid-importer.js +115 -0
- package/dist/es/transformer/timestamp.js +16 -0
- package/dist/es/transformer/update-identifiers.js +87 -0
- package/dist/es/types.js +1 -0
- package/dist/types/errors.d.ts +6 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/jats/importer/index.d.ts +16 -0
- package/dist/types/jats/importer/jats-body-dom-parser.d.ts +24 -0
- package/dist/types/jats/importer/jats-body-transformations.d.ts +31 -0
- package/dist/types/jats/importer/jats-comments.d.ts +26 -0
- package/dist/types/jats/importer/jats-front-parser.d.ts +62 -0
- package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +37 -0
- package/dist/types/jats/importer/jats-parser-utils.d.ts +23 -0
- package/dist/types/jats/importer/jats-reference-parser.d.ts +23 -0
- package/dist/types/jats/importer/parse-jats-article.d.ts +30 -0
- package/dist/types/jats/index.d.ts +18 -0
- package/dist/types/jats/jats-exporter.d.ts +72 -0
- package/dist/types/jats/jats-versions.d.ts +23 -0
- package/dist/types/lib/attributes.d.ts +20 -0
- package/dist/types/lib/html.d.ts +17 -0
- package/dist/types/lib/styled-content.d.ts +22 -0
- package/dist/types/lib/table-cell-styles.d.ts +27 -0
- package/dist/types/lib/utils.d.ts +26 -0
- package/dist/types/mathjax/index.d.ts +3 -0
- package/dist/types/mathjax/mathjax-packages.d.ts +16 -0
- package/dist/types/mathjax/mathml-to-svg.d.ts +17 -0
- package/dist/types/mathjax/tex-to-mathml.d.ts +17 -0
- package/dist/types/mathjax/tex-to-svg.d.ts +17 -0
- package/dist/types/schema/groups.d.ts +22 -0
- package/dist/types/schema/index.d.ts +65 -0
- package/dist/types/schema/marks.d.ts +27 -0
- package/dist/types/schema/nodes/attribution.d.ts +21 -0
- package/dist/types/schema/nodes/bibliography_element.d.ts +26 -0
- package/dist/types/schema/nodes/bibliography_item.d.ts +36 -0
- package/dist/types/schema/nodes/bibliography_section.d.ts +26 -0
- package/dist/types/schema/nodes/blockquote_element.d.ts +28 -0
- package/dist/types/schema/nodes/caption.d.ts +25 -0
- package/dist/types/schema/nodes/caption_title.d.ts +25 -0
- package/dist/types/schema/nodes/citation.d.ts +27 -0
- package/dist/types/schema/nodes/comment.d.ts +31 -0
- package/dist/types/schema/nodes/cross_reference.d.ts +26 -0
- package/dist/types/schema/nodes/doc.d.ts +17 -0
- package/dist/types/schema/nodes/equation.d.ts +28 -0
- package/dist/types/schema/nodes/equation_element.d.ts +29 -0
- package/dist/types/schema/nodes/figcaption.d.ts +21 -0
- package/dist/types/schema/nodes/figure.d.ts +25 -0
- package/dist/types/schema/nodes/figure_element.d.ts +44 -0
- package/dist/types/schema/nodes/footnote.d.ts +32 -0
- package/dist/types/schema/nodes/footnotes_element.d.ts +28 -0
- package/dist/types/schema/nodes/footnotes_section.d.ts +26 -0
- package/dist/types/schema/nodes/graphical_abstract_section.d.ts +26 -0
- package/dist/types/schema/nodes/hard_break.d.ts +21 -0
- package/dist/types/schema/nodes/highlight_marker.d.ts +29 -0
- package/dist/types/schema/nodes/inline_equation.d.ts +28 -0
- package/dist/types/schema/nodes/inline_footnote.d.ts +27 -0
- package/dist/types/schema/nodes/keywords_element.d.ts +27 -0
- package/dist/types/schema/nodes/keywords_section.d.ts +26 -0
- package/dist/types/schema/nodes/link.d.ts +26 -0
- package/dist/types/schema/nodes/list.d.ts +39 -0
- package/dist/types/schema/nodes/listing.d.ts +33 -0
- package/dist/types/schema/nodes/listing_element.d.ts +29 -0
- package/dist/types/schema/nodes/manuscript.d.ts +23 -0
- package/dist/types/schema/nodes/missing_figure.d.ts +23 -0
- package/dist/types/schema/nodes/paragraph.d.ts +30 -0
- package/dist/types/schema/nodes/placeholder.d.ts +26 -0
- package/dist/types/schema/nodes/placeholder_element.d.ts +25 -0
- package/dist/types/schema/nodes/pullquote_element.d.ts +28 -0
- package/dist/types/schema/nodes/section.d.ts +36 -0
- package/dist/types/schema/nodes/section_label.d.ts +22 -0
- package/dist/types/schema/nodes/section_title.d.ts +22 -0
- package/dist/types/schema/nodes/table.d.ts +27 -0
- package/dist/types/schema/nodes/table_col.d.ts +24 -0
- package/dist/types/schema/nodes/table_element.d.ts +35 -0
- package/dist/types/schema/nodes/table_row.d.ts +41 -0
- package/dist/types/schema/nodes/text.d.ts +17 -0
- package/dist/types/schema/nodes/toc_element.d.ts +27 -0
- package/dist/types/schema/nodes/toc_section.d.ts +26 -0
- package/dist/types/schema/types.d.ts +45 -0
- package/dist/types/tests.d.ts +16 -0
- package/dist/types/transformer/builders.d.ts +74 -0
- package/dist/types/transformer/bundles-data.d.ts +3 -0
- package/dist/types/transformer/bundles.d.ts +3 -0
- package/dist/types/transformer/decode.d.ts +38 -0
- package/dist/types/transformer/document-object-types.d.ts +17 -0
- package/dist/types/transformer/encode.d.ts +29 -0
- package/dist/types/transformer/filename.d.ts +16 -0
- package/dist/types/transformer/footnote-category.d.ts +17 -0
- package/dist/types/transformer/footnotes-order.d.ts +23 -0
- package/dist/types/transformer/highlight-markers.d.ts +26 -0
- package/dist/types/transformer/html.d.ts +36 -0
- package/dist/types/transformer/id.d.ts +20 -0
- package/dist/types/transformer/index.d.ts +38 -0
- package/dist/types/transformer/labels.d.ts +24 -0
- package/dist/types/transformer/manuscript-dependencies.d.ts +12 -0
- package/dist/types/transformer/model-map.d.ts +19 -0
- package/dist/types/transformer/models.d.ts +48 -0
- package/dist/types/transformer/node-names.d.ts +17 -0
- package/dist/types/transformer/node-title.d.ts +19 -0
- package/dist/types/transformer/node-types.d.ts +22 -0
- package/dist/types/transformer/object-types.d.ts +29 -0
- package/dist/types/transformer/project-bundle.d.ts +30 -0
- package/dist/types/transformer/section-category.d.ts +28 -0
- package/dist/types/transformer/serializer.d.ts +19 -0
- package/dist/types/transformer/shared-data.d.ts +2 -0
- package/dist/types/transformer/tei-grobid-importer.d.ts +20 -0
- package/dist/types/transformer/timestamp.d.ts +16 -0
- package/dist/types/transformer/update-identifiers.d.ts +23 -0
- package/dist/types/types.d.ts +2 -0
- package/package.json +89 -0
|
@@ -0,0 +1,52 @@
|
|
|
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.listingElement = void 0;
|
|
19
|
+
exports.listingElement = {
|
|
20
|
+
content: '(listing | placeholder) figcaption',
|
|
21
|
+
attrs: {
|
|
22
|
+
id: { default: '' },
|
|
23
|
+
suppressCaption: { default: true },
|
|
24
|
+
suppressTitle: { default: undefined },
|
|
25
|
+
dataTracked: { default: null },
|
|
26
|
+
comments: { default: null },
|
|
27
|
+
},
|
|
28
|
+
group: 'block element',
|
|
29
|
+
selectable: false,
|
|
30
|
+
parseDOM: [
|
|
31
|
+
{
|
|
32
|
+
tag: 'figure.listing',
|
|
33
|
+
getAttrs: (p) => {
|
|
34
|
+
const dom = p;
|
|
35
|
+
return {
|
|
36
|
+
id: dom.getAttribute('id'),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
toDOM: (node) => {
|
|
42
|
+
const listingElementNode = node;
|
|
43
|
+
return [
|
|
44
|
+
'figure',
|
|
45
|
+
{
|
|
46
|
+
class: 'listing',
|
|
47
|
+
id: listingElementNode.attrs.id,
|
|
48
|
+
},
|
|
49
|
+
0,
|
|
50
|
+
];
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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.manuscript = void 0;
|
|
19
|
+
exports.manuscript = {
|
|
20
|
+
content: '(section | sections)+',
|
|
21
|
+
attrs: {
|
|
22
|
+
id: { default: '' },
|
|
23
|
+
},
|
|
24
|
+
group: 'block',
|
|
25
|
+
parseDOM: [
|
|
26
|
+
{
|
|
27
|
+
tag: 'article',
|
|
28
|
+
getAttrs: (p) => {
|
|
29
|
+
const dom = p;
|
|
30
|
+
return {
|
|
31
|
+
id: dom.getAttribute('id'),
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
toDOM: (node) => {
|
|
37
|
+
const manuscriptNode = node;
|
|
38
|
+
return [
|
|
39
|
+
'article',
|
|
40
|
+
{
|
|
41
|
+
id: manuscriptNode.attrs.id,
|
|
42
|
+
},
|
|
43
|
+
0,
|
|
44
|
+
];
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -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.missingFigure = void 0;
|
|
19
|
+
exports.missingFigure = {
|
|
20
|
+
attrs: {
|
|
21
|
+
id: { default: '' },
|
|
22
|
+
position: { default: undefined },
|
|
23
|
+
dataTracked: { default: null },
|
|
24
|
+
},
|
|
25
|
+
selectable: false,
|
|
26
|
+
group: 'block',
|
|
27
|
+
parseDOM: [
|
|
28
|
+
{
|
|
29
|
+
tag: 'figure',
|
|
30
|
+
context: 'figure_element/',
|
|
31
|
+
getAttrs: (dom) => {
|
|
32
|
+
const element = dom;
|
|
33
|
+
return {
|
|
34
|
+
id: element.getAttribute('id'),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
toDOM: (node) => {
|
|
40
|
+
const missingFigureNode = node;
|
|
41
|
+
return [
|
|
42
|
+
'figure',
|
|
43
|
+
{
|
|
44
|
+
class: 'figure',
|
|
45
|
+
id: missingFigureNode.attrs.id,
|
|
46
|
+
},
|
|
47
|
+
0,
|
|
48
|
+
];
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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.isParagraphNode = exports.paragraph = void 0;
|
|
19
|
+
const manuscripts_json_schema_1 = require("@manuscripts/manuscripts-json-schema");
|
|
20
|
+
const attributes_1 = require("../../lib/attributes");
|
|
21
|
+
exports.paragraph = {
|
|
22
|
+
content: 'inline*',
|
|
23
|
+
attrs: {
|
|
24
|
+
id: { default: '' },
|
|
25
|
+
paragraphStyle: { default: '' },
|
|
26
|
+
placeholder: { default: '' },
|
|
27
|
+
dataTracked: { default: null },
|
|
28
|
+
comments: { default: null },
|
|
29
|
+
},
|
|
30
|
+
group: 'block element',
|
|
31
|
+
selectable: false,
|
|
32
|
+
parseDOM: [
|
|
33
|
+
{
|
|
34
|
+
tag: 'p',
|
|
35
|
+
getAttrs: (p) => {
|
|
36
|
+
const dom = p;
|
|
37
|
+
const attrs = {
|
|
38
|
+
id: dom.getAttribute('id') || undefined,
|
|
39
|
+
};
|
|
40
|
+
const placeholder = dom.getAttribute('data-placeholder-text');
|
|
41
|
+
if (placeholder) {
|
|
42
|
+
attrs.placeholder = placeholder;
|
|
43
|
+
}
|
|
44
|
+
return attrs;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
toDOM: (node) => {
|
|
49
|
+
const paragraphNode = node;
|
|
50
|
+
const attrs = {};
|
|
51
|
+
if (paragraphNode.attrs.id) {
|
|
52
|
+
attrs.id = paragraphNode.attrs.id;
|
|
53
|
+
}
|
|
54
|
+
attrs.class = (0, attributes_1.buildElementClass)(paragraphNode.attrs);
|
|
55
|
+
attrs['data-object-type'] = manuscripts_json_schema_1.ObjectTypes.ParagraphElement;
|
|
56
|
+
if (paragraphNode.attrs.placeholder) {
|
|
57
|
+
attrs['data-placeholder-text'] = paragraphNode.attrs.placeholder;
|
|
58
|
+
}
|
|
59
|
+
return ['p', attrs, 0];
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
const isParagraphNode = (node) => node.type === node.type.schema.nodes.paragraph;
|
|
63
|
+
exports.isParagraphNode = isParagraphNode;
|
|
@@ -0,0 +1,49 @@
|
|
|
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.placeholder = void 0;
|
|
19
|
+
exports.placeholder = {
|
|
20
|
+
atom: true,
|
|
21
|
+
selectable: false,
|
|
22
|
+
attrs: {
|
|
23
|
+
id: { default: '' },
|
|
24
|
+
label: { default: '' },
|
|
25
|
+
dataTracked: { default: null },
|
|
26
|
+
},
|
|
27
|
+
group: 'block',
|
|
28
|
+
parseDOM: [
|
|
29
|
+
{
|
|
30
|
+
tag: 'div.placeholder',
|
|
31
|
+
getAttrs: (p) => {
|
|
32
|
+
const dom = p;
|
|
33
|
+
return {
|
|
34
|
+
id: dom.getAttribute('id'),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
toDOM: (node) => {
|
|
40
|
+
const placeholderNode = node;
|
|
41
|
+
return [
|
|
42
|
+
'div',
|
|
43
|
+
{
|
|
44
|
+
class: 'placeholder-item',
|
|
45
|
+
id: placeholderNode.attrs.id,
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
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.placeholderElement = void 0;
|
|
19
|
+
exports.placeholderElement = {
|
|
20
|
+
atom: true,
|
|
21
|
+
selectable: false,
|
|
22
|
+
attrs: {
|
|
23
|
+
id: { default: '' },
|
|
24
|
+
dataTracked: { default: null },
|
|
25
|
+
},
|
|
26
|
+
group: 'block element',
|
|
27
|
+
parseDOM: [
|
|
28
|
+
{
|
|
29
|
+
tag: 'div.placeholder-element',
|
|
30
|
+
getAttrs: (p) => {
|
|
31
|
+
const dom = p;
|
|
32
|
+
return {
|
|
33
|
+
id: dom.getAttribute('id'),
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
toDOM: (node) => {
|
|
39
|
+
const placeholderElementNode = node;
|
|
40
|
+
return [
|
|
41
|
+
'div',
|
|
42
|
+
{
|
|
43
|
+
class: 'placeholder-element',
|
|
44
|
+
id: placeholderElementNode.attrs.id,
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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.isPullquoteElement = exports.pullquoteElement = void 0;
|
|
19
|
+
const manuscripts_json_schema_1 = require("@manuscripts/manuscripts-json-schema");
|
|
20
|
+
const attributes_1 = require("../../lib/attributes");
|
|
21
|
+
exports.pullquoteElement = {
|
|
22
|
+
content: 'paragraph+ attribution',
|
|
23
|
+
attrs: {
|
|
24
|
+
id: { default: '' },
|
|
25
|
+
paragraphStyle: { default: '' },
|
|
26
|
+
placeholder: { default: '' },
|
|
27
|
+
dataTracked: { default: null },
|
|
28
|
+
},
|
|
29
|
+
group: 'block element',
|
|
30
|
+
selectable: false,
|
|
31
|
+
parseDOM: [
|
|
32
|
+
{
|
|
33
|
+
tag: 'aside.pullquote',
|
|
34
|
+
getAttrs: (aside) => {
|
|
35
|
+
const dom = aside;
|
|
36
|
+
const attrs = {
|
|
37
|
+
id: dom.getAttribute('id') || undefined,
|
|
38
|
+
};
|
|
39
|
+
const placeholder = dom.getAttribute('data-placeholder-text');
|
|
40
|
+
if (placeholder) {
|
|
41
|
+
attrs.placeholder = placeholder;
|
|
42
|
+
}
|
|
43
|
+
return attrs;
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
toDOM: (node) => {
|
|
48
|
+
const pullquoteElementNode = node;
|
|
49
|
+
const attrs = {};
|
|
50
|
+
if (pullquoteElementNode.attrs.id) {
|
|
51
|
+
attrs.id = pullquoteElementNode.attrs.id;
|
|
52
|
+
}
|
|
53
|
+
attrs.class = [
|
|
54
|
+
'pullquote',
|
|
55
|
+
(0, attributes_1.buildElementClass)(pullquoteElementNode.attrs),
|
|
56
|
+
].join(' ');
|
|
57
|
+
attrs['data-object-type'] = manuscripts_json_schema_1.ObjectTypes.QuoteElement;
|
|
58
|
+
if (pullquoteElementNode.attrs.placeholder) {
|
|
59
|
+
attrs['data-placeholder-text'] = pullquoteElementNode.attrs.placeholder;
|
|
60
|
+
}
|
|
61
|
+
return ['aside', attrs, 0];
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const isPullquoteElement = (node) => node.type === node.type.schema.nodes.pullquote_element;
|
|
65
|
+
exports.isPullquoteElement = isPullquoteElement;
|
|
@@ -0,0 +1,94 @@
|
|
|
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.isSectionNode = exports.section = exports.PAGE_BREAK_BEFORE_AND_AFTER = exports.PAGE_BREAK_AFTER = exports.PAGE_BREAK_BEFORE = exports.PAGE_BREAK_NONE = void 0;
|
|
19
|
+
exports.PAGE_BREAK_NONE = 0;
|
|
20
|
+
exports.PAGE_BREAK_BEFORE = 1;
|
|
21
|
+
exports.PAGE_BREAK_AFTER = 2;
|
|
22
|
+
exports.PAGE_BREAK_BEFORE_AND_AFTER = 4;
|
|
23
|
+
const choosePageBreakStyle = (element) => {
|
|
24
|
+
const pageBreakAfter = element.classList.contains('page-break-after');
|
|
25
|
+
const pageBreakBefore = element.classList.contains('page-break-before');
|
|
26
|
+
if (pageBreakBefore && pageBreakAfter) {
|
|
27
|
+
return exports.PAGE_BREAK_BEFORE_AND_AFTER;
|
|
28
|
+
}
|
|
29
|
+
if (pageBreakBefore) {
|
|
30
|
+
return exports.PAGE_BREAK_BEFORE;
|
|
31
|
+
}
|
|
32
|
+
if (pageBreakAfter) {
|
|
33
|
+
return exports.PAGE_BREAK_AFTER;
|
|
34
|
+
}
|
|
35
|
+
return exports.PAGE_BREAK_NONE;
|
|
36
|
+
};
|
|
37
|
+
exports.section = {
|
|
38
|
+
content: 'section_label? section_title (paragraph | element)* section*',
|
|
39
|
+
attrs: {
|
|
40
|
+
id: { default: '' },
|
|
41
|
+
category: { default: '' },
|
|
42
|
+
titleSuppressed: { default: false },
|
|
43
|
+
generatedLabel: { default: undefined },
|
|
44
|
+
pageBreakStyle: { default: undefined },
|
|
45
|
+
dataTracked: { default: null },
|
|
46
|
+
comments: { default: null },
|
|
47
|
+
},
|
|
48
|
+
group: 'block sections',
|
|
49
|
+
selectable: false,
|
|
50
|
+
parseDOM: [
|
|
51
|
+
{
|
|
52
|
+
tag: 'section',
|
|
53
|
+
getAttrs: (dom) => {
|
|
54
|
+
const element = dom;
|
|
55
|
+
return {
|
|
56
|
+
id: element.getAttribute('id') || '',
|
|
57
|
+
category: element.getAttribute('data-category') || '',
|
|
58
|
+
titleSuppressed: element.classList.contains('title-suppressed'),
|
|
59
|
+
generatedLabel: element.classList.contains('generated-label'),
|
|
60
|
+
pageBreakStyle: choosePageBreakStyle(element) || undefined,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
toDOM: (node) => {
|
|
66
|
+
const sectionNode = node;
|
|
67
|
+
const { id, category, titleSuppressed, generatedLabel, pageBreakStyle } = sectionNode.attrs;
|
|
68
|
+
const classnames = [];
|
|
69
|
+
if (titleSuppressed) {
|
|
70
|
+
classnames.push('title-suppressed');
|
|
71
|
+
}
|
|
72
|
+
if (typeof generatedLabel === 'undefined' || generatedLabel) {
|
|
73
|
+
classnames.push('generated-label');
|
|
74
|
+
}
|
|
75
|
+
if (pageBreakStyle === exports.PAGE_BREAK_BEFORE ||
|
|
76
|
+
pageBreakStyle === exports.PAGE_BREAK_BEFORE_AND_AFTER) {
|
|
77
|
+
classnames.push('page-break-before');
|
|
78
|
+
}
|
|
79
|
+
if (pageBreakStyle === exports.PAGE_BREAK_AFTER ||
|
|
80
|
+
pageBreakStyle === exports.PAGE_BREAK_BEFORE_AND_AFTER) {
|
|
81
|
+
classnames.push('page-break-after');
|
|
82
|
+
}
|
|
83
|
+
const attrs = { id };
|
|
84
|
+
if (classnames.length) {
|
|
85
|
+
attrs['class'] = classnames.join(' ');
|
|
86
|
+
}
|
|
87
|
+
if (category) {
|
|
88
|
+
attrs['data-category'] = node.attrs.category;
|
|
89
|
+
}
|
|
90
|
+
return ['section', attrs, 0];
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
const isSectionNode = (node) => node.type === node.type.schema.nodes.section;
|
|
94
|
+
exports.isSectionNode = isSectionNode;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.isSectionLabelNode = exports.sectionLabel = void 0;
|
|
19
|
+
exports.sectionLabel = {
|
|
20
|
+
content: 'inline*',
|
|
21
|
+
group: 'block',
|
|
22
|
+
attrs: { dataTracked: { default: null } },
|
|
23
|
+
selectable: false,
|
|
24
|
+
parseDOM: [{ tag: 'label' }],
|
|
25
|
+
toDOM() {
|
|
26
|
+
return ['label', 0];
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const isSectionLabelNode = (node) => node.type === node.type.schema.nodes.section_label;
|
|
30
|
+
exports.isSectionLabelNode = isSectionLabelNode;
|
|
@@ -0,0 +1,48 @@
|
|
|
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.isSectionTitleNode = exports.sectionTitle = void 0;
|
|
19
|
+
exports.sectionTitle = {
|
|
20
|
+
content: '(text | highlight_marker)*',
|
|
21
|
+
marks: 'italic superscript subscript smallcaps bold tracked_insert tracked_delete',
|
|
22
|
+
group: 'block',
|
|
23
|
+
attrs: { dataTracked: { default: null } },
|
|
24
|
+
selectable: false,
|
|
25
|
+
parseDOM: [
|
|
26
|
+
{
|
|
27
|
+
tag: 'h1',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
tag: 'h2',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
tag: 'h3',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
tag: 'h4',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
tag: 'h5',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
tag: 'h6',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
toDOM: () => ['h1', 0],
|
|
46
|
+
};
|
|
47
|
+
const isSectionTitleNode = (node) => node.type === node.type.schema.nodes.section_title;
|
|
48
|
+
exports.isSectionTitleNode = isSectionTitleNode;
|
|
@@ -0,0 +1,70 @@
|
|
|
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.tableBody = exports.table = void 0;
|
|
19
|
+
exports.table = {
|
|
20
|
+
content: 'table_colgroup? table_body',
|
|
21
|
+
tableRole: 'table',
|
|
22
|
+
isolating: true,
|
|
23
|
+
group: 'block',
|
|
24
|
+
selectable: false,
|
|
25
|
+
attrs: {
|
|
26
|
+
id: { default: '' },
|
|
27
|
+
headerRows: { default: 1 },
|
|
28
|
+
footerRows: { default: 1 },
|
|
29
|
+
dataTracked: { default: null },
|
|
30
|
+
comments: { default: null },
|
|
31
|
+
},
|
|
32
|
+
parseDOM: [
|
|
33
|
+
{
|
|
34
|
+
tag: 'table',
|
|
35
|
+
getAttrs: (p) => {
|
|
36
|
+
const dom = p;
|
|
37
|
+
return {
|
|
38
|
+
id: dom.getAttribute('id'),
|
|
39
|
+
headerRows: dom.dataset && dom.dataset['header-rows'],
|
|
40
|
+
footerRows: dom.dataset && dom.dataset['footer-rows'],
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
toDOM: (node) => {
|
|
46
|
+
const tableNode = node;
|
|
47
|
+
return [
|
|
48
|
+
'table',
|
|
49
|
+
{
|
|
50
|
+
id: tableNode.attrs.id,
|
|
51
|
+
'data-header-rows': String(node.attrs.headerRows),
|
|
52
|
+
'data-footer-rows': String(node.attrs.footerRows),
|
|
53
|
+
},
|
|
54
|
+
0,
|
|
55
|
+
];
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
exports.tableBody = {
|
|
59
|
+
content: 'table_row+',
|
|
60
|
+
group: 'block',
|
|
61
|
+
tableRole: 'table',
|
|
62
|
+
parseDOM: [
|
|
63
|
+
{
|
|
64
|
+
tag: 'tbody',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
toDOM() {
|
|
68
|
+
return ['tbody', 0];
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
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.tableCol = exports.tableColGroup = void 0;
|
|
19
|
+
exports.tableColGroup = {
|
|
20
|
+
content: 'table_col+',
|
|
21
|
+
group: 'block',
|
|
22
|
+
tableRole: 'colgroup',
|
|
23
|
+
parseDOM: [
|
|
24
|
+
{
|
|
25
|
+
tag: 'colgroup',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
toDOM() {
|
|
29
|
+
return ['colgroup', 0];
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
exports.tableCol = {
|
|
33
|
+
attrs: {
|
|
34
|
+
width: { default: '' },
|
|
35
|
+
},
|
|
36
|
+
group: 'block',
|
|
37
|
+
tableRole: 'col',
|
|
38
|
+
parseDOM: [
|
|
39
|
+
{
|
|
40
|
+
tag: 'col',
|
|
41
|
+
getAttrs: (p) => {
|
|
42
|
+
const dom = p;
|
|
43
|
+
return {
|
|
44
|
+
width: dom.getAttribute('width'),
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
toDOM: (node) => {
|
|
50
|
+
const tableColNode = node;
|
|
51
|
+
const attrs = {};
|
|
52
|
+
if (tableColNode.attrs.width) {
|
|
53
|
+
attrs['width'] = tableColNode.attrs.width;
|
|
54
|
+
}
|
|
55
|
+
return ['col', attrs];
|
|
56
|
+
},
|
|
57
|
+
};
|