@manuscripts/body-editor 3.13.5 → 3.13.7
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/dist/cjs/components/LanguageDropdown/index.js +1 -1
- package/dist/cjs/components/affiliations/AffiliationForm.js +1 -1
- package/dist/cjs/components/affiliations/AffiliationItem.js +1 -1
- package/dist/cjs/components/authors/AuthorDetailsForm.js +4 -4
- package/dist/cjs/components/authors/DraggableAuthor.js +1 -1
- package/dist/cjs/components/awards/AwardForm.js +5 -5
- package/dist/cjs/components/awards/AwardModal.js +1 -1
- package/dist/cjs/components/outline/DraggableTree.js +1 -1
- package/dist/cjs/components/outline/Outline.js +2 -2
- package/dist/cjs/components/references/CitationEditor.js +4 -4
- package/dist/cjs/components/references/ImportBibliographyForm.js +2 -2
- package/dist/cjs/components/references/ImportBibliographyModal.js +1 -1
- package/dist/cjs/components/references/ReferenceForm/PersonDropDown.js +2 -2
- package/dist/cjs/components/references/ReferenceForm/ReferenceForm.js +2 -2
- package/dist/cjs/components/references/ReferenceForm/styled-components.js +5 -5
- package/dist/cjs/components/references/ReferencesModal.js +1 -1
- package/dist/cjs/components/toolbar/InsertEmbedDialog.js +1 -1
- package/dist/cjs/components/toolbar/InsertTableDialog.js +3 -3
- package/dist/cjs/components/toolbar/ListMenuItem.js +2 -2
- package/dist/cjs/components/toolbar/type-selector/OptionComponent.js +2 -2
- package/dist/cjs/components/views/CrossReferenceItems.js +4 -4
- package/dist/cjs/components/views/FigureDropdown.js +5 -5
- package/dist/cjs/components/views/InsertSpecialCharacter.js +7 -7
- package/dist/cjs/components/views/LinkForm.js +2 -2
- package/dist/cjs/components/views/TableCellContextMenu.js +2 -2
- package/dist/cjs/lib/__tests__/plugins.test.js +2 -1
- package/dist/cjs/testing/default-editor-data.js +2 -1
- package/dist/cjs/versions.js +1 -1
- package/dist/es/components/LanguageDropdown/index.js +1 -1
- package/dist/es/components/affiliations/AffiliationForm.js +1 -1
- package/dist/es/components/affiliations/AffiliationItem.js +1 -1
- package/dist/es/components/authors/AuthorDetailsForm.js +4 -4
- package/dist/es/components/authors/DraggableAuthor.js +1 -1
- package/dist/es/components/awards/AwardForm.js +5 -5
- package/dist/es/components/awards/AwardModal.js +1 -1
- package/dist/es/components/outline/DraggableTree.js +1 -1
- package/dist/es/components/outline/Outline.js +2 -2
- package/dist/es/components/references/CitationEditor.js +4 -4
- package/dist/es/components/references/ImportBibliographyForm.js +2 -2
- package/dist/es/components/references/ImportBibliographyModal.js +1 -1
- package/dist/es/components/references/ReferenceForm/PersonDropDown.js +2 -2
- package/dist/es/components/references/ReferenceForm/ReferenceForm.js +2 -2
- package/dist/es/components/references/ReferenceForm/styled-components.js +5 -5
- package/dist/es/components/references/ReferencesModal.js +1 -1
- package/dist/es/components/toolbar/InsertEmbedDialog.js +1 -1
- package/dist/es/components/toolbar/InsertTableDialog.js +3 -3
- package/dist/es/components/toolbar/ListMenuItem.js +2 -2
- package/dist/es/components/toolbar/type-selector/OptionComponent.js +2 -2
- package/dist/es/components/views/CrossReferenceItems.js +4 -4
- package/dist/es/components/views/FigureDropdown.js +5 -5
- package/dist/es/components/views/InsertSpecialCharacter.js +7 -7
- package/dist/es/components/views/LinkForm.js +2 -2
- package/dist/es/components/views/TableCellContextMenu.js +2 -2
- package/dist/es/lib/__tests__/plugins.test.js +2 -1
- package/dist/es/testing/default-editor-data.js +2 -1
- package/dist/es/versions.js +1 -1
- package/dist/types/components/ChangeHandlingForm.d.ts +1 -1
- package/dist/types/components/authors/AuthorDetailsForm.d.ts +7 -7
- package/dist/types/components/form/CreateModalStyles.d.ts +3 -3
- package/dist/types/components/form/UnsavedLabel.d.ts +2 -2
- package/dist/types/components/modal-drawer/GenericDrawerGroup.d.ts +6 -7
- package/dist/types/components/outline/Outline.d.ts +9 -9
- package/dist/types/components/references/CitationViewer.d.ts +2 -2
- package/dist/types/components/references/ReferenceForm/styled-components.d.ts +32 -35
- package/dist/types/components/references/ReferenceLine.d.ts +2 -2
- package/dist/types/components/references/ReferenceSearchResults.d.ts +2 -2
- package/dist/types/components/references/SearchInput.d.ts +1 -1
- package/dist/types/components/toolbar/ListMenuItem.d.ts +6 -6
- package/dist/types/components/toolbar/type-selector/styles.d.ts +1 -1
- package/dist/types/components/views/LinkForm.d.ts +1 -1
- package/dist/types/versions.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/LanguageDropdown/index.tsx +4 -4
- package/src/components/affiliations/AffiliationForm.tsx +1 -1
- package/src/components/affiliations/AffiliationItem.tsx +1 -1
- package/src/components/authors/AuthorDetailsForm.tsx +4 -4
- package/src/components/authors/DraggableAuthor.tsx +1 -1
- package/src/components/awards/AwardForm.tsx +8 -8
- package/src/components/awards/AwardModal.tsx +1 -1
- package/src/components/outline/DraggableTree.tsx +1 -1
- package/src/components/outline/Outline.tsx +3 -3
- package/src/components/references/CitationEditor.tsx +4 -4
- package/src/components/references/ImportBibliographyForm.tsx +3 -3
- package/src/components/references/ImportBibliographyModal.tsx +1 -1
- package/src/components/references/ReferenceForm/PersonDropDown.tsx +2 -2
- package/src/components/references/ReferenceForm/ReferenceForm.tsx +4 -4
- package/src/components/references/ReferenceForm/styled-components.ts +7 -7
- package/src/components/references/ReferencesModal.tsx +1 -1
- package/src/components/toolbar/InsertEmbedDialog.tsx +1 -1
- package/src/components/toolbar/InsertTableDialog.tsx +5 -5
- package/src/components/toolbar/ListMenuItem.tsx +3 -3
- package/src/components/toolbar/type-selector/OptionComponent.tsx +3 -3
- package/src/components/views/CrossReferenceItems.tsx +5 -5
- package/src/components/views/FigureDropdown.tsx +10 -10
- package/src/components/views/InsertSpecialCharacter.tsx +9 -9
- package/src/components/views/LinkForm.tsx +2 -2
- package/src/components/views/TableCellContextMenu.tsx +2 -2
- package/src/lib/__tests__/plugins.test.ts +2 -1
- package/src/testing/default-editor-data.ts +2 -1
- package/src/types/styled-components.d.ts +1 -1
- package/src/versions.ts +1 -1
|
@@ -50,22 +50,22 @@ const Items = withListNavigation(styled.div`
|
|
|
50
50
|
`)
|
|
51
51
|
|
|
52
52
|
const CrossReferenceItem = withNavigableListItem(styled.div<{
|
|
53
|
-
isSelected: boolean
|
|
53
|
+
$isSelected: boolean
|
|
54
54
|
}>`
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
padding: ${(props) => props.theme.grid.unit * 4}px;
|
|
57
57
|
background-color: ${(props) =>
|
|
58
|
-
props
|
|
58
|
+
props.$isSelected
|
|
59
59
|
? props.theme.colors.background.selected
|
|
60
60
|
: props.theme.colors.background.primary};
|
|
61
61
|
transition: background-color 0.1s;
|
|
62
62
|
border: solid
|
|
63
63
|
${(props) =>
|
|
64
|
-
props
|
|
64
|
+
props.$isSelected
|
|
65
65
|
? props.theme.colors.brand.medium
|
|
66
66
|
: props.theme.colors.border.secondary};
|
|
67
67
|
border-width: 1px 0;
|
|
68
|
-
z-index: ${(props) => (props
|
|
68
|
+
z-index: ${(props) => (props.$isSelected ? '1' : '0')};
|
|
69
69
|
|
|
70
70
|
&:hover {
|
|
71
71
|
background-color: ${(props) => props.theme.colors.background.selected};
|
|
@@ -151,7 +151,7 @@ export const CrossReferenceItems: React.FC<Props> = ({
|
|
|
151
151
|
targets.map((target) => (
|
|
152
152
|
<CrossReferenceItem
|
|
153
153
|
key={target.id}
|
|
154
|
-
isSelected={selectedItem === target.id}
|
|
154
|
+
$isSelected={selectedItem === target.id}
|
|
155
155
|
onClick={() => setSelectedItem(target.id)}
|
|
156
156
|
>
|
|
157
157
|
<DefaultLabelWrapper>
|
|
@@ -204,9 +204,9 @@ export const FigureOptions: React.FC<WrappedProps> = ({
|
|
|
204
204
|
</OptionsButton>
|
|
205
205
|
{isOpen && (
|
|
206
206
|
<OptionsDropdownList
|
|
207
|
-
direction={'right'}
|
|
208
|
-
width={128}
|
|
209
|
-
top={5}
|
|
207
|
+
$direction={'right'}
|
|
208
|
+
$width={128}
|
|
209
|
+
$top={5}
|
|
210
210
|
ref={dropdownRef}
|
|
211
211
|
>
|
|
212
212
|
{showReplace && isEmbedMode && (
|
|
@@ -319,9 +319,9 @@ const NestedDropdown: React.FC<{
|
|
|
319
319
|
</NestedListButton>
|
|
320
320
|
{isOpen && (
|
|
321
321
|
<NestedListDropdownList
|
|
322
|
-
direction={'right'}
|
|
323
|
-
moveLeft={moveLeft}
|
|
324
|
-
width={192}
|
|
322
|
+
$direction={'right'}
|
|
323
|
+
$moveLeft={moveLeft}
|
|
324
|
+
$width={192}
|
|
325
325
|
ref={nestedListRef}
|
|
326
326
|
onClick={(e) => {
|
|
327
327
|
toggleOpen()
|
|
@@ -376,8 +376,8 @@ const ListItemButton = styled(IconTextButton)`
|
|
|
376
376
|
justify-content: space-between;
|
|
377
377
|
align-items: center;
|
|
378
378
|
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
&:hover,
|
|
380
|
+
&:focus-visible {
|
|
381
381
|
background: #f2fbfc;
|
|
382
382
|
}
|
|
383
383
|
|
|
@@ -407,9 +407,9 @@ const NestedListButton = styled(ListItemButton)`
|
|
|
407
407
|
}
|
|
408
408
|
`
|
|
409
409
|
|
|
410
|
-
const NestedListDropdownList = styled(DropdownList)<{ moveLeft?: boolean }>`
|
|
410
|
+
const NestedListDropdownList = styled(DropdownList)<{ $moveLeft?: boolean }>`
|
|
411
411
|
top: 0;
|
|
412
|
-
${(props) => (props
|
|
412
|
+
${(props) => (props.$moveLeft && 'right: 30%;') || 'left: 100%;'}
|
|
413
413
|
`
|
|
414
414
|
|
|
415
415
|
const UploadButton = styled(IconTextButton)`
|
|
@@ -138,8 +138,8 @@ const OptionComponent: React.FC<OptionProps<OptionType, false>> = ({
|
|
|
138
138
|
<OptionWrapper
|
|
139
139
|
{...innerProps}
|
|
140
140
|
ref={innerRef}
|
|
141
|
-
focused={isFocused}
|
|
142
|
-
selected={isSelected}
|
|
141
|
+
$focused={isFocused}
|
|
142
|
+
$selected={isSelected}
|
|
143
143
|
>
|
|
144
144
|
{data.label}
|
|
145
145
|
</OptionWrapper>
|
|
@@ -168,16 +168,16 @@ const ButtonsContainer = styled(ButtonGroup)`
|
|
|
168
168
|
padding-top: ${(props) => props.theme.grid.unit * 5}px;
|
|
169
169
|
`
|
|
170
170
|
|
|
171
|
-
const OptionWrapper = styled.div<{ focused?: boolean; selected?: boolean }>`
|
|
171
|
+
const OptionWrapper = styled.div<{ $focused?: boolean; $selected?: boolean }>`
|
|
172
172
|
padding-left: ${(props) => props.theme.grid.unit * 4}px;
|
|
173
173
|
padding-top: ${(props) => props.theme.grid.unit * 2}px;
|
|
174
174
|
padding-bottom: ${(props) => props.theme.grid.unit * 2}px;
|
|
175
175
|
|
|
176
176
|
background-color: ${(props) => {
|
|
177
|
-
if (props
|
|
177
|
+
if (props.$selected) {
|
|
178
178
|
return props.theme.colors.background.selected
|
|
179
179
|
}
|
|
180
|
-
if (props
|
|
180
|
+
if (props.$focused) {
|
|
181
181
|
return props.theme.colors.background.fifth
|
|
182
182
|
}
|
|
183
183
|
return 'transparent'
|
|
@@ -206,13 +206,13 @@ const Character = withNavigableListItem(styled(IconButton)`
|
|
|
206
206
|
border-right: 1px solid #ddd;
|
|
207
207
|
border-radius: unset;
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
&:hover,
|
|
210
|
+
&:focus {
|
|
211
211
|
background-color: #f0f0f0 !important;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
&:active,
|
|
215
|
+
&:focus {
|
|
216
216
|
color: inherit !important;
|
|
217
217
|
border-bottom: 1px solid #ddd !important;
|
|
218
218
|
border-right: 1px solid #ddd !important;
|
|
@@ -165,7 +165,7 @@ export const LinkForm: React.FC<LinkFormProps> = ({
|
|
|
165
165
|
name={'href'}
|
|
166
166
|
value={href}
|
|
167
167
|
autoComplete={'off'}
|
|
168
|
-
error={!!errors.href}
|
|
168
|
+
$error={!!errors.href}
|
|
169
169
|
onChange={handleHrefChange}
|
|
170
170
|
/>
|
|
171
171
|
|
|
@@ -180,7 +180,7 @@ export const LinkForm: React.FC<LinkFormProps> = ({
|
|
|
180
180
|
name={'text'}
|
|
181
181
|
value={text}
|
|
182
182
|
autoComplete={'off'}
|
|
183
|
-
error={!!errors.text}
|
|
183
|
+
$error={!!errors.text}
|
|
184
184
|
onChange={handleTextChange}
|
|
185
185
|
/>
|
|
186
186
|
{errors.text && <InputErrorText>{errors.text}</InputErrorText>}
|
|
@@ -217,10 +217,10 @@ const ActionButton = styled(IconTextButton)`
|
|
|
217
217
|
padding: 8px 16px;
|
|
218
218
|
justify-content: flex-start;
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
&:hover {
|
|
221
221
|
background: #f2fbfc;
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
&:disabled {
|
|
224
224
|
color: #353535;
|
|
225
225
|
background-color: #ffffff;
|
|
226
226
|
opacity: 0.4;
|
|
@@ -30,6 +30,7 @@ import sectionCategories from '../../testing/section-categories.json'
|
|
|
30
30
|
import { PopperManager } from '../popper'
|
|
31
31
|
import { getMatchingDescendant } from '../utils'
|
|
32
32
|
import jsonDoc from './__fixtures__/doc.json'
|
|
33
|
+
import { defaultTheme } from '@manuscripts/style-guide'
|
|
33
34
|
const userProfile: UserProfile = {
|
|
34
35
|
_id: 'MPUserProfile:1',
|
|
35
36
|
userID: 'MPUser:1',
|
|
@@ -47,7 +48,7 @@ const buildProps = (doc: ActualManuscriptNode): EditorProps => ({
|
|
|
47
48
|
setComment: () => undefined,
|
|
48
49
|
setSelectedComment: () => undefined,
|
|
49
50
|
setEditorSelectedSuggestion: () => undefined,
|
|
50
|
-
theme:
|
|
51
|
+
theme: defaultTheme,
|
|
51
52
|
getFiles: () => [],
|
|
52
53
|
fileManagement: {
|
|
53
54
|
download: () => undefined, // eslint-disable-line @typescript-eslint/no-empty-function
|
|
@@ -26,6 +26,7 @@ import { PopperManager } from '../lib/popper'
|
|
|
26
26
|
import { defaultCapabilities } from './default-capabilities'
|
|
27
27
|
import emptyEditorDocJson from './empty-editor-doc.json'
|
|
28
28
|
import sectionCategories from './section-categories.json'
|
|
29
|
+
import { defaultTheme } from '@manuscripts/style-guide'
|
|
29
30
|
|
|
30
31
|
export const defaultEditorProps: EditorProps = {
|
|
31
32
|
attributes: {
|
|
@@ -45,7 +46,7 @@ export const defaultEditorProps: EditorProps = {
|
|
|
45
46
|
}),
|
|
46
47
|
// @ts-ignore
|
|
47
48
|
history: createBrowserHistory(),
|
|
48
|
-
theme:
|
|
49
|
+
theme: defaultTheme,
|
|
49
50
|
getFiles: () => [],
|
|
50
51
|
fileManagement: {
|
|
51
52
|
// @ts-ignore
|
package/src/versions.ts
CHANGED