@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.caption = void 0;
|
|
19
|
+
exports.caption = {
|
|
20
|
+
content: 'inline*',
|
|
21
|
+
attrs: {
|
|
22
|
+
placeholder: { default: 'Caption...' },
|
|
23
|
+
dataTracked: { default: null },
|
|
24
|
+
},
|
|
25
|
+
selectable: false,
|
|
26
|
+
isolating: true,
|
|
27
|
+
group: 'block',
|
|
28
|
+
parseDOM: [
|
|
29
|
+
{
|
|
30
|
+
tag: 'p',
|
|
31
|
+
getAttrs: (node) => {
|
|
32
|
+
const dom = node;
|
|
33
|
+
return {
|
|
34
|
+
placeholder: dom.getAttribute('data-placeholder-text'),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
toDOM: (node) => {
|
|
40
|
+
const captionNode = node;
|
|
41
|
+
const attrs = {};
|
|
42
|
+
attrs.class = 'caption-description';
|
|
43
|
+
if (captionNode.attrs.placeholder) {
|
|
44
|
+
attrs['data-placeholder-text'] = captionNode.attrs.placeholder;
|
|
45
|
+
}
|
|
46
|
+
if (!captionNode.textContent) {
|
|
47
|
+
attrs.class = `${attrs.class} placeholder`;
|
|
48
|
+
}
|
|
49
|
+
attrs.contenteditable = 'true';
|
|
50
|
+
return ['p', attrs, 0];
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
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.captionTitle = void 0;
|
|
19
|
+
exports.captionTitle = {
|
|
20
|
+
content: 'inline*',
|
|
21
|
+
group: 'block',
|
|
22
|
+
selectable: false,
|
|
23
|
+
attrs: {
|
|
24
|
+
placeholder: { default: 'Title...' },
|
|
25
|
+
dataTracked: { default: null },
|
|
26
|
+
},
|
|
27
|
+
parseDOM: [
|
|
28
|
+
{
|
|
29
|
+
tag: 'label',
|
|
30
|
+
getAttrs: (node) => {
|
|
31
|
+
const dom = node;
|
|
32
|
+
return {
|
|
33
|
+
placeholder: dom.getAttribute('data-placeholder-text'),
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
toDOM: (node) => {
|
|
39
|
+
const captionTitleNode = node;
|
|
40
|
+
const attrs = {};
|
|
41
|
+
attrs.class = 'caption-title';
|
|
42
|
+
if (captionTitleNode.attrs.placeholder) {
|
|
43
|
+
attrs['data-placeholder-text'] = captionTitleNode.attrs.placeholder;
|
|
44
|
+
}
|
|
45
|
+
if (!captionTitleNode.textContent) {
|
|
46
|
+
attrs.class = `${attrs.class} placeholder`;
|
|
47
|
+
}
|
|
48
|
+
attrs.contenteditable = 'true';
|
|
49
|
+
return ['label', attrs, 0];
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -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.isCitationNode = exports.citation = void 0;
|
|
19
|
+
exports.citation = {
|
|
20
|
+
inline: true,
|
|
21
|
+
group: 'inline',
|
|
22
|
+
draggable: true,
|
|
23
|
+
atom: true,
|
|
24
|
+
attrs: {
|
|
25
|
+
rid: { default: '' },
|
|
26
|
+
contents: { default: '' },
|
|
27
|
+
selectedText: { default: '' },
|
|
28
|
+
dataTracked: { default: null },
|
|
29
|
+
},
|
|
30
|
+
parseDOM: [
|
|
31
|
+
{
|
|
32
|
+
tag: 'span.citation[data-reference-id]',
|
|
33
|
+
getAttrs: (p) => {
|
|
34
|
+
const dom = p;
|
|
35
|
+
return {
|
|
36
|
+
rid: dom.getAttribute('data-reference-id'),
|
|
37
|
+
contents: dom.innerHTML,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
toDOM: (node) => {
|
|
43
|
+
const citationNode = node;
|
|
44
|
+
const dom = document.createElement('span');
|
|
45
|
+
dom.className = 'citation';
|
|
46
|
+
dom.setAttribute('data-reference-id', citationNode.attrs.rid);
|
|
47
|
+
dom.innerHTML = citationNode.attrs.contents;
|
|
48
|
+
return dom;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const isCitationNode = (node) => node.type === node.type.schema.nodes.citation;
|
|
52
|
+
exports.isCitationNode = isCitationNode;
|
|
@@ -0,0 +1,26 @@
|
|
|
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.comment = void 0;
|
|
19
|
+
exports.comment = {
|
|
20
|
+
attrs: {
|
|
21
|
+
id: { default: '' },
|
|
22
|
+
contents: { default: '' },
|
|
23
|
+
target: { default: '' },
|
|
24
|
+
selector: { default: null },
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
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.crossReference = void 0;
|
|
19
|
+
exports.crossReference = {
|
|
20
|
+
inline: true,
|
|
21
|
+
group: 'inline',
|
|
22
|
+
draggable: true,
|
|
23
|
+
atom: true,
|
|
24
|
+
attrs: {
|
|
25
|
+
rid: { default: '' },
|
|
26
|
+
label: { default: '' },
|
|
27
|
+
dataTracked: { default: null },
|
|
28
|
+
},
|
|
29
|
+
parseDOM: [
|
|
30
|
+
{
|
|
31
|
+
tag: 'span.cross-reference',
|
|
32
|
+
getAttrs: (p) => {
|
|
33
|
+
const dom = p;
|
|
34
|
+
return {
|
|
35
|
+
rid: dom.getAttribute('data-reference-id'),
|
|
36
|
+
label: dom.textContent,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
toDOM: (node) => {
|
|
42
|
+
const crossReferenceNode = node;
|
|
43
|
+
return [
|
|
44
|
+
'span',
|
|
45
|
+
{
|
|
46
|
+
class: 'cross-reference',
|
|
47
|
+
'data-reference-id': crossReferenceNode.attrs.rid,
|
|
48
|
+
},
|
|
49
|
+
[
|
|
50
|
+
'span',
|
|
51
|
+
{
|
|
52
|
+
class: 'kind elementIndex',
|
|
53
|
+
},
|
|
54
|
+
['b', crossReferenceNode.attrs.label],
|
|
55
|
+
],
|
|
56
|
+
];
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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.doc = void 0;
|
|
19
|
+
exports.doc = {
|
|
20
|
+
content: 'manuscript',
|
|
21
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
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.equation = void 0;
|
|
19
|
+
const manuscripts_json_schema_1 = require("@manuscripts/manuscripts-json-schema");
|
|
20
|
+
exports.equation = {
|
|
21
|
+
attrs: {
|
|
22
|
+
id: { default: '' },
|
|
23
|
+
MathMLStringRepresentation: { default: '' },
|
|
24
|
+
SVGStringRepresentation: { default: '' },
|
|
25
|
+
TeXRepresentation: { default: '' },
|
|
26
|
+
dataTracked: { default: null },
|
|
27
|
+
},
|
|
28
|
+
group: 'block',
|
|
29
|
+
parseDOM: [
|
|
30
|
+
{
|
|
31
|
+
tag: `div.${manuscripts_json_schema_1.ObjectTypes.Equation}`,
|
|
32
|
+
getAttrs: (p) => {
|
|
33
|
+
const dom = p;
|
|
34
|
+
return {
|
|
35
|
+
id: dom.getAttribute('id'),
|
|
36
|
+
MathMLStringRepresentation: dom.getAttribute('data-mathml-string-representation'),
|
|
37
|
+
SVGStringRepresentation: dom.innerHTML,
|
|
38
|
+
TeXRepresentation: dom.getAttribute('data-tex-representation'),
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
toDOM: (node) => {
|
|
44
|
+
const equationNode = node;
|
|
45
|
+
const dom = document.createElement('div');
|
|
46
|
+
dom.setAttribute('id', equationNode.attrs.id);
|
|
47
|
+
dom.classList.add(manuscripts_json_schema_1.ObjectTypes.Equation);
|
|
48
|
+
if (equationNode.attrs.MathMLStringRepresentation) {
|
|
49
|
+
dom.setAttribute('data-mathml-string-representation', equationNode.attrs.MathMLStringRepresentation);
|
|
50
|
+
}
|
|
51
|
+
dom.setAttribute('data-tex-representation', equationNode.attrs.TeXRepresentation);
|
|
52
|
+
dom.innerHTML = equationNode.attrs.SVGStringRepresentation;
|
|
53
|
+
return dom;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -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.equationElement = void 0;
|
|
19
|
+
exports.equationElement = {
|
|
20
|
+
content: '(equation | 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
|
+
selectable: false,
|
|
29
|
+
group: 'block element',
|
|
30
|
+
parseDOM: [
|
|
31
|
+
{
|
|
32
|
+
tag: 'figure.equation',
|
|
33
|
+
getAttrs: (p) => {
|
|
34
|
+
const dom = p;
|
|
35
|
+
return {
|
|
36
|
+
id: dom.getAttribute('id'),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
toDOM: (node) => {
|
|
42
|
+
const equationElementNode = node;
|
|
43
|
+
return [
|
|
44
|
+
'figure',
|
|
45
|
+
{
|
|
46
|
+
class: 'equation',
|
|
47
|
+
id: equationElementNode.attrs.id,
|
|
48
|
+
},
|
|
49
|
+
0,
|
|
50
|
+
];
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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.figcaption = void 0;
|
|
19
|
+
exports.figcaption = {
|
|
20
|
+
content: 'caption_title? caption*',
|
|
21
|
+
group: 'block',
|
|
22
|
+
attrs: { dataTracked: { default: null } },
|
|
23
|
+
isolating: true,
|
|
24
|
+
selectable: false,
|
|
25
|
+
parseDOM: [
|
|
26
|
+
{
|
|
27
|
+
tag: 'figcaption',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
toDOM: () => ['figcaption', 0],
|
|
31
|
+
};
|
|
@@ -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.figure = void 0;
|
|
19
|
+
exports.figure = {
|
|
20
|
+
attrs: {
|
|
21
|
+
id: { default: '' },
|
|
22
|
+
src: { default: '' },
|
|
23
|
+
contentType: { default: '' },
|
|
24
|
+
position: { default: undefined },
|
|
25
|
+
dataTracked: { default: null },
|
|
26
|
+
},
|
|
27
|
+
selectable: false,
|
|
28
|
+
group: 'block',
|
|
29
|
+
parseDOM: [
|
|
30
|
+
{
|
|
31
|
+
tag: 'figure',
|
|
32
|
+
context: 'figure_element/',
|
|
33
|
+
getAttrs: (dom) => {
|
|
34
|
+
const element = dom;
|
|
35
|
+
return {
|
|
36
|
+
id: element.getAttribute('id'),
|
|
37
|
+
src: element.getAttribute('src'),
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
toDOM: (node) => {
|
|
43
|
+
const figureNode = node;
|
|
44
|
+
return [
|
|
45
|
+
'figure',
|
|
46
|
+
{
|
|
47
|
+
class: 'figure',
|
|
48
|
+
id: figureNode.attrs.id,
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
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.isFigureElementNode = exports.figureElement = void 0;
|
|
19
|
+
exports.figureElement = {
|
|
20
|
+
content: '(paragraph | figure | missing_figure | placeholder)+ attribution* figcaption (listing | placeholder)',
|
|
21
|
+
attrs: {
|
|
22
|
+
figureLayout: { default: '' },
|
|
23
|
+
figureStyle: { default: '' },
|
|
24
|
+
id: { default: '' },
|
|
25
|
+
label: { default: '' },
|
|
26
|
+
sizeFraction: { default: 0 },
|
|
27
|
+
alignment: { default: undefined },
|
|
28
|
+
suppressCaption: { default: false },
|
|
29
|
+
suppressTitle: { default: undefined },
|
|
30
|
+
attribution: { default: undefined },
|
|
31
|
+
alternatives: { default: undefined },
|
|
32
|
+
dataTracked: { default: null },
|
|
33
|
+
comments: { default: null },
|
|
34
|
+
},
|
|
35
|
+
selectable: false,
|
|
36
|
+
group: 'block element executable',
|
|
37
|
+
parseDOM: [
|
|
38
|
+
{
|
|
39
|
+
tag: 'figure.figure-group',
|
|
40
|
+
getAttrs: (p) => {
|
|
41
|
+
const dom = p;
|
|
42
|
+
return {
|
|
43
|
+
id: dom.getAttribute('id'),
|
|
44
|
+
figureStyle: dom.getAttribute('data-figure-style'),
|
|
45
|
+
figureLayout: dom.getAttribute('data-figure-layout'),
|
|
46
|
+
sizeFraction: Number(dom.getAttribute('data-size-fraction')) || 0,
|
|
47
|
+
alignment: dom.getAttribute('data-alignment') || undefined,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
toDOM: (node) => {
|
|
53
|
+
const figureElementNode = node;
|
|
54
|
+
const { id, figureStyle, figureLayout, alignment, sizeFraction } = figureElementNode.attrs;
|
|
55
|
+
const attrs = {};
|
|
56
|
+
const classes = ['figure-group'];
|
|
57
|
+
if (sizeFraction === 2) {
|
|
58
|
+
classes.push('figure-group--static');
|
|
59
|
+
}
|
|
60
|
+
attrs.class = classes.join(' ');
|
|
61
|
+
attrs.id = id;
|
|
62
|
+
if (figureStyle) {
|
|
63
|
+
attrs['data-figure-style'] = figureStyle;
|
|
64
|
+
}
|
|
65
|
+
if (figureLayout) {
|
|
66
|
+
attrs['data-figure-layout'] = figureLayout;
|
|
67
|
+
}
|
|
68
|
+
if (sizeFraction) {
|
|
69
|
+
attrs['data-size-fraction'] = String(sizeFraction);
|
|
70
|
+
}
|
|
71
|
+
if (alignment) {
|
|
72
|
+
attrs['data-alignment'] = alignment;
|
|
73
|
+
}
|
|
74
|
+
return ['figure', attrs, 0];
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
const isFigureElementNode = (node) => node.type === node.type.schema.nodes.figure_element;
|
|
78
|
+
exports.isFigureElementNode = isFigureElementNode;
|
|
@@ -0,0 +1,67 @@
|
|
|
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.isFootnoteNode = exports.footnote = void 0;
|
|
19
|
+
exports.footnote = {
|
|
20
|
+
group: 'block',
|
|
21
|
+
content: 'paragraph+',
|
|
22
|
+
attrs: {
|
|
23
|
+
id: { default: '' },
|
|
24
|
+
kind: { default: 'footnote' },
|
|
25
|
+
paragraphStyle: { default: '' },
|
|
26
|
+
placeholder: { default: '' },
|
|
27
|
+
dataTracked: { default: null },
|
|
28
|
+
comments: { default: null },
|
|
29
|
+
},
|
|
30
|
+
parseDOM: [
|
|
31
|
+
{
|
|
32
|
+
tag: 'div.footnote-text',
|
|
33
|
+
getAttrs: (p) => {
|
|
34
|
+
const dom = p;
|
|
35
|
+
const attrs = {
|
|
36
|
+
id: dom.getAttribute('id') || undefined,
|
|
37
|
+
kind: (dom.getAttribute('data-kind') || 'footnote'),
|
|
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 footnoteNode = node;
|
|
49
|
+
const { kind, paragraphStyle, placeholder, id } = footnoteNode.attrs;
|
|
50
|
+
const attrs = { class: 'footnote-text', id: '' };
|
|
51
|
+
if (kind) {
|
|
52
|
+
attrs['data-kind'] = kind;
|
|
53
|
+
}
|
|
54
|
+
if (id) {
|
|
55
|
+
attrs.id = id;
|
|
56
|
+
}
|
|
57
|
+
if (paragraphStyle) {
|
|
58
|
+
attrs.paragraphStyle = paragraphStyle;
|
|
59
|
+
}
|
|
60
|
+
if (placeholder) {
|
|
61
|
+
attrs['data-placeholder-text'] = placeholder;
|
|
62
|
+
}
|
|
63
|
+
return ['div', attrs, 0];
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
const isFootnoteNode = (node) => node.type === node.type.schema.nodes.footnote;
|
|
67
|
+
exports.isFootnoteNode = isFootnoteNode;
|
|
@@ -0,0 +1,54 @@
|
|
|
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.isFootnotesElementNode = exports.footnotesElement = void 0;
|
|
19
|
+
exports.footnotesElement = {
|
|
20
|
+
attrs: {
|
|
21
|
+
id: { default: '' },
|
|
22
|
+
kind: { default: 'footnote' },
|
|
23
|
+
paragraphStyle: { default: '' },
|
|
24
|
+
dataTracked: { default: null },
|
|
25
|
+
},
|
|
26
|
+
content: 'footnote*',
|
|
27
|
+
group: 'block element',
|
|
28
|
+
selectable: false,
|
|
29
|
+
parseDOM: [
|
|
30
|
+
{
|
|
31
|
+
tag: 'div.footnotes',
|
|
32
|
+
getAttrs: (p) => {
|
|
33
|
+
const dom = p;
|
|
34
|
+
return {
|
|
35
|
+
kind: dom.getAttribute('data-kind') || 'footnote',
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
toDOM: (node) => {
|
|
41
|
+
const footnotesElementNode = node;
|
|
42
|
+
const { id, kind, paragraphStyle } = footnotesElementNode.attrs;
|
|
43
|
+
const attrs = { class: 'footnotes', id };
|
|
44
|
+
if (kind) {
|
|
45
|
+
attrs['data-kind'] = kind;
|
|
46
|
+
}
|
|
47
|
+
if (paragraphStyle) {
|
|
48
|
+
attrs['paragraphStyle'] = paragraphStyle;
|
|
49
|
+
}
|
|
50
|
+
return ['div', attrs, 0];
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
const isFootnotesElementNode = (node) => node.type === node.type.schema.nodes.footnotes_element;
|
|
54
|
+
exports.isFootnotesElementNode = isFootnotesElementNode;
|