sanity 6.9.2 → 6.9.3-next.2

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 (121) hide show
  1. package/lib/{AddonDatasetProvider-CIq0vehp.js → AddonDatasetProvider-DDQrh5ob.js} +2 -2
  2. package/lib/{AddonDatasetProvider-CIq0vehp.js.map → AddonDatasetProvider-DDQrh5ob.js.map} +1 -1
  3. package/lib/{CalendarFilter-DRKSPTWd.js → CalendarFilter-DYbHmp_x.js} +3 -3
  4. package/lib/{CalendarFilter-DRKSPTWd.js.map → CalendarFilter-DYbHmp_x.js.map} +1 -1
  5. package/lib/{CommentsDocumentLayout-NGghzPWZ.js → CommentsDocumentLayout-qdF_HKSC.js} +2 -2
  6. package/lib/{CommentsDocumentLayout-NGghzPWZ.js.map → CommentsDocumentLayout-qdF_HKSC.js.map} +1 -1
  7. package/lib/{CommentsField-_QkW9aLe.js → CommentsField-i8xs45PB.js} +3 -3
  8. package/lib/{CommentsField-_QkW9aLe.js.map → CommentsField-i8xs45PB.js.map} +1 -1
  9. package/lib/{CommentsInput-DdtI0Naj.js → CommentsInput-B9iSSi8A.js} +6 -6
  10. package/lib/{CommentsInput-DdtI0Naj.js.map → CommentsInput-B9iSSi8A.js.map} +1 -1
  11. package/lib/{CommentsInspector-BQtqxGsK.js → CommentsInspector-rGGP9buL.js} +5 -5
  12. package/lib/{CommentsInspector-BQtqxGsK.js.map → CommentsInspector-rGGP9buL.js.map} +1 -1
  13. package/lib/{CommentsListItem-B0yR0R5a.js → CommentsListItem-DKS6V_TV.js} +3 -3
  14. package/lib/{CommentsListItem-B0yR0R5a.js.map → CommentsListItem-DKS6V_TV.js.map} +1 -1
  15. package/lib/{CommentsSelectedPathProvider-BYZ2OmJ9.js → CommentsSelectedPathProvider-BnZ6GdNc.js} +3 -3
  16. package/lib/{CommentsSelectedPathProvider-BYZ2OmJ9.js.map → CommentsSelectedPathProvider-BnZ6GdNc.js.map} +1 -1
  17. package/lib/{CommentsStudioLayout-DK4W-hTe.js → CommentsStudioLayout-YlpSH_2Y.js} +4 -4
  18. package/lib/{CommentsStudioLayout-DK4W-hTe.js.map → CommentsStudioLayout-YlpSH_2Y.js.map} +1 -1
  19. package/lib/{DateInputs-enUB1fG8.js → DateInputs-DioSKqY0.js} +7 -7
  20. package/lib/{DateInputs-enUB1fG8.js.map → DateInputs-DioSKqY0.js.map} +1 -1
  21. package/lib/{DocumentStatusIndicator-BP3N2GwG.js → DocumentStatusIndicator-BPBTH84U.js} +5 -5
  22. package/lib/{DocumentStatusIndicator-BP3N2GwG.js.map → DocumentStatusIndicator-BPBTH84U.js.map} +1 -1
  23. package/lib/{FormValue-4tVuOoGw.js → FormValue-CJg43LyM.js} +2 -2
  24. package/lib/{FormValue-4tVuOoGw.js.map → FormValue-CJg43LyM.js.map} +1 -1
  25. package/lib/{LoadingBlock-Cy2Pckab.js → LoadingBlock-DPTVJ58M.js} +3 -3
  26. package/lib/{LoadingBlock-Cy2Pckab.js.map → LoadingBlock-DPTVJ58M.js.map} +1 -1
  27. package/lib/{ReleaseTitle-CkEMIfmx.js → ReleaseTitle-ln13W3P1.js} +4 -4
  28. package/lib/{ReleaseTitle-CkEMIfmx.js.map → ReleaseTitle-ln13W3P1.js.map} +1 -1
  29. package/lib/{ReleasesMetadataProvider-DuAzHgpz.js → ReleasesMetadataProvider-DbxROVyw.js} +2 -2
  30. package/lib/{ReleasesMetadataProvider-DuAzHgpz.js.map → ReleasesMetadataProvider-DbxROVyw.js.map} +1 -1
  31. package/lib/{ReleasesNav-DozstCwb.js → ReleasesNav-DNwncim0.js} +15 -15
  32. package/lib/{ReleasesNav-DozstCwb.js.map → ReleasesNav-DNwncim0.js.map} +1 -1
  33. package/lib/{ReleasesStudioLayout-CXoRbIpf.js → ReleasesStudioLayout-gzl7rMMp.js} +8 -8
  34. package/lib/{ReleasesStudioLayout-CXoRbIpf.js.map → ReleasesStudioLayout-gzl7rMMp.js.map} +1 -1
  35. package/lib/{ReleasesTool-Bxru9khS.js → ReleasesTool-CsHniZCP.js} +20 -20
  36. package/lib/{ReleasesTool-Bxru9khS.js.map → ReleasesTool-CsHniZCP.js.map} +1 -1
  37. package/lib/{SchedulePublishingStudioLayout-CjJ-nu3Q.js → SchedulePublishingStudioLayout-BzSSDp9x.js} +3 -3
  38. package/lib/{SchedulePublishingStudioLayout-CjJ-nu3Q.js.map → SchedulePublishingStudioLayout-BzSSDp9x.js.map} +1 -1
  39. package/lib/{SchedulePublishingUpsellProvider-CxpMXwyA.js → SchedulePublishingUpsellProvider-DQqIZsCc.js} +2 -2
  40. package/lib/{SchedulePublishingUpsellProvider-CxpMXwyA.js.map → SchedulePublishingUpsellProvider-DQqIZsCc.js.map} +1 -1
  41. package/lib/{ScheduledPublishingEnabledProvider-Bvx140h2.js → ScheduledPublishingEnabledProvider-BcWaBJw5.js} +3 -3
  42. package/lib/{ScheduledPublishingEnabledProvider-Bvx140h2.js.map → ScheduledPublishingEnabledProvider-BcWaBJw5.js.map} +1 -1
  43. package/lib/{SearchProvider-DSLbCdgY.js → SearchProvider-D3w4Bvul.js} +10 -10
  44. package/lib/{SearchProvider-DSLbCdgY.js.map → SearchProvider-D3w4Bvul.js.map} +1 -1
  45. package/lib/{SingleDocReleaseLayout-DQicfsKs.js → SingleDocReleaseLayout-CQCkL8-0.js} +2 -2
  46. package/lib/{SingleDocReleaseLayout-DQicfsKs.js.map → SingleDocReleaseLayout-CQCkL8-0.js.map} +1 -1
  47. package/lib/{SingleDocReleaseUpsellProvider-DXNTZGTk.js → SingleDocReleaseUpsellProvider-YDBCGrHT.js} +4 -4
  48. package/lib/{SingleDocReleaseUpsellProvider-DXNTZGTk.js.map → SingleDocReleaseUpsellProvider-YDBCGrHT.js.map} +1 -1
  49. package/lib/{TasksStudioActiveToolLayout-CNpB5xLh.js → TasksStudioActiveToolLayout-DAmh3t6t.js} +16 -16
  50. package/lib/{TasksStudioActiveToolLayout-CNpB5xLh.js.map → TasksStudioActiveToolLayout-DAmh3t6t.js.map} +1 -1
  51. package/lib/{TasksStudioLayout-CnsvBNfw.js → TasksStudioLayout-6qNY69FD.js} +5 -5
  52. package/lib/{TasksStudioLayout-CnsvBNfw.js.map → TasksStudioLayout-6qNY69FD.js.map} +1 -1
  53. package/lib/{TimeZoneButton-DMd-M_ri.js → TimeZoneButton-TmrFye13.js} +4 -4
  54. package/lib/{TimeZoneButton-DMd-M_ri.js.map → TimeZoneButton-TmrFye13.js.map} +1 -1
  55. package/lib/{Tool-VgnYCwyZ.js → Tool-tpq9K4o7.js} +14 -14
  56. package/lib/{Tool-VgnYCwyZ.js.map → Tool-tpq9K4o7.js.map} +1 -1
  57. package/lib/{UnpublishVersionDialog-Fow5nBrc.js → UnpublishVersionDialog-6zyP9rCr.js} +5 -5
  58. package/lib/{UnpublishVersionDialog-Fow5nBrc.js.map → UnpublishVersionDialog-6zyP9rCr.js.map} +1 -1
  59. package/lib/{UpsellDialog-BqP2wmnt.js → UpsellDialog-CM238V3B.js} +3 -3
  60. package/lib/{UpsellDialog-BqP2wmnt.js.map → UpsellDialog-CM238V3B.js.map} +1 -1
  61. package/lib/{VariantsStudioNavbar-CvwRIsWJ.js → VariantsStudioNavbar-lFO2yrMq.js} +7 -7
  62. package/lib/{VariantsStudioNavbar-CvwRIsWJ.js.map → VariantsStudioNavbar-lFO2yrMq.js.map} +1 -1
  63. package/lib/{VariantsTool-CmQqDiwU.js → VariantsTool-B0OS4fku.js} +9 -9
  64. package/lib/{VariantsTool-CmQqDiwU.js.map → VariantsTool-B0OS4fku.js.map} +1 -1
  65. package/lib/{WorkspaceLoader-Ailj0PR9.js → WorkspaceLoader-CiJ6lGBu.js} +32 -32
  66. package/lib/{WorkspaceLoader-Ailj0PR9.js.map → WorkspaceLoader-CiJ6lGBu.js.map} +1 -1
  67. package/lib/_createContext.js +1 -1
  68. package/lib/{buildTextSelectionFromFragment-QpFfw3b7.js → buildTextSelectionFromFragment-CFZdgjpp.js} +3 -3
  69. package/lib/{buildTextSelectionFromFragment-QpFfw3b7.js.map → buildTextSelectionFromFragment-CFZdgjpp.js.map} +1 -1
  70. package/lib/{datastores-D4iZNSXV.js → datastores-wbjstxMt.js} +2 -2
  71. package/lib/{datastores-D4iZNSXV.js.map → datastores-wbjstxMt.js.map} +1 -1
  72. package/lib/{getTransactionsLogs-C-_o7nGx.js → getTransactionsLogs-Di50JBPB.js} +2 -2
  73. package/lib/{getTransactionsLogs-C-_o7nGx.js.map → getTransactionsLogs-Di50JBPB.js.map} +1 -1
  74. package/lib/index.js +35 -35
  75. package/lib/{inputResolver-Dpo4FxTy.js → inputResolver-DuUEGuH5.js} +4 -4
  76. package/lib/{inputResolver-Dpo4FxTy.js.map → inputResolver-DuUEGuH5.js.map} +1 -1
  77. package/lib/{navigation.telemetry-syjEPEw-.js → navigation.telemetry-EsdzXa34.js} +9 -9
  78. package/lib/{navigation.telemetry-syjEPEw-.js.map → navigation.telemetry-EsdzXa34.js.map} +1 -1
  79. package/lib/{plugin-B8Op6DFi.js → plugin-C_6lw0l3.js} +3 -3
  80. package/lib/{plugin-B8Op6DFi.js.map → plugin-C_6lw0l3.js.map} +1 -1
  81. package/lib/{plugin-CmF53OT5.js → plugin-ClT8-pVM.js} +4 -4
  82. package/lib/{plugin-CmF53OT5.js.map → plugin-ClT8-pVM.js.map} +1 -1
  83. package/lib/{plugin-Bk41RRuC.js → plugin-DRuKGgrO.js} +6 -6
  84. package/lib/{plugin-Bk41RRuC.js.map → plugin-DRuKGgrO.js.map} +1 -1
  85. package/lib/{plugin-BhEK2rZ8.js → plugin-wJP1ECFq.js} +6 -6
  86. package/lib/{plugin-BhEK2rZ8.js.map → plugin-wJP1ECFq.js.map} +1 -1
  87. package/lib/{scheduleItem-sJhB8YzX.js → scheduleItem-9PFIH7_h.js} +15 -15
  88. package/lib/{scheduleItem-sJhB8YzX.js.map → scheduleItem-9PFIH7_h.js.map} +1 -1
  89. package/lib/{schedules-CLC2KygL.js → schedules-DniNrpFJ.js} +3 -3
  90. package/lib/{schedules-CLC2KygL.js.map → schedules-DniNrpFJ.js.map} +1 -1
  91. package/lib/{searchDocumentRelease-CtPYZAZk.js → searchDocumentRelease-TrunKdQg.js} +5 -5
  92. package/lib/{searchDocumentRelease-CtPYZAZk.js.map → searchDocumentRelease-TrunKdQg.js.map} +1 -1
  93. package/lib/{studioClient-WYiCwgfZ.js → studioClient-BpYJ_yYC.js} +2 -2
  94. package/lib/{studioClient-WYiCwgfZ.js.map → studioClient-BpYJ_yYC.js.map} +1 -1
  95. package/lib/{useBundleDocuments-CiRQnzQh.js → useBundleDocuments-C58ExRpX.js} +5 -5
  96. package/lib/{useBundleDocuments-CiRQnzQh.js.map → useBundleDocuments-C58ExRpX.js.map} +1 -1
  97. package/lib/{useComments-CxUK5MNb.js → useComments-BcMCyjIE.js} +2 -2
  98. package/lib/{useComments-CxUK5MNb.js.map → useComments-BcMCyjIE.js.map} +1 -1
  99. package/lib/{useCommentsTelemetry-BWqcsQ1u.js → useCommentsTelemetry-CL97yuwT.js} +4 -4
  100. package/lib/{useCommentsTelemetry-BWqcsQ1u.js.map → useCommentsTelemetry-CL97yuwT.js.map} +1 -1
  101. package/lib/{useDocumentPreviewValues-B4jUnACZ.js → useDocumentPreviewValues-Cy9aUMu2.js} +5 -5
  102. package/lib/{useDocumentPreviewValues-B4jUnACZ.js.map → useDocumentPreviewValues-Cy9aUMu2.js.map} +1 -1
  103. package/lib/{useFeatureEnabled-sRpDeLLJ.js → useFeatureEnabled-C5qTffLc.js} +2 -2
  104. package/lib/{useFeatureEnabled-sRpDeLLJ.js.map → useFeatureEnabled-C5qTffLc.js.map} +1 -1
  105. package/lib/{useFieldActions-CrPgIiyl.js → useFieldActions-MFJIkobn.js} +2 -2
  106. package/lib/{useFieldActions-CrPgIiyl.js.map → useFieldActions-MFJIkobn.js.map} +1 -1
  107. package/lib/{useProjectId-bGwoCAuz.js → useProjectId-BRSQ8kIo.js} +2 -2
  108. package/lib/{useProjectId-bGwoCAuz.js.map → useProjectId-BRSQ8kIo.js.map} +1 -1
  109. package/lib/{useReleasesToolAvailable-BevhFmt9.js → useReleasesToolAvailable-BOlw1HWL.js} +3 -3
  110. package/lib/{useReleasesToolAvailable-BevhFmt9.js.map → useReleasesToolAvailable-BOlw1HWL.js.map} +1 -1
  111. package/lib/{useScheduledDraftMenuActions-DqsFlU0p.js → useScheduledDraftMenuActions-DIQYFw0x.js} +6 -6
  112. package/lib/{useScheduledDraftMenuActions-DqsFlU0p.js.map → useScheduledDraftMenuActions-DIQYFw0x.js.map} +1 -1
  113. package/lib/{useStudioUrl-DbfIwS1P.js → useStudioUrl-Dc5LnOvR.js} +5 -5
  114. package/lib/{useStudioUrl-DbfIwS1P.js.map → useStudioUrl-Dc5LnOvR.js.map} +1 -1
  115. package/lib/{useTimeZone-DnxQlCGS.js → useTimeZone-Da8WK1q-.js} +2 -2
  116. package/lib/{useTimeZone-DnxQlCGS.js.map → useTimeZone-Da8WK1q-.js.map} +1 -1
  117. package/lib/{validationUtils-Bcu-PkHm.js → validationUtils-B9CLn9F7.js} +4 -4
  118. package/lib/{validationUtils-Bcu-PkHm.js.map → validationUtils-B9CLn9F7.js.map} +1 -1
  119. package/lib/{version-DTqx_kFw.js → version-D7qSwBVE.js} +2 -2
  120. package/lib/{version-DTqx_kFw.js.map → version-D7qSwBVE.js.map} +1 -1
  121. package/package.json +11 -11
@@ -1,8 +1,8 @@
1
1
  import { n as Tooltip } from "./Button-CGZ3ETwD.js";
2
2
  import { t as useTranslation } from "./useTranslation-Cqs6Itwv.js";
3
- import { f as hasCommentMessageValue, o as CommentInput, v as applyCommentsGroupAttr, x as commentsLocaleNamespace } from "./useComments-CxUK5MNb.js";
4
- import { n as ThreadCard, t as CommentsListItem } from "./CommentsListItem-B0yR0R5a.js";
5
- import { t as LoadingBlock } from "./LoadingBlock-Cy2Pckab.js";
3
+ import { f as hasCommentMessageValue, o as CommentInput, v as applyCommentsGroupAttr, x as commentsLocaleNamespace } from "./useComments-BcMCyjIE.js";
4
+ import { n as ThreadCard, t as CommentsListItem } from "./CommentsListItem-DKS6V_TV.js";
5
+ import { t as LoadingBlock } from "./LoadingBlock-DPTVJ58M.js";
6
6
  import { t as Translate } from "./Translate-0HIWr1eF.js";
7
7
  import { Fragment, memo, useRef, useState } from "react";
8
8
  import { c } from "react/compiler-runtime";
@@ -414,4 +414,4 @@ function useCommentsTelemetry() {
414
414
  }
415
415
  export { CommentsList as n, useCommentsTelemetry as t };
416
416
 
417
- //# sourceMappingURL=useCommentsTelemetry-BWqcsQ1u.js.map
417
+ //# sourceMappingURL=useCommentsTelemetry-CL97yuwT.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCommentsTelemetry-BWqcsQ1u.js","names":["Container","Flex","Stack","Text","LoadingBlock","useTranslation","TFunction","commentsLocaleNamespace","CommentStatus","EmptyStateMessage","title","message","React","ReactNode","getEmptyStateMessages","t","Record","open","resolved","CommentsListStatusProps","error","Error","hasNoComments","loading","status","CommentsListStatus","props","$","_c","t0","emptyStateMessages","t1","t2","t3","t4","t5","ChevronRightIcon","Box","Flex","Stack","Text","Fragment","useMemo","Tooltip","CommentBreadcrumbsProps","titlePath","maxLength","Item","separator","renderItem","item","index","CommentBreadcrumbs","props","$","_c","t0","bb0","len","length","beforeLength","Math","ceil","afterLength","floor","t1","slice","items","t2","key","showSeparator","Array","isArray","map","nodes","CurrentUser","PortableTextBlock","useCallback","useMemo","useRef","useState","UserListWithPermissionsHookValue","useTranslation","Translate","hasCommentMessageValue","commentsLocaleNamespace","CommentMessage","CommentsUIMode","CommentInput","CommentInputHandle","CommentInputProps","EMPTY_PT_ARRAY","CreateNewThreadInputProps","currentUser","fieldTitle","mentionOptions","mode","onBlur","onFocus","onKeyDown","event","React","KeyboardEvent","onNewThreadCreate","payload","readOnly","CreateNewThreadInput","props","$","_c","t","value","setValue","commentInputHandle","t0","nextValue","handleSubmit","t1","hasValue","t2","current","discardDialogController","open","startDiscard","t3","isDefaultPrevented","key","preventDefault","stopPropagation","handleInputKeyDown","t4","Symbol","for","close","focus","confirmDiscard","t5","cancelDiscard","t6","field","placeholder","t7","t8","CurrentUser","Button","Flex","Stack","uuid","MouseEvent","ReactNode","useCallback","useMemo","css","styled","UserListWithPermissionsHookValue","useTranslation","CommentsSelectedPath","commentsLocaleNamespace","CommentBaseCreatePayload","CommentListBreadcrumbs","CommentMessage","CommentsUIMode","CommentBreadcrumbs","CreateNewThreadInput","ThreadCard","HeaderFlex","BreadcrumbsButton","theme","fg","sanity","color","base","CommentThreadLayoutProps","breadcrumbs","canCreateNewThread","children","currentUser","fieldPath","isSelected","mentionOptions","mode","onNewThreadCreate","payload","onPathSelect","nextPath","readOnly","CommentThreadLayout","props","$","_c","t","t0","nextComment","message","parentCommentId","undefined","status","threadId","reactions","handleNewThreadCreate","t1","e","stopPropagation","origin","handleBreadcrumbsClick","t2","e_0","detail","handleNewThreadClick","t3","map","_temp","crumbsTitlePath","lastCrumb","length","t4","field","t5","t6","t7","t8","t9","p","title","CurrentUser","BoundaryElementProvider","Flex","Stack","memo","useMemo","useState","RefAttributes","UserListWithPermissionsHookValue","CommentsSelectedPath","applyCommentsGroupAttr","CommentBaseCreatePayload","CommentReactionOption","CommentStatus","CommentsUIMode","CommentThreadItem","CommentUpdatePayload","CommentsListItem","CommentsListStatus","CommentThreadLayout","GroupedComments","field","groupThreads","comments","reduce","acc","comment","fieldPath","push","CommentsListProps","beforeListNode","React","ReactNode","currentUser","error","Error","loading","mentionOptions","mode","onCopyLink","id","onCreateRetry","onDelete","onEdit","payload","onNewThreadCreate","onPathSelect","nextPath","onReactionSelect","reaction","onReply","onStatusChange","status","readOnly","selectedPath","CommentsListHandle","scrollToComment","CommentsListInner","props","$","_c","ref","boundaryElement","setBoundaryElement","t0","Object","entries","groupedThreads","showComments","length","t1","t2","map","t3","group","breadcrumbs","firstThreadId","threadId","newThreadSelected","item","replies","slice","reverse","canReply","parentComment","_state","type","threadIsSelected","target","path","_id","hasReferencedValue","CommentsList","defineEvent","CommentStatus","CommentLinkCopied","name","version","description","CommentViewedFromLink","CommentListViewChanged","view","useTelemetry","useCallback","useMemo","CommentLinkCopied","CommentListViewChanged","CommentViewedFromLink","CommentStatus","CommentsTelemetryHookValue","commentLinkCopied","commentListViewChanged","view","commentViewedFromLink","useCommentsTelemetry","$","_c","telemetry","t0","log","t1","t2","t3"],"sources":["../src/core/comments/components/list/CommentsListStatus.tsx","../src/core/comments/components/CommentBreadcrumbs.tsx","../src/core/comments/components/list/CreateNewThreadInput.tsx","../src/core/comments/components/list/CommentThreadLayout.tsx","../src/core/comments/components/list/CommentsList.tsx","../src/core/comments/__telemetry__/comments.telemetry.ts","../src/core/comments/hooks/useCommentsTelemetry.ts"],"sourcesContent":["import {Container, Flex, Stack, Text} from '@sanity/ui'\n\nimport {LoadingBlock} from '../../../components/loadingBlock/LoadingBlock'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type TFunction} from '../../../i18n/types'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentStatus} from '../../types'\n\ninterface EmptyStateMessage {\n title: string\n message: React.ReactNode\n}\n\nfunction getEmptyStateMessages(t: TFunction): Record<CommentStatus, EmptyStateMessage> {\n return {\n open: {\n title: t('list-status.empty-state-open-title'),\n message: t('list-status.empty-state-open-text'),\n },\n resolved: {\n title: t('list-status.empty-state-resolved-title'),\n message: t('list-status.empty-state-resolved-text'),\n },\n }\n}\n\ninterface CommentsListStatusProps {\n error: Error | null\n hasNoComments: boolean\n loading: boolean\n status: CommentStatus\n}\n\nexport function CommentsListStatus(props: CommentsListStatusProps) {\n const {status, error, loading, hasNoComments} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n const emptyStateMessages = getEmptyStateMessages(t)\n\n if (error) {\n return (\n <Flex align=\"center\" justify=\"center\" flex={1} padding={4}>\n <Flex align=\"center\">\n <Text size={1} muted>\n {t('list-status.error')}\n </Text>\n </Flex>\n </Flex>\n )\n }\n\n if (loading) {\n return <LoadingBlock showText title={t('list-status.loading')} />\n }\n\n if (hasNoComments) {\n return (\n <Flex align=\"center\" justify=\"center\" flex={1} sizing=\"border\">\n <Container width={0} padding={4}>\n <Stack gap={3}>\n <Text align=\"center\" size={1} muted weight=\"medium\">\n {emptyStateMessages[status].title}\n </Text>\n\n <Text align=\"center\" size={1} muted>\n {emptyStateMessages[status].message}\n </Text>\n </Stack>\n </Container>\n </Flex>\n )\n }\n\n return null\n}\n","import {ChevronRightIcon} from '@sanity/icons/ChevronRight'\nimport {Box, Flex, Stack, Text} from '@sanity/ui'\nimport {Fragment, useMemo} from 'react'\n\nimport {Tooltip} from '../../../ui-components/tooltip/Tooltip'\n\nexport interface CommentBreadcrumbsProps {\n titlePath: string[]\n maxLength: number\n}\n\ntype Item = string | string[]\n\nconst separator = (\n <Text muted>\n <ChevronRightIcon />\n </Text>\n)\n\nconst renderItem = (item: string, index: number) => {\n return (\n <Box key={`${item}-${index}`} as=\"li\">\n <Text textOverflow=\"ellipsis\" size={1} weight=\"medium\">\n {item}\n </Text>\n </Box>\n )\n}\n\nexport function CommentBreadcrumbs(props: CommentBreadcrumbsProps) {\n const {titlePath, maxLength} = props\n\n const items: Item[] = useMemo(() => {\n const len = titlePath.length\n const beforeLength = Math.ceil(maxLength / 2)\n const afterLength = Math.floor(maxLength / 2)\n\n if (maxLength && len > maxLength) {\n return [\n ...titlePath.slice(0, beforeLength - 1),\n titlePath.slice(beforeLength - 1, len - afterLength),\n ...titlePath.slice(len - afterLength),\n ]\n }\n\n return titlePath\n }, [maxLength, titlePath])\n\n const nodes = useMemo(() => {\n return items.map((item, index) => {\n const key = `${item}-${index}`\n const showSeparator = index < items.length - 1\n\n if (Array.isArray(item)) {\n return (\n <Fragment key={key}>\n <Tooltip\n content={\n <Stack gap={2} padding={2}>\n {item.map(renderItem)}\n </Stack>\n }\n >\n <Box>{renderItem('...', index)}</Box>\n </Tooltip>\n\n {showSeparator && separator}\n </Fragment>\n )\n }\n\n return (\n <Fragment key={key}>\n {renderItem(item, index)}\n\n {showSeparator && separator}\n </Fragment>\n )\n })\n }, [items])\n\n return (\n <Flex align=\"center\" as=\"ol\" gap={2}>\n {nodes}\n </Flex>\n )\n}\n","import {type CurrentUser, type PortableTextBlock} from '@sanity/types'\nimport {useCallback, useMemo, useRef, useState} from 'react'\n\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {Translate} from '../../../i18n/Translate'\nimport {hasCommentMessageValue} from '../../helpers'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentMessage, type CommentsUIMode} from '../../types'\nimport {\n CommentInput,\n type CommentInputHandle,\n type CommentInputProps,\n} from '../pte/comment-input/CommentInput'\n\nconst EMPTY_PT_ARRAY: PortableTextBlock[] = []\n\ninterface CreateNewThreadInputProps {\n currentUser: CurrentUser\n fieldTitle: string\n mentionOptions: UserListWithPermissionsHookValue\n mode: CommentsUIMode\n onBlur?: CommentInputProps['onBlur']\n onFocus?: CommentInputProps['onFocus']\n onKeyDown?: (event: React.KeyboardEvent) => void\n onNewThreadCreate: (payload: CommentMessage) => void\n readOnly?: boolean\n}\n\nexport function CreateNewThreadInput(props: CreateNewThreadInputProps) {\n const {\n currentUser,\n fieldTitle,\n mentionOptions,\n mode,\n onBlur,\n onFocus,\n onKeyDown,\n onNewThreadCreate,\n readOnly,\n } = props\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const [value, setValue] = useState<CommentMessage>(EMPTY_PT_ARRAY)\n const commentInputHandle = useRef<CommentInputHandle | null>(null)\n\n const handleSubmit = useCallback(\n (nextValue: CommentMessage) => {\n onNewThreadCreate?.(nextValue)\n setValue(EMPTY_PT_ARRAY)\n },\n [onNewThreadCreate],\n )\n\n const hasValue = useMemo(() => hasCommentMessageValue(value), [value])\n\n const startDiscard = useCallback(() => {\n if (!hasValue) {\n return\n }\n commentInputHandle.current?.discardDialogController.open()\n }, [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 (onKeyDown) onKeyDown(event)\n },\n [onKeyDown, startDiscard],\n )\n\n const confirmDiscard = useCallback(() => {\n setValue(EMPTY_PT_ARRAY)\n commentInputHandle.current?.discardDialogController.close()\n commentInputHandle.current?.focus()\n }, [])\n\n const cancelDiscard = useCallback(() => {\n commentInputHandle.current?.discardDialogController.close()\n }, [])\n\n const placeholder =\n mode === 'upsell' ? (\n t('compose.add-comment-input-placeholder-upsell')\n ) : (\n <Translate\n t={t}\n i18nKey=\"compose.add-comment-input-placeholder\"\n values={{field: fieldTitle}}\n />\n )\n\n return (\n <CommentInput\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onBlur={onBlur}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onFocus={onFocus}\n onSubmit={handleSubmit}\n placeholder={placeholder}\n readOnly={readOnly || mode === 'upsell'}\n ref={commentInputHandle}\n value={value}\n />\n )\n}\n","import {type CurrentUser} from '@sanity/types'\nimport {\n // oxlint-disable-next-line no-restricted-imports\n Button, // Button with specific styling and children behavior.\n Flex,\n Stack,\n} from '@sanity/ui'\nimport {uuid} from '@sanity/uuid'\nimport {type MouseEvent, type ReactNode, useCallback, useMemo} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type CommentsSelectedPath} from '../../context/selected-path/types'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {\n type CommentBaseCreatePayload,\n type CommentListBreadcrumbs,\n type CommentMessage,\n type CommentsUIMode,\n} from '../../types'\nimport {CommentBreadcrumbs} from '../CommentBreadcrumbs'\nimport {CreateNewThreadInput} from './CreateNewThreadInput'\nimport {ThreadCard} from './styles'\n\nconst HeaderFlex = styled(Flex)`\n min-height: 25px;\n`\n\nconst BreadcrumbsButton = styled(Button)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const fg = theme.sanity.color.base.fg\n return css`\n --card-fg-color: ${fg};\n\n // The width is needed to make the text ellipsis work\n // in the breadcrumbs component\n max-width: 100%;\n `\n})\n\ninterface CommentThreadLayoutProps {\n breadcrumbs?: CommentListBreadcrumbs\n canCreateNewThread: boolean\n children: ReactNode\n currentUser: CurrentUser\n fieldPath: string\n isSelected: boolean\n mentionOptions: UserListWithPermissionsHookValue\n mode: CommentsUIMode\n onNewThreadCreate: (payload: CommentBaseCreatePayload) => void\n onPathSelect?: (nextPath: CommentsSelectedPath) => void\n readOnly?: boolean\n}\n\nexport function CommentThreadLayout(props: CommentThreadLayoutProps) {\n const {\n breadcrumbs,\n canCreateNewThread,\n children,\n currentUser,\n fieldPath,\n isSelected,\n mentionOptions,\n mode,\n onNewThreadCreate,\n onPathSelect,\n readOnly,\n } = props\n\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const handleNewThreadCreate = useCallback(\n (payload: CommentMessage) => {\n const nextComment: CommentBaseCreatePayload = {\n message: payload,\n parentCommentId: undefined,\n status: 'open',\n // Since this is a new comment, we generate a new thread ID\n threadId: uuid(),\n // New comments have no reactions\n reactions: [],\n\n payload: {\n fieldPath,\n },\n }\n\n onNewThreadCreate?.(nextComment)\n },\n [onNewThreadCreate, fieldPath],\n )\n\n const handleBreadcrumbsClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n\n onPathSelect?.({\n fieldPath,\n origin: 'inspector',\n threadId: null,\n })\n },\n [fieldPath, onPathSelect],\n )\n\n const handleNewThreadClick = useCallback(\n (e: MouseEvent<HTMLDivElement>) => {\n e.stopPropagation()\n // Skip if the click was triggered from \"Enter\" keydown.\n // This because we don't want to trigger `onPathSelect` when\n // submitting the new thread form.\n if (e.detail === 0) return\n\n onPathSelect?.({\n fieldPath,\n origin: 'inspector',\n threadId: null,\n })\n },\n [fieldPath, onPathSelect],\n )\n\n const crumbsTitlePath = useMemo(() => breadcrumbs?.map((p) => p.title) || [], [breadcrumbs])\n const lastCrumb = crumbsTitlePath[crumbsTitlePath.length - 1]\n\n return (\n <Stack gap={2}>\n <HeaderFlex align=\"center\" gap={2} paddingRight={1} sizing=\"border\">\n <Stack flex={1}>\n <Flex align=\"center\">\n <BreadcrumbsButton\n aria-label={t('list-item.breadcrumb-button-go-to-field-aria-label', {\n field: lastCrumb,\n })}\n mode=\"bleed\"\n onClick={handleBreadcrumbsClick}\n padding={2}\n gap={2}\n >\n <CommentBreadcrumbs maxLength={3} titlePath={crumbsTitlePath} />\n </BreadcrumbsButton>\n </Flex>\n </Stack>\n </HeaderFlex>\n\n {canCreateNewThread && (\n <ThreadCard onClick={handleNewThreadClick} data-active={isSelected}>\n <CreateNewThreadInput\n currentUser={currentUser}\n fieldTitle={lastCrumb}\n mentionOptions={mentionOptions}\n mode={mode}\n onNewThreadCreate={handleNewThreadCreate}\n readOnly={readOnly}\n />\n </ThreadCard>\n )}\n\n <Stack gap={2}>{children}</Stack>\n </Stack>\n )\n}\n","import {type CurrentUser} from '@sanity/types'\nimport {BoundaryElementProvider, Flex, Stack} from '@sanity/ui'\nimport {memo, useMemo, useState, type RefAttributes} from 'react'\n\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {type CommentsSelectedPath} from '../../context/selected-path/types'\nimport {applyCommentsGroupAttr} from '../../hooks/useCommentsScroll'\nimport {\n type CommentBaseCreatePayload,\n type CommentReactionOption,\n type CommentStatus,\n type CommentsUIMode,\n type CommentThreadItem,\n type CommentUpdatePayload,\n} from '../../types'\nimport {CommentsListItem} from './CommentsListItem'\nimport {CommentsListStatus} from './CommentsListStatus'\nimport {CommentThreadLayout} from './CommentThreadLayout'\n\ninterface GroupedComments {\n [field: string]: CommentThreadItem[]\n}\n\nfunction groupThreads(comments: CommentThreadItem[]) {\n return comments.reduce((acc, comment) => {\n const field = comment.fieldPath\n\n if (!acc[field]) {\n acc[field] = []\n }\n\n acc[field].push(comment)\n\n return acc\n }, {} as GroupedComments)\n}\n\n/**\n * @beta\n * @hidden\n */\nexport interface CommentsListProps {\n beforeListNode?: React.ReactNode\n comments: CommentThreadItem[]\n currentUser: CurrentUser\n error: Error | null\n loading: 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 onNewThreadCreate: (payload: CommentBaseCreatePayload) => void\n /**\n * @internal\n */\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 readOnly?: boolean\n /**\n * @internal\n */\n selectedPath: CommentsSelectedPath | null\n status: CommentStatus\n}\n\n/**\n * @beta\n * @hidden\n */\nexport interface CommentsListHandle {\n scrollToComment: (id: string) => void\n}\n\nfunction CommentsListInner(props: CommentsListProps & RefAttributes<HTMLUListElement>) {\n const {\n ref,\n beforeListNode,\n comments,\n currentUser,\n error,\n loading,\n mentionOptions,\n mode,\n onCopyLink,\n onCreateRetry,\n onDelete,\n onEdit,\n onNewThreadCreate,\n onPathSelect,\n onReactionSelect,\n onReply,\n onStatusChange,\n readOnly,\n selectedPath,\n status,\n } = props\n const [boundaryElement, setBoundaryElement] = useState<HTMLDivElement | null>(null)\n\n const groupedThreads = useMemo(() => Object.entries(groupThreads(comments)), [comments])\n\n const showComments = !loading && !error && groupedThreads.length > 0\n\n return (\n <Flex\n data-testid=\"comments-list\"\n direction=\"column\"\n flex={1}\n height=\"fill\"\n overflow=\"hidden\"\n ref={setBoundaryElement}\n sizing=\"border\"\n >\n {mode !== 'upsell' && (\n <CommentsListStatus\n error={error}\n hasNoComments={groupedThreads.length === 0}\n loading={loading}\n status={status}\n />\n )}\n\n {(showComments || beforeListNode) && (\n <Stack\n as=\"ul\"\n flex={1}\n overflow=\"auto\"\n padding={3}\n paddingTop={1}\n paddingBottom={6}\n sizing=\"border\"\n gap={1}\n ref={ref}\n >\n {beforeListNode}\n\n <BoundaryElementProvider element={boundaryElement}>\n {groupedThreads?.map(([fieldPath, group]) => {\n // Since all threads in the group point to the same field, the breadcrumbs will be\n // the same for all of them. Therefore, we can just pick the first one.\n const breadcrumbs = group[0].breadcrumbs\n\n // The thread ID is used to scroll to the thread.\n // We pick the first thread id in the group so that we scroll to the first thread\n // in the group.\n const firstThreadId = group[0].threadId\n\n // The new thread is selected if the field path matches the selected path and\n // there is no thread ID selected.\n const newThreadSelected =\n selectedPath?.fieldPath === fieldPath && !selectedPath.threadId\n\n return (\n <Stack\n key={fieldPath}\n as=\"li\"\n paddingTop={3}\n {...applyCommentsGroupAttr(firstThreadId)}\n >\n <CommentThreadLayout\n key={fieldPath}\n breadcrumbs={breadcrumbs}\n canCreateNewThread={status === 'open'}\n currentUser={currentUser}\n fieldPath={fieldPath}\n isSelected={newThreadSelected}\n mentionOptions={mentionOptions}\n mode={mode}\n onNewThreadCreate={onNewThreadCreate}\n onPathSelect={onPathSelect}\n readOnly={readOnly}\n >\n {group.map((item) => {\n // The default sort order is by date, descending (newest first).\n // However, inside a thread, we want the order to be ascending (oldest first).\n // So we reverse the array here.\n // We use slice() to avoid mutating the original array.\n const replies = item.replies.slice().reverse()\n\n const canReply =\n status === 'open' &&\n item.parentComment._state?.type !== 'createError' &&\n item.parentComment._state?.type !== 'createRetrying'\n\n // The thread is selected if the thread ID and field path matches the\n // selected path.\n const threadIsSelected =\n selectedPath?.threadId === item.parentComment.threadId &&\n selectedPath?.fieldPath === item.parentComment.target.path?.field\n\n return (\n <CommentsListItem\n key={item.parentComment._id}\n canReply={canReply}\n currentUser={currentUser}\n hasReferencedValue={item.hasReferencedValue}\n isSelected={threadIsSelected}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onPathSelect={onPathSelect}\n onReactionSelect={onReactionSelect}\n onReply={onReply}\n onStatusChange={onStatusChange}\n parentComment={item.parentComment}\n readOnly={readOnly}\n replies={replies}\n />\n )\n })}\n </CommentThreadLayout>\n </Stack>\n )\n })}\n </BoundaryElementProvider>\n </Stack>\n )}\n </Flex>\n )\n}\n\n/**\n * @beta\n * @hidden\n */\nexport const CommentsList = memo(CommentsListInner)\n","import {defineEvent} from '@sanity/telemetry'\n\nimport {type CommentStatus} from '../types'\n\nexport const CommentLinkCopied = defineEvent({\n name: 'Comment Link Copied',\n version: 1,\n description: 'The link to a comment is copied',\n})\n\nexport const CommentViewedFromLink = defineEvent({\n name: 'Comment Viewed From Link',\n version: 1,\n description: 'A comment is viewed from a link',\n})\n\nexport const CommentListViewChanged = defineEvent<{view: CommentStatus}>({\n name: 'Comment List View Changed',\n version: 1,\n description: 'The view of the comment list is changed',\n})\n","import {useTelemetry} from '@sanity/telemetry/react'\nimport {useCallback, useMemo} from 'react'\n\nimport {\n CommentLinkCopied,\n CommentListViewChanged,\n CommentViewedFromLink,\n} from '../__telemetry__/comments.telemetry'\nimport {type CommentStatus} from '../types'\n\ninterface CommentsTelemetryHookValue {\n commentLinkCopied: () => void\n commentListViewChanged: (view: CommentStatus) => void\n commentViewedFromLink: () => void\n}\n\n/** @internal */\nexport function useCommentsTelemetry(): CommentsTelemetryHookValue {\n const telemetry = useTelemetry()\n\n const commentLinkCopied = useCallback(() => {\n telemetry.log(CommentLinkCopied)\n }, [telemetry])\n\n const commentViewedFromLink = useCallback(() => {\n telemetry.log(CommentViewedFromLink)\n }, [telemetry])\n\n const commentListViewChanged = useCallback(\n (view: CommentStatus) => {\n telemetry.log(CommentListViewChanged, {view})\n },\n [telemetry],\n )\n\n return useMemo(\n (): CommentsTelemetryHookValue => ({\n commentLinkCopied,\n commentListViewChanged,\n commentViewedFromLink,\n }),\n [commentLinkCopied, commentListViewChanged, commentViewedFromLink],\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,SAASc,sBAAsBC,GAAwD;CACrF,OAAO;EACLE,MAAM;GACJP,OAAOK,EAAE,oCAAoC;GAC7CJ,SAASI,EAAE,mCAAmC;EAChD;EACAG,UAAU;GACRR,OAAOK,EAAE,wCAAwC;GACjDJ,SAASI,EAAE,uCAAuC;EACpD;CACF;AACF;AASA,SAAOU,mBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,EAAA,GACL,EAAAJ,QAAAJ,OAAAG,SAAAD,kBAAgDI,OAChD,EAAAX,MAAYV,eAAeE,uBAAuB,GAACsB;CAAA,AAAAF,EAAA,OAAAZ,IACAc,KAAAF,EAAA,MAAxBE,KAAAf,sBAAsBC,CAAC,GAACY,EAAA,KAAAZ,GAAAY,EAAA,KAAAE;CAAnD,IAAAC,qBAA2BD;CAE3B,IAAIT,OAAK;EAAA,IAAAW;EAAA,AAAAJ,EAAA,OAAAZ,IAKwBgB,KAAAJ,EAAA,MAAtBI,KAAAhB,EAAE,mBAAmB,GAACY,EAAA,KAAAZ,GAAAY,EAAA,KAAAI;EAAA,IAAAC;EAGtB,OAHsBL,EAAA,OAAAI,KAGtBC,KAAAL,EAAA,MANPK,KAAA,oBAAC,MAAD;GAAY,OAAA;GAAiB,SAAA;GAAe,MAAA;GAAY,SAAA;GACtD,UAAA,oBAAC,MAAD;IAAY,OAAA;IACV,UAAA,oBAAC,MAAD;KAAY,MAAA;KAAG,OAAA;KACZD,UAAAA;IADE,CAAA;GADF,CAAA;EADF,CAAA,GAMEJ,EAAA,KAAAI,IAAAJ,EAAA,KAAAK,KANPA;CAMO;CAIX,IAAIT,SAAO;EAAA,IAAAQ;EAAA,AAAAJ,EAAA,OAAAZ,IACoDgB,KAAAJ,EAAA,MAAxBI,KAAAhB,EAAE,qBAAqB,GAACY,EAAA,KAAA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;CAAC,GACrCQ,EAAA,KAAAE,WAAAF,EAAA,KAAAK;CAFD,IAAAP,wBAA8BO,IAEfC;CAAA,AAAAN,EAAA,OAAAE,YAKZI,KAAAN,EAAA,MAFDM,MAAAT,SAAA;EACEK,UAASE,IAAKb,wBAAwB,EAAAM,KAAK,CAAC;CAAC,GAC9CG,EAAA,KAAAE,WAAAF,EAAA,KAAAM;CAHH,IAAAV,yBAA+BU,IAK9BC;CAOE,OAPFP,EAAA,OAAAL,qBAAAK,EAAA,OAAAJ,0BAAAI,EAAA,OAAAF,yBAGoCS,KAAA;EAAAZ;EAAAC;EAAAE;CAInC,GAACE,EAAA,KAAAL,mBAAAK,EAAA,KAAAJ,wBAAAI,EAAA,KAAAF,uBAAAE,EAAA,KAAAO,MAAAA,KAAAP,EAAA,IAJkCO;AAIlC"}
1
+ {"version":3,"file":"useCommentsTelemetry-CL97yuwT.js","names":["Container","Flex","Stack","Text","LoadingBlock","useTranslation","TFunction","commentsLocaleNamespace","CommentStatus","EmptyStateMessage","title","message","React","ReactNode","getEmptyStateMessages","t","Record","open","resolved","CommentsListStatusProps","error","Error","hasNoComments","loading","status","CommentsListStatus","props","$","_c","t0","emptyStateMessages","t1","t2","t3","t4","t5","ChevronRightIcon","Box","Flex","Stack","Text","Fragment","useMemo","Tooltip","CommentBreadcrumbsProps","titlePath","maxLength","Item","separator","renderItem","item","index","CommentBreadcrumbs","props","$","_c","t0","bb0","len","length","beforeLength","Math","ceil","afterLength","floor","t1","slice","items","t2","key","showSeparator","Array","isArray","map","nodes","CurrentUser","PortableTextBlock","useCallback","useMemo","useRef","useState","UserListWithPermissionsHookValue","useTranslation","Translate","hasCommentMessageValue","commentsLocaleNamespace","CommentMessage","CommentsUIMode","CommentInput","CommentInputHandle","CommentInputProps","EMPTY_PT_ARRAY","CreateNewThreadInputProps","currentUser","fieldTitle","mentionOptions","mode","onBlur","onFocus","onKeyDown","event","React","KeyboardEvent","onNewThreadCreate","payload","readOnly","CreateNewThreadInput","props","$","_c","t","value","setValue","commentInputHandle","t0","nextValue","handleSubmit","t1","hasValue","t2","current","discardDialogController","open","startDiscard","t3","isDefaultPrevented","key","preventDefault","stopPropagation","handleInputKeyDown","t4","Symbol","for","close","focus","confirmDiscard","t5","cancelDiscard","t6","field","placeholder","t7","t8","CurrentUser","Button","Flex","Stack","uuid","MouseEvent","ReactNode","useCallback","useMemo","css","styled","UserListWithPermissionsHookValue","useTranslation","CommentsSelectedPath","commentsLocaleNamespace","CommentBaseCreatePayload","CommentListBreadcrumbs","CommentMessage","CommentsUIMode","CommentBreadcrumbs","CreateNewThreadInput","ThreadCard","HeaderFlex","BreadcrumbsButton","theme","fg","sanity","color","base","CommentThreadLayoutProps","breadcrumbs","canCreateNewThread","children","currentUser","fieldPath","isSelected","mentionOptions","mode","onNewThreadCreate","payload","onPathSelect","nextPath","readOnly","CommentThreadLayout","props","$","_c","t","t0","nextComment","message","parentCommentId","undefined","status","threadId","reactions","handleNewThreadCreate","t1","e","stopPropagation","origin","handleBreadcrumbsClick","t2","e_0","detail","handleNewThreadClick","t3","map","_temp","crumbsTitlePath","lastCrumb","length","t4","field","t5","t6","t7","t8","t9","p","title","CurrentUser","BoundaryElementProvider","Flex","Stack","memo","useMemo","useState","RefAttributes","UserListWithPermissionsHookValue","CommentsSelectedPath","applyCommentsGroupAttr","CommentBaseCreatePayload","CommentReactionOption","CommentStatus","CommentsUIMode","CommentThreadItem","CommentUpdatePayload","CommentsListItem","CommentsListStatus","CommentThreadLayout","GroupedComments","field","groupThreads","comments","reduce","acc","comment","fieldPath","push","CommentsListProps","beforeListNode","React","ReactNode","currentUser","error","Error","loading","mentionOptions","mode","onCopyLink","id","onCreateRetry","onDelete","onEdit","payload","onNewThreadCreate","onPathSelect","nextPath","onReactionSelect","reaction","onReply","onStatusChange","status","readOnly","selectedPath","CommentsListHandle","scrollToComment","CommentsListInner","props","$","_c","ref","boundaryElement","setBoundaryElement","t0","Object","entries","groupedThreads","showComments","length","t1","t2","map","t3","group","breadcrumbs","firstThreadId","threadId","newThreadSelected","item","replies","slice","reverse","canReply","parentComment","_state","type","threadIsSelected","target","path","_id","hasReferencedValue","CommentsList","defineEvent","CommentStatus","CommentLinkCopied","name","version","description","CommentViewedFromLink","CommentListViewChanged","view","useTelemetry","useCallback","useMemo","CommentLinkCopied","CommentListViewChanged","CommentViewedFromLink","CommentStatus","CommentsTelemetryHookValue","commentLinkCopied","commentListViewChanged","view","commentViewedFromLink","useCommentsTelemetry","$","_c","telemetry","t0","log","t1","t2","t3"],"sources":["../src/core/comments/components/list/CommentsListStatus.tsx","../src/core/comments/components/CommentBreadcrumbs.tsx","../src/core/comments/components/list/CreateNewThreadInput.tsx","../src/core/comments/components/list/CommentThreadLayout.tsx","../src/core/comments/components/list/CommentsList.tsx","../src/core/comments/__telemetry__/comments.telemetry.ts","../src/core/comments/hooks/useCommentsTelemetry.ts"],"sourcesContent":["import {Container, Flex, Stack, Text} from '@sanity/ui'\n\nimport {LoadingBlock} from '../../../components/loadingBlock/LoadingBlock'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type TFunction} from '../../../i18n/types'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentStatus} from '../../types'\n\ninterface EmptyStateMessage {\n title: string\n message: React.ReactNode\n}\n\nfunction getEmptyStateMessages(t: TFunction): Record<CommentStatus, EmptyStateMessage> {\n return {\n open: {\n title: t('list-status.empty-state-open-title'),\n message: t('list-status.empty-state-open-text'),\n },\n resolved: {\n title: t('list-status.empty-state-resolved-title'),\n message: t('list-status.empty-state-resolved-text'),\n },\n }\n}\n\ninterface CommentsListStatusProps {\n error: Error | null\n hasNoComments: boolean\n loading: boolean\n status: CommentStatus\n}\n\nexport function CommentsListStatus(props: CommentsListStatusProps) {\n const {status, error, loading, hasNoComments} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n const emptyStateMessages = getEmptyStateMessages(t)\n\n if (error) {\n return (\n <Flex align=\"center\" justify=\"center\" flex={1} padding={4}>\n <Flex align=\"center\">\n <Text size={1} muted>\n {t('list-status.error')}\n </Text>\n </Flex>\n </Flex>\n )\n }\n\n if (loading) {\n return <LoadingBlock showText title={t('list-status.loading')} />\n }\n\n if (hasNoComments) {\n return (\n <Flex align=\"center\" justify=\"center\" flex={1} sizing=\"border\">\n <Container width={0} padding={4}>\n <Stack gap={3}>\n <Text align=\"center\" size={1} muted weight=\"medium\">\n {emptyStateMessages[status].title}\n </Text>\n\n <Text align=\"center\" size={1} muted>\n {emptyStateMessages[status].message}\n </Text>\n </Stack>\n </Container>\n </Flex>\n )\n }\n\n return null\n}\n","import {ChevronRightIcon} from '@sanity/icons/ChevronRight'\nimport {Box, Flex, Stack, Text} from '@sanity/ui'\nimport {Fragment, useMemo} from 'react'\n\nimport {Tooltip} from '../../../ui-components/tooltip/Tooltip'\n\nexport interface CommentBreadcrumbsProps {\n titlePath: string[]\n maxLength: number\n}\n\ntype Item = string | string[]\n\nconst separator = (\n <Text muted>\n <ChevronRightIcon />\n </Text>\n)\n\nconst renderItem = (item: string, index: number) => {\n return (\n <Box key={`${item}-${index}`} as=\"li\">\n <Text textOverflow=\"ellipsis\" size={1} weight=\"medium\">\n {item}\n </Text>\n </Box>\n )\n}\n\nexport function CommentBreadcrumbs(props: CommentBreadcrumbsProps) {\n const {titlePath, maxLength} = props\n\n const items: Item[] = useMemo(() => {\n const len = titlePath.length\n const beforeLength = Math.ceil(maxLength / 2)\n const afterLength = Math.floor(maxLength / 2)\n\n if (maxLength && len > maxLength) {\n return [\n ...titlePath.slice(0, beforeLength - 1),\n titlePath.slice(beforeLength - 1, len - afterLength),\n ...titlePath.slice(len - afterLength),\n ]\n }\n\n return titlePath\n }, [maxLength, titlePath])\n\n const nodes = useMemo(() => {\n return items.map((item, index) => {\n const key = `${item}-${index}`\n const showSeparator = index < items.length - 1\n\n if (Array.isArray(item)) {\n return (\n <Fragment key={key}>\n <Tooltip\n content={\n <Stack gap={2} padding={2}>\n {item.map(renderItem)}\n </Stack>\n }\n >\n <Box>{renderItem('...', index)}</Box>\n </Tooltip>\n\n {showSeparator && separator}\n </Fragment>\n )\n }\n\n return (\n <Fragment key={key}>\n {renderItem(item, index)}\n\n {showSeparator && separator}\n </Fragment>\n )\n })\n }, [items])\n\n return (\n <Flex align=\"center\" as=\"ol\" gap={2}>\n {nodes}\n </Flex>\n )\n}\n","import {type CurrentUser, type PortableTextBlock} from '@sanity/types'\nimport {useCallback, useMemo, useRef, useState} from 'react'\n\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {Translate} from '../../../i18n/Translate'\nimport {hasCommentMessageValue} from '../../helpers'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentMessage, type CommentsUIMode} from '../../types'\nimport {\n CommentInput,\n type CommentInputHandle,\n type CommentInputProps,\n} from '../pte/comment-input/CommentInput'\n\nconst EMPTY_PT_ARRAY: PortableTextBlock[] = []\n\ninterface CreateNewThreadInputProps {\n currentUser: CurrentUser\n fieldTitle: string\n mentionOptions: UserListWithPermissionsHookValue\n mode: CommentsUIMode\n onBlur?: CommentInputProps['onBlur']\n onFocus?: CommentInputProps['onFocus']\n onKeyDown?: (event: React.KeyboardEvent) => void\n onNewThreadCreate: (payload: CommentMessage) => void\n readOnly?: boolean\n}\n\nexport function CreateNewThreadInput(props: CreateNewThreadInputProps) {\n const {\n currentUser,\n fieldTitle,\n mentionOptions,\n mode,\n onBlur,\n onFocus,\n onKeyDown,\n onNewThreadCreate,\n readOnly,\n } = props\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const [value, setValue] = useState<CommentMessage>(EMPTY_PT_ARRAY)\n const commentInputHandle = useRef<CommentInputHandle | null>(null)\n\n const handleSubmit = useCallback(\n (nextValue: CommentMessage) => {\n onNewThreadCreate?.(nextValue)\n setValue(EMPTY_PT_ARRAY)\n },\n [onNewThreadCreate],\n )\n\n const hasValue = useMemo(() => hasCommentMessageValue(value), [value])\n\n const startDiscard = useCallback(() => {\n if (!hasValue) {\n return\n }\n commentInputHandle.current?.discardDialogController.open()\n }, [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 (onKeyDown) onKeyDown(event)\n },\n [onKeyDown, startDiscard],\n )\n\n const confirmDiscard = useCallback(() => {\n setValue(EMPTY_PT_ARRAY)\n commentInputHandle.current?.discardDialogController.close()\n commentInputHandle.current?.focus()\n }, [])\n\n const cancelDiscard = useCallback(() => {\n commentInputHandle.current?.discardDialogController.close()\n }, [])\n\n const placeholder =\n mode === 'upsell' ? (\n t('compose.add-comment-input-placeholder-upsell')\n ) : (\n <Translate\n t={t}\n i18nKey=\"compose.add-comment-input-placeholder\"\n values={{field: fieldTitle}}\n />\n )\n\n return (\n <CommentInput\n currentUser={currentUser}\n expandOnFocus\n mentionOptions={mentionOptions}\n onBlur={onBlur}\n onChange={setValue}\n onDiscardCancel={cancelDiscard}\n onDiscardConfirm={confirmDiscard}\n onKeyDown={handleInputKeyDown}\n onFocus={onFocus}\n onSubmit={handleSubmit}\n placeholder={placeholder}\n readOnly={readOnly || mode === 'upsell'}\n ref={commentInputHandle}\n value={value}\n />\n )\n}\n","import {type CurrentUser} from '@sanity/types'\nimport {\n // oxlint-disable-next-line no-restricted-imports\n Button, // Button with specific styling and children behavior.\n Flex,\n Stack,\n} from '@sanity/ui'\nimport {uuid} from '@sanity/uuid'\nimport {type MouseEvent, type ReactNode, useCallback, useMemo} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {type CommentsSelectedPath} from '../../context/selected-path/types'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {\n type CommentBaseCreatePayload,\n type CommentListBreadcrumbs,\n type CommentMessage,\n type CommentsUIMode,\n} from '../../types'\nimport {CommentBreadcrumbs} from '../CommentBreadcrumbs'\nimport {CreateNewThreadInput} from './CreateNewThreadInput'\nimport {ThreadCard} from './styles'\n\nconst HeaderFlex = styled(Flex)`\n min-height: 25px;\n`\n\nconst BreadcrumbsButton = styled(Button)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const fg = theme.sanity.color.base.fg\n return css`\n --card-fg-color: ${fg};\n\n // The width is needed to make the text ellipsis work\n // in the breadcrumbs component\n max-width: 100%;\n `\n})\n\ninterface CommentThreadLayoutProps {\n breadcrumbs?: CommentListBreadcrumbs\n canCreateNewThread: boolean\n children: ReactNode\n currentUser: CurrentUser\n fieldPath: string\n isSelected: boolean\n mentionOptions: UserListWithPermissionsHookValue\n mode: CommentsUIMode\n onNewThreadCreate: (payload: CommentBaseCreatePayload) => void\n onPathSelect?: (nextPath: CommentsSelectedPath) => void\n readOnly?: boolean\n}\n\nexport function CommentThreadLayout(props: CommentThreadLayoutProps) {\n const {\n breadcrumbs,\n canCreateNewThread,\n children,\n currentUser,\n fieldPath,\n isSelected,\n mentionOptions,\n mode,\n onNewThreadCreate,\n onPathSelect,\n readOnly,\n } = props\n\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const handleNewThreadCreate = useCallback(\n (payload: CommentMessage) => {\n const nextComment: CommentBaseCreatePayload = {\n message: payload,\n parentCommentId: undefined,\n status: 'open',\n // Since this is a new comment, we generate a new thread ID\n threadId: uuid(),\n // New comments have no reactions\n reactions: [],\n\n payload: {\n fieldPath,\n },\n }\n\n onNewThreadCreate?.(nextComment)\n },\n [onNewThreadCreate, fieldPath],\n )\n\n const handleBreadcrumbsClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n\n onPathSelect?.({\n fieldPath,\n origin: 'inspector',\n threadId: null,\n })\n },\n [fieldPath, onPathSelect],\n )\n\n const handleNewThreadClick = useCallback(\n (e: MouseEvent<HTMLDivElement>) => {\n e.stopPropagation()\n // Skip if the click was triggered from \"Enter\" keydown.\n // This because we don't want to trigger `onPathSelect` when\n // submitting the new thread form.\n if (e.detail === 0) return\n\n onPathSelect?.({\n fieldPath,\n origin: 'inspector',\n threadId: null,\n })\n },\n [fieldPath, onPathSelect],\n )\n\n const crumbsTitlePath = useMemo(() => breadcrumbs?.map((p) => p.title) || [], [breadcrumbs])\n const lastCrumb = crumbsTitlePath[crumbsTitlePath.length - 1]\n\n return (\n <Stack gap={2}>\n <HeaderFlex align=\"center\" gap={2} paddingRight={1} sizing=\"border\">\n <Stack flex={1}>\n <Flex align=\"center\">\n <BreadcrumbsButton\n aria-label={t('list-item.breadcrumb-button-go-to-field-aria-label', {\n field: lastCrumb,\n })}\n mode=\"bleed\"\n onClick={handleBreadcrumbsClick}\n padding={2}\n gap={2}\n >\n <CommentBreadcrumbs maxLength={3} titlePath={crumbsTitlePath} />\n </BreadcrumbsButton>\n </Flex>\n </Stack>\n </HeaderFlex>\n\n {canCreateNewThread && (\n <ThreadCard onClick={handleNewThreadClick} data-active={isSelected}>\n <CreateNewThreadInput\n currentUser={currentUser}\n fieldTitle={lastCrumb}\n mentionOptions={mentionOptions}\n mode={mode}\n onNewThreadCreate={handleNewThreadCreate}\n readOnly={readOnly}\n />\n </ThreadCard>\n )}\n\n <Stack gap={2}>{children}</Stack>\n </Stack>\n )\n}\n","import {type CurrentUser} from '@sanity/types'\nimport {BoundaryElementProvider, Flex, Stack} from '@sanity/ui'\nimport {memo, useMemo, useState, type RefAttributes} from 'react'\n\nimport {type UserListWithPermissionsHookValue} from '../../../hooks/useUserListWithPermissions'\nimport {type CommentsSelectedPath} from '../../context/selected-path/types'\nimport {applyCommentsGroupAttr} from '../../hooks/useCommentsScroll'\nimport {\n type CommentBaseCreatePayload,\n type CommentReactionOption,\n type CommentStatus,\n type CommentsUIMode,\n type CommentThreadItem,\n type CommentUpdatePayload,\n} from '../../types'\nimport {CommentsListItem} from './CommentsListItem'\nimport {CommentsListStatus} from './CommentsListStatus'\nimport {CommentThreadLayout} from './CommentThreadLayout'\n\ninterface GroupedComments {\n [field: string]: CommentThreadItem[]\n}\n\nfunction groupThreads(comments: CommentThreadItem[]) {\n return comments.reduce((acc, comment) => {\n const field = comment.fieldPath\n\n if (!acc[field]) {\n acc[field] = []\n }\n\n acc[field].push(comment)\n\n return acc\n }, {} as GroupedComments)\n}\n\n/**\n * @beta\n * @hidden\n */\nexport interface CommentsListProps {\n beforeListNode?: React.ReactNode\n comments: CommentThreadItem[]\n currentUser: CurrentUser\n error: Error | null\n loading: 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 onNewThreadCreate: (payload: CommentBaseCreatePayload) => void\n /**\n * @internal\n */\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 readOnly?: boolean\n /**\n * @internal\n */\n selectedPath: CommentsSelectedPath | null\n status: CommentStatus\n}\n\n/**\n * @beta\n * @hidden\n */\nexport interface CommentsListHandle {\n scrollToComment: (id: string) => void\n}\n\nfunction CommentsListInner(props: CommentsListProps & RefAttributes<HTMLUListElement>) {\n const {\n ref,\n beforeListNode,\n comments,\n currentUser,\n error,\n loading,\n mentionOptions,\n mode,\n onCopyLink,\n onCreateRetry,\n onDelete,\n onEdit,\n onNewThreadCreate,\n onPathSelect,\n onReactionSelect,\n onReply,\n onStatusChange,\n readOnly,\n selectedPath,\n status,\n } = props\n const [boundaryElement, setBoundaryElement] = useState<HTMLDivElement | null>(null)\n\n const groupedThreads = useMemo(() => Object.entries(groupThreads(comments)), [comments])\n\n const showComments = !loading && !error && groupedThreads.length > 0\n\n return (\n <Flex\n data-testid=\"comments-list\"\n direction=\"column\"\n flex={1}\n height=\"fill\"\n overflow=\"hidden\"\n ref={setBoundaryElement}\n sizing=\"border\"\n >\n {mode !== 'upsell' && (\n <CommentsListStatus\n error={error}\n hasNoComments={groupedThreads.length === 0}\n loading={loading}\n status={status}\n />\n )}\n\n {(showComments || beforeListNode) && (\n <Stack\n as=\"ul\"\n flex={1}\n overflow=\"auto\"\n padding={3}\n paddingTop={1}\n paddingBottom={6}\n sizing=\"border\"\n gap={1}\n ref={ref}\n >\n {beforeListNode}\n\n <BoundaryElementProvider element={boundaryElement}>\n {groupedThreads?.map(([fieldPath, group]) => {\n // Since all threads in the group point to the same field, the breadcrumbs will be\n // the same for all of them. Therefore, we can just pick the first one.\n const breadcrumbs = group[0].breadcrumbs\n\n // The thread ID is used to scroll to the thread.\n // We pick the first thread id in the group so that we scroll to the first thread\n // in the group.\n const firstThreadId = group[0].threadId\n\n // The new thread is selected if the field path matches the selected path and\n // there is no thread ID selected.\n const newThreadSelected =\n selectedPath?.fieldPath === fieldPath && !selectedPath.threadId\n\n return (\n <Stack\n key={fieldPath}\n as=\"li\"\n paddingTop={3}\n {...applyCommentsGroupAttr(firstThreadId)}\n >\n <CommentThreadLayout\n key={fieldPath}\n breadcrumbs={breadcrumbs}\n canCreateNewThread={status === 'open'}\n currentUser={currentUser}\n fieldPath={fieldPath}\n isSelected={newThreadSelected}\n mentionOptions={mentionOptions}\n mode={mode}\n onNewThreadCreate={onNewThreadCreate}\n onPathSelect={onPathSelect}\n readOnly={readOnly}\n >\n {group.map((item) => {\n // The default sort order is by date, descending (newest first).\n // However, inside a thread, we want the order to be ascending (oldest first).\n // So we reverse the array here.\n // We use slice() to avoid mutating the original array.\n const replies = item.replies.slice().reverse()\n\n const canReply =\n status === 'open' &&\n item.parentComment._state?.type !== 'createError' &&\n item.parentComment._state?.type !== 'createRetrying'\n\n // The thread is selected if the thread ID and field path matches the\n // selected path.\n const threadIsSelected =\n selectedPath?.threadId === item.parentComment.threadId &&\n selectedPath?.fieldPath === item.parentComment.target.path?.field\n\n return (\n <CommentsListItem\n key={item.parentComment._id}\n canReply={canReply}\n currentUser={currentUser}\n hasReferencedValue={item.hasReferencedValue}\n isSelected={threadIsSelected}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={onCopyLink}\n onCreateRetry={onCreateRetry}\n onDelete={onDelete}\n onEdit={onEdit}\n onPathSelect={onPathSelect}\n onReactionSelect={onReactionSelect}\n onReply={onReply}\n onStatusChange={onStatusChange}\n parentComment={item.parentComment}\n readOnly={readOnly}\n replies={replies}\n />\n )\n })}\n </CommentThreadLayout>\n </Stack>\n )\n })}\n </BoundaryElementProvider>\n </Stack>\n )}\n </Flex>\n )\n}\n\n/**\n * @beta\n * @hidden\n */\nexport const CommentsList = memo(CommentsListInner)\n","import {defineEvent} from '@sanity/telemetry'\n\nimport {type CommentStatus} from '../types'\n\nexport const CommentLinkCopied = defineEvent({\n name: 'Comment Link Copied',\n version: 1,\n description: 'The link to a comment is copied',\n})\n\nexport const CommentViewedFromLink = defineEvent({\n name: 'Comment Viewed From Link',\n version: 1,\n description: 'A comment is viewed from a link',\n})\n\nexport const CommentListViewChanged = defineEvent<{view: CommentStatus}>({\n name: 'Comment List View Changed',\n version: 1,\n description: 'The view of the comment list is changed',\n})\n","import {useTelemetry} from '@sanity/telemetry/react'\nimport {useCallback, useMemo} from 'react'\n\nimport {\n CommentLinkCopied,\n CommentListViewChanged,\n CommentViewedFromLink,\n} from '../__telemetry__/comments.telemetry'\nimport {type CommentStatus} from '../types'\n\ninterface CommentsTelemetryHookValue {\n commentLinkCopied: () => void\n commentListViewChanged: (view: CommentStatus) => void\n commentViewedFromLink: () => void\n}\n\n/** @internal */\nexport function useCommentsTelemetry(): CommentsTelemetryHookValue {\n const telemetry = useTelemetry()\n\n const commentLinkCopied = useCallback(() => {\n telemetry.log(CommentLinkCopied)\n }, [telemetry])\n\n const commentViewedFromLink = useCallback(() => {\n telemetry.log(CommentViewedFromLink)\n }, [telemetry])\n\n const commentListViewChanged = useCallback(\n (view: CommentStatus) => {\n telemetry.log(CommentListViewChanged, {view})\n },\n [telemetry],\n )\n\n return useMemo(\n (): CommentsTelemetryHookValue => ({\n commentLinkCopied,\n commentListViewChanged,\n commentViewedFromLink,\n }),\n [commentLinkCopied, commentListViewChanged, commentViewedFromLink],\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,SAASc,sBAAsBC,GAAwD;CACrF,OAAO;EACLE,MAAM;GACJP,OAAOK,EAAE,oCAAoC;GAC7CJ,SAASI,EAAE,mCAAmC;EAChD;EACAG,UAAU;GACRR,OAAOK,EAAE,wCAAwC;GACjDJ,SAASI,EAAE,uCAAuC;EACpD;CACF;AACF;AASA,SAAOU,mBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,EAAA,GACL,EAAAJ,QAAAJ,OAAAG,SAAAD,kBAAgDI,OAChD,EAAAX,MAAYV,eAAeE,uBAAuB,GAACsB;CAAA,AAAAF,EAAA,OAAAZ,IACAc,KAAAF,EAAA,MAAxBE,KAAAf,sBAAsBC,CAAC,GAACY,EAAA,KAAAZ,GAAAY,EAAA,KAAAE;CAAnD,IAAAC,qBAA2BD;CAE3B,IAAIT,OAAK;EAAA,IAAAW;EAAA,AAAAJ,EAAA,OAAAZ,IAKwBgB,KAAAJ,EAAA,MAAtBI,KAAAhB,EAAE,mBAAmB,GAACY,EAAA,KAAAZ,GAAAY,EAAA,KAAAI;EAAA,IAAAC;EAGtB,OAHsBL,EAAA,OAAAI,KAGtBC,KAAAL,EAAA,MANPK,KAAA,oBAAC,MAAD;GAAY,OAAA;GAAiB,SAAA;GAAe,MAAA;GAAY,SAAA;GACtD,UAAA,oBAAC,MAAD;IAAY,OAAA;IACV,UAAA,oBAAC,MAAD;KAAY,MAAA;KAAG,OAAA;KACZD,UAAAA;IADE,CAAA;GADF,CAAA;EADF,CAAA,GAMEJ,EAAA,KAAAI,IAAAJ,EAAA,KAAAK,KANPA;CAMO;CAIX,IAAIT,SAAO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IAAAR,oBAA0BQ,IAEXE;CAAA,AAAAL,EAAA,OAAAE,YAIdG,KAAAL,EAAA,MAFyCK,WAAA;EACxCH,UAASE,IAAKZ,qBAAqB;CAAC,GACrCQ,EAAA,KAAAE,WAAAF,EAAA,KAAAK;CAFD,IAAAP,wBAA8BO,IAEfC;CAAA,AAAAN,EAAA,OAAAE,YAKZI,KAAAN,EAAA,MAFDM,MAAAT,SAAA;EACEK,UAASE,IAAKb,wBAAwB,EAAAM,KAAK,CAAC;CAAC,GAC9CG,EAAA,KAAAE,WAAAF,EAAA,KAAAM;CAHH,IAAAV,yBAA+BU,IAK9BC;CAOE,OAPFP,EAAA,OAAAL,qBAAAK,EAAA,OAAAJ,0BAAAI,EAAA,OAAAF,yBAGoCS,KAAA;EAAAZ;EAAAC;EAAAE;CAInC,GAACE,EAAA,KAAAL,mBAAAK,EAAA,KAAAJ,wBAAAI,EAAA,KAAAF,uBAAAE,EAAA,KAAAO,MAAAA,KAAAP,EAAA,IAJkCO;AAIlC"}
@@ -1,10 +1,10 @@
1
1
  import { n as Tooltip } from "./Button-CGZ3ETwD.js";
2
2
  import { C as isNonNullable, l as getPublishedId, u as getVersionFromId, y as isVersionId } from "./draftUtils-D3HJGQaW.js";
3
- import { c as usePresenceStore, ot as getReleaseIdFromReleaseDocumentId, pn as useSchema, r as useDocumentPreviewStore } from "./datastores-D4iZNSXV.js";
3
+ import { c as usePresenceStore, ot as getReleaseIdFromReleaseDocumentId, pn as useSchema, r as useDocumentPreviewStore } from "./datastores-wbjstxMt.js";
4
4
  import { t as useTranslation } from "./useTranslation-Cqs6Itwv.js";
5
- import { ht as useActiveReleases, j as usePerspective } from "./useBundleDocuments-CiRQnzQh.js";
6
- import { a as UserAvatar } from "./ReleaseTitle-CkEMIfmx.js";
7
- import { x as releasesLocaleNamespace } from "./UnpublishVersionDialog-Fow5nBrc.js";
5
+ import { ht as useActiveReleases, j as usePerspective } from "./useBundleDocuments-C58ExRpX.js";
6
+ import { a as UserAvatar } from "./ReleaseTitle-ln13W3P1.js";
7
+ import { x as releasesLocaleNamespace } from "./UnpublishVersionDialog-6zyP9rCr.js";
8
8
  import { startTransition, useEffect, useReducer } from "react";
9
9
  import { combineLatest, of } from "rxjs";
10
10
  import { c } from "react/compiler-runtime";
@@ -142,4 +142,4 @@ function useDocumentPreviewValues(options) {
142
142
  }
143
143
  export { getPreviewStateObservable as i, DocumentPreviewPresence as n, useDocumentPresence as r, useDocumentPreviewValues as t };
144
144
 
145
- //# sourceMappingURL=useDocumentPreviewValues-B4jUnACZ.js.map
145
+ //# sourceMappingURL=useDocumentPreviewValues-Cy9aUMu2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentPreviewValues-B4jUnACZ.js","names":["PrepareViewOptions","PreviewValue","SanityDocument","SchemaType","combineLatest","Observable","of","map","startWith","PerspectiveStack","getPublishedId","getVersionFromId","isVersionId","DocumentPreviewStore","PreviewState","isLoading","snapshot","Partial","original","getPreviewStateObservable","documentPreviewStore","schemaType","documentId","perspective","viewOptions","variant","perspectiveSnapshot","observeForPreview","_id","versionOrDraftId","preparedVersionSnapshot","pipe","main","version","startTransition","useEffect","useMemo","useReducer","useObservable","of","usePresenceStore","DocumentPresence","initial","fallback","useDocumentPresence","documentId","$","_c","mounted","mount","_temp","t0","t1","Symbol","for","presenceStore","t2","documentPresence","presence$","AvatarStack","getTheme_v2","useMemo","css","styled","Tooltip","TooltipProps","UserAvatar","useTranslation","releasesLocaleNamespace","useActiveReleases","getReleaseIdFromReleaseDocumentId","DocumentPresence","getVersionFromId","isNonNullable","DocumentPreviewPresenceProps","presence","Omit","PRESENCE_MENU_POPOVER_PROPS","portal","AvatarStackBox","div","props","space","theme","DocumentPreviewPresence","$","_c","t","data","releases","t0","Array","from","Set","map","_temp","t1","id","find","a_0","a","user","filter","uniquePresence","t2","bb0","length","firstPresence","documentId","t3","displayName","release","r","_id","undefined","releaseTitle","metadata","title","count","tooltipContent","_temp2","t4","t5","item","PreviewValue","ElementType","ReactNode","useMemo","useObservable","of","useSchema","usePerspective","getPreviewStateObservable","useDocumentPreviewStore","PreviewHookOptions","documentId","documentType","perspectiveStack","variant","PreviewHookValue","isLoading","value","Partial","useDocumentPreviewValues","options","$","_c","t0","perspectiveStackFromOptions","t1","t2","get","schemaType","documentPreviewStore","t3","bb0","t4","Symbol","for","t5","undefined","previewStateObservable","previewState","snapshot","documentTitle","title","subtitle","description","media","t6"],"sources":["../src/core/preview/utils/getPreviewStateObservable.ts","../src/core/store/presence/useDocumentPresence.tsx","../src/core/presence/DocumentPreviewPresence.tsx","../src/core/tasks/hooks/useDocumentPreviewValues.ts"],"sourcesContent":["import {\n type PrepareViewOptions,\n type PreviewValue,\n type SanityDocument,\n type SchemaType,\n} from '@sanity/types'\nimport {combineLatest, type Observable, of} from 'rxjs'\nimport {map, startWith} from 'rxjs/operators'\n\nimport {type PerspectiveStack} from '../../perspective/types'\nimport {getPublishedId, getVersionFromId, isVersionId} from '../../util/draftUtils'\nimport {type DocumentPreviewStore} from '../documentPreviewStore'\n\n/**\n * @internal\n */\nexport interface PreviewState {\n isLoading?: boolean\n /**\n * The preview snapshot as seen through the current perspective stack\n */\n snapshot: PreviewValue | Partial<SanityDocument> | null\n /**\n * The preview snapshot in either a single `version` perspective, or the `drafts` perspective\n * This can be used as a fallback if the document exists in e.g. drafts form, but not in the current perspective\n */\n original: PreviewValue | Partial<SanityDocument> | null\n}\n\n/**\n * Obtain a document's published and draft state, along with loading status.\n *\n * @internal\n */\nexport function getPreviewStateObservable(\n documentPreviewStore: DocumentPreviewStore,\n schemaType: SchemaType,\n documentId: string,\n perspective?: PerspectiveStack,\n viewOptions?: PrepareViewOptions,\n /**\n * The selected editing variant as a bare variant id. When set, both the perspective snapshot and\n * the fallback snapshot are resolved as seen through that variant.\n */\n variant?: string,\n): Observable<PreviewState> {\n const perspectiveSnapshot = documentPreviewStore.observeForPreview(\n {_id: getPublishedId(documentId)},\n schemaType,\n {perspective, variant, viewOptions},\n )\n\n const versionOrDraftId = isVersionId(documentId) ? getVersionFromId(documentId) : 'drafts'\n\n const preparedVersionSnapshot = versionOrDraftId\n ? documentPreviewStore.observeForPreview({_id: getPublishedId(documentId)}, schemaType, {\n perspective: [versionOrDraftId],\n variant,\n viewOptions,\n })\n : of(null)\n\n return combineLatest([perspectiveSnapshot, preparedVersionSnapshot]).pipe(\n map(([main, version]) => ({\n isLoading: false,\n snapshot: main?.snapshot || null,\n original: version?.snapshot || null,\n })),\n startWith({\n isLoading: true,\n snapshot: null,\n original: null,\n }),\n )\n}\n","import {startTransition, useEffect, useMemo, useReducer} from 'react'\nimport {useObservable} from 'react-rx'\nimport {of} from 'rxjs'\n\nimport {usePresenceStore} from '../datastores'\nimport {type DocumentPresence} from './types'\n\nconst initial: DocumentPresence[] = []\nconst fallback = of(initial)\n\n/** @internal */\nexport function useDocumentPresence(documentId: string): DocumentPresence[] {\n const [mounted, mount] = useReducer(() => true, false)\n // Using `startTransition` here ensures that rapid re-renders that affect the deps used by `usePresenceStore` delay the transition to `mounted=true`, thus avoiding creating websocket connections that will be closed immediately.\n useEffect(() => startTransition(mount), [])\n\n const presenceStore = usePresenceStore()\n const presence$ = useMemo(\n () => (mounted ? presenceStore.documentPresence(documentId) : fallback),\n [mounted, presenceStore, documentId],\n )\n return useObservable(presence$, initial)\n}\n","import {AvatarStack} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport {useMemo} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {Tooltip, type TooltipProps} from '../../ui-components/tooltip/Tooltip'\nimport {UserAvatar} from '../components/userAvatar/UserAvatar'\nimport {useTranslation} from '../i18n/hooks/useTranslation'\nimport {releasesLocaleNamespace} from '../releases/i18n'\nimport {useActiveReleases} from '../releases/store/useActiveReleases'\nimport {getReleaseIdFromReleaseDocumentId} from '../releases/util/getReleaseIdFromReleaseDocumentId'\nimport {type DocumentPresence} from '../store/presence/types'\nimport {getVersionFromId} from '../util/draftUtils'\nimport {isNonNullable} from '../util/isNonNullable'\n\n/** @internal */\nexport interface DocumentPreviewPresenceProps {\n presence: Omit<DocumentPresence, 'path'>[]\n}\n\nconst PRESENCE_MENU_POPOVER_PROPS: TooltipProps = {\n portal: true,\n}\n\nconst AvatarStackBox = styled.div((props) => {\n const {space} = getTheme_v2(props.theme)\n\n return css`\n margin: ${0 - space[1]}px;\n `\n})\n\n/** @internal */\nexport function DocumentPreviewPresence(props: DocumentPreviewPresenceProps) {\n const {presence} = props\n const {t} = useTranslation(releasesLocaleNamespace)\n\n const {data: releases} = useActiveReleases()\n\n const uniquePresence = useMemo(\n () =>\n Array.from(new Set(presence.map((a) => a.user.id)))\n .map((id) => {\n return presence.find((a) => a.user.id === id)\n })\n .filter(isNonNullable),\n [presence],\n )\n\n const tooltipContent = useMemo(() => {\n if (uniquePresence.length === 1) {\n const firstPresence = uniquePresence[0]\n const documentId = firstPresence?.documentId\n const release = documentId\n ? releases.find(\n (r) => getReleaseIdFromReleaseDocumentId(r._id) === getVersionFromId(documentId),\n )\n : undefined\n const releaseTitle = release?.metadata?.title\n return t('presence.tooltip.one', {\n displayName: firstPresence.user.displayName,\n releaseTitle: releaseTitle || t('release-placeholder.title'),\n })\n }\n\n if (uniquePresence.length > 1) {\n return t('presence.tooltip.other', {count: uniquePresence.length})\n }\n\n return undefined\n }, [releases, t, uniquePresence])\n\n return (\n <Tooltip content={tooltipContent} {...PRESENCE_MENU_POPOVER_PROPS}>\n <AvatarStackBox>\n <AvatarStack maxLength={2} aria-label={tooltipContent} size={0}>\n {uniquePresence.map((item) => (\n <UserAvatar key={item.user.id} size={0} user={item.user} />\n ))}\n </AvatarStack>\n </AvatarStackBox>\n </Tooltip>\n )\n}\n","import {type PreviewValue} from '@sanity/types'\nimport {type ElementType, type ReactNode, useMemo} from 'react'\nimport {useObservable} from 'react-rx'\nimport {of} from 'rxjs'\n\nimport {useSchema} from '../../hooks/useSchema'\nimport {usePerspective} from '../../perspective/usePerspective'\nimport {getPreviewStateObservable} from '../../preview/utils/getPreviewStateObservable'\nimport {useDocumentPreviewStore} from '../../store/datastores'\n\ninterface PreviewHookOptions {\n documentId: string\n documentType: string\n // to make sure that you can get the preview values for a document in a specific perspective stack\n perspectiveStack: string[]\n /**\n * The variant to resolve the preview values in, as a bare variant id. Like `perspectiveStack`,\n * this is explicit: callers that want the variant currently selected in the studio pass\n * `usePerspective().selectedVariantName`.\n */\n variant?: string\n}\n\ninterface PreviewHookValue {\n isLoading: boolean\n value: Partial<PreviewValue> | null\n}\n\n/** @internal */\nexport function useDocumentPreviewValues(options: PreviewHookOptions): PreviewHookValue {\n const {\n documentId,\n documentType,\n perspectiveStack: perspectiveStackFromOptions,\n variant,\n } = options || {}\n const schemaType = useSchema().get(documentType)\n\n const documentPreviewStore = useDocumentPreviewStore()\n // keeping it for now as to make sure that we can safely remove it later\n // the reason to not remove it now is that it would cause a breaking change\n // during run time and we want to avoid that for now (so we left the perspectiveStack in the props as mandatory)\n // @TODO remove\n const {perspectiveStack} = usePerspective()\n const previewStateObservable = useMemo(() => {\n if (!documentId || !schemaType) return of(null)\n return getPreviewStateObservable(\n documentPreviewStore,\n schemaType,\n documentId,\n perspectiveStackFromOptions ?? perspectiveStack,\n undefined,\n variant,\n )\n }, [\n documentId,\n documentPreviewStore,\n schemaType,\n perspectiveStackFromOptions,\n perspectiveStack,\n variant,\n ])\n // Deferred: react-rx v5's deferral is identity-coherent, so on a document\n // id change the live snapshot wins and the previous document's title/media\n // never pairs with the new identity.\n const previewState = useObservable(previewStateObservable)\n\n const isLoading = previewState?.isLoading ?? true\n\n const {snapshot} = previewState || {}\n const documentTitle = snapshot?.title as string | undefined\n const subtitle = snapshot?.subtitle as string | undefined\n const description = snapshot?.description as string | undefined\n const media = snapshot?.media as ReactNode | ElementType | undefined\n\n return {\n isLoading,\n value: {\n title: documentTitle,\n subtitle,\n media,\n description,\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCA,SAAgBmB,0BACdC,sBACAC,YACAC,YACAC,a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ument","SchemaType","combineLatest","Observable","of","map","startWith","PerspectiveStack","getPublishedId","getVersionFromId","isVersionId","DocumentPreviewStore","PreviewState","isLoading","snapshot","Partial","original","getPreviewStateObservable","documentPreviewStore","schemaType","documentId","perspective","viewOptions","variant","perspectiveSnapshot","observeForPreview","_id","versionOrDraftId","preparedVersionSnapshot","pipe","main","version","startTransition","useEffect","useMemo","useReducer","useObservable","of","usePresenceStore","DocumentPresence","initial","fallback","useDocumentPresence","documentId","$","_c","mounted","mount","_temp","t0","t1","Symbol","for","presenceStore","t2","documentPresence","presence$","AvatarStack","getTheme_v2","useMemo","css","styled","Tooltip","TooltipProps","UserAvatar","useTranslation","releasesLocaleNamespace","useActiveReleases","getReleaseIdFromReleaseDocumentId","DocumentPresence","getVersionFromId","isNonNullable","DocumentPreviewPresenceProps","presence","Omit","PRESENCE_MENU_POPOVER_PROPS","portal","AvatarStackBox","div","props","space","theme","DocumentPreviewPresence","$","_c","t","data","releases","t0","Array","from","Set","map","_temp","t1","id","find","a_0","a","user","filter","uniquePresence","t2","bb0","length","firstPresence","documentId","t3","displayName","release","r","_id","undefined","releaseTitle","metadata","title","count","tooltipContent","_temp2","t4","t5","item","PreviewValue","ElementType","ReactNode","useMemo","useObservable","of","useSchema","usePerspective","getPreviewStateObservable","useDocumentPreviewStore","PreviewHookOptions","documentId","documentType","perspectiveStack","variant","PreviewHookValue","isLoading","value","Partial","useDocumentPreviewValues","options","$","_c","t0","perspectiveStackFromOptions","t1","t2","get","schemaType","documentPreviewStore","t3","bb0","t4","Symbol","for","t5","undefined","previewStateObservable","previewState","snapshot","documentTitle","title","subtitle","description","media","t6"],"sources":["../src/core/preview/utils/getPreviewStateObservable.ts","../src/core/store/presence/useDocumentPresence.tsx","../src/core/presence/DocumentPreviewPresence.tsx","../src/core/tasks/hooks/useDocumentPreviewValues.ts"],"sourcesContent":["import {\n type PrepareViewOptions,\n type PreviewValue,\n type SanityDocument,\n type SchemaType,\n} from '@sanity/types'\nimport {combineLatest, type Observable, of} from 'rxjs'\nimport {map, startWith} from 'rxjs/operators'\n\nimport {type PerspectiveStack} from '../../perspective/types'\nimport {getPublishedId, getVersionFromId, isVersionId} from '../../util/draftUtils'\nimport {type DocumentPreviewStore} from '../documentPreviewStore'\n\n/**\n * @internal\n */\nexport interface PreviewState {\n isLoading?: boolean\n /**\n * The preview snapshot as seen through the current perspective stack\n */\n snapshot: PreviewValue | Partial<SanityDocument> | null\n /**\n * The preview snapshot in either a single `version` perspective, or the `drafts` perspective\n * This can be used as a fallback if the document exists in e.g. drafts form, but not in the current perspective\n */\n original: PreviewValue | Partial<SanityDocument> | null\n}\n\n/**\n * Obtain a document's published and draft state, along with loading status.\n *\n * @internal\n */\nexport function getPreviewStateObservable(\n documentPreviewStore: DocumentPreviewStore,\n schemaType: SchemaType,\n documentId: string,\n perspective?: PerspectiveStack,\n viewOptions?: PrepareViewOptions,\n /**\n * The selected editing variant as a bare variant id. When set, both the perspective snapshot and\n * the fallback snapshot are resolved as seen through that variant.\n */\n variant?: string,\n): Observable<PreviewState> {\n const perspectiveSnapshot = documentPreviewStore.observeForPreview(\n {_id: getPublishedId(documentId)},\n schemaType,\n {perspective, variant, viewOptions},\n )\n\n const versionOrDraftId = isVersionId(documentId) ? getVersionFromId(documentId) : 'drafts'\n\n const preparedVersionSnapshot = versionOrDraftId\n ? documentPreviewStore.observeForPreview({_id: getPublishedId(documentId)}, schemaType, {\n perspective: [versionOrDraftId],\n variant,\n viewOptions,\n })\n : of(null)\n\n return combineLatest([perspectiveSnapshot, preparedVersionSnapshot]).pipe(\n map(([main, version]) => ({\n isLoading: false,\n snapshot: main?.snapshot || null,\n original: version?.snapshot || null,\n })),\n startWith({\n isLoading: true,\n snapshot: null,\n original: null,\n }),\n )\n}\n","import {startTransition, useEffect, useMemo, useReducer} from 'react'\nimport {useObservable} from 'react-rx'\nimport {of} from 'rxjs'\n\nimport {usePresenceStore} from '../datastores'\nimport {type DocumentPresence} from './types'\n\nconst initial: DocumentPresence[] = []\nconst fallback = of(initial)\n\n/** @internal */\nexport function useDocumentPresence(documentId: string): DocumentPresence[] {\n const [mounted, mount] = useReducer(() => true, false)\n // Using `startTransition` here ensures that rapid re-renders that affect the deps used by `usePresenceStore` delay the transition to `mounted=true`, thus avoiding creating websocket connections that will be closed immediately.\n useEffect(() => startTransition(mount), [])\n\n const presenceStore = usePresenceStore()\n const presence$ = useMemo(\n () => (mounted ? presenceStore.documentPresence(documentId) : fallback),\n [mounted, presenceStore, documentId],\n )\n return useObservable(presence$, initial)\n}\n","import {AvatarStack} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport {useMemo} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {Tooltip, type TooltipProps} from '../../ui-components/tooltip/Tooltip'\nimport {UserAvatar} from '../components/userAvatar/UserAvatar'\nimport {useTranslation} from '../i18n/hooks/useTranslation'\nimport {releasesLocaleNamespace} from '../releases/i18n'\nimport {useActiveReleases} from '../releases/store/useActiveReleases'\nimport {getReleaseIdFromReleaseDocumentId} from '../releases/util/getReleaseIdFromReleaseDocumentId'\nimport {type DocumentPresence} from '../store/presence/types'\nimport {getVersionFromId} from '../util/draftUtils'\nimport {isNonNullable} from '../util/isNonNullable'\n\n/** @internal */\nexport interface DocumentPreviewPresenceProps {\n presence: Omit<DocumentPresence, 'path'>[]\n}\n\nconst PRESENCE_MENU_POPOVER_PROPS: TooltipProps = {\n portal: true,\n}\n\nconst AvatarStackBox = styled.div((props) => {\n const {space} = getTheme_v2(props.theme)\n\n return css`\n margin: ${0 - space[1]}px;\n `\n})\n\n/** @internal */\nexport function DocumentPreviewPresence(props: DocumentPreviewPresenceProps) {\n const {presence} = props\n const {t} = useTranslation(releasesLocaleNamespace)\n\n const {data: releases} = useActiveReleases()\n\n const uniquePresence = useMemo(\n () =>\n Array.from(new Set(presence.map((a) => a.user.id)))\n .map((id) => {\n return presence.find((a) => a.user.id === id)\n })\n .filter(isNonNullable),\n [presence],\n )\n\n const tooltipContent = useMemo(() => {\n if (uniquePresence.length === 1) {\n const firstPresence = uniquePresence[0]\n const documentId = firstPresence?.documentId\n const release = documentId\n ? releases.find(\n (r) => getReleaseIdFromReleaseDocumentId(r._id) === getVersionFromId(documentId),\n )\n : undefined\n const releaseTitle = release?.metadata?.title\n return t('presence.tooltip.one', {\n displayName: firstPresence.user.displayName,\n releaseTitle: releaseTitle || t('release-placeholder.title'),\n })\n }\n\n if (uniquePresence.length > 1) {\n return t('presence.tooltip.other', {count: uniquePresence.length})\n }\n\n return undefined\n }, [releases, t, uniquePresence])\n\n return (\n <Tooltip content={tooltipContent} {...PRESENCE_MENU_POPOVER_PROPS}>\n <AvatarStackBox>\n <AvatarStack maxLength={2} aria-label={tooltipContent} size={0}>\n {uniquePresence.map((item) => (\n <UserAvatar key={item.user.id} size={0} user={item.user} />\n ))}\n </AvatarStack>\n </AvatarStackBox>\n </Tooltip>\n )\n}\n","import {type PreviewValue} from '@sanity/types'\nimport {type ElementType, type ReactNode, useMemo} from 'react'\nimport {useObservable} from 'react-rx'\nimport {of} from 'rxjs'\n\nimport {useSchema} from '../../hooks/useSchema'\nimport {usePerspective} from '../../perspective/usePerspective'\nimport {getPreviewStateObservable} from '../../preview/utils/getPreviewStateObservable'\nimport {useDocumentPreviewStore} from '../../store/datastores'\n\ninterface PreviewHookOptions {\n documentId: string\n documentType: string\n // to make sure that you can get the preview values for a document in a specific perspective stack\n perspectiveStack: string[]\n /**\n * The variant to resolve the preview values in, as a bare variant id. Like `perspectiveStack`,\n * this is explicit: callers that want the variant currently selected in the studio pass\n * `usePerspective().selectedVariantName`.\n */\n variant?: string\n}\n\ninterface PreviewHookValue {\n isLoading: boolean\n value: Partial<PreviewValue> | null\n}\n\n/** @internal */\nexport function useDocumentPreviewValues(options: PreviewHookOptions): PreviewHookValue {\n const {\n documentId,\n documentType,\n perspectiveStack: perspectiveStackFromOptions,\n variant,\n } = options || {}\n const schemaType = useSchema().get(documentType)\n\n const documentPreviewStore = useDocumentPreviewStore()\n // keeping it for now as to make sure that we can safely remove it later\n // the reason to not remove it now is that it would cause a breaking change\n // during run time and we want to avoid that for now (so we left the perspectiveStack in the props as mandatory)\n // @TODO remove\n const {perspectiveStack} = usePerspective()\n const previewStateObservable = useMemo(() => {\n if (!documentId || !schemaType) return of(null)\n return getPreviewStateObservable(\n documentPreviewStore,\n schemaType,\n documentId,\n perspectiveStackFromOptions ?? perspectiveStack,\n undefined,\n variant,\n )\n }, [\n documentId,\n documentPreviewStore,\n schemaType,\n perspectiveStackFromOptions,\n perspectiveStack,\n variant,\n ])\n // Deferred: react-rx v5's deferral is identity-coherent, so on a document\n // id change the live snapshot wins and the previous document's title/media\n // never pairs with the new identity.\n const previewState = useObservable(previewStateObservable)\n\n const isLoading = previewState?.isLoading ?? true\n\n const {snapshot} = previewState || {}\n const documentTitle = snapshot?.title as string | undefined\n const subtitle = snapshot?.subtitle as string | undefined\n const description = snapshot?.description as string | undefined\n const media = snapshot?.media as ReactNode | ElementType | undefined\n\n return {\n isLoading,\n value: {\n title: documentTitle,\n subtitle,\n media,\n description,\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCA,SAAgBmB,0BACdC,sBACAC,YACAC,YACAC,aACAC,aAKAC,SAC0B;CAC1B,IAAMC,sBAAsBN,qBAAqBO,kBAC/C,EAACC,KAAKlB,eAAeY,UAAU,EAAC,GAChCD,YACA;EAACE;EAAaE;EAASD;CAAW,CACpC,GAEMK,mBAAmBjB,YAAYU,UAAU,IAAIX,iBAAiBW,UAAU,IAAI,UAE5EQ,0BAA0BD,mBAC5BT,qBAAqBO,kBAAkB,EAACC,KAAKlB,eAAeY,UAAU,EAAC,GAAGD,YAAY;EACpFE,aAAa,CAACM,gBAAgB;EAC9BJ;EACAD;CACF,CAAC,IACDlB,GAAG,IAAI;CAEX,OAAOF,cAAc,CAACsB,qBAAqBI,uBAAuB,CAAC,CAAC,CAACC,KACnExB,OAAK,CAACyB,MAAMC,cAAc;EACxBlB,WAAW;EACXC,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gBAAA,CAAiB,GAACjB,EAAA,MAAAiB,cAAAjB,EAAA,MAAAW;CAArC,IAAA,EAAAO,aAAmBP,IACnBQ,gBAAsBD,UAAQE,OAC9BC,WAAiBH,UAAQG,UACzBC,cAAoBJ,UAAQI,aAC5BC,QAAcL,UAAQK,OAA8CT;CAAA,AAAAd,EAAA,QAAAsB,eAAAtB,EAAA,QAAAmB,iBAAAnB,EAAA,QAAAuB,SAAAvB,EAAA,QAAAqB,YAI3DP,KAAA;EAAAM,OACED;EAAaE;EAAAE;EAAAD;CAItB,GAACtB,EAAA,MAAAsB,aAAAtB,EAAA,MAAAmB,eAAAnB,EAAA,MAAAuB,OAAAvB,EAAA,MAAAqB,UAAArB,EAAA,MAAAc,MAAAA,KAAAd,EAAA;CAAA,IAAAwB;CACF,OADExB,EAAA,QAAAL,aAAAK,EAAA,QAAAc,MAPIU,KAAA;EAAA7B;EAAAC,OAEEkB;CAMT,GAACd,EAAA,MAAAL,WAAAK,EAAA,MAAAc,IAAAd,EAAA,MAAAwB,MAAAA,KAAAxB,EAAA,KARMwB;AAQN"}
@@ -1,4 +1,4 @@
1
- import { i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-WYiCwgfZ.js";
1
+ import { i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-BpYJ_yYC.js";
2
2
  import { of } from "rxjs";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { useObservable } from "react-rx";
@@ -66,4 +66,4 @@ function _temp(error) {
66
66
  }
67
67
  export { useFeatureEnabled as n, FEATURES as t };
68
68
 
69
- //# sourceMappingURL=useFeatureEnabled-sRpDeLLJ.js.map
69
+ //# sourceMappingURL=useFeatureEnabled-C5qTffLc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureEnabled-sRpDeLLJ.js","names":["SanityClient","useMemo","useObservable","Observable","of","catchError","map","shareReplay","startWith","useSource","DEFAULT_STUDIO_CLIENT_OPTIONS","useClient","EMPTY_ARRAY","Features","enabled","error","Error","features","isLoading","INITIAL_LOADING_STATE","FEATURES","Record","contentReleases","studioComments","crossDatasetReferences","scheduledPublishing","sanityTasks","singleDocRelease","fetchFeatures","versionedClient","observable","request","uri","tag","cachedFeatureRequest","Map","getFeatures","projectId","get","pipe","set","useFeatureEnabled","featureKey","$","_c","t0","req","t1","t2","t3","undefined","Boolean","includes","_temp","featureInfoObservable","featureInfo"],"sources":["../src/core/hooks/useFeatureEnabled.ts"],"sourcesContent":["import {type SanityClient} from '@sanity/client'\nimport {useMemo} from 'react'\nimport {useObservable} from 'react-rx'\nimport {type Observable, of} from 'rxjs'\nimport {catchError, map, shareReplay, startWith} from 'rxjs/operators'\n\nimport {useSource} from '../studio/source'\nimport {DEFAULT_STUDIO_CLIENT_OPTIONS} from '../studioClient'\nimport {useClient} from './useClient'\n\nconst EMPTY_ARRAY: [] = []\n\ninterface Features {\n enabled: boolean\n error: Error | null\n features: string[]\n isLoading: boolean\n}\n\nconst INITIAL_LOADING_STATE: Features = {\n enabled: true,\n error: null,\n features: EMPTY_ARRAY,\n isLoading: true,\n}\n\nexport const FEATURES: Record<string, string> = {\n contentReleases: 'contentReleases',\n studioComments: 'studioComments',\n crossDatasetReferences: 'crossDatasetReferences',\n scheduledPublishing: 'scheduledPublishing',\n sanityTasks: 'sanityTasks',\n singleDocRelease: 'singleDocRelease',\n}\n/**\n * fetches all the enabled features for this project\n */\nfunction fetchFeatures({versionedClient}: {versionedClient: SanityClient}): Observable<string[]> {\n return versionedClient.observable.request<string[]>({\n uri: `/features`,\n tag: 'features',\n })\n}\n\nconst cachedFeatureRequest = new Map<string, Observable<string[]>>()\n\n/**\n * Retrieves the features for a given project. This returns a cached observable.\n * The client should be initialized with the options in `DEFAULT_STUDIO_CLIENT_OPTIONS`.\n */\nfunction getFeatures({\n projectId,\n versionedClient,\n}: {\n projectId: string\n versionedClient: SanityClient\n}): Observable<string[]> {\n let features = cachedFeatureRequest.get(projectId)\n if (!features) {\n features = fetchFeatures({versionedClient}).pipe(shareReplay())\n cachedFeatureRequest.set(projectId, features)\n }\n return features\n}\n\n/** @internal */\nexport function useFeatureEnabled(featureKey: keyof typeof FEATURES): Features {\n const versionedClient = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {projectId} = useSource()\n\n const req = getFeatures({projectId, versionedClient})\n\n const featureInfoObservable = useMemo(\n () =>\n req.pipe(\n map((features = []) => ({\n isLoading: false,\n enabled: Boolean(features?.includes(featureKey)),\n features,\n error: null,\n })),\n startWith(INITIAL_LOADING_STATE),\n catchError((error: Error) => {\n return of({isLoading: false, enabled: false, features: EMPTY_ARRAY, error})\n }),\n ),\n [featureKey, req],\n )\n const featureInfo = useObservable(featureInfoObservable, INITIAL_LOADING_STATE)\n\n return featureInfo\n}\n"],"mappings":";;;;;AAUA,MAAMY,cAAkB,CAAA,GASlBO,wBAAkC;CACtCL,SAAS;CACTC,OAAO;CACPE,UAAUL;CACVM,WAAW;AACb,GAEaE,WAAmC;CAC9CE,iBAAiB;CACjBC,gBAAgB;CAChBC,wBAAwB;CACxBC,qBAAqB;CACrBC,aAAa;CACbC,kBAAkB;AACpB;;;;AAIA,SAASC,cAAc,EAACC,mBAAyE;CAC/F,OAAOA,gBAAgBC,WAAWC,QAAkB;EAClDC,KAAK;EACLC,KAAK;CACP,CAAC;AACH;AAEA,MAAMC,uCAAuB,IAAIC,IAAkC;;;;;AAMnE,SAASC,YAAY,EACnBC,WACAR,mBAIuB;CACvB,IAAIZ,WAAWiB,qBAAqBI,IAAID,SAAS;CAKjD,OAJKpB,aACHA,WAAWW,cAAc,EAACC,gBAAe,CAAC,CAAC,CAACU,KAAKhC,cAAY,CAAC,GAC9D2B,qBAAqBM,IAAIH,WAAWpB,QAAQ,IAEvCA;AACT;;AAGA,SAAOwB,kBAAAC,YAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACLf,kBAAwBlB,UAAUD,6BAA6B,GAE/D,EAAA2B,cAAoB5B,UAAU,GAACoC;CAAA,AAAAF,EAAA,OAAAN,aAAAM,EAAA,OAAAd,mBAEnBgB,KAAAT,YAAY;EAAAC;EAAAR;CAA2B,CAAC,GAACc,EAAA,KAAAN,WAAAM,EAAA,KAAAd,iBAAAc,EAAA,KAAAE,MAAAA,KAAAF,EAAA;CAArD,IAAAG,MAAYD,IAAyCE;CAAA,IAAAJ,EAAA,OAAAD,cAAAC,EAAA,OAAAG,KAAA;EAAA,IAAAE;EAehDL,AAfgDA,EAAA,OAAAD,aAU7CM,KAAAL,EAAA,MALEK,MAAAC,OAAA;GAAC,IAAAhC,WAAAgC,OAAAC,KAAAA,IAAA,CAAA,IAAAD;GAAa,OAAM;IAAA/B,WACX;IAAKJ,SACPqC,EAAQlC,UAAQmC,SAAWV,UAAU;IAAEzB;IAAAF,OAEzC;GACT;EAAC,GAAC4B,EAAA,KAAAD,YAAAC,EAAA,KAAAK,KANJD,KAAAD,IAAGP,KACDjC,MAAI0C,EAKF,GACFxC,YAAUW,qBAAqB,GAC/Bd,aAAWgD,KAEV,CACH,GAACV,EAAA,KAAAD,YAAAC,EAAA,KAAAG,KAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAG0E,OAA3DzC,cAAcoD,IAAuBnC,qBAElDoC;AAAW;AAzBb,SAAAF,MAAAtC,OAAA;CAAA,OAkBUX,GAAG;EAAAc,WAAY;EAAKJ,SAAW;EAAKG,UAAYL;EAAWG;CAAO,CAAC;AAAC"}
1
+ {"version":3,"file":"useFeatureEnabled-C5qTffLc.js","names":["SanityClient","useMemo","useObservable","Observable","of","catchError","map","shareReplay","startWith","useSource","DEFAULT_STUDIO_CLIENT_OPTIONS","useClient","EMPTY_ARRAY","Features","enabled","error","Error","features","isLoading","INITIAL_LOADING_STATE","FEATURES","Record","contentReleases","studioComments","crossDatasetReferences","scheduledPublishing","sanityTasks","singleDocRelease","fetchFeatures","versionedClient","observable","request","uri","tag","cachedFeatureRequest","Map","getFeatures","projectId","get","pipe","set","useFeatureEnabled","featureKey","$","_c","t0","req","t1","t2","t3","undefined","Boolean","includes","_temp","featureInfoObservable","featureInfo"],"sources":["../src/core/hooks/useFeatureEnabled.ts"],"sourcesContent":["import {type SanityClient} from '@sanity/client'\nimport {useMemo} from 'react'\nimport {useObservable} from 'react-rx'\nimport {type Observable, of} from 'rxjs'\nimport {catchError, map, shareReplay, startWith} from 'rxjs/operators'\n\nimport {useSource} from '../studio/source'\nimport {DEFAULT_STUDIO_CLIENT_OPTIONS} from '../studioClient'\nimport {useClient} from './useClient'\n\nconst EMPTY_ARRAY: [] = []\n\ninterface Features {\n enabled: boolean\n error: Error | null\n features: string[]\n isLoading: boolean\n}\n\nconst INITIAL_LOADING_STATE: Features = {\n enabled: true,\n error: null,\n features: EMPTY_ARRAY,\n isLoading: true,\n}\n\nexport const FEATURES: Record<string, string> = {\n contentReleases: 'contentReleases',\n studioComments: 'studioComments',\n crossDatasetReferences: 'crossDatasetReferences',\n scheduledPublishing: 'scheduledPublishing',\n sanityTasks: 'sanityTasks',\n singleDocRelease: 'singleDocRelease',\n}\n/**\n * fetches all the enabled features for this project\n */\nfunction fetchFeatures({versionedClient}: {versionedClient: SanityClient}): Observable<string[]> {\n return versionedClient.observable.request<string[]>({\n uri: `/features`,\n tag: 'features',\n })\n}\n\nconst cachedFeatureRequest = new Map<string, Observable<string[]>>()\n\n/**\n * Retrieves the features for a given project. This returns a cached observable.\n * The client should be initialized with the options in `DEFAULT_STUDIO_CLIENT_OPTIONS`.\n */\nfunction getFeatures({\n projectId,\n versionedClient,\n}: {\n projectId: string\n versionedClient: SanityClient\n}): Observable<string[]> {\n let features = cachedFeatureRequest.get(projectId)\n if (!features) {\n features = fetchFeatures({versionedClient}).pipe(shareReplay())\n cachedFeatureRequest.set(projectId, features)\n }\n return features\n}\n\n/** @internal */\nexport function useFeatureEnabled(featureKey: keyof typeof FEATURES): Features {\n const versionedClient = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {projectId} = useSource()\n\n const req = getFeatures({projectId, versionedClient})\n\n const featureInfoObservable = useMemo(\n () =>\n req.pipe(\n map((features = []) => ({\n isLoading: false,\n enabled: Boolean(features?.includes(featureKey)),\n features,\n error: null,\n })),\n startWith(INITIAL_LOADING_STATE),\n catchError((error: Error) => {\n return of({isLoading: false, enabled: false, features: EMPTY_ARRAY, error})\n }),\n ),\n [featureKey, req],\n )\n const featureInfo = useObservable(featureInfoObservable, INITIAL_LOADING_STATE)\n\n return featureInfo\n}\n"],"mappings":";;;;;AAUA,MAAMY,cAAkB,CAAA,GASlBO,wBAAkC;CACtCL,SAAS;CACTC,OAAO;CACPE,UAAUL;CACVM,WAAW;AACb,GAEaE,WAAmC;CAC9CE,iBAAiB;CACjBC,gBAAgB;CAChBC,wBAAwB;CACxBC,qBAAqB;CACrBC,aAAa;CACbC,kBAAkB;AACpB;;;;AAIA,SAASC,cAAc,EAACC,mBAAyE;CAC/F,OAAOA,gBAAgBC,WAAWC,QAAkB;EAClDC,KAAK;EACLC,KAAK;CACP,CAAC;AACH;AAEA,MAAMC,uCAAuB,IAAIC,IAAkC;;;;;AAMnE,SAASC,YAAY,EACnBC,WACAR,mBAIuB;CACvB,IAAIZ,WAAWiB,qBAAqBI,IAAID,SAAS;CAKjD,OAJKpB,aACHA,WAAWW,cAAc,EAACC,gBAAe,CAAC,CAAC,CAACU,KAAKhC,cAAY,CAAC,GAC9D2B,qBAAqBM,IAAIH,WAAWpB,QAAQ,IAEvCA;AACT;;AAGA,SAAOwB,kBAAAC,YAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACLf,kBAAwBlB,UAAUD,6BAA6B,GAE/D,EAAA2B,cAAoB5B,UAAU,GAACoC;CAAA,AAAAF,EAAA,OAAAN,aAAAM,EAAA,OAAAd,mBAEnBgB,KAAAT,YAAY;EAAAC;EAAAR;CAA2B,CAAC,GAACc,EAAA,KAAAN,WAAAM,EAAA,KAAAd,iBAAAc,EAAA,KAAAE,MAAAA,KAAAF,EAAA;CAArD,IAAAG,MAAYD,IAAyCE;CAAA,IAAAJ,EAAA,OAAAD,cAAAC,EAAA,OAAAG,KAAA;EAAA,IAAAE;EAehDL,AAfgDA,EAAA,OAAAD,aAU7CM,KAAAL,EAAA,MALEK,MAAAC,OAAA;GAAC,IAAAhC,WAAAgC,OAAAC,KAAAA,IAAA,CAAA,IAAAD;GAAa,OAAM;IAAA/B,WACX;IAAKJ,SACPqC,EAAQlC,UAAQmC,SAAWV,UAAU;IAAEzB;IAAAF,OAEzC;GACT;EAAC,GAAC4B,EAAA,KAAAD,YAAAC,EAAA,KAAAK,KANJD,KAAAD,IAAGP,KACDjC,MAAI0C,EAKF,GACFxC,YAAUW,qBAAqB,GAC/Bd,aAAWgD,KAEV,CACH,GAACV,EAAA,KAAAD,YAAAC,EAAA,KAAAG,KAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAG0E,OAA3DzC,cAAcoD,IAAuBnC,qBAElDoC;AAAW;AAzBb,SAAAF,MAAAtC,OAAA;CAAA,OAkBUX,GAAG;EAAAc,WAAY;EAAKJ,SAAW;EAAKG,UAAYL;EAAWG;CAAO,CAAC;AAAC"}
@@ -1,4 +1,4 @@
1
- import { dn as isRecord } from "./datastores-D4iZNSXV.js";
1
+ import { dn as isRecord } from "./datastores-wbjstxMt.js";
2
2
  import { useContext } from "react";
3
3
  import { FieldActionsContext } from "sanity/_singletons";
4
4
  import { isIndexSegment, isIndexTuple, isKeySegment, isKeyedObject } from "@sanity/types";
@@ -82,4 +82,4 @@ function useFieldActions() {
82
82
  }
83
83
  export { getValueAtPath as a, normalizeIndexTupleSegment as c, pathToString as d, pathsAreEqual as f, getItemKeySegment as i, normalizeKeySegment as l, findIndex as n, isEmptyObject as o, stringToPath as p, getItemKey as r, normalizeIndexSegment as s, useFieldActions as t, normalizePathSegment as u };
84
84
 
85
- //# sourceMappingURL=useFieldActions-CrPgIiyl.js.map
85
+ //# sourceMappingURL=useFieldActions-MFJIkobn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFieldActions-CrPgIiyl.js","names":["IndexTuple","isIndexSegment","isIndexTuple","isKeyedObject","isKeySegment","KeyedSegment","Path","PathSegment","isRecord","rePropName","reKeySegment","pathToString","path","Array","isArray","Error","reduce","target","segment","i","_key","from","to","separator","JSON","stringify","getValueAtPath","rootValue","tail","slice","undefined","find","item","findIndex","array","stringToPath","segments","match","map","normalizePathSegment","normalizeIndexSegment","normalizeKeySegment","normalizeIndexTupleSegment","Number","replace","split","seg","pathsAreEqual","pathA","pathB","length","every","segmentA","index","segmentB","getItemKey","arrayItem","getItemKeySegment","key","isEmptyObject","Object","keys","useContext","FieldActionsContext","FieldActionsContextValue","useFieldActions"],"sources":["../src/core/field/paths/helpers.ts","../src/core/form/field/actions/useFieldActions.ts"],"sourcesContent":["import {\n type IndexTuple,\n isIndexSegment,\n isIndexTuple,\n isKeyedObject,\n isKeySegment,\n type KeyedSegment,\n type Path,\n type PathSegment,\n} from '@sanity/types'\n\nimport {isRecord} from '../../util/isRecord'\n\nconst rePropName =\n /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g\nconst reKeySegment = /_key\\s*==\\s*['\"](.*)['\"]/\n\n/** @internal */\nexport function pathToString(path: Path): string {\n if (!Array.isArray(path)) {\n throw new Error('Path is not an array')\n }\n\n return path.reduce<string>((target, segment, i) => {\n if (isIndexSegment(segment)) {\n return `${target}[${segment}]`\n }\n\n if (isKeySegment(segment) && segment._key) {\n return `${target}[_key==\"${segment._key}\"]`\n }\n\n if (isIndexTuple(segment)) {\n const [from, to] = segment\n return `${target}[${from}:${to}]`\n }\n\n if (typeof segment === 'string') {\n const separator = i === 0 ? '' : '.'\n return `${target}${separator}${segment}`\n }\n\n throw new Error(`Unsupported path segment \\`${JSON.stringify(segment)}\\``)\n }, '')\n}\n\n/** @internal */\nexport function getValueAtPath(rootValue: unknown, path: Path): unknown {\n const segment = path[0]\n if (typeof segment === 'undefined') {\n return rootValue\n }\n\n const tail = path.slice(1)\n if (isIndexSegment(segment)) {\n return getValueAtPath(Array.isArray(rootValue) ? rootValue[segment] : undefined, tail)\n }\n\n if (isKeySegment(segment)) {\n return getValueAtPath(\n Array.isArray(rootValue) ? rootValue.find((item) => item._key === segment._key) : undefined,\n tail,\n )\n }\n\n if (typeof segment === 'string') {\n return getValueAtPath(isRecord(rootValue) ? rootValue[segment] : undefined, tail)\n }\n\n throw new Error(`Unknown segment type ${JSON.stringify(segment)}`)\n}\n\n/** @internal */\nexport function findIndex(array: unknown[], segment: PathSegment): number {\n if (typeof segment !== 'number' && !isKeySegment(segment)) {\n return -1\n }\n\n return typeof segment === 'number'\n ? segment\n : array.findIndex((item) => isKeyedObject(item) && item._key === segment._key)\n}\n\n/** @internal */\nexport function stringToPath(path: string): Path {\n const segments = path.match(rePropName)\n if (!segments) {\n throw new Error('Invalid path string')\n }\n\n return segments.map(normalizePathSegment)\n}\n\n/** @internal */\nexport function normalizePathSegment(segment: string): PathSegment {\n if (isIndexSegment(segment)) {\n return normalizeIndexSegment(segment)\n }\n\n if (isKeySegment(segment)) {\n return normalizeKeySegment(segment)\n }\n\n if (isIndexTuple(segment)) {\n return normalizeIndexTupleSegment(segment)\n }\n\n return segment\n}\n\n/** @internal */\nexport function normalizeIndexSegment(segment: string): PathSegment {\n return Number(segment.replace(/[^\\d]/g, ''))\n}\n\n/** @internal */\nexport function normalizeKeySegment(segment: string): KeyedSegment {\n const segments = segment.match(reKeySegment)\n if (!segments) {\n throw new Error('Invalid key segment')\n }\n\n return {_key: segments[1]}\n}\n\n/** @internal */\nexport function normalizeIndexTupleSegment(segment: string): IndexTuple {\n const [from, to] = segment.split(':').map((seg) => (seg === '' ? seg : Number(seg)))\n return [from, to]\n}\n\n/** @internal */\nexport function pathsAreEqual(pathA: Path, pathB: Path): boolean {\n if (pathA.length !== pathB.length) {\n return false\n }\n\n return pathA.every((segmentA, index) => {\n const segmentB = pathB[index]\n if (isKeySegment(segmentA) && isKeySegment(segmentB)) {\n return segmentA._key === segmentB._key\n }\n\n if (isIndexSegment(segmentA)) {\n return Number(segmentA) === Number(segmentB)\n }\n\n if (isIndexTuple(segmentA) && isIndexTuple(segmentB)) {\n return segmentA[0] === segmentB[0] && segmentA[1] === segmentB[1]\n }\n\n return segmentA === segmentB\n })\n}\n\n/** @internal */\nexport function getItemKey(arrayItem: unknown): string | undefined {\n return isKeyedObject(arrayItem) ? arrayItem._key : undefined\n}\n\n/** @internal */\nexport function getItemKeySegment(arrayItem: unknown): KeyedSegment | undefined {\n const key = getItemKey(arrayItem)\n return key ? {_key: key} : undefined\n}\n\n/** @internal */\nexport function isEmptyObject(item: unknown): boolean {\n return typeof item === 'object' && item !== null && Object.keys(item).length <= 0\n}\n","import {useContext} from 'react'\nimport {FieldActionsContext, type FieldActionsContextValue} from 'sanity/_singletons'\n\n/** @internal */\nexport function useFieldActions(): FieldActionsContextValue {\n return useContext(FieldActionsContext)\n}\n"],"mappings":";;;;AAaA,MAAMS,aACJ,oGACIC,eAAe;;AAGrB,SAAgBC,aAAaC,MAAoB;CAC/C,IAAI,CAACC,MAAMC,QAAQF,IAAI,GACrB,MAAUG,MAAM,sBAAsB;CAGxC,OAAOH,KAAKI,QAAgBC,QAAQC,SAASC,MAAM;EACjD,IAAIlB,eAAeiB,OAAO,GACxB,OAAO,GAAGD,OAAM,GAAIC,QAAO;EAG7B,IAAId,aAAac,OAAO,KAAKA,QAAQE,MACnC,OAAO,GAAGH,OAAM,UAAWC,QAAQE,KAAI;EAGzC,IAAIlB,aAAagB,OAAO,GAAG;GACzB,IAAM,CAACG,MAAMC,MAAMJ;GACnB,OAAO,GAAGD,OAAM,GAAII,KAAI,GAAIC,GAAE;EAChC;EAEA,IAAI,OAAOJ,WAAY,UAErB,OAAO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AK7B,IAAI,CAAC,CAACkB,UAAU;AAClF;;ACrKA,SAAOe,kBAAA;CAAA,OACEH,WAAWC,mBAAmB;AAAC"}
1
+ {"version":3,"file":"useFieldActions-MFJIkobn.js","names":["IndexTuple","isIndexSegment","isIndexTuple","isKeyedObject","isKeySegment","KeyedSegment","Path","PathSegment","isRecord","rePropName","reKeySegment","pathToString","path","Array","isArray","Error","reduce","target","segment","i","_key","from","to","separator","JSON","stringify","getValueAtPath","rootValue","tail","slice","undefined","find","item","findIndex","array","stringToPath","segments","match","map","normalizePathSegment","normalizeIndexSegment","normalizeKeySegment","normalizeIndexTupleSegment","Number","replace","split","seg","pathsAreEqual","pathA","pathB","length","every","segmentA","index","segmentB","getItemKey","arrayItem","getItemKeySegment","key","isEmptyObject","Object","keys","useContext","FieldActionsContext","FieldActionsContextValue","useFieldActions"],"sources":["../src/core/field/paths/helpers.ts","../src/core/form/field/actions/useFieldActions.ts"],"sourcesContent":["import {\n type IndexTuple,\n isIndexSegment,\n isIndexTuple,\n isKeyedObject,\n isKeySegment,\n type KeyedSegment,\n type Path,\n type PathSegment,\n} from '@sanity/types'\n\nimport {isRecord} from '../../util/isRecord'\n\nconst rePropName =\n /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g\nconst reKeySegment = /_key\\s*==\\s*['\"](.*)['\"]/\n\n/** @internal */\nexport function pathToString(path: Path): string {\n if (!Array.isArray(path)) {\n throw new Error('Path is not an array')\n }\n\n return path.reduce<string>((target, segment, i) => {\n if (isIndexSegment(segment)) {\n return `${target}[${segment}]`\n }\n\n if (isKeySegment(segment) && segment._key) {\n return `${target}[_key==\"${segment._key}\"]`\n }\n\n if (isIndexTuple(segment)) {\n const [from, to] = segment\n return `${target}[${from}:${to}]`\n }\n\n if (typeof segment === 'string') {\n const separator = i === 0 ? '' : '.'\n return `${target}${separator}${segment}`\n }\n\n throw new Error(`Unsupported path segment \\`${JSON.stringify(segment)}\\``)\n }, '')\n}\n\n/** @internal */\nexport function getValueAtPath(rootValue: unknown, path: Path): unknown {\n const segment = path[0]\n if (typeof segment === 'undefined') {\n return rootValue\n }\n\n const tail = path.slice(1)\n if (isIndexSegment(segment)) {\n return getValueAtPath(Array.isArray(rootValue) ? rootValue[segment] : undefined, tail)\n }\n\n if (isKeySegment(segment)) {\n return getValueAtPath(\n Array.isArray(rootValue) ? rootValue.find((item) => item._key === segment._key) : undefined,\n tail,\n )\n }\n\n if (typeof segment === 'string') {\n return getValueAtPath(isRecord(rootValue) ? rootValue[segment] : undefined, tail)\n }\n\n throw new Error(`Unknown segment type ${JSON.stringify(segment)}`)\n}\n\n/** @internal */\nexport function findIndex(array: unknown[], segment: PathSegment): number {\n if (typeof segment !== 'number' && !isKeySegment(segment)) {\n return -1\n }\n\n return typeof segment === 'number'\n ? segment\n : array.findIndex((item) => isKeyedObject(item) && item._key === segment._key)\n}\n\n/** @internal */\nexport function stringToPath(path: string): Path {\n const segments = path.match(rePropName)\n if (!segments) {\n throw new Error('Invalid path string')\n }\n\n return segments.map(normalizePathSegment)\n}\n\n/** @internal */\nexport function normalizePathSegment(segment: string): PathSegment {\n if (isIndexSegment(segment)) {\n return normalizeIndexSegment(segment)\n }\n\n if (isKeySegment(segment)) {\n return normalizeKeySegment(segment)\n }\n\n if (isIndexTuple(segment)) {\n return normalizeIndexTupleSegment(segment)\n }\n\n return segment\n}\n\n/** @internal */\nexport function normalizeIndexSegment(segment: string): PathSegment {\n return Number(segment.replace(/[^\\d]/g, ''))\n}\n\n/** @internal */\nexport function normalizeKeySegment(segment: string): KeyedSegment {\n const segments = segment.match(reKeySegment)\n if (!segments) {\n throw new Error('Invalid key segment')\n }\n\n return {_key: segments[1]}\n}\n\n/** @internal */\nexport function normalizeIndexTupleSegment(segment: string): IndexTuple {\n const [from, to] = segment.split(':').map((seg) => (seg === '' ? seg : Number(seg)))\n return [from, to]\n}\n\n/** @internal */\nexport function pathsAreEqual(pathA: Path, pathB: Path): boolean {\n if (pathA.length !== pathB.length) {\n return false\n }\n\n return pathA.every((segmentA, index) => {\n const segmentB = pathB[index]\n if (isKeySegment(segmentA) && isKeySegment(segmentB)) {\n return segmentA._key === segmentB._key\n }\n\n if (isIndexSegment(segmentA)) {\n return Number(segmentA) === Number(segmentB)\n }\n\n if (isIndexTuple(segmentA) && isIndexTuple(segmentB)) {\n return segmentA[0] === segmentB[0] && segmentA[1] === segmentB[1]\n }\n\n return segmentA === segmentB\n })\n}\n\n/** @internal */\nexport function getItemKey(arrayItem: unknown): string | undefined {\n return isKeyedObject(arrayItem) ? arrayItem._key : undefined\n}\n\n/** @internal */\nexport function getItemKeySegment(arrayItem: unknown): KeyedSegment | undefined {\n const key = getItemKey(arrayItem)\n return key ? {_key: key} : undefined\n}\n\n/** @internal */\nexport function isEmptyObject(item: unknown): boolean {\n return typeof item === 'object' && item !== null && Object.keys(item).length <= 0\n}\n","import {useContext} from 'react'\nimport {FieldActionsContext, type FieldActionsContextValue} from 'sanity/_singletons'\n\n/** @internal */\nexport function useFieldActions(): FieldActionsContextValue {\n return useContext(FieldActionsContext)\n}\n"],"mappings":";;;;AAaA,MAAMS,aACJ,oGACIC,eAAe;;AAGrB,SAAgBC,aAAaC,MAAoB;CAC/C,IAAI,CAACC,MAAMC,QAAQF,IAAI,GACrB,MAAUG,MAAM,sBAAsB;CAGxC,OAAOH,KAAKI,QAAgBC,QAAQC,SAASC,MAAM;EACjD,IAAIlB,eAAeiB,OAAO,GACxB,OAAO,GAAGD,OAAM,GAAIC,QAAO;EAG7B,IAAId,aAAac,OAAO,KAAKA,QAAQE,MACnC,OAAO,GAAGH,OAAM,UAAWC,QAAQE,KAAI;EAGzC,IAAIlB,aAAagB,OAAO,GAAG;GACzB,IAAM,CAACG,MAAMC,MAAMJ;GACnB,OAAO,GAAGD,OAAM,GAAII,KAAI,GAAIC,GAAE;EAChC;EAEA,IAAI,O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AYA,QAAiB4B,OAAOC,KAAK7B,IAAI,CAAC,CAACkB,UAAU;AAClF;;ACrKA,SAAOe,kBAAA;CAAA,OACEH,WAAWC,mBAAmB;AAAC"}
@@ -1,4 +1,4 @@
1
- import { o as useSource } from "./studioClient-WYiCwgfZ.js";
1
+ import { o as useSource } from "./studioClient-BpYJ_yYC.js";
2
2
  /**
3
3
  * React hook that returns the current project id
4
4
  *
@@ -17,4 +17,4 @@ function useProjectId() {
17
17
  }
18
18
  export { useProjectId as t };
19
19
 
20
- //# sourceMappingURL=useProjectId-bGwoCAuz.js.map
20
+ //# sourceMappingURL=useProjectId-BRSQ8kIo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProjectId-bGwoCAuz.js","names":["useSource","useProjectId","projectId"],"sources":["../src/core/hooks/useProjectId.ts"],"sourcesContent":["import {useSource} from '../studio/source'\n\n/**\n * React hook that returns the current project id\n *\n * @public\n * @returns The current project id\n * @example Using the `useProjectId` hook\n * ```ts\n * function MyComponent() {\n * const projectId = useProjectId()\n * // ... do something with the project id ...\n * }\n * ```\n */\nexport function useProjectId(): string {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n return useSource().projectId\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAOC,eAAA;CAAA,OAEED,UAAU,CAAC,CAAAE;AAAU"}
1
+ {"version":3,"file":"useProjectId-BRSQ8kIo.js","names":["useSource","useProjectId","projectId"],"sources":["../src/core/hooks/useProjectId.ts"],"sourcesContent":["import {useSource} from '../studio/source'\n\n/**\n * React hook that returns the current project id\n *\n * @public\n * @returns The current project id\n * @example Using the `useProjectId` hook\n * ```ts\n * function MyComponent() {\n * const projectId = useProjectId()\n * // ... do something with the project id ...\n * }\n * ```\n */\nexport function useProjectId(): string {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n return useSource().projectId\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAOC,eAAA;CAAA,OAEED,UAAU,CAAC,CAAAE;AAAU"}
@@ -1,5 +1,5 @@
1
- import { c as useWorkspace } from "./studioClient-WYiCwgfZ.js";
2
- import { n as SCHEDULES_TOOL_NAME } from "./plugin-BhEK2rZ8.js";
1
+ import { c as useWorkspace } from "./studioClient-BpYJ_yYC.js";
2
+ import { n as SCHEDULES_TOOL_NAME } from "./plugin-wJP1ECFq.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  /**
5
5
  * Determine whether the releases tool is available in the current workspace.
@@ -20,4 +20,4 @@ function _temp(t0) {
20
20
  }
21
21
  export { useReleasesToolAvailable as t };
22
22
 
23
- //# sourceMappingURL=useReleasesToolAvailable-BevhFmt9.js.map
23
+ //# sourceMappingURL=useReleasesToolAvailable-BOlw1HWL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useReleasesToolAvailable-BevhFmt9.js","names":["useMemo","useWorkspace","SCHEDULES_TOOL_NAME","useReleasesToolAvailable","$","_c","workspace","t0","tools","some","_temp","name"],"sources":["../src/core/schedules/hooks/useReleasesToolAvailable.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useWorkspace} from '../../studio/workspace'\nimport {SCHEDULES_TOOL_NAME} from '../plugin'\n\n/**\n * Determine whether the releases tool is available in the current workspace.\n *\n * This check is performed on the available tools, rather than the enabled status of the releases\n * feature itself. This caters to scenarios in which releases are enabled for the workspace, but the\n * release tool was later removed (e.g. using a workspace tool filter).\n *\n * @internal\n */\nexport function useReleasesToolAvailable(): boolean {\n const workspace = useWorkspace()\n return useMemo(() => workspace.tools.some(({name}) => name === SCHEDULES_TOOL_NAME), [workspace])\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAOG,2BAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACLC,YAAkBL,aAAa,GAACM;CACmD,OADnDH,EAAA,OAAAE,UAAAE,QACmDD,KAAAH,EAAA,MAA9DG,KAAAD,UAASE,MAAMC,KAAMC,KAAwC,GAACN,EAAA,KAAAE,UAAAE,OAAAJ,EAAA,KAAAG,KAA9DA;AAA8D;AAF9E,SAAAG,MAAAH,IAAA;CAEsC,IAAA,EAAAI,SAAAJ;CAAM,OAAKI,SAAST;AAAmB"}
1
+ {"version":3,"file":"useReleasesToolAvailable-BOlw1HWL.js","names":["useMemo","useWorkspace","SCHEDULES_TOOL_NAME","useReleasesToolAvailable","$","_c","workspace","t0","tools","some","_temp","name"],"sources":["../src/core/schedules/hooks/useReleasesToolAvailable.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useWorkspace} from '../../studio/workspace'\nimport {SCHEDULES_TOOL_NAME} from '../plugin'\n\n/**\n * Determine whether the releases tool is available in the current workspace.\n *\n * This check is performed on the available tools, rather than the enabled status of the releases\n * feature itself. This caters to scenarios in which releases are enabled for the workspace, but the\n * release tool was later removed (e.g. using a workspace tool filter).\n *\n * @internal\n */\nexport function useReleasesToolAvailable(): boolean {\n const workspace = useWorkspace()\n return useMemo(() => workspace.tools.some(({name}) => name === SCHEDULES_TOOL_NAME), [workspace])\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAOG,2BAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACLC,YAAkBL,aAAa,GAACM;CACmD,OADnDH,EAAA,OAAAE,UAAAE,QACmDD,KAAAH,EAAA,MAA9DG,KAAAD,UAASE,MAAMC,KAAMC,KAAwC,GAACN,EAAA,KAAAE,UAAAE,OAAAJ,EAAA,KAAAG,KAA9DA;AAA8D;AAF9E,SAAAG,MAAAH,IAAA;CAEsC,IAAA,EAAAI,SAAAJ;CAAM,OAAKI,SAAST;AAAmB"}
@@ -3,15 +3,15 @@ import { t as Button$1 } from "./Button-CGZ3ETwD.js";
3
3
  import { t as TooltipDelayGroupProvider } from "./TooltipDelayGroupProvider-whJet8vQ.js";
4
4
  import { t as Popover } from "./Popover-DRCM1MS-.js";
5
5
  import { d as getVersionId, l as getPublishedId, s as getDraftId, u as getVersionFromId } from "./draftUtils-D3HJGQaW.js";
6
- import { i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-WYiCwgfZ.js";
7
- import { Et as getVariantId, ot as getReleaseIdFromReleaseDocumentId, pn as useSchema, r as useDocumentPreviewStore, rn as RELEASES_STUDIO_CLIENT_OPTIONS } from "./datastores-D4iZNSXV.js";
6
+ import { i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-BpYJ_yYC.js";
7
+ import { Et as getVariantId, ot as getReleaseIdFromReleaseDocumentId, pn as useSchema, r as useDocumentPreviewStore, rn as RELEASES_STUDIO_CLIENT_OPTIONS } from "./datastores-wbjstxMt.js";
8
8
  import { t as useTranslation } from "./useTranslation-Cqs6Itwv.js";
9
- import { t as LoadingBlock } from "./LoadingBlock-Cy2Pckab.js";
9
+ import { t as LoadingBlock } from "./LoadingBlock-DPTVJ58M.js";
10
10
  import { t as useCurrentLocale } from "./useLocale-ChRJXddd.js";
11
11
  import { t as Translate } from "./Translate-0HIWr1eF.js";
12
- import { A as isGoingToUnpublish, At as createReleaseId, C as useDocumentVersions, E as Preview, O as unstable_useValuePreview, Ot as isReleaseScheduledOrScheduling, c as getReleaseDocumentIdFromReleaseId, gt as useReleasesStore, i as useReleaseOperations, r as useAllReleases, t as getBundleDocumentsObservable, zt as isPausedCardinalityOneRelease } from "./useBundleDocuments-CiRQnzQh.js";
12
+ import { A as isGoingToUnpublish, At as createReleaseId, C as useDocumentVersions, E as Preview, O as unstable_useValuePreview, Ot as isReleaseScheduledOrScheduling, c as getReleaseDocumentIdFromReleaseId, gt as useReleasesStore, i as useReleaseOperations, r as useAllReleases, t as getBundleDocumentsObservable, zt as isPausedCardinalityOneRelease } from "./useBundleDocuments-C58ExRpX.js";
13
13
  import { r as isAgentBundleName } from "./createAgentBundlesStore-BJwwD0vJ.js";
14
- import { t as useTimeZone } from "./useTimeZone-DnxQlCGS.js";
14
+ import { t as useTimeZone } from "./useTimeZone-Da8WK1q-.js";
15
15
  import { useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
16
16
  import { EMPTY, of } from "rxjs";
17
17
  import { c } from "react/compiler-runtime";
@@ -1986,4 +1986,4 @@ function useScheduledDraftMenuActions(options) {
1986
1986
  }
1987
1987
  export { getDocumentVersionInfoFromVersions as C, isVariantVersion as D, isReleaseVersion as E, readVersionType as O, useDialogTimeZone as S, isPublishedVersion as T, useReleaseDocuments as _, Z_OFFSET as a, singleDocReleaseUsEnglishLocaleBundle as b, DateTimeInput as c, useWeeksOfMonth as d, ARROW_KEYS as f, useScheduledDraftDocument as g, useScheduleDraftOperations as h, SCHEDULED_PUBLISHING_TIME_ZONE_SCOPE as i, DatePicker as l, DEFAULT_WEEK_DAY_NAMES as m, ScheduleDraftDialog as n, getCalendarLabels as o, DEFAULT_MONTH_NAMES as p, CONTENT_RELEASES_TIME_ZONE_SCOPE as r, isValidDate as s, useScheduledDraftMenuActions as t, MONTH_PICKER_VARIANT as u, getErrorMessage as v, isDraftVersion as w, LazyTextInput as x, singleDocReleaseNamespace as y };
1988
1988
 
1989
- //# sourceMappingURL=useScheduledDraftMenuActions-DqsFlU0p.js.map
1989
+ //# sourceMappingURL=useScheduledDraftMenuActions-DIQYFw0x.js.map