@manuscripts/style-guide 1.1.16-LEAN-2669-v8 → 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 +9 -1
- package/dist/es/components/FileManager/FileSectionItem/FileInfo.js +6 -1
- package/dist/es/components/FileManager/InlineFilesSection.js +9 -1
- 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,
|
|
@@ -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,
|
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",
|