elseware-ui 2.31.13 → 2.31.14

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.js CHANGED
@@ -18062,6 +18062,10 @@ function CommentThread({
18062
18062
  );
18063
18063
  }
18064
18064
  }
18065
+ function updateCommentEverywhere(commentId, updater) {
18066
+ setComments((prev) => updateComment(prev, commentId, updater));
18067
+ setReplyCache((prev) => updateReplyCacheComment(prev, commentId, updater));
18068
+ }
18065
18069
  async function handleReply(parentComment, content) {
18066
18070
  const reply = await dataSource.createComment({
18067
18071
  content,
@@ -18147,6 +18151,10 @@ function CommentThread({
18147
18151
  );
18148
18152
  }
18149
18153
  }
18154
+ function handleEditComment(updatedComment) {
18155
+ updateCommentEverywhere(updatedComment.id, () => updatedComment);
18156
+ onEdit?.(updatedComment);
18157
+ }
18150
18158
  if (loading || isLoadingComments) {
18151
18159
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-6", children: "Loading comments..." });
18152
18160
  }
@@ -18171,7 +18179,7 @@ function CommentThread({
18171
18179
  onDislike: handleDislike,
18172
18180
  onReply: handleReply,
18173
18181
  onLoadReplies: handleLoadReplies,
18174
- onEdit,
18182
+ onEdit: handleEditComment,
18175
18183
  onDelete: handleDeleteComment,
18176
18184
  onReport
18177
18185
  }