@manuscripts/style-guide 1.1.16-LEAN-2669-v10 → 1.1.16-LEAN-2669-v1
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 +1 -0
- package/dist/cjs/components/FileManager/InlineFilesSection.js +17 -6
- package/dist/es/components/FileManager/FileSectionItem/FileInfo.js +1 -0
- package/dist/es/components/FileManager/InlineFilesSection.js +17 -6
- package/package.json +1 -1
|
@@ -36,6 +36,14 @@ const FileSectionItem_1 = require("./FileSectionItem/FileSectionItem");
|
|
|
36
36
|
const ItemActions_1 = require("./FileSectionItem/ItemActions");
|
|
37
37
|
const util_1 = require("./util");
|
|
38
38
|
const trackedJoint = ':dataTracked:';
|
|
39
|
+
function formatDate(inputDate) {
|
|
40
|
+
const date = new Date(inputDate);
|
|
41
|
+
const formattedDate = `${date.getMonth() + 1}/${date.getDate()}/${date
|
|
42
|
+
.getFullYear()
|
|
43
|
+
.toString()
|
|
44
|
+
.slice(2)}, ${date.getHours()}:${date.getMinutes()}`;
|
|
45
|
+
return formattedDate;
|
|
46
|
+
}
|
|
39
47
|
const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdateInline, handleDetachFile, inlineFiles, isEditor, dispatch, }) => {
|
|
40
48
|
const onElementClick = (0, react_1.useCallback)((e) => {
|
|
41
49
|
if (!isEditor) {
|
|
@@ -53,9 +61,7 @@ const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdateInline,
|
|
|
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
|
-
react_1.default.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }),
|
|
57
|
-
react_1.default.createElement(exports.FileDateContainer, null,
|
|
58
|
-
react_1.default.createElement(exports.FileDate, null, attachment.createdDate)))))),
|
|
64
|
+
react_1.default.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }))))),
|
|
59
65
|
react_1.default.createElement(Element, { className: 'element' },
|
|
60
66
|
util_1.fileTypesWithIconMap.get(file.type),
|
|
61
67
|
react_1.default.createElement(FileInfo_1.FileInfoContainer, null,
|
|
@@ -74,6 +80,8 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
|
|
|
74
80
|
react_1.default.createElement(Container, null,
|
|
75
81
|
util_1.fileTypesWithIconMap.get(util_1.extensionsWithFileTypesMap.get(fileExtension)),
|
|
76
82
|
react_1.default.createElement(FileReferenceName, null, attachment.name)),
|
|
83
|
+
attachment.createdDate && (react_1.default.createElement(exports.FileDateContainer, null,
|
|
84
|
+
react_1.default.createElement(exports.FileDate, null, formatDate(attachment.createdDate)))),
|
|
77
85
|
handleDownload && handleReplace && (react_1.default.createElement(DropdownContainer, { ref: wrapperRef },
|
|
78
86
|
react_1.default.createElement(FileSectionItem_1.ActionsIcon, { onClick: toggleOpen, type: "button", className: 'external_file_dropdown', "aria-label": "Download or Replace or Detach", "aria-pressed": isOpen },
|
|
79
87
|
react_1.default.createElement(dots_icon_1.default, null)),
|
|
@@ -84,9 +92,9 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
|
|
|
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
|
};
|
|
86
94
|
exports.FileDateContainer = styled_components_1.default.div `
|
|
87
|
-
line-height: 40px;
|
|
88
95
|
overflow: hidden;
|
|
89
96
|
display: none;
|
|
97
|
+
width: 50%;
|
|
90
98
|
`;
|
|
91
99
|
const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
|
|
92
100
|
display: flex;
|
|
@@ -118,6 +126,7 @@ const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
|
|
|
118
126
|
`;
|
|
119
127
|
const Container = styled_components_1.default.div `
|
|
120
128
|
display: flex;
|
|
129
|
+
width: 100%;
|
|
121
130
|
`;
|
|
122
131
|
const Element = styled_components_1.default.div `
|
|
123
132
|
display: flex;
|
|
@@ -131,7 +140,8 @@ const FileReferences = styled_components_1.default.div `
|
|
|
131
140
|
`;
|
|
132
141
|
const FileReferenceItem = styled_components_1.default.div `
|
|
133
142
|
display: flex;
|
|
134
|
-
|
|
143
|
+
width: 100%;
|
|
144
|
+
align-items: space;
|
|
135
145
|
justify-content: space-between;
|
|
136
146
|
width: 100% svg {
|
|
137
147
|
width: 14px;
|
|
@@ -177,6 +187,7 @@ const DropdownContainer = styled_components_1.default.div `
|
|
|
177
187
|
position: relative;
|
|
178
188
|
`;
|
|
179
189
|
exports.FileDate = styled_components_1.default.div `
|
|
180
|
-
color:
|
|
190
|
+
color: #6e6e6e;
|
|
181
191
|
font-size: 12px;
|
|
192
|
+
line-height: 27px;
|
|
182
193
|
`;
|
|
@@ -7,6 +7,14 @@ import { ActionsIcon, Item, } from './FileSectionItem/FileSectionItem';
|
|
|
7
7
|
import { ItemActions } from './FileSectionItem/ItemActions';
|
|
8
8
|
import { extensionsWithFileTypesMap, FileSectionType, fileTypesWithIconMap, } from './util';
|
|
9
9
|
const trackedJoint = ':dataTracked:';
|
|
10
|
+
function formatDate(inputDate) {
|
|
11
|
+
const date = new Date(inputDate);
|
|
12
|
+
const formattedDate = `${date.getMonth() + 1}/${date.getDate()}/${date
|
|
13
|
+
.getFullYear()
|
|
14
|
+
.toString()
|
|
15
|
+
.slice(2)}, ${date.getHours()}:${date.getMinutes()}`;
|
|
16
|
+
return formattedDate;
|
|
17
|
+
}
|
|
10
18
|
export const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdateInline, handleDetachFile, inlineFiles, isEditor, dispatch, }) => {
|
|
11
19
|
const onElementClick = useCallback((e) => {
|
|
12
20
|
if (!isEditor) {
|
|
@@ -24,9 +32,7 @@ export const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdate
|
|
|
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
|
-
React.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }),
|
|
28
|
-
React.createElement(FileDateContainer, null,
|
|
29
|
-
React.createElement(FileDate, null, attachment.createdDate)))))),
|
|
35
|
+
React.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }))))),
|
|
30
36
|
React.createElement(Element, { className: 'element' },
|
|
31
37
|
fileTypesWithIconMap.get(file.type),
|
|
32
38
|
React.createElement(FileInfoContainer, null,
|
|
@@ -44,6 +50,8 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
|
|
|
44
50
|
React.createElement(Container, null,
|
|
45
51
|
fileTypesWithIconMap.get(extensionsWithFileTypesMap.get(fileExtension)),
|
|
46
52
|
React.createElement(FileReferenceName, null, attachment.name)),
|
|
53
|
+
attachment.createdDate && (React.createElement(FileDateContainer, null,
|
|
54
|
+
React.createElement(FileDate, null, formatDate(attachment.createdDate)))),
|
|
47
55
|
handleDownload && handleReplace && (React.createElement(DropdownContainer, { ref: wrapperRef },
|
|
48
56
|
React.createElement(ActionsIcon, { onClick: toggleOpen, type: "button", className: 'external_file_dropdown', "aria-label": "Download or Replace or Detach", "aria-pressed": isOpen },
|
|
49
57
|
React.createElement(DotsIcon, null)),
|
|
@@ -54,9 +62,9 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
|
|
|
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
|
};
|
|
56
64
|
export const FileDateContainer = styled.div `
|
|
57
|
-
line-height: 40px;
|
|
58
65
|
overflow: hidden;
|
|
59
66
|
display: none;
|
|
67
|
+
width: 50%;
|
|
60
68
|
`;
|
|
61
69
|
const ElementItem = styled(Item) `
|
|
62
70
|
display: flex;
|
|
@@ -88,6 +96,7 @@ const ElementItem = styled(Item) `
|
|
|
88
96
|
`;
|
|
89
97
|
const Container = styled.div `
|
|
90
98
|
display: flex;
|
|
99
|
+
width: 100%;
|
|
91
100
|
`;
|
|
92
101
|
const Element = styled.div `
|
|
93
102
|
display: flex;
|
|
@@ -101,7 +110,8 @@ const FileReferences = styled.div `
|
|
|
101
110
|
`;
|
|
102
111
|
const FileReferenceItem = styled.div `
|
|
103
112
|
display: flex;
|
|
104
|
-
|
|
113
|
+
width: 100%;
|
|
114
|
+
align-items: space;
|
|
105
115
|
justify-content: space-between;
|
|
106
116
|
width: 100% svg {
|
|
107
117
|
width: 14px;
|
|
@@ -147,6 +157,7 @@ const DropdownContainer = styled.div `
|
|
|
147
157
|
position: relative;
|
|
148
158
|
`;
|
|
149
159
|
export const FileDate = styled.div `
|
|
150
|
-
color:
|
|
160
|
+
color: #6e6e6e;
|
|
151
161
|
font-size: 12px;
|
|
162
|
+
line-height: 27px;
|
|
152
163
|
`;
|
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-v1",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|