@wordpress/editor 14.33.4 → 14.33.5
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/build/components/collab-sidebar/add-comment.js +1 -1
- package/build/components/collab-sidebar/add-comment.js.map +1 -1
- package/build/components/collab-sidebar/comment-menu-item.js +36 -6
- package/build/components/collab-sidebar/comment-menu-item.js.map +3 -3
- package/build/components/collab-sidebar/comments.js +287 -296
- package/build/components/collab-sidebar/comments.js.map +3 -3
- package/build/components/collab-sidebar/index.js +23 -10
- package/build/components/collab-sidebar/index.js.map +3 -3
- package/build/components/collab-sidebar/utils.js +6 -3
- package/build/components/collab-sidebar/utils.js.map +2 -2
- package/build/components/editor/index.js +2 -2
- package/build/components/editor/index.js.map +3 -3
- package/build-module/components/collab-sidebar/add-comment.js +1 -1
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-menu-item.js +40 -7
- package/build-module/components/collab-sidebar/comment-menu-item.js.map +2 -2
- package/build-module/components/collab-sidebar/comments.js +287 -296
- package/build-module/components/collab-sidebar/comments.js.map +2 -2
- package/build-module/components/collab-sidebar/index.js +23 -10
- package/build-module/components/collab-sidebar/index.js.map +2 -2
- package/build-module/components/collab-sidebar/utils.js +6 -3
- package/build-module/components/collab-sidebar/utils.js.map +2 -2
- package/build-module/components/editor/index.js +2 -2
- package/build-module/components/editor/index.js.map +2 -2
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts +3 -2
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/utils.d.ts +2 -2
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/components/collab-sidebar/add-comment.js +1 -1
- package/src/components/collab-sidebar/comment-menu-item.js +51 -11
- package/src/components/collab-sidebar/comments.js +8 -19
- package/src/components/collab-sidebar/index.js +51 -33
- package/src/components/collab-sidebar/utils.js +15 -5
- package/src/components/editor/index.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -215,19 +215,7 @@ function Comments({
|
|
|
215
215
|
]);
|
|
216
216
|
const hasThreads = Array.isArray(threads) && threads.length > 0;
|
|
217
217
|
if (!hasThreads && !isFloating) {
|
|
218
|
-
return
|
|
219
|
-
/* @__PURE__ */ jsx(
|
|
220
|
-
AddComment,
|
|
221
|
-
{
|
|
222
|
-
onSubmit: onAddReply,
|
|
223
|
-
showCommentBoard,
|
|
224
|
-
setShowCommentBoard,
|
|
225
|
-
commentSidebarRef
|
|
226
|
-
}
|
|
227
|
-
),
|
|
228
|
-
/* @__PURE__ */ jsx(Text, { as: "p", children: __("No notes available.") }),
|
|
229
|
-
/* @__PURE__ */ jsx(Text, { as: "p", variant: "muted", children: __("Only logged in users can see Notes.") })
|
|
230
|
-
] });
|
|
218
|
+
return null;
|
|
231
219
|
}
|
|
232
220
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
233
221
|
!isFloating && showCommentBoard && void 0 === blockCommentId && /* @__PURE__ */ jsx(
|
|
@@ -347,185 +335,181 @@ function Thread({
|
|
|
347
335
|
}
|
|
348
336
|
);
|
|
349
337
|
}
|
|
350
|
-
return (
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
if (event.key === "Enter" && event.currentTarget === event.target) {
|
|
372
|
-
if (isSelected) {
|
|
373
|
-
unselectThread();
|
|
374
|
-
} else {
|
|
375
|
-
handleCommentSelect();
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
if (event.key === "Escape") {
|
|
338
|
+
return /* @__PURE__ */ jsxs(
|
|
339
|
+
VStack,
|
|
340
|
+
{
|
|
341
|
+
className: clsx("editor-collab-sidebar-panel__thread", {
|
|
342
|
+
"is-selected": isSelected,
|
|
343
|
+
"is-floating": isFloating
|
|
344
|
+
}),
|
|
345
|
+
id: `comment-thread-${thread.id}`,
|
|
346
|
+
spacing: "3",
|
|
347
|
+
onClick: handleCommentSelect,
|
|
348
|
+
onMouseEnter,
|
|
349
|
+
onMouseLeave,
|
|
350
|
+
onFocus: onMouseEnter,
|
|
351
|
+
onBlur: onMouseLeave,
|
|
352
|
+
onKeyDown: (event) => {
|
|
353
|
+
if (event.defaultPrevented) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
if (event.key === "Enter" && event.currentTarget === event.target) {
|
|
357
|
+
if (isSelected) {
|
|
379
358
|
unselectThread();
|
|
380
|
-
|
|
359
|
+
} else {
|
|
360
|
+
handleCommentSelect();
|
|
381
361
|
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
362
|
+
}
|
|
363
|
+
if (event.key === "Escape") {
|
|
364
|
+
unselectThread();
|
|
365
|
+
focusCommentThread(thread.id, commentSidebarRef.current);
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
tabIndex: 0,
|
|
369
|
+
role: "treeitem",
|
|
370
|
+
"aria-label": ariaLabel,
|
|
371
|
+
"aria-expanded": isSelected,
|
|
372
|
+
ref: isFloating ? refs.setFloating : void 0,
|
|
373
|
+
style: isFloating ? { top: y } : void 0,
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ jsx(
|
|
376
|
+
Button,
|
|
377
|
+
{
|
|
378
|
+
className: "editor-collab-sidebar-panel__skip-to-comment",
|
|
379
|
+
variant: "secondary",
|
|
380
|
+
size: "compact",
|
|
381
|
+
onClick: () => {
|
|
382
|
+
focusCommentThread(
|
|
383
|
+
thread.id,
|
|
384
|
+
commentSidebarRef.current,
|
|
385
|
+
"textarea"
|
|
386
|
+
);
|
|
387
|
+
},
|
|
388
|
+
children: __("Add new note")
|
|
389
|
+
}
|
|
390
|
+
),
|
|
391
|
+
!thread.blockClientId && /* @__PURE__ */ jsx(Text, { as: "p", weight: 500, variant: "muted", children: __("Original block deleted.") }),
|
|
392
|
+
/* @__PURE__ */ jsx(
|
|
393
|
+
CommentBoard,
|
|
394
|
+
{
|
|
395
|
+
thread,
|
|
396
|
+
isExpanded: isSelected,
|
|
397
|
+
onEdit: (params = {}) => {
|
|
398
|
+
const { status } = params;
|
|
399
|
+
onEditComment(params);
|
|
400
|
+
if (status === "approved") {
|
|
401
|
+
unselectThread();
|
|
397
402
|
focusCommentThread(
|
|
398
403
|
thread.id,
|
|
399
|
-
commentSidebarRef.current
|
|
400
|
-
"textarea"
|
|
404
|
+
commentSidebarRef.current
|
|
401
405
|
);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
onDelete: onCommentDelete,
|
|
409
|
+
reflowComments
|
|
410
|
+
}
|
|
411
|
+
),
|
|
412
|
+
isSelected && allReplies.map((reply) => /* @__PURE__ */ jsx(
|
|
413
|
+
CommentBoard,
|
|
414
|
+
{
|
|
415
|
+
thread: reply,
|
|
416
|
+
parent: thread,
|
|
417
|
+
isExpanded: isSelected,
|
|
418
|
+
onEdit: onEditComment,
|
|
419
|
+
onDelete: onCommentDelete,
|
|
420
|
+
reflowComments
|
|
421
|
+
},
|
|
422
|
+
reply.id
|
|
423
|
+
)),
|
|
424
|
+
!isSelected && restReplies.length > 0 && /* @__PURE__ */ jsx(HStack, { className: "editor-collab-sidebar-panel__more-reply-separator", children: /* @__PURE__ */ jsx(
|
|
425
|
+
Button,
|
|
426
|
+
{
|
|
427
|
+
size: "compact",
|
|
428
|
+
variant: "tertiary",
|
|
429
|
+
className: "editor-collab-sidebar-panel__more-reply-button",
|
|
430
|
+
onClick: () => {
|
|
431
|
+
setSelectedThread(thread.id);
|
|
432
|
+
focusCommentThread(
|
|
433
|
+
thread.id,
|
|
434
|
+
commentSidebarRef.current
|
|
435
|
+
);
|
|
436
|
+
},
|
|
437
|
+
children: sprintf(
|
|
438
|
+
// translators: %s: number of replies.
|
|
439
|
+
_n(
|
|
440
|
+
"%s more reply",
|
|
441
|
+
"%s more replies",
|
|
442
|
+
restReplies.length
|
|
443
|
+
),
|
|
444
|
+
restReplies.length
|
|
445
|
+
)
|
|
446
|
+
}
|
|
447
|
+
) }),
|
|
448
|
+
!isSelected && lastReply && /* @__PURE__ */ jsx(
|
|
449
|
+
CommentBoard,
|
|
450
|
+
{
|
|
451
|
+
thread: lastReply,
|
|
452
|
+
parent: thread,
|
|
453
|
+
isExpanded: isSelected,
|
|
454
|
+
onEdit: onEditComment,
|
|
455
|
+
onDelete: onCommentDelete,
|
|
456
|
+
reflowComments
|
|
457
|
+
}
|
|
458
|
+
),
|
|
459
|
+
isSelected && /* @__PURE__ */ jsxs(VStack, { spacing: "2", role: "treeitem", children: [
|
|
460
|
+
/* @__PURE__ */ jsx(HStack, { alignment: "left", spacing: "3", justify: "flex-start", children: /* @__PURE__ */ jsx(CommentAuthorInfo, {}) }),
|
|
461
|
+
/* @__PURE__ */ jsx(VStack, { spacing: "2", children: /* @__PURE__ */ jsx(
|
|
462
|
+
CommentForm,
|
|
409
463
|
{
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
464
|
+
onSubmit: (inputComment) => {
|
|
465
|
+
if ("approved" === thread.status) {
|
|
466
|
+
onEditComment({
|
|
467
|
+
id: thread.id,
|
|
468
|
+
status: "hold",
|
|
469
|
+
content: inputComment
|
|
470
|
+
});
|
|
471
|
+
} else {
|
|
472
|
+
onAddReply({
|
|
473
|
+
content: inputComment,
|
|
474
|
+
parent: thread.id
|
|
475
|
+
});
|
|
421
476
|
}
|
|
422
477
|
},
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
),
|
|
427
|
-
isSelected && allReplies.map((reply) => /* @__PURE__ */ jsx(
|
|
428
|
-
CommentBoard,
|
|
429
|
-
{
|
|
430
|
-
thread: reply,
|
|
431
|
-
parent: thread,
|
|
432
|
-
isExpanded: isSelected,
|
|
433
|
-
onEdit: onEditComment,
|
|
434
|
-
onDelete: onCommentDelete,
|
|
435
|
-
reflowComments
|
|
436
|
-
},
|
|
437
|
-
reply.id
|
|
438
|
-
)),
|
|
439
|
-
!isSelected && restReplies.length > 0 && /* @__PURE__ */ jsx(HStack, { className: "editor-collab-sidebar-panel__more-reply-separator", children: /* @__PURE__ */ jsx(
|
|
440
|
-
Button,
|
|
441
|
-
{
|
|
442
|
-
size: "compact",
|
|
443
|
-
variant: "tertiary",
|
|
444
|
-
className: "editor-collab-sidebar-panel__more-reply-button",
|
|
445
|
-
onClick: () => {
|
|
446
|
-
setSelectedThread(thread.id);
|
|
478
|
+
onCancel: (event) => {
|
|
479
|
+
event.stopPropagation();
|
|
480
|
+
unselectThread();
|
|
447
481
|
focusCommentThread(
|
|
448
482
|
thread.id,
|
|
449
483
|
commentSidebarRef.current
|
|
450
484
|
);
|
|
451
485
|
},
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
)
|
|
461
|
-
}
|
|
462
|
-
) }),
|
|
463
|
-
!isSelected && lastReply && /* @__PURE__ */ jsx(
|
|
464
|
-
CommentBoard,
|
|
465
|
-
{
|
|
466
|
-
thread: lastReply,
|
|
467
|
-
parent: thread,
|
|
468
|
-
isExpanded: isSelected,
|
|
469
|
-
onEdit: onEditComment,
|
|
470
|
-
onDelete: onCommentDelete,
|
|
486
|
+
submitButtonText: "approved" === thread.status ? __("Reopen & Reply") : __("Reply"),
|
|
487
|
+
rows: "approved" === thread.status ? 2 : 4,
|
|
488
|
+
labelText: sprintf(
|
|
489
|
+
// translators: %1$s: note identifier, %2$s: author name
|
|
490
|
+
__("Reply to note %1$s by %2$s"),
|
|
491
|
+
thread.id,
|
|
492
|
+
thread.author_name
|
|
493
|
+
),
|
|
471
494
|
reflowComments
|
|
472
495
|
}
|
|
473
|
-
)
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
},
|
|
493
|
-
onCancel: (event) => {
|
|
494
|
-
event.stopPropagation();
|
|
495
|
-
unselectThread();
|
|
496
|
-
focusCommentThread(
|
|
497
|
-
thread.id,
|
|
498
|
-
commentSidebarRef.current
|
|
499
|
-
);
|
|
500
|
-
},
|
|
501
|
-
submitButtonText: "approved" === thread.status ? __("Reopen & Reply") : __("Reply"),
|
|
502
|
-
rows: "approved" === thread.status ? 2 : 4,
|
|
503
|
-
labelText: sprintf(
|
|
504
|
-
// translators: %1$s: note identifier, %2$s: author name
|
|
505
|
-
__("Reply to note %1$s by %2$s"),
|
|
506
|
-
thread.id,
|
|
507
|
-
thread.author_name
|
|
508
|
-
),
|
|
509
|
-
reflowComments
|
|
510
|
-
}
|
|
511
|
-
) })
|
|
512
|
-
] }),
|
|
513
|
-
!!thread.blockClientId && /* @__PURE__ */ jsx(
|
|
514
|
-
Button,
|
|
515
|
-
{
|
|
516
|
-
className: "editor-collab-sidebar-panel__skip-to-block",
|
|
517
|
-
variant: "secondary",
|
|
518
|
-
size: "compact",
|
|
519
|
-
onClick: (event) => {
|
|
520
|
-
event.stopPropagation();
|
|
521
|
-
relatedBlockElement?.focus();
|
|
522
|
-
},
|
|
523
|
-
children: __("Back to block")
|
|
524
|
-
}
|
|
525
|
-
)
|
|
526
|
-
]
|
|
527
|
-
}
|
|
528
|
-
)
|
|
496
|
+
) })
|
|
497
|
+
] }),
|
|
498
|
+
!!thread.blockClientId && /* @__PURE__ */ jsx(
|
|
499
|
+
Button,
|
|
500
|
+
{
|
|
501
|
+
className: "editor-collab-sidebar-panel__skip-to-block",
|
|
502
|
+
variant: "secondary",
|
|
503
|
+
size: "compact",
|
|
504
|
+
onClick: (event) => {
|
|
505
|
+
event.stopPropagation();
|
|
506
|
+
relatedBlockElement?.focus();
|
|
507
|
+
},
|
|
508
|
+
children: __("Back to block")
|
|
509
|
+
}
|
|
510
|
+
)
|
|
511
|
+
]
|
|
512
|
+
}
|
|
529
513
|
);
|
|
530
514
|
}
|
|
531
515
|
const CommentBoard = ({
|
|
@@ -579,133 +563,140 @@ const CommentBoard = ({
|
|
|
579
563
|
];
|
|
580
564
|
const canResolve = thread.parent === 0;
|
|
581
565
|
const moreActions = parent?.status !== "approved" ? actions.filter((item) => item.isEligible(thread)) : [];
|
|
582
|
-
return /* @__PURE__ */ jsxs(
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
566
|
+
return /* @__PURE__ */ jsxs(
|
|
567
|
+
VStack,
|
|
568
|
+
{
|
|
569
|
+
spacing: "2",
|
|
570
|
+
role: thread.parent !== 0 ? "treeitem" : void 0,
|
|
571
|
+
children: [
|
|
572
|
+
/* @__PURE__ */ jsxs(HStack, { alignment: "left", spacing: "3", justify: "flex-start", children: [
|
|
573
|
+
/* @__PURE__ */ jsx(
|
|
574
|
+
CommentAuthorInfo,
|
|
575
|
+
{
|
|
576
|
+
avatar: thread?.author_avatar_urls?.[48],
|
|
577
|
+
name: thread?.author_name,
|
|
578
|
+
date: thread?.date,
|
|
579
|
+
userId: thread?.author
|
|
580
|
+
}
|
|
581
|
+
),
|
|
582
|
+
isExpanded && /* @__PURE__ */ jsx(
|
|
583
|
+
FlexItem,
|
|
584
|
+
{
|
|
585
|
+
className: "editor-collab-sidebar-panel__comment-status",
|
|
586
|
+
onClick: (event) => {
|
|
587
|
+
event.stopPropagation();
|
|
588
|
+
},
|
|
589
|
+
children: /* @__PURE__ */ jsxs(HStack, { spacing: "0", children: [
|
|
590
|
+
canResolve && /* @__PURE__ */ jsx(
|
|
591
|
+
Button,
|
|
592
|
+
{
|
|
593
|
+
label: _x(
|
|
594
|
+
"Resolve",
|
|
595
|
+
"Mark note as resolved"
|
|
596
|
+
),
|
|
597
|
+
size: "small",
|
|
598
|
+
icon: published,
|
|
599
|
+
disabled: thread.status === "approved",
|
|
600
|
+
accessibleWhenDisabled: thread.status === "approved",
|
|
601
|
+
onClick: () => {
|
|
602
|
+
onEdit({
|
|
603
|
+
id: thread.id,
|
|
604
|
+
status: "approved"
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
}
|
|
607
608
|
),
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
accessibleWhenDisabled: thread.status === "approved",
|
|
612
|
-
onClick: () => {
|
|
613
|
-
onEdit({
|
|
614
|
-
id: thread.id,
|
|
615
|
-
status: "approved"
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
),
|
|
620
|
-
/* @__PURE__ */ jsxs(Menu, { placement: "bottom-end", children: [
|
|
621
|
-
/* @__PURE__ */ jsx(
|
|
622
|
-
Menu.TriggerButton,
|
|
623
|
-
{
|
|
624
|
-
render: /* @__PURE__ */ jsx(
|
|
625
|
-
Button,
|
|
609
|
+
/* @__PURE__ */ jsxs(Menu, { placement: "bottom-end", children: [
|
|
610
|
+
/* @__PURE__ */ jsx(
|
|
611
|
+
Menu.TriggerButton,
|
|
626
612
|
{
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
613
|
+
render: /* @__PURE__ */ jsx(
|
|
614
|
+
Button,
|
|
615
|
+
{
|
|
616
|
+
ref: actionButtonRef,
|
|
617
|
+
size: "small",
|
|
618
|
+
icon: moreVertical,
|
|
619
|
+
label: __("Actions"),
|
|
620
|
+
disabled: !moreActions.length,
|
|
621
|
+
accessibleWhenDisabled: true
|
|
622
|
+
}
|
|
623
|
+
)
|
|
633
624
|
}
|
|
634
|
-
)
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
"edit" === actionState ? /* @__PURE__ */ jsx(
|
|
651
|
-
CommentForm,
|
|
652
|
-
{
|
|
653
|
-
onSubmit: (value) => {
|
|
654
|
-
onEdit({
|
|
655
|
-
id: thread.id,
|
|
656
|
-
content: value
|
|
657
|
-
});
|
|
658
|
-
setActionState(false);
|
|
659
|
-
actionButtonRef.current?.focus();
|
|
660
|
-
},
|
|
661
|
-
onCancel: () => handleCancel(),
|
|
662
|
-
thread,
|
|
663
|
-
submitButtonText: _x("Update", "verb"),
|
|
664
|
-
labelText: sprintf(
|
|
665
|
-
// translators: %1$s: note identifier, %2$s: author name.
|
|
666
|
-
__("Edit note %1$s by %2$s"),
|
|
667
|
-
thread.id,
|
|
668
|
-
thread.author_name
|
|
669
|
-
),
|
|
670
|
-
reflowComments
|
|
671
|
-
}
|
|
672
|
-
) : /* @__PURE__ */ jsx(
|
|
673
|
-
RawHTML,
|
|
674
|
-
{
|
|
675
|
-
className: clsx(
|
|
676
|
-
"editor-collab-sidebar-panel__user-comment",
|
|
625
|
+
),
|
|
626
|
+
/* @__PURE__ */ jsx(Menu.Popover, { children: moreActions.map((action) => /* @__PURE__ */ jsx(
|
|
627
|
+
Menu.Item,
|
|
628
|
+
{
|
|
629
|
+
onClick: () => action.onClick(),
|
|
630
|
+
children: /* @__PURE__ */ jsx(Menu.ItemLabel, { children: action.title })
|
|
631
|
+
},
|
|
632
|
+
action.id
|
|
633
|
+
)) })
|
|
634
|
+
] })
|
|
635
|
+
] })
|
|
636
|
+
}
|
|
637
|
+
)
|
|
638
|
+
] }),
|
|
639
|
+
"edit" === actionState ? /* @__PURE__ */ jsx(
|
|
640
|
+
CommentForm,
|
|
677
641
|
{
|
|
678
|
-
|
|
642
|
+
onSubmit: (value) => {
|
|
643
|
+
onEdit({
|
|
644
|
+
id: thread.id,
|
|
645
|
+
content: value
|
|
646
|
+
});
|
|
647
|
+
setActionState(false);
|
|
648
|
+
actionButtonRef.current?.focus();
|
|
649
|
+
},
|
|
650
|
+
onCancel: () => handleCancel(),
|
|
651
|
+
thread,
|
|
652
|
+
submitButtonText: _x("Update", "verb"),
|
|
653
|
+
labelText: sprintf(
|
|
654
|
+
// translators: %1$s: note identifier, %2$s: author name.
|
|
655
|
+
__("Edit note %1$s by %2$s"),
|
|
656
|
+
thread.id,
|
|
657
|
+
thread.author_name
|
|
658
|
+
),
|
|
659
|
+
reflowComments
|
|
660
|
+
}
|
|
661
|
+
) : /* @__PURE__ */ jsx(
|
|
662
|
+
RawHTML,
|
|
663
|
+
{
|
|
664
|
+
className: clsx(
|
|
665
|
+
"editor-collab-sidebar-panel__user-comment",
|
|
666
|
+
{
|
|
667
|
+
"editor-collab-sidebar-panel__resolution-text": isResolutionComment
|
|
668
|
+
}
|
|
669
|
+
),
|
|
670
|
+
children: isResolutionComment ? (() => {
|
|
671
|
+
const actionText = thread.meta._wp_note_status === "resolved" ? __("Marked as resolved") : __("Reopened");
|
|
672
|
+
const content = thread?.content?.raw;
|
|
673
|
+
if (content && typeof content === "string" && content.trim() !== "") {
|
|
674
|
+
return sprintf(
|
|
675
|
+
// translators: %1$s: action label ("Marked as resolved" or "Reopened"); %2$s: note text.
|
|
676
|
+
__("%1$s: %2$s"),
|
|
677
|
+
actionText,
|
|
678
|
+
content
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
return actionText;
|
|
682
|
+
})() : thread?.content?.rendered
|
|
679
683
|
}
|
|
680
684
|
),
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
)
|
|
685
|
+
"delete" === actionState && /* @__PURE__ */ jsx(
|
|
686
|
+
ConfirmDialog,
|
|
687
|
+
{
|
|
688
|
+
isOpen: showConfirmDialog,
|
|
689
|
+
onConfirm: handleConfirmDelete,
|
|
690
|
+
onCancel: handleCancel,
|
|
691
|
+
confirmButtonText: __("Delete"),
|
|
692
|
+
children: __(
|
|
693
|
+
"Are you sure you want to delete this note? This will also delete all of this note's replies."
|
|
694
|
+
)
|
|
691
695
|
}
|
|
692
|
-
return actionText;
|
|
693
|
-
})() : thread?.content?.rendered
|
|
694
|
-
}
|
|
695
|
-
),
|
|
696
|
-
"delete" === actionState && /* @__PURE__ */ jsx(
|
|
697
|
-
ConfirmDialog,
|
|
698
|
-
{
|
|
699
|
-
isOpen: showConfirmDialog,
|
|
700
|
-
onConfirm: handleConfirmDelete,
|
|
701
|
-
onCancel: handleCancel,
|
|
702
|
-
confirmButtonText: __("Delete"),
|
|
703
|
-
children: __(
|
|
704
|
-
"Are you sure you want to delete this note? This will also delete all of this note's replies."
|
|
705
696
|
)
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
697
|
+
]
|
|
698
|
+
}
|
|
699
|
+
);
|
|
709
700
|
};
|
|
710
701
|
var comments_default = Comments;
|
|
711
702
|
export {
|