@manuscripts/body-editor 3.18.0 → 3.18.2
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/references/CitationEditor.js +8 -34
- package/dist/cjs/components/views/FigureDropdown.js +30 -39
- package/dist/cjs/components/views/FootnotesSelector.js +4 -5
- package/dist/cjs/components/views/LinkForm.js +5 -4
- package/dist/cjs/components/views/TableCellContextMenu.js +15 -15
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/ReactSubView.js +4 -2
- package/dist/cjs/views/cross_reference.js +4 -9
- package/dist/cjs/views/cross_reference_editable.js +1 -15
- package/dist/es/components/references/CitationEditor.js +9 -35
- package/dist/es/components/views/FigureDropdown.js +31 -40
- package/dist/es/components/views/FootnotesSelector.js +5 -6
- package/dist/es/components/views/LinkForm.js +6 -5
- package/dist/es/components/views/TableCellContextMenu.js +16 -16
- package/dist/es/versions.js +1 -1
- package/dist/es/views/ReactSubView.js +4 -2
- package/dist/es/views/cross_reference.js +4 -9
- package/dist/es/views/cross_reference_editable.js +1 -15
- package/dist/types/versions.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/references/CitationEditor.tsx +14 -42
- package/src/components/views/FigureDropdown.tsx +48 -38
- package/src/components/views/FootnotesSelector.tsx +8 -9
- package/src/components/views/LinkForm.tsx +10 -7
- package/src/components/views/TableCellContextMenu.tsx +24 -10
- package/src/versions.ts +1 -1
- package/src/views/ReactSubView.tsx +13 -10
- package/src/views/cross_reference.ts +4 -13
- package/src/views/cross_reference_editable.ts +2 -16
|
@@ -13,7 +13,8 @@
|
|
|
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,
|
|
16
|
+
import { DeleteIcon, FormContainer, FormRow, Label, TextField, InputErrorText, withFocusTrap, } from '@manuscripts/style-guide';
|
|
17
|
+
import { Button } from '@manuscripts/style-guide/mui';
|
|
17
18
|
import React, { useCallback, useState } from 'react';
|
|
18
19
|
import styled from 'styled-components';
|
|
19
20
|
import { allowedHref } from '../../lib/url';
|
|
@@ -31,7 +32,7 @@ const ActionGroup = styled.span `
|
|
|
31
32
|
margin-right: 4px;
|
|
32
33
|
}
|
|
33
34
|
`;
|
|
34
|
-
const RemoveButton = styled(
|
|
35
|
+
const RemoveButton = styled(Button) `
|
|
35
36
|
display: flex;
|
|
36
37
|
justify-content: space-between;
|
|
37
38
|
align-items: center;
|
|
@@ -117,10 +118,10 @@ export const LinkForm = ({ onCancel, onRemove, onSave, value, }) => {
|
|
|
117
118
|
React.createElement(TextField, { type: 'text', name: 'title', value: title, autoComplete: 'off', required: false, onChange: (e) => setTitle(e.target.value) })),
|
|
118
119
|
React.createElement(Actions, null,
|
|
119
120
|
React.createElement(ActionGroup, null,
|
|
120
|
-
React.createElement(RemoveButton, { type: 'button', onClick: onRemove },
|
|
121
|
+
React.createElement(RemoveButton, { variant: "secondary", type: 'button', onClick: onRemove },
|
|
121
122
|
React.createElement(DeleteIcon, null),
|
|
122
123
|
React.createElement("span", null, "Remove Link"))),
|
|
123
124
|
React.createElement(ActionGroup, null,
|
|
124
|
-
React.createElement(
|
|
125
|
-
React.createElement(
|
|
125
|
+
React.createElement(Button, { variant: "secondary", type: 'button', onClick: onCancel }, "Cancel"),
|
|
126
|
+
React.createElement(Button, { type: 'submit' }, "Save"))))));
|
|
126
127
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Category, DeleteIcon, Dialog,
|
|
1
|
+
import { Category, DeleteIcon, Dialog, PlusIcon, } from '@manuscripts/style-guide';
|
|
2
|
+
import { Button } from '@manuscripts/style-guide/mui';
|
|
2
3
|
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
|
3
4
|
import { schema } from '@manuscripts/transform';
|
|
4
5
|
import { CellSelection, deleteColumn, deleteRow, mergeCells, selectedRect, splitCell, } from 'prosemirror-tables';
|
|
@@ -52,45 +53,45 @@ export const ContextMenu = ({ view, close, onCancelColumnDialog }) => {
|
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
return (React.createElement(MenuDropdownList, { className: 'table-ctx' },
|
|
55
|
-
React.createElement(ActionButton, { disabled: isHeaderCellSelected(view.state), onClick: () => runCommand(addRows('top')) },
|
|
56
|
+
React.createElement(ActionButton, { variant: "tertiary", disabled: isHeaderCellSelected(view.state), onClick: () => runCommand(addRows('top')) },
|
|
56
57
|
React.createElement(PlusIcon, null),
|
|
57
58
|
" Insert ",
|
|
58
59
|
rows,
|
|
59
60
|
" above"),
|
|
60
|
-
React.createElement(ActionButton, { onClick: () => runCommand(addRows('bottom')) },
|
|
61
|
+
React.createElement(ActionButton, { variant: "tertiary", onClick: () => runCommand(addRows('bottom')) },
|
|
61
62
|
React.createElement(PlusIcon, null),
|
|
62
63
|
" Insert ",
|
|
63
64
|
rows,
|
|
64
65
|
" below"),
|
|
65
|
-
React.createElement(ActionButton, { onClick: () => showWarningForTCPlugin(setColumnAction, () => addColumns('left')) },
|
|
66
|
+
React.createElement(ActionButton, { variant: "tertiary", onClick: () => showWarningForTCPlugin(setColumnAction, () => addColumns('left')) },
|
|
66
67
|
React.createElement(PlusIcon, null),
|
|
67
68
|
" Insert ",
|
|
68
69
|
columns,
|
|
69
70
|
" to the left"),
|
|
70
|
-
React.createElement(ActionButton, { onClick: () => showWarningForTCPlugin(setColumnAction, () => addColumns('right')) },
|
|
71
|
+
React.createElement(ActionButton, { variant: "tertiary", onClick: () => showWarningForTCPlugin(setColumnAction, () => addColumns('right')) },
|
|
71
72
|
React.createElement(PlusIcon, null),
|
|
72
73
|
" Insert ",
|
|
73
74
|
columns,
|
|
74
75
|
" to the right"),
|
|
75
76
|
React.createElement(Separator, null),
|
|
76
|
-
React.createElement(ActionButton, { disabled: count.rows !== 1, onClick: () => runCommand(addHeaderRow(headerPosition)) },
|
|
77
|
+
React.createElement(ActionButton, { variant: "tertiary", disabled: count.rows !== 1, onClick: () => runCommand(addHeaderRow(headerPosition)) },
|
|
77
78
|
React.createElement(PlusIcon, null),
|
|
78
79
|
" Insert header row ",
|
|
79
80
|
headerPosition),
|
|
80
81
|
React.createElement(Separator, null),
|
|
81
|
-
React.createElement(ActionButton, { onClick: () => showWarningForTCPlugin(setRowDeleteAction, () => deleteRow) },
|
|
82
|
+
React.createElement(ActionButton, { variant: "tertiary", onClick: () => showWarningForTCPlugin(setRowDeleteAction, () => deleteRow) },
|
|
82
83
|
React.createElement(GrayDeleteIcon, null),
|
|
83
84
|
" Delete",
|
|
84
85
|
isHeaderCellSelected(view.state) ? ' header ' : '',
|
|
85
86
|
" ",
|
|
86
87
|
rows),
|
|
87
|
-
React.createElement(ActionButton, { onClick: () => showWarningForTCPlugin(setColumnAction, () => deleteColumn) },
|
|
88
|
+
React.createElement(ActionButton, { variant: "tertiary", onClick: () => showWarningForTCPlugin(setColumnAction, () => deleteColumn) },
|
|
88
89
|
React.createElement(GrayDeleteIcon, null),
|
|
89
90
|
" Delete ",
|
|
90
91
|
columns),
|
|
91
92
|
(isCellSelectionMerged || isCellSelectionSplittable) && React.createElement(Separator, null),
|
|
92
|
-
isCellSelectionMerged && (React.createElement(ActionButton, { onClick: () => runCommand(mergeCells, true) }, "Merge cells")),
|
|
93
|
-
isCellSelectionSplittable && (React.createElement(ActionButton, { onClick: () => runCommand(splitCell, true) }, "Split cells")),
|
|
93
|
+
isCellSelectionMerged && (React.createElement(ActionButton, { variant: "tertiary", onClick: () => runCommand(mergeCells, true) }, "Merge cells")),
|
|
94
|
+
isCellSelectionSplittable && (React.createElement(ActionButton, { variant: "tertiary", onClick: () => runCommand(splitCell, true) }, "Split cells")),
|
|
94
95
|
React.createElement(TableChangeWarningDialog, { isOpen: !!rowDeleteAction, primaryAction: () => {
|
|
95
96
|
if (rowDeleteAction) {
|
|
96
97
|
runCommand(rowDeleteAction, true);
|
|
@@ -111,12 +112,11 @@ const MenuDropdownList = styled.div `
|
|
|
111
112
|
display: flex;
|
|
112
113
|
flex-direction: column;
|
|
113
114
|
`;
|
|
114
|
-
const ActionButton = styled(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
background: #f2fbfc;
|
|
115
|
+
const ActionButton = styled(Button) `
|
|
116
|
+
&& {
|
|
117
|
+
padding: 8px 16px;
|
|
118
|
+
justify-content: flex-start;
|
|
119
|
+
width: 100%;
|
|
120
120
|
}
|
|
121
121
|
&:disabled {
|
|
122
122
|
color: #353535;
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '3.18.
|
|
1
|
+
export const VERSION = '3.18.2';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { MuiThemeProvider, muiTheme } from '@manuscripts/style-guide/mui';
|
|
16
17
|
import React from 'react';
|
|
17
18
|
import { flushSync } from 'react-dom';
|
|
18
19
|
import { createRoot } from 'react-dom/client';
|
|
@@ -40,8 +41,9 @@ function createView(props, Component, componentProps, node, getPos, view, classN
|
|
|
40
41
|
}).setSelection(selection.map(tr.doc, tr.mapping));
|
|
41
42
|
view.dispatch(tr);
|
|
42
43
|
};
|
|
43
|
-
return (React.createElement(
|
|
44
|
-
React.createElement(
|
|
44
|
+
return (React.createElement(MuiThemeProvider, { theme: muiTheme },
|
|
45
|
+
React.createElement(ThemeProvider, { theme: props.theme },
|
|
46
|
+
React.createElement(Component, { nodeAttrs: node.attrs, setNodeAttrs: setNodeAttrs, viewProps: { node, view, getPos }, container: container, ...props, ...componentProps }))));
|
|
45
47
|
};
|
|
46
48
|
return Wrapped;
|
|
47
49
|
}
|
|
@@ -14,9 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { schema, } from '@manuscripts/transform';
|
|
17
|
-
import { findNodeByID } from '../lib/doc';
|
|
18
17
|
import { handleEnterKey } from '../lib/navigation-utils';
|
|
19
|
-
import { getSupplementDisplayLabel } from '../lib/supplements';
|
|
20
18
|
import { objectsKey } from '../plugins/objects';
|
|
21
19
|
import { BaseNodeView } from './base_node_view';
|
|
22
20
|
import { createNodeView } from './creators';
|
|
@@ -50,13 +48,10 @@ export class CrossReferenceView extends BaseNodeView {
|
|
|
50
48
|
const targets = objectsKey.getState(this.view.state);
|
|
51
49
|
const attrs = this.node.attrs;
|
|
52
50
|
const target = attrs.rids.length ? targets.get(attrs.rids[0]) : undefined;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
derivedLabel = getSupplementDisplayLabel(found.node, this.props.getFiles());
|
|
58
|
-
}
|
|
59
|
-
}
|
|
51
|
+
const isSupplement = target?.type === schema.nodes.supplement.name;
|
|
52
|
+
const derivedLabel = isSupplement
|
|
53
|
+
? target?.caption || target?.label || ''
|
|
54
|
+
: target?.label || '';
|
|
60
55
|
this.dom.textContent = attrs.label || derivedLabel;
|
|
61
56
|
this.dom.addEventListener('click', this.handleClick);
|
|
62
57
|
}
|
|
@@ -19,8 +19,6 @@ import { schema } from '@manuscripts/transform';
|
|
|
19
19
|
import { TextSelection } from 'prosemirror-state';
|
|
20
20
|
import { CrossReferenceItems } from '../components/views/CrossReferenceItems';
|
|
21
21
|
import { handleComment } from '../lib/comments';
|
|
22
|
-
import { findNodeByID } from '../lib/doc';
|
|
23
|
-
import { getSupplementDisplayLabel } from '../lib/supplements';
|
|
24
22
|
import { objectsKey } from '../plugins/objects';
|
|
25
23
|
import { createEditableNodeView } from './creators';
|
|
26
24
|
import { CrossReferenceView } from './cross_reference';
|
|
@@ -61,24 +59,12 @@ export class CrossReferenceEditableView extends CrossReferenceView {
|
|
|
61
59
|
};
|
|
62
60
|
this.getTargets = () => {
|
|
63
61
|
const targets = objectsKey.getState(this.view.state);
|
|
64
|
-
const files = this.props.getFiles();
|
|
65
|
-
const fileMap = new Map(files.map((f) => [f.id, f.name]));
|
|
66
62
|
const excludedTypes = [schema.nodes.image_element.name];
|
|
67
|
-
const supplement = schema.nodes.supplement.name;
|
|
68
63
|
return Array.from(targets.values()).reduce((acc, t) => {
|
|
69
64
|
if (excludedTypes.includes(t.type)) {
|
|
70
65
|
return acc;
|
|
71
66
|
}
|
|
72
|
-
|
|
73
|
-
const found = findNodeByID(this.view.state.doc, t.id);
|
|
74
|
-
const label = found
|
|
75
|
-
? getSupplementDisplayLabel(found.node, files)
|
|
76
|
-
: (fileMap.get(t.href) ?? t.href);
|
|
77
|
-
acc.push({ ...t, label, caption: '' });
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
acc.push(t);
|
|
81
|
-
}
|
|
67
|
+
acc.push(t);
|
|
82
68
|
return acc;
|
|
83
69
|
}, []);
|
|
84
70
|
};
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.18.
|
|
1
|
+
export declare const VERSION = "3.18.2";
|
|
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.18.
|
|
4
|
+
"version": "3.18.2",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"@citation-js/plugin-pubmed": "0.3.0",
|
|
42
42
|
"@citation-js/plugin-ris": "0.7.18",
|
|
43
43
|
"@iarna/word-count": "1.1.2",
|
|
44
|
-
"@manuscripts/style-guide": "3.7.
|
|
44
|
+
"@manuscripts/style-guide": "3.7.3",
|
|
45
45
|
"@manuscripts/track-changes-plugin": "2.4.0",
|
|
46
|
-
"@manuscripts/transform": "4.5.
|
|
46
|
+
"@manuscripts/transform": "4.5.6",
|
|
47
47
|
"@popperjs/core": "2.11.8",
|
|
48
48
|
"citeproc": "2.4.63",
|
|
49
49
|
"codemirror": "5.65.19",
|
|
@@ -19,11 +19,9 @@ import {
|
|
|
19
19
|
DeleteSolidIcon,
|
|
20
20
|
Dialog,
|
|
21
21
|
EditIcon,
|
|
22
|
-
IconButton,
|
|
23
|
-
PrimaryButton,
|
|
24
|
-
SecondaryButton,
|
|
25
22
|
withFocusTrap,
|
|
26
23
|
} from '@manuscripts/style-guide'
|
|
24
|
+
import { Button, IconButton } from '@manuscripts/style-guide/mui'
|
|
27
25
|
import {
|
|
28
26
|
BibliographyItemAttrs,
|
|
29
27
|
generateNodeID,
|
|
@@ -46,35 +44,6 @@ const CitedItemActions = styled.div`
|
|
|
46
44
|
display: flex;
|
|
47
45
|
align-items: center;
|
|
48
46
|
margin-left: 12px;
|
|
49
|
-
|
|
50
|
-
svg.remove-icon {
|
|
51
|
-
color: #6e6e6e;
|
|
52
|
-
}
|
|
53
|
-
`
|
|
54
|
-
|
|
55
|
-
const ActionButton = styled(IconButton).attrs({
|
|
56
|
-
$size: 24,
|
|
57
|
-
})`
|
|
58
|
-
&:disabled {
|
|
59
|
-
background-color: transparent !important;
|
|
60
|
-
border-color: transparent !important;
|
|
61
|
-
color: rgb(255, 255, 255);
|
|
62
|
-
path,
|
|
63
|
-
g {
|
|
64
|
-
fill: ${(props) => props.theme.colors.background.tertiary} !important;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
&:not(:disabled):focus,
|
|
68
|
-
&:not(:disabled):hover {
|
|
69
|
-
path,
|
|
70
|
-
g {
|
|
71
|
-
fill: ${(props) => props.theme.colors.brand.medium} !important;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
`
|
|
75
|
-
|
|
76
|
-
const EditReferenceButton = styled(ActionButton)`
|
|
77
|
-
margin-right: ${(props) => props.theme.grid.unit * 3}px;
|
|
78
47
|
`
|
|
79
48
|
|
|
80
49
|
const Actions = styled(ButtonGroup)`
|
|
@@ -261,31 +230,34 @@ export const CitationEditor: React.FC<CitationEditorProps> = ({
|
|
|
261
230
|
/>
|
|
262
231
|
<CitedItems>
|
|
263
232
|
{cited.map((item) => (
|
|
264
|
-
<CitedItem key={item.id}>
|
|
233
|
+
<CitedItem key={item.id} data-cy="cited-item">
|
|
265
234
|
<ReferenceLine item={item} />
|
|
266
235
|
<CitedItemActions>
|
|
267
|
-
<
|
|
236
|
+
<IconButton
|
|
268
237
|
value={item.id}
|
|
269
238
|
disabled={!canEdit}
|
|
270
239
|
onClick={() => setEditingForm({ show: true, item: item })}
|
|
271
240
|
>
|
|
272
|
-
<EditIcon />
|
|
273
|
-
</
|
|
274
|
-
<
|
|
241
|
+
<EditIcon fill={'currentColor'} />
|
|
242
|
+
</IconButton>
|
|
243
|
+
<IconButton
|
|
244
|
+
data-cy="remove-citation"
|
|
275
245
|
disabled={!canEdit}
|
|
276
246
|
onClick={() => setDeleteDialog({ show: true, id: item.id })}
|
|
277
247
|
>
|
|
278
|
-
<DeleteSolidIcon
|
|
279
|
-
</
|
|
248
|
+
<DeleteSolidIcon fill={'currentColor'} />
|
|
249
|
+
</IconButton>
|
|
280
250
|
</CitedItemActions>
|
|
281
251
|
</CitedItem>
|
|
282
252
|
))}
|
|
283
253
|
</CitedItems>
|
|
284
254
|
<Actions>
|
|
285
|
-
<
|
|
286
|
-
|
|
255
|
+
<Button variant="secondary" onClick={onCancel}>
|
|
256
|
+
Done
|
|
257
|
+
</Button>
|
|
258
|
+
<Button disabled={!canEdit} onClick={() => setSearching(true)}>
|
|
287
259
|
Add Citation
|
|
288
|
-
</
|
|
260
|
+
</Button>
|
|
289
261
|
</Actions>
|
|
290
262
|
</Container>
|
|
291
263
|
)
|
|
@@ -17,12 +17,11 @@ import {
|
|
|
17
17
|
DotsIcon,
|
|
18
18
|
DropdownList,
|
|
19
19
|
getFileIcon,
|
|
20
|
-
IconButton,
|
|
21
|
-
IconTextButton,
|
|
22
20
|
TriangleCollapsedIcon,
|
|
23
21
|
UploadIcon,
|
|
24
22
|
useDropdown,
|
|
25
23
|
} from '@manuscripts/style-guide'
|
|
24
|
+
import { Button, IconButton } from '@manuscripts/style-guide/mui'
|
|
26
25
|
import { FigureNode } from '@manuscripts/transform'
|
|
27
26
|
import { Node as ManuscriptNode } from 'prosemirror-model'
|
|
28
27
|
import React, { SyntheticEvent, useCallback, useEffect, useRef } from 'react'
|
|
@@ -140,6 +139,7 @@ function getOtherFiles(
|
|
|
140
139
|
|
|
141
140
|
type WrappedProps = FigureOptionsProps & ReactViewComponentProps<FigureNode>
|
|
142
141
|
|
|
142
|
+
// TODO: To be refactored with the new dropdown component
|
|
143
143
|
export const FigureOptions: React.FC<WrappedProps> = ({
|
|
144
144
|
can,
|
|
145
145
|
getDoc,
|
|
@@ -221,7 +221,10 @@ export const FigureOptions: React.FC<WrappedProps> = ({
|
|
|
221
221
|
ref={dropdownRef}
|
|
222
222
|
>
|
|
223
223
|
{showReplace && isEmbedMode && (
|
|
224
|
-
<ListItemButton
|
|
224
|
+
<ListItemButton
|
|
225
|
+
variant="tertiary"
|
|
226
|
+
onClick={() => onReplaceEmbed && onReplaceEmbed()}
|
|
227
|
+
>
|
|
225
228
|
Edit Link
|
|
226
229
|
</ListItemButton>
|
|
227
230
|
)}
|
|
@@ -236,6 +239,7 @@ export const FigureOptions: React.FC<WrappedProps> = ({
|
|
|
236
239
|
{getSupplements(getFiles, getDoc, groupFiles, isEmbed).map(
|
|
237
240
|
(file, index) => (
|
|
238
241
|
<ListItemButton
|
|
242
|
+
variant="tertiary"
|
|
239
243
|
key={file.id}
|
|
240
244
|
id={index.toString()}
|
|
241
245
|
onClick={() => onReplace && onReplace(file, true)}
|
|
@@ -248,6 +252,7 @@ export const FigureOptions: React.FC<WrappedProps> = ({
|
|
|
248
252
|
{getOtherFiles(getFiles, getDoc, groupFiles, isEmbed).map(
|
|
249
253
|
(file, index) => (
|
|
250
254
|
<ListItemButton
|
|
255
|
+
variant="tertiary"
|
|
251
256
|
key={file.id}
|
|
252
257
|
id={index.toString()}
|
|
253
258
|
onClick={() => onReplace && onReplace(file)}
|
|
@@ -258,7 +263,11 @@ export const FigureOptions: React.FC<WrappedProps> = ({
|
|
|
258
263
|
)
|
|
259
264
|
)}
|
|
260
265
|
{showUpload && (
|
|
261
|
-
<UploadButton
|
|
266
|
+
<UploadButton
|
|
267
|
+
variant="tertiary"
|
|
268
|
+
onClick={onUpload}
|
|
269
|
+
disabled={!showUpload}
|
|
270
|
+
>
|
|
262
271
|
<UploadIcon /> Upload new...
|
|
263
272
|
</UploadButton>
|
|
264
273
|
)}
|
|
@@ -267,17 +276,27 @@ export const FigureOptions: React.FC<WrappedProps> = ({
|
|
|
267
276
|
/>
|
|
268
277
|
)}
|
|
269
278
|
{showDownload && (
|
|
270
|
-
<ListItemButton
|
|
279
|
+
<ListItemButton
|
|
280
|
+
variant="tertiary"
|
|
281
|
+
onClick={onDownload}
|
|
282
|
+
disabled={!showDownload}
|
|
283
|
+
>
|
|
271
284
|
Download
|
|
272
285
|
</ListItemButton>
|
|
273
286
|
)}
|
|
274
287
|
{showDetach && (
|
|
275
|
-
<ListItemButton
|
|
288
|
+
<ListItemButton
|
|
289
|
+
variant="tertiary"
|
|
290
|
+
onClick={onDetach}
|
|
291
|
+
disabled={!showDetach}
|
|
292
|
+
>
|
|
276
293
|
Detach
|
|
277
294
|
</ListItemButton>
|
|
278
295
|
)}
|
|
279
296
|
{showDelete() && (
|
|
280
|
-
<ListItemButton onClick={onDelete}>
|
|
297
|
+
<ListItemButton variant="tertiary" onClick={onDelete}>
|
|
298
|
+
Delete
|
|
299
|
+
</ListItemButton>
|
|
281
300
|
)}
|
|
282
301
|
</OptionsDropdownList>
|
|
283
302
|
)}
|
|
@@ -315,6 +334,7 @@ const NestedDropdown: React.FC<{
|
|
|
315
334
|
return (
|
|
316
335
|
<DropdownWrapper ref={wrapperRef}>
|
|
317
336
|
<NestedListButton
|
|
337
|
+
variant="tertiary"
|
|
318
338
|
className="nested-list-button"
|
|
319
339
|
onClick={toggleOpen}
|
|
320
340
|
disabled={disabled}
|
|
@@ -352,26 +372,18 @@ const OptionsDropdownList = styled(DropdownList)`
|
|
|
352
372
|
right: 4%;
|
|
353
373
|
`
|
|
354
374
|
|
|
355
|
-
const OptionsButton = styled(IconButton)
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
background: #ffffff;
|
|
364
|
-
|
|
365
|
-
&:hover {
|
|
366
|
-
background: #f2fbfc !important;
|
|
367
|
-
border: 1px solid #e2e2e2 !important;
|
|
375
|
+
const OptionsButton = styled(IconButton).attrs({
|
|
376
|
+
size: 'small',
|
|
377
|
+
bordered: true,
|
|
378
|
+
})`
|
|
379
|
+
&& {
|
|
380
|
+
margin: ${(props) => props.theme.grid.unit}px;
|
|
381
|
+
visibility: hidden;
|
|
382
|
+
background: #ffffff;
|
|
368
383
|
}
|
|
369
384
|
|
|
370
385
|
&:active,
|
|
371
386
|
&:focus {
|
|
372
|
-
background: #f2fbfc !important;
|
|
373
|
-
border: 1px solid #e2e2e2 !important;
|
|
374
|
-
|
|
375
387
|
circle {
|
|
376
388
|
fill: #1a9bc7;
|
|
377
389
|
}
|
|
@@ -382,14 +394,12 @@ const OptionsButton = styled(IconButton)`
|
|
|
382
394
|
}
|
|
383
395
|
`
|
|
384
396
|
|
|
385
|
-
const ListItemButton = styled(
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
&:focus-visible {
|
|
392
|
-
background: #f2fbfc;
|
|
397
|
+
const ListItemButton = styled(Button)`
|
|
398
|
+
&& {
|
|
399
|
+
padding: 16px 14px;
|
|
400
|
+
justify-content: space-between;
|
|
401
|
+
align-items: center;
|
|
402
|
+
width: 100%;
|
|
393
403
|
}
|
|
394
404
|
|
|
395
405
|
&:is([disabled]) {
|
|
@@ -423,12 +433,12 @@ const NestedListDropdownList = styled(DropdownList)<{ $moveLeft?: boolean }>`
|
|
|
423
433
|
${(props) => (props.$moveLeft && 'right: 30%;') || 'left: 100%;'}
|
|
424
434
|
`
|
|
425
435
|
|
|
426
|
-
const UploadButton = styled(
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
436
|
+
const UploadButton = styled(Button)`
|
|
437
|
+
&& {
|
|
438
|
+
border-top: 1px solid #f2f2f2;
|
|
439
|
+
padding: ${(props) => props.theme.grid.unit * 4}px;
|
|
440
|
+
justify-content: flex-start;
|
|
441
|
+
width: 100%;
|
|
442
|
+
border-radius: 0;
|
|
433
443
|
}
|
|
434
444
|
`
|
|
@@ -19,13 +19,11 @@ import {
|
|
|
19
19
|
AddIcon,
|
|
20
20
|
AddNewIcon,
|
|
21
21
|
ButtonGroup,
|
|
22
|
-
IconTextButton,
|
|
23
|
-
PrimaryButton,
|
|
24
|
-
SecondaryButton,
|
|
25
22
|
withFocusTrap,
|
|
26
23
|
withListNavigation,
|
|
27
24
|
withNavigableListItem,
|
|
28
25
|
} from '@manuscripts/style-guide'
|
|
26
|
+
import { Button } from '@manuscripts/style-guide/mui'
|
|
29
27
|
import { isDeleted } from '@manuscripts/track-changes-plugin'
|
|
30
28
|
import { FootnoteNode, InlineFootnoteNode } from '@manuscripts/transform'
|
|
31
29
|
import React, { useState } from 'react'
|
|
@@ -131,19 +129,20 @@ export const FootnotesSelector: React.FC<FootnotesSelectorProps> = ({
|
|
|
131
129
|
</NotesContainer>
|
|
132
130
|
<Actions>
|
|
133
131
|
<AddNewFootnote>
|
|
134
|
-
<
|
|
135
|
-
<AddNewIcon />
|
|
132
|
+
<Button variant="tertiary" onClick={onAdd} startIcon={<AddNewIcon />}>
|
|
136
133
|
Add new
|
|
137
|
-
</
|
|
134
|
+
</Button>
|
|
138
135
|
</AddNewFootnote>
|
|
139
136
|
<ButtonGroup>
|
|
140
|
-
<
|
|
141
|
-
|
|
137
|
+
<Button variant="secondary" onClick={onCancel}>
|
|
138
|
+
Cancel
|
|
139
|
+
</Button>
|
|
140
|
+
<Button
|
|
142
141
|
onClick={handleClick}
|
|
143
142
|
disabled={selections.size === 0 && !inlineFootnote}
|
|
144
143
|
>
|
|
145
144
|
{inlineFootnote ? 'Update' : 'Insert'}
|
|
146
|
-
</
|
|
145
|
+
</Button>
|
|
147
146
|
</ButtonGroup>
|
|
148
147
|
</Actions>
|
|
149
148
|
</Container>
|
|
@@ -19,12 +19,11 @@ import {
|
|
|
19
19
|
FormContainer,
|
|
20
20
|
FormRow,
|
|
21
21
|
Label,
|
|
22
|
-
PrimaryButton,
|
|
23
|
-
SecondaryButton,
|
|
24
22
|
TextField,
|
|
25
23
|
InputErrorText,
|
|
26
24
|
withFocusTrap,
|
|
27
25
|
} from '@manuscripts/style-guide'
|
|
26
|
+
import { Button } from '@manuscripts/style-guide/mui'
|
|
28
27
|
import React, { useCallback, useState } from 'react'
|
|
29
28
|
import styled from 'styled-components'
|
|
30
29
|
|
|
@@ -46,7 +45,7 @@ const ActionGroup = styled.span`
|
|
|
46
45
|
}
|
|
47
46
|
`
|
|
48
47
|
|
|
49
|
-
const RemoveButton = styled(
|
|
48
|
+
const RemoveButton = styled(Button)`
|
|
50
49
|
display: flex;
|
|
51
50
|
justify-content: space-between;
|
|
52
51
|
align-items: center;
|
|
@@ -201,17 +200,21 @@ export const LinkForm: React.FC<LinkFormProps> = ({
|
|
|
201
200
|
|
|
202
201
|
<Actions>
|
|
203
202
|
<ActionGroup>
|
|
204
|
-
<RemoveButton
|
|
203
|
+
<RemoveButton
|
|
204
|
+
variant="secondary"
|
|
205
|
+
type={'button'}
|
|
206
|
+
onClick={onRemove}
|
|
207
|
+
>
|
|
205
208
|
<DeleteIcon />
|
|
206
209
|
<span>Remove Link</span>
|
|
207
210
|
</RemoveButton>
|
|
208
211
|
</ActionGroup>
|
|
209
212
|
|
|
210
213
|
<ActionGroup>
|
|
211
|
-
<
|
|
214
|
+
<Button variant="secondary" type={'button'} onClick={onCancel}>
|
|
212
215
|
Cancel
|
|
213
|
-
</
|
|
214
|
-
<
|
|
216
|
+
</Button>
|
|
217
|
+
<Button type={'submit'}>Save</Button>
|
|
215
218
|
</ActionGroup>
|
|
216
219
|
</Actions>
|
|
217
220
|
</FormContainer>
|