elseware-ui 2.31.15 → 2.31.16
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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1533,6 +1533,7 @@ interface CommentThreadProps {
|
|
|
1533
1533
|
loading?: boolean;
|
|
1534
1534
|
components?: CommentComponents;
|
|
1535
1535
|
config?: CommentThreadConfig;
|
|
1536
|
+
updatedComment?: CommentEntity | null;
|
|
1536
1537
|
onEdit?: (comment: CommentEntity) => CommentEntity | void | Promise<CommentEntity | void>;
|
|
1537
1538
|
onDelete?: (comment: CommentEntity) => void;
|
|
1538
1539
|
onReport?: (comment: CommentEntity) => void;
|
|
@@ -1575,7 +1576,7 @@ interface CommentComponents {
|
|
|
1575
1576
|
RepliesToggle?: ComponentType<CommentRepliesToggleProps>;
|
|
1576
1577
|
}
|
|
1577
1578
|
|
|
1578
|
-
declare function CommentThread({ currentUser, dataSource, loading, components, config, onEdit, onDelete, onReport, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
|
|
1579
|
+
declare function CommentThread({ currentUser, dataSource, loading, components, config, updatedComment, onEdit, onDelete, onReport, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
|
|
1579
1580
|
|
|
1580
1581
|
declare function formatCommentDate(date: string, format?: "relative" | "absolute"): string;
|
|
1581
1582
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1533,6 +1533,7 @@ interface CommentThreadProps {
|
|
|
1533
1533
|
loading?: boolean;
|
|
1534
1534
|
components?: CommentComponents;
|
|
1535
1535
|
config?: CommentThreadConfig;
|
|
1536
|
+
updatedComment?: CommentEntity | null;
|
|
1536
1537
|
onEdit?: (comment: CommentEntity) => CommentEntity | void | Promise<CommentEntity | void>;
|
|
1537
1538
|
onDelete?: (comment: CommentEntity) => void;
|
|
1538
1539
|
onReport?: (comment: CommentEntity) => void;
|
|
@@ -1575,7 +1576,7 @@ interface CommentComponents {
|
|
|
1575
1576
|
RepliesToggle?: ComponentType<CommentRepliesToggleProps>;
|
|
1576
1577
|
}
|
|
1577
1578
|
|
|
1578
|
-
declare function CommentThread({ currentUser, dataSource, loading, components, config, onEdit, onDelete, onReport, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
|
|
1579
|
+
declare function CommentThread({ currentUser, dataSource, loading, components, config, updatedComment, onEdit, onDelete, onReport, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
|
|
1579
1580
|
|
|
1580
1581
|
declare function formatCommentDate(date: string, format?: "relative" | "absolute"): string;
|
|
1581
1582
|
|
package/dist/index.js
CHANGED
|
@@ -17985,6 +17985,7 @@ function CommentThread({
|
|
|
17985
17985
|
loading = false,
|
|
17986
17986
|
components,
|
|
17987
17987
|
config,
|
|
17988
|
+
updatedComment,
|
|
17988
17989
|
onEdit,
|
|
17989
17990
|
onDelete,
|
|
17990
17991
|
onReport
|
|
@@ -18106,6 +18107,12 @@ function CommentThread({
|
|
|
18106
18107
|
setComments((prev) => updateComment(prev, commentId, updater));
|
|
18107
18108
|
setReplyCache((prev) => updateReplyCacheComment(prev, commentId, updater));
|
|
18108
18109
|
}
|
|
18110
|
+
React4.useEffect(() => {
|
|
18111
|
+
if (!updatedComment) {
|
|
18112
|
+
return;
|
|
18113
|
+
}
|
|
18114
|
+
updateCommentEverywhere(updatedComment.id, () => updatedComment);
|
|
18115
|
+
}, [updatedComment]);
|
|
18109
18116
|
async function handleReply(parentComment, content) {
|
|
18110
18117
|
const reply = await dataSource.createComment({
|
|
18111
18118
|
content,
|
|
@@ -18192,9 +18199,9 @@ function CommentThread({
|
|
|
18192
18199
|
}
|
|
18193
18200
|
}
|
|
18194
18201
|
async function handleEditComment(comment) {
|
|
18195
|
-
const
|
|
18196
|
-
if (
|
|
18197
|
-
updateCommentEverywhere(
|
|
18202
|
+
const updatedComment2 = await onEdit?.(comment);
|
|
18203
|
+
if (updatedComment2) {
|
|
18204
|
+
updateCommentEverywhere(updatedComment2.id, () => updatedComment2);
|
|
18198
18205
|
}
|
|
18199
18206
|
}
|
|
18200
18207
|
if (loading || isLoadingComments) {
|