sanity 6.14.0 → 6.14.1

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 (163) hide show
  1. package/lib/{AddonDatasetProvider-0aiLWkZg.js → AddonDatasetProvider-C9tdum2G.js} +2 -2
  2. package/lib/{AddonDatasetProvider-0aiLWkZg.js.map → AddonDatasetProvider-C9tdum2G.js.map} +1 -1
  3. package/lib/{CalendarFilter-DVz369RP.js → CalendarFilter-C80uOkw-.js} +3 -3
  4. package/lib/{CalendarFilter-DVz369RP.js.map → CalendarFilter-C80uOkw-.js.map} +1 -1
  5. package/lib/{CommandList-CTDV_QZY.js → CommandList-duj-LVnd.js} +2 -2
  6. package/lib/{CommandList-CTDV_QZY.js.map → CommandList-duj-LVnd.js.map} +1 -1
  7. package/lib/{CommentInput-B5T1Iwnt.js → CommentInput-BXYQnGhq.js} +5 -5
  8. package/lib/{CommentInput-B5T1Iwnt.js.map → CommentInput-BXYQnGhq.js.map} +1 -1
  9. package/lib/{CommentsDocumentLayout-ByFwej_y.js → CommentsDocumentLayout-DAwAhx7q.js} +2 -2
  10. package/lib/{CommentsDocumentLayout-ByFwej_y.js.map → CommentsDocumentLayout-DAwAhx7q.js.map} +1 -1
  11. package/lib/{CommentsDocumentLayout-Czb6fC0_.js → CommentsDocumentLayout-pfM29WSy.js} +2 -2
  12. package/lib/{CommentsDocumentLayout-Czb6fC0_.js.map → CommentsDocumentLayout-pfM29WSy.js.map} +1 -1
  13. package/lib/{CommentsEnabledProvider-D2gutvsb.js → CommentsEnabledProvider-DN_oXwXM.js} +3 -3
  14. package/lib/{CommentsEnabledProvider-D2gutvsb.js.map → CommentsEnabledProvider-DN_oXwXM.js.map} +1 -1
  15. package/lib/{CommentsField-D2Fum0Jx.js → CommentsField-B7wTBRMB.js} +5 -5
  16. package/lib/{CommentsField-D2Fum0Jx.js.map → CommentsField-B7wTBRMB.js.map} +1 -1
  17. package/lib/{CommentsField-YM3cp3fA.js → CommentsField-BxoVuJOl.js} +4 -4
  18. package/lib/{CommentsField-YM3cp3fA.js.map → CommentsField-BxoVuJOl.js.map} +1 -1
  19. package/lib/{CommentsInput-Bx2t5AW_.js → CommentsInput-C3rEb5L8.js} +6 -6
  20. package/lib/{CommentsInput-Bx2t5AW_.js.map → CommentsInput-C3rEb5L8.js.map} +1 -1
  21. package/lib/{CommentsInput-BBBng3CJ.js → CommentsInput-CU-PFXmu.js} +7 -7
  22. package/lib/{CommentsInput-BBBng3CJ.js.map → CommentsInput-CU-PFXmu.js.map} +1 -1
  23. package/lib/{CommentsInspector-BnSG5Mq0.js → CommentsInspector-BJ1qwj6P.js} +6 -6
  24. package/lib/{CommentsInspector-BnSG5Mq0.js.map → CommentsInspector-BJ1qwj6P.js.map} +1 -1
  25. package/lib/{CommentsInspector-B5V_Bpz5.js → CommentsInspector-BQiMPjvm.js} +6 -6
  26. package/lib/{CommentsInspector-B5V_Bpz5.js.map → CommentsInspector-BQiMPjvm.js.map} +1 -1
  27. package/lib/{CommentsListItem-DnqAlN4p.js → CommentsListItem-QyYan1DB.js} +5 -5
  28. package/lib/{CommentsListItem-DnqAlN4p.js.map → CommentsListItem-QyYan1DB.js.map} +1 -1
  29. package/lib/{CommentsListItem-DVE4IMls.js → CommentsListItem-dvKmANi3.js} +4 -4
  30. package/lib/{CommentsListItem-DVE4IMls.js.map → CommentsListItem-dvKmANi3.js.map} +1 -1
  31. package/lib/{CommentsSelectedPathProvider-DRJ3Xqs4.js → CommentsSelectedPathProvider-COcPb3W3.js} +3 -3
  32. package/lib/{CommentsSelectedPathProvider-DRJ3Xqs4.js.map → CommentsSelectedPathProvider-COcPb3W3.js.map} +1 -1
  33. package/lib/{CommentsStudioLayout-Di510XhD.js → CommentsStudioLayout-BkX6o14w.js} +3 -3
  34. package/lib/{CommentsStudioLayout-Di510XhD.js.map → CommentsStudioLayout-BkX6o14w.js.map} +1 -1
  35. package/lib/{CommentsStudioLayout-Z09s50bM.js → CommentsStudioLayout-dIXEz52s.js} +3 -3
  36. package/lib/{CommentsStudioLayout-Z09s50bM.js.map → CommentsStudioLayout-dIXEz52s.js.map} +1 -1
  37. package/lib/{GlobalPerspectiveMenu-Cwur4_iD.js → GlobalPerspectiveMenu-0Hs276Z-.js} +15 -15
  38. package/lib/{GlobalPerspectiveMenu-Cwur4_iD.js.map → GlobalPerspectiveMenu-0Hs276Z-.js.map} +1 -1
  39. package/lib/{LoadingBlock-Ch_dBXfn.js → LoadingBlock-CElIdb7F.js} +3 -3
  40. package/lib/{LoadingBlock-Ch_dBXfn.js.map → LoadingBlock-CElIdb7F.js.map} +1 -1
  41. package/lib/{PerspectiveProvider-Yk7lgugx.js → PerspectiveProvider-D-6sweQH.js} +130 -97
  42. package/lib/PerspectiveProvider-D-6sweQH.js.map +1 -0
  43. package/lib/{ReleaseAvatar-C68bGuVQ.js → ReleaseAvatar-Bqp_Ci7r.js} +4 -4
  44. package/lib/{ReleaseAvatar-C68bGuVQ.js.map → ReleaseAvatar-Bqp_Ci7r.js.map} +1 -1
  45. package/lib/{ReleasesMetadataProvider-DabLuMD8.js → ReleasesMetadataProvider-BD6XRcpT.js} +2 -2
  46. package/lib/{ReleasesMetadataProvider-DabLuMD8.js.map → ReleasesMetadataProvider-BD6XRcpT.js.map} +1 -1
  47. package/lib/{ReleasesStudioLayout-DsygG30q.js → ReleasesStudioLayout-C6mmxoaY.js} +7 -7
  48. package/lib/{ReleasesStudioLayout-DsygG30q.js.map → ReleasesStudioLayout-C6mmxoaY.js.map} +1 -1
  49. package/lib/{ReleasesTool-CNXNODI_.js → ReleasesTool-DIDmkzic.js} +23 -23
  50. package/lib/{ReleasesTool-CNXNODI_.js.map → ReleasesTool-DIDmkzic.js.map} +1 -1
  51. package/lib/{SchedulePublishingStudioLayout-EsgEGZ7F.js → SchedulePublishingStudioLayout-DrZO-qbI.js} +3 -3
  52. package/lib/{SchedulePublishingStudioLayout-EsgEGZ7F.js.map → SchedulePublishingStudioLayout-DrZO-qbI.js.map} +1 -1
  53. package/lib/{SchedulePublishingUpsellProvider-CWxgqzFp.js → SchedulePublishingUpsellProvider-DeZ_jZIX.js} +2 -2
  54. package/lib/{SchedulePublishingUpsellProvider-CWxgqzFp.js.map → SchedulePublishingUpsellProvider-DeZ_jZIX.js.map} +1 -1
  55. package/lib/{ScheduledPublishingEnabledProvider-CQ-T1Y96.js → ScheduledPublishingEnabledProvider-B8C0_tc5.js} +3 -3
  56. package/lib/{ScheduledPublishingEnabledProvider-CQ-T1Y96.js.map → ScheduledPublishingEnabledProvider-B8C0_tc5.js.map} +1 -1
  57. package/lib/{SearchProvider-CEXmRg1N.js → SearchProvider-T8fsDJV5.js} +8 -8
  58. package/lib/{SearchProvider-CEXmRg1N.js.map → SearchProvider-T8fsDJV5.js.map} +1 -1
  59. package/lib/{SingleDocReleaseLayout-ByDXFS8N.js → SingleDocReleaseLayout-BpMXU9KY.js} +2 -2
  60. package/lib/{SingleDocReleaseLayout-ByDXFS8N.js.map → SingleDocReleaseLayout-BpMXU9KY.js.map} +1 -1
  61. package/lib/{SingleDocReleaseUpsellProvider-ByuDpBIG.js → SingleDocReleaseUpsellProvider-7_OXHySY.js} +3 -3
  62. package/lib/{SingleDocReleaseUpsellProvider-ByuDpBIG.js.map → SingleDocReleaseUpsellProvider-7_OXHySY.js.map} +1 -1
  63. package/lib/{TasksFooterOpenTasks-BSO8TgVF.js → TasksFooterOpenTasks-IFtOEGnB.js} +2 -2
  64. package/lib/{TasksFooterOpenTasks-BSO8TgVF.js.map → TasksFooterOpenTasks-IFtOEGnB.js.map} +1 -1
  65. package/lib/{TasksStudioActiveToolLayout-BXktrH08.js → TasksStudioActiveToolLayout-C99LQz4S.js} +20 -20
  66. package/lib/{TasksStudioActiveToolLayout-BXktrH08.js.map → TasksStudioActiveToolLayout-C99LQz4S.js.map} +1 -1
  67. package/lib/{TasksStudioLayout-BfN-M93c.js → TasksStudioLayout-CmFbUpnB.js} +4 -4
  68. package/lib/{TasksStudioLayout-BfN-M93c.js.map → TasksStudioLayout-CmFbUpnB.js.map} +1 -1
  69. package/lib/{TasksStudioNavbar-CfqloSfP.js → TasksStudioNavbar-DB7DJC4e.js} +2 -2
  70. package/lib/{TasksStudioNavbar-CfqloSfP.js.map → TasksStudioNavbar-DB7DJC4e.js.map} +1 -1
  71. package/lib/{TimeZoneButton-FCwCyJ1J.js → TimeZoneButton-B_ki5v8q.js} +7 -7
  72. package/lib/{TimeZoneButton-FCwCyJ1J.js.map → TimeZoneButton-B_ki5v8q.js.map} +1 -1
  73. package/lib/{Tool-PzN5dskE.js → Tool-DlkZrcrD.js} +15 -15
  74. package/lib/{Tool-PzN5dskE.js.map → Tool-DlkZrcrD.js.map} +1 -1
  75. package/lib/{UpsellPanel-T-5ZD_7k.js → UpsellPanel-ITWwjktp.js} +2 -2
  76. package/lib/{UpsellPanel-T-5ZD_7k.js.map → UpsellPanel-ITWwjktp.js.map} +1 -1
  77. package/lib/{VariantsStudioNavbar-D0XbvL1D.js → VariantsStudioNavbar-DwEV1roH.js} +9 -9
  78. package/lib/{VariantsStudioNavbar-D0XbvL1D.js.map → VariantsStudioNavbar-DwEV1roH.js.map} +1 -1
  79. package/lib/{VariantsTool-B3EEDrQT.js → VariantsTool-Dzhy3PST.js} +12 -12
  80. package/lib/{VariantsTool-B3EEDrQT.js.map → VariantsTool-Dzhy3PST.js.map} +1 -1
  81. package/lib/{WorkspaceLoader-BH_VDaY4.js → WorkspaceLoader-Ck4TMoR5.js} +31 -31
  82. package/lib/{WorkspaceLoader-BH_VDaY4.js.map → WorkspaceLoader-Ck4TMoR5.js.map} +1 -1
  83. package/lib/_createContext.js +1 -1
  84. package/lib/_unstable-embedded.js +5 -5
  85. package/lib/{buildRangeDecorationSelectionsFromComments-B1-tJPvG.js → buildRangeDecorationSelectionsFromComments-BnlhrvDK.js} +3 -3
  86. package/lib/{buildRangeDecorationSelectionsFromComments-B1-tJPvG.js.map → buildRangeDecorationSelectionsFromComments-BnlhrvDK.js.map} +1 -1
  87. package/lib/{buildTextSelectionFromFragment-BiLg851R.js → buildTextSelectionFromFragment-BXrYd9lr.js} +3 -3
  88. package/lib/{buildTextSelectionFromFragment-BiLg851R.js.map → buildTextSelectionFromFragment-BXrYd9lr.js.map} +1 -1
  89. package/lib/{constants-DdgHySkY.js → constants-BQItnHll.js} +2 -2
  90. package/lib/{constants-DdgHySkY.js.map → constants-BQItnHll.js.map} +1 -1
  91. package/lib/{datastores-D1tF4HQA.js → datastores-DNOJm1LF.js} +2 -2
  92. package/lib/{datastores-D1tF4HQA.js.map → datastores-DNOJm1LF.js.map} +1 -1
  93. package/lib/{i18n-Cl_y4bbR.js → i18n-JUYUb7y_.js} +2 -2
  94. package/lib/{i18n-Cl_y4bbR.js.map → i18n-JUYUb7y_.js.map} +1 -1
  95. package/lib/index.js +38 -38
  96. package/lib/{inputResolver-CUWPjdGU.js → inputResolver-Ce1lTBE-.js} +4 -4
  97. package/lib/{inputResolver-CUWPjdGU.js.map → inputResolver-Ce1lTBE-.js.map} +1 -1
  98. package/lib/{navigation.telemetry-rXclq03x.js → navigation.telemetry-BPxX2IEN.js} +10 -10
  99. package/lib/{navigation.telemetry-rXclq03x.js.map → navigation.telemetry-BPxX2IEN.js.map} +1 -1
  100. package/lib/{plugin-CSp8hwQE.js → plugin-Bvxhb5ko.js} +8 -8
  101. package/lib/{plugin-CSp8hwQE.js.map → plugin-Bvxhb5ko.js.map} +1 -1
  102. package/lib/{plugin-Daxe5hwG.js → plugin-Cv6TLYbE.js} +6 -6
  103. package/lib/{plugin-Daxe5hwG.js.map → plugin-Cv6TLYbE.js.map} +1 -1
  104. package/lib/{plugin-BFTpdKKH.js → plugin-D6-7jrXf.js} +3 -3
  105. package/lib/{plugin-BFTpdKKH.js.map → plugin-D6-7jrXf.js.map} +1 -1
  106. package/lib/{plugin-dtgDcBsL.js → plugin-D_GVPwTR.js} +6 -6
  107. package/lib/{plugin-dtgDcBsL.js.map → plugin-D_GVPwTR.js.map} +1 -1
  108. package/lib/{releases.telemetry-B6tRA9U2.js → releases.telemetry-BAO7xaO7.js} +6 -6
  109. package/lib/{releases.telemetry-B6tRA9U2.js.map → releases.telemetry-BAO7xaO7.js.map} +1 -1
  110. package/lib/{resources-BjljYbUa.js → resources-Bw1bpPhG.js} +2 -2
  111. package/lib/{resources-BjljYbUa.js.map → resources-Bw1bpPhG.js.map} +1 -1
  112. package/lib/{resources-DYxnNjS8.js → resources-CC1qBsSO.js} +2 -2
  113. package/lib/{resources-DYxnNjS8.js.map → resources-CC1qBsSO.js.map} +1 -1
  114. package/lib/{resources-D7Mp6N-8.js → resources-CH42UqhC.js} +2 -2
  115. package/lib/{resources-D7Mp6N-8.js.map → resources-CH42UqhC.js.map} +1 -1
  116. package/lib/{resources-GpX0LblP.js → resources-Cq1lXH8T.js} +2 -2
  117. package/lib/{resources-GpX0LblP.js.map → resources-Cq1lXH8T.js.map} +1 -1
  118. package/lib/{resources-B7mfG9Km.js → resources-D7XsFe7y.js} +2 -2
  119. package/lib/{resources-B7mfG9Km.js.map → resources-D7XsFe7y.js.map} +1 -1
  120. package/lib/{resources-CmmAynkL.js → resources-DYn0yzEW.js} +2 -2
  121. package/lib/{resources-CmmAynkL.js.map → resources-DYn0yzEW.js.map} +1 -1
  122. package/lib/{resources-C79qQva3.js → resources-TsgtFPi7.js} +2 -2
  123. package/lib/{resources-C79qQva3.js.map → resources-TsgtFPi7.js.map} +1 -1
  124. package/lib/{scheduleItem-Bdvl81Kb.js → scheduleItem-5fXCZgfo.js} +13 -13
  125. package/lib/{scheduleItem-Bdvl81Kb.js.map → scheduleItem-5fXCZgfo.js.map} +1 -1
  126. package/lib/{schedules-D7bPbTPm.js → schedules-BsE0_g47.js} +3 -3
  127. package/lib/{schedules-D7bPbTPm.js.map → schedules-BsE0_g47.js.map} +1 -1
  128. package/lib/{searchDocumentRelease-v1o9dMnE.js → searchDocumentRelease-Bang3A8l.js} +5 -5
  129. package/lib/{searchDocumentRelease-v1o9dMnE.js.map → searchDocumentRelease-Bang3A8l.js.map} +1 -1
  130. package/lib/{studioClient-EJDu6kOb.js → studioClient-C7B6Aobi.js} +2 -2
  131. package/lib/{studioClient-EJDu6kOb.js.map → studioClient-C7B6Aobi.js.map} +1 -1
  132. package/lib/{useActiveReleases-Bh_Q6f7G.js → useActiveReleases-DxYjyTB1.js} +5 -5
  133. package/lib/{useActiveReleases-Bh_Q6f7G.js.map → useActiveReleases-DxYjyTB1.js.map} +1 -1
  134. package/lib/{useBundleDocuments-zP6JiTzz.js → useBundleDocuments-2YaaN-2l.js} +3 -3
  135. package/lib/{useBundleDocuments-zP6JiTzz.js.map → useBundleDocuments-2YaaN-2l.js.map} +1 -1
  136. package/lib/{useComments-BGOJwUe0.js → useComments-DWh1k0kS.js} +5 -5
  137. package/lib/{useComments-BGOJwUe0.js.map → useComments-DWh1k0kS.js.map} +1 -1
  138. package/lib/{useCommentsTelemetry-BMkf6MTO.js → useCommentsTelemetry-BbJ8lTKN.js} +4 -4
  139. package/lib/{useCommentsTelemetry-BMkf6MTO.js.map → useCommentsTelemetry-BbJ8lTKN.js.map} +1 -1
  140. package/lib/{useDocumentPreviewValues-CryTvfKc.js → useDocumentPreviewValues-CK5VteK3.js} +4 -4
  141. package/lib/{useDocumentPreviewValues-CryTvfKc.js.map → useDocumentPreviewValues-CK5VteK3.js.map} +1 -1
  142. package/lib/{useFieldActions-BTj7VsW5.js → useFieldActions-BmY1Kh3s.js} +2 -2
  143. package/lib/{useFieldActions-BTj7VsW5.js.map → useFieldActions-BmY1Kh3s.js.map} +1 -1
  144. package/lib/{useProjectId-BN6GCdwS.js → useProjectId-C8pZxybz.js} +2 -2
  145. package/lib/{useProjectId-BN6GCdwS.js.map → useProjectId-C8pZxybz.js.map} +1 -1
  146. package/lib/{useReleasesToolAvailable-CQ9-I8Tt.js → useReleasesToolAvailable-DjaSujLo.js} +3 -3
  147. package/lib/{useReleasesToolAvailable-CQ9-I8Tt.js.map → useReleasesToolAvailable-DjaSujLo.js.map} +1 -1
  148. package/lib/{useScheduledDraftMenuActions-OSkdxONo.js → useScheduledDraftMenuActions-DSJU6xQa.js} +9 -9
  149. package/lib/{useScheduledDraftMenuActions-OSkdxONo.js.map → useScheduledDraftMenuActions-DSJU6xQa.js.map} +1 -1
  150. package/lib/{useStudioUrl-DUBI_S4K.js → useStudioUrl-DcTGV00c.js} +5 -5
  151. package/lib/{useStudioUrl-DUBI_S4K.js.map → useStudioUrl-DcTGV00c.js.map} +1 -1
  152. package/lib/{useTasksNavigation-fohCXW6l.js → useTasksNavigation-tAXFJd2V.js} +2 -2
  153. package/lib/{useTasksNavigation-fohCXW6l.js.map → useTasksNavigation-tAXFJd2V.js.map} +1 -1
  154. package/lib/{useTimeZone-DM8ZmUO2.js → useTimeZone-Dj7C8tfZ.js} +2 -2
  155. package/lib/{useTimeZone-DM8ZmUO2.js.map → useTimeZone-Dj7C8tfZ.js.map} +1 -1
  156. package/lib/{utils-D-4rueJZ.js → utils-CT034e4q.js} +3 -3
  157. package/lib/{utils-D-4rueJZ.js.map → utils-CT034e4q.js.map} +1 -1
  158. package/lib/{validationUtils-jTd1rxfY.js → validationUtils-BZPoHEYN.js} +4 -4
  159. package/lib/{validationUtils-jTd1rxfY.js.map → validationUtils-BZPoHEYN.js.map} +1 -1
  160. package/lib/{version-D0Vx4cX1.js → version-BDSMcNU7.js} +2 -2
  161. package/lib/{version-D0Vx4cX1.js.map → version-BDSMcNU7.js.map} +1 -1
  162. package/package.json +17 -17
  163. package/lib/PerspectiveProvider-Yk7lgugx.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CommentsListItem-DnqAlN4p.js","names":["getDialogCopy(t)","() => {\n onConfirm(commentId)\n }","useCallback(() => {\n onConfirm(commentId)\n }, [commentId, onConfirm])","{\n onClick: onClose,\n }","{\n loading,\n onClick: handleDelete,\n text: confirmButtonText,\n tone: 'critical',\n }","{\n cancelButton: {\n onClick: onClose,\n },\n confirmButton: {\n loading,\n onClick: handleDelete,\n text: confirmButtonText,\n tone: 'critical',\n },\n }","<Text size={1} as=\"div\" trim={true}>\n {body}\n </Text>","error && <TextWithTone tone=\"critical\">{t('delete-dialog.error')}</TextWithTone>","<VStack gap={4}>\n <Text size={1} as=\"div\" trim={true}>\n {body}\n </Text>\n\n {error && <TextWithTone tone=\"critical\">{t('delete-dialog.error')}</TextWithTone>}\n </VStack>","<Dialog\n footer={{\n cancelButton: {\n onClick: onClose,\n },\n confirmButton: {\n loading,\n onClick: handleDelete,\n text: confirmButtonText,\n tone: 'critical',\n },\n }}\n header={title}\n id=\"delete-comment-dialog\"\n onClose={onClose}\n width={0}\n >\n <VStack gap={4}>\n <Text size={1} as=\"div\" trim={true}>\n {body}\n </Text>\n\n {error && <TextWithTone tone=\"critical\">{t('delete-dialog.error')}</TextWithTone>}\n </VStack>\n </Dialog>","transformChildren(props.children)","children","useMemo(() => transformChildren(props.children), [props.children])","<NormalBlock>{children}</NormalBlock>","<PortableTextWrap>\n <PortableText value={blocks || EMPTY_ARRAY} components={components} />\n </PortableTextWrap>","blocks || EMPTY_ARRAY","<path\n d=\"M10.1044 10.4011L10.1044 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />","<path\n d=\"M14.2393 10.4011L14.2393 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />","<path\n d=\"M7.12128 14.1151C7.70803 15.0226 9.66113 16.8377 11.7735 16.8377C13.8859 16.8377 15.6713 15.0226 16.4257 14.1151\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />","<path\n d=\"M16.703 6.43905C15.3486 5.36511 13.6357 4.72374 11.773 4.72374C7.38731 4.72374 3.83203 8.27902 3.83203 12.6647C3.83203 17.0503 7.38731 20.6056 11.773 20.6056C16.0995 20.6056 19.618 17.1455 19.712 12.8415\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n />","<path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.1135 9.03425L19.1135 11.4903L20.3135 11.4903L20.3135 9.03425L22.7693 9.03425L22.7693 7.83425L20.3135 7.83425L20.3135 5.37941L19.1135 5.37941L19.1135 7.83425L16.6584 7.83425L16.6584 9.03425L19.1135 9.03425Z\"\n fill=\"currentColor\"\n />","<svg\n data-sanity-icon=\"add-reaction\"\n fill=\"none\"\n height=\"1em\"\n ref={ref}\n viewBox=\"0 0 25 25\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n d=\"M10.1044 10.4011L10.1044 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M14.2393 10.4011L14.2393 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M7.12128 14.1151C7.70803 15.0226 9.66113 16.8377 11.7735 16.8377C13.8859 16.8377 15.6713 15.0226 16.4257 14.1151\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M16.703 6.43905C15.3486 5.36511 13.6357 4.72374 11.773 4.72374C7.38731 4.72374 3.83203 8.27902 3.83203 12.6647C3.83203 17.0503 7.38731 20.6056 11.773 20.6056C16.0995 20.6056 19.618 17.1455 19.712 12.8415\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.1135 9.03425L19.1135 11.4903L20.3135 11.4903L20.3135 9.03425L22.7693 9.03425L22.7693 7.83425L20.3135 7.83425L20.3135 5.37941L19.1135 5.37941L19.1135 7.83425L16.6584 7.83425L16.6584 9.03425L19.1135 9.03425Z\"\n fill=\"currentColor\"\n />\n </svg>","(event: React.KeyboardEvent<HTMLDivElement>) => {\n const focusableLen = rootElement?.querySelectorAll('button').length ?? 0\n\n if (event.key === 'ArrowRight') {\n setFocusedIndex((prev) => (prev + 1) % focusableLen)\n }\n if (event.key === 'ArrowLeft') {\n setFocusedIndex((prev) => (prev - 1 + focusableLen) % focusableLen)\n }\n // if (event.key === 'ArrowDown') {\n // setFocusedIndex((prev) => (prev + GRID_COLUMNS) % focusableLen)\n // }\n // if (event.key === 'ArrowUp') {\n // setFocusedIndex((prev) => (prev - GRID_COLUMNS + focusableLen) % focusableLen)\n // }\n }","rootElement?.querySelectorAll","prev","useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const focusableLen = rootElement?.querySelectorAll('button').length ?? 0\n\n if (event.key === 'ArrowRight') {\n setFocusedIndex((prev) => (prev + 1) % focusableLen)\n }\n if (event.key === 'ArrowLeft') {\n setFocusedIndex((prev) => (prev - 1 + focusableLen) % focusableLen)\n }\n // if (event.key === 'ArrowDown') {\n // setFocusedIndex((prev) => (prev + GRID_COLUMNS) % focusableLen)\n // }\n // if (event.key === 'ArrowUp') {\n // setFocusedIndex((prev) => (prev - GRID_COLUMNS + focusableLen) % focusableLen)\n // }\n },\n [rootElement],\n )","(event: React.MouseEvent<HTMLButtonElement>) => {\n const index = rootElement\n ? Array.from(rootElement.querySelectorAll('button')).indexOf(event.currentTarget)\n : -1\n setFocusedIndex(index)\n onSelect(options[index])\n }","event","useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n const index = rootElement\n ? Array.from(rootElement.querySelectorAll('button')).indexOf(event.currentTarget)\n : -1\n setFocusedIndex(index)\n onSelect(options[index])\n },\n [rootElement, onSelect, options],\n )","() => {\n if (!rootElement) return\n const focusableElements = Array.from(rootElement.querySelectorAll('button'))\n if (focusableElements.length > 0) {\n focusableElements[focusedIndex].focus()\n }\n }","[focusedIndex, rootElement]","options.map((o) => {\n const emoji = COMMENT_REACTION_EMOJIS[o.shortName]\n\n return (\n <UIButton\n key={o.shortName}\n aria-label={t('reactions.react-with-aria-label', {\n reactionName: o.title || o.shortName,\n })}\n mode=\"bleed\"\n onClick={handleOptionClick}\n padding={2}\n role=\"menuitem\"\n tabIndex={-1}\n >\n <EmojiText align=\"center\" size={2} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n </UIButton>\n )\n })","(o) => {\n const emoji = COMMENT_REACTION_EMOJIS[o.shortName]\n\n return (\n <UIButton\n key={o.shortName}\n aria-label={t('reactions.react-with-aria-label', {\n reactionName: o.title || o.shortName,\n })}\n mode=\"bleed\"\n onClick={handleOptionClick}\n padding={2}\n role=\"menuitem\"\n tabIndex={-1}\n >\n <EmojiText align=\"center\" size={2} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n </UIButton>\n )\n }","<Grid\n gridTemplateColumns=\"repeat(6, minmax(0,1fr))\"\n gap={1}\n onKeyDown={handleRootKeyDown}\n ref={setRootElement}\n role=\"menu\"\n >\n {options.map((o) => {\n const emoji = COMMENT_REACTION_EMOJIS[o.shortName]\n\n return (\n <UIButton\n key={o.shortName}\n aria-label={t('reactions.react-with-aria-label', {\n reactionName: o.title || o.shortName,\n })}\n mode=\"bleed\"\n onClick={handleOptionClick}\n padding={2}\n role=\"menuitem\"\n tabIndex={-1}\n >\n <EmojiText align=\"center\" size={2} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n </UIButton>\n )\n })}\n </Grid>","() => {\n const next = !open\n setOpen(next)\n\n if (next) {\n onMenuOpen?.()\n } else {\n onMenuClose?.()\n }\n }","useCallback(() => {\n const next = !open\n setOpen(next)\n\n if (next) {\n onMenuOpen?.()\n } else {\n onMenuClose?.()\n }\n }, [onMenuClose, onMenuOpen, open])","() => {\n if (!open) return\n\n setOpen(false)\n onMenuClose?.()\n }","useCallback(() => {\n if (!open) return\n\n setOpen(false)\n onMenuClose?.()\n }, [open, onMenuClose])","() => {\n if (!open) return\n\n handleClose()\n buttonElement?.focus()\n }","buttonElement?.focus","useCallback(() => {\n if (!open) return\n\n handleClose()\n buttonElement?.focus()\n }, [buttonElement, handleClose, open])","(event: React.KeyboardEvent<HTMLDivElement>) => {\n const {key, shiftKey} = event\n\n if ((shiftKey && key === 'Tab') || key === 'Escape' || key === 'Tab') {\n handleCloseAndFocus()\n }\n }","useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const {key, shiftKey} = event\n\n if ((shiftKey && key === 'Tab') || key === 'Escape' || key === 'Tab') {\n handleCloseAndFocus()\n }\n },\n [handleCloseAndFocus],\n )","() => [popoverRef.current, buttonElement]","(option: CommentReactionOption) => {\n onSelect(option)\n handleClose()\n }","useCallback(\n (option: CommentReactionOption) => {\n onSelect(option)\n handleClose()\n },\n [handleClose, onSelect],\n )","cloneElement(btn, {\n 'aria-expanded': open,\n 'aria-haspopup': 'true',\n 'disabled': readOnly || mode === 'upsell',\n 'id': 'reactions-menu-button',\n 'onClick': handleClick,\n 'ref': setButtonElement,\n })","useMemo(() => {\n // Get the button element from the renderMenuButton function.\n const btn = renderMenuButton({\n open,\n tooltipContent:\n mode === 'upsell'\n ? t('list-item.context-menu-add-reaction-upsell')\n : t('list-item.context-menu-add-reaction'),\n t,\n })\n\n // Clone the button element and add the necessary props.\n return cloneElement(btn, {\n 'aria-expanded': open,\n 'aria-haspopup': 'true',\n 'disabled': readOnly || mode === 'upsell',\n 'id': 'reactions-menu-button',\n 'onClick': handleClick,\n 'ref': setButtonElement,\n })\n }, [handleClick, open, readOnly, renderMenuButton, t, mode])","<CommentReactionsMenu onSelect={handleSelect} options={options} />","<Card\n aria-labelledby=\"reactions-menu-button\"\n onKeyDown={handleKeyDown}\n padding={1}\n radius={3}\n tone=\"default\"\n >\n <CommentReactionsMenu onSelect={handleSelect} options={options} />\n </Card>","<Popover\n constrainSize\n content={popoverContent}\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n open={open}\n placement=\"bottom\"\n portal\n ref={popoverRef}\n tone=\"default\"\n >\n {button}\n </Popover>","t('reactions.user-list.you', {context, replace: {name: user?.displayName}})","user?.displayName","user?.displayName || t('reactions.user-list.unknown-user-fallback-name')","displayName","<CommentReactionsUsersTooltipContent {...restProps} />","<div>{children}</div>","<Tooltip\n content={<CommentReactionsUsersTooltipContent {...restProps} />}\n placement=\"bottom\"\n portal\n >\n <div>{children}</div>\n </Tooltip>","{\n currentUserId,\n userIds,\n}: {\n currentUserId: string | null | undefined\n userIds: string[]\n}","{style: 'long', type: 'conjunction'}","nonWhitespace = ''","{currentUserId, userIds}: ReactionTooltipComponentProps","<FormattedUserList currentUserId={currentUserId} userIds={userIds} />","{reactionName}: ReactionTooltipComponentProps","<InlineText muted forwardedAs=\"div\" trim={true}>\n {reactionName}\n </InlineText>","{children}: ReactionTooltipComponentProps","<InlineText muted forwardedAs=\"div\" trim={true}>\n {children}\n </InlineText>","<wbr />","<>\n <InlineText muted forwardedAs=\"div\" trim={true}>\n {children}\n </InlineText>{' '}\n <wbr />{' '}\n </>","<Flex justifyContent=\"center\" paddingBottom={2} paddingTop={1}>\n <EmojiText size={4} forwardedAs=\"div\" trim={true}>\n {COMMENT_REACTION_EMOJIS[reactionName]}\n </EmojiText>\n </Flex>","COMMENT_REACTION_EMOJIS[reactionName]","{reactionName}","{UserList, ReactionName, Text: ReactionText}","{\n currentUserId: currentUser.sanityUserId,\n reactionName,\n userIds,\n }","sanityUserId","<TextBox>\n <Translate\n t={t}\n i18nKey=\"reactions.users-reacted-with-reaction\"\n values={{reactionName}}\n components={{UserList, ReactionName, Text: ReactionText}}\n componentProps={{\n currentUserId: currentUser.sanityUserId,\n reactionName,\n userIds,\n }}\n />\n </TextBox>","<ContentStack padding={1} flexDirection=\"column\">\n <Flex justifyContent=\"center\" paddingBottom={2} paddingTop={1}>\n <EmojiText size={4} forwardedAs=\"div\" trim={true}>\n {COMMENT_REACTION_EMOJIS[reactionName]}\n </EmojiText>\n </Flex>\n\n <TextBox>\n <Translate\n t={t}\n i18nKey=\"reactions.users-reacted-with-reaction\"\n values={{reactionName}}\n components={{UserList, ReactionName, Text: ReactionText}}\n componentProps={{\n currentUserId: currentUser.sanityUserId,\n reactionName,\n userIds,\n }}\n />\n </TextBox>\n </ContentStack>","(name: CommentReactionShortNames) => {\n const option = COMMENT_REACTION_OPTIONS.find((o) => o.shortName === name)\n\n if (option) {\n onSelect(option)\n }\n }","useCallback(\n (name: CommentReactionShortNames) => {\n const option = COMMENT_REACTION_OPTIONS.find((o) => o.shortName === name)\n\n if (option) {\n onSelect(option)\n }\n },\n [onSelect],\n )","reactions.filter((r) => r.userId === currentUser?.sanityUserId).map((r) => r.shortName)","sanityUserId","(r) => r.userId === currentUser?.sanityUserId","(r) => r.shortName","useMemo(() => {\n return reactions.filter((r) => r.userId === currentUser?.sanityUserId).map((r) => r.shortName)\n }, [currentUser?.sanityUserId, reactions])","grouped.filter(([name]) => COMMENT_REACTION_EMOJIS[name])","([name]) => COMMENT_REACTION_EMOJIS[name]","useMemo(() => {\n const grouped = groupReactionsByName(reactions)\n\n // Filter out reactions that are not in the `COMMENT_REACTION_EMOJIS` map.\n return grouped.filter(([name]) => COMMENT_REACTION_EMOJIS[name])\n }, [reactions])","() => ({\n // An array of the initial order of the reactions. This is used to sort the reactions.\n // E.g. [':+1:', ':heart:']\n sortOrder: Object.keys(Object.fromEntries(groupedReactions)),\n // We cache the groupedReactions to know when we should update the sortedReactions, ensuring we don't run into an infinite render loop.\n groupedReactions: [] as typeof groupedReactions,\n sortedReactions: [] as typeof groupedReactions,\n })","groupedReactions","sortedReactions.map(([name]) => name)","setSortedGroupedReactions","([nameA], [nameB]) => {\n const indexA = sortOrder.indexOf(nameA)\n const indexB = sortOrder.indexOf(nameB)\n\n if (indexA === -1) {\n return 1\n }\n\n if (indexB === -1) {\n return -1\n }\n\n return indexA - indexB\n }","[nameA]","[nameB]","([name]) => name","sortedReactions.map(([name, reactionsList]) => {\n const hasReacted = currentUserReactionNames.includes(name)\n const userIds = reactionsList.map((r) => r.userId)\n const emoji = COMMENT_REACTION_EMOJIS[name]\n\n return (\n <CommentReactionsUsersTooltip\n key={name}\n currentUser={currentUser}\n reactionName={name}\n userIds={userIds}\n >\n <TransparentCard tone=\"default\">\n <UIButton\n disabled={readOnly || mode === 'upsell'}\n mode=\"ghost\"\n onClick={() => handleSelect(name)}\n padding={2}\n radius=\"full\"\n selected={hasReacted}\n tone={hasReacted ? 'primary' : 'default'}\n >\n <Flex alignItems=\"center\" gap={1}>\n <EmojiText size={1} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n\n <Text size={0} weight={hasReacted ? 'semibold' : 'medium'} as=\"div\" trim={true}>\n {reactionsList?.length}\n </Text>\n </Flex>\n </UIButton>\n </TransparentCard>\n </CommentReactionsUsersTooltip>\n )\n })","([name, reactionsList]) => {\n const hasReacted = currentUserReactionNames.includes(name)\n const userIds = reactionsList.map((r) => r.userId)\n const emoji = COMMENT_REACTION_EMOJIS[name]\n\n return (\n <CommentReactionsUsersTooltip\n key={name}\n currentUser={currentUser}\n reactionName={name}\n userIds={userIds}\n >\n <TransparentCard tone=\"default\">\n <UIButton\n disabled={readOnly || mode === 'upsell'}\n mode=\"ghost\"\n onClick={() => handleSelect(name)}\n padding={2}\n radius=\"full\"\n selected={hasReacted}\n tone={hasReacted ? 'primary' : 'default'}\n >\n <Flex alignItems=\"center\" gap={1}>\n <EmojiText size={1} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n\n <Text size={0} weight={hasReacted ? 'semibold' : 'medium'} as=\"div\" trim={true}>\n {reactionsList?.length}\n </Text>\n </Flex>\n </UIButton>\n </TransparentCard>\n </CommentReactionsUsersTooltip>\n )\n }","name","[name, reactionsList]","(r) => r.userId","(o) => handleSelect(o.shortName)","o","<TransparentCard tone=\"default\">\n <CommentReactionsMenuButton\n mode={mode}\n onSelect={(o) => handleSelect(o.shortName)}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n </TransparentCard>","<Flex alignItems=\"center\" gap={1} flexWrap=\"wrap\">\n <TooltipDelayGroupProvider>\n {sortedReactions.map(([name, reactionsList]) => {\n const hasReacted = currentUserReactionNames.includes(name)\n const userIds = reactionsList.map((r) => r.userId)\n const emoji = COMMENT_REACTION_EMOJIS[name]\n\n return (\n <CommentReactionsUsersTooltip\n key={name}\n currentUser={currentUser}\n reactionName={name}\n userIds={userIds}\n >\n <TransparentCard tone=\"default\">\n <UIButton\n disabled={readOnly || mode === 'upsell'}\n mode=\"ghost\"\n onClick={() => handleSelect(name)}\n padding={2}\n radius=\"full\"\n selected={hasReacted}\n tone={hasReacted ? 'primary' : 'default'}\n >\n <Flex alignItems=\"center\" gap={1}>\n <EmojiText size={1} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n\n <Text size={0} weight={hasReacted ? 'semibold' : 'medium'} as=\"div\" trim={true}>\n {reactionsList?.length}\n </Text>\n </Flex>\n </UIButton>\n </TransparentCard>\n </CommentReactionsUsersTooltip>\n )\n })}\n\n <TransparentCard tone=\"default\">\n <CommentReactionsMenuButton\n mode={mode}\n onSelect={(o) => handleSelect(o.shortName)}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n </TransparentCard>\n </TooltipDelayGroupProvider>\n </Flex>","r","[name]","{origin}: {origin: CommentOrigin}","<Text size={2}>{origin === 'draft' ? <RingIcon /> : <CircleSmallIcon />}</Text>","<IconSlotRoot data-status={origin}>\n <Text size={2}>{origin === 'draft' ? <RingIcon /> : <CircleSmallIcon />}</Text>\n </IconSlotRoot>","t(getOriginI18nKey(origin))","<Text size={0} muted weight=\"medium\">\n {t(getOriginI18nKey(origin))}\n </Text>","<Flex marginBottom={2}>\n <Card border padding={1} radius={3}>\n <Flex alignItems=\"center\" gap={1} paddingRight={1}>\n <IconSlotRoot data-status={origin}>\n <Text size={2}>{origin === 'draft' ? <RingIcon /> : <CircleSmallIcon />}</Text>\n </IconSlotRoot>\n\n <Text size={0} muted weight=\"medium\">\n {t(getOriginI18nKey(origin))}\n </Text>\n </Flex>\n </Card>\n </Flex>","onReactionSelect && (\n <CommentReactionsMenuButton\n mode={mode}\n onMenuClose={onMenuClose}\n onMenuOpen={onMenuOpen}\n onSelect={onReactionSelect}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n )","isParent && onStatusChange && (\n <Button\n aria-label={\n status === 'open'\n ? t('list-item.resolved-tooltip-aria-label')\n : t('list-item.re-open-resolved-aria-label')\n }\n data-testid=\"comments-list-item-status-button\"\n disabled={readOnly}\n icon={status === 'open' ? CheckmarkCircleIcon : UndoIcon}\n mode=\"bleed\"\n onClick={onStatusChange}\n tooltipProps={{\n content:\n status === 'open'\n ? t('list-item.resolved-tooltip-content')\n : t('list-item.re-open-resolved'),\n }}\n />\n )","hasContextMenuOptions && (\n <MenuButton\n id=\"comment-actions-menu\"\n button={\n <ContextMenuButton\n aria-label={t('list-item.open-menu-aria-label')}\n disabled={readOnly}\n hidden={!showMenuButton}\n />\n }\n onOpen={onMenuOpen}\n onClose={onMenuClose}\n menu={\n <Menu>\n <MenuItem\n hidden={!canEdit}\n icon={EditIcon}\n onClick={onEditStart}\n text={t('list-item.edit-comment')}\n tooltipProps={\n mode === 'upsell' ? {content: t('list-item.edit-comment-upsell')} : undefined\n }\n disabled={mode === 'upsell'}\n />\n\n <MenuItem\n hidden={!canDelete}\n icon={TrashIcon}\n onClick={onDeleteStart}\n text={t('list-item.delete-comment')}\n tone=\"critical\"\n />\n\n {onCopyLink && <MenuDivider hidden={!canDelete && !canEdit} />}\n\n <MenuItem\n hidden={!onCopyLink}\n icon={LinkIcon}\n onClick={onCopyLink}\n text={t('list-item.copy-link')}\n />\n </Menu>\n }\n popover={POPOVER_PROPS}\n />\n )","<TooltipDelayGroupProvider>\n <Flex>\n <FloatingCard display=\"flex\" shadow={2} padding={1} radius={2} sizing=\"border\">\n {onReactionSelect && (\n <CommentReactionsMenuButton\n mode={mode}\n onMenuClose={onMenuClose}\n onMenuOpen={onMenuOpen}\n onSelect={onReactionSelect}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n )}\n\n {isParent && onStatusChange && (\n <Button\n aria-label={\n status === 'open'\n ? t('list-item.resolved-tooltip-aria-label')\n : t('list-item.re-open-resolved-aria-label')\n }\n data-testid=\"comments-list-item-status-button\"\n disabled={readOnly}\n icon={status === 'open' ? CheckmarkCircleIcon : UndoIcon}\n mode=\"bleed\"\n onClick={onStatusChange}\n tooltipProps={{\n content:\n status === 'open'\n ? t('list-item.resolved-tooltip-content')\n : t('list-item.re-open-resolved'),\n }}\n />\n )}\n\n {hasContextMenuOptions && (\n <MenuButton\n id=\"comment-actions-menu\"\n button={\n <ContextMenuButton\n aria-label={t('list-item.open-menu-aria-label')}\n disabled={readOnly}\n hidden={!showMenuButton}\n />\n }\n onOpen={onMenuOpen}\n onClose={onMenuClose}\n menu={\n <Menu>\n <MenuItem\n hidden={!canEdit}\n icon={EditIcon}\n onClick={onEditStart}\n text={t('list-item.edit-comment')}\n tooltipProps={\n mode === 'upsell' ? {content: t('list-item.edit-comment-upsell')} : undefined\n }\n disabled={mode === 'upsell'}\n />\n\n <MenuItem\n hidden={!canDelete}\n icon={TrashIcon}\n onClick={onDeleteStart}\n text={t('list-item.delete-comment')}\n tone=\"critical\"\n />\n\n {onCopyLink && <MenuDivider hidden={!canDelete && !canEdit} />}\n\n <MenuItem\n hidden={!onCopyLink}\n icon={LinkIcon}\n onClick={onCopyLink}\n text={t('list-item.copy-link')}\n />\n </Menu>\n }\n popover={POPOVER_PROPS}\n />\n )}\n </FloatingCard>\n </Flex>\n </TooltipDelayGroupProvider>","t('list-item.missing-referenced-value-tooltip-content')","useMemo(() => {\n if (Array.isArray(value) && value?.filter(isPortableTextTextBlock).length > 0) {\n const text = value?.map(toPlainText).join(' ')\n const truncated = truncate(text)\n\n return truncated\n }\n\n return null\n }, [value])","truncate(text)","value?.map","!hasReferencedValue && (\n <Tooltip content={tooltipText}>\n <InlineBox>\n <Icon size={1} icon={LinkRemovedIcon} style={{margin: '-0.375rem'}} />\n </InlineBox>\n </Tooltip>\n )","<Flex alignItems=\"flex-start\">\n <Text size={1} muted as=\"div\" trim={true}>\n {!hasReferencedValue && (\n <Tooltip content={tooltipText}>\n <InlineBox>\n <Icon size={1} icon={LinkRemovedIcon} style={{margin: '-0.375rem'}} />\n </InlineBox>\n </Tooltip>\n )}\n\n {resolvedValue}\n </Text>\n </Flex>","<BlockQuoteStack\n $hasReferencedValue={Boolean(hasReferencedValue)}\n data-testid=\"comments-list-item-referenced-value\"\n flexBasis=\"0%\"\n flexGrow={1}\n flexDirection=\"column\"\n forwardedAs=\"blockquote\"\n padding={1}\n paddingLeft={2}\n >\n <Flex alignItems=\"flex-start\">\n <Text size={1} muted as=\"div\" trim={true}>\n {!hasReferencedValue && (\n <Tooltip content={tooltipText}>\n <InlineBox>\n <Icon size={1} icon={LinkRemovedIcon} style={{margin: '-0.375rem'}} />\n </InlineBox>\n </Tooltip>\n )}\n\n {resolvedValue}\n </Text>\n </Flex>\n </BlockQuoteStack>","Boolean(hasReferencedValue)","{\n children,\n intent,\n}: {\n children?: React.ReactNode\n intent?: CommentContext['intent']\n}","<IntentLink params={intent.params} intent={intent.name}>\n {children}\n </IntentLink>","name","params","avatarSize = 1","withAvatar = true","isParent ? getForeignCommentOrigin(comment, versionId) : null","hasCommentMessageValue(value)","useMemo(() => hasCommentMessageValue(value), [value])","(\n comment?.reactions?.filter((r) => r?._optimisticState !== 'removed') || EMPTY_ARRAY\n ).filter((r) => {\n // Filter out reactions that might have to incorrect format\n return 'userId' in r && 'shortName' in r\n })","reactions","(r) => r?._optimisticState !== 'removed'","(r) => {\n // Filter out reactions that might have to incorrect format\n return 'userId' in r && 'shortName' in r\n }","_createdAt ? new Date(_createdAt) : new Date()","{\n dateStyle: 'full',\n timeStyle: 'medium',\n }","dateTimeFormat.format(createdDate)","() => {\n if (isEditing) return\n\n startMessage.current = message\n // oxlint-disable-next-line react/set-state-in-effect -- pre-existing violation, to be fixed in a follow-up\n setValue(message)\n }","[isEditing, message]","() => setMenuOpen(true)","useCallback(() => setMenuOpen(true), [])","() => setMenuOpen(false)","useCallback(() => setMenuOpen(false), [])","() => onCopyLink?.(_id)","useCallback(() => onCopyLink?.(_id), [_id, onCopyLink])","(e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation()\n onCreateRetry?.(_id)\n }","useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation()\n onCreateRetry?.(_id)\n },\n [_id, onCreateRetry],\n )","() => onDelete(_id)","useCallback(() => onDelete(_id), [_id, onDelete])","() => {\n setIsEditing(false)\n setValue(startMessage.current)\n }","useCallback(() => {\n setIsEditing(false)\n setValue(startMessage.current)\n }, [])","() => {\n if (!hasValue || !hasChanges) {\n cancelEdit()\n return\n }\n commentInputRef.current?.discardDialogController.open()\n }","useCallback(() => {\n if (!hasValue || !hasChanges) {\n cancelEdit()\n return\n }\n commentInputRef.current?.discardDialogController.open()\n }, [cancelEdit, hasChanges, hasValue])","(event: React.KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard the input text\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n // Call parent handler\n if (onInputKeyDown) onInputKeyDown(event)\n }","useCallback(\n (event: React.KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard the input text\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n // Call parent handler\n if (onInputKeyDown) onInputKeyDown(event)\n },\n [onInputKeyDown, startDiscard],\n )","() => {\n commentInputRef.current?.discardDialogController.close()\n }","useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n }, [])","() => {\n commentInputRef.current?.discardDialogController.close()\n cancelEdit()\n }","useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n cancelEdit()\n }, [cancelEdit])","(reaction: CommentReactionOption) => {\n onReactionSelect?.(_id, reaction)\n }","useCallback(\n (reaction: CommentReactionOption) => {\n onReactionSelect?.(_id, reaction)\n },\n [_id, onReactionSelect],\n )","(nextValue: CommentMessage) => {\n onEdit(_id, {message: nextValue})\n setIsEditing(false)\n }","useCallback(\n (nextValue: CommentMessage) => {\n onEdit(_id, {message: nextValue})\n setIsEditing(false)\n },\n [_id, onEdit],\n )","() => {\n onStatusChange?.(_id, comment.status === 'open' ? 'resolved' : 'open')\n }","status","useCallback(() => {\n onStatusChange?.(_id, comment.status === 'open' ? 'resolved' : 'open')\n }, [_id, comment.status, onStatusChange])","() => {\n setIsEditing((v) => !v)\n }","(v) => !v","useCallback(() => {\n setIsEditing((v) => !v)\n }, [])","(event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && !hasChanges) {\n cancelEdit()\n }\n }","event","useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && !hasChanges) {\n cancelEdit()\n }\n },\n [cancelEdit, hasChanges],\n )","() => [rootElementRef.current]","user?.displayName ? (\n <Text size={1} weight=\"medium\" truncate={1} title={user.displayName} as=\"div\" trim={true}>\n {user.displayName}\n </Text>\n ) : (\n <TextSkeleton size={1} style={SKELETON_INLINE_STYLE} />\n )","user?.displayName","foreignOrigin && <CommentOriginBadge origin={foreignOrigin} />","withAvatar && <CommentsAvatar user={user} size={avatarSize} />","<Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>","<Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>","Flex","!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )","\"flex-end\"","2","<Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>","comment.context?.intent ? 0 : 1","\"center\"","\"0%\"","1","intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )","<Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>","intent ? 2 : 0","\"column\"","!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )","<HeaderFlex\n alignItems=\"center\"\n gap={FLEX_GAP}\n flexBasis=\"0%\"\n flexGrow={1}\n $size={avatarSize}\n >\n {withAvatar && <CommentsAvatar user={user} size={avatarSize} />}\n\n <Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>\n\n {!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )}\n </HeaderFlex>","HeaderFlex","FLEX_GAP","isTextSelectionComment(comment) && Boolean(comment?.contentSnapshot) && (\n <Flex gap={FLEX_GAP} marginBottom={3}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentsListItemReferencedValue\n hasReferencedValue={hasReferencedValue}\n value={comment?.contentSnapshot}\n />\n </Flex>\n )","isEditing && (\n <Flex alignItems=\"flex-start\" gap={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex flexBasis=\"0%\" flexGrow={1} flexDirection=\"column\">\n <CommentInput\n currentUser={currentUser}\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleEditSubmit}\n readOnly={readOnly}\n ref={commentInputRef}\n value={value}\n withAvatar={false}\n />\n </Flex>\n </Flex>\n )","!isEditing && (\n <Flex gap={FLEX_GAP}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentMessageSerializer blocks={message} />\n </Flex>\n )","hasReactions && (\n <Flex gap={FLEX_GAP} marginTop={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Box onClick={stopPropagation}>\n <CommentReactionsBar\n currentUser={currentUser}\n mode={mode}\n onSelect={handleReactionSelect}\n reactions={reactions}\n readOnly={readOnly}\n />\n </Box>\n </Flex>\n )","<InnerStack gap={1} data-muted={displayError}>\n {foreignOrigin && <CommentOriginBadge origin={foreignOrigin} />}\n\n <HeaderFlex\n alignItems=\"center\"\n gap={FLEX_GAP}\n flexBasis=\"0%\"\n flexGrow={1}\n $size={avatarSize}\n >\n {withAvatar && <CommentsAvatar user={user} size={avatarSize} />}\n\n <Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>\n\n {!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )}\n </HeaderFlex>\n\n {isTextSelectionComment(comment) && Boolean(comment?.contentSnapshot) && (\n <Flex gap={FLEX_GAP} marginBottom={3}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentsListItemReferencedValue\n hasReferencedValue={hasReferencedValue}\n value={comment?.contentSnapshot}\n />\n </Flex>\n )}\n\n {isEditing && (\n <Flex alignItems=\"flex-start\" gap={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex flexBasis=\"0%\" flexGrow={1} flexDirection=\"column\">\n <CommentInput\n currentUser={currentUser}\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleEditSubmit}\n readOnly={readOnly}\n ref={commentInputRef}\n value={value}\n withAvatar={false}\n />\n </Flex>\n </Flex>\n )}\n\n {!isEditing && (\n <Flex gap={FLEX_GAP}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentMessageSerializer blocks={message} />\n </Flex>\n )}\n\n {hasReactions && (\n <Flex gap={FLEX_GAP} marginTop={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Box onClick={stopPropagation}>\n <CommentReactionsBar\n currentUser={currentUser}\n mode={mode}\n onSelect={handleReactionSelect}\n reactions={reactions}\n readOnly={readOnly}\n />\n </Box>\n </Flex>\n )}\n </InnerStack>","InnerStack","displayError && (\n <ErrorFlex gap={FLEX_GAP} $size={avatarSize}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex alignItems=\"center\" gap={1} flexBasis=\"0%\" flexGrow={1}>\n <Text muted size={1} as=\"div\" trim={true}>\n {hasError && t('list-item.layout-failed-sent')}\n {isRetrying && t('list-item.layout-posting')}\n </Text>\n\n <Flex hidden={isRetrying}>\n <RetryCardButton\n __unstable_focusRing\n display=\"flex\"\n forwardedAs=\"button\"\n onClick={handleCreateRetry}\n padding={1}\n radius={2}\n tone=\"primary\"\n >\n <Text size={1} muted as=\"div\" trim={true}>\n {t('list-item.layout-retry')}\n </Text>\n </RetryCardButton>\n </Flex>\n </Flex>\n </ErrorFlex>\n )","<RootStack\n data-menu-open={menuOpen ? 'true' : 'false'}\n data-testid=\"comments-list-item-layout\"\n onKeyDown={handleRootKeyDown}\n ref={rootElementRef}\n gap={4}\n >\n <InnerStack gap={1} data-muted={displayError}>\n {foreignOrigin && <CommentOriginBadge origin={foreignOrigin} />}\n\n <HeaderFlex\n alignItems=\"center\"\n gap={FLEX_GAP}\n flexBasis=\"0%\"\n flexGrow={1}\n $size={avatarSize}\n >\n {withAvatar && <CommentsAvatar user={user} size={avatarSize} />}\n\n <Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>\n\n {!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )}\n </HeaderFlex>\n\n {isTextSelectionComment(comment) && Boolean(comment?.contentSnapshot) && (\n <Flex gap={FLEX_GAP} marginBottom={3}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentsListItemReferencedValue\n hasReferencedValue={hasReferencedValue}\n value={comment?.contentSnapshot}\n />\n </Flex>\n )}\n\n {isEditing && (\n <Flex alignItems=\"flex-start\" gap={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex flexBasis=\"0%\" flexGrow={1} flexDirection=\"column\">\n <CommentInput\n currentUser={currentUser}\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleEditSubmit}\n readOnly={readOnly}\n ref={commentInputRef}\n value={value}\n withAvatar={false}\n />\n </Flex>\n </Flex>\n )}\n\n {!isEditing && (\n <Flex gap={FLEX_GAP}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentMessageSerializer blocks={message} />\n </Flex>\n )}\n\n {hasReactions && (\n <Flex gap={FLEX_GAP} marginTop={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Box onClick={stopPropagation}>\n <CommentReactionsBar\n currentUser={currentUser}\n mode={mode}\n onSelect={handleReactionSelect}\n reactions={reactions}\n readOnly={readOnly}\n />\n </Box>\n </Flex>\n )}\n </InnerStack>\n\n {displayError && (\n <ErrorFlex gap={FLEX_GAP} $size={avatarSize}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex alignItems=\"center\" gap={1} flexBasis=\"0%\" flexGrow={1}>\n <Text muted size={1} as=\"div\" trim={true}>\n {hasError && t('list-item.layout-failed-sent')}\n {isRetrying && t('list-item.layout-posting')}\n </Text>\n\n <Flex hidden={isRetrying}>\n <RetryCardButton\n __unstable_focusRing\n display=\"flex\"\n forwardedAs=\"button\"\n onClick={handleCreateRetry}\n padding={1}\n radius={2}\n tone=\"primary\"\n >\n <Text size={1} muted as=\"div\" trim={true}>\n {t('list-item.layout-retry')}\n </Text>\n </RetryCardButton>\n </Flex>\n </Flex>\n </ErrorFlex>\n )}\n </RootStack>","RootStack","menuOpen ? 'true' : 'false'","\"comments-list-item-layout\"","4","r","avatarConfig = DEFAULT_AVATAR_CONFIG","replies = EMPTY_ARRAY","hasCommentMessageValue(value)","useMemo(() => hasCommentMessageValue(value), [value])","() => setMouseOver(true)","() => setMouseOver(false)","(nextValue: CommentMessage) => {\n const nextComment: CommentBaseCreatePayload = {\n message: nextValue,\n parentCommentId: parentComment._id,\n status: parentComment?.status || 'open',\n // Since this is a reply to an existing comment, we use the same thread ID as the parent\n threadId: parentComment.threadId,\n // A new comment will not have any reactions\n reactions: EMPTY_ARRAY,\n\n payload: {\n fieldPath: parentComment.target.path?.field || '',\n },\n }\n\n onReply?.(nextComment)\n setValue(EMPTY_ARRAY)\n }","_id","status","field","threadId","() => {\n if (!hasValue) {\n setValue(EMPTY_ARRAY)\n return\n }\n\n replyInputRef.current?.discardDialogController.open()\n }","useCallback(() => {\n if (!hasValue) {\n setValue(EMPTY_ARRAY)\n return\n }\n\n replyInputRef.current?.discardDialogController.open()\n }, [hasValue])","(event: KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard input text with Escape\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n }","useCallback(\n (event: KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard input text with Escape\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n },\n [startDiscard],\n )","() => {\n replyInputRef.current?.discardDialogController.close()\n }","useCallback(() => {\n replyInputRef.current?.discardDialogController.close()\n }, [])","() => {\n setValue(EMPTY_ARRAY)\n replyInputRef.current?.discardDialogController.close()\n replyInputRef.current?.focus()\n }","useCallback(() => {\n setValue(EMPTY_ARRAY)\n replyInputRef.current?.discardDialogController.close()\n replyInputRef.current?.focus()\n }, [])","(e: MouseEvent<HTMLDivElement>) => {\n e.stopPropagation()\n\n // Don't act if the click was caused by clicking\n // outside e.g. a popover or a menu\n if (!isTopLayer) return\n\n onPathSelect?.({\n fieldPath: parentComment.target.path?.field || '',\n origin: 'inspector',\n threadId: parentComment.threadId,\n })\n }","useCallback(\n (e: MouseEvent<HTMLDivElement>) => {\n e.stopPropagation()\n\n // Don't act if the click was caused by clicking\n // outside e.g. a popover or a menu\n if (!isTopLayer) return\n\n onPathSelect?.({\n fieldPath: parentComment.target.path?.field || '',\n origin: 'inspector',\n threadId: parentComment.threadId,\n })\n },\n [isTopLayer, onPathSelect, parentComment.target.path?.field, parentComment.threadId],\n )","(e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n setCollapsed(false)\n }","useCallback((e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n setCollapsed(false)\n }, [])","useMemo(() => {\n if (collapsed) return replies?.slice(-MAX_COLLAPSED_REPLIES)\n return replies\n }, [replies, collapsed])","replies?.slice(-MAX_COLLAPSED_REPLIES)","replies?.slice","useMemo(() => {\n if (!replies) return false\n return replies.length > MAX_COLLAPSED_REPLIES\n }, [replies])","t('list-item.go-to-field-button.aria-label')","<GhostButton\n data-ui=\"GhostButton\"\n aria-label={t('list-item.go-to-field-button.aria-label')}\n />","applyCommentIdAttr(parentComment._id)","<CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />","avatarSize","parentCommentAvatar","parentComment._system.createdBy === currentUser.sanityUserId","parentComment._state?.type === 'createError'","parentComment.context?.intent","parentComment._state?.type === 'createRetrying'","<VStack as=\"li\" {...applyCommentIdAttr(parentComment._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />\n </VStack>","showCollapseButton && collapsed && (\n <Flex gap={1} paddingY={1}>\n <SpacerAvatar />\n\n <ExpandButton\n iconRight={ChevronDownIcon}\n mode=\"bleed\"\n onClick={handleExpand}\n text={expandButtonText}\n />\n </Flex>\n )","splicedReplies.map((reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n ))","threadCommentsAvatar","currentUser.sanityUserId","(reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n )","canReply && (\n <CommentInput\n avatarSize={avatarConfig.avatarSize}\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleReplySubmit}\n placeholder={\n mode === 'upsell'\n ? t('compose.reply-placeholder-upsell')\n : t('compose.reply-placeholder')\n }\n readOnly={readOnly || mode === 'upsell'}\n ref={replyInputRef}\n value={value}\n withAvatar={avatarConfig.replyAvatar}\n />\n )","replyAvatar","<Flex\n as=\"ul\"\n padding={innerPadding}\n // Add some extra padding to the bottom if there is no reply input.\n // This is to make the UI look more balanced.\n paddingBottom={canReply ? undefined : 1}\n gap={4}\n flexDirection=\"column\"\n >\n <VStack as=\"li\" {...applyCommentIdAttr(parentComment._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />\n </VStack>\n\n {showCollapseButton && collapsed && (\n <Flex gap={1} paddingY={1}>\n <SpacerAvatar />\n\n <ExpandButton\n iconRight={ChevronDownIcon}\n mode=\"bleed\"\n onClick={handleExpand}\n text={expandButtonText}\n />\n </Flex>\n )}\n\n {splicedReplies.map((reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n ))}\n\n {canReply && (\n <CommentInput\n avatarSize={avatarConfig.avatarSize}\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleReplySubmit}\n placeholder={\n mode === 'upsell'\n ? t('compose.reply-placeholder-upsell')\n : t('compose.reply-placeholder')\n }\n readOnly={readOnly || mode === 'upsell'}\n ref={replyInputRef}\n value={value}\n withAvatar={avatarConfig.replyAvatar}\n />\n )}\n </Flex>","canReply ? undefined : 1","<StyledThreadCard\n data-active={isSelected ? 'true' : 'false'}\n data-hovered={mouseOver ? 'true' : 'false'}\n data-testid=\"comments-list-item\"\n data-ui=\"CommentsListItem\"\n onClick={handleThreadRootClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <GhostButton\n data-ui=\"GhostButton\"\n aria-label={t('list-item.go-to-field-button.aria-label')}\n />\n\n <Flex\n as=\"ul\"\n padding={innerPadding}\n // Add some extra padding to the bottom if there is no reply input.\n // This is to make the UI look more balanced.\n paddingBottom={canReply ? undefined : 1}\n gap={4}\n flexDirection=\"column\"\n >\n <VStack as=\"li\" {...applyCommentIdAttr(parentComment._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />\n </VStack>\n\n {showCollapseButton && collapsed && (\n <Flex gap={1} paddingY={1}>\n <SpacerAvatar />\n\n <ExpandButton\n iconRight={ChevronDownIcon}\n mode=\"bleed\"\n onClick={handleExpand}\n text={expandButtonText}\n />\n </Flex>\n )}\n\n {splicedReplies.map((reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n ))}\n\n {canReply && (\n <CommentInput\n avatarSize={avatarConfig.avatarSize}\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleReplySubmit}\n placeholder={\n mode === 'upsell'\n ? t('compose.reply-placeholder-upsell')\n : t('compose.reply-placeholder')\n }\n readOnly={readOnly || mode === 'upsell'}\n ref={replyInputRef}\n value={value}\n withAvatar={avatarConfig.replyAvatar}\n />\n )}\n </Flex>\n </StyledThreadCard>","isSelected ? 'true' : 'false'","mouseOver ? 'true' : 'false'"],"sources":["../src/core/comments-v2/components/CommentDeleteDialog.tsx","../src/core/comments-v2/components/avatars/SpacerAvatar.tsx","../src/core/comments-v2/utils/transform-children/linkMiddleware.tsx","../src/core/comments-v2/utils/transform-children/index.ts","../src/core/comments-v2/components/pte/CommentMessageSerializer.tsx","../src/core/comments-v2/components/icons/ReactionIcon.tsx","../src/core/comments-v2/components/reactions/EmojiText.styled.ts","../src/core/comments-v2/components/reactions/CommentReactionsMenu.tsx","../src/core/comments-v2/components/reactions/CommentReactionsMenuButton.tsx","../src/core/comments-v2/components/reactions/CommentReactionsUsersTooltip.tsx","../src/core/comments-v2/components/reactions/TransparentCard.styled.ts","../src/core/comments-v2/components/reactions/CommentReactionsBar.tsx","../src/core/comments-v2/components/list/CommentOriginBadge.tsx","../src/core/comments-v2/components/list/CommentsListItemContextMenu.tsx","../src/core/comments-v2/components/list/CommentsListItemReferencedValue.tsx","../src/core/comments-v2/components/list/CommentsListItemLayout.tsx","../src/core/comments-v2/components/list/styles.ts","../src/core/comments-v2/components/list/CommentsListItem.tsx"],"sourcesContent":["import {useCallback} from 'react'\nimport {Text, VStack} from 'ui5'\n\nimport {Dialog} from '../../../ui-components/dialog/Dialog'\nimport {TextWithTone} from '../../components/textWithTone/TextWithTone'\nimport {useTranslation} from '../../i18n/hooks/useTranslation'\nimport {type TFunction} from '../../i18n/types'\nimport {commentsLocaleNamespace} from '../i18n'\n\nfunction getDialogCopy(\n t: TFunction,\n): Record<'thread' | 'comment', {title: string; body: string; confirmButtonText: string}> {\n return {\n thread: {\n title: t('delete-thread.title'),\n body: t('delete-thread.body'),\n confirmButtonText: t('delete-thread.confirm'),\n },\n comment: {\n title: t('delete-comment.title'),\n body: t('delete-comment.body'),\n confirmButtonText: t('delete-comment.confirm'),\n },\n }\n}\n\n/**\n * @beta\n * @hidden\n */\nexport interface CommentDeleteDialogProps {\n commentId: string\n error: Error | null\n isParent: boolean\n loading: boolean\n onClose: () => void\n onConfirm: (id: string) => void\n}\n\n/**\n * @beta\n * @hidden\n */\nexport function CommentDeleteDialog(props: CommentDeleteDialogProps) {\n const {isParent, onClose, commentId, onConfirm, loading, error} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n const dialogCopy = getDialogCopy(t)\n const {title, body, confirmButtonText} = dialogCopy[isParent ? 'thread' : 'comment']\n\n const handleDelete = useCallback(() => {\n onConfirm(commentId)\n }, [commentId, onConfirm])\n\n return (\n <Dialog\n footer={{\n cancelButton: {\n onClick: onClose,\n },\n confirmButton: {\n loading,\n onClick: handleDelete,\n text: confirmButtonText,\n tone: 'critical',\n },\n }}\n header={title}\n id=\"delete-comment-dialog\"\n onClose={onClose}\n width={0}\n >\n <VStack gap={4}>\n <Text size={1} as=\"div\" trim={true}>\n {body}\n </Text>\n\n {error && <TextWithTone tone=\"critical\">{t('delete-dialog.error')}</TextWithTone>}\n </VStack>\n </Dialog>\n )\n}\n","import {type AvatarSize} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport {css, styled} from 'styled-components'\n\n/**\n * This component is used to as a spacer in situations where we want to align\n * components without avatars with components that have avatars.\n */\nexport const SpacerAvatar = styled.div<{$size?: AvatarSize}>((props) => {\n const theme = getTheme_v2(props.theme)\n const {$size = 1} = props\n return css`\n min-width: ${theme.avatar.sizes[$size]?.size}px;\n `\n})\n","import {type MouseEvent, type ReactNode} from 'react'\n\nimport {type Middleware} from './types'\n\nconst URL_REGEX = /\\b(https?:\\/\\/[^\\s,()]+(?:\\.[^\\s,()]+)*|www\\.[^\\s,()]+\\.[^\\s,()]{2,})\\b/g\n\nexport function onClick(event: MouseEvent<HTMLAnchorElement>): void {\n event.stopPropagation()\n}\n\nfunction createLinkElement(url: string): ReactNode {\n const href = url.startsWith('http') ? url : `https://${url}`\n\n return (\n <a key={url} href={href} target=\"_blank\" rel=\"noopener noreferrer\" onClick={onClick}>\n {url}\n </a>\n )\n}\n\n/**\n * Middleware that creates link elements for URLs in the text\n */\nexport const linkMiddleware: Middleware = (node) => {\n if (typeof node === 'string') {\n const parts = node.split(URL_REGEX)\n\n return parts.flatMap((part) => {\n if (part.match(URL_REGEX)) {\n return createLinkElement(part)\n }\n\n return part\n })\n }\n\n return node\n}\n","import {type ReactNode} from 'react'\n\nimport {linkMiddleware} from './linkMiddleware'\nimport {type Middleware} from './types'\n\nconst middlewares: Middleware[] = [linkMiddleware]\n\n/**\n * A function that transforms a ReactNode using a set of middlewares\n */\nexport function transformChildren(node: ReactNode): ReactNode {\n if (!Array.isArray(node)) return node\n\n return node.flatMap((item) => {\n let transformedItem: ReactNode[] = [item]\n\n for (const middleware of middlewares) {\n transformedItem = transformedItem.flatMap(middleware)\n }\n\n return transformedItem\n })\n}\n","import {PortableText, type PortableTextComponents} from '@portabletext/react'\nimport {Fragment, type PropsWithChildren, useMemo} from 'react'\nimport {css, styled} from 'styled-components'\nimport {VStack} from 'ui5'\n\nimport {type CommentMessage} from '../../types'\nimport {transformChildren} from '../../utils/transform-children'\nimport {MentionInlineBlock} from './blocks/MentionInlineBlock'\nimport {NormalBlock} from './blocks/NormalBlock'\n\nconst PortableTextWrap = styled(VStack)(() => {\n return css`\n & > [data-ui='Text']:not(:first-child) {\n margin-top: 1em; // todo: improve\n }\n\n & > [data-ui='Text']:empty {\n display: none;\n }\n `\n})\n\nconst EMPTY_ARRAY: [] = []\n\nfunction NormalBlockTransformed(props: PropsWithChildren) {\n const children = useMemo(() => transformChildren(props.children), [props.children])\n\n return <NormalBlock>{children}</NormalBlock>\n}\n\nconst components: PortableTextComponents = {\n // Since we do not offer any formatting options, we can just use the normal block for all of these.\n block: {\n normal: NormalBlockTransformed,\n h1: NormalBlockTransformed,\n h2: NormalBlockTransformed,\n h3: NormalBlockTransformed,\n h4: NormalBlockTransformed,\n h5: NormalBlockTransformed,\n h6: NormalBlockTransformed,\n blockquote: NormalBlockTransformed,\n code: NormalBlockTransformed,\n },\n\n list: {\n bullet: Fragment,\n number: Fragment,\n checkmarks: Fragment,\n },\n\n listItem: {\n bullet: NormalBlockTransformed,\n number: NormalBlockTransformed,\n checkmarks: NormalBlockTransformed,\n },\n\n // Since we do not offer any formatting options, we can just use the normal block for all of these.\n marks: {\n strong: Fragment,\n em: Fragment,\n code: Fragment,\n underline: Fragment,\n strikeThrough: Fragment,\n link: Fragment,\n },\n\n types: {\n mention: (props) => {\n return <MentionInlineBlock userId={props?.value?.userId} selected={false} />\n },\n },\n}\n\ninterface CommentMessageSerializerProps {\n blocks: CommentMessage\n}\n\n/**\n * @beta\n * @hidden\n */\nexport function CommentMessageSerializer(props: CommentMessageSerializerProps): React.JSX.Element {\n const {blocks} = props\n\n return (\n <PortableTextWrap>\n <PortableText value={blocks || EMPTY_ARRAY} components={components} />\n </PortableTextWrap>\n )\n}\n","import {type RefAttributes, type SVGProps} from 'react'\n\nexport function ReactionIcon(props: SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>) {\n const {ref, ...rest} = props\n return (\n <svg\n data-sanity-icon=\"add-reaction\"\n fill=\"none\"\n height=\"1em\"\n ref={ref}\n viewBox=\"0 0 25 25\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n d=\"M10.1044 10.4011L10.1044 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M14.2393 10.4011L14.2393 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M7.12128 14.1151C7.70803 15.0226 9.66113 16.8377 11.7735 16.8377C13.8859 16.8377 15.6713 15.0226 16.4257 14.1151\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M16.703 6.43905C15.3486 5.36511 13.6357 4.72374 11.773 4.72374C7.38731 4.72374 3.83203 8.27902 3.83203 12.6647C3.83203 17.0503 7.38731 20.6056 11.773 20.6056C16.0995 20.6056 19.618 17.1455 19.712 12.8415\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.1135 9.03425L19.1135 11.4903L20.3135 11.4903L20.3135 9.03425L22.7693 9.03425L22.7693 7.83425L20.3135 7.83425L20.3135 5.37941L19.1135 5.37941L19.1135 7.83425L16.6584 7.83425L16.6584 9.03425L19.1135 9.03425Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n","import {styled} from 'styled-components'\nimport {Text} from 'ui5'\n\nexport const EmojiText = styled(Text)`\n font-family:\n 'Twemoji Mozilla', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji',\n 'EmojiOne Color', 'Android Emoji', sans-serif;\n`\n","// oxlint-disable-next-line no-restricted-imports\nimport {Button as UIButton} from '@sanity/ui'\nimport {useCallback, useEffect, useState} from 'react'\nimport {Grid} from 'ui5'\n\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {COMMENT_REACTION_EMOJIS} from '../../constants'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentReactionOption} from '../../types'\nimport {EmojiText} from './EmojiText.styled'\n\ninterface CommentReactionsMenuProps {\n options: CommentReactionOption[]\n onSelect: (option: CommentReactionOption) => void\n}\n\nexport function CommentReactionsMenu(props: CommentReactionsMenuProps) {\n const {options, onSelect} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n const [focusedIndex, setFocusedIndex] = useState<number>(0)\n\n const handleRootKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const focusableLen = rootElement?.querySelectorAll('button').length ?? 0\n\n if (event.key === 'ArrowRight') {\n setFocusedIndex((prev) => (prev + 1) % focusableLen)\n }\n if (event.key === 'ArrowLeft') {\n setFocusedIndex((prev) => (prev - 1 + focusableLen) % focusableLen)\n }\n // if (event.key === 'ArrowDown') {\n // setFocusedIndex((prev) => (prev + GRID_COLUMNS) % focusableLen)\n // }\n // if (event.key === 'ArrowUp') {\n // setFocusedIndex((prev) => (prev - GRID_COLUMNS + focusableLen) % focusableLen)\n // }\n },\n [rootElement],\n )\n\n const handleOptionClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n const index = rootElement\n ? Array.from(rootElement.querySelectorAll('button')).indexOf(event.currentTarget)\n : -1\n setFocusedIndex(index)\n onSelect(options[index])\n },\n [rootElement, onSelect, options],\n )\n\n // Focus the button at the focused index.\n useEffect(() => {\n if (!rootElement) return\n const focusableElements = Array.from(rootElement.querySelectorAll('button'))\n if (focusableElements.length > 0) {\n focusableElements[focusedIndex].focus()\n }\n }, [focusedIndex, rootElement])\n\n return (\n <Grid\n gridTemplateColumns=\"repeat(6, minmax(0,1fr))\"\n gap={1}\n onKeyDown={handleRootKeyDown}\n ref={setRootElement}\n role=\"menu\"\n >\n {options.map((o) => {\n const emoji = COMMENT_REACTION_EMOJIS[o.shortName]\n\n return (\n <UIButton\n key={o.shortName}\n aria-label={t('reactions.react-with-aria-label', {\n reactionName: o.title || o.shortName,\n })}\n mode=\"bleed\"\n onClick={handleOptionClick}\n padding={2}\n role=\"menuitem\"\n tabIndex={-1}\n >\n <EmojiText align=\"center\" size={2} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n </UIButton>\n )\n })}\n </Grid>\n )\n}\n","import {Card, useClickOutsideEvent} from '@sanity/ui'\nimport {cloneElement, useCallback, useMemo, useRef, useState} from 'react'\n\nimport {Popover, type PopoverProps} from '../../../../ui-components/popover/Popover'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type TFunction} from '../../../i18n/types'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentReactionOption, type CommentsUIMode} from '../../types'\nimport {CommentReactionsMenu} from './CommentReactionsMenu'\n\nconst POPOVER_FALLBACK_PLACEMENTS: PopoverProps['fallbackPlacements'] = ['top', 'bottom']\n\nexport interface CommentReactionsMenuButtonProps {\n mode: CommentsUIMode\n onMenuClose?: () => void\n onMenuOpen?: () => void\n onSelect: (option: CommentReactionOption) => void\n options: CommentReactionOption[]\n readOnly?: boolean\n renderMenuButton: (props: {\n open: boolean\n tooltipContent: string\n t: TFunction\n }) => React.JSX.Element\n}\n\nexport function CommentReactionsMenuButton(props: CommentReactionsMenuButtonProps) {\n const {onMenuClose, onMenuOpen, onSelect, options, readOnly, renderMenuButton, mode} = props\n const [buttonElement, setButtonElement] = useState<HTMLButtonElement | null>(null)\n const popoverRef = useRef<HTMLDivElement | null>(null)\n\n const [open, setOpen] = useState<boolean>(false)\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const handleClick = useCallback(() => {\n const next = !open\n setOpen(next)\n\n if (next) {\n onMenuOpen?.()\n } else {\n onMenuClose?.()\n }\n }, [onMenuClose, onMenuOpen, open])\n\n const handleClose = useCallback(() => {\n if (!open) return\n\n setOpen(false)\n onMenuClose?.()\n }, [open, onMenuClose])\n\n const handleCloseAndFocus = useCallback(() => {\n if (!open) return\n\n handleClose()\n buttonElement?.focus()\n }, [buttonElement, handleClose, open])\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const {key, shiftKey} = event\n\n if ((shiftKey && key === 'Tab') || key === 'Escape' || key === 'Tab') {\n handleCloseAndFocus()\n }\n },\n [handleCloseAndFocus],\n )\n\n useClickOutsideEvent(handleClose, () => [popoverRef.current, buttonElement])\n\n const handleSelect = useCallback(\n (option: CommentReactionOption) => {\n onSelect(option)\n handleClose()\n },\n [handleClose, onSelect],\n )\n\n const button = useMemo(() => {\n // Get the button element from the renderMenuButton function.\n const btn = renderMenuButton({\n open,\n tooltipContent:\n mode === 'upsell'\n ? t('list-item.context-menu-add-reaction-upsell')\n : t('list-item.context-menu-add-reaction'),\n t,\n })\n\n // Clone the button element and add the necessary props.\n return cloneElement(btn, {\n 'aria-expanded': open,\n 'aria-haspopup': 'true',\n 'disabled': readOnly || mode === 'upsell',\n 'id': 'reactions-menu-button',\n 'onClick': handleClick,\n 'ref': setButtonElement,\n })\n }, [handleClick, open, readOnly, renderMenuButton, t, mode])\n\n const popoverContent = (\n <Card\n aria-labelledby=\"reactions-menu-button\"\n onKeyDown={handleKeyDown}\n padding={1}\n radius={3}\n tone=\"default\"\n >\n <CommentReactionsMenu onSelect={handleSelect} options={options} />\n </Card>\n )\n\n return (\n <Popover\n constrainSize\n content={popoverContent}\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n open={open}\n placement=\"bottom\"\n portal\n ref={popoverRef}\n tone=\"default\"\n >\n {button}\n </Popover>\n )\n}\n","import {type CurrentUser} from '@sanity/types'\nimport {styled} from 'styled-components'\nimport {type TextProps, Text, Box, Flex} from 'ui5'\n\nimport {Tooltip} from '../../../../ui-components/tooltip/Tooltip'\nimport {useListFormat} from '../../../hooks/useListFormat'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {Translate} from '../../../i18n/Translate'\nimport {useUser} from '../../../store/user/hooks'\nimport {COMMENT_REACTION_EMOJIS} from '../../constants'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentReactionShortNames} from '../../types'\nimport {EmojiText} from './EmojiText.styled'\n\nconst TEXT_SIZE: TextProps['size'] = 1\n\nconst ContentStack = styled(Flex)`\n max-width: 180px;\n`\n\nconst TextGroup = styled.div`\n display: inline-block;\n`\n\nconst InlineText = styled(Text).attrs({size: TEXT_SIZE})`\n display: inline-block !important;\n white-space: break-spaces;\n`\n\nconst TextBox = styled(Box)`\n line-height: 1;\n text-align: center;\n`\n\nconst LEADING_NON_WHITESPACE_RE = /^\\S+/\n\ninterface UserDisplayNameProps {\n currentUserId: string | null | undefined\n isFirst?: boolean\n userId: string\n}\n\nfunction UserDisplayName(props: UserDisplayNameProps): string {\n const {currentUserId, isFirst, userId} = props\n const [user] = useUser(userId)\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const isCurrentUser = Boolean(currentUserId) && currentUserId === userId\n if (isCurrentUser) {\n const context = isFirst ? 'leading' : undefined\n return t('reactions.user-list.you', {context, replace: {name: user?.displayName}})\n }\n\n return user?.displayName || t('reactions.user-list.unknown-user-fallback-name')\n}\n\ninterface CommentReactionsUsersTooltipProps {\n children: React.ReactNode\n currentUser: CurrentUser\n reactionName: CommentReactionShortNames\n userIds: string[]\n}\n\nexport function CommentReactionsUsersTooltip(props: CommentReactionsUsersTooltipProps) {\n const {children, ...restProps} = props\n\n return (\n <Tooltip\n content={<CommentReactionsUsersTooltipContent {...restProps} />}\n placement=\"bottom\"\n portal\n >\n <div>{children}</div>\n </Tooltip>\n )\n}\n\nfunction FormattedUserList({\n currentUserId,\n userIds,\n}: {\n currentUserId: string | null | undefined\n userIds: string[]\n}) {\n const listFormat = useListFormat({style: 'long', type: 'conjunction'})\n if (userIds.length === 0) return null\n\n /**\n * We need to do some surgery on the list: in some locales (such as en-US), the literal segments\n * can contain oxford commas, which we want to include as the part of the element preceeding it.\n * This ensures that we do not wrap to a new line that starts with a comma. In general, we should\n * not special case on _comma_ per se, but rather by the presence of a non-whitespace character.\n */\n const parts = listFormat.formatToParts(userIds)\n const elements: React.JSX.Element[] = []\n for (let i = 0; i < parts.length; i++) {\n const item = parts[i]\n\n if (item.type === 'literal') {\n // Add literals as-is - the next case will rewrite literals to exclude leading non-whitespace\n elements.push(\n <InlineText key={`literal-${i}`} forwardedAs=\"div\" trim={true}>\n {item.value}\n </InlineText>,\n )\n continue\n }\n\n const nextItem = parts[i + 1]\n const nextLeadsWithNonWhitespace =\n nextItem && nextItem.type === 'literal' && LEADING_NON_WHITESPACE_RE.test(nextItem.value)\n if (nextLeadsWithNonWhitespace) {\n // This is the 'oxford comma' case, where we want to include any leading non-whitespace from\n // the literal as trailing characters to the element we are currently adding.\n const [nonWhitespace = ''] = nextItem.value.match(LEADING_NON_WHITESPACE_RE) || []\n\n elements.push(\n // Key (value) is user ID, thus unique\n <TextGroup key={item.value}>\n <InlineText weight=\"medium\" forwardedAs=\"div\" trim={true}>\n <UserDisplayName currentUserId={currentUserId} isFirst={i === 0} userId={item.value} />\n </InlineText>\n <InlineText forwardedAs=\"div\" trim={true}>\n {nonWhitespace}\n </InlineText>\n </TextGroup>,\n )\n\n // Rewrite the next item to not contain this leading non-whitespace\n nextItem.value = nextItem.value.slice(nonWhitespace.length)\n continue\n }\n\n // Literals have been taken care of and returns early, so the only remaining case is that we're\n // in an element that does _not_ have a leading non-whitespace literal following it.\n elements.push(\n // Key (value) is user ID, thus unique\n <InlineText key={item.value} weight=\"medium\" forwardedAs=\"div\" trim={true}>\n <UserDisplayName currentUserId={currentUserId} isFirst={i === 0} userId={item.value} />\n </InlineText>,\n )\n }\n\n return elements\n}\n\ninterface ReactionTooltipComponentProps {\n children?: React.ReactNode\n currentUserId: string | null | undefined\n reactionName: CommentReactionShortNames\n userIds: string[]\n}\n\nfunction UserList({currentUserId, userIds}: ReactionTooltipComponentProps) {\n return <FormattedUserList currentUserId={currentUserId} userIds={userIds} />\n}\n\nfunction ReactionName({reactionName}: ReactionTooltipComponentProps) {\n return (\n <InlineText muted forwardedAs=\"div\" trim={true}>\n {reactionName}\n </InlineText>\n )\n}\n\nfunction ReactionText({children}: ReactionTooltipComponentProps) {\n return (\n <>\n <InlineText muted forwardedAs=\"div\" trim={true}>\n {children}\n </InlineText>{' '}\n <wbr />{' '}\n </>\n )\n}\n\nfunction CommentReactionsUsersTooltipContent(\n props: Omit<CommentReactionsUsersTooltipProps, 'children'>,\n) {\n const {currentUser, reactionName, userIds} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n\n return (\n <ContentStack padding={1} flexDirection=\"column\">\n <Flex justifyContent=\"center\" paddingBottom={2} paddingTop={1}>\n <EmojiText size={4} forwardedAs=\"div\" trim={true}>\n {COMMENT_REACTION_EMOJIS[reactionName]}\n </EmojiText>\n </Flex>\n\n <TextBox>\n <Translate\n t={t}\n i18nKey=\"reactions.users-reacted-with-reaction\"\n values={{reactionName}}\n components={{UserList, ReactionName, Text: ReactionText}}\n componentProps={{\n currentUserId: currentUser.sanityUserId,\n reactionName,\n userIds,\n }}\n />\n </TextBox>\n </ContentStack>\n )\n}\n","import {Card} from '@sanity/ui'\nimport {styled} from 'styled-components'\n\n/**\n * Returns a styled `<Card>` without a background.\n * This is a temporary workaround to force nested Sanity UI components to adhere to a specific tone (and bypass color mixing).\n *\n * TODO: consider exposing an unstable prop in Sanity UI to facilitate this.\n */\nexport const TransparentCard = styled(Card)`\n background: none;\n`\n","import {type CurrentUser} from '@sanity/types'\n// oxlint-disable-next-line no-restricted-imports\nimport {Button as UIButton} from '@sanity/ui'\nimport {memo, useCallback, useMemo, useState} from 'react'\nimport {Text, Flex, Icon} from 'ui5'\n\nimport {Tooltip} from '../../../../ui-components/tooltip/Tooltip'\nimport {TooltipDelayGroupProvider} from '../../../../ui-components/tooltipDelayGroupProvider/TooltipDelayGroupProvider'\nimport {COMMENT_REACTION_EMOJIS, COMMENT_REACTION_OPTIONS} from '../../constants'\nimport {\n type CommentReactionItem,\n type CommentReactionOption,\n type CommentReactionShortNames,\n type CommentsUIMode,\n} from '../../types'\nimport {ReactionIcon} from '../icons/ReactionIcon'\nimport {CommentReactionsMenuButton} from './CommentReactionsMenuButton'\nimport {CommentReactionsUsersTooltip} from './CommentReactionsUsersTooltip'\nimport {EmojiText} from './EmojiText.styled'\nimport {TransparentCard} from './TransparentCard.styled'\n\n/**\n * A function that groups reactions by name. For example:\n *\n * ```js\n * [\n * [':name:', [{shortName: ':name:', userId: 'user1'}, {shortName: ':name:', userId: 'user2'}],\n * [':name2:', [{shortName: ':name2:', userId: 'user1'}]\n * ]\n *```\n */\nfunction groupReactionsByName(reactions: CommentReactionItem[]) {\n const grouped = reactions.reduce(\n (acc, reaction) => {\n const {shortName} = reaction\n\n if (!acc[shortName]) {\n acc[shortName] = []\n }\n\n acc[shortName].push(reaction)\n\n return acc\n },\n {} as Record<CommentReactionShortNames, CommentReactionItem[]>,\n )\n\n // Sort based on the first appearance of the reaction in `reactions` array.\n // This is to ensure that the order of the reactions is consistent so that\n // the reactions are not jumping around when new reactions are added.\n const sorted = Object.entries(grouped).sort(([nameA], [nameB]) => {\n const indexA = reactions.findIndex((r) => r.shortName === nameA)\n const indexB = reactions.findIndex((r) => r.shortName === nameB)\n\n return indexA - indexB\n })\n\n return sorted as [CommentReactionShortNames, CommentReactionItem[]][]\n}\n\nconst renderMenuButton = ({open, tooltipContent}: {open: boolean; tooltipContent: string}) => {\n return (\n <UIButton fontSize={1} mode=\"ghost\" padding={0} radius=\"full\" selected={open}>\n <Flex paddingX={3} paddingY={2}>\n <Tooltip animate content={tooltipContent} disabled={open}>\n <Icon size={1} icon={ReactionIcon} style={{margin: '-0.375rem'}} />\n </Tooltip>\n </Flex>\n </UIButton>\n )\n}\n\ninterface CommentReactionsBarProps {\n currentUser: CurrentUser\n onSelect: (reaction: CommentReactionOption) => void\n reactions: CommentReactionItem[]\n readOnly?: boolean\n mode: CommentsUIMode\n}\n\nexport const CommentReactionsBar = memo(function CommentReactionsBar(\n props: CommentReactionsBarProps,\n) {\n const {currentUser, onSelect, reactions, readOnly, mode} = props\n const handleSelect = useCallback(\n (name: CommentReactionShortNames) => {\n const option = COMMENT_REACTION_OPTIONS.find((o) => o.shortName === name)\n\n if (option) {\n onSelect(option)\n }\n },\n [onSelect],\n )\n\n // The list of the current user's reactions, e.g. [':+1:', ':heart:']\n const currentUserReactionNames = useMemo(() => {\n return reactions.filter((r) => r.userId === currentUser?.sanityUserId).map((r) => r.shortName)\n }, [currentUser?.sanityUserId, reactions])\n\n // Reactions grouped by name, e.g. [ [':+1:', [{shortName: ':+1:', userId: 'user1'}] ] ]\n const groupedReactions = useMemo(() => {\n const grouped = groupReactionsByName(reactions)\n\n // Filter out reactions that are not in the `COMMENT_REACTION_EMOJIS` map.\n return grouped.filter(([name]) => COMMENT_REACTION_EMOJIS[name])\n }, [reactions])\n\n const [sortedGroupedReactions, setSortedGroupedReactions] = useState(() => ({\n // An array of the initial order of the reactions. This is used to sort the reactions.\n // E.g. [':+1:', ':heart:']\n sortOrder: Object.keys(Object.fromEntries(groupedReactions)),\n // We cache the groupedReactions to know when we should update the sortedReactions, ensuring we don't run into an infinite render loop.\n groupedReactions: [] as typeof groupedReactions,\n sortedReactions: [] as typeof groupedReactions,\n }))\n // Sort the reactions based on the initial order to make sure that the reactions\n // are not jumping around when new reactions are added.\n let {sortedReactions} = sortedGroupedReactions\n if (sortedGroupedReactions.groupedReactions !== groupedReactions) {\n const {sortOrder} = sortedGroupedReactions\n sortedReactions = groupedReactions.sort(([nameA], [nameB]) => {\n const indexA = sortOrder.indexOf(nameA)\n const indexB = sortOrder.indexOf(nameB)\n\n if (indexA === -1) {\n return 1\n }\n\n if (indexB === -1) {\n return -1\n }\n\n return indexA - indexB\n })\n\n setSortedGroupedReactions({\n groupedReactions,\n sortOrder: sortedReactions.map(([name]) => name),\n sortedReactions,\n })\n }\n\n return (\n <Flex alignItems=\"center\" gap={1} flexWrap=\"wrap\">\n <TooltipDelayGroupProvider>\n {sortedReactions.map(([name, reactionsList]) => {\n const hasReacted = currentUserReactionNames.includes(name)\n const userIds = reactionsList.map((r) => r.userId)\n const emoji = COMMENT_REACTION_EMOJIS[name]\n\n return (\n <CommentReactionsUsersTooltip\n key={name}\n currentUser={currentUser}\n reactionName={name}\n userIds={userIds}\n >\n <TransparentCard tone=\"default\">\n <UIButton\n disabled={readOnly || mode === 'upsell'}\n mode=\"ghost\"\n onClick={() => handleSelect(name)}\n padding={2}\n radius=\"full\"\n selected={hasReacted}\n tone={hasReacted ? 'primary' : 'default'}\n >\n <Flex alignItems=\"center\" gap={1}>\n <EmojiText size={1} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n\n <Text size={0} weight={hasReacted ? 'semibold' : 'medium'} as=\"div\" trim={true}>\n {reactionsList?.length}\n </Text>\n </Flex>\n </UIButton>\n </TransparentCard>\n </CommentReactionsUsersTooltip>\n )\n })}\n\n <TransparentCard tone=\"default\">\n <CommentReactionsMenuButton\n mode={mode}\n onSelect={(o) => handleSelect(o.shortName)}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n </TransparentCard>\n </TooltipDelayGroupProvider>\n </Flex>\n )\n})\n","import {Card, Text} from '@sanity/ui'\nimport {styled} from 'styled-components'\nimport {Flex} from 'ui5'\n\nimport {CircleSmallIcon} from '../../../components/temporary-icons/CircleSmall'\nimport {RingIcon} from '../../../components/temporary-icons/Ring'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\n\nexport type CommentOrigin = 'draft' | 'published'\n\n/**\n * Same slot as `DocumentVersionsStatusIndicator`: `@sanity/ui` Text sizes the\n * 1em glyphs and applies `--card-icon-color`. ui5 `Icon` paints\n * `--foreground-high` and drops the draft orange / published green.\n */\nconst IconSlotRoot = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n\n &[data-status='published'] {\n --card-icon-color: var(--card-badge-positive-dot-color);\n }\n &[data-status='draft'] {\n --card-icon-color: var(--card-badge-caution-dot-color);\n }\n`\n\nfunction getOriginI18nKey(origin: CommentOrigin) {\n switch (origin) {\n case 'draft':\n return 'list-item.origin.draft'\n case 'published':\n return 'list-item.origin.published'\n default:\n origin satisfies never\n return origin\n }\n}\n\nexport function CommentOriginBadge({origin}: {origin: CommentOrigin}) {\n const {t} = useTranslation(commentsLocaleNamespace)\n\n return (\n <Flex marginBottom={2}>\n <Card border padding={1} radius={3}>\n <Flex alignItems=\"center\" gap={1} paddingRight={1}>\n <IconSlotRoot data-status={origin}>\n <Text size={2}>{origin === 'draft' ? <RingIcon /> : <CircleSmallIcon />}</Text>\n </IconSlotRoot>\n\n <Text size={0} muted weight=\"medium\">\n {t(getOriginI18nKey(origin))}\n </Text>\n </Flex>\n </Card>\n </Flex>\n )\n}\n","import {CheckmarkCircleIcon} from '@sanity/icons/CheckmarkCircle'\nimport {EditIcon} from '@sanity/icons/Edit'\nimport {LinkIcon} from '@sanity/icons/Link'\nimport {TrashIcon} from '@sanity/icons/Trash'\nimport {UndoIcon} from '@sanity/icons/Undo'\nimport {Card} from '@sanity/ui'\nimport {Menu, MenuDivider} from '@sanity/ui/menu'\nimport {styled} from 'styled-components'\nimport {Flex} from 'ui5'\n\nimport {Button} from '../../../../ui-components/button/Button'\nimport {MenuButton, type MenuButtonProps} from '../../../../ui-components/menuButton/MenuButton'\nimport {MenuItem} from '../../../../ui-components/menuItem/MenuItem'\nimport {TooltipDelayGroupProvider} from '../../../../ui-components/tooltipDelayGroupProvider/TooltipDelayGroupProvider'\nimport {ContextMenuButton} from '../../../components/contextMenuButton/ContextMenuButton'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type TFunction} from '../../../i18n/types'\nimport {COMMENT_REACTION_OPTIONS} from '../../constants'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentReactionOption, type CommentStatus, type CommentsUIMode} from '../../types'\nimport {ReactionIcon} from '../icons/ReactionIcon'\nimport {CommentReactionsMenuButton} from '../reactions/CommentReactionsMenuButton'\n\nconst renderMenuButton = ({\n open,\n tooltipContent,\n t,\n}: {\n open: boolean\n tooltipContent: string\n t: TFunction\n}) => (\n <Button\n aria-label={t('list-item.context-menu-add-reaction-aria-label')}\n icon={ReactionIcon}\n mode=\"bleed\"\n selected={open}\n tooltipProps={{content: tooltipContent}}\n />\n)\n\nconst POPOVER_PROPS: MenuButtonProps['popover'] = {\n placement: 'bottom-end',\n}\n\nconst FloatingCard = styled(Card)`\n &:empty {\n display: none;\n }\n`\n\ninterface CommentsListItemContextMenuProps {\n canDelete: boolean | undefined\n canEdit: boolean | undefined\n isParent: boolean | undefined\n mode: CommentsUIMode\n onCopyLink?: () => void\n onDeleteStart?: () => void\n onEditStart?: () => void\n onMenuClose?: () => void\n onMenuOpen?: () => void\n onReactionSelect?: (option: CommentReactionOption) => void\n onStatusChange?: () => void\n readOnly?: boolean\n status: CommentStatus\n}\n\nexport function CommentsListItemContextMenu(props: CommentsListItemContextMenuProps) {\n const {\n canDelete,\n canEdit,\n isParent,\n mode,\n onCopyLink,\n onDeleteStart,\n onEditStart,\n onMenuClose,\n onMenuOpen,\n onReactionSelect,\n onStatusChange,\n readOnly,\n status,\n } = props\n\n const showMenuButton = Boolean(onCopyLink || onDeleteStart || onEditStart)\n\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const hasContextMenuOptions = Boolean(canDelete || canEdit || onCopyLink)\n return (\n <TooltipDelayGroupProvider>\n <Flex>\n <FloatingCard display=\"flex\" shadow={2} padding={1} radius={2} sizing=\"border\">\n {onReactionSelect && (\n <CommentReactionsMenuButton\n mode={mode}\n onMenuClose={onMenuClose}\n onMenuOpen={onMenuOpen}\n onSelect={onReactionSelect}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n )}\n\n {isParent && onStatusChange && (\n <Button\n aria-label={\n status === 'open'\n ? t('list-item.resolved-tooltip-aria-label')\n : t('list-item.re-open-resolved-aria-label')\n }\n data-testid=\"comments-list-item-status-button\"\n disabled={readOnly}\n icon={status === 'open' ? CheckmarkCircleIcon : UndoIcon}\n mode=\"bleed\"\n onClick={onStatusChange}\n tooltipProps={{\n content:\n status === 'open'\n ? t('list-item.resolved-tooltip-content')\n : t('list-item.re-open-resolved'),\n }}\n />\n )}\n\n {hasContextMenuOptions && (\n <MenuButton\n id=\"comment-actions-menu\"\n button={\n <ContextMenuButton\n aria-label={t('list-item.open-menu-aria-label')}\n disabled={readOnly}\n hidden={!showMenuButton}\n />\n }\n onOpen={onMenuOpen}\n onClose={onMenuClose}\n menu={\n <Menu>\n <MenuItem\n hidden={!canEdit}\n icon={EditIcon}\n onClick={onEditStart}\n text={t('list-item.edit-comment')}\n tooltipProps={\n mode === 'upsell' ? {content: t('list-item.edit-comment-upsell')} : undefined\n }\n disabled={mode === 'upsell'}\n />\n\n <MenuItem\n hidden={!canDelete}\n icon={TrashIcon}\n onClick={onDeleteStart}\n text={t('list-item.delete-comment')}\n tone=\"critical\"\n />\n\n {onCopyLink && <MenuDivider hidden={!canDelete && !canEdit} />}\n\n <MenuItem\n hidden={!onCopyLink}\n icon={LinkIcon}\n onClick={onCopyLink}\n text={t('list-item.copy-link')}\n />\n </Menu>\n }\n popover={POPOVER_PROPS}\n />\n )}\n </FloatingCard>\n </Flex>\n </TooltipDelayGroupProvider>\n )\n}\n","import {toPlainText} from '@portabletext/react'\nimport {hues} from '@sanity/color'\nimport {LinkRemovedIcon} from '@sanity/icons/LinkRemoved'\nimport {isPortableTextTextBlock} from '@sanity/types'\nimport {type Theme} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport {css, styled} from 'styled-components'\nimport {Text, Box, Flex, Icon} from 'ui5'\n\nimport {Tooltip} from '../../../../ui-components/tooltip/Tooltip'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {COMMENTS_HIGHLIGHT_HUE_KEY} from '../../constants'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentDocument} from '../../types'\n\nfunction truncate(str: string, length = 250) {\n if (str.length <= length) return str\n return `${str.slice(0, length)}...`\n}\n\ninterface BlockQuoteStackProps {\n $hasReferencedValue: boolean\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n theme: Theme\n}\n\nconst InlineBox = styled(Box).attrs({marginLeft: 1, marginRight: 2})`\n &:not([data-hidden]) {\n display: inline;\n }\n`\n\nconst BlockQuoteStack = styled(Flex)<BlockQuoteStackProps>(({theme, $hasReferencedValue}) => {\n const isDark = theme.sanity.v2?.color._dark\n\n const hue = $hasReferencedValue ? COMMENTS_HIGHLIGHT_HUE_KEY : 'gray'\n const borderColor = isDark ? hues[hue][700].hex : hues[hue][300].hex\n\n return css`\n border-left: 2px solid ${borderColor};\n word-break: break-word;\n `\n})\n\ninterface CommentsListItemReferencedValueProps {\n hasReferencedValue: boolean | undefined\n value: CommentDocument['contentSnapshot']\n}\n\nexport function CommentsListItemReferencedValue(props: CommentsListItemReferencedValueProps) {\n const {hasReferencedValue, value} = props\n\n const {t} = useTranslation(commentsLocaleNamespace)\n const tooltipText = t('list-item.missing-referenced-value-tooltip-content')\n\n const resolvedValue = useMemo(() => {\n if (Array.isArray(value) && value?.filter(isPortableTextTextBlock).length > 0) {\n const text = value?.map(toPlainText).join(' ')\n const truncated = truncate(text)\n\n return truncated\n }\n\n return null\n }, [value])\n\n if (!resolvedValue) return null\n\n return (\n <BlockQuoteStack\n $hasReferencedValue={Boolean(hasReferencedValue)}\n data-testid=\"comments-list-item-referenced-value\"\n flexBasis=\"0%\"\n flexGrow={1}\n flexDirection=\"column\"\n forwardedAs=\"blockquote\"\n padding={1}\n paddingLeft={2}\n >\n <Flex alignItems=\"flex-start\">\n <Text size={1} muted as=\"div\" trim={true}>\n {!hasReferencedValue && (\n <Tooltip content={tooltipText}>\n <InlineBox>\n <Icon size={1} icon={LinkRemovedIcon} style={{margin: '-0.375rem'}} />\n </InlineBox>\n </Tooltip>\n )}\n\n {resolvedValue}\n </Text>\n </Flex>\n </BlockQuoteStack>\n )\n}\n","import {hues} from '@sanity/color'\nimport {type CurrentUser} from '@sanity/types'\nimport {type AvatarSize, Card, TextSkeleton, useClickOutsideEvent} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport {useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport {IntentLink} from 'sanity/router'\nimport {css, styled} from 'styled-components'\nimport {Text, Box, Flex, VStack} from 'ui5'\n\nimport {useDidUpdate} from '../../../form/hooks/useDidUpdate'\nimport {useDateTimeFormat} from '../../../hooks/useDateTimeFormat'\nimport {type RelativeTimeOptions, useRelativeTime} from '../../../hooks/useRelativeTime'\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {Translate} from '../../../i18n/Translate'\nimport {useUser} from '../../../store/user/hooks'\nimport {isDraftId, isPublishedId} from '../../../util/draftUtils'\nimport {hasCommentMessageValue, isTextSelectionComment, useCommentHasChanged} from '../../helpers'\nimport {useComments} from '../../hooks/useComments'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {\n type CommentContext,\n type CommentDocument,\n type CommentMessage,\n type CommentReactionOption,\n type CommentStatus,\n type CommentsUIMode,\n type CommentUpdatePayload,\n} from '../../types'\nimport {CommentsAvatar} from '../avatars/CommentsAvatar'\nimport {SpacerAvatar} from '../avatars/SpacerAvatar'\nimport {FLEX_GAP} from '../constants'\nimport {CommentInput, type CommentInputHandle} from '../pte/comment-input/CommentInput'\nimport {CommentMessageSerializer} from '../pte/CommentMessageSerializer'\nimport {CommentReactionsBar} from '../reactions/CommentReactionsBar'\nimport {type CommentOrigin, CommentOriginBadge} from './CommentOriginBadge'\nimport {CommentsListItemContextMenu} from './CommentsListItemContextMenu'\nimport {CommentsListItemReferencedValue} from './CommentsListItemReferencedValue'\n\nconst stopPropagation = (e: React.MouseEvent<HTMLDivElement>) => e.stopPropagation()\n\nfunction CommentIntentLink({\n children,\n intent,\n}: {\n children?: React.ReactNode\n intent?: CommentContext['intent']\n}) {\n if (!intent) return null\n return (\n <IntentLink params={intent.params} intent={intent.name}>\n {children}\n </IntentLink>\n )\n}\n\nconst ContextMenuBox = styled(Box)``\n\nconst SKELETON_INLINE_STYLE: React.CSSProperties = {width: '50%'}\n\nconst EMPTY_ARRAY: [] = []\n\nconst TimeText = styled(Text)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const isDark = theme.sanity.color.dark\n const fg = hues.gray[isDark ? 200 : 800].hex\n\n return css`\n min-width: max-content;\n --card-fg-color: ${fg};\n color: var(--card-fg-color);\n `\n})\n\nconst HeaderFlex = styled(Flex)<{$size: AvatarSize}>((props) => {\n const theme = getTheme_v2(props.theme)\n\n return css`\n min-height: ${theme.avatar.sizes[props.$size]?.size}px;\n `\n})\n\nconst IntentText = styled(Text)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const isDark = theme.sanity.color.dark\n const fg = hues.gray[isDark ? 200 : 800].hex\n\n return css`\n --card-fg-color: ${fg};\n color: var(--card-fg-color);\n `\n})\n\nconst InnerStack = styled(VStack)`\n transition: opacity 200ms ease;\n\n &[data-muted='true'] {\n transition: unset;\n opacity: 0.5;\n }\n`\n\nconst ErrorFlex = styled(Flex)<{$size: AvatarSize}>((props) => {\n const theme = getTheme_v2(props.theme)\n\n return css`\n min-height: ${theme.avatar.sizes[props.$size]?.size}px;\n `\n})\n\nconst RetryCardButton = styled(Card)`\n /* Add not on hover */\n &:not(:hover) {\n background-color: transparent;\n }\n`\n\nconst RootStack = styled(VStack)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {space} = theme.sanity\n\n return css`\n position: relative;\n\n /* Only show the floating layer on hover when hover is supported.\n Else, the layer is always visible. */\n @media (hover: hover) {\n ${ContextMenuBox} {\n opacity: 0;\n position: absolute;\n right: 0;\n top: 0;\n transform: translate(${space[1]}px, -${space[1]}px);\n }\n\n ${ContextMenuBox} {\n &:focus-within {\n opacity: 1;\n }\n }\n\n &:hover {\n ${ContextMenuBox} {\n opacity: 1;\n }\n }\n }\n\n &[data-menu-open='true'] {\n ${ContextMenuBox} {\n opacity: 1;\n }\n }\n `\n})\n\ninterface CommentsListItemLayoutProps {\n avatarSize?: AvatarSize\n canDelete?: boolean\n canEdit?: boolean\n comment: CommentDocument\n currentUser: CurrentUser\n hasError?: boolean\n hasReferencedValue?: boolean\n intent?: CommentContext['intent']\n isParent?: boolean\n isRetrying?: boolean\n mentionOptions: UserListWithPermissionsHookValue\n mode: CommentsUIMode\n onCopyLink?: (id: string) => void\n onCreateRetry?: (id: string) => void\n onDelete: (id: string) => void\n onEdit: (id: string, message: CommentUpdatePayload) => void\n onInputKeyDown?: (event: React.KeyboardEvent) => void\n onReactionSelect?: (id: string, reaction: CommentReactionOption) => void\n onStatusChange?: (id: string, status: CommentStatus) => void\n readOnly?: boolean\n withAvatar?: boolean\n}\n\n/**\n * The document a comment was made on, when that isn't the document being viewed.\n * Only draft vs published: versions and other ids return `null`.\n */\nexport function getForeignCommentOrigin(\n comment: CommentDocument,\n versionId: string | undefined,\n): CommentOrigin | null {\n const source = comment.target?.sourceDocumentId\n if (!source || !versionId || source === versionId) return null\n if (!(isDraftId(source) || isPublishedId(source))) return null\n if (!(isDraftId(versionId) || isPublishedId(versionId))) return null\n return isDraftId(source) ? 'draft' : 'published'\n}\n\nconst RELATIVE_TIME_OPTIONS: RelativeTimeOptions = {useTemporalPhrase: true}\n\nexport function CommentsListItemLayout(props: CommentsListItemLayoutProps) {\n const {\n avatarSize = 1,\n canDelete,\n canEdit,\n comment,\n currentUser,\n hasError,\n hasReferencedValue,\n intent,\n isParent,\n isRetrying,\n mentionOptions,\n mode,\n onCopyLink,\n onCreateRetry,\n onDelete,\n onEdit,\n onInputKeyDown,\n onReactionSelect,\n onStatusChange,\n readOnly,\n withAvatar = true,\n } = props\n const {_createdAt, message, _id, lastEditedAt} = comment\n const authorId = comment._system.createdBy\n const [user] = useUser(authorId)\n const {t} = useTranslation(commentsLocaleNamespace)\n const {versionId} = useComments()\n const foreignOrigin = isParent ? getForeignCommentOrigin(comment, versionId) : null\n\n const [value, setValue] = useState<CommentMessage>(message)\n const [isEditing, setIsEditing] = useState<boolean>(false)\n const rootElementRef = useRef<HTMLDivElement | null>(null)\n const startMessage = useRef<CommentMessage>(message)\n const [menuOpen, setMenuOpen] = useState<boolean>(false)\n\n const commentInputRef = useRef<CommentInputHandle>(null)\n\n const hasChanges = useCommentHasChanged(value)\n const hasValue = useMemo(() => hasCommentMessageValue(value), [value])\n\n // Filter out reactions that's been optimistically removed from the comment.\n const reactions = (\n comment?.reactions?.filter((r) => r?._optimisticState !== 'removed') || EMPTY_ARRAY\n ).filter((r) => {\n // Filter out reactions that might have to incorrect format\n return 'userId' in r && 'shortName' in r\n })\n\n const hasReactions = Boolean(reactions?.length)\n\n const createdDate = _createdAt ? new Date(_createdAt) : new Date()\n const editedDate = lastEditedAt ? new Date(lastEditedAt) : null\n const createdTimeAgo = useRelativeTime(createdDate, RELATIVE_TIME_OPTIONS)\n const dateTimeFormat = useDateTimeFormat({\n dateStyle: 'full',\n timeStyle: 'medium',\n })\n const formattedCreatedAt = dateTimeFormat.format(createdDate)\n const formattedLastEditAt = editedDate ? dateTimeFormat.format(editedDate) : null\n const displayError = hasError || isRetrying\n\n // If the message has changed we need to update the value in the state\n // so that, when the user starts editing, the input is populated with the\n // latest message value.\n useEffect(() => {\n if (isEditing) return\n\n startMessage.current = message\n // oxlint-disable-next-line react/set-state-in-effect -- pre-existing violation, to be fixed in a follow-up\n setValue(message)\n }, [isEditing, message])\n\n const handleMenuOpen = useCallback(() => setMenuOpen(true), [])\n const handleMenuClose = useCallback(() => setMenuOpen(false), [])\n const handleCopyLink = useCallback(() => onCopyLink?.(_id), [_id, onCopyLink])\n const handleCreateRetry = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation()\n onCreateRetry?.(_id)\n },\n [_id, onCreateRetry],\n )\n const handleDelete = useCallback(() => onDelete(_id), [_id, onDelete])\n\n const cancelEdit = useCallback(() => {\n setIsEditing(false)\n setValue(startMessage.current)\n }, [])\n\n const startDiscard = useCallback(() => {\n if (!hasValue || !hasChanges) {\n cancelEdit()\n return\n }\n commentInputRef.current?.discardDialogController.open()\n }, [cancelEdit, hasChanges, hasValue])\n\n const handleInputKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard the input text\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n // Call parent handler\n if (onInputKeyDown) onInputKeyDown(event)\n },\n [onInputKeyDown, startDiscard],\n )\n\n const cancelDiscard = useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n }, [])\n\n const confirmDiscard = useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n cancelEdit()\n }, [cancelEdit])\n\n const handleReactionSelect = useCallback(\n (reaction: CommentReactionOption) => {\n onReactionSelect?.(_id, reaction)\n },\n [_id, onReactionSelect],\n )\n\n const handleEditSubmit = useCallback(\n (nextValue: CommentMessage) => {\n onEdit(_id, {message: nextValue})\n setIsEditing(false)\n },\n [_id, onEdit],\n )\n\n const handleOpenStatusChange = useCallback(() => {\n onStatusChange?.(_id, comment.status === 'open' ? 'resolved' : 'open')\n }, [_id, comment.status, onStatusChange])\n\n const toggleEdit = useCallback(() => {\n setIsEditing((v) => !v)\n }, [])\n\n const handleCloseMenu = useCallback(() => setMenuOpen(false), [])\n\n const handleRootKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && !hasChanges) {\n cancelEdit()\n }\n },\n [cancelEdit, hasChanges],\n )\n\n useDidUpdate(isEditing, handleCloseMenu)\n\n useClickOutsideEvent(!hasChanges && cancelEdit, () => [rootElementRef.current])\n\n const name = user?.displayName ? (\n <Text size={1} weight=\"medium\" truncate={1} title={user.displayName} as=\"div\" trim={true}>\n {user.displayName}\n </Text>\n ) : (\n <TextSkeleton size={1} style={SKELETON_INLINE_STYLE} />\n )\n\n return (\n <RootStack\n data-menu-open={menuOpen ? 'true' : 'false'}\n data-testid=\"comments-list-item-layout\"\n onKeyDown={handleRootKeyDown}\n ref={rootElementRef}\n gap={4}\n >\n <InnerStack gap={1} data-muted={displayError}>\n {foreignOrigin && <CommentOriginBadge origin={foreignOrigin} />}\n\n <HeaderFlex\n alignItems=\"center\"\n gap={FLEX_GAP}\n flexBasis=\"0%\"\n flexGrow={1}\n $size={avatarSize}\n >\n {withAvatar && <CommentsAvatar user={user} size={avatarSize} />}\n\n <Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>\n\n {!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )}\n </HeaderFlex>\n\n {isTextSelectionComment(comment) && Boolean(comment?.contentSnapshot) && (\n <Flex gap={FLEX_GAP} marginBottom={3}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentsListItemReferencedValue\n hasReferencedValue={hasReferencedValue}\n value={comment?.contentSnapshot}\n />\n </Flex>\n )}\n\n {isEditing && (\n <Flex alignItems=\"flex-start\" gap={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex flexBasis=\"0%\" flexGrow={1} flexDirection=\"column\">\n <CommentInput\n currentUser={currentUser}\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleEditSubmit}\n readOnly={readOnly}\n ref={commentInputRef}\n value={value}\n withAvatar={false}\n />\n </Flex>\n </Flex>\n )}\n\n {!isEditing && (\n <Flex gap={FLEX_GAP}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentMessageSerializer blocks={message} />\n </Flex>\n )}\n\n {hasReactions && (\n <Flex gap={FLEX_GAP} marginTop={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Box onClick={stopPropagation}>\n <CommentReactionsBar\n currentUser={currentUser}\n mode={mode}\n onSelect={handleReactionSelect}\n reactions={reactions}\n readOnly={readOnly}\n />\n </Box>\n </Flex>\n )}\n </InnerStack>\n\n {displayError && (\n <ErrorFlex gap={FLEX_GAP} $size={avatarSize}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex alignItems=\"center\" gap={1} flexBasis=\"0%\" flexGrow={1}>\n <Text muted size={1} as=\"div\" trim={true}>\n {hasError && t('list-item.layout-failed-sent')}\n {isRetrying && t('list-item.layout-posting')}\n </Text>\n\n <Flex hidden={isRetrying}>\n <RetryCardButton\n __unstable_focusRing\n display=\"flex\"\n forwardedAs=\"button\"\n onClick={handleCreateRetry}\n padding={1}\n radius={2}\n tone=\"primary\"\n >\n <Text size={1} muted as=\"div\" trim={true}>\n {t('list-item.layout-retry')}\n </Text>\n </RetryCardButton>\n </Flex>\n </Flex>\n </ErrorFlex>\n )}\n </RootStack>\n )\n}\n","import {hues} from '@sanity/color'\nimport {Card} from '@sanity/ui'\nimport {css, styled} from 'styled-components'\n\nimport {COMMENTS_HIGHLIGHT_HUE_KEY} from '../../constants'\n\nexport const ThreadCard = styled(Card).attrs({padding: 3, radius: 3, sizing: 'border'})((props) => {\n const {theme} = props\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const isDark = theme.sanity.color.dark\n const activeBg = hues[COMMENTS_HIGHLIGHT_HUE_KEY][isDark ? 900 : 50].hex\n const defaultBg = hues.gray[isDark ? 900 : 50].hex\n\n return css`\n background-color: ${defaultBg};\n\n &[data-active='true'] {\n background-color: ${activeBg};\n }\n `\n})\n","import {ChevronDownIcon} from '@sanity/icons/ChevronDown'\nimport {type CurrentUser} from '@sanity/types'\nimport {type AvatarSize, useLayer} from '@sanity/ui'\nimport {\n type KeyboardEvent,\n memo,\n type MouseEvent,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport {css, styled} from 'styled-components'\nimport {type PaddingProps, Flex, VStack} from 'ui5'\n\nimport {Button} from '../../../../ui-components/button/Button'\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type CommentsSelectedPath} from '../../context/selected-path/types'\nimport {commentIntentIfDiffers, hasCommentMessageValue} from '../../helpers'\nimport {applyCommentIdAttr} from '../../hooks/useCommentsScroll'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {\n type CommentBaseCreatePayload,\n type CommentDocument,\n type CommentMessage,\n type CommentReactionOption,\n type CommentStatus,\n type CommentsUIMode,\n type CommentUpdatePayload,\n} from '../../types'\nimport {SpacerAvatar} from '../avatars/SpacerAvatar'\nimport {CommentInput, type CommentInputHandle} from '../pte/comment-input/CommentInput'\nimport {CommentsListItemLayout} from './CommentsListItemLayout'\nimport {ThreadCard} from './styles'\n\nconst EMPTY_ARRAY: [] = []\n\nconst MAX_COLLAPSED_REPLIES = 5\n\nconst DEFAULT_AVATAR_CONFIG: CommentsListItemProps['avatarConfig'] = {\n avatarSize: 1,\n parentCommentAvatar: true,\n replyAvatar: true,\n threadCommentsAvatar: true,\n}\n\n// data-active = when the comment is selected\n// data-hovered = when the mouse is over the comment\nconst StyledThreadCard = styled(ThreadCard)(() => {\n return css`\n position: relative;\n\n &:has(> [data-ui='GhostButton']:focus:focus-visible) {\n box-shadow:\n inset 0 0 0 1px var(--card-border-color),\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 2px var(--card-focus-ring-color);\n }\n\n // The hover styles is managed with the [data-hovered] attribute instead of the :hover pseudo class\n // since we want to show the hover styles when hovering over the menu items in the context menu as well.\n // The context menu is rendered using a portal, so the :hover pseudo class won't work when hovering over\n // the menu items.\n &:not([data-active='true']) {\n @media (hover: hover) {\n &[data-hovered='true'] {\n [data-root-menu='true'] {\n opacity: 1;\n }\n }\n }\n }\n `\n})\n\nconst ExpandButton = styled(Button)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {medium} = theme.sanity.fonts.text.weights\n\n return css`\n font-weight: ${medium};\n `\n})\n\nconst GhostButton = styled.button`\n opacity: 0;\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n left: 0;\n`\n\nexport interface CommentsListItemProps {\n avatarConfig?: {\n avatarSize: AvatarSize\n parentCommentAvatar: boolean\n replyAvatar: boolean\n threadCommentsAvatar: boolean\n }\n canReply?: boolean\n currentUser: CurrentUser\n hasReferencedValue?: boolean\n innerPadding?: PaddingProps['padding']\n isSelected: boolean\n mentionOptions: UserListWithPermissionsHookValue\n mode: CommentsUIMode\n onCopyLink?: (id: string) => void\n onCreateRetry: (id: string) => void\n onDelete: (id: string) => void\n onEdit: (id: string, payload: CommentUpdatePayload) => void\n onKeyDown?: (event: KeyboardEvent) => void\n onPathSelect?: (nextPath: CommentsSelectedPath) => void\n onReactionSelect?: (id: string, reaction: CommentReactionOption) => void\n onReply: (payload: CommentBaseCreatePayload) => void\n onStatusChange?: (id: string, status: CommentStatus) => void\n parentComment: CommentDocument\n readOnly?: boolean\n replies: CommentDocument[] | undefined\n}\n\nexport const CommentsListItem = memo(function CommentsListItem(props: CommentsListItemProps) {\n const {\n avatarConfig = DEFAULT_AVATAR_CONFIG,\n canReply,\n currentUser,\n hasReferencedValue,\n innerPadding,\n isSelected,\n mentionOptions,\n mode,\n onCopyLink,\n onCreateRetry,\n onDelete,\n onEdit,\n onKeyDown,\n onPathSelect,\n onReactionSelect,\n onReply,\n onStatusChange,\n parentComment,\n readOnly,\n replies = EMPTY_ARRAY,\n } = props\n const {t} = useTranslation(commentsLocaleNamespace)\n const [value, setValue] = useState<CommentMessage>(EMPTY_ARRAY)\n const [collapsed, setCollapsed] = useState<boolean>(true)\n const replyInputRef = useRef<CommentInputHandle>(null)\n\n const {isTopLayer} = useLayer()\n\n const hasValue = useMemo(() => hasCommentMessageValue(value), [value])\n\n const [mouseOver, setMouseOver] = useState<boolean>(false)\n\n const handleMouseEnter = () => setMouseOver(true)\n const handleMouseLeave = () => setMouseOver(false)\n\n const handleReplySubmit = (nextValue: CommentMessage) => {\n const nextComment: CommentBaseCreatePayload = {\n message: nextValue,\n parentCommentId: parentComment._id,\n status: parentComment?.status || 'open',\n // Since this is a reply to an existing comment, we use the same thread ID as the parent\n threadId: parentComment.threadId,\n // A new comment will not have any reactions\n reactions: EMPTY_ARRAY,\n\n payload: {\n fieldPath: parentComment.target.path?.field || '',\n },\n }\n\n onReply?.(nextComment)\n setValue(EMPTY_ARRAY)\n }\n\n const startDiscard = useCallback(() => {\n if (!hasValue) {\n setValue(EMPTY_ARRAY)\n return\n }\n\n replyInputRef.current?.discardDialogController.open()\n }, [hasValue])\n\n const handleInputKeyDown = useCallback(\n (event: KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard input text with Escape\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n },\n [startDiscard],\n )\n\n const cancelDiscard = useCallback(() => {\n replyInputRef.current?.discardDialogController.close()\n }, [])\n\n const confirmDiscard = useCallback(() => {\n setValue(EMPTY_ARRAY)\n replyInputRef.current?.discardDialogController.close()\n replyInputRef.current?.focus()\n }, [])\n\n const handleThreadRootClick = useCallback(\n (e: MouseEvent<HTMLDivElement>) => {\n e.stopPropagation()\n\n // Don't act if the click was caused by clicking\n // outside e.g. a popover or a menu\n if (!isTopLayer) return\n\n onPathSelect?.({\n fieldPath: parentComment.target.path?.field || '',\n origin: 'inspector',\n threadId: parentComment.threadId,\n })\n },\n [isTopLayer, onPathSelect, parentComment.target.path?.field, parentComment.threadId],\n )\n\n const handleExpand = useCallback((e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n setCollapsed(false)\n }, [])\n\n const splicedReplies = useMemo(() => {\n if (collapsed) return replies?.slice(-MAX_COLLAPSED_REPLIES)\n return replies\n }, [replies, collapsed])\n\n const showCollapseButton = useMemo(() => {\n if (!replies) return false\n return replies.length > MAX_COLLAPSED_REPLIES\n }, [replies])\n\n const expandButtonText = `${replies?.length - MAX_COLLAPSED_REPLIES} more ${\n replies?.length - MAX_COLLAPSED_REPLIES === 1 ? 'comment' : 'comments'\n }`\n\n return (\n <StyledThreadCard\n data-active={isSelected ? 'true' : 'false'}\n data-hovered={mouseOver ? 'true' : 'false'}\n data-testid=\"comments-list-item\"\n data-ui=\"CommentsListItem\"\n onClick={handleThreadRootClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <GhostButton\n data-ui=\"GhostButton\"\n aria-label={t('list-item.go-to-field-button.aria-label')}\n />\n\n <Flex\n as=\"ul\"\n padding={innerPadding}\n // Add some extra padding to the bottom if there is no reply input.\n // This is to make the UI look more balanced.\n paddingBottom={canReply ? undefined : 1}\n gap={4}\n flexDirection=\"column\"\n >\n <VStack as=\"li\" {...applyCommentIdAttr(parentComment._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />\n </VStack>\n\n {showCollapseButton && collapsed && (\n <Flex gap={1} paddingY={1}>\n <SpacerAvatar />\n\n <ExpandButton\n iconRight={ChevronDownIcon}\n mode=\"bleed\"\n onClick={handleExpand}\n text={expandButtonText}\n />\n </Flex>\n )}\n\n {splicedReplies.map((reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n ))}\n\n {canReply && (\n <CommentInput\n avatarSize={avatarConfig.avatarSize}\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleReplySubmit}\n placeholder={\n mode === 'upsell'\n ? t('compose.reply-placeholder-upsell')\n : t('compose.reply-placeholder')\n }\n readOnly={readOnly || mode === 'upsell'}\n ref={replyInputRef}\n value={value}\n withAvatar={avatarConfig.replyAvatar}\n />\n )}\n </Flex>\n </StyledThreadCard>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,cACP,GACwF;CACxF,OAAO;EACL,QAAQ;GACN,OAAO,EAAE,qBAAqB;GAC9B,MAAM,EAAE,oBAAoB;GAC5B,mBAAmB,EAAE,uBAAuB;EAC9C;EACA,SAAS;GACP,OAAO,EAAE,sBAAsB;GAC/B,MAAM,EAAE,qBAAqB;GAC7B,mBAAmB,EAAE,wBAAwB;EAC/C;CACF;AACF;;;;;AAmBA,SAA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BCC;GAaAC;GAyBAI;EAsBG;KA7FK,EAAA,MAAA,cAGMG,EAAAA,OAAAA,KAIfT,EAAAA,OAAAA,KA0BCC,EAAAA,OAAAA,KAaAC,EAAAA,OAAAA,KAyBAI,EAAAA,OAAAA;CAvFLI,IAAAA;CADF,OAMa,EAAA,SAAA,yBAAA,EAAA,SAJIC,OAAAA,EAAAA,SACCC,OAAAA,EAAAA,SAOdrB,OAAAA,EAAAA,SAKAiB,OAdF,MAAA,qBAAC,kBAAD;EACE,eAAaG;EACb,gBAAcC;EACd,eAAY;EACZ,WAAQ;EACR,SAAS;EACT,cAAc;EACd,cAAc;EAPhB,UAAA,CASErB,KAKAiB,GAgGgB;KAzGP,EAAA,OAAA,uBAJIG,EAAAA,OAAAA,KACCC,EAAAA,OAAAA,KAOdrB,EAAAA,OAAAA,KAKAiB,EAAAA,OAAAA,mCAdFE;AAgHJ,CAAC"}
1
+ {"version":3,"file":"CommentsListItem-QyYan1DB.js","names":["getDialogCopy(t)","() => {\n onConfirm(commentId)\n }","useCallback(() => {\n onConfirm(commentId)\n }, [commentId, onConfirm])","{\n onClick: onClose,\n }","{\n loading,\n onClick: handleDelete,\n text: confirmButtonText,\n tone: 'critical',\n }","{\n cancelButton: {\n onClick: onClose,\n },\n confirmButton: {\n loading,\n onClick: handleDelete,\n text: confirmButtonText,\n tone: 'critical',\n },\n }","<Text size={1} as=\"div\" trim={true}>\n {body}\n </Text>","error && <TextWithTone tone=\"critical\">{t('delete-dialog.error')}</TextWithTone>","<VStack gap={4}>\n <Text size={1} as=\"div\" trim={true}>\n {body}\n </Text>\n\n {error && <TextWithTone tone=\"critical\">{t('delete-dialog.error')}</TextWithTone>}\n </VStack>","<Dialog\n footer={{\n cancelButton: {\n onClick: onClose,\n },\n confirmButton: {\n loading,\n onClick: handleDelete,\n text: confirmButtonText,\n tone: 'critical',\n },\n }}\n header={title}\n id=\"delete-comment-dialog\"\n onClose={onClose}\n width={0}\n >\n <VStack gap={4}>\n <Text size={1} as=\"div\" trim={true}>\n {body}\n </Text>\n\n {error && <TextWithTone tone=\"critical\">{t('delete-dialog.error')}</TextWithTone>}\n </VStack>\n </Dialog>","transformChildren(props.children)","children","useMemo(() => transformChildren(props.children), [props.children])","<NormalBlock>{children}</NormalBlock>","<PortableTextWrap>\n <PortableText value={blocks || EMPTY_ARRAY} components={components} />\n </PortableTextWrap>","blocks || EMPTY_ARRAY","<path\n d=\"M10.1044 10.4011L10.1044 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />","<path\n d=\"M14.2393 10.4011L14.2393 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />","<path\n d=\"M7.12128 14.1151C7.70803 15.0226 9.66113 16.8377 11.7735 16.8377C13.8859 16.8377 15.6713 15.0226 16.4257 14.1151\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />","<path\n d=\"M16.703 6.43905C15.3486 5.36511 13.6357 4.72374 11.773 4.72374C7.38731 4.72374 3.83203 8.27902 3.83203 12.6647C3.83203 17.0503 7.38731 20.6056 11.773 20.6056C16.0995 20.6056 19.618 17.1455 19.712 12.8415\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n />","<path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.1135 9.03425L19.1135 11.4903L20.3135 11.4903L20.3135 9.03425L22.7693 9.03425L22.7693 7.83425L20.3135 7.83425L20.3135 5.37941L19.1135 5.37941L19.1135 7.83425L16.6584 7.83425L16.6584 9.03425L19.1135 9.03425Z\"\n fill=\"currentColor\"\n />","<svg\n data-sanity-icon=\"add-reaction\"\n fill=\"none\"\n height=\"1em\"\n ref={ref}\n viewBox=\"0 0 25 25\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n d=\"M10.1044 10.4011L10.1044 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M14.2393 10.4011L14.2393 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M7.12128 14.1151C7.70803 15.0226 9.66113 16.8377 11.7735 16.8377C13.8859 16.8377 15.6713 15.0226 16.4257 14.1151\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M16.703 6.43905C15.3486 5.36511 13.6357 4.72374 11.773 4.72374C7.38731 4.72374 3.83203 8.27902 3.83203 12.6647C3.83203 17.0503 7.38731 20.6056 11.773 20.6056C16.0995 20.6056 19.618 17.1455 19.712 12.8415\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.1135 9.03425L19.1135 11.4903L20.3135 11.4903L20.3135 9.03425L22.7693 9.03425L22.7693 7.83425L20.3135 7.83425L20.3135 5.37941L19.1135 5.37941L19.1135 7.83425L16.6584 7.83425L16.6584 9.03425L19.1135 9.03425Z\"\n fill=\"currentColor\"\n />\n </svg>","(event: React.KeyboardEvent<HTMLDivElement>) => {\n const focusableLen = rootElement?.querySelectorAll('button').length ?? 0\n\n if (event.key === 'ArrowRight') {\n setFocusedIndex((prev) => (prev + 1) % focusableLen)\n }\n if (event.key === 'ArrowLeft') {\n setFocusedIndex((prev) => (prev - 1 + focusableLen) % focusableLen)\n }\n // if (event.key === 'ArrowDown') {\n // setFocusedIndex((prev) => (prev + GRID_COLUMNS) % focusableLen)\n // }\n // if (event.key === 'ArrowUp') {\n // setFocusedIndex((prev) => (prev - GRID_COLUMNS + focusableLen) % focusableLen)\n // }\n }","rootElement?.querySelectorAll","prev","useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const focusableLen = rootElement?.querySelectorAll('button').length ?? 0\n\n if (event.key === 'ArrowRight') {\n setFocusedIndex((prev) => (prev + 1) % focusableLen)\n }\n if (event.key === 'ArrowLeft') {\n setFocusedIndex((prev) => (prev - 1 + focusableLen) % focusableLen)\n }\n // if (event.key === 'ArrowDown') {\n // setFocusedIndex((prev) => (prev + GRID_COLUMNS) % focusableLen)\n // }\n // if (event.key === 'ArrowUp') {\n // setFocusedIndex((prev) => (prev - GRID_COLUMNS + focusableLen) % focusableLen)\n // }\n },\n [rootElement],\n )","(event: React.MouseEvent<HTMLButtonElement>) => {\n const index = rootElement\n ? Array.from(rootElement.querySelectorAll('button')).indexOf(event.currentTarget)\n : -1\n setFocusedIndex(index)\n onSelect(options[index])\n }","event","useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n const index = rootElement\n ? Array.from(rootElement.querySelectorAll('button')).indexOf(event.currentTarget)\n : -1\n setFocusedIndex(index)\n onSelect(options[index])\n },\n [rootElement, onSelect, options],\n )","() => {\n if (!rootElement) return\n const focusableElements = Array.from(rootElement.querySelectorAll('button'))\n if (focusableElements.length > 0) {\n focusableElements[focusedIndex].focus()\n }\n }","[focusedIndex, rootElement]","options.map((o) => {\n const emoji = COMMENT_REACTION_EMOJIS[o.shortName]\n\n return (\n <UIButton\n key={o.shortName}\n aria-label={t('reactions.react-with-aria-label', {\n reactionName: o.title || o.shortName,\n })}\n mode=\"bleed\"\n onClick={handleOptionClick}\n padding={2}\n role=\"menuitem\"\n tabIndex={-1}\n >\n <EmojiText align=\"center\" size={2} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n </UIButton>\n )\n })","(o) => {\n const emoji = COMMENT_REACTION_EMOJIS[o.shortName]\n\n return (\n <UIButton\n key={o.shortName}\n aria-label={t('reactions.react-with-aria-label', {\n reactionName: o.title || o.shortName,\n })}\n mode=\"bleed\"\n onClick={handleOptionClick}\n padding={2}\n role=\"menuitem\"\n tabIndex={-1}\n >\n <EmojiText align=\"center\" size={2} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n </UIButton>\n )\n }","<Grid\n gridTemplateColumns=\"repeat(6, minmax(0,1fr))\"\n gap={1}\n onKeyDown={handleRootKeyDown}\n ref={setRootElement}\n role=\"menu\"\n >\n {options.map((o) => {\n const emoji = COMMENT_REACTION_EMOJIS[o.shortName]\n\n return (\n <UIButton\n key={o.shortName}\n aria-label={t('reactions.react-with-aria-label', {\n reactionName: o.title || o.shortName,\n })}\n mode=\"bleed\"\n onClick={handleOptionClick}\n padding={2}\n role=\"menuitem\"\n tabIndex={-1}\n >\n <EmojiText align=\"center\" size={2} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n </UIButton>\n )\n })}\n </Grid>","() => {\n const next = !open\n setOpen(next)\n\n if (next) {\n onMenuOpen?.()\n } else {\n onMenuClose?.()\n }\n }","useCallback(() => {\n const next = !open\n setOpen(next)\n\n if (next) {\n onMenuOpen?.()\n } else {\n onMenuClose?.()\n }\n }, [onMenuClose, onMenuOpen, open])","() => {\n if (!open) return\n\n setOpen(false)\n onMenuClose?.()\n }","useCallback(() => {\n if (!open) return\n\n setOpen(false)\n onMenuClose?.()\n }, [open, onMenuClose])","() => {\n if (!open) return\n\n handleClose()\n buttonElement?.focus()\n }","buttonElement?.focus","useCallback(() => {\n if (!open) return\n\n handleClose()\n buttonElement?.focus()\n }, [buttonElement, handleClose, open])","(event: React.KeyboardEvent<HTMLDivElement>) => {\n const {key, shiftKey} = event\n\n if ((shiftKey && key === 'Tab') || key === 'Escape' || key === 'Tab') {\n handleCloseAndFocus()\n }\n }","useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const {key, shiftKey} = event\n\n if ((shiftKey && key === 'Tab') || key === 'Escape' || key === 'Tab') {\n handleCloseAndFocus()\n }\n },\n [handleCloseAndFocus],\n )","() => [popoverRef.current, buttonElement]","(option: CommentReactionOption) => {\n onSelect(option)\n handleClose()\n }","useCallback(\n (option: CommentReactionOption) => {\n onSelect(option)\n handleClose()\n },\n [handleClose, onSelect],\n )","cloneElement(btn, {\n 'aria-expanded': open,\n 'aria-haspopup': 'true',\n 'disabled': readOnly || mode === 'upsell',\n 'id': 'reactions-menu-button',\n 'onClick': handleClick,\n 'ref': setButtonElement,\n })","useMemo(() => {\n // Get the button element from the renderMenuButton function.\n const btn = renderMenuButton({\n open,\n tooltipContent:\n mode === 'upsell'\n ? t('list-item.context-menu-add-reaction-upsell')\n : t('list-item.context-menu-add-reaction'),\n t,\n })\n\n // Clone the button element and add the necessary props.\n return cloneElement(btn, {\n 'aria-expanded': open,\n 'aria-haspopup': 'true',\n 'disabled': readOnly || mode === 'upsell',\n 'id': 'reactions-menu-button',\n 'onClick': handleClick,\n 'ref': setButtonElement,\n })\n }, [handleClick, open, readOnly, renderMenuButton, t, mode])","<CommentReactionsMenu onSelect={handleSelect} options={options} />","<Card\n aria-labelledby=\"reactions-menu-button\"\n onKeyDown={handleKeyDown}\n padding={1}\n radius={3}\n tone=\"default\"\n >\n <CommentReactionsMenu onSelect={handleSelect} options={options} />\n </Card>","<Popover\n constrainSize\n content={popoverContent}\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n open={open}\n placement=\"bottom\"\n portal\n ref={popoverRef}\n tone=\"default\"\n >\n {button}\n </Popover>","t('reactions.user-list.you', {context, replace: {name: user?.displayName}})","user?.displayName","user?.displayName || t('reactions.user-list.unknown-user-fallback-name')","displayName","<CommentReactionsUsersTooltipContent {...restProps} />","<div>{children}</div>","<Tooltip\n content={<CommentReactionsUsersTooltipContent {...restProps} />}\n placement=\"bottom\"\n portal\n >\n <div>{children}</div>\n </Tooltip>","{\n currentUserId,\n userIds,\n}: {\n currentUserId: string | null | undefined\n userIds: string[]\n}","{style: 'long', type: 'conjunction'}","nonWhitespace = ''","{currentUserId, userIds}: ReactionTooltipComponentProps","<FormattedUserList currentUserId={currentUserId} userIds={userIds} />","{reactionName}: ReactionTooltipComponentProps","<InlineText muted forwardedAs=\"div\" trim={true}>\n {reactionName}\n </InlineText>","{children}: ReactionTooltipComponentProps","<InlineText muted forwardedAs=\"div\" trim={true}>\n {children}\n </InlineText>","<wbr />","<>\n <InlineText muted forwardedAs=\"div\" trim={true}>\n {children}\n </InlineText>{' '}\n <wbr />{' '}\n </>","<Flex justifyContent=\"center\" paddingBottom={2} paddingTop={1}>\n <EmojiText size={4} forwardedAs=\"div\" trim={true}>\n {COMMENT_REACTION_EMOJIS[reactionName]}\n </EmojiText>\n </Flex>","COMMENT_REACTION_EMOJIS[reactionName]","{reactionName}","{UserList, ReactionName, Text: ReactionText}","{\n currentUserId: currentUser.sanityUserId,\n reactionName,\n userIds,\n }","sanityUserId","<TextBox>\n <Translate\n t={t}\n i18nKey=\"reactions.users-reacted-with-reaction\"\n values={{reactionName}}\n components={{UserList, ReactionName, Text: ReactionText}}\n componentProps={{\n currentUserId: currentUser.sanityUserId,\n reactionName,\n userIds,\n }}\n />\n </TextBox>","<ContentStack padding={1} flexDirection=\"column\">\n <Flex justifyContent=\"center\" paddingBottom={2} paddingTop={1}>\n <EmojiText size={4} forwardedAs=\"div\" trim={true}>\n {COMMENT_REACTION_EMOJIS[reactionName]}\n </EmojiText>\n </Flex>\n\n <TextBox>\n <Translate\n t={t}\n i18nKey=\"reactions.users-reacted-with-reaction\"\n values={{reactionName}}\n components={{UserList, ReactionName, Text: ReactionText}}\n componentProps={{\n currentUserId: currentUser.sanityUserId,\n reactionName,\n userIds,\n }}\n />\n </TextBox>\n </ContentStack>","(name: CommentReactionShortNames) => {\n const option = COMMENT_REACTION_OPTIONS.find((o) => o.shortName === name)\n\n if (option) {\n onSelect(option)\n }\n }","useCallback(\n (name: CommentReactionShortNames) => {\n const option = COMMENT_REACTION_OPTIONS.find((o) => o.shortName === name)\n\n if (option) {\n onSelect(option)\n }\n },\n [onSelect],\n )","reactions.filter((r) => r.userId === currentUser?.sanityUserId).map((r) => r.shortName)","sanityUserId","(r) => r.userId === currentUser?.sanityUserId","(r) => r.shortName","useMemo(() => {\n return reactions.filter((r) => r.userId === currentUser?.sanityUserId).map((r) => r.shortName)\n }, [currentUser?.sanityUserId, reactions])","grouped.filter(([name]) => COMMENT_REACTION_EMOJIS[name])","([name]) => COMMENT_REACTION_EMOJIS[name]","useMemo(() => {\n const grouped = groupReactionsByName(reactions)\n\n // Filter out reactions that are not in the `COMMENT_REACTION_EMOJIS` map.\n return grouped.filter(([name]) => COMMENT_REACTION_EMOJIS[name])\n }, [reactions])","() => ({\n // An array of the initial order of the reactions. This is used to sort the reactions.\n // E.g. [':+1:', ':heart:']\n sortOrder: Object.keys(Object.fromEntries(groupedReactions)),\n // We cache the groupedReactions to know when we should update the sortedReactions, ensuring we don't run into an infinite render loop.\n groupedReactions: [] as typeof groupedReactions,\n sortedReactions: [] as typeof groupedReactions,\n })","groupedReactions","sortedReactions.map(([name]) => name)","setSortedGroupedReactions","([nameA], [nameB]) => {\n const indexA = sortOrder.indexOf(nameA)\n const indexB = sortOrder.indexOf(nameB)\n\n if (indexA === -1) {\n return 1\n }\n\n if (indexB === -1) {\n return -1\n }\n\n return indexA - indexB\n }","[nameA]","[nameB]","([name]) => name","sortedReactions.map(([name, reactionsList]) => {\n const hasReacted = currentUserReactionNames.includes(name)\n const userIds = reactionsList.map((r) => r.userId)\n const emoji = COMMENT_REACTION_EMOJIS[name]\n\n return (\n <CommentReactionsUsersTooltip\n key={name}\n currentUser={currentUser}\n reactionName={name}\n userIds={userIds}\n >\n <TransparentCard tone=\"default\">\n <UIButton\n disabled={readOnly || mode === 'upsell'}\n mode=\"ghost\"\n onClick={() => handleSelect(name)}\n padding={2}\n radius=\"full\"\n selected={hasReacted}\n tone={hasReacted ? 'primary' : 'default'}\n >\n <Flex alignItems=\"center\" gap={1}>\n <EmojiText size={1} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n\n <Text size={0} weight={hasReacted ? 'semibold' : 'medium'} as=\"div\" trim={true}>\n {reactionsList?.length}\n </Text>\n </Flex>\n </UIButton>\n </TransparentCard>\n </CommentReactionsUsersTooltip>\n )\n })","([name, reactionsList]) => {\n const hasReacted = currentUserReactionNames.includes(name)\n const userIds = reactionsList.map((r) => r.userId)\n const emoji = COMMENT_REACTION_EMOJIS[name]\n\n return (\n <CommentReactionsUsersTooltip\n key={name}\n currentUser={currentUser}\n reactionName={name}\n userIds={userIds}\n >\n <TransparentCard tone=\"default\">\n <UIButton\n disabled={readOnly || mode === 'upsell'}\n mode=\"ghost\"\n onClick={() => handleSelect(name)}\n padding={2}\n radius=\"full\"\n selected={hasReacted}\n tone={hasReacted ? 'primary' : 'default'}\n >\n <Flex alignItems=\"center\" gap={1}>\n <EmojiText size={1} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n\n <Text size={0} weight={hasReacted ? 'semibold' : 'medium'} as=\"div\" trim={true}>\n {reactionsList?.length}\n </Text>\n </Flex>\n </UIButton>\n </TransparentCard>\n </CommentReactionsUsersTooltip>\n )\n }","name","[name, reactionsList]","(r) => r.userId","(o) => handleSelect(o.shortName)","o","<TransparentCard tone=\"default\">\n <CommentReactionsMenuButton\n mode={mode}\n onSelect={(o) => handleSelect(o.shortName)}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n </TransparentCard>","<Flex alignItems=\"center\" gap={1} flexWrap=\"wrap\">\n <TooltipDelayGroupProvider>\n {sortedReactions.map(([name, reactionsList]) => {\n const hasReacted = currentUserReactionNames.includes(name)\n const userIds = reactionsList.map((r) => r.userId)\n const emoji = COMMENT_REACTION_EMOJIS[name]\n\n return (\n <CommentReactionsUsersTooltip\n key={name}\n currentUser={currentUser}\n reactionName={name}\n userIds={userIds}\n >\n <TransparentCard tone=\"default\">\n <UIButton\n disabled={readOnly || mode === 'upsell'}\n mode=\"ghost\"\n onClick={() => handleSelect(name)}\n padding={2}\n radius=\"full\"\n selected={hasReacted}\n tone={hasReacted ? 'primary' : 'default'}\n >\n <Flex alignItems=\"center\" gap={1}>\n <EmojiText size={1} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n\n <Text size={0} weight={hasReacted ? 'semibold' : 'medium'} as=\"div\" trim={true}>\n {reactionsList?.length}\n </Text>\n </Flex>\n </UIButton>\n </TransparentCard>\n </CommentReactionsUsersTooltip>\n )\n })}\n\n <TransparentCard tone=\"default\">\n <CommentReactionsMenuButton\n mode={mode}\n onSelect={(o) => handleSelect(o.shortName)}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n </TransparentCard>\n </TooltipDelayGroupProvider>\n </Flex>","r","[name]","{origin}: {origin: CommentOrigin}","<Text size={2}>{origin === 'draft' ? <RingIcon /> : <CircleSmallIcon />}</Text>","<IconSlotRoot data-status={origin}>\n <Text size={2}>{origin === 'draft' ? <RingIcon /> : <CircleSmallIcon />}</Text>\n </IconSlotRoot>","t(getOriginI18nKey(origin))","<Text size={0} muted weight=\"medium\">\n {t(getOriginI18nKey(origin))}\n </Text>","<Flex marginBottom={2}>\n <Card border padding={1} radius={3}>\n <Flex alignItems=\"center\" gap={1} paddingRight={1}>\n <IconSlotRoot data-status={origin}>\n <Text size={2}>{origin === 'draft' ? <RingIcon /> : <CircleSmallIcon />}</Text>\n </IconSlotRoot>\n\n <Text size={0} muted weight=\"medium\">\n {t(getOriginI18nKey(origin))}\n </Text>\n </Flex>\n </Card>\n </Flex>","onReactionSelect && (\n <CommentReactionsMenuButton\n mode={mode}\n onMenuClose={onMenuClose}\n onMenuOpen={onMenuOpen}\n onSelect={onReactionSelect}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n )","isParent && onStatusChange && (\n <Button\n aria-label={\n status === 'open'\n ? t('list-item.resolved-tooltip-aria-label')\n : t('list-item.re-open-resolved-aria-label')\n }\n data-testid=\"comments-list-item-status-button\"\n disabled={readOnly}\n icon={status === 'open' ? CheckmarkCircleIcon : UndoIcon}\n mode=\"bleed\"\n onClick={onStatusChange}\n tooltipProps={{\n content:\n status === 'open'\n ? t('list-item.resolved-tooltip-content')\n : t('list-item.re-open-resolved'),\n }}\n />\n )","hasContextMenuOptions && (\n <MenuButton\n id=\"comment-actions-menu\"\n button={\n <ContextMenuButton\n aria-label={t('list-item.open-menu-aria-label')}\n disabled={readOnly}\n hidden={!showMenuButton}\n />\n }\n onOpen={onMenuOpen}\n onClose={onMenuClose}\n menu={\n <Menu>\n <MenuItem\n hidden={!canEdit}\n icon={EditIcon}\n onClick={onEditStart}\n text={t('list-item.edit-comment')}\n tooltipProps={\n mode === 'upsell' ? {content: t('list-item.edit-comment-upsell')} : undefined\n }\n disabled={mode === 'upsell'}\n />\n\n <MenuItem\n hidden={!canDelete}\n icon={TrashIcon}\n onClick={onDeleteStart}\n text={t('list-item.delete-comment')}\n tone=\"critical\"\n />\n\n {onCopyLink && <MenuDivider hidden={!canDelete && !canEdit} />}\n\n <MenuItem\n hidden={!onCopyLink}\n icon={LinkIcon}\n onClick={onCopyLink}\n text={t('list-item.copy-link')}\n />\n </Menu>\n }\n popover={POPOVER_PROPS}\n />\n )","<TooltipDelayGroupProvider>\n <Flex>\n <FloatingCard display=\"flex\" shadow={2} padding={1} radius={2} sizing=\"border\">\n {onReactionSelect && (\n <CommentReactionsMenuButton\n mode={mode}\n onMenuClose={onMenuClose}\n onMenuOpen={onMenuOpen}\n onSelect={onReactionSelect}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n )}\n\n {isParent && onStatusChange && (\n <Button\n aria-label={\n status === 'open'\n ? t('list-item.resolved-tooltip-aria-label')\n : t('list-item.re-open-resolved-aria-label')\n }\n data-testid=\"comments-list-item-status-button\"\n disabled={readOnly}\n icon={status === 'open' ? CheckmarkCircleIcon : UndoIcon}\n mode=\"bleed\"\n onClick={onStatusChange}\n tooltipProps={{\n content:\n status === 'open'\n ? t('list-item.resolved-tooltip-content')\n : t('list-item.re-open-resolved'),\n }}\n />\n )}\n\n {hasContextMenuOptions && (\n <MenuButton\n id=\"comment-actions-menu\"\n button={\n <ContextMenuButton\n aria-label={t('list-item.open-menu-aria-label')}\n disabled={readOnly}\n hidden={!showMenuButton}\n />\n }\n onOpen={onMenuOpen}\n onClose={onMenuClose}\n menu={\n <Menu>\n <MenuItem\n hidden={!canEdit}\n icon={EditIcon}\n onClick={onEditStart}\n text={t('list-item.edit-comment')}\n tooltipProps={\n mode === 'upsell' ? {content: t('list-item.edit-comment-upsell')} : undefined\n }\n disabled={mode === 'upsell'}\n />\n\n <MenuItem\n hidden={!canDelete}\n icon={TrashIcon}\n onClick={onDeleteStart}\n text={t('list-item.delete-comment')}\n tone=\"critical\"\n />\n\n {onCopyLink && <MenuDivider hidden={!canDelete && !canEdit} />}\n\n <MenuItem\n hidden={!onCopyLink}\n icon={LinkIcon}\n onClick={onCopyLink}\n text={t('list-item.copy-link')}\n />\n </Menu>\n }\n popover={POPOVER_PROPS}\n />\n )}\n </FloatingCard>\n </Flex>\n </TooltipDelayGroupProvider>","t('list-item.missing-referenced-value-tooltip-content')","useMemo(() => {\n if (Array.isArray(value) && value?.filter(isPortableTextTextBlock).length > 0) {\n const text = value?.map(toPlainText).join(' ')\n const truncated = truncate(text)\n\n return truncated\n }\n\n return null\n }, [value])","truncate(text)","value?.map","!hasReferencedValue && (\n <Tooltip content={tooltipText}>\n <InlineBox>\n <Icon size={1} icon={LinkRemovedIcon} style={{margin: '-0.375rem'}} />\n </InlineBox>\n </Tooltip>\n )","<Flex alignItems=\"flex-start\">\n <Text size={1} muted as=\"div\" trim={true}>\n {!hasReferencedValue && (\n <Tooltip content={tooltipText}>\n <InlineBox>\n <Icon size={1} icon={LinkRemovedIcon} style={{margin: '-0.375rem'}} />\n </InlineBox>\n </Tooltip>\n )}\n\n {resolvedValue}\n </Text>\n </Flex>","<BlockQuoteStack\n $hasReferencedValue={Boolean(hasReferencedValue)}\n data-testid=\"comments-list-item-referenced-value\"\n flexBasis=\"0%\"\n flexGrow={1}\n flexDirection=\"column\"\n forwardedAs=\"blockquote\"\n padding={1}\n paddingLeft={2}\n >\n <Flex alignItems=\"flex-start\">\n <Text size={1} muted as=\"div\" trim={true}>\n {!hasReferencedValue && (\n <Tooltip content={tooltipText}>\n <InlineBox>\n <Icon size={1} icon={LinkRemovedIcon} style={{margin: '-0.375rem'}} />\n </InlineBox>\n </Tooltip>\n )}\n\n {resolvedValue}\n </Text>\n </Flex>\n </BlockQuoteStack>","Boolean(hasReferencedValue)","{\n children,\n intent,\n}: {\n children?: React.ReactNode\n intent?: CommentContext['intent']\n}","<IntentLink params={intent.params} intent={intent.name}>\n {children}\n </IntentLink>","name","params","avatarSize = 1","withAvatar = true","isParent ? getForeignCommentOrigin(comment, versionId) : null","hasCommentMessageValue(value)","useMemo(() => hasCommentMessageValue(value), [value])","(\n comment?.reactions?.filter((r) => r?._optimisticState !== 'removed') || EMPTY_ARRAY\n ).filter((r) => {\n // Filter out reactions that might have to incorrect format\n return 'userId' in r && 'shortName' in r\n })","reactions","(r) => r?._optimisticState !== 'removed'","(r) => {\n // Filter out reactions that might have to incorrect format\n return 'userId' in r && 'shortName' in r\n }","_createdAt ? new Date(_createdAt) : new Date()","{\n dateStyle: 'full',\n timeStyle: 'medium',\n }","dateTimeFormat.format(createdDate)","() => {\n if (isEditing) return\n\n startMessage.current = message\n // oxlint-disable-next-line react/set-state-in-effect -- pre-existing violation, to be fixed in a follow-up\n setValue(message)\n }","[isEditing, message]","() => setMenuOpen(true)","useCallback(() => setMenuOpen(true), [])","() => setMenuOpen(false)","useCallback(() => setMenuOpen(false), [])","() => onCopyLink?.(_id)","useCallback(() => onCopyLink?.(_id), [_id, onCopyLink])","(e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation()\n onCreateRetry?.(_id)\n }","useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation()\n onCreateRetry?.(_id)\n },\n [_id, onCreateRetry],\n )","() => onDelete(_id)","useCallback(() => onDelete(_id), [_id, onDelete])","() => {\n setIsEditing(false)\n setValue(startMessage.current)\n }","useCallback(() => {\n setIsEditing(false)\n setValue(startMessage.current)\n }, [])","() => {\n if (!hasValue || !hasChanges) {\n cancelEdit()\n return\n }\n commentInputRef.current?.discardDialogController.open()\n }","useCallback(() => {\n if (!hasValue || !hasChanges) {\n cancelEdit()\n return\n }\n commentInputRef.current?.discardDialogController.open()\n }, [cancelEdit, hasChanges, hasValue])","(event: React.KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard the input text\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n // Call parent handler\n if (onInputKeyDown) onInputKeyDown(event)\n }","useCallback(\n (event: React.KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard the input text\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n // Call parent handler\n if (onInputKeyDown) onInputKeyDown(event)\n },\n [onInputKeyDown, startDiscard],\n )","() => {\n commentInputRef.current?.discardDialogController.close()\n }","useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n }, [])","() => {\n commentInputRef.current?.discardDialogController.close()\n cancelEdit()\n }","useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n cancelEdit()\n }, [cancelEdit])","(reaction: CommentReactionOption) => {\n onReactionSelect?.(_id, reaction)\n }","useCallback(\n (reaction: CommentReactionOption) => {\n onReactionSelect?.(_id, reaction)\n },\n [_id, onReactionSelect],\n )","(nextValue: CommentMessage) => {\n onEdit(_id, {message: nextValue})\n setIsEditing(false)\n }","useCallback(\n (nextValue: CommentMessage) => {\n onEdit(_id, {message: nextValue})\n setIsEditing(false)\n },\n [_id, onEdit],\n )","() => {\n onStatusChange?.(_id, comment.status === 'open' ? 'resolved' : 'open')\n }","status","useCallback(() => {\n onStatusChange?.(_id, comment.status === 'open' ? 'resolved' : 'open')\n }, [_id, comment.status, onStatusChange])","() => {\n setIsEditing((v) => !v)\n }","(v) => !v","useCallback(() => {\n setIsEditing((v) => !v)\n }, [])","(event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && !hasChanges) {\n cancelEdit()\n }\n }","event","useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && !hasChanges) {\n cancelEdit()\n }\n },\n [cancelEdit, hasChanges],\n )","() => [rootElementRef.current]","user?.displayName ? (\n <Text size={1} weight=\"medium\" truncate={1} title={user.displayName} as=\"div\" trim={true}>\n {user.displayName}\n </Text>\n ) : (\n <TextSkeleton size={1} style={SKELETON_INLINE_STYLE} />\n )","user?.displayName","foreignOrigin && <CommentOriginBadge origin={foreignOrigin} />","withAvatar && <CommentsAvatar user={user} size={avatarSize} />","<Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>","<Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>","Flex","!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )","\"flex-end\"","2","<Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>","comment.context?.intent ? 0 : 1","\"center\"","\"0%\"","1","intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )","<Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>","intent ? 2 : 0","\"column\"","!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )","<HeaderFlex\n alignItems=\"center\"\n gap={FLEX_GAP}\n flexBasis=\"0%\"\n flexGrow={1}\n $size={avatarSize}\n >\n {withAvatar && <CommentsAvatar user={user} size={avatarSize} />}\n\n <Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>\n\n {!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )}\n </HeaderFlex>","HeaderFlex","FLEX_GAP","isTextSelectionComment(comment) && Boolean(comment?.contentSnapshot) && (\n <Flex gap={FLEX_GAP} marginBottom={3}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentsListItemReferencedValue\n hasReferencedValue={hasReferencedValue}\n value={comment?.contentSnapshot}\n />\n </Flex>\n )","isEditing && (\n <Flex alignItems=\"flex-start\" gap={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex flexBasis=\"0%\" flexGrow={1} flexDirection=\"column\">\n <CommentInput\n currentUser={currentUser}\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleEditSubmit}\n readOnly={readOnly}\n ref={commentInputRef}\n value={value}\n withAvatar={false}\n />\n </Flex>\n </Flex>\n )","!isEditing && (\n <Flex gap={FLEX_GAP}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentMessageSerializer blocks={message} />\n </Flex>\n )","hasReactions && (\n <Flex gap={FLEX_GAP} marginTop={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Box onClick={stopPropagation}>\n <CommentReactionsBar\n currentUser={currentUser}\n mode={mode}\n onSelect={handleReactionSelect}\n reactions={reactions}\n readOnly={readOnly}\n />\n </Box>\n </Flex>\n )","<InnerStack gap={1} data-muted={displayError}>\n {foreignOrigin && <CommentOriginBadge origin={foreignOrigin} />}\n\n <HeaderFlex\n alignItems=\"center\"\n gap={FLEX_GAP}\n flexBasis=\"0%\"\n flexGrow={1}\n $size={avatarSize}\n >\n {withAvatar && <CommentsAvatar user={user} size={avatarSize} />}\n\n <Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>\n\n {!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )}\n </HeaderFlex>\n\n {isTextSelectionComment(comment) && Boolean(comment?.contentSnapshot) && (\n <Flex gap={FLEX_GAP} marginBottom={3}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentsListItemReferencedValue\n hasReferencedValue={hasReferencedValue}\n value={comment?.contentSnapshot}\n />\n </Flex>\n )}\n\n {isEditing && (\n <Flex alignItems=\"flex-start\" gap={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex flexBasis=\"0%\" flexGrow={1} flexDirection=\"column\">\n <CommentInput\n currentUser={currentUser}\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleEditSubmit}\n readOnly={readOnly}\n ref={commentInputRef}\n value={value}\n withAvatar={false}\n />\n </Flex>\n </Flex>\n )}\n\n {!isEditing && (\n <Flex gap={FLEX_GAP}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentMessageSerializer blocks={message} />\n </Flex>\n )}\n\n {hasReactions && (\n <Flex gap={FLEX_GAP} marginTop={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Box onClick={stopPropagation}>\n <CommentReactionsBar\n currentUser={currentUser}\n mode={mode}\n onSelect={handleReactionSelect}\n reactions={reactions}\n readOnly={readOnly}\n />\n </Box>\n </Flex>\n )}\n </InnerStack>","InnerStack","displayError && (\n <ErrorFlex gap={FLEX_GAP} $size={avatarSize}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex alignItems=\"center\" gap={1} flexBasis=\"0%\" flexGrow={1}>\n <Text muted size={1} as=\"div\" trim={true}>\n {hasError && t('list-item.layout-failed-sent')}\n {isRetrying && t('list-item.layout-posting')}\n </Text>\n\n <Flex hidden={isRetrying}>\n <RetryCardButton\n __unstable_focusRing\n display=\"flex\"\n forwardedAs=\"button\"\n onClick={handleCreateRetry}\n padding={1}\n radius={2}\n tone=\"primary\"\n >\n <Text size={1} muted as=\"div\" trim={true}>\n {t('list-item.layout-retry')}\n </Text>\n </RetryCardButton>\n </Flex>\n </Flex>\n </ErrorFlex>\n )","<RootStack\n data-menu-open={menuOpen ? 'true' : 'false'}\n data-testid=\"comments-list-item-layout\"\n onKeyDown={handleRootKeyDown}\n ref={rootElementRef}\n gap={4}\n >\n <InnerStack gap={1} data-muted={displayError}>\n {foreignOrigin && <CommentOriginBadge origin={foreignOrigin} />}\n\n <HeaderFlex\n alignItems=\"center\"\n gap={FLEX_GAP}\n flexBasis=\"0%\"\n flexGrow={1}\n $size={avatarSize}\n >\n {withAvatar && <CommentsAvatar user={user} size={avatarSize} />}\n\n <Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>\n\n {!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )}\n </HeaderFlex>\n\n {isTextSelectionComment(comment) && Boolean(comment?.contentSnapshot) && (\n <Flex gap={FLEX_GAP} marginBottom={3}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentsListItemReferencedValue\n hasReferencedValue={hasReferencedValue}\n value={comment?.contentSnapshot}\n />\n </Flex>\n )}\n\n {isEditing && (\n <Flex alignItems=\"flex-start\" gap={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex flexBasis=\"0%\" flexGrow={1} flexDirection=\"column\">\n <CommentInput\n currentUser={currentUser}\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleEditSubmit}\n readOnly={readOnly}\n ref={commentInputRef}\n value={value}\n withAvatar={false}\n />\n </Flex>\n </Flex>\n )}\n\n {!isEditing && (\n <Flex gap={FLEX_GAP}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentMessageSerializer blocks={message} />\n </Flex>\n )}\n\n {hasReactions && (\n <Flex gap={FLEX_GAP} marginTop={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Box onClick={stopPropagation}>\n <CommentReactionsBar\n currentUser={currentUser}\n mode={mode}\n onSelect={handleReactionSelect}\n reactions={reactions}\n readOnly={readOnly}\n />\n </Box>\n </Flex>\n )}\n </InnerStack>\n\n {displayError && (\n <ErrorFlex gap={FLEX_GAP} $size={avatarSize}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex alignItems=\"center\" gap={1} flexBasis=\"0%\" flexGrow={1}>\n <Text muted size={1} as=\"div\" trim={true}>\n {hasError && t('list-item.layout-failed-sent')}\n {isRetrying && t('list-item.layout-posting')}\n </Text>\n\n <Flex hidden={isRetrying}>\n <RetryCardButton\n __unstable_focusRing\n display=\"flex\"\n forwardedAs=\"button\"\n onClick={handleCreateRetry}\n padding={1}\n radius={2}\n tone=\"primary\"\n >\n <Text size={1} muted as=\"div\" trim={true}>\n {t('list-item.layout-retry')}\n </Text>\n </RetryCardButton>\n </Flex>\n </Flex>\n </ErrorFlex>\n )}\n </RootStack>","RootStack","menuOpen ? 'true' : 'false'","\"comments-list-item-layout\"","4","r","avatarConfig = DEFAULT_AVATAR_CONFIG","replies = EMPTY_ARRAY","hasCommentMessageValue(value)","useMemo(() => hasCommentMessageValue(value), [value])","() => setMouseOver(true)","() => setMouseOver(false)","(nextValue: CommentMessage) => {\n const nextComment: CommentBaseCreatePayload = {\n message: nextValue,\n parentCommentId: parentComment._id,\n status: parentComment?.status || 'open',\n // Since this is a reply to an existing comment, we use the same thread ID as the parent\n threadId: parentComment.threadId,\n // A new comment will not have any reactions\n reactions: EMPTY_ARRAY,\n\n payload: {\n fieldPath: parentComment.target.path?.field || '',\n },\n }\n\n onReply?.(nextComment)\n setValue(EMPTY_ARRAY)\n }","_id","status","field","threadId","() => {\n if (!hasValue) {\n setValue(EMPTY_ARRAY)\n return\n }\n\n replyInputRef.current?.discardDialogController.open()\n }","useCallback(() => {\n if (!hasValue) {\n setValue(EMPTY_ARRAY)\n return\n }\n\n replyInputRef.current?.discardDialogController.open()\n }, [hasValue])","(event: KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard input text with Escape\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n }","useCallback(\n (event: KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard input text with Escape\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n },\n [startDiscard],\n )","() => {\n replyInputRef.current?.discardDialogController.close()\n }","useCallback(() => {\n replyInputRef.current?.discardDialogController.close()\n }, [])","() => {\n setValue(EMPTY_ARRAY)\n replyInputRef.current?.discardDialogController.close()\n replyInputRef.current?.focus()\n }","useCallback(() => {\n setValue(EMPTY_ARRAY)\n replyInputRef.current?.discardDialogController.close()\n replyInputRef.current?.focus()\n }, [])","(e: MouseEvent<HTMLDivElement>) => {\n e.stopPropagation()\n\n // Don't act if the click was caused by clicking\n // outside e.g. a popover or a menu\n if (!isTopLayer) return\n\n onPathSelect?.({\n fieldPath: parentComment.target.path?.field || '',\n origin: 'inspector',\n threadId: parentComment.threadId,\n })\n }","useCallback(\n (e: MouseEvent<HTMLDivElement>) => {\n e.stopPropagation()\n\n // Don't act if the click was caused by clicking\n // outside e.g. a popover or a menu\n if (!isTopLayer) return\n\n onPathSelect?.({\n fieldPath: parentComment.target.path?.field || '',\n origin: 'inspector',\n threadId: parentComment.threadId,\n })\n },\n [isTopLayer, onPathSelect, parentComment.target.path?.field, parentComment.threadId],\n )","(e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n setCollapsed(false)\n }","useCallback((e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n setCollapsed(false)\n }, [])","useMemo(() => {\n if (collapsed) return replies?.slice(-MAX_COLLAPSED_REPLIES)\n return replies\n }, [replies, collapsed])","replies?.slice(-MAX_COLLAPSED_REPLIES)","replies?.slice","useMemo(() => {\n if (!replies) return false\n return replies.length > MAX_COLLAPSED_REPLIES\n }, [replies])","t('list-item.go-to-field-button.aria-label')","<GhostButton\n data-ui=\"GhostButton\"\n aria-label={t('list-item.go-to-field-button.aria-label')}\n />","applyCommentIdAttr(parentComment._id)","<CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />","avatarSize","parentCommentAvatar","parentComment._system.createdBy === currentUser.sanityUserId","parentComment._state?.type === 'createError'","parentComment.context?.intent","parentComment._state?.type === 'createRetrying'","<VStack as=\"li\" {...applyCommentIdAttr(parentComment._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />\n </VStack>","showCollapseButton && collapsed && (\n <Flex gap={1} paddingY={1}>\n <SpacerAvatar />\n\n <ExpandButton\n iconRight={ChevronDownIcon}\n mode=\"bleed\"\n onClick={handleExpand}\n text={expandButtonText}\n />\n </Flex>\n )","splicedReplies.map((reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n ))","threadCommentsAvatar","currentUser.sanityUserId","(reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n )","canReply && (\n <CommentInput\n avatarSize={avatarConfig.avatarSize}\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleReplySubmit}\n placeholder={\n mode === 'upsell'\n ? t('compose.reply-placeholder-upsell')\n : t('compose.reply-placeholder')\n }\n readOnly={readOnly || mode === 'upsell'}\n ref={replyInputRef}\n value={value}\n withAvatar={avatarConfig.replyAvatar}\n />\n )","replyAvatar","<Flex\n as=\"ul\"\n padding={innerPadding}\n // Add some extra padding to the bottom if there is no reply input.\n // This is to make the UI look more balanced.\n paddingBottom={canReply ? undefined : 1}\n gap={4}\n flexDirection=\"column\"\n >\n <VStack as=\"li\" {...applyCommentIdAttr(parentComment._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />\n </VStack>\n\n {showCollapseButton && collapsed && (\n <Flex gap={1} paddingY={1}>\n <SpacerAvatar />\n\n <ExpandButton\n iconRight={ChevronDownIcon}\n mode=\"bleed\"\n onClick={handleExpand}\n text={expandButtonText}\n />\n </Flex>\n )}\n\n {splicedReplies.map((reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n ))}\n\n {canReply && (\n <CommentInput\n avatarSize={avatarConfig.avatarSize}\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleReplySubmit}\n placeholder={\n mode === 'upsell'\n ? t('compose.reply-placeholder-upsell')\n : t('compose.reply-placeholder')\n }\n readOnly={readOnly || mode === 'upsell'}\n ref={replyInputRef}\n value={value}\n withAvatar={avatarConfig.replyAvatar}\n />\n )}\n </Flex>","canReply ? undefined : 1","<StyledThreadCard\n data-active={isSelected ? 'true' : 'false'}\n data-hovered={mouseOver ? 'true' : 'false'}\n data-testid=\"comments-list-item\"\n data-ui=\"CommentsListItem\"\n onClick={handleThreadRootClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <GhostButton\n data-ui=\"GhostButton\"\n aria-label={t('list-item.go-to-field-button.aria-label')}\n />\n\n <Flex\n as=\"ul\"\n padding={innerPadding}\n // Add some extra padding to the bottom if there is no reply input.\n // This is to make the UI look more balanced.\n paddingBottom={canReply ? undefined : 1}\n gap={4}\n flexDirection=\"column\"\n >\n <VStack as=\"li\" {...applyCommentIdAttr(parentComment._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />\n </VStack>\n\n {showCollapseButton && collapsed && (\n <Flex gap={1} paddingY={1}>\n <SpacerAvatar />\n\n <ExpandButton\n iconRight={ChevronDownIcon}\n mode=\"bleed\"\n onClick={handleExpand}\n text={expandButtonText}\n />\n </Flex>\n )}\n\n {splicedReplies.map((reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n ))}\n\n {canReply && (\n <CommentInput\n avatarSize={avatarConfig.avatarSize}\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleReplySubmit}\n placeholder={\n mode === 'upsell'\n ? t('compose.reply-placeholder-upsell')\n : t('compose.reply-placeholder')\n }\n readOnly={readOnly || mode === 'upsell'}\n ref={replyInputRef}\n value={value}\n withAvatar={avatarConfig.replyAvatar}\n />\n )}\n </Flex>\n </StyledThreadCard>","isSelected ? 'true' : 'false'","mouseOver ? 'true' : 'false'"],"sources":["../src/core/comments-v2/components/CommentDeleteDialog.tsx","../src/core/comments-v2/components/avatars/SpacerAvatar.tsx","../src/core/comments-v2/utils/transform-children/linkMiddleware.tsx","../src/core/comments-v2/utils/transform-children/index.ts","../src/core/comments-v2/components/pte/CommentMessageSerializer.tsx","../src/core/comments-v2/components/icons/ReactionIcon.tsx","../src/core/comments-v2/components/reactions/EmojiText.styled.ts","../src/core/comments-v2/components/reactions/CommentReactionsMenu.tsx","../src/core/comments-v2/components/reactions/CommentReactionsMenuButton.tsx","../src/core/comments-v2/components/reactions/CommentReactionsUsersTooltip.tsx","../src/core/comments-v2/components/reactions/TransparentCard.styled.ts","../src/core/comments-v2/components/reactions/CommentReactionsBar.tsx","../src/core/comments-v2/components/list/CommentOriginBadge.tsx","../src/core/comments-v2/components/list/CommentsListItemContextMenu.tsx","../src/core/comments-v2/components/list/CommentsListItemReferencedValue.tsx","../src/core/comments-v2/components/list/CommentsListItemLayout.tsx","../src/core/comments-v2/components/list/styles.ts","../src/core/comments-v2/components/list/CommentsListItem.tsx"],"sourcesContent":["import {useCallback} from 'react'\nimport {Text, VStack} from 'ui5'\n\nimport {Dialog} from '../../../ui-components/dialog/Dialog'\nimport {TextWithTone} from '../../components/textWithTone/TextWithTone'\nimport {useTranslation} from '../../i18n/hooks/useTranslation'\nimport {type TFunction} from '../../i18n/types'\nimport {commentsLocaleNamespace} from '../i18n'\n\nfunction getDialogCopy(\n t: TFunction,\n): Record<'thread' | 'comment', {title: string; body: string; confirmButtonText: string}> {\n return {\n thread: {\n title: t('delete-thread.title'),\n body: t('delete-thread.body'),\n confirmButtonText: t('delete-thread.confirm'),\n },\n comment: {\n title: t('delete-comment.title'),\n body: t('delete-comment.body'),\n confirmButtonText: t('delete-comment.confirm'),\n },\n }\n}\n\n/**\n * @beta\n * @hidden\n */\nexport interface CommentDeleteDialogProps {\n commentId: string\n error: Error | null\n isParent: boolean\n loading: boolean\n onClose: () => void\n onConfirm: (id: string) => void\n}\n\n/**\n * @beta\n * @hidden\n */\nexport function CommentDeleteDialog(props: CommentDeleteDialogProps) {\n const {isParent, onClose, commentId, onConfirm, loading, error} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n const dialogCopy = getDialogCopy(t)\n const {title, body, confirmButtonText} = dialogCopy[isParent ? 'thread' : 'comment']\n\n const handleDelete = useCallback(() => {\n onConfirm(commentId)\n }, [commentId, onConfirm])\n\n return (\n <Dialog\n footer={{\n cancelButton: {\n onClick: onClose,\n },\n confirmButton: {\n loading,\n onClick: handleDelete,\n text: confirmButtonText,\n tone: 'critical',\n },\n }}\n header={title}\n id=\"delete-comment-dialog\"\n onClose={onClose}\n width={0}\n >\n <VStack gap={4}>\n <Text size={1} as=\"div\" trim={true}>\n {body}\n </Text>\n\n {error && <TextWithTone tone=\"critical\">{t('delete-dialog.error')}</TextWithTone>}\n </VStack>\n </Dialog>\n )\n}\n","import {type AvatarSize} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport {css, styled} from 'styled-components'\n\n/**\n * This component is used to as a spacer in situations where we want to align\n * components without avatars with components that have avatars.\n */\nexport const SpacerAvatar = styled.div<{$size?: AvatarSize}>((props) => {\n const theme = getTheme_v2(props.theme)\n const {$size = 1} = props\n return css`\n min-width: ${theme.avatar.sizes[$size]?.size}px;\n `\n})\n","import {type MouseEvent, type ReactNode} from 'react'\n\nimport {type Middleware} from './types'\n\nconst URL_REGEX = /\\b(https?:\\/\\/[^\\s,()]+(?:\\.[^\\s,()]+)*|www\\.[^\\s,()]+\\.[^\\s,()]{2,})\\b/g\n\nexport function onClick(event: MouseEvent<HTMLAnchorElement>): void {\n event.stopPropagation()\n}\n\nfunction createLinkElement(url: string): ReactNode {\n const href = url.startsWith('http') ? url : `https://${url}`\n\n return (\n <a key={url} href={href} target=\"_blank\" rel=\"noopener noreferrer\" onClick={onClick}>\n {url}\n </a>\n )\n}\n\n/**\n * Middleware that creates link elements for URLs in the text\n */\nexport const linkMiddleware: Middleware = (node) => {\n if (typeof node === 'string') {\n const parts = node.split(URL_REGEX)\n\n return parts.flatMap((part) => {\n if (part.match(URL_REGEX)) {\n return createLinkElement(part)\n }\n\n return part\n })\n }\n\n return node\n}\n","import {type ReactNode} from 'react'\n\nimport {linkMiddleware} from './linkMiddleware'\nimport {type Middleware} from './types'\n\nconst middlewares: Middleware[] = [linkMiddleware]\n\n/**\n * A function that transforms a ReactNode using a set of middlewares\n */\nexport function transformChildren(node: ReactNode): ReactNode {\n if (!Array.isArray(node)) return node\n\n return node.flatMap((item) => {\n let transformedItem: ReactNode[] = [item]\n\n for (const middleware of middlewares) {\n transformedItem = transformedItem.flatMap(middleware)\n }\n\n return transformedItem\n })\n}\n","import {PortableText, type PortableTextComponents} from '@portabletext/react'\nimport {Fragment, type PropsWithChildren, useMemo} from 'react'\nimport {css, styled} from 'styled-components'\nimport {VStack} from 'ui5'\n\nimport {type CommentMessage} from '../../types'\nimport {transformChildren} from '../../utils/transform-children'\nimport {MentionInlineBlock} from './blocks/MentionInlineBlock'\nimport {NormalBlock} from './blocks/NormalBlock'\n\nconst PortableTextWrap = styled(VStack)(() => {\n return css`\n & > [data-ui='Text']:not(:first-child) {\n margin-top: 1em; // todo: improve\n }\n\n & > [data-ui='Text']:empty {\n display: none;\n }\n `\n})\n\nconst EMPTY_ARRAY: [] = []\n\nfunction NormalBlockTransformed(props: PropsWithChildren) {\n const children = useMemo(() => transformChildren(props.children), [props.children])\n\n return <NormalBlock>{children}</NormalBlock>\n}\n\nconst components: PortableTextComponents = {\n // Since we do not offer any formatting options, we can just use the normal block for all of these.\n block: {\n normal: NormalBlockTransformed,\n h1: NormalBlockTransformed,\n h2: NormalBlockTransformed,\n h3: NormalBlockTransformed,\n h4: NormalBlockTransformed,\n h5: NormalBlockTransformed,\n h6: NormalBlockTransformed,\n blockquote: NormalBlockTransformed,\n code: NormalBlockTransformed,\n },\n\n list: {\n bullet: Fragment,\n number: Fragment,\n checkmarks: Fragment,\n },\n\n listItem: {\n bullet: NormalBlockTransformed,\n number: NormalBlockTransformed,\n checkmarks: NormalBlockTransformed,\n },\n\n // Since we do not offer any formatting options, we can just use the normal block for all of these.\n marks: {\n strong: Fragment,\n em: Fragment,\n code: Fragment,\n underline: Fragment,\n strikeThrough: Fragment,\n link: Fragment,\n },\n\n types: {\n mention: (props) => {\n return <MentionInlineBlock userId={props?.value?.userId} selected={false} />\n },\n },\n}\n\ninterface CommentMessageSerializerProps {\n blocks: CommentMessage\n}\n\n/**\n * @beta\n * @hidden\n */\nexport function CommentMessageSerializer(props: CommentMessageSerializerProps): React.JSX.Element {\n const {blocks} = props\n\n return (\n <PortableTextWrap>\n <PortableText value={blocks || EMPTY_ARRAY} components={components} />\n </PortableTextWrap>\n )\n}\n","import {type RefAttributes, type SVGProps} from 'react'\n\nexport function ReactionIcon(props: SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>) {\n const {ref, ...rest} = props\n return (\n <svg\n data-sanity-icon=\"add-reaction\"\n fill=\"none\"\n height=\"1em\"\n ref={ref}\n viewBox=\"0 0 25 25\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n d=\"M10.1044 10.4011L10.1044 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M14.2393 10.4011L14.2393 10.9972\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M7.12128 14.1151C7.70803 15.0226 9.66113 16.8377 11.7735 16.8377C13.8859 16.8377 15.6713 15.0226 16.4257 14.1151\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinecap=\"square\"\n />\n <path\n d=\"M16.703 6.43905C15.3486 5.36511 13.6357 4.72374 11.773 4.72374C7.38731 4.72374 3.83203 8.27902 3.83203 12.6647C3.83203 17.0503 7.38731 20.6056 11.773 20.6056C16.0995 20.6056 19.618 17.1455 19.712 12.8415\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.1135 9.03425L19.1135 11.4903L20.3135 11.4903L20.3135 9.03425L22.7693 9.03425L22.7693 7.83425L20.3135 7.83425L20.3135 5.37941L19.1135 5.37941L19.1135 7.83425L16.6584 7.83425L16.6584 9.03425L19.1135 9.03425Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n","import {styled} from 'styled-components'\nimport {Text} from 'ui5'\n\nexport const EmojiText = styled(Text)`\n font-family:\n 'Twemoji Mozilla', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji',\n 'EmojiOne Color', 'Android Emoji', sans-serif;\n`\n","// oxlint-disable-next-line no-restricted-imports\nimport {Button as UIButton} from '@sanity/ui'\nimport {useCallback, useEffect, useState} from 'react'\nimport {Grid} from 'ui5'\n\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {COMMENT_REACTION_EMOJIS} from '../../constants'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentReactionOption} from '../../types'\nimport {EmojiText} from './EmojiText.styled'\n\ninterface CommentReactionsMenuProps {\n options: CommentReactionOption[]\n onSelect: (option: CommentReactionOption) => void\n}\n\nexport function CommentReactionsMenu(props: CommentReactionsMenuProps) {\n const {options, onSelect} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n const [focusedIndex, setFocusedIndex] = useState<number>(0)\n\n const handleRootKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const focusableLen = rootElement?.querySelectorAll('button').length ?? 0\n\n if (event.key === 'ArrowRight') {\n setFocusedIndex((prev) => (prev + 1) % focusableLen)\n }\n if (event.key === 'ArrowLeft') {\n setFocusedIndex((prev) => (prev - 1 + focusableLen) % focusableLen)\n }\n // if (event.key === 'ArrowDown') {\n // setFocusedIndex((prev) => (prev + GRID_COLUMNS) % focusableLen)\n // }\n // if (event.key === 'ArrowUp') {\n // setFocusedIndex((prev) => (prev - GRID_COLUMNS + focusableLen) % focusableLen)\n // }\n },\n [rootElement],\n )\n\n const handleOptionClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n const index = rootElement\n ? Array.from(rootElement.querySelectorAll('button')).indexOf(event.currentTarget)\n : -1\n setFocusedIndex(index)\n onSelect(options[index])\n },\n [rootElement, onSelect, options],\n )\n\n // Focus the button at the focused index.\n useEffect(() => {\n if (!rootElement) return\n const focusableElements = Array.from(rootElement.querySelectorAll('button'))\n if (focusableElements.length > 0) {\n focusableElements[focusedIndex].focus()\n }\n }, [focusedIndex, rootElement])\n\n return (\n <Grid\n gridTemplateColumns=\"repeat(6, minmax(0,1fr))\"\n gap={1}\n onKeyDown={handleRootKeyDown}\n ref={setRootElement}\n role=\"menu\"\n >\n {options.map((o) => {\n const emoji = COMMENT_REACTION_EMOJIS[o.shortName]\n\n return (\n <UIButton\n key={o.shortName}\n aria-label={t('reactions.react-with-aria-label', {\n reactionName: o.title || o.shortName,\n })}\n mode=\"bleed\"\n onClick={handleOptionClick}\n padding={2}\n role=\"menuitem\"\n tabIndex={-1}\n >\n <EmojiText align=\"center\" size={2} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n </UIButton>\n )\n })}\n </Grid>\n )\n}\n","import {Card, useClickOutsideEvent} from '@sanity/ui'\nimport {cloneElement, useCallback, useMemo, useRef, useState} from 'react'\n\nimport {Popover, type PopoverProps} from '../../../../ui-components/popover/Popover'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type TFunction} from '../../../i18n/types'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentReactionOption, type CommentsUIMode} from '../../types'\nimport {CommentReactionsMenu} from './CommentReactionsMenu'\n\nconst POPOVER_FALLBACK_PLACEMENTS: PopoverProps['fallbackPlacements'] = ['top', 'bottom']\n\nexport interface CommentReactionsMenuButtonProps {\n mode: CommentsUIMode\n onMenuClose?: () => void\n onMenuOpen?: () => void\n onSelect: (option: CommentReactionOption) => void\n options: CommentReactionOption[]\n readOnly?: boolean\n renderMenuButton: (props: {\n open: boolean\n tooltipContent: string\n t: TFunction\n }) => React.JSX.Element\n}\n\nexport function CommentReactionsMenuButton(props: CommentReactionsMenuButtonProps) {\n const {onMenuClose, onMenuOpen, onSelect, options, readOnly, renderMenuButton, mode} = props\n const [buttonElement, setButtonElement] = useState<HTMLButtonElement | null>(null)\n const popoverRef = useRef<HTMLDivElement | null>(null)\n\n const [open, setOpen] = useState<boolean>(false)\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const handleClick = useCallback(() => {\n const next = !open\n setOpen(next)\n\n if (next) {\n onMenuOpen?.()\n } else {\n onMenuClose?.()\n }\n }, [onMenuClose, onMenuOpen, open])\n\n const handleClose = useCallback(() => {\n if (!open) return\n\n setOpen(false)\n onMenuClose?.()\n }, [open, onMenuClose])\n\n const handleCloseAndFocus = useCallback(() => {\n if (!open) return\n\n handleClose()\n buttonElement?.focus()\n }, [buttonElement, handleClose, open])\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n const {key, shiftKey} = event\n\n if ((shiftKey && key === 'Tab') || key === 'Escape' || key === 'Tab') {\n handleCloseAndFocus()\n }\n },\n [handleCloseAndFocus],\n )\n\n useClickOutsideEvent(handleClose, () => [popoverRef.current, buttonElement])\n\n const handleSelect = useCallback(\n (option: CommentReactionOption) => {\n onSelect(option)\n handleClose()\n },\n [handleClose, onSelect],\n )\n\n const button = useMemo(() => {\n // Get the button element from the renderMenuButton function.\n const btn = renderMenuButton({\n open,\n tooltipContent:\n mode === 'upsell'\n ? t('list-item.context-menu-add-reaction-upsell')\n : t('list-item.context-menu-add-reaction'),\n t,\n })\n\n // Clone the button element and add the necessary props.\n return cloneElement(btn, {\n 'aria-expanded': open,\n 'aria-haspopup': 'true',\n 'disabled': readOnly || mode === 'upsell',\n 'id': 'reactions-menu-button',\n 'onClick': handleClick,\n 'ref': setButtonElement,\n })\n }, [handleClick, open, readOnly, renderMenuButton, t, mode])\n\n const popoverContent = (\n <Card\n aria-labelledby=\"reactions-menu-button\"\n onKeyDown={handleKeyDown}\n padding={1}\n radius={3}\n tone=\"default\"\n >\n <CommentReactionsMenu onSelect={handleSelect} options={options} />\n </Card>\n )\n\n return (\n <Popover\n constrainSize\n content={popoverContent}\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n open={open}\n placement=\"bottom\"\n portal\n ref={popoverRef}\n tone=\"default\"\n >\n {button}\n </Popover>\n )\n}\n","import {type CurrentUser} from '@sanity/types'\nimport {styled} from 'styled-components'\nimport {type TextProps, Text, Box, Flex} from 'ui5'\n\nimport {Tooltip} from '../../../../ui-components/tooltip/Tooltip'\nimport {useListFormat} from '../../../hooks/useListFormat'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {Translate} from '../../../i18n/Translate'\nimport {useUser} from '../../../store/user/hooks'\nimport {COMMENT_REACTION_EMOJIS} from '../../constants'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentReactionShortNames} from '../../types'\nimport {EmojiText} from './EmojiText.styled'\n\nconst TEXT_SIZE: TextProps['size'] = 1\n\nconst ContentStack = styled(Flex)`\n max-width: 180px;\n`\n\nconst TextGroup = styled.div`\n display: inline-block;\n`\n\nconst InlineText = styled(Text).attrs({size: TEXT_SIZE})`\n display: inline-block !important;\n white-space: break-spaces;\n`\n\nconst TextBox = styled(Box)`\n line-height: 1;\n text-align: center;\n`\n\nconst LEADING_NON_WHITESPACE_RE = /^\\S+/\n\ninterface UserDisplayNameProps {\n currentUserId: string | null | undefined\n isFirst?: boolean\n userId: string\n}\n\nfunction UserDisplayName(props: UserDisplayNameProps): string {\n const {currentUserId, isFirst, userId} = props\n const [user] = useUser(userId)\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const isCurrentUser = Boolean(currentUserId) && currentUserId === userId\n if (isCurrentUser) {\n const context = isFirst ? 'leading' : undefined\n return t('reactions.user-list.you', {context, replace: {name: user?.displayName}})\n }\n\n return user?.displayName || t('reactions.user-list.unknown-user-fallback-name')\n}\n\ninterface CommentReactionsUsersTooltipProps {\n children: React.ReactNode\n currentUser: CurrentUser\n reactionName: CommentReactionShortNames\n userIds: string[]\n}\n\nexport function CommentReactionsUsersTooltip(props: CommentReactionsUsersTooltipProps) {\n const {children, ...restProps} = props\n\n return (\n <Tooltip\n content={<CommentReactionsUsersTooltipContent {...restProps} />}\n placement=\"bottom\"\n portal\n >\n <div>{children}</div>\n </Tooltip>\n )\n}\n\nfunction FormattedUserList({\n currentUserId,\n userIds,\n}: {\n currentUserId: string | null | undefined\n userIds: string[]\n}) {\n const listFormat = useListFormat({style: 'long', type: 'conjunction'})\n if (userIds.length === 0) return null\n\n /**\n * We need to do some surgery on the list: in some locales (such as en-US), the literal segments\n * can contain oxford commas, which we want to include as the part of the element preceeding it.\n * This ensures that we do not wrap to a new line that starts with a comma. In general, we should\n * not special case on _comma_ per se, but rather by the presence of a non-whitespace character.\n */\n const parts = listFormat.formatToParts(userIds)\n const elements: React.JSX.Element[] = []\n for (let i = 0; i < parts.length; i++) {\n const item = parts[i]\n\n if (item.type === 'literal') {\n // Add literals as-is - the next case will rewrite literals to exclude leading non-whitespace\n elements.push(\n <InlineText key={`literal-${i}`} forwardedAs=\"div\" trim={true}>\n {item.value}\n </InlineText>,\n )\n continue\n }\n\n const nextItem = parts[i + 1]\n const nextLeadsWithNonWhitespace =\n nextItem && nextItem.type === 'literal' && LEADING_NON_WHITESPACE_RE.test(nextItem.value)\n if (nextLeadsWithNonWhitespace) {\n // This is the 'oxford comma' case, where we want to include any leading non-whitespace from\n // the literal as trailing characters to the element we are currently adding.\n const [nonWhitespace = ''] = nextItem.value.match(LEADING_NON_WHITESPACE_RE) || []\n\n elements.push(\n // Key (value) is user ID, thus unique\n <TextGroup key={item.value}>\n <InlineText weight=\"medium\" forwardedAs=\"div\" trim={true}>\n <UserDisplayName currentUserId={currentUserId} isFirst={i === 0} userId={item.value} />\n </InlineText>\n <InlineText forwardedAs=\"div\" trim={true}>\n {nonWhitespace}\n </InlineText>\n </TextGroup>,\n )\n\n // Rewrite the next item to not contain this leading non-whitespace\n nextItem.value = nextItem.value.slice(nonWhitespace.length)\n continue\n }\n\n // Literals have been taken care of and returns early, so the only remaining case is that we're\n // in an element that does _not_ have a leading non-whitespace literal following it.\n elements.push(\n // Key (value) is user ID, thus unique\n <InlineText key={item.value} weight=\"medium\" forwardedAs=\"div\" trim={true}>\n <UserDisplayName currentUserId={currentUserId} isFirst={i === 0} userId={item.value} />\n </InlineText>,\n )\n }\n\n return elements\n}\n\ninterface ReactionTooltipComponentProps {\n children?: React.ReactNode\n currentUserId: string | null | undefined\n reactionName: CommentReactionShortNames\n userIds: string[]\n}\n\nfunction UserList({currentUserId, userIds}: ReactionTooltipComponentProps) {\n return <FormattedUserList currentUserId={currentUserId} userIds={userIds} />\n}\n\nfunction ReactionName({reactionName}: ReactionTooltipComponentProps) {\n return (\n <InlineText muted forwardedAs=\"div\" trim={true}>\n {reactionName}\n </InlineText>\n )\n}\n\nfunction ReactionText({children}: ReactionTooltipComponentProps) {\n return (\n <>\n <InlineText muted forwardedAs=\"div\" trim={true}>\n {children}\n </InlineText>{' '}\n <wbr />{' '}\n </>\n )\n}\n\nfunction CommentReactionsUsersTooltipContent(\n props: Omit<CommentReactionsUsersTooltipProps, 'children'>,\n) {\n const {currentUser, reactionName, userIds} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n\n return (\n <ContentStack padding={1} flexDirection=\"column\">\n <Flex justifyContent=\"center\" paddingBottom={2} paddingTop={1}>\n <EmojiText size={4} forwardedAs=\"div\" trim={true}>\n {COMMENT_REACTION_EMOJIS[reactionName]}\n </EmojiText>\n </Flex>\n\n <TextBox>\n <Translate\n t={t}\n i18nKey=\"reactions.users-reacted-with-reaction\"\n values={{reactionName}}\n components={{UserList, ReactionName, Text: ReactionText}}\n componentProps={{\n currentUserId: currentUser.sanityUserId,\n reactionName,\n userIds,\n }}\n />\n </TextBox>\n </ContentStack>\n )\n}\n","import {Card} from '@sanity/ui'\nimport {styled} from 'styled-components'\n\n/**\n * Returns a styled `<Card>` without a background.\n * This is a temporary workaround to force nested Sanity UI components to adhere to a specific tone (and bypass color mixing).\n *\n * TODO: consider exposing an unstable prop in Sanity UI to facilitate this.\n */\nexport const TransparentCard = styled(Card)`\n background: none;\n`\n","import {type CurrentUser} from '@sanity/types'\n// oxlint-disable-next-line no-restricted-imports\nimport {Button as UIButton} from '@sanity/ui'\nimport {memo, useCallback, useMemo, useState} from 'react'\nimport {Text, Flex, Icon} from 'ui5'\n\nimport {Tooltip} from '../../../../ui-components/tooltip/Tooltip'\nimport {TooltipDelayGroupProvider} from '../../../../ui-components/tooltipDelayGroupProvider/TooltipDelayGroupProvider'\nimport {COMMENT_REACTION_EMOJIS, COMMENT_REACTION_OPTIONS} from '../../constants'\nimport {\n type CommentReactionItem,\n type CommentReactionOption,\n type CommentReactionShortNames,\n type CommentsUIMode,\n} from '../../types'\nimport {ReactionIcon} from '../icons/ReactionIcon'\nimport {CommentReactionsMenuButton} from './CommentReactionsMenuButton'\nimport {CommentReactionsUsersTooltip} from './CommentReactionsUsersTooltip'\nimport {EmojiText} from './EmojiText.styled'\nimport {TransparentCard} from './TransparentCard.styled'\n\n/**\n * A function that groups reactions by name. For example:\n *\n * ```js\n * [\n * [':name:', [{shortName: ':name:', userId: 'user1'}, {shortName: ':name:', userId: 'user2'}],\n * [':name2:', [{shortName: ':name2:', userId: 'user1'}]\n * ]\n *```\n */\nfunction groupReactionsByName(reactions: CommentReactionItem[]) {\n const grouped = reactions.reduce(\n (acc, reaction) => {\n const {shortName} = reaction\n\n if (!acc[shortName]) {\n acc[shortName] = []\n }\n\n acc[shortName].push(reaction)\n\n return acc\n },\n {} as Record<CommentReactionShortNames, CommentReactionItem[]>,\n )\n\n // Sort based on the first appearance of the reaction in `reactions` array.\n // This is to ensure that the order of the reactions is consistent so that\n // the reactions are not jumping around when new reactions are added.\n const sorted = Object.entries(grouped).sort(([nameA], [nameB]) => {\n const indexA = reactions.findIndex((r) => r.shortName === nameA)\n const indexB = reactions.findIndex((r) => r.shortName === nameB)\n\n return indexA - indexB\n })\n\n return sorted as [CommentReactionShortNames, CommentReactionItem[]][]\n}\n\nconst renderMenuButton = ({open, tooltipContent}: {open: boolean; tooltipContent: string}) => {\n return (\n <UIButton fontSize={1} mode=\"ghost\" padding={0} radius=\"full\" selected={open}>\n <Flex paddingX={3} paddingY={2}>\n <Tooltip animate content={tooltipContent} disabled={open}>\n <Icon size={1} icon={ReactionIcon} style={{margin: '-0.375rem'}} />\n </Tooltip>\n </Flex>\n </UIButton>\n )\n}\n\ninterface CommentReactionsBarProps {\n currentUser: CurrentUser\n onSelect: (reaction: CommentReactionOption) => void\n reactions: CommentReactionItem[]\n readOnly?: boolean\n mode: CommentsUIMode\n}\n\nexport const CommentReactionsBar = memo(function CommentReactionsBar(\n props: CommentReactionsBarProps,\n) {\n const {currentUser, onSelect, reactions, readOnly, mode} = props\n const handleSelect = useCallback(\n (name: CommentReactionShortNames) => {\n const option = COMMENT_REACTION_OPTIONS.find((o) => o.shortName === name)\n\n if (option) {\n onSelect(option)\n }\n },\n [onSelect],\n )\n\n // The list of the current user's reactions, e.g. [':+1:', ':heart:']\n const currentUserReactionNames = useMemo(() => {\n return reactions.filter((r) => r.userId === currentUser?.sanityUserId).map((r) => r.shortName)\n }, [currentUser?.sanityUserId, reactions])\n\n // Reactions grouped by name, e.g. [ [':+1:', [{shortName: ':+1:', userId: 'user1'}] ] ]\n const groupedReactions = useMemo(() => {\n const grouped = groupReactionsByName(reactions)\n\n // Filter out reactions that are not in the `COMMENT_REACTION_EMOJIS` map.\n return grouped.filter(([name]) => COMMENT_REACTION_EMOJIS[name])\n }, [reactions])\n\n const [sortedGroupedReactions, setSortedGroupedReactions] = useState(() => ({\n // An array of the initial order of the reactions. This is used to sort the reactions.\n // E.g. [':+1:', ':heart:']\n sortOrder: Object.keys(Object.fromEntries(groupedReactions)),\n // We cache the groupedReactions to know when we should update the sortedReactions, ensuring we don't run into an infinite render loop.\n groupedReactions: [] as typeof groupedReactions,\n sortedReactions: [] as typeof groupedReactions,\n }))\n // Sort the reactions based on the initial order to make sure that the reactions\n // are not jumping around when new reactions are added.\n let {sortedReactions} = sortedGroupedReactions\n if (sortedGroupedReactions.groupedReactions !== groupedReactions) {\n const {sortOrder} = sortedGroupedReactions\n sortedReactions = groupedReactions.sort(([nameA], [nameB]) => {\n const indexA = sortOrder.indexOf(nameA)\n const indexB = sortOrder.indexOf(nameB)\n\n if (indexA === -1) {\n return 1\n }\n\n if (indexB === -1) {\n return -1\n }\n\n return indexA - indexB\n })\n\n setSortedGroupedReactions({\n groupedReactions,\n sortOrder: sortedReactions.map(([name]) => name),\n sortedReactions,\n })\n }\n\n return (\n <Flex alignItems=\"center\" gap={1} flexWrap=\"wrap\">\n <TooltipDelayGroupProvider>\n {sortedReactions.map(([name, reactionsList]) => {\n const hasReacted = currentUserReactionNames.includes(name)\n const userIds = reactionsList.map((r) => r.userId)\n const emoji = COMMENT_REACTION_EMOJIS[name]\n\n return (\n <CommentReactionsUsersTooltip\n key={name}\n currentUser={currentUser}\n reactionName={name}\n userIds={userIds}\n >\n <TransparentCard tone=\"default\">\n <UIButton\n disabled={readOnly || mode === 'upsell'}\n mode=\"ghost\"\n onClick={() => handleSelect(name)}\n padding={2}\n radius=\"full\"\n selected={hasReacted}\n tone={hasReacted ? 'primary' : 'default'}\n >\n <Flex alignItems=\"center\" gap={1}>\n <EmojiText size={1} forwardedAs=\"div\" trim={true}>\n {emoji}\n </EmojiText>\n\n <Text size={0} weight={hasReacted ? 'semibold' : 'medium'} as=\"div\" trim={true}>\n {reactionsList?.length}\n </Text>\n </Flex>\n </UIButton>\n </TransparentCard>\n </CommentReactionsUsersTooltip>\n )\n })}\n\n <TransparentCard tone=\"default\">\n <CommentReactionsMenuButton\n mode={mode}\n onSelect={(o) => handleSelect(o.shortName)}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n </TransparentCard>\n </TooltipDelayGroupProvider>\n </Flex>\n )\n})\n","import {Card, Text} from '@sanity/ui'\nimport {styled} from 'styled-components'\nimport {Flex} from 'ui5'\n\nimport {CircleSmallIcon} from '../../../components/temporary-icons/CircleSmall'\nimport {RingIcon} from '../../../components/temporary-icons/Ring'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\n\nexport type CommentOrigin = 'draft' | 'published'\n\n/**\n * Same slot as `DocumentVersionsStatusIndicator`: `@sanity/ui` Text sizes the\n * 1em glyphs and applies `--card-icon-color`. ui5 `Icon` paints\n * `--foreground-high` and drops the draft orange / published green.\n */\nconst IconSlotRoot = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n\n &[data-status='published'] {\n --card-icon-color: var(--card-badge-positive-dot-color);\n }\n &[data-status='draft'] {\n --card-icon-color: var(--card-badge-caution-dot-color);\n }\n`\n\nfunction getOriginI18nKey(origin: CommentOrigin) {\n switch (origin) {\n case 'draft':\n return 'list-item.origin.draft'\n case 'published':\n return 'list-item.origin.published'\n default:\n origin satisfies never\n return origin\n }\n}\n\nexport function CommentOriginBadge({origin}: {origin: CommentOrigin}) {\n const {t} = useTranslation(commentsLocaleNamespace)\n\n return (\n <Flex marginBottom={2}>\n <Card border padding={1} radius={3}>\n <Flex alignItems=\"center\" gap={1} paddingRight={1}>\n <IconSlotRoot data-status={origin}>\n <Text size={2}>{origin === 'draft' ? <RingIcon /> : <CircleSmallIcon />}</Text>\n </IconSlotRoot>\n\n <Text size={0} muted weight=\"medium\">\n {t(getOriginI18nKey(origin))}\n </Text>\n </Flex>\n </Card>\n </Flex>\n )\n}\n","import {CheckmarkCircleIcon} from '@sanity/icons/CheckmarkCircle'\nimport {EditIcon} from '@sanity/icons/Edit'\nimport {LinkIcon} from '@sanity/icons/Link'\nimport {TrashIcon} from '@sanity/icons/Trash'\nimport {UndoIcon} from '@sanity/icons/Undo'\nimport {Card} from '@sanity/ui'\nimport {Menu, MenuDivider} from '@sanity/ui/menu'\nimport {styled} from 'styled-components'\nimport {Flex} from 'ui5'\n\nimport {Button} from '../../../../ui-components/button/Button'\nimport {MenuButton, type MenuButtonProps} from '../../../../ui-components/menuButton/MenuButton'\nimport {MenuItem} from '../../../../ui-components/menuItem/MenuItem'\nimport {TooltipDelayGroupProvider} from '../../../../ui-components/tooltipDelayGroupProvider/TooltipDelayGroupProvider'\nimport {ContextMenuButton} from '../../../components/contextMenuButton/ContextMenuButton'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type TFunction} from '../../../i18n/types'\nimport {COMMENT_REACTION_OPTIONS} from '../../constants'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentReactionOption, type CommentStatus, type CommentsUIMode} from '../../types'\nimport {ReactionIcon} from '../icons/ReactionIcon'\nimport {CommentReactionsMenuButton} from '../reactions/CommentReactionsMenuButton'\n\nconst renderMenuButton = ({\n open,\n tooltipContent,\n t,\n}: {\n open: boolean\n tooltipContent: string\n t: TFunction\n}) => (\n <Button\n aria-label={t('list-item.context-menu-add-reaction-aria-label')}\n icon={ReactionIcon}\n mode=\"bleed\"\n selected={open}\n tooltipProps={{content: tooltipContent}}\n />\n)\n\nconst POPOVER_PROPS: MenuButtonProps['popover'] = {\n placement: 'bottom-end',\n}\n\nconst FloatingCard = styled(Card)`\n &:empty {\n display: none;\n }\n`\n\ninterface CommentsListItemContextMenuProps {\n canDelete: boolean | undefined\n canEdit: boolean | undefined\n isParent: boolean | undefined\n mode: CommentsUIMode\n onCopyLink?: () => void\n onDeleteStart?: () => void\n onEditStart?: () => void\n onMenuClose?: () => void\n onMenuOpen?: () => void\n onReactionSelect?: (option: CommentReactionOption) => void\n onStatusChange?: () => void\n readOnly?: boolean\n status: CommentStatus\n}\n\nexport function CommentsListItemContextMenu(props: CommentsListItemContextMenuProps) {\n const {\n canDelete,\n canEdit,\n isParent,\n mode,\n onCopyLink,\n onDeleteStart,\n onEditStart,\n onMenuClose,\n onMenuOpen,\n onReactionSelect,\n onStatusChange,\n readOnly,\n status,\n } = props\n\n const showMenuButton = Boolean(onCopyLink || onDeleteStart || onEditStart)\n\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const hasContextMenuOptions = Boolean(canDelete || canEdit || onCopyLink)\n return (\n <TooltipDelayGroupProvider>\n <Flex>\n <FloatingCard display=\"flex\" shadow={2} padding={1} radius={2} sizing=\"border\">\n {onReactionSelect && (\n <CommentReactionsMenuButton\n mode={mode}\n onMenuClose={onMenuClose}\n onMenuOpen={onMenuOpen}\n onSelect={onReactionSelect}\n options={COMMENT_REACTION_OPTIONS}\n readOnly={readOnly}\n renderMenuButton={renderMenuButton}\n />\n )}\n\n {isParent && onStatusChange && (\n <Button\n aria-label={\n status === 'open'\n ? t('list-item.resolved-tooltip-aria-label')\n : t('list-item.re-open-resolved-aria-label')\n }\n data-testid=\"comments-list-item-status-button\"\n disabled={readOnly}\n icon={status === 'open' ? CheckmarkCircleIcon : UndoIcon}\n mode=\"bleed\"\n onClick={onStatusChange}\n tooltipProps={{\n content:\n status === 'open'\n ? t('list-item.resolved-tooltip-content')\n : t('list-item.re-open-resolved'),\n }}\n />\n )}\n\n {hasContextMenuOptions && (\n <MenuButton\n id=\"comment-actions-menu\"\n button={\n <ContextMenuButton\n aria-label={t('list-item.open-menu-aria-label')}\n disabled={readOnly}\n hidden={!showMenuButton}\n />\n }\n onOpen={onMenuOpen}\n onClose={onMenuClose}\n menu={\n <Menu>\n <MenuItem\n hidden={!canEdit}\n icon={EditIcon}\n onClick={onEditStart}\n text={t('list-item.edit-comment')}\n tooltipProps={\n mode === 'upsell' ? {content: t('list-item.edit-comment-upsell')} : undefined\n }\n disabled={mode === 'upsell'}\n />\n\n <MenuItem\n hidden={!canDelete}\n icon={TrashIcon}\n onClick={onDeleteStart}\n text={t('list-item.delete-comment')}\n tone=\"critical\"\n />\n\n {onCopyLink && <MenuDivider hidden={!canDelete && !canEdit} />}\n\n <MenuItem\n hidden={!onCopyLink}\n icon={LinkIcon}\n onClick={onCopyLink}\n text={t('list-item.copy-link')}\n />\n </Menu>\n }\n popover={POPOVER_PROPS}\n />\n )}\n </FloatingCard>\n </Flex>\n </TooltipDelayGroupProvider>\n )\n}\n","import {toPlainText} from '@portabletext/react'\nimport {hues} from '@sanity/color'\nimport {LinkRemovedIcon} from '@sanity/icons/LinkRemoved'\nimport {isPortableTextTextBlock} from '@sanity/types'\nimport {type Theme} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport {css, styled} from 'styled-components'\nimport {Text, Box, Flex, Icon} from 'ui5'\n\nimport {Tooltip} from '../../../../ui-components/tooltip/Tooltip'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {COMMENTS_HIGHLIGHT_HUE_KEY} from '../../constants'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentDocument} from '../../types'\n\nfunction truncate(str: string, length = 250) {\n if (str.length <= length) return str\n return `${str.slice(0, length)}...`\n}\n\ninterface BlockQuoteStackProps {\n $hasReferencedValue: boolean\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n theme: Theme\n}\n\nconst InlineBox = styled(Box).attrs({marginLeft: 1, marginRight: 2})`\n &:not([data-hidden]) {\n display: inline;\n }\n`\n\nconst BlockQuoteStack = styled(Flex)<BlockQuoteStackProps>(({theme, $hasReferencedValue}) => {\n const isDark = theme.sanity.v2?.color._dark\n\n const hue = $hasReferencedValue ? COMMENTS_HIGHLIGHT_HUE_KEY : 'gray'\n const borderColor = isDark ? hues[hue][700].hex : hues[hue][300].hex\n\n return css`\n border-left: 2px solid ${borderColor};\n word-break: break-word;\n `\n})\n\ninterface CommentsListItemReferencedValueProps {\n hasReferencedValue: boolean | undefined\n value: CommentDocument['contentSnapshot']\n}\n\nexport function CommentsListItemReferencedValue(props: CommentsListItemReferencedValueProps) {\n const {hasReferencedValue, value} = props\n\n const {t} = useTranslation(commentsLocaleNamespace)\n const tooltipText = t('list-item.missing-referenced-value-tooltip-content')\n\n const resolvedValue = useMemo(() => {\n if (Array.isArray(value) && value?.filter(isPortableTextTextBlock).length > 0) {\n const text = value?.map(toPlainText).join(' ')\n const truncated = truncate(text)\n\n return truncated\n }\n\n return null\n }, [value])\n\n if (!resolvedValue) return null\n\n return (\n <BlockQuoteStack\n $hasReferencedValue={Boolean(hasReferencedValue)}\n data-testid=\"comments-list-item-referenced-value\"\n flexBasis=\"0%\"\n flexGrow={1}\n flexDirection=\"column\"\n forwardedAs=\"blockquote\"\n padding={1}\n paddingLeft={2}\n >\n <Flex alignItems=\"flex-start\">\n <Text size={1} muted as=\"div\" trim={true}>\n {!hasReferencedValue && (\n <Tooltip content={tooltipText}>\n <InlineBox>\n <Icon size={1} icon={LinkRemovedIcon} style={{margin: '-0.375rem'}} />\n </InlineBox>\n </Tooltip>\n )}\n\n {resolvedValue}\n </Text>\n </Flex>\n </BlockQuoteStack>\n )\n}\n","import {hues} from '@sanity/color'\nimport {type CurrentUser} from '@sanity/types'\nimport {type AvatarSize, Card, TextSkeleton, useClickOutsideEvent} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport {useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport {IntentLink} from 'sanity/router'\nimport {css, styled} from 'styled-components'\nimport {Text, Box, Flex, VStack} from 'ui5'\n\nimport {useDidUpdate} from '../../../form/hooks/useDidUpdate'\nimport {useDateTimeFormat} from '../../../hooks/useDateTimeFormat'\nimport {type RelativeTimeOptions, useRelativeTime} from '../../../hooks/useRelativeTime'\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {Translate} from '../../../i18n/Translate'\nimport {useUser} from '../../../store/user/hooks'\nimport {isDraftId, isPublishedId} from '../../../util/draftUtils'\nimport {hasCommentMessageValue, isTextSelectionComment, useCommentHasChanged} from '../../helpers'\nimport {useComments} from '../../hooks/useComments'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {\n type CommentContext,\n type CommentDocument,\n type CommentMessage,\n type CommentReactionOption,\n type CommentStatus,\n type CommentsUIMode,\n type CommentUpdatePayload,\n} from '../../types'\nimport {CommentsAvatar} from '../avatars/CommentsAvatar'\nimport {SpacerAvatar} from '../avatars/SpacerAvatar'\nimport {FLEX_GAP} from '../constants'\nimport {CommentInput, type CommentInputHandle} from '../pte/comment-input/CommentInput'\nimport {CommentMessageSerializer} from '../pte/CommentMessageSerializer'\nimport {CommentReactionsBar} from '../reactions/CommentReactionsBar'\nimport {type CommentOrigin, CommentOriginBadge} from './CommentOriginBadge'\nimport {CommentsListItemContextMenu} from './CommentsListItemContextMenu'\nimport {CommentsListItemReferencedValue} from './CommentsListItemReferencedValue'\n\nconst stopPropagation = (e: React.MouseEvent<HTMLDivElement>) => e.stopPropagation()\n\nfunction CommentIntentLink({\n children,\n intent,\n}: {\n children?: React.ReactNode\n intent?: CommentContext['intent']\n}) {\n if (!intent) return null\n return (\n <IntentLink params={intent.params} intent={intent.name}>\n {children}\n </IntentLink>\n )\n}\n\nconst ContextMenuBox = styled(Box)``\n\nconst SKELETON_INLINE_STYLE: React.CSSProperties = {width: '50%'}\n\nconst EMPTY_ARRAY: [] = []\n\nconst TimeText = styled(Text)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const isDark = theme.sanity.color.dark\n const fg = hues.gray[isDark ? 200 : 800].hex\n\n return css`\n min-width: max-content;\n --card-fg-color: ${fg};\n color: var(--card-fg-color);\n `\n})\n\nconst HeaderFlex = styled(Flex)<{$size: AvatarSize}>((props) => {\n const theme = getTheme_v2(props.theme)\n\n return css`\n min-height: ${theme.avatar.sizes[props.$size]?.size}px;\n `\n})\n\nconst IntentText = styled(Text)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const isDark = theme.sanity.color.dark\n const fg = hues.gray[isDark ? 200 : 800].hex\n\n return css`\n --card-fg-color: ${fg};\n color: var(--card-fg-color);\n `\n})\n\nconst InnerStack = styled(VStack)`\n transition: opacity 200ms ease;\n\n &[data-muted='true'] {\n transition: unset;\n opacity: 0.5;\n }\n`\n\nconst ErrorFlex = styled(Flex)<{$size: AvatarSize}>((props) => {\n const theme = getTheme_v2(props.theme)\n\n return css`\n min-height: ${theme.avatar.sizes[props.$size]?.size}px;\n `\n})\n\nconst RetryCardButton = styled(Card)`\n /* Add not on hover */\n &:not(:hover) {\n background-color: transparent;\n }\n`\n\nconst RootStack = styled(VStack)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {space} = theme.sanity\n\n return css`\n position: relative;\n\n /* Only show the floating layer on hover when hover is supported.\n Else, the layer is always visible. */\n @media (hover: hover) {\n ${ContextMenuBox} {\n opacity: 0;\n position: absolute;\n right: 0;\n top: 0;\n transform: translate(${space[1]}px, -${space[1]}px);\n }\n\n ${ContextMenuBox} {\n &:focus-within {\n opacity: 1;\n }\n }\n\n &:hover {\n ${ContextMenuBox} {\n opacity: 1;\n }\n }\n }\n\n &[data-menu-open='true'] {\n ${ContextMenuBox} {\n opacity: 1;\n }\n }\n `\n})\n\ninterface CommentsListItemLayoutProps {\n avatarSize?: AvatarSize\n canDelete?: boolean\n canEdit?: boolean\n comment: CommentDocument\n currentUser: CurrentUser\n hasError?: boolean\n hasReferencedValue?: boolean\n intent?: CommentContext['intent']\n isParent?: boolean\n isRetrying?: boolean\n mentionOptions: UserListWithPermissionsHookValue\n mode: CommentsUIMode\n onCopyLink?: (id: string) => void\n onCreateRetry?: (id: string) => void\n onDelete: (id: string) => void\n onEdit: (id: string, message: CommentUpdatePayload) => void\n onInputKeyDown?: (event: React.KeyboardEvent) => void\n onReactionSelect?: (id: string, reaction: CommentReactionOption) => void\n onStatusChange?: (id: string, status: CommentStatus) => void\n readOnly?: boolean\n withAvatar?: boolean\n}\n\n/**\n * The document a comment was made on, when that isn't the document being viewed.\n * Only draft vs published: versions and other ids return `null`.\n */\nexport function getForeignCommentOrigin(\n comment: CommentDocument,\n versionId: string | undefined,\n): CommentOrigin | null {\n const source = comment.target?.sourceDocumentId\n if (!source || !versionId || source === versionId) return null\n if (!(isDraftId(source) || isPublishedId(source))) return null\n if (!(isDraftId(versionId) || isPublishedId(versionId))) return null\n return isDraftId(source) ? 'draft' : 'published'\n}\n\nconst RELATIVE_TIME_OPTIONS: RelativeTimeOptions = {useTemporalPhrase: true}\n\nexport function CommentsListItemLayout(props: CommentsListItemLayoutProps) {\n const {\n avatarSize = 1,\n canDelete,\n canEdit,\n comment,\n currentUser,\n hasError,\n hasReferencedValue,\n intent,\n isParent,\n isRetrying,\n mentionOptions,\n mode,\n onCopyLink,\n onCreateRetry,\n onDelete,\n onEdit,\n onInputKeyDown,\n onReactionSelect,\n onStatusChange,\n readOnly,\n withAvatar = true,\n } = props\n const {_createdAt, message, _id, lastEditedAt} = comment\n const authorId = comment._system.createdBy\n const [user] = useUser(authorId)\n const {t} = useTranslation(commentsLocaleNamespace)\n const {versionId} = useComments()\n const foreignOrigin = isParent ? getForeignCommentOrigin(comment, versionId) : null\n\n const [value, setValue] = useState<CommentMessage>(message)\n const [isEditing, setIsEditing] = useState<boolean>(false)\n const rootElementRef = useRef<HTMLDivElement | null>(null)\n const startMessage = useRef<CommentMessage>(message)\n const [menuOpen, setMenuOpen] = useState<boolean>(false)\n\n const commentInputRef = useRef<CommentInputHandle>(null)\n\n const hasChanges = useCommentHasChanged(value)\n const hasValue = useMemo(() => hasCommentMessageValue(value), [value])\n\n // Filter out reactions that's been optimistically removed from the comment.\n const reactions = (\n comment?.reactions?.filter((r) => r?._optimisticState !== 'removed') || EMPTY_ARRAY\n ).filter((r) => {\n // Filter out reactions that might have to incorrect format\n return 'userId' in r && 'shortName' in r\n })\n\n const hasReactions = Boolean(reactions?.length)\n\n const createdDate = _createdAt ? new Date(_createdAt) : new Date()\n const editedDate = lastEditedAt ? new Date(lastEditedAt) : null\n const createdTimeAgo = useRelativeTime(createdDate, RELATIVE_TIME_OPTIONS)\n const dateTimeFormat = useDateTimeFormat({\n dateStyle: 'full',\n timeStyle: 'medium',\n })\n const formattedCreatedAt = dateTimeFormat.format(createdDate)\n const formattedLastEditAt = editedDate ? dateTimeFormat.format(editedDate) : null\n const displayError = hasError || isRetrying\n\n // If the message has changed we need to update the value in the state\n // so that, when the user starts editing, the input is populated with the\n // latest message value.\n useEffect(() => {\n if (isEditing) return\n\n startMessage.current = message\n // oxlint-disable-next-line react/set-state-in-effect -- pre-existing violation, to be fixed in a follow-up\n setValue(message)\n }, [isEditing, message])\n\n const handleMenuOpen = useCallback(() => setMenuOpen(true), [])\n const handleMenuClose = useCallback(() => setMenuOpen(false), [])\n const handleCopyLink = useCallback(() => onCopyLink?.(_id), [_id, onCopyLink])\n const handleCreateRetry = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation()\n onCreateRetry?.(_id)\n },\n [_id, onCreateRetry],\n )\n const handleDelete = useCallback(() => onDelete(_id), [_id, onDelete])\n\n const cancelEdit = useCallback(() => {\n setIsEditing(false)\n setValue(startMessage.current)\n }, [])\n\n const startDiscard = useCallback(() => {\n if (!hasValue || !hasChanges) {\n cancelEdit()\n return\n }\n commentInputRef.current?.discardDialogController.open()\n }, [cancelEdit, hasChanges, hasValue])\n\n const handleInputKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard the input text\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n // Call parent handler\n if (onInputKeyDown) onInputKeyDown(event)\n },\n [onInputKeyDown, startDiscard],\n )\n\n const cancelDiscard = useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n }, [])\n\n const confirmDiscard = useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n cancelEdit()\n }, [cancelEdit])\n\n const handleReactionSelect = useCallback(\n (reaction: CommentReactionOption) => {\n onReactionSelect?.(_id, reaction)\n },\n [_id, onReactionSelect],\n )\n\n const handleEditSubmit = useCallback(\n (nextValue: CommentMessage) => {\n onEdit(_id, {message: nextValue})\n setIsEditing(false)\n },\n [_id, onEdit],\n )\n\n const handleOpenStatusChange = useCallback(() => {\n onStatusChange?.(_id, comment.status === 'open' ? 'resolved' : 'open')\n }, [_id, comment.status, onStatusChange])\n\n const toggleEdit = useCallback(() => {\n setIsEditing((v) => !v)\n }, [])\n\n const handleCloseMenu = useCallback(() => setMenuOpen(false), [])\n\n const handleRootKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && !hasChanges) {\n cancelEdit()\n }\n },\n [cancelEdit, hasChanges],\n )\n\n useDidUpdate(isEditing, handleCloseMenu)\n\n useClickOutsideEvent(!hasChanges && cancelEdit, () => [rootElementRef.current])\n\n const name = user?.displayName ? (\n <Text size={1} weight=\"medium\" truncate={1} title={user.displayName} as=\"div\" trim={true}>\n {user.displayName}\n </Text>\n ) : (\n <TextSkeleton size={1} style={SKELETON_INLINE_STYLE} />\n )\n\n return (\n <RootStack\n data-menu-open={menuOpen ? 'true' : 'false'}\n data-testid=\"comments-list-item-layout\"\n onKeyDown={handleRootKeyDown}\n ref={rootElementRef}\n gap={4}\n >\n <InnerStack gap={1} data-muted={displayError}>\n {foreignOrigin && <CommentOriginBadge origin={foreignOrigin} />}\n\n <HeaderFlex\n alignItems=\"center\"\n gap={FLEX_GAP}\n flexBasis=\"0%\"\n flexGrow={1}\n $size={avatarSize}\n >\n {withAvatar && <CommentsAvatar user={user} size={avatarSize} />}\n\n <Flex flexDirection=\"column\" gap={2} paddingY={intent ? 2 : 0}>\n <Flex\n alignItems=\"center\"\n paddingBottom={comment.context?.intent ? 0 : 1}\n flexBasis=\"0%\"\n flexGrow={1}\n >\n <Flex alignItems=\"flex-end\" gap={2}>\n <Box flexBasis=\"0%\" flexGrow={1}>\n {name}\n </Box>\n\n {!displayError && (\n <Flex alignItems=\"center\" gap={1}>\n <TimeText muted size={0} forwardedAs=\"div\" trim={true}>\n <time dateTime={createdDate.toISOString()} title={formattedCreatedAt}>\n {createdTimeAgo}\n </time>\n </TimeText>\n\n {formattedLastEditAt && editedDate && (\n <TimeText\n muted\n size={0}\n title={formattedLastEditAt}\n forwardedAs=\"div\"\n trim={true}\n >\n <time dateTime={editedDate.toISOString()} title={formattedLastEditAt}>\n ({t('list-item.layout-edited')})\n </time>\n </TimeText>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {intent && (\n <Box flexBasis=\"0%\" flexGrow={1}>\n <IntentText muted size={0} truncate={1} forwardedAs=\"div\" trim={true}>\n <Translate\n t={t}\n i18nKey=\"list-item.layout-context\"\n values={{title: intent.title, intent: 'edit'}}\n components={{IntentLink: CommentIntentLink}}\n componentProps={{intent}}\n />\n </IntentText>\n </Box>\n )}\n </Flex>\n\n {!isEditing && !displayError && (\n <ContextMenuBox data-root-menu={isParent ? 'true' : 'false'} onClick={stopPropagation}>\n <CommentsListItemContextMenu\n canDelete={canDelete}\n canEdit={canEdit}\n isParent={isParent}\n mode={mode}\n onCopyLink={onCopyLink ? handleCopyLink : undefined}\n onDeleteStart={handleDelete}\n onEditStart={toggleEdit}\n onMenuClose={handleMenuClose}\n onMenuOpen={handleMenuOpen}\n onReactionSelect={handleReactionSelect}\n onStatusChange={onStatusChange ? handleOpenStatusChange : undefined}\n readOnly={readOnly}\n status={comment.status}\n />\n </ContextMenuBox>\n )}\n </HeaderFlex>\n\n {isTextSelectionComment(comment) && Boolean(comment?.contentSnapshot) && (\n <Flex gap={FLEX_GAP} marginBottom={3}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentsListItemReferencedValue\n hasReferencedValue={hasReferencedValue}\n value={comment?.contentSnapshot}\n />\n </Flex>\n )}\n\n {isEditing && (\n <Flex alignItems=\"flex-start\" gap={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex flexBasis=\"0%\" flexGrow={1} flexDirection=\"column\">\n <CommentInput\n currentUser={currentUser}\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleEditSubmit}\n readOnly={readOnly}\n ref={commentInputRef}\n value={value}\n withAvatar={false}\n />\n </Flex>\n </Flex>\n )}\n\n {!isEditing && (\n <Flex gap={FLEX_GAP}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <CommentMessageSerializer blocks={message} />\n </Flex>\n )}\n\n {hasReactions && (\n <Flex gap={FLEX_GAP} marginTop={2}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Box onClick={stopPropagation}>\n <CommentReactionsBar\n currentUser={currentUser}\n mode={mode}\n onSelect={handleReactionSelect}\n reactions={reactions}\n readOnly={readOnly}\n />\n </Box>\n </Flex>\n )}\n </InnerStack>\n\n {displayError && (\n <ErrorFlex gap={FLEX_GAP} $size={avatarSize}>\n {withAvatar && <SpacerAvatar $size={avatarSize} />}\n\n <Flex alignItems=\"center\" gap={1} flexBasis=\"0%\" flexGrow={1}>\n <Text muted size={1} as=\"div\" trim={true}>\n {hasError && t('list-item.layout-failed-sent')}\n {isRetrying && t('list-item.layout-posting')}\n </Text>\n\n <Flex hidden={isRetrying}>\n <RetryCardButton\n __unstable_focusRing\n display=\"flex\"\n forwardedAs=\"button\"\n onClick={handleCreateRetry}\n padding={1}\n radius={2}\n tone=\"primary\"\n >\n <Text size={1} muted as=\"div\" trim={true}>\n {t('list-item.layout-retry')}\n </Text>\n </RetryCardButton>\n </Flex>\n </Flex>\n </ErrorFlex>\n )}\n </RootStack>\n )\n}\n","import {hues} from '@sanity/color'\nimport {Card} from '@sanity/ui'\nimport {css, styled} from 'styled-components'\n\nimport {COMMENTS_HIGHLIGHT_HUE_KEY} from '../../constants'\n\nexport const ThreadCard = styled(Card).attrs({padding: 3, radius: 3, sizing: 'border'})((props) => {\n const {theme} = props\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const isDark = theme.sanity.color.dark\n const activeBg = hues[COMMENTS_HIGHLIGHT_HUE_KEY][isDark ? 900 : 50].hex\n const defaultBg = hues.gray[isDark ? 900 : 50].hex\n\n return css`\n background-color: ${defaultBg};\n\n &[data-active='true'] {\n background-color: ${activeBg};\n }\n `\n})\n","import {ChevronDownIcon} from '@sanity/icons/ChevronDown'\nimport {type CurrentUser} from '@sanity/types'\nimport {type AvatarSize, useLayer} from '@sanity/ui'\nimport {\n type KeyboardEvent,\n memo,\n type MouseEvent,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport {css, styled} from 'styled-components'\nimport {type PaddingProps, Flex, VStack} from 'ui5'\n\nimport {Button} from '../../../../ui-components/button/Button'\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type CommentsSelectedPath} from '../../context/selected-path/types'\nimport {commentIntentIfDiffers, hasCommentMessageValue} from '../../helpers'\nimport {applyCommentIdAttr} from '../../hooks/useCommentsScroll'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {\n type CommentBaseCreatePayload,\n type CommentDocument,\n type CommentMessage,\n type CommentReactionOption,\n type CommentStatus,\n type CommentsUIMode,\n type CommentUpdatePayload,\n} from '../../types'\nimport {SpacerAvatar} from '../avatars/SpacerAvatar'\nimport {CommentInput, type CommentInputHandle} from '../pte/comment-input/CommentInput'\nimport {CommentsListItemLayout} from './CommentsListItemLayout'\nimport {ThreadCard} from './styles'\n\nconst EMPTY_ARRAY: [] = []\n\nconst MAX_COLLAPSED_REPLIES = 5\n\nconst DEFAULT_AVATAR_CONFIG: CommentsListItemProps['avatarConfig'] = {\n avatarSize: 1,\n parentCommentAvatar: true,\n replyAvatar: true,\n threadCommentsAvatar: true,\n}\n\n// data-active = when the comment is selected\n// data-hovered = when the mouse is over the comment\nconst StyledThreadCard = styled(ThreadCard)(() => {\n return css`\n position: relative;\n\n &:has(> [data-ui='GhostButton']:focus:focus-visible) {\n box-shadow:\n inset 0 0 0 1px var(--card-border-color),\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 2px var(--card-focus-ring-color);\n }\n\n // The hover styles is managed with the [data-hovered] attribute instead of the :hover pseudo class\n // since we want to show the hover styles when hovering over the menu items in the context menu as well.\n // The context menu is rendered using a portal, so the :hover pseudo class won't work when hovering over\n // the menu items.\n &:not([data-active='true']) {\n @media (hover: hover) {\n &[data-hovered='true'] {\n [data-root-menu='true'] {\n opacity: 1;\n }\n }\n }\n }\n `\n})\n\nconst ExpandButton = styled(Button)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {medium} = theme.sanity.fonts.text.weights\n\n return css`\n font-weight: ${medium};\n `\n})\n\nconst GhostButton = styled.button`\n opacity: 0;\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n left: 0;\n`\n\nexport interface CommentsListItemProps {\n avatarConfig?: {\n avatarSize: AvatarSize\n parentCommentAvatar: boolean\n replyAvatar: boolean\n threadCommentsAvatar: boolean\n }\n canReply?: boolean\n currentUser: CurrentUser\n hasReferencedValue?: boolean\n innerPadding?: PaddingProps['padding']\n isSelected: boolean\n mentionOptions: UserListWithPermissionsHookValue\n mode: CommentsUIMode\n onCopyLink?: (id: string) => void\n onCreateRetry: (id: string) => void\n onDelete: (id: string) => void\n onEdit: (id: string, payload: CommentUpdatePayload) => void\n onKeyDown?: (event: KeyboardEvent) => void\n onPathSelect?: (nextPath: CommentsSelectedPath) => void\n onReactionSelect?: (id: string, reaction: CommentReactionOption) => void\n onReply: (payload: CommentBaseCreatePayload) => void\n onStatusChange?: (id: string, status: CommentStatus) => void\n parentComment: CommentDocument\n readOnly?: boolean\n replies: CommentDocument[] | undefined\n}\n\nexport const CommentsListItem = memo(function CommentsListItem(props: CommentsListItemProps) {\n const {\n avatarConfig = DEFAULT_AVATAR_CONFIG,\n canReply,\n currentUser,\n hasReferencedValue,\n innerPadding,\n isSelected,\n mentionOptions,\n mode,\n onCopyLink,\n onCreateRetry,\n onDelete,\n onEdit,\n onKeyDown,\n onPathSelect,\n onReactionSelect,\n onReply,\n onStatusChange,\n parentComment,\n readOnly,\n replies = EMPTY_ARRAY,\n } = props\n const {t} = useTranslation(commentsLocaleNamespace)\n const [value, setValue] = useState<CommentMessage>(EMPTY_ARRAY)\n const [collapsed, setCollapsed] = useState<boolean>(true)\n const replyInputRef = useRef<CommentInputHandle>(null)\n\n const {isTopLayer} = useLayer()\n\n const hasValue = useMemo(() => hasCommentMessageValue(value), [value])\n\n const [mouseOver, setMouseOver] = useState<boolean>(false)\n\n const handleMouseEnter = () => setMouseOver(true)\n const handleMouseLeave = () => setMouseOver(false)\n\n const handleReplySubmit = (nextValue: CommentMessage) => {\n const nextComment: CommentBaseCreatePayload = {\n message: nextValue,\n parentCommentId: parentComment._id,\n status: parentComment?.status || 'open',\n // Since this is a reply to an existing comment, we use the same thread ID as the parent\n threadId: parentComment.threadId,\n // A new comment will not have any reactions\n reactions: EMPTY_ARRAY,\n\n payload: {\n fieldPath: parentComment.target.path?.field || '',\n },\n }\n\n onReply?.(nextComment)\n setValue(EMPTY_ARRAY)\n }\n\n const startDiscard = useCallback(() => {\n if (!hasValue) {\n setValue(EMPTY_ARRAY)\n return\n }\n\n replyInputRef.current?.discardDialogController.open()\n }, [hasValue])\n\n const handleInputKeyDown = useCallback(\n (event: KeyboardEvent) => {\n // Don't act if the input already prevented this event\n if (event.isDefaultPrevented()) {\n return\n }\n // Discard input text with Escape\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n startDiscard()\n }\n },\n [startDiscard],\n )\n\n const cancelDiscard = useCallback(() => {\n replyInputRef.current?.discardDialogController.close()\n }, [])\n\n const confirmDiscard = useCallback(() => {\n setValue(EMPTY_ARRAY)\n replyInputRef.current?.discardDialogController.close()\n replyInputRef.current?.focus()\n }, [])\n\n const handleThreadRootClick = useCallback(\n (e: MouseEvent<HTMLDivElement>) => {\n e.stopPropagation()\n\n // Don't act if the click was caused by clicking\n // outside e.g. a popover or a menu\n if (!isTopLayer) return\n\n onPathSelect?.({\n fieldPath: parentComment.target.path?.field || '',\n origin: 'inspector',\n threadId: parentComment.threadId,\n })\n },\n [isTopLayer, onPathSelect, parentComment.target.path?.field, parentComment.threadId],\n )\n\n const handleExpand = useCallback((e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n setCollapsed(false)\n }, [])\n\n const splicedReplies = useMemo(() => {\n if (collapsed) return replies?.slice(-MAX_COLLAPSED_REPLIES)\n return replies\n }, [replies, collapsed])\n\n const showCollapseButton = useMemo(() => {\n if (!replies) return false\n return replies.length > MAX_COLLAPSED_REPLIES\n }, [replies])\n\n const expandButtonText = `${replies?.length - MAX_COLLAPSED_REPLIES} more ${\n replies?.length - MAX_COLLAPSED_REPLIES === 1 ? 'comment' : 'comments'\n }`\n\n return (\n <StyledThreadCard\n data-active={isSelected ? 'true' : 'false'}\n data-hovered={mouseOver ? 'true' : 'false'}\n data-testid=\"comments-list-item\"\n data-ui=\"CommentsListItem\"\n onClick={handleThreadRootClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <GhostButton\n data-ui=\"GhostButton\"\n aria-label={t('list-item.go-to-field-button.aria-label')}\n />\n\n <Flex\n as=\"ul\"\n padding={innerPadding}\n // Add some extra padding to the bottom if there is no reply input.\n // This is to make the UI look more balanced.\n paddingBottom={canReply ? undefined : 1}\n gap={4}\n flexDirection=\"column\"\n >\n <VStack as=\"li\" {...applyCommentIdAttr(parentComment._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={parentComment._system.createdBy === currentUser.sanityUserId}\n canEdit={parentComment._system.createdBy === currentUser.sanityUserId}\n comment={parentComment}\n currentUser={currentUser}\n hasError={parentComment._state?.type === 'createError'}\n hasReferencedValue={hasReferencedValue}\n intent={parentComment.context?.intent}\n isParent\n isRetrying={parentComment._state?.type === 'createRetrying'}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={onKeyDown}\n onReactionSelect={onReactionSelect}\n onStatusChange={onStatusChange}\n readOnly={readOnly}\n withAvatar={avatarConfig.parentCommentAvatar}\n />\n </VStack>\n\n {showCollapseButton && collapsed && (\n <Flex gap={1} paddingY={1}>\n <SpacerAvatar />\n\n <ExpandButton\n iconRight={ChevronDownIcon}\n mode=\"bleed\"\n onClick={handleExpand}\n text={expandButtonText}\n />\n </Flex>\n )}\n\n {splicedReplies.map((reply) => (\n <VStack key={reply._id} as=\"li\" {...applyCommentIdAttr(reply._id)}>\n <CommentsListItemLayout\n avatarSize={avatarConfig.avatarSize}\n canDelete={reply._system.createdBy === currentUser.sanityUserId}\n canEdit={reply._system.createdBy === currentUser.sanityUserId}\n comment={reply}\n currentUser={currentUser}\n hasError={reply._state?.type === 'createError'}\n isRetrying={reply._state?.type === 'createRetrying'}\n intent={commentIntentIfDiffers(parentComment, reply)}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onInputKeyDown={handleInputKeyDown}\n onReactionSelect={onReactionSelect}\n readOnly={readOnly}\n withAvatar={avatarConfig.threadCommentsAvatar}\n />\n </VStack>\n ))}\n\n {canReply && (\n <CommentInput\n avatarSize={avatarConfig.avatarSize}\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onSubmit={handleReplySubmit}\n placeholder={\n mode === 'upsell'\n ? t('compose.reply-placeholder-upsell')\n : t('compose.reply-placeholder')\n }\n readOnly={readOnly || mode === 'upsell'}\n ref={replyInputRef}\n value={value}\n withAvatar={avatarConfig.replyAvatar}\n />\n )}\n </Flex>\n </StyledThreadCard>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,cACP,GACwF;CACxF,OAAO;EACL,QAAQ;GACN,OAAO,EAAE,qBAAqB;GAC9B,MAAM,EAAE,oBAAoB;GAC5B,mBAAmB,EAAE,uBAAuB;EAC9C;EACA,SAAS;GACP,OAAO,EAAE,sBAAsB;GAC/B,MAAM,EAAE,qBAAqB;GAC7B,mBAAmB,EAAE,wBAAwB;EAC/C;CACF;AACF;;;;;AAmBA,SAAgB,oBAAoB,OAAiC;gBAC7D,EAAC,UAAU,SAAS,WAAW,WAAW,SAAS,UAAS,OAC5D,EAAC,MAAK,eAAe,uBAAuB,GAC/BA;CAAc,AAAA,EAAA,OAAA,iBAAd,KAAA,cAAc,CAAC,GAAD,EAAA,KAAA;CACjC,IAAM,EAAC,OAAO,MAAM,sBAAqB,GAAW,WAAW,WAAW,YAEzCC;CACrB,AAAA,EAAA,OAAA,aAAA,EAAA,OAAV,aAD+B,WAAM;EACrC,UAAU,SAAS;CACrB,GADY,EAAA,KAAA,WAAV,EAAA,KAAA;CADF,IAAM,eAAeC,IAODC;CACH,AA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