@manuscripts/style-guide 0.30.16 → 0.30.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.
@@ -19,8 +19,15 @@ exports.FileSectionItem = ({ submissionId, externalFile, title, showAttachmentNa
19
19
  const fileExtension = externalFile.filename.substring(externalFile.filename.lastIndexOf('.') + 1);
20
20
  const designation = util_1.namesWithDesignationMap.get(externalFile.designation);
21
21
  const isMainManuscript = designation === util_1.Designation.MainManuscript;
22
+ const isSelected = externalFile._id == window.location.hash.substr(1);
22
23
  return (react_1.default.createElement(exports.Item, { ref: dragRef, className: className, style: style },
23
- react_1.default.createElement(exports.ItemContainer, { onClick: () => (window.location.hash = isEditor ? `#${externalFile._id}` : '#') },
24
+ react_1.default.createElement(exports.ItemContainer, { onClick: () => {
25
+ window.location.hash =
26
+ isEditor && !isSelected ? `#${externalFile._id}` : '#';
27
+ if (isSelected) {
28
+ window.location.hash = `#${externalFile._id}`;
29
+ }
30
+ } },
24
31
  react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { withDot: isMainManuscript, fileExtension: fileExtension, alt: externalFile.filename }),
25
32
  react_1.default.createElement(FileInfo_1.FileInfo, { fileExtension: fileExtension, showAttachmentName: showAttachmentName, showDesignationActions: showDesignationActions, submissionAttachmentName: externalFile.filename, title: title, designation: designation, description: externalFile.description, handleChangeDesignation: handleChangeDesignation, submissionId: submissionId, dispatch: dispatch })),
26
33
  onClose && (react_1.default.createElement(IconCloseButton, { onClick: (e) => {
@@ -13,8 +13,15 @@ export const FileSectionItem = ({ submissionId, externalFile, title, showAttachm
13
13
  const fileExtension = externalFile.filename.substring(externalFile.filename.lastIndexOf('.') + 1);
14
14
  const designation = namesWithDesignationMap.get(externalFile.designation);
15
15
  const isMainManuscript = designation === Designation.MainManuscript;
16
+ const isSelected = externalFile._id == window.location.hash.substr(1);
16
17
  return (React.createElement(Item, { ref: dragRef, className: className, style: style },
17
- React.createElement(ItemContainer, { onClick: () => (window.location.hash = isEditor ? `#${externalFile._id}` : '#') },
18
+ React.createElement(ItemContainer, { onClick: () => {
19
+ window.location.hash =
20
+ isEditor && !isSelected ? `#${externalFile._id}` : '#';
21
+ if (isSelected) {
22
+ window.location.hash = `#${externalFile._id}`;
23
+ }
24
+ } },
18
25
  React.createElement(FileTypeIcon, { withDot: isMainManuscript, fileExtension: fileExtension, alt: externalFile.filename }),
19
26
  React.createElement(FileInfo, { fileExtension: fileExtension, showAttachmentName: showAttachmentName, showDesignationActions: showDesignationActions, submissionAttachmentName: externalFile.filename, title: title, designation: designation, description: externalFile.description, handleChangeDesignation: handleChangeDesignation, submissionId: submissionId, dispatch: dispatch })),
20
27
  onClose && (React.createElement(IconCloseButton, { onClick: (e) => {
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": "0.30.16",
4
+ "version": "0.30.17",
5
5
  "repository": "gitlab:mpapp-public/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",