@manuscripts/article-editor 3.2.17-LEAN-3894.0 → 3.2.17-LEAN-3709.0

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.
Files changed (55) hide show
  1. package/dist/cjs/api/Api.js +2 -2
  2. package/dist/cjs/api/Api.js.map +1 -1
  3. package/dist/cjs/api/buildUtilities.js +2 -2
  4. package/dist/cjs/api/buildUtilities.js.map +1 -1
  5. package/dist/cjs/components/comments/CommentActions.js +2 -6
  6. package/dist/cjs/components/comments/CommentActions.js.map +1 -1
  7. package/dist/cjs/components/comments/CommentResolveButton.js +1 -1
  8. package/dist/cjs/components/comments/CommentThread.js +89 -77
  9. package/dist/cjs/components/comments/CommentThread.js.map +1 -1
  10. package/dist/cjs/components/comments/CommentsPanel.js +7 -31
  11. package/dist/cjs/components/comments/CommentsPanel.js.map +1 -1
  12. package/dist/cjs/components/inspector/SnapshotsDropdown.js +0 -11
  13. package/dist/cjs/components/inspector/SnapshotsDropdown.js.map +1 -1
  14. package/dist/cjs/hooks/use-handle-snapshot.js +2 -2
  15. package/dist/cjs/hooks/use-handle-snapshot.js.map +1 -1
  16. package/dist/cjs/lib/comments.js +5 -14
  17. package/dist/cjs/lib/comments.js.map +1 -1
  18. package/dist/es/api/Api.js +2 -2
  19. package/dist/es/api/Api.js.map +1 -1
  20. package/dist/es/api/buildUtilities.js +2 -2
  21. package/dist/es/api/buildUtilities.js.map +1 -1
  22. package/dist/es/components/comments/CommentActions.js +2 -6
  23. package/dist/es/components/comments/CommentActions.js.map +1 -1
  24. package/dist/es/components/comments/CommentResolveButton.js +1 -1
  25. package/dist/es/components/comments/CommentThread.js +92 -80
  26. package/dist/es/components/comments/CommentThread.js.map +1 -1
  27. package/dist/es/components/comments/CommentsPanel.js +8 -32
  28. package/dist/es/components/comments/CommentsPanel.js.map +1 -1
  29. package/dist/es/components/inspector/SnapshotsDropdown.js +1 -12
  30. package/dist/es/components/inspector/SnapshotsDropdown.js.map +1 -1
  31. package/dist/es/hooks/use-handle-snapshot.js +2 -2
  32. package/dist/es/hooks/use-handle-snapshot.js.map +1 -1
  33. package/dist/es/lib/comments.js +3 -11
  34. package/dist/es/lib/comments.js.map +1 -1
  35. package/dist/types/api/Api.d.ts +1 -1
  36. package/dist/types/components/comments/CommentThread.d.ts +2 -3
  37. package/dist/types/hooks/use-handle-snapshot.d.ts +1 -1
  38. package/dist/types/lib/comments.d.ts +3 -4
  39. package/dist/types/store/Store.d.ts +2 -2
  40. package/package.json +2 -2
  41. package/dist/cjs/components/comments/CommentCard.js +0 -162
  42. package/dist/cjs/components/comments/CommentCard.js.map +0 -1
  43. package/dist/cjs/components/comments/DeleteCommentConfirmation.js +0 -69
  44. package/dist/cjs/components/comments/DeleteCommentConfirmation.js.map +0 -1
  45. package/dist/cjs/components/comments/ReplyBox.js +0 -119
  46. package/dist/cjs/components/comments/ReplyBox.js.map +0 -1
  47. package/dist/es/components/comments/CommentCard.js +0 -132
  48. package/dist/es/components/comments/CommentCard.js.map +0 -1
  49. package/dist/es/components/comments/DeleteCommentConfirmation.js +0 -62
  50. package/dist/es/components/comments/DeleteCommentConfirmation.js.map +0 -1
  51. package/dist/es/components/comments/ReplyBox.js +0 -89
  52. package/dist/es/components/comments/ReplyBox.js.map +0 -1
  53. package/dist/types/components/comments/CommentCard.d.ts +0 -25
  54. package/dist/types/components/comments/DeleteCommentConfirmation.d.ts +0 -18
  55. package/dist/types/components/comments/ReplyBox.d.ts +0 -18
@@ -41,7 +41,7 @@ export type state = {
41
41
  collaborators: Map<string, UserProfile>;
42
42
  collaboratorsById: Map<string, UserProfile>;
43
43
  snapshots: SnapshotLabel[];
44
- createSnapshot: () => Promise<void>;
44
+ createSnapshot: (name: string) => Promise<void>;
45
45
  getSnapshot: (id: string) => Promise<ManuscriptSnapshot | undefined>;
46
46
  permittedActions: string[];
47
47
  selectedCommentKey?: CommentKey;
@@ -52,7 +52,7 @@ export type state = {
52
52
  preventUnload?: boolean;
53
53
  beforeUnload?: () => void;
54
54
  userRole: ProjectRole | null;
55
- handleSnapshot: () => Promise<void>;
55
+ handleSnapshot: (name: string) => Promise<void>;
56
56
  cslLocale?: string;
57
57
  cslStyle?: string;
58
58
  hasPendingSuggestions?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manuscripts/article-editor",
3
- "version": "3.2.17-LEAN-3894.0",
3
+ "version": "3.2.17-LEAN-3709.0",
4
4
  "license": "CPAL-1.0",
5
5
  "description": "React components for editing and viewing manuscripts",
6
6
  "repository": "github:Atypon-OpenSource/manuscripts-article-editor",
@@ -35,7 +35,7 @@
35
35
  "@fontsource/lato": "^4.5.10",
36
36
  "@fontsource/pt-sans": "^4.5.11",
37
37
  "@fontsource/pt-serif": "^4.5.11",
38
- "@manuscripts/body-editor": "2.2.16-LEAN-3894.0",
38
+ "@manuscripts/body-editor": "2.2.15",
39
39
  "@manuscripts/json-schema": "2.2.11",
40
40
  "@manuscripts/library": "1.3.11",
41
41
  "@manuscripts/style-guide": "2.0.21",
@@ -1,162 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.CommentCard = void 0;
30
- const style_guide_1 = require("@manuscripts/style-guide");
31
- const react_1 = __importStar(require("react"));
32
- const styled_components_1 = __importDefault(require("styled-components"));
33
- const comments_1 = require("../../lib/comments");
34
- const store_1 = require("../../store");
35
- const CommentActions_1 = require("./CommentActions");
36
- const CommentBody_1 = require("./CommentBody");
37
- const DeleteCommentConfirmation_1 = require("./DeleteCommentConfirmation");
38
- const CommentHeader = styled_components_1.default.div `
39
- display: flex;
40
- justify-content: space-between;
41
- margin-bottom: 8px;
42
- `;
43
- const CommentMetadata = styled_components_1.default.div `
44
- display: flex;
45
- align-items: center;
46
- padding-right: 8px;
47
- `;
48
- const CommentAuthor = styled_components_1.default.div `
49
- display: flex;
50
- color: #353535;
51
- font-weight: 400;
52
- max-width: 200px;
53
- white-space: nowrap;
54
- overflow: hidden;
55
- text-overflow: ellipsis;
56
- width: 100%;
57
-
58
- svg {
59
- padding-right: 10px;
60
- }
61
- `;
62
- const CommentTarget = styled_components_1.default.div `
63
- font-size: 14px;
64
- color: #353535;
65
- background-color: #ffeebf;
66
- padding: 4px 8px;
67
- margin-top: 16px;
68
- margin-bottom: 16px;
69
- `;
70
- const Timestamp = (0, styled_components_1.default)(style_guide_1.RelativeDate) `
71
- font-size: 12px;
72
- line-height: 16px;
73
- font-weight: 400;
74
- color: #6e6e6e;
75
- white-space: nowrap;
76
- padding-right: 8px;
77
- `;
78
- const RepliesCount = styled_components_1.default.div `
79
- border-radius: 50%;
80
- width: 20px;
81
- height: 12px;
82
- color: #ffffff;
83
- background-color: #1a9bc7;
84
- text-align: center;
85
- font-size: 9px;
86
- `;
87
- const Card = styled_components_1.default.div `
88
- position: relative;
89
- `;
90
- const CommentCard = ({ comment, isReply, numOfReplies, isNew, isEndOfThread, onSave, onDelete, onSelect, }) => {
91
- const can = (0, style_guide_1.usePermissions)();
92
- const [{ user, collaboratorsById }] = (0, store_1.useStore)((state) => ({
93
- user: state.user,
94
- collaboratorsById: state.collaboratorsById,
95
- }));
96
- const authorID = (0, comments_1.getAuthorID)(comment);
97
- const authorName = authorID
98
- ? (0, comments_1.buildAuthorName)(collaboratorsById.get(authorID))
99
- : '';
100
- const timestamp = comment.node.attrs.contributions?.[0].timestamp;
101
- const isOwn = authorID === user._id;
102
- const isResolveEnabled = isOwn
103
- ? can.resolveOwnComment
104
- : can.resolveOthersComment;
105
- const isActionsEnabled = isOwn
106
- ? can.handleOwnComments
107
- : can.handleOthersComments;
108
- const [isEditing, setEditing] = (0, react_1.useState)(isNew);
109
- const [showDeleteConfirmation, setShowDeleteConfirmation] = (0, react_1.useState)(false);
110
- const handleEdit = () => {
111
- setEditing(true);
112
- onSelect();
113
- };
114
- const handleSave = (contents) => {
115
- onSave({
116
- ...comment.node.attrs,
117
- contents,
118
- });
119
- setEditing(false);
120
- };
121
- const handleCancel = () => {
122
- setEditing(false);
123
- if (isNew) {
124
- onDelete(comment.node.attrs.id);
125
- }
126
- };
127
- const handleToggleResolve = () => {
128
- onSave({
129
- ...comment.node.attrs,
130
- resolved: !comment.node.attrs.resolved,
131
- });
132
- };
133
- const handleDelete = () => {
134
- setShowDeleteConfirmation(true);
135
- };
136
- const confirmDelete = () => {
137
- onDelete(comment.node.attrs.id);
138
- setShowDeleteConfirmation(false);
139
- };
140
- const cancelDelete = () => {
141
- setShowDeleteConfirmation(false);
142
- };
143
- return (react_1.default.createElement(Card, null,
144
- react_1.default.createElement(CommentHeader, { "data-cy": "comment-header" },
145
- react_1.default.createElement(CommentMetadata, null,
146
- react_1.default.createElement(CommentAuthor, null, authorName ? (react_1.default.createElement(react_1.default.Fragment, null,
147
- react_1.default.createElement(style_guide_1.AvatarIcon, { width: 20, height: 20 }),
148
- react_1.default.createElement(CommentAuthor, null, authorName))) : (!isReply && (react_1.default.createElement(react_1.default.Fragment, null,
149
- react_1.default.createElement(style_guide_1.SystemUserAvatarIcon, { width: 20, height: 20 }),
150
- react_1.default.createElement(CommentAuthor, null, "System"))))),
151
- timestamp && react_1.default.createElement(Timestamp, { date: timestamp * 1000 }),
152
- numOfReplies !== 0 && react_1.default.createElement(RepliesCount, null,
153
- " ",
154
- numOfReplies,
155
- " ")),
156
- react_1.default.createElement(CommentActions_1.CommentActions, { comment: comment, isResolveEnabled: isResolveEnabled && !isReply, isActionsEnabled: isActionsEnabled && isEndOfThread, onDelete: handleDelete, onEdit: handleEdit, toggleResolve: handleToggleResolve })),
157
- comment.node.attrs.originalText && (react_1.default.createElement(CommentTarget, null, comment.node.attrs.originalText)),
158
- react_1.default.createElement(CommentBody_1.CommentBody, { comment: comment, isEditing: isNew || isEditing, onSave: handleSave, onCancel: handleCancel, onSelect: onSelect }),
159
- showDeleteConfirmation && (react_1.default.createElement(DeleteCommentConfirmation_1.DeleteCommentConfirmation, { onCancel: cancelDelete, onConfirm: confirmDelete }))));
160
- };
161
- exports.CommentCard = CommentCard;
162
- //# sourceMappingURL=CommentCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommentCard.js","sourceRoot":"","sources":["../../../../src/components/comments/CommentCard.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,0DAKiC;AACjC,+CAAuC;AACvC,0EAAsC;AAEtC,iDAAiE;AACjE,uCAAsC;AACtC,qDAAiD;AACjD,+CAA2C;AAC3C,2EAAuE;AAEvE,MAAM,aAAa,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAI/B,CAAA;AAED,MAAM,eAAe,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAIjC,CAAA;AAED,MAAM,aAAa,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;CAa/B,CAAA;AACD,MAAM,aAAa,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;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ACH,CAAC,CAAA;AA5HY,QAAA,WAAW,eA4HvB"}
@@ -1,69 +0,0 @@
1
- "use strict";
2
- /*!
3
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
4
- *
5
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
6
- *
7
- * The Original Code is manuscripts-frontend.
8
- *
9
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
10
- *
11
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
12
- */
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.DeleteCommentConfirmation = void 0;
18
- const style_guide_1 = require("@manuscripts/style-guide");
19
- const react_1 = __importDefault(require("react"));
20
- const styled_components_1 = __importDefault(require("styled-components"));
21
- const MessageContainer = styled_components_1.default.div `
22
- display: flex;
23
- align-items: center;
24
- flex-grow: 1;
25
- `;
26
- const CancelButton = (0, styled_components_1.default)(style_guide_1.SecondaryButton) `
27
- padding: 4px ${(props) => props.theme.grid.unit * 3}px;
28
- font-size: 14px;
29
- `;
30
- const DeleteButton = (0, styled_components_1.default)(style_guide_1.PrimaryButton) `
31
- padding: 4px ${(props) => props.theme.grid.unit * 3}px;
32
- font-size: 14px;
33
- `;
34
- const Message = styled_components_1.default.div `
35
- font-weight: 700;
36
- color: #000;
37
- font-size: 14px;
38
- line-height: 16px;
39
- margin: 0 8px;
40
- `;
41
- const DeleteConfirmation = styled_components_1.default.div `
42
- position: absolute;
43
- top: 0;
44
- left: 0;
45
- right: 0;
46
- bottom: 0;
47
- opacity: 0.95;
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- background: #fafafa;
52
- z-index: 10;
53
- `;
54
- const Buttons = (0, styled_components_1.default)(style_guide_1.ButtonGroup) `
55
- & button:not(:last-of-type) {
56
- margin-right: 4px;
57
- }
58
- `;
59
- const DeleteCommentConfirmation = ({ onCancel, onConfirm }) => {
60
- return (react_1.default.createElement(DeleteConfirmation, null,
61
- react_1.default.createElement(MessageContainer, null,
62
- react_1.default.createElement(style_guide_1.AttentionOrangeIcon, null),
63
- react_1.default.createElement(Message, null, "Delete this comment?")),
64
- react_1.default.createElement(Buttons, null,
65
- react_1.default.createElement(CancelButton, { onClick: onCancel }, "Cancel"),
66
- react_1.default.createElement(DeleteButton, { onClick: onConfirm }, "Delete"))));
67
- };
68
- exports.DeleteCommentConfirmation = DeleteCommentConfirmation;
69
- //# sourceMappingURL=DeleteCommentConfirmation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeleteCommentConfirmation.js","sourceRoot":"","sources":["../../../../src/components/comments/DeleteCommentConfirmation.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,0DAKiC;AACjC,kDAAyB;AACzB,0EAAsC;AAEtC,MAAM,gBAAgB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAIlC,CAAA;AAED,MAAM,YAAY,GAAG,IAAA,2BAAM,EAAC,6BAAe,CAAC,CAAA;iBAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;CAEpD,CAAA;AACD,MAAM,YAAY,GAAG,IAAA,2BAAM,EAAC,2BAAa,CAAC,CAAA;iBACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;CAEpD,CAAA;AACD,MAAM,OAAO,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;CAMzB,CAAA;AAED,MAAM,kBAAkB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;CAYpC,CAAA;AAED,MAAM,OAAO,GAAG,IAAA,2BAAM,EAAC,yBAAW,CAAC,CAAA;;;;CAIlC,CAAA;AAOM,MAAM,yBAAyB,GAElC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IAC9B,OAAO,CACL,8BAAC,kBAAkB;QACjB,8BAAC,gBAAgB;YACf,8BAAC,iCAAmB,OAAG;YACvB,8BAAC,OAAO,+BAA+B,CACtB;QACnB,8BAAC,OAAO;YACN,8BAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,aAAuB;YACtD,8BAAC,YAAY,IAAC,OAAO,EAAE,SAAS,aAAuB,CAC/C,CACS,CACtB,CAAA;AACH,CAAC,CAAA;AAfY,QAAA,yBAAyB,6BAerC"}
@@ -1,119 +0,0 @@
1
- "use strict";
2
- /*!
3
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
4
- *
5
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
6
- *
7
- * The Original Code is manuscripts-frontend.
8
- *
9
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
10
- *
11
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
12
- */
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.ReplyBox = void 0;
41
- const style_guide_1 = require("@manuscripts/style-guide");
42
- const react_1 = __importStar(require("react"));
43
- const styled_components_1 = __importDefault(require("styled-components"));
44
- const ReplyBox = ({ insertCommentReply, commentId, }) => {
45
- const [isTextBoxFocused, setIsTextBoxFocused] = (0, react_1.useState)(false);
46
- const [value, setValue] = (0, react_1.useState)('');
47
- const replyRef = (0, react_1.useRef)(null);
48
- const handleFocus = () => setIsTextBoxFocused(true);
49
- const handleBlur = (event) => {
50
- if (!event.target.value.length) {
51
- setIsTextBoxFocused(false);
52
- }
53
- };
54
- const reply = () => {
55
- if (replyRef.current) {
56
- insertCommentReply(commentId, replyRef.current.value);
57
- setIsTextBoxFocused(false);
58
- setValue('');
59
- replyRef.current.value = '';
60
- replyRef.current.style.height = '30px'; // Reset the height
61
- }
62
- };
63
- const disableSaveButton = (0, react_1.useMemo)(() => !value.length, [value]);
64
- const onTextChange = (e) => {
65
- setValue(e.target.value);
66
- if (replyRef.current) {
67
- replyRef.current.style.height = '30px'; // Reset the height
68
- replyRef.current.style.height = `${Math.min(replyRef.current.scrollHeight, 55)}px`; // Set the height based on content
69
- }
70
- };
71
- return (react_1.default.createElement(react_1.default.Fragment, null,
72
- react_1.default.createElement(TextBox, { "data-cy": "reply", placeholder: "Reply...", ref: replyRef, onChange: onTextChange, onFocus: handleFocus, onBlur: handleBlur }),
73
- isTextBoxFocused && (react_1.default.createElement(Actions, { "data-cy": "reply-actions" },
74
- react_1.default.createElement(style_guide_1.SecondaryButton, { onClick: () => {
75
- setIsTextBoxFocused(false);
76
- setValue('');
77
- if (replyRef.current) {
78
- replyRef.current.value = '';
79
- replyRef.current.style.height = '30px'; // Reset the height
80
- }
81
- } }, "Cancel"),
82
- react_1.default.createElement(style_guide_1.PrimaryButton, { onClick: reply, disabled: disableSaveButton }, "Reply")))));
83
- };
84
- exports.ReplyBox = ReplyBox;
85
- const TextBox = styled_components_1.default.textarea `
86
- cursor: text;
87
- font-family: ${(props) => props.theme.font.family.sans};
88
- color: ${(props) => props.theme.colors.text.primary};
89
- margin: ${(props) => props.theme.grid.unit * 2}px 0;
90
- resize: none;
91
-
92
- width: 100%;
93
-
94
- height: 30px;
95
- max-height: 55px;
96
-
97
- outline: 0;
98
- border: 1px solid #e2e2e2;
99
- border-radius: 6px;
100
-
101
- &:focus {
102
- background: #f2fbfc;
103
- border: 1px solid #bce7f6;
104
- border-radius: 6px;
105
- }
106
-
107
- box-sizing: border-box;
108
- padding: 3px 16px 3px 16px;
109
- font-style: normal;
110
- font-weight: 400;
111
- font-size: 14px;
112
- line-height: 24px;
113
- `;
114
- const Actions = (0, styled_components_1.default)(style_guide_1.ButtonGroup) `
115
- & button:not(:last-of-type) {
116
- margin-right: 4px;
117
- }
118
- `;
119
- //# sourceMappingURL=ReplyBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReplyBox.js","sourceRoot":"","sources":["../../../../src/components/comments/ReplyBox.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;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KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;YACzC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;CAwB/C,CAAA;AAED,MAAM,OAAO,GAAG,IAAA,2BAAM,EAAC,yBAAW,CAAC,CAAA;;;;CAIlC,CAAA"}
@@ -1,132 +0,0 @@
1
- import { AvatarIcon, RelativeDate, SystemUserAvatarIcon, usePermissions, } from '@manuscripts/style-guide';
2
- import React, { useState } from 'react';
3
- import styled from 'styled-components';
4
- import { buildAuthorName, getAuthorID } from '../../lib/comments';
5
- import { useStore } from '../../store';
6
- import { CommentActions } from './CommentActions';
7
- import { CommentBody } from './CommentBody';
8
- import { DeleteCommentConfirmation } from './DeleteCommentConfirmation';
9
- const CommentHeader = styled.div `
10
- display: flex;
11
- justify-content: space-between;
12
- margin-bottom: 8px;
13
- `;
14
- const CommentMetadata = styled.div `
15
- display: flex;
16
- align-items: center;
17
- padding-right: 8px;
18
- `;
19
- const CommentAuthor = styled.div `
20
- display: flex;
21
- color: #353535;
22
- font-weight: 400;
23
- max-width: 200px;
24
- white-space: nowrap;
25
- overflow: hidden;
26
- text-overflow: ellipsis;
27
- width: 100%;
28
-
29
- svg {
30
- padding-right: 10px;
31
- }
32
- `;
33
- const CommentTarget = styled.div `
34
- font-size: 14px;
35
- color: #353535;
36
- background-color: #ffeebf;
37
- padding: 4px 8px;
38
- margin-top: 16px;
39
- margin-bottom: 16px;
40
- `;
41
- const Timestamp = styled(RelativeDate) `
42
- font-size: 12px;
43
- line-height: 16px;
44
- font-weight: 400;
45
- color: #6e6e6e;
46
- white-space: nowrap;
47
- padding-right: 8px;
48
- `;
49
- const RepliesCount = styled.div `
50
- border-radius: 50%;
51
- width: 20px;
52
- height: 12px;
53
- color: #ffffff;
54
- background-color: #1a9bc7;
55
- text-align: center;
56
- font-size: 9px;
57
- `;
58
- const Card = styled.div `
59
- position: relative;
60
- `;
61
- export const CommentCard = ({ comment, isReply, numOfReplies, isNew, isEndOfThread, onSave, onDelete, onSelect, }) => {
62
- const can = usePermissions();
63
- const [{ user, collaboratorsById }] = useStore((state) => ({
64
- user: state.user,
65
- collaboratorsById: state.collaboratorsById,
66
- }));
67
- const authorID = getAuthorID(comment);
68
- const authorName = authorID
69
- ? buildAuthorName(collaboratorsById.get(authorID))
70
- : '';
71
- const timestamp = comment.node.attrs.contributions?.[0].timestamp;
72
- const isOwn = authorID === user._id;
73
- const isResolveEnabled = isOwn
74
- ? can.resolveOwnComment
75
- : can.resolveOthersComment;
76
- const isActionsEnabled = isOwn
77
- ? can.handleOwnComments
78
- : can.handleOthersComments;
79
- const [isEditing, setEditing] = useState(isNew);
80
- const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false);
81
- const handleEdit = () => {
82
- setEditing(true);
83
- onSelect();
84
- };
85
- const handleSave = (contents) => {
86
- onSave({
87
- ...comment.node.attrs,
88
- contents,
89
- });
90
- setEditing(false);
91
- };
92
- const handleCancel = () => {
93
- setEditing(false);
94
- if (isNew) {
95
- onDelete(comment.node.attrs.id);
96
- }
97
- };
98
- const handleToggleResolve = () => {
99
- onSave({
100
- ...comment.node.attrs,
101
- resolved: !comment.node.attrs.resolved,
102
- });
103
- };
104
- const handleDelete = () => {
105
- setShowDeleteConfirmation(true);
106
- };
107
- const confirmDelete = () => {
108
- onDelete(comment.node.attrs.id);
109
- setShowDeleteConfirmation(false);
110
- };
111
- const cancelDelete = () => {
112
- setShowDeleteConfirmation(false);
113
- };
114
- return (React.createElement(Card, null,
115
- React.createElement(CommentHeader, { "data-cy": "comment-header" },
116
- React.createElement(CommentMetadata, null,
117
- React.createElement(CommentAuthor, null, authorName ? (React.createElement(React.Fragment, null,
118
- React.createElement(AvatarIcon, { width: 20, height: 20 }),
119
- React.createElement(CommentAuthor, null, authorName))) : (!isReply && (React.createElement(React.Fragment, null,
120
- React.createElement(SystemUserAvatarIcon, { width: 20, height: 20 }),
121
- React.createElement(CommentAuthor, null, "System"))))),
122
- timestamp && React.createElement(Timestamp, { date: timestamp * 1000 }),
123
- numOfReplies !== 0 && React.createElement(RepliesCount, null,
124
- " ",
125
- numOfReplies,
126
- " ")),
127
- React.createElement(CommentActions, { comment: comment, isResolveEnabled: isResolveEnabled && !isReply, isActionsEnabled: isActionsEnabled && isEndOfThread, onDelete: handleDelete, onEdit: handleEdit, toggleResolve: handleToggleResolve })),
128
- comment.node.attrs.originalText && (React.createElement(CommentTarget, null, comment.node.attrs.originalText)),
129
- React.createElement(CommentBody, { comment: comment, isEditing: isNew || isEditing, onSave: handleSave, onCancel: handleCancel, onSelect: onSelect }),
130
- showDeleteConfirmation && (React.createElement(DeleteCommentConfirmation, { onCancel: cancelDelete, onConfirm: confirmDelete }))));
131
- };
132
- //# sourceMappingURL=CommentCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommentCard.js","sourceRoot":"","sources":["../../../../src/components/comments/CommentCard.tsx"],"names":[],"mappings":"AAYA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAEvE,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI/B,CAAA;AAED,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIjC,CAAA;AAED,MAAM,aAAa,GAA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AE,YAAY,EACtB,SAAS,EAAE,aAAa,GACxB,CACH,CACI,CACR,CAAA;AACH,CAAC,CAAA"}
@@ -1,62 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { AttentionOrangeIcon, ButtonGroup, PrimaryButton, SecondaryButton, } from '@manuscripts/style-guide';
13
- import React from 'react';
14
- import styled from 'styled-components';
15
- const MessageContainer = styled.div `
16
- display: flex;
17
- align-items: center;
18
- flex-grow: 1;
19
- `;
20
- const CancelButton = styled(SecondaryButton) `
21
- padding: 4px ${(props) => props.theme.grid.unit * 3}px;
22
- font-size: 14px;
23
- `;
24
- const DeleteButton = styled(PrimaryButton) `
25
- padding: 4px ${(props) => props.theme.grid.unit * 3}px;
26
- font-size: 14px;
27
- `;
28
- const Message = styled.div `
29
- font-weight: 700;
30
- color: #000;
31
- font-size: 14px;
32
- line-height: 16px;
33
- margin: 0 8px;
34
- `;
35
- const DeleteConfirmation = styled.div `
36
- position: absolute;
37
- top: 0;
38
- left: 0;
39
- right: 0;
40
- bottom: 0;
41
- opacity: 0.95;
42
- display: flex;
43
- align-items: center;
44
- justify-content: center;
45
- background: #fafafa;
46
- z-index: 10;
47
- `;
48
- const Buttons = styled(ButtonGroup) `
49
- & button:not(:last-of-type) {
50
- margin-right: 4px;
51
- }
52
- `;
53
- export const DeleteCommentConfirmation = ({ onCancel, onConfirm }) => {
54
- return (React.createElement(DeleteConfirmation, null,
55
- React.createElement(MessageContainer, null,
56
- React.createElement(AttentionOrangeIcon, null),
57
- React.createElement(Message, null, "Delete this comment?")),
58
- React.createElement(Buttons, null,
59
- React.createElement(CancelButton, { onClick: onCancel }, "Cancel"),
60
- React.createElement(DeleteButton, { onClick: onConfirm }, "Delete"))));
61
- };
62
- //# sourceMappingURL=DeleteCommentConfirmation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeleteCommentConfirmation.js","sourceRoot":"","sources":["../../../../src/components/comments/DeleteCommentConfirmation.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIlC,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,CAAA;iBAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;CAEpD,CAAA;AACD,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;iBACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;CAEpD,CAAA;AACD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMzB,CAAA;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;CAYpC,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;CAIlC,CAAA;AAOD,MAAM,CAAC,MAAM,yBAAyB,GAElC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IAC9B,OAAO,CACL,oBAAC,kBAAkB;QACjB,oBAAC,gBAAgB;YACf,oBAAC,mBAAmB,OAAG;YACvB,oBAAC,OAAO,+BAA+B,CACtB;QACnB,oBAAC,OAAO;YACN,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,aAAuB;YACtD,oBAAC,YAAY,IAAC,OAAO,EAAE,SAAS,aAAuB,CAC/C,CACS,CACtB,CAAA;AACH,CAAC,CAAA"}