@manuscripts/style-guide 1.1.16-LEAN-2669-v8 → 1.1.17

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.
@@ -26,11 +26,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.FileDescription = exports.FileDate = exports.FileName = exports.FileNameContainer = exports.FileTitle = exports.FileNameTitleContainer = exports.FileInfoContainer = exports.FileDateContainer = exports.FileInfo = void 0;
29
+ exports.FileDescription = exports.FileName = exports.FileNameContainer = exports.FileTitle = exports.FileNameTitleContainer = exports.FileInfoContainer = exports.FileInfo = void 0;
30
30
  const react_1 = __importStar(require("react"));
31
31
  const styled_components_1 = __importDefault(require("styled-components"));
32
32
  const FileManager_1 = require("../FileManager");
33
- const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension, attachmentId, dispatch, fileCreatedDate, }) => {
33
+ const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension, attachmentId, dispatch, }) => {
34
34
  const fileName = fileAttachmentName.substring(0, fileAttachmentName.lastIndexOf('.'));
35
35
  const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
36
36
  return (react_1.default.createElement(exports.FileInfoContainer, null,
@@ -42,17 +42,9 @@ const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension
42
42
  react_1.default.createElement(exports.FileName, null, fileName),
43
43
  react_1.default.createElement("div", null,
44
44
  ".",
45
- fileExtension))),
46
- fileCreatedDate && (react_1.default.createElement(exports.FileDateContainer, null,
47
- react_1.default.createElement(exports.FileDate, null, fileCreatedDate))))));
45
+ fileExtension))))));
48
46
  };
49
47
  exports.FileInfo = FileInfo;
50
- exports.FileDateContainer = styled_components_1.default.div `
51
- line-height: 20px;
52
- overflow: hidden;
53
- width: 100%;
54
- display: none;
55
- `;
56
48
  exports.FileInfoContainer = styled_components_1.default.div `
57
49
  margin-left: 8px;
58
50
  overflow: hidden;
@@ -61,15 +53,10 @@ exports.FileInfoContainer = styled_components_1.default.div `
61
53
  justify-content: center;
62
54
  align-items: start;
63
55
  width: 100%;
64
-
65
- &:hover ${exports.FileDateContainer} {
66
- display: flex;
67
- }
68
56
  `;
69
57
  exports.FileNameTitleContainer = styled_components_1.default.div `
70
58
  display: flex;
71
59
  width: 100%;
72
- align-items: baseline;
73
60
  `;
74
61
  exports.FileTitle = styled_components_1.default.div `
75
62
  color: ${(props) => props.theme.colors.text.primary};
@@ -92,11 +79,6 @@ exports.FileName = styled_components_1.default.div `
92
79
  text-overflow: ellipsis;
93
80
  white-space: nowrap;
94
81
  overflow: hidden;
95
- width: 50px;
96
- `;
97
- exports.FileDate = styled_components_1.default.div `
98
- color: '#6E6E6E';
99
- font-size: 12px;
100
82
  `;
101
83
  exports.FileDescription = styled_components_1.default.div `
102
84
  color: ${(props) => props.theme.colors.text.secondary};
@@ -27,7 +27,7 @@ const FileSectionItem = ({ fileSection, externalFile, title, showAttachmentName
27
27
  }
28
28
  } },
29
29
  react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { withDot: isMainManuscript, fileExtension: fileExtension, alt: externalFile.name }),
30
- react_1.default.createElement(FileInfo_1.FileInfo, { fileExtension: fileExtension, fileCreatedDate: externalFile.createdDate, showAttachmentName: showAttachmentName, fileAttachmentName: externalFile.name, title: title, attachmentId: externalFile.id, dispatch: dispatch })),
30
+ react_1.default.createElement(FileInfo_1.FileInfo, { fileExtension: fileExtension, showAttachmentName: showAttachmentName, fileAttachmentName: externalFile.name, title: title, attachmentId: externalFile.id, dispatch: dispatch })),
31
31
  onClose && (react_1.default.createElement(IconCloseButton, { onClick: (e) => {
32
32
  e.preventDefault();
33
33
  onClose();
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.FileDate = exports.FileDateContainer = exports.InlineFilesSection = void 0;
29
+ exports.InlineFilesSection = void 0;
30
30
  const react_1 = __importStar(require("react"));
31
31
  const styled_components_1 = __importDefault(require("styled-components"));
32
32
  const use_dropdown_1 = require("../../hooks/use-dropdown");
@@ -52,10 +52,7 @@ const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdateInline,
52
52
  return (react_1.default.createElement("div", null, inlineFiles.map((file, index) => {
53
53
  var _a;
54
54
  return (react_1.default.createElement(ElementItem, { className: 'item', key: index, id: file.id, onClick: onElementClick },
55
- 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)))))),
55
+ react_1.default.createElement(FileReferences, { className: 'refItems' }, (_a = file.attachments) === null || _a === void 0 ? void 0 : _a.map((attachment) => (react_1.default.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch })))),
59
56
  react_1.default.createElement(Element, { className: 'element' },
60
57
  util_1.fileTypesWithIconMap.get(file.type),
61
58
  react_1.default.createElement(FileInfo_1.FileInfoContainer, null,
@@ -83,11 +80,6 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
83
80
  attachment.modelId &&
84
81
  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
82
  };
86
- exports.FileDateContainer = styled_components_1.default.div `
87
- line-height: 40px;
88
- overflow: hidden;
89
- display: none;
90
- `;
91
83
  const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
92
84
  display: flex;
93
85
  // this will allow us to select the previous sibling node,
@@ -102,9 +94,6 @@ const ElementItem = (0, styled_components_1.default)(FileSectionItem_1.Item) `
102
94
  .refItems:hover ~ .element {
103
95
  background: white !important;
104
96
  }
105
- &:hover ${exports.FileDateContainer} {
106
- display: flex;
107
- }
108
97
 
109
98
  .refItems:hover {
110
99
  background: white !important;
@@ -123,17 +112,13 @@ const Element = styled_components_1.default.div `
123
112
  display: flex;
124
113
  padding: 20px 15px;
125
114
  `;
126
- const FileReferences = styled_components_1.default.div `
127
- display: flex;
128
- align-items: center;
129
- justify-content: space-between;
130
- width: 100%;
131
- `;
115
+ const FileReferences = styled_components_1.default.div ``;
132
116
  const FileReferenceItem = styled_components_1.default.div `
133
117
  display: flex;
134
118
  align-items: center;
135
119
  justify-content: space-between;
136
- width: 100% svg {
120
+
121
+ svg {
137
122
  width: 14px;
138
123
  height: 17px;
139
124
  }
@@ -176,7 +161,3 @@ const FileReferenceName = styled_components_1.default.div `
176
161
  const DropdownContainer = styled_components_1.default.div `
177
162
  position: relative;
178
163
  `;
179
- exports.FileDate = styled_components_1.default.div `
180
- color: '#6E6E6E';
181
- font-size: 12px;
182
- `;
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { PermissionsContext } from '../FileManager';
4
- export const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension, attachmentId, dispatch, fileCreatedDate, }) => {
4
+ export const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileExtension, attachmentId, dispatch, }) => {
5
5
  const fileName = fileAttachmentName.substring(0, fileAttachmentName.lastIndexOf('.'));
6
6
  const can = useContext(PermissionsContext);
7
7
  return (React.createElement(FileInfoContainer, null,
@@ -13,16 +13,8 @@ export const FileInfo = ({ showAttachmentName, title, fileAttachmentName, fileEx
13
13
  React.createElement(FileName, null, fileName),
14
14
  React.createElement("div", null,
15
15
  ".",
16
- fileExtension))),
17
- fileCreatedDate && (React.createElement(FileDateContainer, null,
18
- React.createElement(FileDate, null, fileCreatedDate))))));
16
+ fileExtension))))));
19
17
  };
20
- export const FileDateContainer = styled.div `
21
- line-height: 20px;
22
- overflow: hidden;
23
- width: 100%;
24
- display: none;
25
- `;
26
18
  export const FileInfoContainer = styled.div `
27
19
  margin-left: 8px;
28
20
  overflow: hidden;
@@ -31,15 +23,10 @@ export const FileInfoContainer = styled.div `
31
23
  justify-content: center;
32
24
  align-items: start;
33
25
  width: 100%;
34
-
35
- &:hover ${FileDateContainer} {
36
- display: flex;
37
- }
38
26
  `;
39
27
  export const FileNameTitleContainer = styled.div `
40
28
  display: flex;
41
29
  width: 100%;
42
- align-items: baseline;
43
30
  `;
44
31
  export const FileTitle = styled.div `
45
32
  color: ${(props) => props.theme.colors.text.primary};
@@ -62,11 +49,6 @@ export const FileName = styled.div `
62
49
  text-overflow: ellipsis;
63
50
  white-space: nowrap;
64
51
  overflow: hidden;
65
- width: 50px;
66
- `;
67
- export const FileDate = styled.div `
68
- color: '#6E6E6E';
69
- font-size: 12px;
70
52
  `;
71
53
  export const FileDescription = styled.div `
72
54
  color: ${(props) => props.theme.colors.text.secondary};
@@ -21,7 +21,7 @@ export const FileSectionItem = ({ fileSection, externalFile, title, showAttachme
21
21
  }
22
22
  } },
23
23
  React.createElement(FileTypeIcon, { withDot: isMainManuscript, fileExtension: fileExtension, alt: externalFile.name }),
24
- React.createElement(FileInfo, { fileExtension: fileExtension, fileCreatedDate: externalFile.createdDate, showAttachmentName: showAttachmentName, fileAttachmentName: externalFile.name, title: title, attachmentId: externalFile.id, dispatch: dispatch })),
24
+ React.createElement(FileInfo, { fileExtension: fileExtension, showAttachmentName: showAttachmentName, fileAttachmentName: externalFile.name, title: title, attachmentId: externalFile.id, dispatch: dispatch })),
25
25
  onClose && (React.createElement(IconCloseButton, { onClick: (e) => {
26
26
  e.preventDefault();
27
27
  onClose();
@@ -23,10 +23,7 @@ export const InlineFilesSection = ({ handleReplace, handleDownload, handleUpdate
23
23
  return (React.createElement("div", null, inlineFiles.map((file, index) => {
24
24
  var _a;
25
25
  return (React.createElement(ElementItem, { className: 'item', key: index, id: file.id, onClick: onElementClick },
26
- 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)))))),
26
+ React.createElement(FileReferences, { className: 'refItems' }, (_a = file.attachments) === null || _a === void 0 ? void 0 : _a.map((attachment) => (React.createElement(FileReference, { key: attachment.id, attachment: attachment, handleReplace: handleReplace, handleUpdateInline: handleUpdateInline, handleDetachFile: handleDetachFile, handleDownload: handleDownload, dispatch: dispatch })))),
30
27
  React.createElement(Element, { className: 'element' },
31
28
  fileTypesWithIconMap.get(file.type),
32
29
  React.createElement(FileInfoContainer, null,
@@ -53,11 +50,6 @@ const FileReference = ({ attachment, handleReplace, handleDownload, handleUpdate
53
50
  attachment.modelId &&
54
51
  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
52
  };
56
- export const FileDateContainer = styled.div `
57
- line-height: 40px;
58
- overflow: hidden;
59
- display: none;
60
- `;
61
53
  const ElementItem = styled(Item) `
62
54
  display: flex;
63
55
  // this will allow us to select the previous sibling node,
@@ -72,9 +64,6 @@ const ElementItem = styled(Item) `
72
64
  .refItems:hover ~ .element {
73
65
  background: white !important;
74
66
  }
75
- &:hover ${FileDateContainer} {
76
- display: flex;
77
- }
78
67
 
79
68
  .refItems:hover {
80
69
  background: white !important;
@@ -93,17 +82,13 @@ const Element = styled.div `
93
82
  display: flex;
94
83
  padding: 20px 15px;
95
84
  `;
96
- const FileReferences = styled.div `
97
- display: flex;
98
- align-items: center;
99
- justify-content: space-between;
100
- width: 100%;
101
- `;
85
+ const FileReferences = styled.div ``;
102
86
  const FileReferenceItem = styled.div `
103
87
  display: flex;
104
88
  align-items: center;
105
89
  justify-content: space-between;
106
- width: 100% svg {
90
+
91
+ svg {
107
92
  width: 14px;
108
93
  height: 17px;
109
94
  }
@@ -146,7 +131,3 @@ const FileReferenceName = styled.div `
146
131
  const DropdownContainer = styled.div `
147
132
  position: relative;
148
133
  `;
149
- export const FileDate = styled.div `
150
- color: '#6E6E6E';
151
- font-size: 12px;
152
- `;
@@ -6,14 +6,11 @@ export declare const FileInfo: React.FC<{
6
6
  fileAttachmentName: string;
7
7
  fileExtension: string;
8
8
  attachmentId: string;
9
- fileCreatedDate: Date;
10
9
  dispatch?: Dispatch<Action>;
11
10
  }>;
12
- export declare const FileDateContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
13
11
  export declare const FileInfoContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
14
12
  export declare const FileNameTitleContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
15
13
  export declare const FileTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
16
14
  export declare const FileNameContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
17
15
  export declare const FileName: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
18
- export declare const FileDate: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
19
16
  export declare const FileDescription: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -9,7 +9,6 @@ export type FileAttachment = {
9
9
  name: string;
10
10
  type: FileAttachmentType;
11
11
  link: string;
12
- createdDate: Date;
13
12
  };
14
13
  export type FileAttachmentType = {
15
14
  id: string;
@@ -18,5 +18,3 @@ export declare const InlineFilesSection: React.FC<{
18
18
  isEditor: boolean;
19
19
  dispatch: Dispatch<Action>;
20
20
  }>;
21
- export declare const FileDateContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
22
- export declare const FileDate: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
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-v8",
4
+ "version": "1.1.17",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -36,7 +36,7 @@
36
36
  "@formatjs/intl-relativetimeformat": "^4.5.9",
37
37
  "@formatjs/intl-utils": "^2.2.0",
38
38
  "@manuscripts/assets": "^0.6.2",
39
- "@manuscripts/transform": "^1.3.4",
39
+ "@manuscripts/transform": "^1.3.7",
40
40
  "@manuscripts/json-schema": "^2.1.0",
41
41
  "@manuscripts/title-editor": "^1.1.0",
42
42
  "@manuscripts/comment-editor": "^1.0.3",