@manuscripts/body-editor 3.12.2 → 3.12.4

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.
Files changed (65) hide show
  1. package/dist/cjs/components/affiliations/AffiliationItem.js +7 -11
  2. package/dist/cjs/components/affiliations/AffiliationList.js +3 -5
  3. package/dist/cjs/components/affiliations/AffiliationsModal.js +13 -4
  4. package/dist/cjs/components/authors/AuthorList.js +4 -2
  5. package/dist/cjs/components/authors/AuthorsModal.js +10 -3
  6. package/dist/cjs/components/authors/DraggableAuthor.js +7 -11
  7. package/dist/cjs/components/awards/AwardForm.js +108 -100
  8. package/dist/cjs/components/hooks/use-debounce.js +15 -0
  9. package/dist/cjs/components/modal-drawer/GenericDrawerGroup.js +1 -0
  10. package/dist/cjs/components/references/CitationEditor.js +6 -7
  11. package/dist/cjs/components/references/ImportBibliographyForm.js +12 -3
  12. package/dist/cjs/components/references/ReferenceForm/PersonDropDown.js +1 -1
  13. package/dist/cjs/components/references/ReferenceForm/styled-components.js +12 -3
  14. package/dist/cjs/components/references/ReferenceSearch.js +2 -2
  15. package/dist/cjs/components/references/ReferenceSearchResults.js +58 -11
  16. package/dist/cjs/components/references/ReferenceSearchSection.js +3 -11
  17. package/dist/cjs/components/references/ReferencesModal.js +5 -4
  18. package/dist/cjs/components/toolbar/InsertTableDialog.js +11 -3
  19. package/dist/cjs/components/views/CrossReferenceItems.js +8 -14
  20. package/dist/cjs/components/views/FootnotesSelector.js +6 -6
  21. package/dist/cjs/components/views/InsertSpecialCharacter.js +24 -10
  22. package/dist/cjs/components/views/LinkForm.js +8 -1
  23. package/dist/cjs/lib/popper.js +4 -2
  24. package/dist/cjs/versions.js +1 -1
  25. package/dist/cjs/views/cross_reference_editable.js +1 -0
  26. package/dist/cjs/views/equation_editable.js +6 -0
  27. package/dist/cjs/views/footnote.js +6 -6
  28. package/dist/cjs/views/inline_equation_editable.js +6 -0
  29. package/dist/cjs/views/inline_footnote.js +1 -0
  30. package/dist/es/components/affiliations/AffiliationItem.js +8 -12
  31. package/dist/es/components/affiliations/AffiliationList.js +3 -5
  32. package/dist/es/components/affiliations/AffiliationsModal.js +14 -5
  33. package/dist/es/components/authors/AuthorList.js +4 -2
  34. package/dist/es/components/authors/AuthorsModal.js +11 -4
  35. package/dist/es/components/authors/DraggableAuthor.js +8 -12
  36. package/dist/es/components/awards/AwardForm.js +110 -102
  37. package/dist/es/components/hooks/use-debounce.js +15 -1
  38. package/dist/es/components/modal-drawer/GenericDrawerGroup.js +2 -1
  39. package/dist/es/components/references/CitationEditor.js +7 -8
  40. package/dist/es/components/references/ImportBibliographyForm.js +14 -5
  41. package/dist/es/components/references/ReferenceForm/PersonDropDown.js +1 -1
  42. package/dist/es/components/references/ReferenceForm/styled-components.js +13 -4
  43. package/dist/es/components/references/ReferenceSearch.js +3 -3
  44. package/dist/es/components/references/ReferenceSearchResults.js +26 -12
  45. package/dist/es/components/references/ReferenceSearchSection.js +4 -12
  46. package/dist/es/components/references/ReferencesModal.js +6 -5
  47. package/dist/es/components/toolbar/InsertTableDialog.js +11 -3
  48. package/dist/es/components/views/CrossReferenceItems.js +9 -15
  49. package/dist/es/components/views/FootnotesSelector.js +7 -7
  50. package/dist/es/components/views/InsertSpecialCharacter.js +25 -11
  51. package/dist/es/components/views/LinkForm.js +9 -2
  52. package/dist/es/lib/popper.js +4 -2
  53. package/dist/es/versions.js +1 -1
  54. package/dist/es/views/cross_reference_editable.js +1 -0
  55. package/dist/es/views/equation_editable.js +6 -0
  56. package/dist/es/views/footnote.js +6 -6
  57. package/dist/es/views/inline_equation_editable.js +6 -0
  58. package/dist/es/views/inline_footnote.js +1 -0
  59. package/dist/types/components/hooks/use-debounce.d.ts +1 -0
  60. package/dist/types/components/references/ReferenceForm/styled-components.d.ts +11 -1
  61. package/dist/types/components/references/ReferenceSearchResults.d.ts +20 -2
  62. package/dist/types/versions.d.ts +1 -1
  63. package/dist/types/views/footnote.d.ts +2 -2
  64. package/package.json +2 -2
  65. package/styles/popper.css +2 -0
@@ -1,4 +1,4 @@
1
- import { Category, CitationCountIcon, CloseButton, Dialog, ModalBody, ModalContainer, ModalHeader, ModalSidebar, ModalSidebarHeader, ModalSidebarTitle, ScrollableModalContent, SidebarContent, StyledModal, useScrollDetection, } from '@manuscripts/style-guide';
1
+ import { Category, CitationCountIcon, CloseButton, Dialog, ModalBody, ModalContainer, ModalHeader, ModalSidebar, ModalSidebarHeader, ModalSidebarTitle, ScrollableModalContent, SidebarContent, StyledModal, useScrollDetection, withListNavigation, withNavigableListItem, } 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';
@@ -13,10 +13,11 @@ const ReferencesSidebar = styled(ModalSidebar) `
13
13
  const ReferencesSidebarContent = styled(SidebarContent) `
14
14
  overflow-y: auto;
15
15
  `;
16
- const ReferencesInnerWrapper = styled.div `
16
+ const ReferencesInnerWrapper = withListNavigation(styled.div `
17
17
  width: 100%;
18
- `;
19
- const ReferenceButton = styled.div `
18
+ padding: 12px 0;
19
+ `);
20
+ const ReferenceButton = withNavigableListItem(styled.div `
20
21
  cursor: pointer;
21
22
  display: flex;
22
23
  justify-content: flex-start;
@@ -43,7 +44,7 @@ const ReferenceButton = styled.div `
43
44
  padding: ${(props) => props.theme.grid.unit * 2}px;
44
45
  border-radius: 6px;
45
46
  }
46
- `;
47
+ `);
47
48
  const IconContainer = styled.div `
48
49
  padding-right: ${(props) => props.theme.grid.unit * 5}px;
49
50
  position: relative;
@@ -38,7 +38,15 @@ const OptionWrapper = styled.div `
38
38
  padding-top: ${(props) => props.theme.grid.unit * 2}px;
39
39
  padding-bottom: ${(props) => props.theme.grid.unit * 2}px;
40
40
 
41
- background-color: ${(props) => props.focused ? props.theme.colors.background.fifth : 'transparent'};
41
+ background-color: ${(props) => {
42
+ if (props.selected) {
43
+ return props.theme.colors.background.selected;
44
+ }
45
+ if (props.focused) {
46
+ return props.theme.colors.background.fifth;
47
+ }
48
+ return 'transparent';
49
+ }};
42
50
 
43
51
  &:hover {
44
52
  background-color: ${(props) => props.theme.colors.background.fifth};
@@ -59,8 +67,8 @@ export const InsertTableDialog = ({ state, dispatch, }) => {
59
67
  value: index + 1,
60
68
  label: `${index + 1}`,
61
69
  }));
62
- const OptionComponent = ({ innerProps, data, }) => {
63
- return (React.createElement(OptionWrapper, { ...innerProps, ref: null }, data.label));
70
+ const OptionComponent = ({ innerProps, data, innerRef, isFocused, isSelected, }) => {
71
+ return (React.createElement(OptionWrapper, { ...innerProps, ref: innerRef, focused: isFocused, selected: isSelected }, data.label));
64
72
  };
65
73
  const actions = {
66
74
  primary: {
@@ -13,30 +13,29 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ButtonGroup, PrimaryButton, SecondaryButton, TextArea, } from '@manuscripts/style-guide';
16
+ import { ButtonGroup, PrimaryButton, SecondaryButton, TextArea, withFocusTrap, withListNavigation, withNavigableListItem, } from '@manuscripts/style-guide';
17
17
  import React, { useEffect, useRef, useState } from 'react';
18
18
  import styled from 'styled-components';
19
- const Container = styled.div `
19
+ const Container = withFocusTrap(styled.div `
20
20
  padding: ${(props) => props.theme.grid.unit * 3}px
21
21
  ${(props) => props.theme.grid.unit * 4}px;
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  max-height: 60vh;
25
25
  overflow: hidden;
26
- `;
26
+ `);
27
27
  const Actions = styled.div `
28
28
  display: flex;
29
29
  align-items: center;
30
30
  justify-content: flex-end;
31
31
  flex-shrink: 0;
32
32
  `;
33
- const Items = styled.div `
33
+ const Items = withListNavigation(styled.div `
34
34
  flex: 1;
35
35
  overflow-y: auto;
36
- margin: ${(props) => props.theme.grid.unit * 4}px 0;
37
- `;
38
- const CrossReferenceItem = styled.div `
39
- position: relative;
36
+ padding: ${(props) => props.theme.grid.unit * 3}px;
37
+ `);
38
+ const CrossReferenceItem = withNavigableListItem(styled.div `
40
39
  cursor: pointer;
41
40
  padding: ${(props) => props.theme.grid.unit * 4}px;
42
41
  background-color: ${(props) => props.isSelected
@@ -48,17 +47,12 @@ const CrossReferenceItem = styled.div `
48
47
  ? props.theme.colors.brand.medium
49
48
  : props.theme.colors.border.secondary};
50
49
  border-width: 1px 0;
51
- margin-top: -1px;
52
50
  z-index: ${(props) => (props.isSelected ? '1' : '0')};
53
51
 
54
- &:first-child {
55
- margin-top: 0;
56
- }
57
-
58
52
  &:hover {
59
53
  background-color: ${(props) => props.theme.colors.background.selected};
60
54
  }
61
- `;
55
+ `);
62
56
  const Label = styled.span `
63
57
  color: ${(props) => props.theme.colors.text.primary};
64
58
  `;
@@ -105,7 +99,7 @@ export const CrossReferenceItems = ({ targets, handleSelect, handleCancel, curre
105
99
  }, [currentTargetId]);
106
100
  return (React.createElement(Container, null,
107
101
  React.createElement(Heading, null, "Insert Cross-reference"),
108
- React.createElement(Items, null, targets.length ? (targets.map((target) => (React.createElement(CrossReferenceItem, { key: target.id, isSelected: selectedItem === target.id, onMouseDown: () => setSelectedItem(target.id) },
102
+ React.createElement(Items, null, targets.length ? (targets.map((target) => (React.createElement(CrossReferenceItem, { key: target.id, isSelected: selectedItem === target.id, onClick: () => setSelectedItem(target.id) },
109
103
  React.createElement(DefaultLabelWrapper, null,
110
104
  React.createElement(Label, null, target.label),
111
105
  React.createElement(Caption, null, target.caption && ': ' + trimmedCaption(target.caption, 200))),
@@ -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 { AddedIcon, AddIcon, AddNewIcon, ButtonGroup, IconTextButton, PrimaryButton, SecondaryButton, } from '@manuscripts/style-guide';
16
+ import { AddedIcon, AddIcon, AddNewIcon, ButtonGroup, IconTextButton, PrimaryButton, SecondaryButton, withFocusTrap, withListNavigation, withNavigableListItem, } from '@manuscripts/style-guide';
17
17
  import React, { useState } from 'react';
18
18
  import styled from 'styled-components';
19
19
  import { isDeleted } from '../../lib/track-changes-utils';
@@ -29,10 +29,10 @@ const Actions = styled(ButtonGroup) `
29
29
  justify-content: space-between;
30
30
  padding: ${(props) => props.theme.grid.unit * 4}px;
31
31
  `;
32
- const Container = styled.div `
32
+ const Container = withFocusTrap(styled.div `
33
33
  flex: 1;
34
34
  font-family: ${(props) => props.theme.font.family.sans};
35
- `;
35
+ `);
36
36
  const AddNewFootnote = styled(ButtonGroup) `
37
37
  button {
38
38
  margin-right: ${(props) => props.theme.grid.unit * 8}px;
@@ -113,17 +113,17 @@ const Separator = styled.div `
113
113
  border-bottom: 1px solid #e2e2e2;
114
114
  margin: 4px 0;
115
115
  `;
116
- const NotesListContainer = styled.div `
116
+ const NotesListContainer = withListNavigation(styled.div `
117
117
  padding: ${(props) => props.theme.grid.unit * 6}px
118
118
  ${(props) => props.theme.grid.unit * 5}px;
119
119
  flex: 1;
120
120
  overflow-y: auto;
121
- `;
122
- const FootnoteItemContainer = styled.div `
121
+ `);
122
+ const FootnoteItemContainer = withNavigableListItem(styled.div `
123
123
  cursor: pointer;
124
124
  padding: ${(props) => props.theme.grid.unit * 2}px 0;
125
125
  display: flex;
126
- `;
126
+ `);
127
127
  const StatusIcon = styled.div `
128
128
  flex-shrink: 1;
129
129
  margin-right: ${(props) => props.theme.grid.unit * 3}px;
@@ -1,4 +1,4 @@
1
- import { ButtonGroup, CloseButton, IconButton, IconButtonGroup, ModalBody, ModalContainer, ModalHeader, ModalSidebar, ModalSidebarHeader, ModalSidebarTitle, PrimaryButton, SidebarContent, StyledModal, } from '@manuscripts/style-guide';
1
+ import { ButtonGroup, CloseButton, IconButton, IconButtonGroup, ModalBody, ModalContainer, ModalHeader, ModalSidebar, ModalSidebarHeader, ModalSidebarTitle, PrimaryButton, SidebarContent, StyledModal, withNavigableListItem, withListNavigation, } from '@manuscripts/style-guide';
2
2
  import React, { useState } from 'react';
3
3
  import Select from 'react-select';
4
4
  import styled from 'styled-components';
@@ -39,8 +39,8 @@ const InsertSpecialCharacterDialog = ({ view }) => {
39
39
  React.createElement(ButtonsContainer, null,
40
40
  React.createElement(PrimaryButton, { onClick: handleClose }, "Close")))))));
41
41
  };
42
- const OptionComponent = ({ innerProps, data, }) => {
43
- return (React.createElement(OptionWrapper, { ...innerProps, ref: null }, data.label));
42
+ const OptionComponent = ({ innerProps, innerRef, data, isFocused, isSelected, }) => {
43
+ return (React.createElement(OptionWrapper, { ...innerProps, ref: innerRef, focused: isFocused, selected: isSelected }, data.label));
44
44
  };
45
45
  const Container = styled(ModalContainer) `
46
46
  padding: 8px;
@@ -64,7 +64,15 @@ const OptionWrapper = styled.div `
64
64
  padding-top: ${(props) => props.theme.grid.unit * 2}px;
65
65
  padding-bottom: ${(props) => props.theme.grid.unit * 2}px;
66
66
 
67
- background-color: ${(props) => props.focused ? props.theme.colors.background.fifth : 'transparent'};
67
+ background-color: ${(props) => {
68
+ if (props.selected) {
69
+ return props.theme.colors.background.selected;
70
+ }
71
+ if (props.focused) {
72
+ return props.theme.colors.background.fifth;
73
+ }
74
+ return 'transparent';
75
+ }};
68
76
 
69
77
  &:hover {
70
78
  background-color: ${(props) => props.theme.colors.background.fifth};
@@ -74,19 +82,20 @@ const CharactersSetContainer = styled.div `
74
82
  flex: 1;
75
83
  overflow-y: scroll;
76
84
  margin: 18px 0;
77
- border: 1px solid #ddd;
85
+ padding: 8px;
78
86
  `;
79
- const CharactersSet = styled(IconButtonGroup) `
87
+ const CharactersSet = withListNavigation(styled(IconButtonGroup) `
80
88
  display: grid;
81
89
  grid-template-columns: repeat(auto-fit, minmax(28px, max-content));
82
- height: ${(props) => props.theme.grid.unit * 8}px;
83
- `;
84
- const Character = styled(IconButton) `
90
+ border: 1px solid #ddd;
91
+ `);
92
+ const Character = withNavigableListItem(styled(IconButton) `
85
93
  border-bottom: 1px solid #ddd;
86
94
  border-right: 1px solid #ddd;
87
95
  border-radius: unset;
88
96
 
89
- :hover {
97
+ :hover,
98
+ :focus {
90
99
  background-color: #f0f0f0 !important;
91
100
  }
92
101
 
@@ -96,7 +105,12 @@ const Character = styled(IconButton) `
96
105
  border-bottom: 1px solid #ddd !important;
97
106
  border-right: 1px solid #ddd !important;
98
107
  }
99
- `;
108
+
109
+ &&:not([disabled]):focus-visible {
110
+ outline: 1px solid ${(props) => props.theme.colors.outline.focus};
111
+ outline-offset: 2px;
112
+ }
113
+ `);
100
114
  export const openInsertSpecialCharacterDialog = (view) => {
101
115
  if (!view) {
102
116
  return;
@@ -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 { DeleteIcon, FormContainer, FormRow, Label, PrimaryButton, SecondaryButton, TextField, InputErrorText, } from '@manuscripts/style-guide';
16
+ import { DeleteIcon, FormContainer, FormRow, Label, PrimaryButton, SecondaryButton, TextField, InputErrorText, withFocusTrap, } from '@manuscripts/style-guide';
17
17
  import React, { useCallback, useState } from 'react';
18
18
  import styled from 'styled-components';
19
19
  import { allowedHref } from '../../lib/url';
@@ -44,6 +44,7 @@ const RemoveButton = styled(SecondaryButton) `
44
44
  export const Open = styled.a `
45
45
  display: inline-block;
46
46
  margin-left: ${(props) => props.theme.grid.unit * 2}px;
47
+ margin-top: 4px;
47
48
  text-transform: uppercase;
48
49
  color: inherit;
49
50
  font-size: ${(props) => props.theme.font.size.small};
@@ -53,7 +54,13 @@ export const Open = styled.a `
53
54
  content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
54
55
  margin-left: 4px;
55
56
  }
57
+
58
+ &&:not([disabled]):focus-visible {
59
+ outline: 2px solid ${(props) => props.theme.colors.outline.focus};
60
+ outline-offset: 3px;
61
+ }
56
62
  `;
63
+ const Form = withFocusTrap(styled.form ``);
57
64
  export const LinkForm = ({ onCancel, onRemove, onSave, value, }) => {
58
65
  const [href, setHref] = useState(value.href);
59
66
  const [text, setText] = useState(value.text);
@@ -93,7 +100,7 @@ export const LinkForm = ({ onCancel, onRemove, onSave, value, }) => {
93
100
  onSave({ href, text, title });
94
101
  }
95
102
  }, [href, text, title, onSave, validate]);
96
- return (React.createElement("form", { onSubmit: handleSubmit, noValidate: true },
103
+ return (React.createElement(Form, { onSubmit: handleSubmit, noValidate: true },
97
104
  React.createElement(FormContainer, null,
98
105
  React.createElement(FormRow, null,
99
106
  React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
@@ -37,11 +37,13 @@ export class PopperManager {
37
37
  this.triggerElement.focus();
38
38
  }
39
39
  };
40
+ const isMenu = contents.classList.contains('context-menu') ||
41
+ contents.classList.contains('menu');
40
42
  createKeyboardInteraction({
41
43
  container,
42
44
  additionalKeys: {
43
45
  Escape: closeAndRestoreFocus,
44
- Tab: closeAndRestoreFocus,
46
+ Tab: isMenu ? closeAndRestoreFocus : undefined,
45
47
  },
46
48
  });
47
49
  if (showArrow) {
@@ -113,7 +115,7 @@ export class PopperManager {
113
115
  return;
114
116
  }
115
117
  if (autoFocus) {
116
- const button = container.querySelector('button:not([disabled])');
118
+ const button = container.querySelector('button:not([disabled]), [tabindex]:not([tabindex="-1"])');
117
119
  button?.focus();
118
120
  }
119
121
  }
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.12.2';
1
+ export const VERSION = '3.12.4';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -39,6 +39,7 @@ export class CrossReferenceEditableView extends CrossReferenceView {
39
39
  currentCustomLabel: this.node.attrs.label,
40
40
  };
41
41
  this.popperContainer = ReactSubView(this.props, CrossReferenceItems, componentProps, this.node, this.getPos, this.view, ['cross-reference-editor']);
42
+ this.popperContainer.setAttribute('tabindex', '0');
42
43
  this.props.popper.show(this.dom, this.popperContainer, 'auto');
43
44
  };
44
45
  this.destroy = () => {
@@ -30,6 +30,12 @@ export class EquationEditableView extends EquationView {
30
30
  mode: 'stex',
31
31
  placeholder,
32
32
  autofocus: true,
33
+ extraKeys: {
34
+ Esc: () => {
35
+ this.props.popper.destroy();
36
+ this.view.focus();
37
+ },
38
+ },
33
39
  });
34
40
  input.on('changes', async () => {
35
41
  const contents = input.getValue();
@@ -35,15 +35,15 @@ export class FootnoteView extends BaseNodeView {
35
35
  this.dom.tabIndex = 0;
36
36
  this.contentDOM = document.createElement('div');
37
37
  this.contentDOM.classList.add('footnote-text');
38
- this.dom.addEventListener('mousedown', this.handleClick);
39
- this.dom.addEventListener('keydown', handleEnterKey(this.handleClick));
38
+ this.dom.addEventListener('mousedown', (e) => this.handleClick(e, false));
39
+ this.dom.addEventListener('keydown', handleEnterKey((e) => this.handleClick(e, true)));
40
40
  this.updateContents();
41
41
  };
42
- this.handleClick = (event) => {
42
+ this.handleClick = (event, fromKeyboard = false) => {
43
43
  const element = event.target;
44
44
  const item = element.closest('.footnote');
45
45
  if (item) {
46
- this.showContextMenu(item);
46
+ this.showContextMenu(item, fromKeyboard);
47
47
  }
48
48
  };
49
49
  this.handleMarkerClick = (e) => {
@@ -134,7 +134,7 @@ export class FootnoteView extends BaseNodeView {
134
134
  const fn = getFootnotesElementState(this.view.state, id);
135
135
  return { id, fn };
136
136
  }
137
- showContextMenu(element) {
137
+ showContextMenu(element, autoFocus) {
138
138
  this.props.popper.destroy();
139
139
  const can = this.props.getCapabilities();
140
140
  const { id, fn } = this.getFootnoteState();
@@ -156,7 +156,7 @@ export class FootnoteView extends BaseNodeView {
156
156
  });
157
157
  }
158
158
  this.contextMenu = ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu', 'footnote-context-menu']);
159
- this.props.popper.show(element, this.contextMenu, 'right-start');
159
+ this.props.popper.show(element, this.contextMenu, 'right-start', true, [], autoFocus);
160
160
  }
161
161
  }
162
162
  const getEffectiveChildCount = (node) => {
@@ -30,6 +30,12 @@ export class InlineEquationEditableView extends InlineEquationView {
30
30
  mode: 'stex',
31
31
  placeholder,
32
32
  autofocus: true,
33
+ extraKeys: {
34
+ Esc: () => {
35
+ this.props.popper.destroy();
36
+ this.view.focus();
37
+ },
38
+ },
33
39
  });
34
40
  input.on('changes', async () => {
35
41
  const contents = input.getValue();
@@ -98,6 +98,7 @@ export class InlineFootnoteView extends BaseNodeView {
98
98
  onInsert: this.handleInsert,
99
99
  };
100
100
  this.popperContainer = ReactSubView(this.props, FootnotesSelector, props, this.node, this.getPos, this.view, ['footnote-editor']);
101
+ this.popperContainer.setAttribute('tabindex', '0');
101
102
  this.props.popper.show(this.dom, this.popperContainer, 'auto', false);
102
103
  };
103
104
  this.initialise = () => {
@@ -14,3 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export declare const useDebounce: <T>(value: T, delay: number) => T;
17
+ export default function useDebounced<Input, Output>(fn: (arg: Input) => Promise<Output>, delay: number): (arg: Input) => Promise<Output>;
@@ -36,4 +36,14 @@ export declare const DropdownIndicator: import("styled-components").StyledCompon
36
36
  export declare const ToggleButton: import("styled-components").StyledComponent<"button", any, {
37
37
  isOpen: boolean;
38
38
  }, never>;
39
- export declare const RemoveButton: import("styled-components").StyledComponent<"button", any, {}, never>;
39
+ export declare const RemoveButton: import("styled-components").StyledComponent<"button", any, {
40
+ type: "button" | "submit" | "reset";
41
+ } & {
42
+ danger?: boolean;
43
+ disabled?: boolean;
44
+ mini?: boolean;
45
+ } & {
46
+ defaultColor?: boolean;
47
+ size?: number;
48
+ iconColor?: string;
49
+ }, "type">;
@@ -15,8 +15,26 @@
15
15
  */
16
16
  import { BibliographyItemAttrs } from '@manuscripts/transform';
17
17
  import React from 'react';
18
- export declare const ReferenceSearchResultsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
19
- export declare const ReferenceSearchResult: import("styled-components").StyledComponent<"div", any, {}, never>;
18
+ export declare const ReferenceSearchResultsContainer: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<Omit<{
19
+ [x: string]: any;
20
+ [x: number]: any;
21
+ [x: symbol]: any;
22
+ } & {
23
+ theme?: any;
24
+ } & {
25
+ as?: string | React.ComponentType<any> | undefined;
26
+ forwardedAs?: string | React.ComponentType<any> | undefined;
27
+ }, "ref"> & React.RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;
28
+ export declare const ReferenceSearchResult: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<Omit<{
29
+ [x: string]: any;
30
+ [x: number]: any;
31
+ [x: symbol]: any;
32
+ } & {
33
+ theme?: any;
34
+ } & {
35
+ as?: string | React.ComponentType<any> | undefined;
36
+ forwardedAs?: string | React.ComponentType<any> | undefined;
37
+ }, "ref"> & React.RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;
20
38
  export declare const ReferenceSearchResults: React.FC<{
21
39
  items: BibliographyItemAttrs[];
22
40
  total: number;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.12.2";
1
+ export declare const VERSION = "3.12.4";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
@@ -26,8 +26,8 @@ export declare class FootnoteView extends BaseNodeView<Trackable<FootnoteNode>>
26
26
  id: string;
27
27
  fn: import("../plugins/footnotes").FootnotesElementState | undefined;
28
28
  };
29
- showContextMenu(element: HTMLElement): void;
30
- handleClick: (event: Event) => void;
29
+ showContextMenu(element: HTMLElement, autoFocus: boolean): void;
30
+ handleClick: (event: Event, fromKeyboard?: boolean) => void;
31
31
  handleMarkerClick: (e?: Event) => void;
32
32
  handleDeleteClick: (e?: Event) => void;
33
33
  handleDelete: () => void;
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.12.2",
4
+ "version": "3.12.4",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -37,7 +37,7 @@
37
37
  "@citation-js/plugin-pubmed": "0.3.0",
38
38
  "@citation-js/plugin-ris": "0.7.18",
39
39
  "@iarna/word-count": "1.1.2",
40
- "@manuscripts/style-guide": "3.5.5",
40
+ "@manuscripts/style-guide": "3.5.6",
41
41
  "@manuscripts/track-changes-plugin": "2.3.8",
42
42
  "@manuscripts/transform": "4.3.27",
43
43
  "@popperjs/core": "2.11.8",
package/styles/popper.css CHANGED
@@ -245,6 +245,7 @@
245
245
 
246
246
  .popper .cross-reference-editor {
247
247
  position: relative;
248
+ outline: none;
248
249
  }
249
250
 
250
251
  .popper .cross-reference-editor,
@@ -272,6 +273,7 @@
272
273
  box-shadow: 0 4px 9px 0 rgba(84, 83, 83, 0.3);
273
274
  height: auto;
274
275
  width: 600px;
276
+ outline: none;
275
277
  }
276
278
 
277
279
  .popper .track-attrs-popper {