@manuscripts/body-editor 3.7.28 → 3.8.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.
@@ -114,8 +114,7 @@ const AffiliationItem = ({ affiliation, isSelected, onClick, onDelete, showSucce
114
114
  affiliation.country ? ', ' : '')),
115
115
  affiliation.country && react_1.default.createElement(react_1.default.Fragment, null, affiliation.country))),
116
116
  showSuccessIcon && (react_1.default.createElement(style_guide_1.CrclTickAnimation, { size: 36, style: { position: 'absolute', left: '10px' } })),
117
- isSelected && (react_1.default.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-id": 'delete-button-tooltip' },
118
- react_1.default.createElement(style_guide_1.DeleteIcon, { fill: '#6E6E6E' }),
119
- react_1.default.createElement(style_guide_1.Tooltip, { id: 'delete-button-tooltip', place: "bottom" }, 'Delete')))));
117
+ isSelected && (react_1.default.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-content": "Delete" },
118
+ react_1.default.createElement(style_guide_1.DeleteIcon, { fill: '#6E6E6E' })))));
120
119
  };
121
120
  exports.AffiliationItem = AffiliationItem;
@@ -201,7 +201,6 @@ exports.DraggableAuthor = react_1.default.memo(({ author, isSelected, onClick, o
201
201
  react_1.default.createElement(AuthorNotes, { "data-cy": "author-notes" }, author.isCorresponding && (react_1.default.createElement(AuthorBadge, null,
202
202
  react_1.default.createElement(style_guide_1.CorrespondingAuthorIcon, null))))),
203
203
  react_1.default.createElement(AuthorName, { "data-cy": "author-name" }, (0, authors_1.authorLabel)(author)),
204
- isSelected && (react_1.default.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-id": 'delete-button-tooltip' },
205
- react_1.default.createElement(style_guide_1.DeleteIcon, { fill: '#6E6E6E' }),
206
- react_1.default.createElement(style_guide_1.Tooltip, { id: 'delete-button-tooltip', place: "bottom" }, 'Delete')))));
204
+ isSelected && (react_1.default.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-content": "Delete" },
205
+ react_1.default.createElement(style_guide_1.DeleteIcon, { fill: '#6E6E6E' })))));
207
206
  });
@@ -97,38 +97,24 @@ const ImportBibliographyModal = ({ onCancel, onSave }) => {
97
97
  react_1.default.createElement(ModalBody, null,
98
98
  react_1.default.createElement(ModalTitle, null, "Import Bibliography"),
99
99
  react_1.default.createElement("p", null,
100
- react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "example_bibtex" }, "BibTex"),
100
+ react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": exampleBibtex, "data-tool": true }, "BibTex"),
101
101
  ",",
102
102
  ' ',
103
- react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "example_pubmed" }, "PubMed"),
103
+ react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": examplePubmed }, "PubMed"),
104
104
  ",",
105
105
  ' ',
106
- react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "example_ris" }, "RIS"),
106
+ react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": exampleRis }, "RIS"),
107
107
  ",",
108
108
  ' ',
109
- react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "example_enw" }, "ENW"),
109
+ react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": exampleEnw }, "ENW"),
110
110
  ' ',
111
111
  "and",
112
112
  ' ',
113
- react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "example_doi" }, "DOI"),
113
+ react_1.default.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": exampleDoi }, "DOI"),
114
114
  ' ',
115
115
  "formats are supported"),
116
116
  react_1.default.createElement(ImportBibliographyForm_1.ImportBibliographyForm, { onCancel: handleCancel, onSave: handleSave }),
117
- react_1.default.createElement(Example, { id: "example_bibtex", place: "bottom" },
118
- react_1.default.createElement("div", null,
119
- react_1.default.createElement("pre", null, exampleBibtex))),
120
- react_1.default.createElement(Example, { id: "example_pubmed", place: "bottom" },
121
- react_1.default.createElement("div", null,
122
- react_1.default.createElement("pre", null, examplePubmed))),
123
- react_1.default.createElement(Example, { id: "example_ris", place: "bottom" },
124
- react_1.default.createElement("div", null,
125
- react_1.default.createElement("pre", null, exampleRis))),
126
- react_1.default.createElement(Example, { id: "example_enw", place: "bottom" },
127
- react_1.default.createElement("div", null,
128
- react_1.default.createElement("pre", null, exampleEnw))),
129
- react_1.default.createElement(Example, { id: "example_doi", place: "bottom" },
130
- react_1.default.createElement("div", null,
131
- react_1.default.createElement("pre", null, exampleDoi)))))));
117
+ react_1.default.createElement(Example, { id: "import-example-tooltip", place: "bottom", render: (s) => (react_1.default.createElement("pre", null, s.content)) })))));
132
118
  };
133
119
  exports.ImportBibliographyModal = ImportBibliographyModal;
134
120
  const ModalBody = styled_components_1.default.div `
@@ -112,9 +112,8 @@ const ReferenceForm = ({ values, showDelete, onChange, onDelete, onCancel, onSav
112
112
  react_1.default.createElement(style_guide_1.ButtonGroup, null,
113
113
  react_1.default.createElement(style_guide_1.IconButton, { as: "a", href: `https://doi.org/${formik.values.DOI}`, target: '_blank' },
114
114
  react_1.default.createElement(style_guide_1.LinkIcon, null)),
115
- react_1.default.createElement(styled_components_1.DeleteButton, { defaultColor: true, disabled: !showDelete, "data-tooltip-id": showDelete ? '' : 'delete-button-tooltip', onClick: () => setShowDeleteDialog(true) },
116
- react_1.default.createElement(style_guide_1.DeleteIcon, null)),
117
- react_1.default.createElement(style_guide_1.Tooltip, { id: "delete-button-tooltip", place: "bottom" }, "Unable to delete because the item is used in the document")),
115
+ react_1.default.createElement(styled_components_1.DeleteButton, { defaultColor: true, disabled: !showDelete, "data-tooltip-content": "Unable to delete because the item is used in the document", "data-tooltip-hidden": showDelete, onClick: () => setShowDeleteDialog(true) },
116
+ react_1.default.createElement(style_guide_1.DeleteIcon, null))),
118
117
  react_1.default.createElement(style_guide_1.ButtonGroup, null,
119
118
  react_1.default.createElement(style_guide_1.SecondaryButton, { onClick: onCancel }, "Cancel"),
120
119
  react_1.default.createElement(style_guide_1.PrimaryButton, { type: "submit", disabled: !formik.isValid || !formik.dirty }, "Save"))),
@@ -247,9 +247,8 @@ const ReferencesModal = ({ isOpen, onCancel, items, item, citationCounts, onSave
247
247
  react_1.default.createElement(ReferencesInnerWrapper, null, items.slice(startIndex, endIndex + 1).map((item) => (react_1.default.createElement(ReferenceButton, { key: item.id, id: item.id, className: isSelected(item) ? 'selected' : '', onClick: () => handleItemClick(item), ref: isSelected(item) ? selectionRef : null },
248
248
  react_1.default.createElement(IconContainer, null,
249
249
  react_1.default.createElement(style_guide_1.CitationCountIcon, null),
250
- (citationCounts.get(item.id) || 0) > 0 ? (react_1.default.createElement(CitationCount, { "data-tooltip-id": "citation-count-tooltip" }, citationCounts.get(item.id))) : (react_1.default.createElement(CitationCount, { className: "unused" }, "0"))),
251
- react_1.default.createElement(ReferenceLine_1.ReferenceLine, { item: item }))))),
252
- react_1.default.createElement(style_guide_1.Tooltip, { id: "citation-count-tooltip", place: "bottom" }, "Number of times used in the document"))),
250
+ (citationCounts.get(item.id) || 0) > 0 ? (react_1.default.createElement(CitationCount, { "data-tooltip-content": "Number of times used in the document" }, citationCounts.get(item.id))) : (react_1.default.createElement(CitationCount, { className: "unused" }, "0"))),
251
+ react_1.default.createElement(ReferenceLine_1.ReferenceLine, { item: item }))))))),
253
252
  react_1.default.createElement(style_guide_1.ScrollableModalContent, null, selection && (react_1.default.createElement(ReferenceForm_1.ReferenceForm, { values: normalize(selection), showDelete: !citationCounts.get(selection.id) &&
254
253
  isNewItem(selection, ['id', 'type']), onChange: handleChange, onCancel: onCancel, onDelete: handleDelete, onSave: handleSave, actionsRef: actionsRef })))))));
255
254
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MATHJAX_VERSION = exports.VERSION = void 0;
4
- exports.VERSION = '3.7.28';
4
+ exports.VERSION = '3.8.0';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -1,4 +1,4 @@
1
- import { AffiliationIcon, CrclTickAnimation, DeleteIcon, Tooltip, } from '@manuscripts/style-guide';
1
+ import { AffiliationIcon, CrclTickAnimation, DeleteIcon, } from '@manuscripts/style-guide';
2
2
  import React, { useRef } from 'react';
3
3
  import styled from 'styled-components';
4
4
  const AffiliationContainer = styled.div `
@@ -75,7 +75,6 @@ export const AffiliationItem = ({ affiliation, isSelected, onClick, onDelete, sh
75
75
  affiliation.country ? ', ' : '')),
76
76
  affiliation.country && React.createElement(React.Fragment, null, affiliation.country))),
77
77
  showSuccessIcon && (React.createElement(CrclTickAnimation, { size: 36, style: { position: 'absolute', left: '10px' } })),
78
- isSelected && (React.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-id": 'delete-button-tooltip' },
79
- React.createElement(DeleteIcon, { fill: '#6E6E6E' }),
80
- React.createElement(Tooltip, { id: 'delete-button-tooltip', place: "bottom" }, 'Delete')))));
78
+ isSelected && (React.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-content": "Delete" },
79
+ React.createElement(DeleteIcon, { fill: '#6E6E6E' })))));
81
80
  };
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Avatar, CorrespondingAuthorIcon, CrclTickAnimation, DeleteIcon, DraggableIcon, Tooltip, } from '@manuscripts/style-guide';
16
+ import { Avatar, CorrespondingAuthorIcon, CrclTickAnimation, DeleteIcon, DraggableIcon, } from '@manuscripts/style-guide';
17
17
  import React, { useRef, useState } from 'react';
18
18
  import { useDrag, useDrop } from 'react-dnd';
19
19
  import styled from 'styled-components';
@@ -162,7 +162,6 @@ export const DraggableAuthor = React.memo(({ author, isSelected, onClick, onDele
162
162
  React.createElement(AuthorNotes, { "data-cy": "author-notes" }, author.isCorresponding && (React.createElement(AuthorBadge, null,
163
163
  React.createElement(CorrespondingAuthorIcon, null))))),
164
164
  React.createElement(AuthorName, { "data-cy": "author-name" }, authorLabel(author)),
165
- isSelected && (React.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-id": 'delete-button-tooltip' },
166
- React.createElement(DeleteIcon, { fill: '#6E6E6E' }),
167
- React.createElement(Tooltip, { id: 'delete-button-tooltip', place: "bottom" }, 'Delete')))));
165
+ isSelected && (React.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-content": "Delete" },
166
+ React.createElement(DeleteIcon, { fill: '#6E6E6E' })))));
168
167
  });
@@ -58,38 +58,24 @@ export const ImportBibliographyModal = ({ onCancel, onSave }) => {
58
58
  React.createElement(ModalBody, null,
59
59
  React.createElement(ModalTitle, null, "Import Bibliography"),
60
60
  React.createElement("p", null,
61
- React.createElement(SpanWithExample, { "data-tooltip-id": "example_bibtex" }, "BibTex"),
61
+ React.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": exampleBibtex, "data-tool": true }, "BibTex"),
62
62
  ",",
63
63
  ' ',
64
- React.createElement(SpanWithExample, { "data-tooltip-id": "example_pubmed" }, "PubMed"),
64
+ React.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": examplePubmed }, "PubMed"),
65
65
  ",",
66
66
  ' ',
67
- React.createElement(SpanWithExample, { "data-tooltip-id": "example_ris" }, "RIS"),
67
+ React.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": exampleRis }, "RIS"),
68
68
  ",",
69
69
  ' ',
70
- React.createElement(SpanWithExample, { "data-tooltip-id": "example_enw" }, "ENW"),
70
+ React.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": exampleEnw }, "ENW"),
71
71
  ' ',
72
72
  "and",
73
73
  ' ',
74
- React.createElement(SpanWithExample, { "data-tooltip-id": "example_doi" }, "DOI"),
74
+ React.createElement(SpanWithExample, { "data-tooltip-id": "import-example-tooltip", "data-tooltip-content": exampleDoi }, "DOI"),
75
75
  ' ',
76
76
  "formats are supported"),
77
77
  React.createElement(ImportBibliographyForm, { onCancel: handleCancel, onSave: handleSave }),
78
- React.createElement(Example, { id: "example_bibtex", place: "bottom" },
79
- React.createElement("div", null,
80
- React.createElement("pre", null, exampleBibtex))),
81
- React.createElement(Example, { id: "example_pubmed", place: "bottom" },
82
- React.createElement("div", null,
83
- React.createElement("pre", null, examplePubmed))),
84
- React.createElement(Example, { id: "example_ris", place: "bottom" },
85
- React.createElement("div", null,
86
- React.createElement("pre", null, exampleRis))),
87
- React.createElement(Example, { id: "example_enw", place: "bottom" },
88
- React.createElement("div", null,
89
- React.createElement("pre", null, exampleEnw))),
90
- React.createElement(Example, { id: "example_doi", place: "bottom" },
91
- React.createElement("div", null,
92
- React.createElement("pre", null, exampleDoi)))))));
78
+ React.createElement(Example, { id: "import-example-tooltip", place: "bottom", render: (s) => (React.createElement("pre", null, s.content)) })))));
93
79
  };
94
80
  const ModalBody = styled.div `
95
81
  box-sizing: border-box;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { AddAuthorIcon, ButtonGroup, Category, DeleteIcon, Dialog, IconButton, LinkIcon, PrimaryButton, SecondaryButton, SelectField, Tooltip, } from '@manuscripts/style-guide';
16
+ import { AddAuthorIcon, ButtonGroup, Category, DeleteIcon, Dialog, IconButton, LinkIcon, PrimaryButton, SecondaryButton, SelectField, } from '@manuscripts/style-guide';
17
17
  import { Field, FieldArray, Formik } from 'formik';
18
18
  import React, { useEffect, useRef, useState } from 'react';
19
19
  import { bibliographyItemTypes } from '../../../lib/references';
@@ -76,9 +76,8 @@ export const ReferenceForm = ({ values, showDelete, onChange, onDelete, onCancel
76
76
  React.createElement(ButtonGroup, null,
77
77
  React.createElement(IconButton, { as: "a", href: `https://doi.org/${formik.values.DOI}`, target: '_blank' },
78
78
  React.createElement(LinkIcon, null)),
79
- React.createElement(DeleteButton, { defaultColor: true, disabled: !showDelete, "data-tooltip-id": showDelete ? '' : 'delete-button-tooltip', onClick: () => setShowDeleteDialog(true) },
80
- React.createElement(DeleteIcon, null)),
81
- React.createElement(Tooltip, { id: "delete-button-tooltip", place: "bottom" }, "Unable to delete because the item is used in the document")),
79
+ React.createElement(DeleteButton, { defaultColor: true, disabled: !showDelete, "data-tooltip-content": "Unable to delete because the item is used in the document", "data-tooltip-hidden": showDelete, onClick: () => setShowDeleteDialog(true) },
80
+ React.createElement(DeleteIcon, null))),
82
81
  React.createElement(ButtonGroup, null,
83
82
  React.createElement(SecondaryButton, { onClick: onCancel }, "Cancel"),
84
83
  React.createElement(PrimaryButton, { type: "submit", disabled: !formik.isValid || !formik.dirty }, "Save"))),
@@ -1,4 +1,4 @@
1
- import { Category, CitationCountIcon, CloseButton, Dialog, ModalBody, ModalContainer, ModalHeader, ModalSidebar, ModalSidebarHeader, ModalSidebarTitle, ScrollableModalContent, SidebarContent, StyledModal, Tooltip, useScrollDetection, } from '@manuscripts/style-guide';
1
+ import { Category, CitationCountIcon, CloseButton, Dialog, ModalBody, ModalContainer, ModalHeader, ModalSidebar, ModalSidebarHeader, ModalSidebarTitle, ScrollableModalContent, SidebarContent, StyledModal, useScrollDetection, } from '@manuscripts/style-guide';
2
2
  import { isEqual } from 'lodash';
3
3
  import React, { useEffect, useRef, useState } from 'react';
4
4
  import styled from 'styled-components';
@@ -208,9 +208,8 @@ export const ReferencesModal = ({ isOpen, onCancel, items, item, citationCounts,
208
208
  React.createElement(ReferencesInnerWrapper, null, items.slice(startIndex, endIndex + 1).map((item) => (React.createElement(ReferenceButton, { key: item.id, id: item.id, className: isSelected(item) ? 'selected' : '', onClick: () => handleItemClick(item), ref: isSelected(item) ? selectionRef : null },
209
209
  React.createElement(IconContainer, null,
210
210
  React.createElement(CitationCountIcon, null),
211
- (citationCounts.get(item.id) || 0) > 0 ? (React.createElement(CitationCount, { "data-tooltip-id": "citation-count-tooltip" }, citationCounts.get(item.id))) : (React.createElement(CitationCount, { className: "unused" }, "0"))),
212
- React.createElement(ReferenceLine, { item: item }))))),
213
- React.createElement(Tooltip, { id: "citation-count-tooltip", place: "bottom" }, "Number of times used in the document"))),
211
+ (citationCounts.get(item.id) || 0) > 0 ? (React.createElement(CitationCount, { "data-tooltip-content": "Number of times used in the document" }, citationCounts.get(item.id))) : (React.createElement(CitationCount, { className: "unused" }, "0"))),
212
+ React.createElement(ReferenceLine, { item: item }))))))),
214
213
  React.createElement(ScrollableModalContent, null, selection && (React.createElement(ReferenceForm, { values: normalize(selection), showDelete: !citationCounts.get(selection.id) &&
215
214
  isNewItem(selection, ['id', 'type']), onChange: handleChange, onCancel: onCancel, onDelete: handleDelete, onSave: handleSave, actionsRef: actionsRef })))))));
216
215
  };
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.7.28';
1
+ export const VERSION = '3.8.0';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.7.28";
1
+ export declare const VERSION = "3.8.0";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/body-editor",
3
3
  "description": "Prosemirror components for editing and viewing manuscripts",
4
- "version": "3.7.28",
4
+ "version": "3.8.0",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -38,9 +38,9 @@
38
38
  "@citation-js/plugin-ris": "0.7.18",
39
39
  "@iarna/word-count": "1.1.2",
40
40
  "@manuscripts/json-schema": "2.2.12",
41
- "@manuscripts/style-guide": "3.3.15",
41
+ "@manuscripts/style-guide": "3.4.0",
42
42
  "@manuscripts/track-changes-plugin": "2.2.3",
43
- "@manuscripts/transform": "4.3.13",
43
+ "@manuscripts/transform": "4.3.14",
44
44
  "@popperjs/core": "2.11.8",
45
45
  "citeproc": "2.4.63",
46
46
  "codemirror": "5.65.19",