@manuscripts/article-editor 3.4.2-LEAN-3894.0 → 3.4.2-LEAN-3638.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.
- package/dist/cjs/components/comments/CommentActions.js +7 -11
- package/dist/cjs/components/comments/CommentActions.js.map +1 -1
- package/dist/cjs/components/comments/CommentBody.js +6 -10
- package/dist/cjs/components/comments/CommentBody.js.map +1 -1
- package/dist/cjs/components/comments/CommentResolveButton.js +1 -1
- package/dist/cjs/components/comments/CommentThread.js +89 -83
- package/dist/cjs/components/comments/CommentThread.js.map +1 -1
- package/dist/cjs/components/comments/CommentsPanel.js +10 -33
- package/dist/cjs/components/comments/CommentsPanel.js.map +1 -1
- package/dist/cjs/lib/comments.js +5 -26
- package/dist/cjs/lib/comments.js.map +1 -1
- package/dist/es/components/comments/CommentActions.js +7 -11
- package/dist/es/components/comments/CommentActions.js.map +1 -1
- package/dist/es/components/comments/CommentBody.js +7 -11
- package/dist/es/components/comments/CommentBody.js.map +1 -1
- package/dist/es/components/comments/CommentResolveButton.js +1 -1
- package/dist/es/components/comments/CommentThread.js +92 -86
- package/dist/es/components/comments/CommentThread.js.map +1 -1
- package/dist/es/components/comments/CommentsPanel.js +12 -35
- package/dist/es/components/comments/CommentsPanel.js.map +1 -1
- package/dist/es/lib/comments.js +3 -23
- package/dist/es/lib/comments.js.map +1 -1
- package/dist/types/components/comments/CommentThread.d.ts +2 -3
- package/dist/types/lib/comments.d.ts +3 -4
- package/package.json +2 -2
- package/dist/cjs/components/comments/CommentCard.js +0 -165
- package/dist/cjs/components/comments/CommentCard.js.map +0 -1
- package/dist/cjs/components/comments/DeleteCommentConfirmation.js +0 -74
- package/dist/cjs/components/comments/DeleteCommentConfirmation.js.map +0 -1
- package/dist/cjs/components/comments/ReplyBox.js +0 -121
- package/dist/cjs/components/comments/ReplyBox.js.map +0 -1
- package/dist/es/components/comments/CommentCard.js +0 -135
- package/dist/es/components/comments/CommentCard.js.map +0 -1
- package/dist/es/components/comments/DeleteCommentConfirmation.js +0 -67
- package/dist/es/components/comments/DeleteCommentConfirmation.js.map +0 -1
- package/dist/es/components/comments/ReplyBox.js +0 -91
- package/dist/es/components/comments/ReplyBox.js.map +0 -1
- package/dist/types/components/comments/CommentCard.d.ts +0 -27
- package/dist/types/components/comments/DeleteCommentConfirmation.d.ts +0 -19
- package/dist/types/components/comments/ReplyBox.d.ts +0 -18
@@ -1,165 +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 AuthorContainer = 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
|
-
flex-grow: 1;
|
56
|
-
text-overflow: ellipsis;
|
57
|
-
margin-right: 8px;
|
58
|
-
|
59
|
-
svg {
|
60
|
-
padding-right: 10px;
|
61
|
-
flex-shrink: 0;
|
62
|
-
}
|
63
|
-
`;
|
64
|
-
const CommentTarget = styled_components_1.default.div `
|
65
|
-
font-size: 14px;
|
66
|
-
color: #353535;
|
67
|
-
background-color: #ffeebf;
|
68
|
-
padding: 4px 8px;
|
69
|
-
margin-top: 16px;
|
70
|
-
margin-bottom: 16px;
|
71
|
-
`;
|
72
|
-
const Timestamp = (0, styled_components_1.default)(style_guide_1.RelativeDate) `
|
73
|
-
font-size: 12px;
|
74
|
-
line-height: 16px;
|
75
|
-
font-weight: 400;
|
76
|
-
color: #6e6e6e;
|
77
|
-
white-space: nowrap;
|
78
|
-
padding-right: 8px;
|
79
|
-
`;
|
80
|
-
const RepliesCount = styled_components_1.default.div `
|
81
|
-
border-radius: 50%;
|
82
|
-
width: 12px;
|
83
|
-
height: 12px;
|
84
|
-
color: #ffffff;
|
85
|
-
background-color: #1a9bc7;
|
86
|
-
text-align: center;
|
87
|
-
font-size: 9px;
|
88
|
-
`;
|
89
|
-
const Card = styled_components_1.default.div `
|
90
|
-
position: relative;
|
91
|
-
`;
|
92
|
-
const CommentCard = ({ comment, isReply, numOfReplies, isNew, isEndOfThread, editingCommentId, setEditingCommentId, onSave, onDelete, onSelect, }) => {
|
93
|
-
const can = (0, style_guide_1.usePermissions)();
|
94
|
-
const [{ user, collaboratorsById }] = (0, store_1.useStore)((state) => ({
|
95
|
-
user: state.user,
|
96
|
-
collaboratorsById: state.collaboratorsById,
|
97
|
-
}));
|
98
|
-
const authorID = (0, comments_1.getAuthorID)(comment);
|
99
|
-
const authorName = authorID
|
100
|
-
? (0, comments_1.buildAuthorName)(collaboratorsById.get(authorID))
|
101
|
-
: '';
|
102
|
-
const timestamp = comment.node.attrs.contributions?.[0].timestamp;
|
103
|
-
const isOwn = authorID === user._id;
|
104
|
-
const isResolveEnabled = isOwn
|
105
|
-
? can.resolveOwnComment
|
106
|
-
: can.resolveOthersComment;
|
107
|
-
const isActionsEnabled = isOwn
|
108
|
-
? can.handleOwnComments
|
109
|
-
: can.handleOthersComments;
|
110
|
-
const commentID = comment.node.attrs.id;
|
111
|
-
const [showDeleteConfirmation, setShowDeleteConfirmation] = (0, react_1.useState)(false);
|
112
|
-
const handleEdit = () => {
|
113
|
-
setEditingCommentId(commentID);
|
114
|
-
onSelect();
|
115
|
-
};
|
116
|
-
const handleSave = (contents) => {
|
117
|
-
onSave({
|
118
|
-
...comment.node.attrs,
|
119
|
-
contents,
|
120
|
-
});
|
121
|
-
setEditingCommentId(null);
|
122
|
-
};
|
123
|
-
const handleCancel = () => {
|
124
|
-
setEditingCommentId(null);
|
125
|
-
if (isNew) {
|
126
|
-
onDelete(commentID);
|
127
|
-
}
|
128
|
-
};
|
129
|
-
const handleToggleResolve = () => {
|
130
|
-
onSave({
|
131
|
-
...comment.node.attrs,
|
132
|
-
resolved: !comment.node.attrs.resolved,
|
133
|
-
});
|
134
|
-
};
|
135
|
-
const handleDelete = () => {
|
136
|
-
setShowDeleteConfirmation(true);
|
137
|
-
onSelect();
|
138
|
-
};
|
139
|
-
const confirmDelete = () => {
|
140
|
-
onDelete(commentID);
|
141
|
-
setShowDeleteConfirmation(false);
|
142
|
-
};
|
143
|
-
const cancelDelete = () => {
|
144
|
-
setShowDeleteConfirmation(false);
|
145
|
-
};
|
146
|
-
return (react_1.default.createElement(Card, null,
|
147
|
-
react_1.default.createElement(CommentHeader, { "data-cy": "comment-header" },
|
148
|
-
react_1.default.createElement(CommentMetadata, null,
|
149
|
-
react_1.default.createElement(AuthorContainer, null, authorName ? (react_1.default.createElement(react_1.default.Fragment, null,
|
150
|
-
react_1.default.createElement(style_guide_1.AvatarIcon, { width: 20, height: 20 }),
|
151
|
-
react_1.default.createElement(react_1.default.Fragment, null, authorName))) : (!isReply && (react_1.default.createElement(react_1.default.Fragment, null,
|
152
|
-
react_1.default.createElement(style_guide_1.SystemUserAvatarIcon, { width: 20, height: 20 }),
|
153
|
-
react_1.default.createElement(react_1.default.Fragment, null, "System"))))),
|
154
|
-
timestamp && react_1.default.createElement(Timestamp, { date: timestamp * 1000 }),
|
155
|
-
numOfReplies !== 0 && react_1.default.createElement(RepliesCount, null,
|
156
|
-
" ",
|
157
|
-
numOfReplies,
|
158
|
-
" ")),
|
159
|
-
react_1.default.createElement(CommentActions_1.CommentActions, { comment: comment, isResolveEnabled: isResolveEnabled && !isReply, isActionsEnabled: isActionsEnabled && isEndOfThread, onDelete: handleDelete, onEdit: handleEdit, toggleResolve: handleToggleResolve })),
|
160
|
-
comment.node.attrs.originalText && (react_1.default.createElement(CommentTarget, null, comment.node.attrs.originalText)),
|
161
|
-
react_1.default.createElement(CommentBody_1.CommentBody, { comment: comment, isEditing: editingCommentId === commentID, onSave: handleSave, onCancel: handleCancel, onSelect: onSelect }),
|
162
|
-
showDeleteConfirmation && (react_1.default.createElement(DeleteCommentConfirmation_1.DeleteCommentConfirmation, { isReply: isReply, onCancel: cancelDelete, onConfirm: confirmDelete }))));
|
163
|
-
};
|
164
|
-
exports.CommentCard = CommentCard;
|
165
|
-
//# 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,eAAe,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;CAejC,CAAA;AACD,MAAM,aAAa,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;CAO/B,CAAA;AAED,MAAM,SAAS,GAAG,IAAA,2BAAM,EAAC,0BAAY,CAAC,CAAA;;;;;;;CAOrC,CAAA;AACD,MAAM,YAAY,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;;CAQ9B,CAAA;AACD,MAAM,IAAI,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAEtB,CAAA;AAeM,MAAM,WAAW,GAA+B,CAAC,EACtD,OAAO,EACP,OAAO,EACP,YAAY,EACZ,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,IAAA,4BAAc,GAAE,CAAA;IAC5B,MAAM,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,KAAK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CACpD;YAClB,8BAAC,+BAAc,IACb,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,IAAI,CAAC,OAAO,EAC9C,gBAAgB,EAAE,gBAAgB,IAAI,aAAa,EACnD,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,mBAAmB,GAClC,CACY;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAClC,8BAAC,aAAa,QAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAiB,CACjE;QACD,8BAAC,yBAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,gBAAgB,KAAK,SAAS,EACzC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,GAClB;QACD,sBAAsB,IAAI,CACzB,8BAAC,qDAAyB,IACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,GACxB,CACH,CACI,CACR,CAAA;AACH,CAAC,CAAA;AAhIY,QAAA,WAAW,eAgIvB"}
|
@@ -1,74 +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
|
-
svg {
|
27
|
-
padding-left: 14px;
|
28
|
-
}
|
29
|
-
`;
|
30
|
-
const CancelButton = (0, styled_components_1.default)(style_guide_1.SecondaryButton) `
|
31
|
-
padding: 4px ${(props) => props.theme.grid.unit * 3}px;
|
32
|
-
font-size: 14px;
|
33
|
-
`;
|
34
|
-
const DeleteButton = (0, styled_components_1.default)(style_guide_1.PrimaryButton) `
|
35
|
-
padding: 4px ${(props) => props.theme.grid.unit * 3}px;
|
36
|
-
margin-right: 16px;
|
37
|
-
font-size: 14px;
|
38
|
-
`;
|
39
|
-
const Message = styled_components_1.default.div `
|
40
|
-
font-weight: 700;
|
41
|
-
color: #000;
|
42
|
-
font-size: 14px;
|
43
|
-
line-height: 16px;
|
44
|
-
margin: 0 8px;
|
45
|
-
`;
|
46
|
-
const DeleteConfirmation = styled_components_1.default.div `
|
47
|
-
position: absolute;
|
48
|
-
top: -8px;
|
49
|
-
left: ${(props) => (props.isReply ? '-24px' : '-8px')};
|
50
|
-
right: -8px;
|
51
|
-
bottom: -16px;
|
52
|
-
opacity: 0.95;
|
53
|
-
display: flex;
|
54
|
-
align-items: center;
|
55
|
-
justify-content: center;
|
56
|
-
background: #fafafa;
|
57
|
-
z-index: 10;
|
58
|
-
`;
|
59
|
-
const Buttons = (0, styled_components_1.default)(style_guide_1.ButtonGroup) `
|
60
|
-
& button:not(:last-of-type) {
|
61
|
-
margin-right: 4px;
|
62
|
-
}
|
63
|
-
`;
|
64
|
-
const DeleteCommentConfirmation = ({ isReply, onCancel, onConfirm }) => {
|
65
|
-
return (react_1.default.createElement(DeleteConfirmation, { isReply: isReply },
|
66
|
-
react_1.default.createElement(MessageContainer, null,
|
67
|
-
react_1.default.createElement(style_guide_1.AttentionOrangeIcon, null),
|
68
|
-
react_1.default.createElement(Message, null, "Delete this comment?")),
|
69
|
-
react_1.default.createElement(Buttons, null,
|
70
|
-
react_1.default.createElement(CancelButton, { onClick: onCancel }, "Cancel"),
|
71
|
-
react_1.default.createElement(DeleteButton, { onClick: onConfirm }, "Delete"))));
|
72
|
-
};
|
73
|
-
exports.DeleteCommentConfirmation = DeleteCommentConfirmation;
|
74
|
-
//# 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;;;;;;;;CAQlC,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;;;CAGpD,CAAA;AACD,MAAM,OAAO,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;CAMzB,CAAA;AAED,MAAM,kBAAkB,GAAG,2BAAM,CAAC,GAAG,CAAuB;;;UAGlD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;;;;;;;;;CAStD,CAAA;AAED,MAAM,OAAO,GAAG,IAAA,2BAAM,EAAC,yBAAW,CAAC,CAAA;;;;CAIlC,CAAA;AAQM,MAAM,yBAAyB,GAElC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IACvC,OAAO,CACL,8BAAC,kBAAkB,IAAC,OAAO,EAAE,OAAO;QAClC,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,121 +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 reply = () => {
|
50
|
-
if (replyRef.current) {
|
51
|
-
insertCommentReply(commentID, replyRef.current.value);
|
52
|
-
setValue('');
|
53
|
-
replyRef.current.value = '';
|
54
|
-
replyRef.current.style.height = '30px'; // Reset the height
|
55
|
-
}
|
56
|
-
};
|
57
|
-
const handleCancel = () => {
|
58
|
-
setIsTextBoxFocused(false);
|
59
|
-
setValue('');
|
60
|
-
if (replyRef.current) {
|
61
|
-
replyRef.current.value = '';
|
62
|
-
replyRef.current.style.height = '30px'; // Reset the height
|
63
|
-
}
|
64
|
-
};
|
65
|
-
const disableSaveButton = (0, react_1.useMemo)(() => !value.length, [value]);
|
66
|
-
const onTextChange = (e) => {
|
67
|
-
setValue(e.target.value);
|
68
|
-
if (replyRef.current) {
|
69
|
-
replyRef.current.style.height = '30px'; // Reset the height
|
70
|
-
replyRef.current.style.height = `${Math.min(replyRef.current.scrollHeight, 55)}px`; // Set the height based on content
|
71
|
-
}
|
72
|
-
};
|
73
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
74
|
-
react_1.default.createElement(TextBox, { "data-cy": "reply", placeholder: "Reply...", ref: replyRef, onChange: onTextChange, onFocus: handleFocus }),
|
75
|
-
isTextBoxFocused && (react_1.default.createElement(Actions, { "data-cy": "reply-actions" },
|
76
|
-
react_1.default.createElement(style_guide_1.TertiaryButton, { onClick: handleCancel }, "Cancel"),
|
77
|
-
react_1.default.createElement(style_guide_1.PrimaryButton, { onClick: reply, disabled: disableSaveButton }, "Reply")))));
|
78
|
-
};
|
79
|
-
exports.ReplyBox = ReplyBox;
|
80
|
-
const TextBox = styled_components_1.default.textarea `
|
81
|
-
cursor: text;
|
82
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
83
|
-
color: ${(props) => props.theme.colors.text.primary};
|
84
|
-
margin: ${(props) => props.theme.grid.unit * 2}px 0;
|
85
|
-
resize: none;
|
86
|
-
|
87
|
-
width: 100%;
|
88
|
-
|
89
|
-
height: 30px;
|
90
|
-
max-height: 55px;
|
91
|
-
|
92
|
-
outline: 0;
|
93
|
-
border: 1px solid #e2e2e2;
|
94
|
-
border-radius: 6px;
|
95
|
-
|
96
|
-
&:focus {
|
97
|
-
background: #f2fbfc;
|
98
|
-
border: 1px solid #bce7f6;
|
99
|
-
border-radius: 6px;
|
100
|
-
}
|
101
|
-
|
102
|
-
box-sizing: border-box;
|
103
|
-
padding: 3px 16px 3px 16px;
|
104
|
-
font-style: normal;
|
105
|
-
font-weight: 400;
|
106
|
-
font-size: 14px;
|
107
|
-
line-height: 24px;
|
108
|
-
overflow: hidden;
|
109
|
-
`;
|
110
|
-
const Actions = (0, styled_components_1.default)(style_guide_1.ButtonGroup) `
|
111
|
-
& button:not(:last-of-type) {
|
112
|
-
margin-right: 4px;
|
113
|
-
}
|
114
|
-
& ${style_guide_1.TertiaryButton} {
|
115
|
-
&:hover {
|
116
|
-
background-color: inherit !important;
|
117
|
-
border-color: transparent !important;
|
118
|
-
}
|
119
|
-
}
|
120
|
-
`;
|
121
|
-
//# sourceMappingURL=ReplyBox.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ReplyBox.js","sourceRoot":"","sources":["../../../../src/components/comments/ReplyBox.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0DAIiC;AACjC,+CAAqE;AACrE,0EAAsC;AAO/B,MAAM,QAAQ,GAA4B,CAAC,EAChD,kBAAkB,EAClB,SAAS,GACV,EAAE,EAAE;IACH,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAA;IAC/D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAA;IACtC,MAAM,QAAQ,G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,OAAO,CAAC,YAAY,EAC7B,EAAE,CACH,IAAI,CAAA,CAAC,kCAAkC;SACzC;IACH,CAAC,CAAA;IAED,OAAO,CACL;QACE,8BAAC,OAAO,eACE,OAAO,EACf,WAAW,EAAC,UAAU,EACtB,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,WAAW,GACpB;QACD,gBAAgB,IAAI,CACnB,8BAAC,OAAO,eAAS,eAAe;YAC9B,8BAAC,4BAAc,IAAC,OAAO,EAAE,YAAY,aAAyB;YAC9D,8BAAC,2BAAa,IAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,YAE1C,CACR,CACX,CACA,CACJ,CAAA;AACH,CAAC,CAAA;AA3DY,QAAA,QAAQ,YA2DpB;AACD,MAAM,OAAO,GAAG,2BAAM,CAAC,QAAQ,CAAA;;iBAEd,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;WAC7C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;YACzC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAyB/C,CAAA;AAED,MAAM,OAAO,GAAG,IAAA,2BAAM,EAAC,yBAAW,CAAC,CAAA;;;;MAI7B,4BAAc;;;;;;CAMnB,CAAA"}
|
@@ -1,135 +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 AuthorContainer = styled.div `
|
20
|
-
display: flex;
|
21
|
-
color: #353535;
|
22
|
-
font-weight: 400;
|
23
|
-
max-width: 200px;
|
24
|
-
white-space: nowrap;
|
25
|
-
overflow: hidden;
|
26
|
-
flex-grow: 1;
|
27
|
-
text-overflow: ellipsis;
|
28
|
-
margin-right: 8px;
|
29
|
-
|
30
|
-
svg {
|
31
|
-
padding-right: 10px;
|
32
|
-
flex-shrink: 0;
|
33
|
-
}
|
34
|
-
`;
|
35
|
-
const CommentTarget = styled.div `
|
36
|
-
font-size: 14px;
|
37
|
-
color: #353535;
|
38
|
-
background-color: #ffeebf;
|
39
|
-
padding: 4px 8px;
|
40
|
-
margin-top: 16px;
|
41
|
-
margin-bottom: 16px;
|
42
|
-
`;
|
43
|
-
const Timestamp = styled(RelativeDate) `
|
44
|
-
font-size: 12px;
|
45
|
-
line-height: 16px;
|
46
|
-
font-weight: 400;
|
47
|
-
color: #6e6e6e;
|
48
|
-
white-space: nowrap;
|
49
|
-
padding-right: 8px;
|
50
|
-
`;
|
51
|
-
const RepliesCount = styled.div `
|
52
|
-
border-radius: 50%;
|
53
|
-
width: 12px;
|
54
|
-
height: 12px;
|
55
|
-
color: #ffffff;
|
56
|
-
background-color: #1a9bc7;
|
57
|
-
text-align: center;
|
58
|
-
font-size: 9px;
|
59
|
-
`;
|
60
|
-
const Card = styled.div `
|
61
|
-
position: relative;
|
62
|
-
`;
|
63
|
-
export const CommentCard = ({ comment, isReply, numOfReplies, isNew, isEndOfThread, editingCommentId, setEditingCommentId, onSave, onDelete, onSelect, }) => {
|
64
|
-
const can = usePermissions();
|
65
|
-
const [{ user, collaboratorsById }] = useStore((state) => ({
|
66
|
-
user: state.user,
|
67
|
-
collaboratorsById: state.collaboratorsById,
|
68
|
-
}));
|
69
|
-
const authorID = getAuthorID(comment);
|
70
|
-
const authorName = authorID
|
71
|
-
? buildAuthorName(collaboratorsById.get(authorID))
|
72
|
-
: '';
|
73
|
-
const timestamp = comment.node.attrs.contributions?.[0].timestamp;
|
74
|
-
const isOwn = authorID === user._id;
|
75
|
-
const isResolveEnabled = isOwn
|
76
|
-
? can.resolveOwnComment
|
77
|
-
: can.resolveOthersComment;
|
78
|
-
const isActionsEnabled = isOwn
|
79
|
-
? can.handleOwnComments
|
80
|
-
: can.handleOthersComments;
|
81
|
-
const commentID = comment.node.attrs.id;
|
82
|
-
const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false);
|
83
|
-
const handleEdit = () => {
|
84
|
-
setEditingCommentId(commentID);
|
85
|
-
onSelect();
|
86
|
-
};
|
87
|
-
const handleSave = (contents) => {
|
88
|
-
onSave({
|
89
|
-
...comment.node.attrs,
|
90
|
-
contents,
|
91
|
-
});
|
92
|
-
setEditingCommentId(null);
|
93
|
-
};
|
94
|
-
const handleCancel = () => {
|
95
|
-
setEditingCommentId(null);
|
96
|
-
if (isNew) {
|
97
|
-
onDelete(commentID);
|
98
|
-
}
|
99
|
-
};
|
100
|
-
const handleToggleResolve = () => {
|
101
|
-
onSave({
|
102
|
-
...comment.node.attrs,
|
103
|
-
resolved: !comment.node.attrs.resolved,
|
104
|
-
});
|
105
|
-
};
|
106
|
-
const handleDelete = () => {
|
107
|
-
setShowDeleteConfirmation(true);
|
108
|
-
onSelect();
|
109
|
-
};
|
110
|
-
const confirmDelete = () => {
|
111
|
-
onDelete(commentID);
|
112
|
-
setShowDeleteConfirmation(false);
|
113
|
-
};
|
114
|
-
const cancelDelete = () => {
|
115
|
-
setShowDeleteConfirmation(false);
|
116
|
-
};
|
117
|
-
return (React.createElement(Card, null,
|
118
|
-
React.createElement(CommentHeader, { "data-cy": "comment-header" },
|
119
|
-
React.createElement(CommentMetadata, null,
|
120
|
-
React.createElement(AuthorContainer, null, authorName ? (React.createElement(React.Fragment, null,
|
121
|
-
React.createElement(AvatarIcon, { width: 20, height: 20 }),
|
122
|
-
React.createElement(React.Fragment, null, authorName))) : (!isReply && (React.createElement(React.Fragment, null,
|
123
|
-
React.createElement(SystemUserAvatarIcon, { width: 20, height: 20 }),
|
124
|
-
React.createElement(React.Fragment, null, "System"))))),
|
125
|
-
timestamp && React.createElement(Timestamp, { date: timestamp * 1000 }),
|
126
|
-
numOfReplies !== 0 && React.createElement(RepliesCount, null,
|
127
|
-
" ",
|
128
|
-
numOfReplies,
|
129
|
-
" ")),
|
130
|
-
React.createElement(CommentActions, { comment: comment, isResolveEnabled: isResolveEnabled && !isReply, isActionsEnabled: isActionsEnabled && isEndOfThread, onDelete: handleDelete, onEdit: handleEdit, toggleResolve: handleToggleResolve })),
|
131
|
-
comment.node.attrs.originalText && (React.createElement(CommentTarget, null, comment.node.attrs.originalText)),
|
132
|
-
React.createElement(CommentBody, { comment: comment, isEditing: editingCommentId === commentID, onSave: handleSave, onCancel: handleCancel, onSelect: onSelect }),
|
133
|
-
showDeleteConfirmation && (React.createElement(DeleteCommentConfirmation, { isReply: isReply, onCancel: cancelDelete, onConfirm: confirmDelete }))));
|
134
|
-
};
|
135
|
-
//# 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,oBAA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K,CAAC,YAAY,IAAI,CAClC,oBAAC,aAAa,QAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAiB,CACjE;QACD,oBAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,gBAAgB,KAAK,SAAS,EACzC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,GAClB;QACD,sBAAsB,IAAI,CACzB,oBAAC,yBAAyB,IACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,GACxB,CACH,CACI,CACR,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,67 +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
|
-
svg {
|
21
|
-
padding-left: 14px;
|
22
|
-
}
|
23
|
-
`;
|
24
|
-
const CancelButton = styled(SecondaryButton) `
|
25
|
-
padding: 4px ${(props) => props.theme.grid.unit * 3}px;
|
26
|
-
font-size: 14px;
|
27
|
-
`;
|
28
|
-
const DeleteButton = styled(PrimaryButton) `
|
29
|
-
padding: 4px ${(props) => props.theme.grid.unit * 3}px;
|
30
|
-
margin-right: 16px;
|
31
|
-
font-size: 14px;
|
32
|
-
`;
|
33
|
-
const Message = styled.div `
|
34
|
-
font-weight: 700;
|
35
|
-
color: #000;
|
36
|
-
font-size: 14px;
|
37
|
-
line-height: 16px;
|
38
|
-
margin: 0 8px;
|
39
|
-
`;
|
40
|
-
const DeleteConfirmation = styled.div `
|
41
|
-
position: absolute;
|
42
|
-
top: -8px;
|
43
|
-
left: ${(props) => (props.isReply ? '-24px' : '-8px')};
|
44
|
-
right: -8px;
|
45
|
-
bottom: -16px;
|
46
|
-
opacity: 0.95;
|
47
|
-
display: flex;
|
48
|
-
align-items: center;
|
49
|
-
justify-content: center;
|
50
|
-
background: #fafafa;
|
51
|
-
z-index: 10;
|
52
|
-
`;
|
53
|
-
const Buttons = styled(ButtonGroup) `
|
54
|
-
& button:not(:last-of-type) {
|
55
|
-
margin-right: 4px;
|
56
|
-
}
|
57
|
-
`;
|
58
|
-
export const DeleteCommentConfirmation = ({ isReply, onCancel, onConfirm }) => {
|
59
|
-
return (React.createElement(DeleteConfirmation, { isReply: isReply },
|
60
|
-
React.createElement(MessageContainer, null,
|
61
|
-
React.createElement(AttentionOrangeIcon, null),
|
62
|
-
React.createElement(Message, null, "Delete this comment?")),
|
63
|
-
React.createElement(Buttons, null,
|
64
|
-
React.createElement(CancelButton, { onClick: onCancel }, "Cancel"),
|
65
|
-
React.createElement(DeleteButton, { onClick: onConfirm }, "Delete"))));
|
66
|
-
};
|
67
|
-
//# 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;;;;;;;;CAQlC,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;;;CAGpD,CAAA;AACD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMzB,CAAA;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAuB;;;UAGlD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;;;;;;;;;CAStD,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;CAIlC,CAAA;AAQD,MAAM,CAAC,MAAM,yBAAyB,GAElC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IACvC,OAAO,CACL,oBAAC,kBAAkB,IAAC,OAAO,EAAE,OAAO;QAClC,oBAAC,gBAAgB;YACf,oBAAC,mBAAmB,OAAG;YACvB,oBAAC,OAAO,+BAA+B,CACtB;QACnB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