@manuscripts/style-guide 0.31.21 → 0.31.23

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 (39) hide show
  1. package/dist/cjs/components/Badge.js +29 -0
  2. package/dist/cjs/components/Dropdown.js +1 -1
  3. package/dist/cjs/components/EditorHeader/EditorHeader.js +202 -0
  4. package/dist/cjs/components/EditorHeader/ProceedView.js +172 -0
  5. package/dist/cjs/components/LoadingOverlay.js +35 -0
  6. package/dist/cjs/components/NavDropdown.js +162 -0
  7. package/dist/cjs/components/SubmissionInspector/BaseInformation.js +1 -1
  8. package/dist/cjs/components/icons/annotator-icon.js +11 -0
  9. package/dist/cjs/components/icons/edit-icon.js +9 -0
  10. package/dist/cjs/components/icons/index.js +9 -1
  11. package/dist/cjs/components/icons/left-arrow.js +9 -0
  12. package/dist/cjs/components/icons/reading-icon.js +13 -0
  13. package/dist/cjs/index.js +4 -0
  14. package/dist/es/components/Badge.js +23 -0
  15. package/dist/es/components/Dropdown.js +1 -1
  16. package/dist/es/components/EditorHeader/EditorHeader.js +176 -0
  17. package/dist/es/components/EditorHeader/ProceedView.js +146 -0
  18. package/dist/es/components/LoadingOverlay.js +28 -0
  19. package/dist/es/components/NavDropdown.js +136 -0
  20. package/dist/es/components/SubmissionInspector/BaseInformation.js +1 -1
  21. package/dist/es/components/icons/annotator-icon.js +6 -0
  22. package/dist/es/components/icons/edit-icon.js +4 -0
  23. package/dist/es/components/icons/index.js +4 -0
  24. package/dist/es/components/icons/left-arrow.js +4 -0
  25. package/dist/es/components/icons/reading-icon.js +8 -0
  26. package/dist/es/index.js +4 -0
  27. package/dist/types/components/Badge.d.ts +16 -0
  28. package/dist/types/components/Dropdown.d.ts +1 -1
  29. package/dist/types/components/EditorHeader/EditorHeader.d.ts +56 -0
  30. package/dist/types/components/EditorHeader/ProceedView.d.ts +22 -0
  31. package/dist/types/components/LoadingOverlay.d.ts +2 -0
  32. package/dist/types/components/NavDropdown.d.ts +58 -0
  33. package/dist/types/components/icons/annotator-icon.d.ts +3 -0
  34. package/dist/types/components/icons/edit-icon.d.ts +3 -0
  35. package/dist/types/components/icons/index.d.ts +4 -0
  36. package/dist/types/components/icons/left-arrow.d.ts +3 -0
  37. package/dist/types/components/icons/reading-icon.d.ts +3 -0
  38. package/dist/types/index.d.ts +4 -0
  39. package/package.json +3 -1
@@ -0,0 +1,29 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.Badge = void 0;
22
+ const styled_components_1 = __importDefault(require("styled-components"));
23
+ exports.Badge = styled_components_1.default.div `
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ padding: 2px;
28
+ border-radius: 50px;
29
+ `;
@@ -13,7 +13,7 @@ exports.DropdownList = styled_components_1.default.div `
13
13
  border-radius: 4px;
14
14
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
15
15
  background: ${(props) => props.theme.colors.background.primary};
16
- width: ${(props) => props.width}px;
16
+ width: ${(props) => (props.width ? props.width + 'px' : 'auto')};
17
17
  ${(props) => props.height && `height: ${props.height}px`};
18
18
  ${(props) => (props.direction === 'right' ? ' right: 0' : 'left : 0')};
19
19
  top: ${(props) => props.theme.grid.unit * (props.top || 3)}px;
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __importDefault = (this && this.__importDefault) || function (mod) {
31
+ return (mod && mod.__esModule) ? mod : { "default": mod };
32
+ };
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.MediumTextArea = exports.PrimaryButtonSmall = exports.EditorHeader = void 0;
35
+ const react_1 = __importStar(require("react"));
36
+ const styled_components_1 = __importDefault(require("styled-components"));
37
+ const __1 = require("../..");
38
+ const ProceedView_1 = require("./ProceedView");
39
+ const Editing = { label: 'Editing...', icon: __1.EditIcon };
40
+ const MapUserRole = {
41
+ Editor: Editing,
42
+ Owner: Editing,
43
+ Writer: Editing,
44
+ Annotator: { label: 'Suggesting...', icon: __1.AnnotatorIcon },
45
+ Viewer: { label: 'Reading...', icon: __1.ReadingIcon },
46
+ };
47
+ const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions, userRole, canCompleteTask, submitProceed, goBack, status, isAnnotator, message, exceptionDialog: ExceptionDialog, disabelProceedNote, }) => {
48
+ var _a, _b, _c;
49
+ const [confirmationDialog, toggleConfirmationDialog] = (0, react_1.useState)(false);
50
+ const [loading, setLoading] = (0, react_1.useState)(false);
51
+ const [noteValue, setNoteValue] = (0, react_1.useState)('');
52
+ const [error, setError] = (0, react_1.useState)(undefined);
53
+ const [selectedTransitionIndex, setSelectedTransitionIndex] = (0, react_1.useState)();
54
+ const { complete: showComplete, error: submissionError, mutationError, submit, } = submitProceed;
55
+ (0, react_1.useEffect)(() => {
56
+ if (submissionError) {
57
+ setError(submissionError);
58
+ }
59
+ }, [submissionError]);
60
+ const continueDialogAction = (0, react_1.useCallback)(() => __awaiter(void 0, void 0, void 0, function* () {
61
+ if (submission && selectedTransitionIndex && handleSnapshot) {
62
+ const { status } = submission.currentStep.type.transitions[selectedTransitionIndex];
63
+ setLoading(true);
64
+ yield handleSnapshot();
65
+ yield submit(status.id, noteValue);
66
+ setLoading(false);
67
+ }
68
+ }), [
69
+ handleSnapshot,
70
+ selectedTransitionIndex,
71
+ submission,
72
+ noteValue,
73
+ submit,
74
+ ]);
75
+ const onTransitionClick = (0, react_1.useCallback)((event) => {
76
+ toggleConfirmationDialog(true);
77
+ setSelectedTransitionIndex(event.target.value);
78
+ }, [setSelectedTransitionIndex, toggleConfirmationDialog]);
79
+ const onCancelClick = (0, react_1.useCallback)(() => {
80
+ toggleConfirmationDialog(false);
81
+ setSelectedTransitionIndex(undefined);
82
+ setError(undefined);
83
+ }, [toggleConfirmationDialog, setSelectedTransitionIndex, setError]);
84
+ const onNoteChange = (0, react_1.useCallback)((event) => setNoteValue(event.target.value), [setNoteValue]);
85
+ const currentStepTransition = submission === null || submission === void 0 ? void 0 : submission.currentStep.type.transitions;
86
+ const disable = !currentStepTransition || !canCompleteTask;
87
+ const errorCode = (_c = (_b = (_a = mutationError === null || mutationError === void 0 ? void 0 : mutationError.graphQLErrors) === null || _a === void 0 ? void 0 : _a.find((error) => { var _a; return (_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a.code; })) === null || _b === void 0 ? void 0 : _b.extensions) === null || _c === void 0 ? void 0 : _c.code.name;
88
+ return (react_1.default.createElement(Wrapper, null,
89
+ goBack && (react_1.default.createElement(SecondaryButtonSmall, { onClick: goBack, type: "button" },
90
+ react_1.default.createElement(__1.LeftArrow, null),
91
+ react_1.default.createElement("span", null, "Dashboard"))),
92
+ handleSnapshot &&
93
+ typeof hasPendingSuggestions == 'boolean' &&
94
+ submission.nextStep && (react_1.default.createElement(ProceedView_1.ProceedView, { isAnnotator: isAnnotator, disable: disable, onTransitionClick: onTransitionClick, hasPendingSuggestions: hasPendingSuggestions, loading: loading, showComplete: showComplete, noteValue: noteValue, currentStepTransition: currentStepTransition, error: error, nextStepType: submission.nextStep.type, currentStepType: submission.currentStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
95
+ status && (react_1.default.createElement(ChildWrapper, null,
96
+ react_1.default.createElement(__1.SaveStatus, { status: status }))),
97
+ react_1.default.createElement(Spacer, null),
98
+ react_1.default.createElement(CurrentStepLabel, null, submission.currentStep.type.label),
99
+ react_1.default.createElement(CurrentActionLablel, null,
100
+ userRole &&
101
+ MapUserRole[userRole] &&
102
+ react_1.default.createElement(MapUserRole[userRole].icon),
103
+ react_1.default.createElement("span", null, userRole && MapUserRole[userRole].label)),
104
+ react_1.default.createElement(HelpDropdown, null),
105
+ errorCode && react_1.default.createElement(ExceptionDialog, { errorCode: errorCode })));
106
+ };
107
+ exports.EditorHeader = EditorHeader;
108
+ const HelpDropdown = () => {
109
+ const { isOpen, toggleOpen, wrapperRef } = (0, __1.useDropdown)();
110
+ return (react_1.default.createElement(HelpDropdownContainer, { ref: wrapperRef },
111
+ react_1.default.createElement(HelpDropdownButton, { onClick: toggleOpen },
112
+ react_1.default.createElement("span", null, "Help"),
113
+ react_1.default.createElement(__1.NavDropdownToggle, { className: isOpen ? 'open' : '' })),
114
+ isOpen && (react_1.default.createElement(__1.DropdownList, { top: 12, direction: "right" },
115
+ react_1.default.createElement(DropdownItem, null, "Documentation")))));
116
+ };
117
+ const SecondaryButtonSmall = (0, styled_components_1.default)(__1.SecondaryButton) `
118
+ font-size: inherit;
119
+ margin-right: ${(props) => props.theme.grid.unit * 2}px;
120
+ padding-top: ${(props) => props.theme.grid.unit * 0.75}px;
121
+ padding-bottom: ${(props) => props.theme.grid.unit * 0.75}px;
122
+ `;
123
+ const HelpDropdownButton = styled_components_1.default.button `
124
+ background: transparent;
125
+ border: none;
126
+ cursor: pointer;
127
+ `;
128
+ const HelpDropdownContainer = (0, styled_components_1.default)(__1.DropdownContainer) `
129
+ border-left: 1px solid #f2f2f2;
130
+ margin: -${(props) => props.theme.grid.unit * 3}px ${(props) => props.theme.grid.unit * 2}px -${(props) => props.theme.grid.unit * 3}px
131
+ ${(props) => props.theme.grid.unit * 6}px;
132
+ padding: ${(props) => props.theme.grid.unit * 4.75}px 0
133
+ ${(props) => props.theme.grid.unit * 5}px
134
+ ${(props) => props.theme.grid.unit * 4}px;
135
+ `;
136
+ const DropdownItem = styled_components_1.default.a `
137
+ color: inherit;
138
+ display: block;
139
+ cursor: pointer;
140
+ text-decoration: none;
141
+ padding: ${(props) => props.theme.grid.unit * 5}px;
142
+ `;
143
+ exports.PrimaryButtonSmall = (0, styled_components_1.default)(__1.PrimaryButton) `
144
+ padding-top: ${(props) => props.theme.grid.unit * 0.75}px;
145
+ padding-bottom: ${(props) => props.theme.grid.unit * 0.75}px;
146
+ font-size: inherit;
147
+ `;
148
+ const Wrapper = styled_components_1.default.div `
149
+ display: flex;
150
+ padding: ${(props) => props.theme.grid.unit * 3}px
151
+ ${(props) => props.theme.grid.unit * 8}px;
152
+ width: 100%;
153
+ box-sizing: border-box;
154
+ align-items: center;
155
+ border-bottom: 1px solid #f2f2f2;
156
+ font-size: 14px;
157
+
158
+ ${__1.NavDropdownContainer} + ${__1.NavDropdownContainer} {
159
+ margin-left: ${(props) => props.theme.grid.unit * 2}px;
160
+ }
161
+ ${exports.PrimaryButtonSmall} + ${__1.NavDropdownContainer} {
162
+ margin-left: ${(props) => props.theme.grid.unit * 2}px;
163
+ }
164
+ `;
165
+ const CurrentStepLabel = styled_components_1.default.span `
166
+ background: #f2f2f2;
167
+ border-radius: ${(props) => props.theme.grid.unit * 1.5}px;
168
+ padding: ${(props) => props.theme.grid.unit}px;
169
+ `;
170
+ const CurrentActionLablel = styled_components_1.default.span `
171
+ display: flex;
172
+ padding: 0 ${(props) => props.theme.grid.unit * 6}px;
173
+ svg {
174
+ margin-right: ${(props) => props.theme.grid.unit * 2.5}px;
175
+ }
176
+ `;
177
+ const ChildWrapper = styled_components_1.default.div `
178
+ display: inline-flex;
179
+ margin: 0 2em;
180
+ flex-direction: row;
181
+ align-items: center;
182
+ `;
183
+ const Grid = styled_components_1.default.div `
184
+ display: grid;
185
+ grid-template-columns: max-content auto;
186
+ gap: 0 ${(props) => props.theme.grid.unit * 2}px;
187
+ margin-top: ${(props) => props.theme.grid.unit * 4}px;
188
+ background: ${(props) => props.theme.colors.background.secondary};
189
+ padding: ${(props) => props.theme.grid.unit * 6}px;
190
+ `;
191
+ const Line = styled_components_1.default.hr `
192
+ margin: 5px 0 0 0;
193
+ flex: 1;
194
+ border: 1px dashed #c9c9c9;
195
+ `;
196
+ const Spacer = styled_components_1.default.div `
197
+ flex: auto;
198
+ `;
199
+ exports.MediumTextArea = (0, styled_components_1.default)(__1.TextArea) `
200
+ padding: 8px;
201
+ font-size: 1em;
202
+ `;
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.ProceedView = void 0;
26
+ const react_1 = __importStar(require("react"));
27
+ const styled_components_1 = __importDefault(require("styled-components"));
28
+ const __1 = require("../..");
29
+ const AlertMessage_1 = require("../AlertMessage");
30
+ const EditorHeader_1 = require("./EditorHeader");
31
+ const DropdownWrapper = ({ disabled, button, primary, children }) => {
32
+ const { isOpen, toggleOpen, wrapperRef } = (0, __1.useDropdown)();
33
+ return (react_1.default.createElement(__1.NavDropdownContainer, { id: 'user-dropdown', ref: wrapperRef },
34
+ react_1.default.createElement(__1.NavDropdownButton, { as: (primary && __1.PrimaryButton) || undefined, disabled: disabled, isOpen: isOpen, onClick: toggleOpen }, button),
35
+ isOpen && react_1.default.createElement(__1.NavDropdown, { direction: "left" }, children)));
36
+ };
37
+ const StepDetails = ({ icon, label, description, role }) => (react_1.default.createElement(react_1.default.Fragment, null,
38
+ icon && react_1.default.createElement(TaskStatus, null, icon),
39
+ react_1.default.createElement(TaskContainer, null,
40
+ react_1.default.createElement(__1.PrimaryBoldHeading, null, label),
41
+ react_1.default.createElement(__1.SecondarySmallText, null, description),
42
+ react_1.default.createElement(__1.SecondarySmallText, null,
43
+ "Actor: ",
44
+ role.label))));
45
+ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loading, showComplete, confirmationDialog, nextStepType, currentStepType, isAnnotator, hasPendingSuggestions, error, noteValue, onNoteChange, onCancelClick, continueDialogAction, message: Message, }) => {
46
+ const dialogMessages = (0, react_1.useMemo)(() => hasPendingSuggestions && !isAnnotator
47
+ ? {
48
+ header: 'The task can not be transitioned to the next step',
49
+ message: `There are still pending suggestions in the document.
50
+ It is not possible to complete the task without having them approved or rejected.`,
51
+ actions: {
52
+ primary: {
53
+ action: onCancelClick,
54
+ title: 'Ok',
55
+ },
56
+ },
57
+ }
58
+ : showComplete
59
+ ? {
60
+ header: 'Content reassigned successfully',
61
+ message: `to the ${nextStepType.label}`,
62
+ actions: {
63
+ primary: {
64
+ action: onCancelClick,
65
+ title: 'Close',
66
+ },
67
+ },
68
+ }
69
+ : {
70
+ header: 'Are you sure?',
71
+ message: 'You are about to complete your task. If you confirm, you will no longer be able to make any changes.',
72
+ actions: {
73
+ primary: {
74
+ action: continueDialogAction,
75
+ title: 'Continue',
76
+ },
77
+ secondary: {
78
+ action: onCancelClick,
79
+ title: 'Cancel',
80
+ },
81
+ },
82
+ }, [
83
+ showComplete,
84
+ continueDialogAction,
85
+ onCancelClick,
86
+ nextStepType,
87
+ hasPendingSuggestions,
88
+ isAnnotator,
89
+ ]);
90
+ return (react_1.default.createElement(react_1.default.Fragment, null,
91
+ (currentStepTransition && (currentStepTransition === null || currentStepTransition === void 0 ? void 0 : currentStepTransition.length) > 1 && (react_1.default.createElement(DropdownWrapper, { button: 'Complete task', disabled: disable, primary: true },
92
+ react_1.default.createElement(TaskDropdown, null, currentStepTransition &&
93
+ currentStepTransition.map((transition, index) => (react_1.default.createElement(Task, { key: 'task_' + transition.type.id, className: transition.status.id === 'success' ? 'happyPath' : '', value: index, onClick: onTransitionClick },
94
+ react_1.default.createElement("strong", null, transition.type.label),
95
+ transition.type.description))))))) || (react_1.default.createElement(EditorHeader_1.PrimaryButtonSmall, { value: 0, onClick: onTransitionClick, disabled: disable }, "Complete task")),
96
+ (loading && (react_1.default.createElement(__1.LoadingOverlay, null,
97
+ react_1.default.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026")))) || (react_1.default.createElement(__1.Dialog, { isOpen: confirmationDialog && !loading, category: __1.Category.confirmation, header: dialogMessages.header, message: dialogMessages.message, actions: dialogMessages.actions },
98
+ (showComplete && (react_1.default.createElement(Grid, null,
99
+ react_1.default.createElement(StepDetails, Object.assign({}, currentStepType, { icon: react_1.default.createElement(react_1.default.Fragment, null,
100
+ react_1.default.createElement(__1.TaskStepDoneIcon, null),
101
+ react_1.default.createElement(Line, null)) })),
102
+ react_1.default.createElement(StepDetails, Object.assign({}, nextStepType))))) ||
103
+ ((!hasPendingSuggestions || isAnnotator) && onNoteChange && (react_1.default.createElement(TextAreaWrapper, null,
104
+ react_1.default.createElement(EditorHeader_1.MediumTextArea, { value: noteValue, onChange: onNoteChange, rows: 5, placeholder: 'Add any additional comment here...' })))),
105
+ error && (react_1.default.createElement(AlertMessage_1.AlertMessage, { type: AlertMessage_1.AlertMessageType.error, hideCloseButton: true }, error))))));
106
+ };
107
+ exports.ProceedView = ProceedView;
108
+ const TaskDropdown = styled_components_1.default.div `
109
+ display: flex;
110
+ flex-direction: column;
111
+ padding: ${(props) => props.theme.grid.unit * 2}px 0;
112
+ `;
113
+ const Task = styled_components_1.default.button `
114
+ background: transparent;
115
+ border: none;
116
+ color: ${(props) => props.theme.colors.text.secondary};
117
+ cursor: pointer;
118
+ font: ${(props) => props.theme.font.weight.normal}
119
+ ${(props) => props.theme.font.size.small} /
120
+ ${(props) => props.theme.font.lineHeight.normal}
121
+ ${(props) => props.theme.font.family.sans};
122
+ order: 1;
123
+ outline: none;
124
+ padding: ${(props) => props.theme.grid.unit * 2}px
125
+ ${(props) => props.theme.grid.unit * 4}px;
126
+ text-align: left;
127
+ width: ${(props) => props.theme.grid.unit * 66}px;
128
+
129
+ &:not([disabled]):hover,
130
+ &:not([disabled]):focus {
131
+ background-color: ${(props) => props.theme.colors.button.default.background.hover};
132
+ }
133
+
134
+ strong {
135
+ color: ${(props) => props.theme.colors.text.primary};
136
+ display: block;
137
+ font-size: ${(props) => props.theme.font.size.normal};
138
+ line-height: ${(props) => props.theme.font.lineHeight.normal};
139
+ }
140
+
141
+ &.happyPath {
142
+ border-bottom: 1px solid ${(props) => props.theme.colors.border.tertiary};
143
+ order: 0;
144
+ }
145
+ `;
146
+ const TextAreaWrapper = styled_components_1.default.div `
147
+ margin-top: ${(props) => props.theme.grid.unit * 4}px;
148
+ `;
149
+ const Grid = styled_components_1.default.div `
150
+ display: grid;
151
+ grid-template-columns: max-content auto;
152
+ gap: 0 ${(props) => props.theme.grid.unit * 2}px;
153
+ margin-top: ${(props) => props.theme.grid.unit * 4}px;
154
+ background: ${(props) => props.theme.colors.background.secondary};
155
+ padding: ${(props) => props.theme.grid.unit * 6}px;
156
+ `;
157
+ const Line = styled_components_1.default.hr `
158
+ margin: 5px 0 0 0;
159
+ flex: 1;
160
+ border: 1px dashed #c9c9c9;
161
+ `;
162
+ const TaskStatus = styled_components_1.default.div `
163
+ grid-column: 1;
164
+ display: flex;
165
+ flex-direction: column;
166
+ align-items: center;
167
+ padding-top: 5px;
168
+ `;
169
+ const TaskContainer = styled_components_1.default.div `
170
+ grid-column: 2;
171
+ margin-bottom: 8px;
172
+ `;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LoadingOverlay = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_modal_1 = __importDefault(require("react-modal"));
9
+ const LoadingOverlay = ({ children }) => (react_1.default.createElement(react_1.default.Fragment, null,
10
+ react_1.default.createElement(react_modal_1.default, { isOpen: true, style: {
11
+ overlay: {
12
+ position: 'fixed',
13
+ top: 0,
14
+ left: 0,
15
+ right: 0,
16
+ bottom: 0,
17
+ backgroundColor: 'white',
18
+ zIndex: 20,
19
+ },
20
+ content: {
21
+ position: 'fixed',
22
+ top: 0,
23
+ left: 0,
24
+ right: 0,
25
+ bottom: 0,
26
+ background: 'white',
27
+ display: 'flex',
28
+ flexDirection: 'column',
29
+ padding: 0,
30
+ overflow: 'auto',
31
+ border: 'none',
32
+ },
33
+ } },
34
+ react_1.default.createElement(react_1.default.Fragment, null, children))));
35
+ exports.LoadingOverlay = LoadingOverlay;
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2020 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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.NavDropdownButton = exports.NavDropdownButtonContainer = exports.NotificationsBadge = exports.NavDropdownToggle = exports.NavDropdownButtonText = exports.NavDropdownSeparator = exports.NavDropdownElement = exports.NavDropdownLink = exports.InvitedBy = exports.PlaceholderTitle = exports.NavDropdown = exports.NavDropdownContainer = void 0;
41
+ const ArrowDownUp_1 = __importDefault(require("@manuscripts/assets/react/ArrowDownUp"));
42
+ const title_editor_1 = require("@manuscripts/title-editor");
43
+ const react_1 = __importDefault(require("react"));
44
+ const react_router_dom_1 = require("react-router-dom");
45
+ const styled_components_1 = __importStar(require("styled-components"));
46
+ const Badge_1 = require("./Badge");
47
+ const Button_1 = require("./Button");
48
+ exports.NavDropdownContainer = styled_components_1.default.div `
49
+ position: relative;
50
+ display: inline-flex;
51
+ align-items: center;
52
+ `;
53
+ exports.NavDropdown = styled_components_1.default.div `
54
+ border: 1px solid ${(props) => props.theme.colors.border.secondary};
55
+ border-radius: ${(props) => props.theme.grid.radius.small};
56
+ box-shadow: ${(props) => props.theme.shadow.dropShadow};
57
+ background: ${(props) => props.theme.colors.background.primary};
58
+ color: ${(props) => props.theme.colors.text.primary};
59
+ display: flex;
60
+ flex-direction: column;
61
+ font-size: ${(props) => props.theme.font.size.normal};
62
+ font-weight: ${(props) => props.theme.font.weight.normal};
63
+ max-height: 80vh;
64
+ max-width: 300px;
65
+ ${(props) => props.minWidth && 'min-width: ' + props.minWidth + 'px;'}
66
+ ${(props) => (props.direction === 'right' ? ' right: 0' : 'left : 0')};
67
+ top: ${(props) => (props.top ? props.top : props.theme.grid.unit * 10)}px;
68
+ position: absolute;
69
+ z-index: 10;
70
+ `;
71
+ exports.PlaceholderTitle = (0, styled_components_1.default)(title_editor_1.Title) `
72
+ color: ${(props) => props.theme.colors.text.secondary};
73
+ `;
74
+ exports.InvitedBy = styled_components_1.default.div `
75
+ display: flex;
76
+ align-items: center;
77
+ font-size: ${(props) => props.theme.font.size.normal};
78
+ letter-spacing: -0.3px;
79
+ color: ${(props) => props.theme.colors.text.secondary};
80
+ clear: both;
81
+ margin-top: ${(props) => props.theme.grid.unit * 2}px;
82
+ `;
83
+ const commonStyles = (0, styled_components_1.css) `
84
+ display: flex;
85
+ justify-content: space-between;
86
+ padding: ${(props) => props.theme.grid.unit * 3}px
87
+ ${(props) => props.theme.grid.unit * 3}px;
88
+ align-items: center;
89
+ text-decoration: none;
90
+ white-space: nowrap;
91
+ color: ${(props) => props.disabled
92
+ ? props.theme.colors.text.secondary
93
+ : props.theme.colors.text.primary};
94
+ pointer-events: ${(props) => (props.disabled ? 'none' : 'unset')};
95
+
96
+ &:hover,
97
+ &:hover ${exports.PlaceholderTitle} {
98
+ background: ${(props) => props.theme.colors.background.fifth};
99
+ }
100
+ `;
101
+ exports.NavDropdownLink = (0, styled_components_1.default)(react_router_dom_1.NavLink) `
102
+ ${commonStyles};
103
+ `;
104
+ exports.NavDropdownElement = styled_components_1.default.div `
105
+ ${commonStyles};
106
+
107
+ cursor: pointer;
108
+
109
+ &:hover .user-icon-path {
110
+ fill: ${(props) => props.theme.colors.text.onDark};
111
+ }
112
+ `;
113
+ exports.NavDropdownSeparator = styled_components_1.default.div `
114
+ height: 1px;
115
+ width: 100%;
116
+ opacity: 0.23;
117
+ background-color: ${(props) => props.theme.colors.border.primary};
118
+ `;
119
+ exports.NavDropdownButtonText = styled_components_1.default.div `
120
+ align-items: center;
121
+ display: flex;
122
+ margin-right: ${(props) => props.theme.grid.unit}px;
123
+ `;
124
+ exports.NavDropdownToggle = (0, styled_components_1.default)(ArrowDownUp_1.default) `
125
+ margin-left: 6px;
126
+ transform: rotate(180deg);
127
+
128
+ path {
129
+ stroke: currentColor;
130
+ }
131
+
132
+ &.open {
133
+ transform: rotate(0deg);
134
+ }
135
+ `;
136
+ exports.NotificationsBadge = (0, styled_components_1.default)(Badge_1.Badge) `
137
+ background-color: ${(props) => props.isOpen
138
+ ? props.theme.colors.background.success
139
+ : props.theme.colors.brand.default};
140
+ color: ${(props) => props.isOpen
141
+ ? props.theme.colors.text.success
142
+ : props.theme.colors.text.onDark};
143
+ font-family: ${(props) => props.theme.font.family.sans};
144
+ font-size: 9px;
145
+ margin-left: 4px;
146
+ max-height: 10px;
147
+ min-width: 10px;
148
+ min-height: 10px;
149
+ `;
150
+ exports.NavDropdownButtonContainer = (0, styled_components_1.default)(Button_1.SecondaryButton).attrs((props) => ({
151
+ selected: props.isOpen,
152
+ })) `
153
+ .inheritColors path {
154
+ fill: currentColor;
155
+ stroke: currentColor;
156
+ }
157
+ `;
158
+ const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, }) => (react_1.default.createElement(exports.NavDropdownButtonContainer, { as: as, disabled: disabled, onClick: onClick, isOpen: isOpen, className: 'dropdown-toggle' },
159
+ react_1.default.createElement(exports.NavDropdownButtonText, null, children),
160
+ !!notificationsCount && (react_1.default.createElement(exports.NotificationsBadge, { isOpen: isOpen }, notificationsCount)),
161
+ !removeChevron && react_1.default.createElement(exports.NavDropdownToggle, { className: isOpen ? 'open' : '' })));
162
+ exports.NavDropdownButton = NavDropdownButton;
@@ -113,7 +113,7 @@ const BaseInformation = ({ submission, handleDateChange, userRole }) => {
113
113
  react_1.default.createElement(Label, null, "DOI:"),
114
114
  react_1.default.createElement(Value, null, submission.doi),
115
115
  react_1.default.createElement(Label, null, "Journal:"),
116
- react_1.default.createElement(Value, null, submission.journal.title),
116
+ react_1.default.createElement(Value, { "data-journal": submission.journal.title }, submission.journal.title),
117
117
  react_1.default.createElement(Label, null, "Journal ID:"),
118
118
  react_1.default.createElement(Value, null, submission.journal.id),
119
119
  submission.author && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const AnnotatorIcon = () => (react_1.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
8
+ react_1.default.createElement("path", { d: "M5.5 6.5H12.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }),
9
+ react_1.default.createElement("path", { d: "M5.5 9.5H12.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }),
10
+ react_1.default.createElement("path", { d: "M16.5 8C16.5 4.41 13.142 1.5 9 1.5C4.858 1.5 1.5 4.41 1.5 8C1.5 11.59 4.858 14.5 9 14.5C9.525 14.5 10.037 14.452 10.532 14.363L14.5 16.5V12.409C15.738 11.25 16.5 9.704 16.5 8Z", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" })));
11
+ exports.default = AnnotatorIcon;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const EditIcon = () => (react_1.default.createElement("svg", { className: "inheritColors", viewBox: "0 0 18 18", width: 18, height: 18 },
8
+ react_1.default.createElement("path", { d: "M15.035 2.964a3.059 3.059 0 00-4.328 0L2.77 10.899a.397.397 0 00-.112.227l-.588 4.355a.396.396 0 00.112.334.402.402 0 00.28.119c.019 0 .036 0 .054-.004l2.624-.354a.4.4 0 00-.107-.792l-2.103.283.41-3.036 3.197 3.196a.39.39 0 00.561 0l7.936-7.933a3.042 3.042 0 00.899-2.166c0-.819-.32-1.587-.899-2.164zm-4.175.976l1.334 1.332-7.243 7.243-1.332-1.333 7.242-7.243v.001zM6.822 14.383L5.52 13.079l7.242-7.243 1.302 1.304-7.241 7.243zm7.797-7.814L11.43 3.381a2.26 2.26 0 011.442-.517 2.258 2.258 0 012.264 2.263 2.25 2.25 0 01-.518 1.442h.001z", fill: "#6E6E6E", stroke: "#6E6E6E", strokeWidth: ".533" })));
9
+ exports.default = EditIcon;