@manuscripts/style-guide 1.1.16-LEAN-2669-v9 → 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) {
@@ -49,21 +57,11 @@ const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdateInline,
49
57
  window.location.hash = `#${clearedId}`;
50
58
  }
51
59
  }, [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
- }
60
60
  return (react_1.default.createElement("div", null, inlineFiles.map((file, index) => {
61
61
  var _a;
62
62
  return (react_1.default.createElement(ElementItem, { className: 'item', key: index, id: file.id, onClick: onElementClick },
63
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,
64
- react_1.default.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }),
65
- react_1.default.createElement(exports.FileDateContainer, null,
66
- react_1.default.createElement(exports.FileDate, null, formatDate(attachment.createdDate))))))),
64
+ react_1.default.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }))))),
67
65
  react_1.default.createElement(Element, { className: 'element' },
68
66
  util_1.fileTypesWithIconMap.get(file.type),
69
67
  react_1.default.createElement(FileInfo_1.FileInfoContainer, null,
@@ -82,6 +80,8 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
82
80
  react_1.default.createElement(Container, null,
83
81
  util_1.fileTypesWithIconMap.get(util_1.extensionsWithFileTypesMap.get(fileExtension)),
84
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)))),
85
85
  handleDownload && handleReplace && (react_1.default.createElement(DropdownContainer, { ref: wrapperRef },
86
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 },
87
87
  react_1.default.createElement(dots_icon_1.default, null)),
@@ -92,7 +92,6 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
92
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' }))))));
93
93
  };
94
94
  exports.FileDateContainer = styled_components_1.default.div `
95
- line-height: 40px;
96
95
  overflow: hidden;
97
96
  display: none;
98
97
  `;
@@ -126,6 +125,7 @@ const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
126
125
  `;
127
126
  const Container = styled_components_1.default.div `
128
127
  display: flex;
128
+ width: 100%;
129
129
  `;
130
130
  const Element = styled_components_1.default.div `
131
131
  display: flex;
@@ -139,7 +139,8 @@ const FileReferences = styled_components_1.default.div `
139
139
  `;
140
140
  const FileReferenceItem = styled_components_1.default.div `
141
141
  display: flex;
142
- align-items: center;
142
+ width: 100%;
143
+ align-items: space;
143
144
  justify-content: space-between;
144
145
  width: 100% svg {
145
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) {
@@ -20,21 +28,11 @@ export const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdate
20
28
  window.location.hash = `#${clearedId}`;
21
29
  }
22
30
  }, [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
- }
31
31
  return (React.createElement("div", null, inlineFiles.map((file, index) => {
32
32
  var _a;
33
33
  return (React.createElement(ElementItem, { className: 'item', key: index, id: file.id, onClick: onElementClick },
34
34
  React.createElement(FileReferences, { className: 'refItems' }, (_a = file.attachments) === null || _a === void 0 ? void 0 : _a.map((attachment) => (React.createElement(React.Fragment, null,
35
- React.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }),
36
- React.createElement(FileDateContainer, null,
37
- React.createElement(FileDate, null, formatDate(attachment.createdDate))))))),
35
+ React.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch }))))),
38
36
  React.createElement(Element, { className: 'element' },
39
37
  fileTypesWithIconMap.get(file.type),
40
38
  React.createElement(FileInfoContainer, null,
@@ -52,6 +50,8 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
52
50
  React.createElement(Container, null,
53
51
  fileTypesWithIconMap.get(extensionsWithFileTypesMap.get(fileExtension)),
54
52
  React.createElement(FileReferenceName, null, attachment.name)),
53
+ attachment.createdDate && (React.createElement(FileDateContainer, null,
54
+ React.createElement(FileDate, null, formatDate(attachment.createdDate)))),
55
55
  handleDownload && handleReplace && (React.createElement(DropdownContainer, { ref: wrapperRef },
56
56
  React.createElement(ActionsIcon, { onClick: toggleOpen, type: "button", className: 'external_file_dropdown', "aria-label": "Download or Replace or Detach", "aria-pressed": isOpen },
57
57
  React.createElement(DotsIcon, null)),
@@ -62,7 +62,6 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
62
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' }))))));
63
63
  };
64
64
  export const FileDateContainer = styled.div `
65
- line-height: 40px;
66
65
  overflow: hidden;
67
66
  display: none;
68
67
  `;
@@ -96,6 +95,7 @@ const ElementItem = styled(Item) `
96
95
  `;
97
96
  const Container = styled.div `
98
97
  display: flex;
98
+ width: 100%;
99
99
  `;
100
100
  const Element = styled.div `
101
101
  display: flex;
@@ -109,7 +109,8 @@ const FileReferences = styled.div `
109
109
  `;
110
110
  const FileReferenceItem = styled.div `
111
111
  display: flex;
112
- align-items: center;
112
+ width: 100%;
113
+ align-items: space;
113
114
  justify-content: space-between;
114
115
  width: 100% svg {
115
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-v9",
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",