@manuscripts/style-guide 1.1.16-LEAN-2669-v7 → 1.1.16-LEAN-2669-v9
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/FileManager/FileSectionItem/FileInfo.js +6 -1
- package/dist/cjs/components/FileManager/InlineFilesSection.js +17 -10
- package/dist/es/components/FileManager/FileSectionItem/FileInfo.js +6 -1
- package/dist/es/components/FileManager/InlineFilesSection.js +17 -10
- package/package.json +1 -1
|
@@ -33,6 +33,11 @@ const FileManager_1 = require("../FileManager");
|
|
|
33
33
|
const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension, attachmentId, dispatch, fileCreatedDate, }) => {
|
|
34
34
|
const fileName = fileAttachmentName.substring(0, fileAttachmentName.lastIndexOf('.'));
|
|
35
35
|
const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
|
|
36
|
+
const date = new Date(fileCreatedDate);
|
|
37
|
+
const formattedDate = `${date.getMonth() + 1}/${date.getDate()}/${date
|
|
38
|
+
.getFullYear()
|
|
39
|
+
.toString()
|
|
40
|
+
.slice(2)}, ${date.getHours()}:${date.getMinutes()}`;
|
|
36
41
|
return (react_1.default.createElement(exports.FileInfoContainer, null,
|
|
37
42
|
react_1.default.createElement(exports.FileNameTitleContainer, null,
|
|
38
43
|
react_1.default.createElement(exports.FileTitle, null,
|
|
@@ -44,7 +49,7 @@ const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension
|
|
|
44
49
|
".",
|
|
45
50
|
fileExtension))),
|
|
46
51
|
fileCreatedDate && (react_1.default.createElement(exports.FileDateContainer, null,
|
|
47
|
-
react_1.default.createElement(exports.FileDate, null,
|
|
52
|
+
react_1.default.createElement(exports.FileDate, null, formattedDate))))));
|
|
48
53
|
};
|
|
49
54
|
exports.FileInfo = FileInfo;
|
|
50
55
|
exports.FileDateContainer = styled_components_1.default.div `
|
|
@@ -49,13 +49,21 @@ const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdateInline,
|
|
|
49
49
|
window.location.hash = `#${clearedId}`;
|
|
50
50
|
}
|
|
51
51
|
}, [isEditor]);
|
|
52
|
+
function formatDate(inputDate) {
|
|
53
|
+
const date = new Date(inputDate);
|
|
54
|
+
const formattedDate = `${date.getMonth() + 1}/${date.getDate()}/${date
|
|
55
|
+
.getFullYear()
|
|
56
|
+
.toString()
|
|
57
|
+
.slice(2)}, ${date.getHours()}:${date.getMinutes()}`;
|
|
58
|
+
return formattedDate;
|
|
59
|
+
}
|
|
52
60
|
return (react_1.default.createElement("div", null, inlineFiles.map((file, index) => {
|
|
53
61
|
var _a;
|
|
54
62
|
return (react_1.default.createElement(ElementItem, { className: 'item', key: index, id: file.id, onClick: onElementClick },
|
|
55
63
|
react_1.default.createElement(FileReferences, { className: 'refItems' }, (_a = file.attachments) === null || _a === void 0 ? void 0 : _a.map((attachment) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
56
64
|
react_1.default.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }),
|
|
57
65
|
react_1.default.createElement(exports.FileDateContainer, null,
|
|
58
|
-
react_1.default.createElement(exports.FileDate, null, attachment.createdDate)))))),
|
|
66
|
+
react_1.default.createElement(exports.FileDate, null, formatDate(attachment.createdDate))))))),
|
|
59
67
|
react_1.default.createElement(Element, { className: 'element' },
|
|
60
68
|
util_1.fileTypesWithIconMap.get(file.type),
|
|
61
69
|
react_1.default.createElement(FileInfo_1.FileInfoContainer, null,
|
|
@@ -83,6 +91,11 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
|
|
|
83
91
|
attachment.modelId &&
|
|
84
92
|
handleDetachFile(attachment.id, attachment.modelId), downloadAttachmentHandler: handleDownload, attachmentId: attachment.id, fileName: attachment.name, publicUrl: attachment.link, hideActionList: toggleOpen, dispatch: dispatch, dropDownClassName: 'ref_item_dropdown' }))))));
|
|
85
93
|
};
|
|
94
|
+
exports.FileDateContainer = styled_components_1.default.div `
|
|
95
|
+
line-height: 40px;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
display: none;
|
|
98
|
+
`;
|
|
86
99
|
const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
|
|
87
100
|
display: flex;
|
|
88
101
|
// this will allow us to select the previous sibling node,
|
|
@@ -97,6 +110,9 @@ const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
|
|
|
97
110
|
.refItems:hover ~ .element {
|
|
98
111
|
background: white !important;
|
|
99
112
|
}
|
|
113
|
+
&:hover ${exports.FileDateContainer} {
|
|
114
|
+
display: flex;
|
|
115
|
+
}
|
|
100
116
|
|
|
101
117
|
.refItems:hover {
|
|
102
118
|
background: white !important;
|
|
@@ -111,18 +127,9 @@ const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
|
|
|
111
127
|
const Container = styled_components_1.default.div `
|
|
112
128
|
display: flex;
|
|
113
129
|
`;
|
|
114
|
-
exports.FileDateContainer = styled_components_1.default.div `
|
|
115
|
-
line-height: 40px;
|
|
116
|
-
overflow: hidden;
|
|
117
|
-
display: none;
|
|
118
|
-
`;
|
|
119
130
|
const Element = styled_components_1.default.div `
|
|
120
131
|
display: flex;
|
|
121
132
|
padding: 20px 15px;
|
|
122
|
-
|
|
123
|
-
&:hover ${exports.FileDateContainer} {
|
|
124
|
-
display: flex;
|
|
125
|
-
}
|
|
126
133
|
`;
|
|
127
134
|
const FileReferences = styled_components_1.default.div `
|
|
128
135
|
display: flex;
|
|
@@ -4,6 +4,11 @@ import { PermissionsContext } from '../FileManager';
|
|
|
4
4
|
export const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension, attachmentId, dispatch, fileCreatedDate, }) => {
|
|
5
5
|
const fileName = fileAttachmentName.substring(0, fileAttachmentName.lastIndexOf('.'));
|
|
6
6
|
const can = useContext(PermissionsContext);
|
|
7
|
+
const date = new Date(fileCreatedDate);
|
|
8
|
+
const formattedDate = `${date.getMonth() + 1}/${date.getDate()}/${date
|
|
9
|
+
.getFullYear()
|
|
10
|
+
.toString()
|
|
11
|
+
.slice(2)}, ${date.getHours()}:${date.getMinutes()}`;
|
|
7
12
|
return (React.createElement(FileInfoContainer, null,
|
|
8
13
|
React.createElement(FileNameTitleContainer, null,
|
|
9
14
|
React.createElement(FileTitle, null,
|
|
@@ -15,7 +20,7 @@ export const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileEx
|
|
|
15
20
|
".",
|
|
16
21
|
fileExtension))),
|
|
17
22
|
fileCreatedDate && (React.createElement(FileDateContainer, null,
|
|
18
|
-
React.createElement(FileDate, null,
|
|
23
|
+
React.createElement(FileDate, null, formattedDate))))));
|
|
19
24
|
};
|
|
20
25
|
export const FileDateContainer = styled.div `
|
|
21
26
|
line-height: 20px;
|
|
@@ -20,13 +20,21 @@ export const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdate
|
|
|
20
20
|
window.location.hash = `#${clearedId}`;
|
|
21
21
|
}
|
|
22
22
|
}, [isEditor]);
|
|
23
|
+
function formatDate(inputDate) {
|
|
24
|
+
const date = new Date(inputDate);
|
|
25
|
+
const formattedDate = `${date.getMonth() + 1}/${date.getDate()}/${date
|
|
26
|
+
.getFullYear()
|
|
27
|
+
.toString()
|
|
28
|
+
.slice(2)}, ${date.getHours()}:${date.getMinutes()}`;
|
|
29
|
+
return formattedDate;
|
|
30
|
+
}
|
|
23
31
|
return (React.createElement("div", null, inlineFiles.map((file, index) => {
|
|
24
32
|
var _a;
|
|
25
33
|
return (React.createElement(ElementItem, { className: 'item', key: index, id: file.id, onClick: onElementClick },
|
|
26
34
|
React.createElement(FileReferences, { className: 'refItems' }, (_a = file.attachments) === null || _a === void 0 ? void 0 : _a.map((attachment) => (React.createElement(React.Fragment, null,
|
|
27
35
|
React.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }),
|
|
28
36
|
React.createElement(FileDateContainer, null,
|
|
29
|
-
React.createElement(FileDate, null, attachment.createdDate)))))),
|
|
37
|
+
React.createElement(FileDate, null, formatDate(attachment.createdDate))))))),
|
|
30
38
|
React.createElement(Element, { className: 'element' },
|
|
31
39
|
fileTypesWithIconMap.get(file.type),
|
|
32
40
|
React.createElement(FileInfoContainer, null,
|
|
@@ -53,6 +61,11 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
|
|
|
53
61
|
attachment.modelId &&
|
|
54
62
|
handleDetachFile(attachment.id, attachment.modelId), downloadAttachmentHandler: handleDownload, attachmentId: attachment.id, fileName: attachment.name, publicUrl: attachment.link, hideActionList: toggleOpen, dispatch: dispatch, dropDownClassName: 'ref_item_dropdown' }))))));
|
|
55
63
|
};
|
|
64
|
+
export const FileDateContainer = styled.div `
|
|
65
|
+
line-height: 40px;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
display: none;
|
|
68
|
+
`;
|
|
56
69
|
const ElementItem = styled(Item) `
|
|
57
70
|
display: flex;
|
|
58
71
|
// this will allow us to select the previous sibling node,
|
|
@@ -67,6 +80,9 @@ const ElementItem = styled(Item) `
|
|
|
67
80
|
.refItems:hover ~ .element {
|
|
68
81
|
background: white !important;
|
|
69
82
|
}
|
|
83
|
+
&:hover ${FileDateContainer} {
|
|
84
|
+
display: flex;
|
|
85
|
+
}
|
|
70
86
|
|
|
71
87
|
.refItems:hover {
|
|
72
88
|
background: white !important;
|
|
@@ -81,18 +97,9 @@ const ElementItem = styled(Item) `
|
|
|
81
97
|
const Container = styled.div `
|
|
82
98
|
display: flex;
|
|
83
99
|
`;
|
|
84
|
-
export const FileDateContainer = styled.div `
|
|
85
|
-
line-height: 40px;
|
|
86
|
-
overflow: hidden;
|
|
87
|
-
display: none;
|
|
88
|
-
`;
|
|
89
100
|
const Element = styled.div `
|
|
90
101
|
display: flex;
|
|
91
102
|
padding: 20px 15px;
|
|
92
|
-
|
|
93
|
-
&:hover ${FileDateContainer} {
|
|
94
|
-
display: flex;
|
|
95
|
-
}
|
|
96
103
|
`;
|
|
97
104
|
const FileReferences = styled.div `
|
|
98
105
|
display: flex;
|
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.16-LEAN-2669-
|
|
4
|
+
"version": "1.1.16-LEAN-2669-v9",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|