@manuscripts/style-guide 1.1.16-LEAN-2669-v10 → 1.1.16-LEAN-2669
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.
|
@@ -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,7 +92,6 @@ 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;
|
|
90
97
|
`;
|
|
@@ -118,6 +125,7 @@ const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
|
|
|
118
125
|
`;
|
|
119
126
|
const Container = styled_components_1.default.div `
|
|
120
127
|
display: flex;
|
|
128
|
+
width: 100%;
|
|
121
129
|
`;
|
|
122
130
|
const Element = styled_components_1.default.div `
|
|
123
131
|
display: flex;
|
|
@@ -131,7 +139,8 @@ const FileReferences = styled_components_1.default.div `
|
|
|
131
139
|
`;
|
|
132
140
|
const FileReferenceItem = styled_components_1.default.div `
|
|
133
141
|
display: flex;
|
|
134
|
-
|
|
142
|
+
width: 100%;
|
|
143
|
+
align-items: space;
|
|
135
144
|
justify-content: space-between;
|
|
136
145
|
width: 100% svg {
|
|
137
146
|
width: 14px;
|
|
@@ -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,7 +62,6 @@ 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;
|
|
60
67
|
`;
|
|
@@ -88,6 +95,7 @@ const ElementItem = styled(Item) `
|
|
|
88
95
|
`;
|
|
89
96
|
const Container = styled.div `
|
|
90
97
|
display: flex;
|
|
98
|
+
width: 100%;
|
|
91
99
|
`;
|
|
92
100
|
const Element = styled.div `
|
|
93
101
|
display: flex;
|
|
@@ -101,7 +109,8 @@ const FileReferences = styled.div `
|
|
|
101
109
|
`;
|
|
102
110
|
const FileReferenceItem = styled.div `
|
|
103
111
|
display: flex;
|
|
104
|
-
|
|
112
|
+
width: 100%;
|
|
113
|
+
align-items: space;
|
|
105
114
|
justify-content: space-between;
|
|
106
115
|
width: 100% svg {
|
|
107
116
|
width: 14px;
|
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",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|