@manuscripts/style-guide 1.4.0-LEAN-3050-0 → 1.4.0-LEAN-2852-11

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.
@@ -56,27 +56,35 @@ const LinkSharedStyles = (0, styled_components_1.css) `
56
56
  color: inherit;
57
57
  outline: none;
58
58
 
59
- &:hover,
60
- &:focus {
61
- &,
62
- span {
63
- color: ${(props) => props.theme.colors.text.tertiary};
59
+ &:not(:disabled) {
60
+ &:hover,
61
+ &:focus {
62
+ &,
63
+ span {
64
+ color: ${(props) => props.theme.colors.text.tertiary};
65
+ }
64
66
  }
65
67
  }
66
68
  `;
67
69
  const AuthorAffiliation = styled_components_1.default.span `
68
70
  ${LinkSharedStyles}
69
71
  `;
70
- const AuthorsContainer = styled_components_1.default.a `
72
+ const AuthorsContainer = styled_components_1.default.button `
71
73
  display: inline-flex;
74
+ background: transparent;
75
+ border: 0;
76
+ font-size: 1rem;
72
77
  ${LinkSharedStyles}
73
- &:hover {
74
- text-decoration: underline;
75
- cursor: pointer;
78
+
79
+ &:not(:disabled) {
80
+ &:hover {
81
+ text-decoration: underline;
82
+ cursor: pointer !important;
83
+ }
76
84
  }
77
85
  `;
78
- const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, }) => (react_1.default.createElement("span", { key: author._id },
79
- showEditButton ? (react_1.default.createElement(AuthorsContainer, { href: "#", onClick: (e) => {
86
+ const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, disableEditButton, }) => (react_1.default.createElement("span", { key: author._id },
87
+ showEditButton ? (react_1.default.createElement(AuthorsContainer, { disabled: disableEditButton, onClick: (e) => {
80
88
  e.preventDefault();
81
89
  startEditing && startEditing();
82
90
  selectAuthor && selectAuthor(author);
@@ -46,7 +46,7 @@ const AuthorsActions = styled_components_1.default.div `
46
46
  const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (react_1.default.createElement(AuthorsContainer, { isEmpty: !authors.length },
47
47
  react_1.default.createElement("div", null, authors.map((author, index) => (react_1.default.createElement(react_1.default.Fragment, { key: author._id },
48
48
  !!index && ', ',
49
- react_1.default.createElement(Author_1.Author, { author: author, jointFirstAuthor: (0, authors_1.isJointFirstAuthor)(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton }))))),
49
+ react_1.default.createElement(Author_1.Author, { author: author, jointFirstAuthor: (0, authors_1.isJointFirstAuthor)(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton, disableEditButton: disableEditButton }))))),
50
50
  showEditButton && startEditing && (react_1.default.createElement(AuthorsActions, null,
51
51
  react_1.default.createElement(Button_1.PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
52
52
  exports.AuthorsList = AuthorsList;
@@ -41,9 +41,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  return (mod && mod.__esModule) ? mod : { "default": mod };
42
42
  };
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.NavDropdownButton = exports.NavDropdownButtonContainer = exports.NotificationsBadge = exports.NavDropdownToggle = exports.NavDropdownButtonText = exports.NavDropdownSeparator = exports.NavDropdownElement = exports.NavDropdownLink = exports.InvitedBy = exports.PlaceholderTitle = exports.NavDropdown = exports.NavDropdownContainer = void 0;
44
+ exports.NavDropdownButton = exports.NavDropdownButtonContainer = exports.NotificationsBadge = exports.NavDropdownToggle = exports.NavDropdownButtonText = exports.NavDropdownSeparator = exports.NavDropdownElement = exports.NavDropdownLink = exports.InvitedBy = exports.NavDropdown = exports.NavDropdownContainer = void 0;
45
45
  const ArrowDownUp_1 = __importDefault(require("@manuscripts/assets/react/ArrowDownUp"));
46
- const title_editor_1 = require("@manuscripts/title-editor");
47
46
  const react_1 = __importDefault(require("react"));
48
47
  const react_router_dom_1 = require("react-router-dom");
49
48
  const styled_components_1 = __importStar(require("styled-components"));
@@ -72,9 +71,6 @@ exports.NavDropdown = styled_components_1.default.div `
72
71
  position: absolute;
73
72
  z-index: 10;
74
73
  `;
75
- exports.PlaceholderTitle = (0, styled_components_1.default)(title_editor_1.Title) `
76
- color: ${(props) => props.theme.colors.text.secondary};
77
- `;
78
74
  exports.InvitedBy = styled_components_1.default.div `
79
75
  display: flex;
80
76
  align-items: center;
@@ -97,8 +93,7 @@ const commonStyles = (0, styled_components_1.css) `
97
93
  : props.theme.colors.text.primary};
98
94
  pointer-events: ${(props) => (props.disabled ? 'none' : 'unset')};
99
95
 
100
- &:hover,
101
- &:hover ${exports.PlaceholderTitle} {
96
+ &:hover {
102
97
  background: ${(props) => props.theme.colors.background.fifth};
103
98
  }
104
99
  `;
@@ -56,7 +56,7 @@ const getCapabilities = (project, profile, role, actions) => {
56
56
  accessEditor: true,
57
57
  formatArticle: !isViewer(),
58
58
  editArticle: !isViewer(),
59
- editMetadata: !(isViewer() || isAnnotator() || isProofer()),
59
+ editMetadata: !(isViewer() || isProofer()) || isAnnotator(),
60
60
  editCitationsAndRefs: !(isViewer() || isAnnotator() || isProofer()),
61
61
  shareProject: isOwner(),
62
62
  applySaveChanges: !(isAnnotator() || isProofer()),
@@ -27,27 +27,35 @@ const LinkSharedStyles = css `
27
27
  color: inherit;
28
28
  outline: none;
29
29
 
30
- &:hover,
31
- &:focus {
32
- &,
33
- span {
34
- color: ${(props) => props.theme.colors.text.tertiary};
30
+ &:not(:disabled) {
31
+ &:hover,
32
+ &:focus {
33
+ &,
34
+ span {
35
+ color: ${(props) => props.theme.colors.text.tertiary};
36
+ }
35
37
  }
36
38
  }
37
39
  `;
38
40
  const AuthorAffiliation = styled.span `
39
41
  ${LinkSharedStyles}
40
42
  `;
41
- const AuthorsContainer = styled.a `
43
+ const AuthorsContainer = styled.button `
42
44
  display: inline-flex;
45
+ background: transparent;
46
+ border: 0;
47
+ font-size: 1rem;
43
48
  ${LinkSharedStyles}
44
- &:hover {
45
- text-decoration: underline;
46
- cursor: pointer;
49
+
50
+ &:not(:disabled) {
51
+ &:hover {
52
+ text-decoration: underline;
53
+ cursor: pointer !important;
54
+ }
47
55
  }
48
56
  `;
49
- export const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, }) => (React.createElement("span", { key: author._id },
50
- showEditButton ? (React.createElement(AuthorsContainer, { href: "#", onClick: (e) => {
57
+ export const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, disableEditButton, }) => (React.createElement("span", { key: author._id },
58
+ showEditButton ? (React.createElement(AuthorsContainer, { disabled: disableEditButton, onClick: (e) => {
51
59
  e.preventDefault();
52
60
  startEditing && startEditing();
53
61
  selectAuthor && selectAuthor(author);
@@ -40,6 +40,6 @@ const AuthorsActions = styled.div `
40
40
  export const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (React.createElement(AuthorsContainer, { isEmpty: !authors.length },
41
41
  React.createElement("div", null, authors.map((author, index) => (React.createElement(React.Fragment, { key: author._id },
42
42
  !!index && ', ',
43
- React.createElement(Author, { author: author, jointFirstAuthor: isJointFirstAuthor(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton }))))),
43
+ React.createElement(Author, { author: author, jointFirstAuthor: isJointFirstAuthor(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton, disableEditButton: disableEditButton }))))),
44
44
  showEditButton && startEditing && (React.createElement(AuthorsActions, null,
45
45
  React.createElement(PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
@@ -14,7 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import ArrowDownUp from '@manuscripts/assets/react/ArrowDownUp';
17
- import { Title } from '@manuscripts/title-editor';
18
17
  import React from 'react';
19
18
  import { NavLink } from 'react-router-dom';
20
19
  import styled, { css } from 'styled-components';
@@ -43,9 +42,6 @@ export const NavDropdown = styled.div `
43
42
  position: absolute;
44
43
  z-index: 10;
45
44
  `;
46
- export const PlaceholderTitle = styled(Title) `
47
- color: ${(props) => props.theme.colors.text.secondary};
48
- `;
49
45
  export const InvitedBy = styled.div `
50
46
  display: flex;
51
47
  align-items: center;
@@ -68,8 +64,7 @@ const commonStyles = css `
68
64
  : props.theme.colors.text.primary};
69
65
  pointer-events: ${(props) => (props.disabled ? 'none' : 'unset')};
70
66
 
71
- &:hover,
72
- &:hover ${PlaceholderTitle} {
67
+ &:hover {
73
68
  background: ${(props) => props.theme.colors.background.fifth};
74
69
  }
75
70
  `;
@@ -50,7 +50,7 @@ export const getCapabilities = (project, profile, role, actions) => {
50
50
  accessEditor: true,
51
51
  formatArticle: !isViewer(),
52
52
  editArticle: !isViewer(),
53
- editMetadata: !(isViewer() || isAnnotator() || isProofer()),
53
+ editMetadata: !(isViewer() || isProofer()) || isAnnotator(),
54
54
  editCitationsAndRefs: !(isViewer() || isAnnotator() || isProofer()),
55
55
  shareProject: isOwner(),
56
56
  applySaveChanges: !(isAnnotator() || isProofer()),
@@ -21,6 +21,7 @@ interface AuthorProps {
21
21
  affiliations?: AuthorAffiliationT[];
22
22
  jointFirstAuthor: boolean;
23
23
  showEditButton?: boolean;
24
+ disableEditButton?: boolean;
24
25
  selectAuthor?: (data: Contributor) => void;
25
26
  startEditing?: () => void;
26
27
  }
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Title } from '@manuscripts/title-editor';
17
16
  import React from 'react';
18
17
  import { NavLink } from 'react-router-dom';
19
18
  export declare const NavDropdownContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -22,7 +21,6 @@ export declare const NavDropdown: import("styled-components").StyledComponent<"d
22
21
  minWidth?: number | undefined;
23
22
  top?: number | undefined;
24
23
  }, never>;
25
- export declare const PlaceholderTitle: import("styled-components").StyledComponent<typeof Title, import("styled-components").DefaultTheme, {}, never>;
26
24
  export declare const InvitedBy: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
27
25
  export declare const NavDropdownLink: import("styled-components").StyledComponent<typeof NavLink, import("styled-components").DefaultTheme, {
28
26
  disabled?: boolean | undefined;
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.4.0-LEAN-3050-0",
4
+ "version": "1.4.0-LEAN-2852-11",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -36,9 +36,9 @@
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.5.0",
40
- "@manuscripts/json-schema": "^2.1.2",
41
- "@manuscripts/title-editor": "^1.1.0",
39
+ "@manuscripts/transform": "1.5.1-LEAN-2852-12",
40
+ "@manuscripts/json-schema": "2.2.0-LEAN-2852-14",
41
+ "@manuscripts/comment-editor": "^1.0.3",
42
42
  "@reach/tabs": "^0.11.2",
43
43
  "formik": "^2.2.9",
44
44
  "date-fns": "^2.29.3",
@@ -122,7 +122,6 @@
122
122
  "prosemirror-model": "^1.18.3",
123
123
  "prosemirror-state": "^1.4.2",
124
124
  "prosemirror-transform": "^1.7.0",
125
- "prosemirror-view": "^1.29.1",
126
125
  "react": "^17.0.2",
127
126
  "react-color": "^2.19.3",
128
127
  "react-dnd": "^11.1.3",