@manuscripts/style-guide 1.3.5 → 1.3.6-LEAN-2705
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/EditorHeader/EditorHeader.js +3 -11
- package/dist/cjs/components/EditorHeader/ProceedView.js +25 -6
- package/dist/cjs/components/FileManager/{FileSectionItem/DragLayer.js → DragLayer.js} +12 -10
- package/dist/cjs/components/FileManager/FileActions.js +134 -0
- package/dist/cjs/components/FileManager/FileContainer.js +39 -0
- package/dist/cjs/components/FileManager/FileCreatedDate.js +25 -0
- package/dist/cjs/components/FileManager/FileManager.js +14 -125
- package/dist/cjs/components/FileManager/FileManagerProvider.js +2 -7
- package/dist/cjs/components/FileManager/FileName.js +27 -0
- package/dist/cjs/components/FileManager/FileSectionAlert.js +170 -0
- package/dist/cjs/components/FileManager/FileTypeIcon.js +22 -0
- package/dist/cjs/components/FileManager/{UploadFileArea.js → FileUploader.js} +19 -12
- package/dist/cjs/components/FileManager/InlineFilesSection.js +71 -126
- package/dist/cjs/components/FileManager/OtherFilesSection.js +101 -0
- package/dist/cjs/components/FileManager/SupplementsSection.js +118 -0
- package/dist/cjs/components/FileManager/{TooltipDiv.js → Tooltip.js} +8 -3
- package/dist/cjs/components/FileManager/util.js +52 -67
- package/dist/cjs/components/icons/corrupted-file-icon.js +27 -0
- package/dist/cjs/components/icons/document-icon-with-dot.js +1 -1
- package/dist/cjs/hooks/use-deep-compare.js +2 -2
- package/dist/cjs/hooks/use-files.js +29 -43
- package/dist/cjs/index.js +3 -4
- package/dist/cjs/lib/capabilities.js +1 -0
- package/dist/cjs/lib/files.js +85 -0
- package/dist/es/components/EditorHeader/EditorHeader.js +3 -11
- package/dist/es/components/EditorHeader/ProceedView.js +26 -7
- package/dist/es/components/FileManager/{FileSectionItem/DragLayer.js → DragLayer.js} +12 -10
- package/dist/es/components/FileManager/FileActions.js +104 -0
- package/dist/es/components/FileManager/FileContainer.js +33 -0
- package/dist/es/components/FileManager/FileCreatedDate.js +18 -0
- package/dist/es/components/FileManager/FileManager.js +16 -124
- package/dist/es/components/FileManager/FileManagerProvider.js +3 -8
- package/dist/es/components/FileManager/FileName.js +20 -0
- package/dist/es/components/FileManager/FileSectionAlert.js +163 -0
- package/dist/es/components/FileManager/FileTypeIcon.js +15 -0
- package/dist/es/components/FileManager/{UploadFileArea.js → FileUploader.js} +17 -10
- package/dist/es/components/FileManager/InlineFilesSection.js +72 -127
- package/dist/es/components/FileManager/OtherFilesSection.js +74 -0
- package/dist/es/components/FileManager/SupplementsSection.js +91 -0
- package/dist/es/components/FileManager/{TooltipDiv.js → Tooltip.js} +7 -2
- package/dist/es/components/FileManager/util.js +47 -65
- package/dist/es/components/icons/corrupted-file-icon.js +22 -0
- package/dist/es/components/icons/document-icon-with-dot.js +1 -1
- package/dist/es/hooks/use-deep-compare.js +2 -2
- package/dist/es/hooks/use-files.js +29 -40
- package/dist/es/index.js +2 -2
- package/dist/es/lib/capabilities.js +1 -0
- package/dist/es/lib/files.js +79 -0
- package/dist/types/components/EditorHeader/ProceedView.d.ts +0 -1
- package/dist/types/components/FileManager/FileActions.d.ts +19 -0
- package/dist/types/components/FileManager/FileContainer.d.ts +1 -0
- package/dist/types/components/FileManager/FileCreatedDate.d.ts +8 -0
- package/dist/types/components/FileManager/FileManager.d.ts +17 -8
- package/dist/types/components/FileManager/FileManagerProvider.d.ts +8 -18
- package/dist/types/components/FileManager/FileName.d.ts +6 -0
- package/dist/types/components/FileManager/FileSectionAlert.d.ts +13 -0
- package/dist/types/components/FileManager/{FileSectionItem/FileTypeIcon.d.ts → FileTypeIcon.d.ts} +2 -3
- package/dist/types/components/FileManager/FileUploader.d.ts +4 -0
- package/dist/types/components/FileManager/InlineFilesSection.d.ts +3 -19
- package/dist/types/components/FileManager/OtherFilesSection.d.ts +5 -0
- package/dist/types/components/FileManager/SupplementsSection.d.ts +5 -0
- package/dist/types/components/FileManager/Tooltip.d.ts +2 -0
- package/dist/types/components/FileManager/util.d.ts +8 -12
- package/dist/types/components/icons/corrupted-file-icon.d.ts +19 -0
- package/dist/types/hooks/use-files.d.ts +4 -6
- package/dist/types/index.d.ts +2 -2
- package/dist/types/lib/capabilities.d.ts +1 -0
- package/dist/types/lib/files.d.ts +24 -0
- package/package.json +3 -3
- package/dist/cjs/components/FileManager/ConfirmationPopUp.js +0 -90
- package/dist/cjs/components/FileManager/DragItemArea.js +0 -28
- package/dist/cjs/components/FileManager/FileSectionItem/DraggableFileSectionItem.js +0 -76
- package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +0 -115
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +0 -95
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionUploadItem.js +0 -37
- package/dist/cjs/components/FileManager/FileSectionItem/FileTypeIcon.js +0 -53
- package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +0 -92
- package/dist/cjs/components/FileManager/FileSectionItem/ProgressBarUploadItem.js +0 -120
- package/dist/cjs/components/FileManager/FileSectionState.js +0 -83
- package/dist/cjs/components/FileManager/FilesSection.js +0 -61
- package/dist/cjs/components/FileManager/ItemsAction.js +0 -48
- package/dist/cjs/lib/inlineFiles.js +0 -92
- package/dist/es/components/FileManager/ConfirmationPopUp.js +0 -62
- package/dist/es/components/FileManager/DragItemArea.js +0 -21
- package/dist/es/components/FileManager/FileSectionItem/DraggableFileSectionItem.js +0 -46
- package/dist/es/components/FileManager/FileSectionItem/FileInfo.js +0 -85
- package/dist/es/components/FileManager/FileSectionItem/FileSectionItem.js +0 -88
- package/dist/es/components/FileManager/FileSectionItem/FileSectionUploadItem.js +0 -30
- package/dist/es/components/FileManager/FileSectionItem/FileTypeIcon.js +0 -46
- package/dist/es/components/FileManager/FileSectionItem/ItemActions.js +0 -65
- package/dist/es/components/FileManager/FileSectionItem/ProgressBarUploadItem.js +0 -113
- package/dist/es/components/FileManager/FileSectionState.js +0 -78
- package/dist/es/components/FileManager/FilesSection.js +0 -34
- package/dist/es/components/FileManager/ItemsAction.js +0 -42
- package/dist/es/lib/inlineFiles.js +0 -90
- package/dist/types/components/FileManager/ConfirmationPopUp.d.ts +0 -12
- package/dist/types/components/FileManager/DragItemArea.d.ts +0 -4
- package/dist/types/components/FileManager/FileSectionItem/DraggableFileSectionItem.d.ts +0 -3
- package/dist/types/components/FileManager/FileSectionItem/FileInfo.d.ts +0 -19
- package/dist/types/components/FileManager/FileSectionItem/FileSectionItem.d.ts +0 -38
- package/dist/types/components/FileManager/FileSectionItem/FileSectionUploadItem.d.ts +0 -12
- package/dist/types/components/FileManager/FileSectionItem/ItemActions.d.ts +0 -21
- package/dist/types/components/FileManager/FileSectionItem/ProgressBarUploadItem.d.ts +0 -4
- package/dist/types/components/FileManager/FileSectionState.d.ts +0 -38
- package/dist/types/components/FileManager/FilesSection.d.ts +0 -12
- package/dist/types/components/FileManager/ItemsAction.d.ts +0 -4
- package/dist/types/components/FileManager/TooltipDiv.d.ts +0 -1
- package/dist/types/components/FileManager/UploadFileArea.d.ts +0 -9
- package/dist/types/lib/inlineFiles.d.ts +0 -11
- /package/dist/types/components/FileManager/{FileSectionItem/DragLayer.d.ts → DragLayer.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Category, Dialog, DialogState, LoadingOverlay, NavDropdown, NavDropdownButton, NavDropdownContainer, PrimaryBoldHeading, PrimaryButton, SecondarySmallText, TaskStepDoneIcon, useDropdown, } from '../..';
|
|
4
4
|
import { AlertMessage, AlertMessageType } from '../AlertMessage';
|
|
@@ -17,8 +17,11 @@ 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,
|
|
21
|
-
const dialogMessages = useMemo(() => hasPendingSuggestions &&
|
|
20
|
+
export const ProceedView = ({ currentStepTransition, onTransitionClick, disable, dialogData, previousStepType, currentStepType, isAnnotator, isProofer, hasPendingSuggestions, onCancelClick, continueDialogAction, message: Message, }) => {
|
|
21
|
+
const dialogMessages = useMemo(() => hasPendingSuggestions &&
|
|
22
|
+
!isAnnotator &&
|
|
23
|
+
!isProofer &&
|
|
24
|
+
dialogData.state !== DialogState.SUCCESS
|
|
22
25
|
? {
|
|
23
26
|
header: 'The task can not be transitioned to the next step',
|
|
24
27
|
message: `There are still pending suggestions in the document.
|
|
@@ -28,6 +31,7 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
|
|
|
28
31
|
action: onCancelClick,
|
|
29
32
|
title: 'Ok',
|
|
30
33
|
},
|
|
34
|
+
onClose: onCancelClick,
|
|
31
35
|
},
|
|
32
36
|
}
|
|
33
37
|
: dialogData.state === DialogState.SUCCESS
|
|
@@ -39,6 +43,7 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
|
|
|
39
43
|
action: onCancelClick,
|
|
40
44
|
title: 'Close',
|
|
41
45
|
},
|
|
46
|
+
onClose: onCancelClick,
|
|
42
47
|
},
|
|
43
48
|
}
|
|
44
49
|
: {
|
|
@@ -53,6 +58,7 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
|
|
|
53
58
|
action: onCancelClick,
|
|
54
59
|
title: 'Cancel',
|
|
55
60
|
},
|
|
61
|
+
onClose: onCancelClick,
|
|
56
62
|
},
|
|
57
63
|
}, [
|
|
58
64
|
dialogData,
|
|
@@ -63,21 +69,34 @@ export const ProceedView = ({ currentStepTransition, onTransitionClick, disable,
|
|
|
63
69
|
isAnnotator,
|
|
64
70
|
isProofer,
|
|
65
71
|
]);
|
|
72
|
+
const prevDialogMsgs = useRef();
|
|
73
|
+
const prevDialogueState = useRef();
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
prevDialogMsgs.current = dialogMessages;
|
|
76
|
+
prevDialogueState.current = dialogData.state;
|
|
77
|
+
}, [dialogData.state]);
|
|
78
|
+
const messages = dialogData.state === DialogState.CLOSED && prevDialogMsgs.current
|
|
79
|
+
? prevDialogMsgs.current
|
|
80
|
+
: dialogMessages;
|
|
81
|
+
const finalState = dialogData.state === DialogState.CLOSED && prevDialogueState.current
|
|
82
|
+
? prevDialogueState.current
|
|
83
|
+
: dialogData.state;
|
|
66
84
|
return (React.createElement(React.Fragment, null,
|
|
67
85
|
(currentStepTransition && (currentStepTransition === null || currentStepTransition === void 0 ? void 0 : currentStepTransition.length) > 1 && (React.createElement(DropdownWrapper, { button: 'Complete task', disabled: disable, primary: true },
|
|
68
86
|
React.createElement(TaskDropdown, null, currentStepTransition &&
|
|
69
87
|
currentStepTransition.map((transition, index) => (React.createElement(Task, { key: 'task_' + transition.type.id, className: transition.status.id === 'success' ? 'happyPath' : '', value: index, onClick: onTransitionClick },
|
|
70
88
|
React.createElement("strong", null, transition.type.label),
|
|
71
89
|
transition.type.description))))))) || (React.createElement(PrimaryButtonSmall, { value: 0, onClick: onTransitionClick, disabled: disable }, "Complete task")),
|
|
72
|
-
|
|
90
|
+
finalState === DialogState.LOADING && (React.createElement(LoadingOverlay, null,
|
|
73
91
|
React.createElement(Message, { isCentered: true }, "Proceeding with your submission\u2026"))),
|
|
74
|
-
|
|
75
|
-
|
|
92
|
+
React.createElement(Dialog, { isOpen: dialogData.state !== DialogState.CLOSED &&
|
|
93
|
+
dialogData.state !== DialogState.LOADING, category: Category.confirmation, header: messages.header, message: messages.message, actions: messages.actions },
|
|
94
|
+
finalState === DialogState.SUCCESS && (React.createElement(Grid, null,
|
|
76
95
|
previousStepType && (React.createElement(StepDetails, Object.assign({}, previousStepType, { icon: React.createElement(React.Fragment, null,
|
|
77
96
|
React.createElement(TaskStepDoneIcon, null),
|
|
78
97
|
React.createElement(Line, null)) }))),
|
|
79
98
|
React.createElement(StepDetails, Object.assign({}, currentStepType)))),
|
|
80
|
-
|
|
99
|
+
finalState === DialogState.ERROR && (React.createElement(AlertMessage, { type: AlertMessageType.error, hideCloseButton: true }, dialogData.error)))));
|
|
81
100
|
};
|
|
82
101
|
const TaskDropdown = styled.div `
|
|
83
102
|
display: flex;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useDragLayer } from 'react-dnd';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import {
|
|
4
|
+
import { FileContainer } from './FileContainer';
|
|
5
|
+
import { FileCreatedDate } from './FileCreatedDate';
|
|
6
|
+
import { FileName } from './FileName';
|
|
5
7
|
function getItemStyles(initialOffset, currentOffset) {
|
|
6
8
|
if (!initialOffset || !currentOffset) {
|
|
7
9
|
return {
|
|
@@ -25,8 +27,10 @@ export const DragLayer = () => {
|
|
|
25
27
|
}));
|
|
26
28
|
const renderItem = useCallback(() => {
|
|
27
29
|
switch (itemType) {
|
|
28
|
-
case '
|
|
29
|
-
return (React.createElement(
|
|
30
|
+
case 'file':
|
|
31
|
+
return (React.createElement(DraggableFileContainer, null,
|
|
32
|
+
React.createElement(FileName, { file: item.file }),
|
|
33
|
+
item.file.createdDate && React.createElement(FileCreatedDate, { file: item.file })));
|
|
30
34
|
default:
|
|
31
35
|
return null;
|
|
32
36
|
}
|
|
@@ -34,8 +38,7 @@ export const DragLayer = () => {
|
|
|
34
38
|
if (!isDragging) {
|
|
35
39
|
return null;
|
|
36
40
|
}
|
|
37
|
-
return (React.createElement(Container,
|
|
38
|
-
React.createElement("div", { style: getItemStyles(initialOffset, currentOffset) }, renderItem())));
|
|
41
|
+
return (React.createElement(Container, { style: getItemStyles(initialOffset, currentOffset) }, renderItem()));
|
|
39
42
|
};
|
|
40
43
|
const Container = styled.div `
|
|
41
44
|
position: fixed;
|
|
@@ -43,13 +46,12 @@ const Container = styled.div `
|
|
|
43
46
|
z-index: 999;
|
|
44
47
|
left: 0;
|
|
45
48
|
top: 0;
|
|
46
|
-
width:
|
|
47
|
-
height: 100%;
|
|
49
|
+
max-width: 400px;
|
|
48
50
|
`;
|
|
49
|
-
const
|
|
51
|
+
const DraggableFileContainer = styled(FileContainer) `
|
|
50
52
|
padding: 16px 32px;
|
|
51
53
|
background: #f2fbfc;
|
|
52
54
|
border: 1px solid #bce7f6;
|
|
53
|
-
box-shadow:
|
|
55
|
+
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
54
56
|
border-radius: 6px;
|
|
55
|
-
|
|
57
|
+
`;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import React, { useContext, useRef, useState } from 'react';
|
|
11
|
+
import styled from 'styled-components';
|
|
12
|
+
import { useDropdown } from '../../hooks/use-dropdown';
|
|
13
|
+
import { Category, Dialog } from '../Dialog';
|
|
14
|
+
import { DropdownContainer, DropdownList } from '../Dropdown';
|
|
15
|
+
import DotsIcon from '../icons/dots-icon';
|
|
16
|
+
import { PermissionsContext } from './FileManager';
|
|
17
|
+
export const FileActions = ({ sectionType, handleDownload, handleReplace, handleDetach, move, className, }) => {
|
|
18
|
+
const can = useContext(PermissionsContext);
|
|
19
|
+
const { isOpen, toggleOpen, wrapperRef } = useDropdown();
|
|
20
|
+
const [isMoveDialogOpen, setMoveDialogOpen] = useState(false);
|
|
21
|
+
const showDownload = (can === null || can === void 0 ? void 0 : can.downloadFiles) && handleDownload;
|
|
22
|
+
const showReplace = (can === null || can === void 0 ? void 0 : can.replaceFile) && handleReplace;
|
|
23
|
+
const showDetach = (can === null || can === void 0 ? void 0 : can.editArticle) && handleDetach;
|
|
24
|
+
const showMove = (can === null || can === void 0 ? void 0 : can.moveFile) && move;
|
|
25
|
+
const show = showDownload || showReplace || showDetach || showMove;
|
|
26
|
+
const fileInputRef = useRef(null);
|
|
27
|
+
const handleChange = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
if (handleReplace && event && event.target && event.target.files) {
|
|
29
|
+
const file = event.target.files[0];
|
|
30
|
+
yield handleReplace(file);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const openFileDialog = () => {
|
|
34
|
+
if (fileInputRef && fileInputRef.current) {
|
|
35
|
+
fileInputRef.current.click();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return show ? (React.createElement(DropdownContainer, { ref: wrapperRef },
|
|
39
|
+
React.createElement(ActionsIcon, { onClick: toggleOpen, type: "button", className: "show-on-hover", "aria-label": "Actions", "aria-pressed": isOpen },
|
|
40
|
+
React.createElement(DotsIcon, null)),
|
|
41
|
+
isOpen && (React.createElement(FileActionDropdownList, { direction: "right", className: className, width: 192, top: 5, onClick: toggleOpen },
|
|
42
|
+
showDownload && (React.createElement(FileAction, { onClick: handleDownload }, "Download")),
|
|
43
|
+
showReplace && (React.createElement(React.Fragment, null,
|
|
44
|
+
React.createElement(FileAction, { onClick: openFileDialog }, "Replace"),
|
|
45
|
+
React.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleChange }))),
|
|
46
|
+
showDetach && React.createElement(FileAction, { onClick: handleDetach }, "Detach"),
|
|
47
|
+
showMove && (React.createElement(FileAction, { onClick: () => setMoveDialogOpen(true) },
|
|
48
|
+
"Move to ",
|
|
49
|
+
move.sectionType)))),
|
|
50
|
+
showMove && (React.createElement(MoveFileConfirmationDialog, { isOpen: isMoveDialogOpen, close: () => setMoveDialogOpen(false), source: sectionType, target: move.sectionType, handleMove: move.handler })))) : (React.createElement(React.Fragment, null));
|
|
51
|
+
};
|
|
52
|
+
const MoveFileConfirmationDialog = ({ isOpen, close, source, target, handleMove }) => {
|
|
53
|
+
const header = `Are you sure you want to move this file to “${target}”?`;
|
|
54
|
+
const message = `The file will be removed from “${source}” and added to “${target}”.`;
|
|
55
|
+
const handleConfirm = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
yield handleMove();
|
|
57
|
+
close();
|
|
58
|
+
});
|
|
59
|
+
return (React.createElement(Dialog, { isOpen: isOpen, category: Category.confirmation, header: header, message: message, actions: {
|
|
60
|
+
primary: {
|
|
61
|
+
action: handleConfirm,
|
|
62
|
+
title: 'Move',
|
|
63
|
+
},
|
|
64
|
+
secondary: {
|
|
65
|
+
action: () => close(),
|
|
66
|
+
title: 'Cancel',
|
|
67
|
+
},
|
|
68
|
+
} }));
|
|
69
|
+
};
|
|
70
|
+
export const ActionsIcon = styled.button `
|
|
71
|
+
border: none;
|
|
72
|
+
background: transparent;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
padding: 0 8px;
|
|
75
|
+
&:focus {
|
|
76
|
+
outline: none;
|
|
77
|
+
}
|
|
78
|
+
&:hover svg circle {
|
|
79
|
+
fill: #1a9bc7;
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
export const FileActionDropdownList = styled(DropdownList) `
|
|
83
|
+
border: 1px solid #e2e2e2;
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
86
|
+
border-radius: 8px;
|
|
87
|
+
min-width: 180px;
|
|
88
|
+
background: ${(props) => props.theme.colors.background.primary};
|
|
89
|
+
z-index: 999;
|
|
90
|
+
text-align: left;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
`;
|
|
93
|
+
export const FileAction = styled.div `
|
|
94
|
+
font-family: ${(props) => props.theme.font.family.Lato};
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
font-size: 16px;
|
|
97
|
+
line-height: 24px;
|
|
98
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
99
|
+
padding: 16px;
|
|
100
|
+
&:hover,
|
|
101
|
+
&:focus {
|
|
102
|
+
background: #f2fbfc;
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export const FileContainer = styled.div `
|
|
3
|
+
display: flex;
|
|
4
|
+
font-family: ${(props) => props.theme.font.family.Lato};
|
|
5
|
+
align-items: center;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
position: relative;
|
|
9
|
+
padding: 24px 18px;
|
|
10
|
+
height: 72px;
|
|
11
|
+
|
|
12
|
+
&.dragging {
|
|
13
|
+
opacity: 0.2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.file-icon {
|
|
17
|
+
min-width: 20px;
|
|
18
|
+
width: 20px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.show-on-hover {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:hover .show-on-hover {
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:hover,
|
|
30
|
+
&:focus {
|
|
31
|
+
background: #f2fbfc;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { format } from 'date-fns';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Tooltip } from './Tooltip';
|
|
5
|
+
export const FileCreatedDate = ({ file, className }) => {
|
|
6
|
+
return file.createdDate ? (React.createElement(FileDateContainer, { "data-tip": "File Uploaded", "data-for": `${file.id}-created-date`, className: className },
|
|
7
|
+
React.createElement(FileDate, null, format(new Date(file.createdDate), 'M/d/yy, HH:mm')),
|
|
8
|
+
React.createElement(Tooltip, { id: `${file.id}-created-date`, place: "bottom", offset: { top: 0 }, effect: "solid", className: "tooltip" }, "File Uploaded"))) : (React.createElement(React.Fragment, null));
|
|
9
|
+
};
|
|
10
|
+
export const FileDateContainer = styled.div `
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
min-width: 88px;
|
|
13
|
+
margin-left: 8px;
|
|
14
|
+
`;
|
|
15
|
+
export const FileDate = styled.div `
|
|
16
|
+
font-size: ${(props) => props.theme.font.size.small};
|
|
17
|
+
line-height: 27px;
|
|
18
|
+
`;
|
|
@@ -1,141 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { ObjectTypes, } from '@manuscripts/json-schema';
|
|
11
|
-
import { buildSupplementaryMaterial, getModelsByType, } from '@manuscripts/transform';
|
|
12
|
-
import React, { createContext, useCallback, useReducer } from 'react';
|
|
13
|
-
import ReactTooltip from 'react-tooltip';
|
|
14
|
-
import { FileSectionType, useFiles } from '../../index';
|
|
1
|
+
import React, { createContext } from 'react';
|
|
2
|
+
import { useFiles } from '../../index';
|
|
15
3
|
import { InspectorTab, InspectorTabList, InspectorTabPanel, InspectorTabPanels, InspectorTabs, } from '../Inspector';
|
|
16
4
|
import { InspectorSection } from '../InspectorSection';
|
|
17
|
-
import {
|
|
5
|
+
import { DragLayer } from './DragLayer';
|
|
18
6
|
import { FileManagerProvider } from './FileManagerProvider';
|
|
19
|
-
import { DraggableFileSectionItem } from './FileSectionItem/DraggableFileSectionItem';
|
|
20
|
-
import { DragLayer } from './FileSectionItem/DragLayer';
|
|
21
|
-
import { FileSectionItem, } from './FileSectionItem/FileSectionItem';
|
|
22
|
-
import { actions, getInitialState, reducer } from './FileSectionState';
|
|
23
|
-
import { FilesSection } from './FilesSection';
|
|
24
7
|
import { InlineFilesSection } from './InlineFilesSection';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
8
|
+
import { OtherFilesSection } from './OtherFilesSection';
|
|
9
|
+
import { SupplementsSection } from './SupplementsSection';
|
|
10
|
+
import { Tooltip } from './Tooltip';
|
|
27
11
|
export const PermissionsContext = createContext(null);
|
|
28
|
-
export const FileManager = ({ modelMap, saveModel, deleteModel, enableDragAndDrop, can,
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
dispatch(actions.HANDLE_UPLOAD_ACTION());
|
|
32
|
-
const res = yield replace(attachmentId, name, file);
|
|
33
|
-
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
34
|
-
if (res) {
|
|
35
|
-
dispatch(actions.HANDLE_SUCCESS_MESSAGE('File uploaded successfully.'));
|
|
36
|
-
}
|
|
37
|
-
return res;
|
|
38
|
-
}), [replace]);
|
|
39
|
-
const handleUploadFile = useCallback((file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
-
dispatch(actions.HANDLE_UPLOAD_ACTION());
|
|
41
|
-
const res = yield upload(file);
|
|
42
|
-
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
43
|
-
if (res) {
|
|
44
|
-
dispatch(actions.HANDLE_SUCCESS_MESSAGE('File uploaded successfully.', FileSectionType.OtherFile));
|
|
45
|
-
}
|
|
46
|
-
return res;
|
|
47
|
-
}), [upload]);
|
|
48
|
-
const handleUploadFileWithSupplement = useCallback((file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
-
dispatch(actions.HANDLE_UPLOAD_ACTION());
|
|
50
|
-
const response = yield upload(file);
|
|
51
|
-
if (typeof response === 'object') {
|
|
52
|
-
const { id, name } = response;
|
|
53
|
-
yield saveModel(buildSupplementaryMaterial(name, `attachment:${id}`));
|
|
54
|
-
}
|
|
55
|
-
dispatch(actions.HANDLE_FINISH_UPLOAD());
|
|
56
|
-
if (response) {
|
|
57
|
-
dispatch(actions.HANDLE_SUCCESS_MESSAGE('File uploaded successfully.', FileSectionType.Supplements));
|
|
58
|
-
}
|
|
59
|
-
return response;
|
|
60
|
-
}), [upload, saveModel]);
|
|
61
|
-
const handleSupplementReplace = useCallback((attachment, oldAttachmentId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
const model = getModelsByType(modelMap, ObjectTypes.Supplement).find(({ href }) => (href === null || href === void 0 ? void 0 : href.replace('attachment:', '')) === oldAttachmentId);
|
|
63
|
-
yield saveModel(Object.assign(Object.assign({}, model), { title: attachment.name, href: `attachment:${attachment.id}` }));
|
|
64
|
-
}), [modelMap, saveModel]);
|
|
65
|
-
const handleDownload = useCallback((url) => {
|
|
66
|
-
window.location.assign(url);
|
|
67
|
-
}, []);
|
|
68
|
-
const handleUpdateInline = useCallback((modelId, attachment) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
-
const figureModel = modelMap.get(modelId);
|
|
70
|
-
figureModel.src = `attachment:${attachment.id}`;
|
|
71
|
-
if (addAttachmentToState) {
|
|
72
|
-
addAttachmentToState(Object.assign({}, attachment));
|
|
73
|
-
}
|
|
74
|
-
yield saveModel(figureModel);
|
|
75
|
-
}), [modelMap, saveModel, addAttachmentToState]);
|
|
76
|
-
const attachments = getAttachments();
|
|
77
|
-
const { otherFiles, supplementFiles, inlineFiles } = useFiles(modelMap, attachments);
|
|
78
|
-
const handleDetachFile = (attachmentId, modelId) => {
|
|
79
|
-
const model = modelMap.get(modelId);
|
|
80
|
-
if (model) {
|
|
81
|
-
saveModel(Object.assign(Object.assign({}, model), { src: '' }));
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
const getFileSectionExternalFile = (fileSection) => {
|
|
85
|
-
const isSupplementOrOtherFilesTab = fileSection === FileSectionType.Supplements ||
|
|
86
|
-
fileSection === FileSectionType.OtherFile;
|
|
87
|
-
const isOtherFilesTab = fileSection === FileSectionType.OtherFile;
|
|
88
|
-
const itemsData = (fileSection === FileSectionType.Supplements && supplementFiles) ||
|
|
89
|
-
otherFiles;
|
|
90
|
-
const itemsDataWithTitle = generateAttachmentsTitles(itemsData, fileSection);
|
|
91
|
-
const filesItems = itemsDataWithTitle.map((element) => {
|
|
92
|
-
const itemProps = {
|
|
93
|
-
fileSection,
|
|
94
|
-
externalFile: element.externalFile,
|
|
95
|
-
title: element.title,
|
|
96
|
-
showAttachmentName: isSupplementOrOtherFilesTab,
|
|
97
|
-
showReplaceAction: !isOtherFilesTab,
|
|
98
|
-
handleDownload,
|
|
99
|
-
handleReplace: handleReplaceFile,
|
|
100
|
-
handleSupplementReplace,
|
|
101
|
-
dispatch: dispatch,
|
|
102
|
-
};
|
|
103
|
-
if (enableDragAndDrop && isSupplementOrOtherFilesTab) {
|
|
104
|
-
return (React.createElement(DraggableFileSectionItem, Object.assign({}, itemProps, { key: element.externalFile.id })));
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
return (React.createElement(FileSectionItem, Object.assign({}, itemProps, { key: element.externalFile.id, isEditor: enableDragAndDrop })));
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
return filesItems;
|
|
111
|
-
};
|
|
112
|
-
return (React.createElement(FileManagerProvider, { saveModel: saveModel, modelMap: modelMap, deleteModel: deleteModel, getAttachments: getAttachments },
|
|
12
|
+
export const FileManager = ({ files, fileManagement, modelMap, saveModel, deleteModel, enableDragAndDrop, can, }) => {
|
|
13
|
+
const { inlineFiles, supplements, otherFiles } = useFiles(modelMap, files);
|
|
14
|
+
return (React.createElement(FileManagerProvider, { saveModel: saveModel, deleteModel: deleteModel, modelMap: modelMap, fileManagement: fileManagement },
|
|
113
15
|
React.createElement(DragLayer, null),
|
|
114
16
|
React.createElement(PermissionsContext.Provider, { value: can },
|
|
115
|
-
React.createElement(InspectorSection, { title: 'Files', contentStyles: { margin: '24px' } },
|
|
17
|
+
React.createElement(InspectorSection, { title: 'Files', contentStyles: { margin: '24px 16px' } },
|
|
116
18
|
React.createElement(InspectorTabs, { defaultIndex: 0, style: { overflow: 'visible' } },
|
|
117
19
|
React.createElement(InspectorTabList, null,
|
|
118
20
|
React.createElement(InspectorTab, { "data-for": "inline", "data-tip": true }, "Inline files"),
|
|
119
|
-
React.createElement(
|
|
120
|
-
React.createElement(ReactTooltip, { id: "inline", place: "bottom", offset: { bottom: -11 }, effect: "solid", className: "tooltip" },
|
|
121
|
-
React.createElement("div", null,
|
|
122
|
-
"Files that can be found inline ",
|
|
123
|
-
React.createElement("br", null),
|
|
124
|
-
" in the manuscript."))),
|
|
21
|
+
React.createElement(Tooltip, { id: "inline", place: "bottom", offset: { bottom: -11 }, effect: "solid", className: "tooltip" }, "Files that can be found inline in the manuscript."),
|
|
125
22
|
React.createElement(InspectorTab, { "data-for": "supplements", "data-tip": true }, "Supplements"),
|
|
126
|
-
React.createElement(
|
|
127
|
-
React.createElement(ReactTooltip, { id: "supplements", place: "bottom", offset: { bottom: -11 }, effect: "solid", className: "tooltip" },
|
|
128
|
-
React.createElement("div", null, "Files that were marked as supplementaries."))),
|
|
23
|
+
React.createElement(Tooltip, { id: "supplements", place: "bottom", offset: { bottom: -11 }, effect: "solid", className: "tooltip" }, "Files that were marked as supplements."),
|
|
129
24
|
React.createElement(InspectorTab, { "data-for": "other", "data-tip": true }, "Other files"),
|
|
130
|
-
React.createElement(
|
|
131
|
-
React.createElement(ReactTooltip, { id: "other", place: "bottom", offset: { bottom: -11 }, effect: "solid", className: "tooltip" },
|
|
132
|
-
React.createElement("div", null, "Files excluded from the final submission.")))),
|
|
25
|
+
React.createElement(Tooltip, { id: "other", place: "bottom", offset: { bottom: -11 }, effect: "solid", className: "tooltip" }, "Files excluded from the final submission.")),
|
|
133
26
|
React.createElement(InspectorTabPanels, { style: { overflowY: 'visible', position: 'relative' } },
|
|
134
27
|
React.createElement(InspectorTabPanel, null,
|
|
135
|
-
React.createElement(InlineFilesSection, {
|
|
28
|
+
React.createElement(InlineFilesSection, { elements: inlineFiles, isEditor: enableDragAndDrop })),
|
|
136
29
|
React.createElement(InspectorTabPanel, null,
|
|
137
|
-
React.createElement(
|
|
30
|
+
React.createElement(SupplementsSection, { supplements: supplements })),
|
|
138
31
|
React.createElement(InspectorTabPanel, null,
|
|
139
|
-
React.createElement(
|
|
140
|
-
React.createElement(MoveFilePopup, { dispatch: dispatch }))));
|
|
32
|
+
React.createElement(OtherFilesSection, { files: otherFiles }))))))));
|
|
141
33
|
};
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import React, { createContext
|
|
1
|
+
import React, { createContext } from 'react';
|
|
2
2
|
export const FileManagerContext = createContext({
|
|
3
3
|
saveModel: () => '',
|
|
4
|
-
moveFilePopup: { isOpen: false },
|
|
5
|
-
setMoveFilePopupData: () => '',
|
|
6
4
|
});
|
|
7
|
-
export const FileManagerProvider = ({ children, saveModel, deleteModel, modelMap,
|
|
8
|
-
const [moveFilePopup, setMoveFilePopupData] = useState({ isOpen: false });
|
|
5
|
+
export const FileManagerProvider = ({ children, saveModel, deleteModel, modelMap, fileManagement }) => {
|
|
9
6
|
return (React.createElement(FileManagerContext.Provider, { value: {
|
|
10
7
|
saveModel,
|
|
11
8
|
deleteModel,
|
|
12
9
|
modelMap,
|
|
13
|
-
|
|
14
|
-
moveFilePopup,
|
|
15
|
-
setMoveFilePopupData,
|
|
10
|
+
fileManagement,
|
|
16
11
|
} }, children));
|
|
17
12
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { FileTypeIcon } from './FileTypeIcon';
|
|
4
|
+
export const FileName = ({ file }) => {
|
|
5
|
+
return (React.createElement(React.Fragment, null,
|
|
6
|
+
React.createElement(FileTypeIcon, { file: file }),
|
|
7
|
+
React.createElement(FileNameText, null, file.name)));
|
|
8
|
+
};
|
|
9
|
+
export const FileNameText = styled.div `
|
|
10
|
+
font-family: ${(props) => props.theme.font.family.Lato};
|
|
11
|
+
font-size: ${(props) => props.theme.font.size.medium};
|
|
12
|
+
line-height: ${(props) => props.theme.font.lineHeight.large};
|
|
13
|
+
font-weight: ${(props) => props.theme.font.weight.normal};
|
|
14
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
15
|
+
margin-left: ${(props) => props.theme.grid.unit * 2}px;
|
|
16
|
+
flex-grow: 1;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
`;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { AlertMessage, AlertMessageType } from '../AlertMessage';
|
|
4
|
+
import UnknownFormatFileIcon from '../icons/unknown-format-file-icon';
|
|
5
|
+
import { FileContainer } from './FileContainer';
|
|
6
|
+
import { FileNameText } from './FileName';
|
|
7
|
+
export var FileSectionAlertType;
|
|
8
|
+
(function (FileSectionAlertType) {
|
|
9
|
+
FileSectionAlertType[FileSectionAlertType["NONE"] = 0] = "NONE";
|
|
10
|
+
FileSectionAlertType[FileSectionAlertType["UPLOAD_IN_PROGRESS"] = 1] = "UPLOAD_IN_PROGRESS";
|
|
11
|
+
FileSectionAlertType[FileSectionAlertType["UPLOAD_SUCCESSFUL"] = 2] = "UPLOAD_SUCCESSFUL";
|
|
12
|
+
FileSectionAlertType[FileSectionAlertType["MOVE_SUCCESSFUL"] = 3] = "MOVE_SUCCESSFUL";
|
|
13
|
+
})(FileSectionAlertType || (FileSectionAlertType = {}));
|
|
14
|
+
export const FileSectionAlert = ({ alert }) => {
|
|
15
|
+
return (React.createElement(React.Fragment, null,
|
|
16
|
+
alert.type === FileSectionAlertType.UPLOAD_IN_PROGRESS && (React.createElement(FileUploadInProgressAlert, { name: alert.message })),
|
|
17
|
+
alert.type === FileSectionAlertType.UPLOAD_SUCCESSFUL && (React.createElement(FileUploadSuccessful, null)),
|
|
18
|
+
alert.type === FileSectionAlertType.MOVE_SUCCESSFUL && (React.createElement(FileMoveSuccessful, { name: alert.message }))));
|
|
19
|
+
};
|
|
20
|
+
const FileUploadInProgressAlert = ({ name }) => {
|
|
21
|
+
return (React.createElement(FileUploadContainer, null,
|
|
22
|
+
React.createElement(UnknownFormatFileIcon, null),
|
|
23
|
+
React.createElement(FileUploadNameContainer, null,
|
|
24
|
+
React.createElement(UploadFileNameText, null, name),
|
|
25
|
+
React.createElement(FileUploadProgressBar, null))));
|
|
26
|
+
};
|
|
27
|
+
const FileUploadSuccessful = () => {
|
|
28
|
+
return (React.createElement(AlertMessageContainer, null,
|
|
29
|
+
React.createElement(AlertMessage, { type: AlertMessageType.success, hideCloseButton: true, dismissButton: {
|
|
30
|
+
text: 'OK',
|
|
31
|
+
} }, "File uploaded successfully")));
|
|
32
|
+
};
|
|
33
|
+
const FileMoveSuccessful = ({ name }) => {
|
|
34
|
+
return (React.createElement(AlertMessageContainer, null,
|
|
35
|
+
React.createElement(AlertMessage, { type: AlertMessageType.success, hideCloseButton: true, dismissButton: {
|
|
36
|
+
text: 'OK',
|
|
37
|
+
} },
|
|
38
|
+
"File moved to ",
|
|
39
|
+
name)));
|
|
40
|
+
};
|
|
41
|
+
const AlertMessageContainer = styled.div `
|
|
42
|
+
margin-left: 16px;
|
|
43
|
+
margin-right: 16px;
|
|
44
|
+
`;
|
|
45
|
+
const FileUploadContainer = styled(FileContainer) `
|
|
46
|
+
background: #f2fbfc;
|
|
47
|
+
`;
|
|
48
|
+
const FileUploadNameContainer = styled.div `
|
|
49
|
+
flex-grow: 1;
|
|
50
|
+
margin-left: 8px;
|
|
51
|
+
`;
|
|
52
|
+
const UploadFileNameText = styled(FileNameText) `
|
|
53
|
+
margin: 0;
|
|
54
|
+
`;
|
|
55
|
+
const FileUploadProgressBar = () => {
|
|
56
|
+
return (React.createElement(LinearProgress, null,
|
|
57
|
+
React.createElement(Bar, { className: "bar1" }),
|
|
58
|
+
React.createElement(Bar, { className: "bar2" })));
|
|
59
|
+
};
|
|
60
|
+
const LinearProgress = styled.div `
|
|
61
|
+
background: ${(props) => props.theme.colors.background.tertiary};
|
|
62
|
+
opacity: 0.7;
|
|
63
|
+
height: 4px;
|
|
64
|
+
position: relative;
|
|
65
|
+
width: 100%;
|
|
66
|
+
margin: 8px auto 0;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
border-radius: 8px;
|
|
69
|
+
animation: start 0.3s ease-in;
|
|
70
|
+
`;
|
|
71
|
+
const Bar = styled.div `
|
|
72
|
+
position: absolute;
|
|
73
|
+
opacity: 0.7;
|
|
74
|
+
background: #1a9bc7;
|
|
75
|
+
transition: transform 0.2s linear;
|
|
76
|
+
left: 0;
|
|
77
|
+
top: 0;
|
|
78
|
+
bottom: 0;
|
|
79
|
+
width: 100%;
|
|
80
|
+
|
|
81
|
+
&.bar1 {
|
|
82
|
+
animation: growBar1 2.5s infinite, moveBar1 2.5s infinite;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.bar2 {
|
|
86
|
+
animation: growBar2 2.5s infinite, moveBar2 2.5s infinite;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes growBar1 {
|
|
90
|
+
0% {
|
|
91
|
+
animation-timing-function: linear;
|
|
92
|
+
transform: scaleX(0.1);
|
|
93
|
+
}
|
|
94
|
+
35% {
|
|
95
|
+
animation-timing-function: cubic-bezier(0.3, 0.1, 0.7, 1);
|
|
96
|
+
transform: scaleX(0.1);
|
|
97
|
+
}
|
|
98
|
+
70% {
|
|
99
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.2, 1.4);
|
|
100
|
+
transform: scaleX(0.8);
|
|
101
|
+
}
|
|
102
|
+
100% {
|
|
103
|
+
transform: scaleX(0.1);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@keyframes moveBar1 {
|
|
108
|
+
0% {
|
|
109
|
+
left: -105%;
|
|
110
|
+
animation-timing-function: linear;
|
|
111
|
+
}
|
|
112
|
+
20% {
|
|
113
|
+
left: -105%;
|
|
114
|
+
animation-timing-function: cubic-bezier(0.5, 0, 0.7, 0.4);
|
|
115
|
+
}
|
|
116
|
+
60% {
|
|
117
|
+
left: 21%;
|
|
118
|
+
animation-timing-function: cubic-bezier(0.3, 0.4, 0.55, 0.9);
|
|
119
|
+
}
|
|
120
|
+
80% {
|
|
121
|
+
left: 40%;
|
|
122
|
+
animation-timing-function: cubic-bezier(0.1, 0.2, 0.3, 0.95);
|
|
123
|
+
}
|
|
124
|
+
100% {
|
|
125
|
+
left: 90%;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@keyframes growBar2 {
|
|
130
|
+
0% {
|
|
131
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.5, 0.4);
|
|
132
|
+
transform: scaleX(0.1);
|
|
133
|
+
}
|
|
134
|
+
20% {
|
|
135
|
+
animation-timing-function: cubic-bezier(0.1, 0.2, 0.6, 1);
|
|
136
|
+
transform: scaleX(0.3);
|
|
137
|
+
}
|
|
138
|
+
60% {
|
|
139
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.2, 1.4);
|
|
140
|
+
transform: scaleX(0.6);
|
|
141
|
+
}
|
|
142
|
+
100% {
|
|
143
|
+
transform: scaleX(0.1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
@keyframes moveBar2 {
|
|
147
|
+
0% {
|
|
148
|
+
left: -100%;
|
|
149
|
+
animation-timing-function: cubic-bezier(0.15, 0, 0.5, 0.4);
|
|
150
|
+
}
|
|
151
|
+
25% {
|
|
152
|
+
left: -50%;
|
|
153
|
+
animation-timing-function: cubic-bezier(0.3, 0.3, 0.8, 0.7);
|
|
154
|
+
}
|
|
155
|
+
50% {
|
|
156
|
+
left: 45%;
|
|
157
|
+
animation-timing-function: cubic-bezier(0.1, 0.6, 0.6, 0.9);
|
|
158
|
+
}
|
|
159
|
+
100% {
|
|
160
|
+
left: 95%;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
`;
|