@manuscripts/style-guide 1.1.15-LEAN-2620-1 → 1.1.15-LEAN-2651

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.
@@ -35,19 +35,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
36
  };
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.MediumTextArea = exports.PrimaryButtonSmall = exports.EditorHeader = exports.DialogState = void 0;
38
+ exports.MediumTextArea = exports.PrimaryButtonSmall = exports.EditorHeader = void 0;
39
39
  const react_1 = __importStar(require("react"));
40
40
  const styled_components_1 = __importDefault(require("styled-components"));
41
41
  const __1 = require("../..");
42
42
  const ProceedView_1 = require("./ProceedView");
43
- var DialogState;
44
- (function (DialogState) {
45
- DialogState[DialogState["INIT"] = 0] = "INIT";
46
- DialogState[DialogState["LOADING"] = 1] = "LOADING";
47
- DialogState[DialogState["ERROR"] = 2] = "ERROR";
48
- DialogState[DialogState["SUCCESS"] = 3] = "SUCCESS";
49
- DialogState[DialogState["CLOSED"] = 4] = "CLOSED";
50
- })(DialogState = exports.DialogState || (exports.DialogState = {}));
51
43
  const Editing = { label: 'Editing...', icon: __1.EditIcon };
52
44
  const MapUserRole = {
53
45
  Editor: Editing,
@@ -57,54 +49,53 @@ const MapUserRole = {
57
49
  Viewer: { label: 'Reading...', icon: __1.ReadingIcon },
58
50
  };
59
51
  const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions, userRole, canCompleteTask, submitProceed, goBack, status, isAnnotator, message, exceptionDialog: ExceptionDialog, disabelProceedNote, }) => {
60
- var _a, _b, _c, _d, _e;
52
+ var _a, _b, _c, _d;
61
53
  const [confirmationDialog, toggleConfirmationDialog] = (0, react_1.useState)(false);
54
+ const [loading, setLoading] = (0, react_1.useState)(false);
62
55
  const [noteValue, setNoteValue] = (0, react_1.useState)('');
56
+ const [error, setError] = (0, react_1.useState)(undefined);
63
57
  const [selectedTransitionIndex, setSelectedTransitionIndex] = (0, react_1.useState)();
64
- const { dialogData, submit } = submitProceed;
65
- const { updateState, clearError } = dialogData;
58
+ const { complete: showComplete, error: submissionError, mutationError, submit, } = submitProceed;
59
+ (0, react_1.useEffect)(() => {
60
+ if (submissionError) {
61
+ setError(submissionError);
62
+ }
63
+ }, [submissionError]);
66
64
  const continueDialogAction = (0, react_1.useCallback)(() => __awaiter(void 0, void 0, void 0, function* () {
67
65
  if (submission && selectedTransitionIndex && handleSnapshot) {
68
66
  const { status } = submission.currentStep.type.transitions[selectedTransitionIndex];
69
- updateState(DialogState.LOADING);
67
+ setLoading(true);
70
68
  yield handleSnapshot();
71
69
  yield submit(status.id, noteValue);
70
+ setLoading(false);
72
71
  }
73
72
  }), [
74
- submission,
75
- selectedTransitionIndex,
76
73
  handleSnapshot,
77
- updateState,
78
- submit,
74
+ selectedTransitionIndex,
75
+ submission,
79
76
  noteValue,
77
+ submit,
80
78
  ]);
81
79
  const onTransitionClick = (0, react_1.useCallback)((event) => {
82
- updateState(DialogState.INIT);
83
80
  toggleConfirmationDialog(true);
84
81
  setSelectedTransitionIndex(event.target.value || event.target.parentNode.value);
85
- }, [setSelectedTransitionIndex, toggleConfirmationDialog, updateState]);
82
+ }, [setSelectedTransitionIndex, toggleConfirmationDialog]);
86
83
  const onCancelClick = (0, react_1.useCallback)(() => {
87
84
  toggleConfirmationDialog(false);
88
85
  setSelectedTransitionIndex(undefined);
89
- clearError();
90
- updateState(DialogState.CLOSED);
91
- }, [
92
- toggleConfirmationDialog,
93
- setSelectedTransitionIndex,
94
- clearError,
95
- updateState,
96
- ]);
86
+ setError(undefined);
87
+ }, [toggleConfirmationDialog, setSelectedTransitionIndex, setError]);
97
88
  const onNoteChange = (0, react_1.useCallback)((event) => setNoteValue(event.target.value), [setNoteValue]);
98
89
  const currentStepTransition = submission === null || submission === void 0 ? void 0 : submission.currentStep.type.transitions;
99
90
  const disable = !currentStepTransition || !canCompleteTask;
100
- const errorCode = (_d = (_c = (_b = (_a = dialogData.mutationError) === null || _a === void 0 ? void 0 : _a.graphQLErrors) === null || _b === void 0 ? void 0 : _b.find((error) => { var _a; return (_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a.code; })) === null || _c === void 0 ? void 0 : _c.extensions) === null || _d === void 0 ? void 0 : _d.code.name;
91
+ 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;
101
92
  return (react_1.default.createElement(Wrapper, null,
102
93
  goBack && (react_1.default.createElement(SecondaryButtonSmall, { onClick: goBack, type: "button" },
103
94
  react_1.default.createElement(__1.LeftArrow, null),
104
95
  react_1.default.createElement("span", null, "Dashboard"))),
105
96
  handleSnapshot &&
106
97
  typeof hasPendingSuggestions == 'boolean' &&
107
- submission.nextStep && (react_1.default.createElement(ProceedView_1.ProceedView, { isAnnotator: isAnnotator, disable: disable, onTransitionClick: onTransitionClick, hasPendingSuggestions: hasPendingSuggestions, dialogData: dialogData, noteValue: noteValue, currentStepTransition: currentStepTransition, currentStepType: submission.currentStep.type, previousStepType: (_e = submission.previousStep) === null || _e === void 0 ? void 0 : _e.type, nextStepType: submission.nextStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
98
+ 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, currentStepType: submission.currentStep.type, previousStepType: (_d = submission.previousStep) === null || _d === void 0 ? void 0 : _d.type, nextStepType: submission.nextStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
108
99
  status && (react_1.default.createElement(ChildWrapper, null,
109
100
  react_1.default.createElement(__1.SaveStatus, { status: status }))),
110
101
  react_1.default.createElement(Spacer, null),
@@ -46,7 +46,7 @@ const StepDetails = ({ icon, label, description, role }) => (react_1.default.cre
46
46
  react_1.default.createElement(__1.SecondarySmallText, null,
47
47
  "Actor: ",
48
48
  role.label))));
49
- const ProceedView = ({ currentStepTransition, onTransitionClick, disable, dialogData, confirmationDialog, previousStepType, currentStepType, isAnnotator, hasPendingSuggestions, onCancelClick, continueDialogAction, message: Message, }) => {
49
+ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loading, showComplete, confirmationDialog, previousStepType, currentStepType, nextStepType, isAnnotator, hasPendingSuggestions, error, noteValue, onNoteChange, onCancelClick, continueDialogAction, message: Message, }) => {
50
50
  const dialogMessages = (0, react_1.useMemo)(() => hasPendingSuggestions && !isAnnotator
51
51
  ? {
52
52
  header: 'The task can not be transitioned to the next step',
@@ -59,7 +59,7 @@ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, dialog
59
59
  },
60
60
  },
61
61
  }
62
- : dialogData.state === __1.DialogState.SUCCESS
62
+ : showComplete
63
63
  ? {
64
64
  header: 'Content reassigned successfully',
65
65
  message: `to the ${currentStepType.label}`,
@@ -84,7 +84,7 @@ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, dialog
84
84
  },
85
85
  },
86
86
  }, [
87
- dialogData,
87
+ showComplete,
88
88
  continueDialogAction,
89
89
  onCancelClick,
90
90
  currentStepType,
@@ -97,15 +97,16 @@ const ProceedView = ({ currentStepTransition, onTransitionClick, disable, dialog
97
97
  currentStepTransition.map((transition, index) => (react_1.default.createElement(Task, { key: 'task_' + transition.type.id, className: transition.status.id === 'success' ? 'happyPath' : '', value: index, onClick: onTransitionClick },
98
98
  react_1.default.createElement("strong", null, transition.type.label),
99
99
  transition.type.description))))))) || (react_1.default.createElement(EditorHeader_1.PrimaryButtonSmall, { value: 0, onClick: onTransitionClick, disabled: disable }, "Complete task")),
100
- dialogData.state === __1.DialogState.LOADING && (react_1.default.createElement(__1.LoadingOverlay, null,
101
- react_1.default.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026"))),
102
- !(dialogData.state === __1.DialogState.CLOSED) && (react_1.default.createElement(__1.Dialog, { isOpen: confirmationDialog && !(dialogData.state === __1.DialogState.LOADING), category: __1.Category.confirmation, header: dialogMessages.header, message: dialogMessages.message, actions: dialogMessages.actions },
103
- dialogData.state === __1.DialogState.SUCCESS && (react_1.default.createElement(Grid, null,
100
+ (loading && (react_1.default.createElement(__1.LoadingOverlay, null,
101
+ 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 },
102
+ (showComplete && (react_1.default.createElement(Grid, null,
104
103
  previousStepType && (react_1.default.createElement(StepDetails, Object.assign({}, previousStepType, { icon: react_1.default.createElement(react_1.default.Fragment, null,
105
104
  react_1.default.createElement(__1.TaskStepDoneIcon, null),
106
105
  react_1.default.createElement(Line, null)) }))),
107
- react_1.default.createElement(StepDetails, Object.assign({}, currentStepType)))),
108
- dialogData.state === __1.DialogState.ERROR && (react_1.default.createElement(AlertMessage_1.AlertMessage, { type: AlertMessage_1.AlertMessageType.error, hideCloseButton: true }, dialogData.error))))));
106
+ react_1.default.createElement(StepDetails, Object.assign({}, currentStepType))))) ||
107
+ ((!hasPendingSuggestions || isAnnotator) && onNoteChange && (react_1.default.createElement(TextAreaWrapper, null,
108
+ react_1.default.createElement(EditorHeader_1.MediumTextArea, { value: noteValue, onChange: onNoteChange, rows: 5, placeholder: 'Add any additional comment here...' })))),
109
+ error && (react_1.default.createElement(AlertMessage_1.AlertMessage, { type: AlertMessage_1.AlertMessageType.error, hideCloseButton: true }, error))))));
109
110
  };
110
111
  exports.ProceedView = ProceedView;
111
112
  const TaskDropdown = styled_components_1.default.div `
@@ -7,18 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import React, { useCallback, useState } from 'react';
10
+ import React, { useCallback, useEffect, useState } from 'react';
11
11
  import styled from 'styled-components';
12
12
  import { AnnotatorIcon, DropdownContainer, DropdownList, EditIcon, LeftArrow, NavDropdownContainer, NavDropdownToggle, PrimaryButton, ReadingIcon, SaveStatus, SecondaryButton, TextArea, useDropdown, } from '../..';
13
13
  import { ProceedView } from './ProceedView';
14
- export var DialogState;
15
- (function (DialogState) {
16
- DialogState[DialogState["INIT"] = 0] = "INIT";
17
- DialogState[DialogState["LOADING"] = 1] = "LOADING";
18
- DialogState[DialogState["ERROR"] = 2] = "ERROR";
19
- DialogState[DialogState["SUCCESS"] = 3] = "SUCCESS";
20
- DialogState[DialogState["CLOSED"] = 4] = "CLOSED";
21
- })(DialogState || (DialogState = {}));
22
14
  const Editing = { label: 'Editing...', icon: EditIcon };
23
15
  const MapUserRole = {
24
16
  Editor: Editing,
@@ -28,54 +20,53 @@ const MapUserRole = {
28
20
  Viewer: { label: 'Reading...', icon: ReadingIcon },
29
21
  };
30
22
  export const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions, userRole, canCompleteTask, submitProceed, goBack, status, isAnnotator, message, exceptionDialog: ExceptionDialog, disabelProceedNote, }) => {
31
- var _a, _b, _c, _d, _e;
23
+ var _a, _b, _c, _d;
32
24
  const [confirmationDialog, toggleConfirmationDialog] = useState(false);
25
+ const [loading, setLoading] = useState(false);
33
26
  const [noteValue, setNoteValue] = useState('');
27
+ const [error, setError] = useState(undefined);
34
28
  const [selectedTransitionIndex, setSelectedTransitionIndex] = useState();
35
- const { dialogData, submit } = submitProceed;
36
- const { updateState, clearError } = dialogData;
29
+ const { complete: showComplete, error: submissionError, mutationError, submit, } = submitProceed;
30
+ useEffect(() => {
31
+ if (submissionError) {
32
+ setError(submissionError);
33
+ }
34
+ }, [submissionError]);
37
35
  const continueDialogAction = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
38
36
  if (submission && selectedTransitionIndex && handleSnapshot) {
39
37
  const { status } = submission.currentStep.type.transitions[selectedTransitionIndex];
40
- updateState(DialogState.LOADING);
38
+ setLoading(true);
41
39
  yield handleSnapshot();
42
40
  yield submit(status.id, noteValue);
41
+ setLoading(false);
43
42
  }
44
43
  }), [
45
- submission,
46
- selectedTransitionIndex,
47
44
  handleSnapshot,
48
- updateState,
49
- submit,
45
+ selectedTransitionIndex,
46
+ submission,
50
47
  noteValue,
48
+ submit,
51
49
  ]);
52
50
  const onTransitionClick = useCallback((event) => {
53
- updateState(DialogState.INIT);
54
51
  toggleConfirmationDialog(true);
55
52
  setSelectedTransitionIndex(event.target.value || event.target.parentNode.value);
56
- }, [setSelectedTransitionIndex, toggleConfirmationDialog, updateState]);
53
+ }, [setSelectedTransitionIndex, toggleConfirmationDialog]);
57
54
  const onCancelClick = useCallback(() => {
58
55
  toggleConfirmationDialog(false);
59
56
  setSelectedTransitionIndex(undefined);
60
- clearError();
61
- updateState(DialogState.CLOSED);
62
- }, [
63
- toggleConfirmationDialog,
64
- setSelectedTransitionIndex,
65
- clearError,
66
- updateState,
67
- ]);
57
+ setError(undefined);
58
+ }, [toggleConfirmationDialog, setSelectedTransitionIndex, setError]);
68
59
  const onNoteChange = useCallback((event) => setNoteValue(event.target.value), [setNoteValue]);
69
60
  const currentStepTransition = submission === null || submission === void 0 ? void 0 : submission.currentStep.type.transitions;
70
61
  const disable = !currentStepTransition || !canCompleteTask;
71
- const errorCode = (_d = (_c = (_b = (_a = dialogData.mutationError) === null || _a === void 0 ? void 0 : _a.graphQLErrors) === null || _b === void 0 ? void 0 : _b.find((error) => { var _a; return (_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a.code; })) === null || _c === void 0 ? void 0 : _c.extensions) === null || _d === void 0 ? void 0 : _d.code.name;
62
+ 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;
72
63
  return (React.createElement(Wrapper, null,
73
64
  goBack && (React.createElement(SecondaryButtonSmall, { onClick: goBack, type: "button" },
74
65
  React.createElement(LeftArrow, null),
75
66
  React.createElement("span", null, "Dashboard"))),
76
67
  handleSnapshot &&
77
68
  typeof hasPendingSuggestions == 'boolean' &&
78
- submission.nextStep && (React.createElement(ProceedView, { isAnnotator: isAnnotator, disable: disable, onTransitionClick: onTransitionClick, hasPendingSuggestions: hasPendingSuggestions, dialogData: dialogData, noteValue: noteValue, currentStepTransition: currentStepTransition, currentStepType: submission.currentStep.type, previousStepType: (_e = submission.previousStep) === null || _e === void 0 ? void 0 : _e.type, nextStepType: submission.nextStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
69
+ submission.nextStep && (React.createElement(ProceedView, { isAnnotator: isAnnotator, disable: disable, onTransitionClick: onTransitionClick, hasPendingSuggestions: hasPendingSuggestions, loading: loading, showComplete: showComplete, noteValue: noteValue, currentStepTransition: currentStepTransition, error: error, currentStepType: submission.currentStep.type, previousStepType: (_d = submission.previousStep) === null || _d === void 0 ? void 0 : _d.type, nextStepType: submission.nextStep.type, confirmationDialog: confirmationDialog, onNoteChange: disabelProceedNote ? undefined : onNoteChange, continueDialogAction: continueDialogAction, onCancelClick: onCancelClick, message: message })),
79
70
  status && (React.createElement(ChildWrapper, null,
80
71
  React.createElement(SaveStatus, { status: status }))),
81
72
  React.createElement(Spacer, null),
@@ -1,8 +1,8 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import styled from 'styled-components';
3
- import { Category, Dialog, DialogState, LoadingOverlay, NavDropdown, NavDropdownButton, NavDropdownContainer, PrimaryBoldHeading, PrimaryButton, SecondarySmallText, TaskStepDoneIcon, useDropdown, } from '../..';
3
+ import { Category, Dialog, LoadingOverlay, NavDropdown, NavDropdownButton, NavDropdownContainer, PrimaryBoldHeading, PrimaryButton, SecondarySmallText, TaskStepDoneIcon, useDropdown, } from '../..';
4
4
  import { AlertMessage, AlertMessageType } from '../AlertMessage';
5
- import { PrimaryButtonSmall, } from './EditorHeader';
5
+ import { MediumTextArea, PrimaryButtonSmall, } from './EditorHeader';
6
6
  const DropdownWrapper = ({ disabled, button, primary, children }) => {
7
7
  const { isOpen, toggleOpen, wrapperRef } = useDropdown();
8
8
  return (React.createElement(NavDropdownContainer, { id: 'user-dropdown', ref: wrapperRef },
@@ -17,7 +17,7 @@ const StepDetails = ({ icon, label, description, role }) => (React.createElement
17
17
  React.createElement(SecondarySmallText, null,
18
18
  "Actor: ",
19
19
  role.label))));
20
- export const ProceedView = ({ currentStepTransition, onTransitionClick, disable, dialogData, confirmationDialog, previousStepType, currentStepType, isAnnotator, hasPendingSuggestions, onCancelClick, continueDialogAction, message: Message, }) => {
20
+ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable, loading, showComplete, confirmationDialog, previousStepType, currentStepType, nextStepType, isAnnotator, hasPendingSuggestions, error, noteValue, onNoteChange, onCancelClick, continueDialogAction, message: Message, }) => {
21
21
  const dialogMessages = useMemo(() => hasPendingSuggestions && !isAnnotator
22
22
  ? {
23
23
  header: 'The task can not be transitioned to the next step',
@@ -30,7 +30,7 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
30
30
  },
31
31
  },
32
32
  }
33
- : dialogData.state === DialogState.SUCCESS
33
+ : showComplete
34
34
  ? {
35
35
  header: 'Content reassigned successfully',
36
36
  message: `to the ${currentStepType.label}`,
@@ -55,7 +55,7 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
55
55
  },
56
56
  },
57
57
  }, [
58
- dialogData,
58
+ showComplete,
59
59
  continueDialogAction,
60
60
  onCancelClick,
61
61
  currentStepType,
@@ -68,15 +68,16 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
68
68
  currentStepTransition.map((transition, index) => (React.createElement(Task, { key: 'task_' + transition.type.id, className: transition.status.id === 'success' ? 'happyPath' : '', value: index, onClick: onTransitionClick },
69
69
  React.createElement("strong", null, transition.type.label),
70
70
  transition.type.description))))))) || (React.createElement(PrimaryButtonSmall, { value: 0, onClick: onTransitionClick, disabled: disable }, "Complete task")),
71
- dialogData.state === DialogState.LOADING && (React.createElement(LoadingOverlay, null,
72
- React.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026"))),
73
- !(dialogData.state === DialogState.CLOSED) && (React.createElement(Dialog, { isOpen: confirmationDialog && !(dialogData.state === DialogState.LOADING), category: Category.confirmation, header: dialogMessages.header, message: dialogMessages.message, actions: dialogMessages.actions },
74
- dialogData.state === DialogState.SUCCESS && (React.createElement(Grid, null,
71
+ (loading && (React.createElement(LoadingOverlay, null,
72
+ React.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026")))) || (React.createElement(Dialog, { isOpen: confirmationDialog && !loading, category: Category.confirmation, header: dialogMessages.header, message: dialogMessages.message, actions: dialogMessages.actions },
73
+ (showComplete && (React.createElement(Grid, null,
75
74
  previousStepType && (React.createElement(StepDetails, Object.assign({}, previousStepType, { icon: React.createElement(React.Fragment, null,
76
75
  React.createElement(TaskStepDoneIcon, null),
77
76
  React.createElement(Line, null)) }))),
78
- React.createElement(StepDetails, Object.assign({}, currentStepType)))),
79
- dialogData.state === DialogState.ERROR && (React.createElement(AlertMessage, { type: AlertMessageType.error, hideCloseButton: true }, dialogData.error))))));
77
+ React.createElement(StepDetails, Object.assign({}, currentStepType))))) ||
78
+ ((!hasPendingSuggestions || isAnnotator) && onNoteChange && (React.createElement(TextAreaWrapper, null,
79
+ React.createElement(MediumTextArea, { value: noteValue, onChange: onNoteChange, rows: 5, placeholder: 'Add any additional comment here...' })))),
80
+ error && (React.createElement(AlertMessage, { type: AlertMessageType.error, hideCloseButton: true }, error))))));
80
81
  };
81
82
  const TaskDropdown = styled.div `
82
83
  display: flex;
@@ -26,20 +26,6 @@ export type SubmissionStepType = {
26
26
  label: string;
27
27
  };
28
28
  };
29
- export declare enum DialogState {
30
- INIT = 0,
31
- LOADING = 1,
32
- ERROR = 2,
33
- SUCCESS = 3,
34
- CLOSED = 4
35
- }
36
- export type ProceedDialogData = {
37
- state: DialogState;
38
- error?: string;
39
- mutationError?: ApolloError | undefined;
40
- updateState: (state: DialogState) => void;
41
- clearError: () => void;
42
- };
43
29
  export declare const EditorHeader: React.FC<{
44
30
  handleSnapshot?: () => Promise<void>;
45
31
  submission: PartialSubmission;
@@ -50,7 +36,9 @@ export declare const EditorHeader: React.FC<{
50
36
  }>;
51
37
  userRole: string;
52
38
  submitProceed: {
53
- dialogData: ProceedDialogData;
39
+ complete: boolean;
40
+ error: string;
41
+ mutationError: ApolloError | undefined;
54
42
  submit: (statusId: string, noteValue: string) => Promise<unknown>;
55
43
  };
56
44
  goBack?: () => void;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ProceedDialogData } from '../..';
3
2
  import { SubmissionStepTransition, SubmissionStepType } from './EditorHeader';
4
3
  export declare const ProceedView: React.FC<{
5
4
  isAnnotator: boolean;
@@ -7,9 +6,11 @@ export declare const ProceedView: React.FC<{
7
6
  onTransitionClick: (event: unknown) => void;
8
7
  onNoteChange?: (event: unknown) => void;
9
8
  hasPendingSuggestions: boolean;
10
- dialogData: ProceedDialogData;
9
+ loading: boolean;
10
+ showComplete: boolean;
11
11
  noteValue: string;
12
12
  currentStepTransition: SubmissionStepTransition[];
13
+ error: string | undefined;
13
14
  previousStepType: SubmissionStepType | undefined;
14
15
  currentStepType: SubmissionStepType;
15
16
  nextStepType: SubmissionStepType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/style-guide",
3
3
  "description": "Shared components for Manuscripts applications",
4
- "version": "1.1.15-LEAN-2620-1",
4
+ "version": "1.1.15-LEAN-2651",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -36,7 +36,7 @@
36
36
  "@formatjs/intl-relativetimeformat": "^4.5.9",
37
37
  "@formatjs/intl-utils": "^2.2.0",
38
38
  "@manuscripts/assets": "^0.6.2",
39
- "@manuscripts/transform": "^1.3.4",
39
+ "@manuscripts/transform": "1.3.6-LEAN-2650",
40
40
  "@manuscripts/json-schema": "^2.1.0",
41
41
  "@manuscripts/title-editor": "^1.1.0",
42
42
  "@manuscripts/comment-editor": "^1.0.3",
@@ -75,7 +75,6 @@
75
75
  "@babel/preset-react": "^7.18.6",
76
76
  "@babel/preset-typescript": "^7.18.6",
77
77
  "@inline-svg-unique-id/react": "^1.2.3",
78
- "@manuscripts/data": "^1.0.2",
79
78
  "@manuscripts/eslint-config": "^0.5.1",
80
79
  "@manuscripts/examples": "^0.0.7",
81
80
  "@storybook/addon-actions": "^6.5.15",