sanity 6.9.2-next.21 → 6.9.2-next.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{AddonDatasetProvider-B5npf4J4.js → AddonDatasetProvider-CfAw3oMr.js} +2 -2
- package/lib/{AddonDatasetProvider-B5npf4J4.js.map → AddonDatasetProvider-CfAw3oMr.js.map} +1 -1
- package/lib/{CalendarFilter-DYJEZDCP.js → CalendarFilter-OHGevGRx.js} +3 -3
- package/lib/{CalendarFilter-DYJEZDCP.js.map → CalendarFilter-OHGevGRx.js.map} +1 -1
- package/lib/{CommentsDocumentLayout-CTL7lt6a.js → CommentsDocumentLayout-p8p-oNuH.js} +2 -2
- package/lib/{CommentsDocumentLayout-CTL7lt6a.js.map → CommentsDocumentLayout-p8p-oNuH.js.map} +1 -1
- package/lib/{CommentsField-BE_CI2SY.js → CommentsField-CqXs722Y.js} +3 -3
- package/lib/{CommentsField-BE_CI2SY.js.map → CommentsField-CqXs722Y.js.map} +1 -1
- package/lib/{CommentsInput-D_EM-t5a.js → CommentsInput-B3rd8HlF.js} +5 -5
- package/lib/{CommentsInput-D_EM-t5a.js.map → CommentsInput-B3rd8HlF.js.map} +1 -1
- package/lib/{CommentsInspector-DtBIUadl.js → CommentsInspector-DTHmjTFc.js} +5 -5
- package/lib/{CommentsInspector-DtBIUadl.js.map → CommentsInspector-DTHmjTFc.js.map} +1 -1
- package/lib/{CommentsListItem-BFRqZMJ6.js → CommentsListItem-C2Ac0esL.js} +3 -3
- package/lib/{CommentsListItem-BFRqZMJ6.js.map → CommentsListItem-C2Ac0esL.js.map} +1 -1
- package/lib/{CommentsSelectedPathProvider-CIKpHpK3.js → CommentsSelectedPathProvider-DwDw8s-s.js} +3 -3
- package/lib/{CommentsSelectedPathProvider-CIKpHpK3.js.map → CommentsSelectedPathProvider-DwDw8s-s.js.map} +1 -1
- package/lib/{CommentsStudioLayout-Dx0jIDle.js → CommentsStudioLayout-e2hCA_5z.js} +4 -4
- package/lib/{CommentsStudioLayout-Dx0jIDle.js.map → CommentsStudioLayout-e2hCA_5z.js.map} +1 -1
- package/lib/{ReleasesMetadataProvider-hILX90V4.js → ReleasesMetadataProvider-BWsmHWkh.js} +2 -2
- package/lib/{ReleasesMetadataProvider-hILX90V4.js.map → ReleasesMetadataProvider-BWsmHWkh.js.map} +1 -1
- package/lib/{ReleasesNav-DIv-1iR7.js → ReleasesNav-DPSjEs29.js} +14 -14
- package/lib/{ReleasesNav-DIv-1iR7.js.map → ReleasesNav-DPSjEs29.js.map} +1 -1
- package/lib/{ReleasesStudioLayout-DW7fJSfG.js → ReleasesStudioLayout-CtyE88nI.js} +8 -8
- package/lib/{ReleasesStudioLayout-DW7fJSfG.js.map → ReleasesStudioLayout-CtyE88nI.js.map} +1 -1
- package/lib/{ReleasesTool-BQjO7osC.js → ReleasesTool-BjbRMZlc.js} +15 -15
- package/lib/{ReleasesTool-BQjO7osC.js.map → ReleasesTool-BjbRMZlc.js.map} +1 -1
- package/lib/{SchedulePublishingStudioLayout-Cwmdz7HZ.js → SchedulePublishingStudioLayout-gZWH97ZL.js} +3 -3
- package/lib/{SchedulePublishingStudioLayout-Cwmdz7HZ.js.map → SchedulePublishingStudioLayout-gZWH97ZL.js.map} +1 -1
- package/lib/{SchedulePublishingUpsellProvider-C5B21VDh.js → SchedulePublishingUpsellProvider-DsI8OUg-.js} +2 -2
- package/lib/{SchedulePublishingUpsellProvider-C5B21VDh.js.map → SchedulePublishingUpsellProvider-DsI8OUg-.js.map} +1 -1
- package/lib/{ScheduledPublishingEnabledProvider-BNMAVqrS.js → ScheduledPublishingEnabledProvider-BDRtV8OB.js} +3 -3
- package/lib/{ScheduledPublishingEnabledProvider-BNMAVqrS.js.map → ScheduledPublishingEnabledProvider-BDRtV8OB.js.map} +1 -1
- package/lib/{SearchProvider-DkGUk8a6.js → SearchProvider-Hk7IMQqR.js} +4 -4
- package/lib/{SearchProvider-DkGUk8a6.js.map → SearchProvider-Hk7IMQqR.js.map} +1 -1
- package/lib/{SingleDocReleaseLayout-fW8U-ktp.js → SingleDocReleaseLayout-evCp37zs.js} +2 -2
- package/lib/{SingleDocReleaseLayout-fW8U-ktp.js.map → SingleDocReleaseLayout-evCp37zs.js.map} +1 -1
- package/lib/{SingleDocReleaseUpsellProvider-BNF2Rj3j.js → SingleDocReleaseUpsellProvider-BOe2BACb.js} +4 -4
- package/lib/{SingleDocReleaseUpsellProvider-BNF2Rj3j.js.map → SingleDocReleaseUpsellProvider-BOe2BACb.js.map} +1 -1
- package/lib/{TasksStudioActiveToolLayout-CHazNA61.js → TasksStudioActiveToolLayout-Dbs-1GX6.js} +11 -11
- package/lib/{TasksStudioActiveToolLayout-CHazNA61.js.map → TasksStudioActiveToolLayout-Dbs-1GX6.js.map} +1 -1
- package/lib/{TasksStudioLayout-B7bCL28Q.js → TasksStudioLayout-Pn-RwtPi.js} +5 -5
- package/lib/{TasksStudioLayout-B7bCL28Q.js.map → TasksStudioLayout-Pn-RwtPi.js.map} +1 -1
- package/lib/{Tool-rkq_tjXo.js → Tool-D4-WLZtb.js} +12 -12
- package/lib/{Tool-rkq_tjXo.js.map → Tool-D4-WLZtb.js.map} +1 -1
- package/lib/{UnpublishVersionDialog-DWYCXGkz.js → UnpublishVersionDialog-DmFHVqhI.js} +4 -4
- package/lib/{UnpublishVersionDialog-DWYCXGkz.js.map → UnpublishVersionDialog-DmFHVqhI.js.map} +1 -1
- package/lib/{UpsellDialog-BiDSVmne.js → UpsellDialog-DRhOCOce.js} +2 -2
- package/lib/{UpsellDialog-BiDSVmne.js.map → UpsellDialog-DRhOCOce.js.map} +1 -1
- package/lib/{VariantsStudioNavbar-Bae9LOIN.js → VariantsStudioNavbar-CXpr7UUl.js} +7 -7
- package/lib/{VariantsStudioNavbar-Bae9LOIN.js.map → VariantsStudioNavbar-CXpr7UUl.js.map} +1 -1
- package/lib/{VariantsTool-E4ptTHik.js → VariantsTool-BCtrSWfP.js} +7 -7
- package/lib/{VariantsTool-E4ptTHik.js.map → VariantsTool-BCtrSWfP.js.map} +1 -1
- package/lib/{WorkspaceLoader-sdFQ9rkh.js → WorkspaceLoader-_w6NnbDb.js} +21 -21
- package/lib/{WorkspaceLoader-sdFQ9rkh.js.map → WorkspaceLoader-_w6NnbDb.js.map} +1 -1
- package/lib/_createContext.js +1 -1
- package/lib/{buildTextSelectionFromFragment-CuXpitEZ.js → buildTextSelectionFromFragment-Egmw5rNs.js} +3 -3
- package/lib/{buildTextSelectionFromFragment-CuXpitEZ.js.map → buildTextSelectionFromFragment-Egmw5rNs.js.map} +1 -1
- package/lib/{datastores-XTDIa3jc.js → datastores-DpJ5Y313.js} +2 -2
- package/lib/{datastores-XTDIa3jc.js.map → datastores-DpJ5Y313.js.map} +1 -1
- package/lib/index.js +28 -28
- package/lib/{inputResolver-DLP8YZcM.js → inputResolver-BX-VuloN.js} +4 -4
- package/lib/{inputResolver-DLP8YZcM.js.map → inputResolver-BX-VuloN.js.map} +1 -1
- package/lib/{navigation.telemetry-4pppJENG.js → navigation.telemetry-VbqjOek0.js} +7 -7
- package/lib/{navigation.telemetry-4pppJENG.js.map → navigation.telemetry-VbqjOek0.js.map} +1 -1
- package/lib/{plugin-BmARoHKH.js → plugin-DGOEvpWT.js} +4 -4
- package/lib/{plugin-BmARoHKH.js.map → plugin-DGOEvpWT.js.map} +1 -1
- package/lib/{plugin-BUox1zeI.js → plugin-Da_fKb0U.js} +3 -3
- package/lib/{plugin-BUox1zeI.js.map → plugin-Da_fKb0U.js.map} +1 -1
- package/lib/{plugin-CjN39wwt.js → plugin-DqqaZdOH.js} +5 -5
- package/lib/{plugin-CjN39wwt.js.map → plugin-DqqaZdOH.js.map} +1 -1
- package/lib/{plugin-BRnqEpCl.js → plugin-qHXYpO99.js} +6 -6
- package/lib/{plugin-BRnqEpCl.js.map → plugin-qHXYpO99.js.map} +1 -1
- package/lib/{scheduleItem-Dtb26ejO.js → scheduleItem-DcC1HE9G.js} +8 -8
- package/lib/{scheduleItem-Dtb26ejO.js.map → scheduleItem-DcC1HE9G.js.map} +1 -1
- package/lib/{schedules-6qsR7E_I.js → schedules-CbnXaXM9.js} +3 -3
- package/lib/{schedules-6qsR7E_I.js.map → schedules-CbnXaXM9.js.map} +1 -1
- package/lib/{searchDocumentRelease-CUk7BiST.js → searchDocumentRelease-C5sClmGF.js} +4 -4
- package/lib/{searchDocumentRelease-CUk7BiST.js.map → searchDocumentRelease-C5sClmGF.js.map} +1 -1
- package/lib/{studioClient-D1Z2zK3C.js → studioClient-CwMJwOTd.js} +2 -2
- package/lib/{studioClient-D1Z2zK3C.js.map → studioClient-CwMJwOTd.js.map} +1 -1
- package/lib/{useBundleDocuments-BnCBcbdJ.js → useBundleDocuments-DvVAF6cf.js} +7 -7
- package/lib/{useBundleDocuments-BnCBcbdJ.js.map → useBundleDocuments-DvVAF6cf.js.map} +1 -1
- package/lib/{useComments-Bm-0CwNH.js → useComments-DuEOnDkA.js} +2 -2
- package/lib/{useComments-Bm-0CwNH.js.map → useComments-DuEOnDkA.js.map} +1 -1
- package/lib/{useCommentsTelemetry-D1kYRuPU.js → useCommentsTelemetry-BgNdQdz5.js} +3 -3
- package/lib/{useCommentsTelemetry-D1kYRuPU.js.map → useCommentsTelemetry-BgNdQdz5.js.map} +1 -1
- package/lib/{useDocumentPreviewValues-DJvES8Wi.js → useDocumentPreviewValues-B1zNjl_D.js} +3 -3
- package/lib/{useDocumentPreviewValues-DJvES8Wi.js.map → useDocumentPreviewValues-B1zNjl_D.js.map} +1 -1
- package/lib/{useFeatureEnabled-g8eZoiLM.js → useFeatureEnabled-4qCpV_mX.js} +2 -2
- package/lib/{useFeatureEnabled-g8eZoiLM.js.map → useFeatureEnabled-4qCpV_mX.js.map} +1 -1
- package/lib/{useFieldActions-BV_qfe65.js → useFieldActions-uDe2qh98.js} +2 -2
- package/lib/{useFieldActions-BV_qfe65.js.map → useFieldActions-uDe2qh98.js.map} +1 -1
- package/lib/{useReleasesToolAvailable-Duu10qV0.js → useReleasesToolAvailable-DDuNc6HV.js} +3 -3
- package/lib/{useReleasesToolAvailable-Duu10qV0.js.map → useReleasesToolAvailable-DDuNc6HV.js.map} +1 -1
- package/lib/{useScheduledDraftMenuActions-Byiy3-k3.js → useScheduledDraftMenuActions-DqkHlC0c.js} +5 -5
- package/lib/{useScheduledDraftMenuActions-Byiy3-k3.js.map → useScheduledDraftMenuActions-DqkHlC0c.js.map} +1 -1
- package/lib/{useStudioUrl-BEb30_UK.js → useStudioUrl-B4w58A2i.js} +5 -5
- package/lib/{useStudioUrl-BEb30_UK.js.map → useStudioUrl-B4w58A2i.js.map} +1 -1
- package/lib/{useTimeZone-zs0ybzXu.js → useTimeZone-8Wd1UR4j.js} +2 -2
- package/lib/{useTimeZone-zs0ybzXu.js.map → useTimeZone-8Wd1UR4j.js.map} +1 -1
- package/lib/{validationUtils-LdwtMTh5.js → validationUtils-Cuk0jhWJ.js} +4 -4
- package/lib/{validationUtils-LdwtMTh5.js.map → validationUtils-Cuk0jhWJ.js.map} +1 -1
- package/lib/{version-XEmBTnIh.js → version-BVcB_xWL.js} +2 -2
- package/lib/{version-XEmBTnIh.js.map → version-BVcB_xWL.js.map} +1 -1
- package/package.json +10 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as Tooltip$1 } from "./MenuItem-BWdL61CI.js";
|
|
2
2
|
import { t as useTranslation } from "./useTranslation-Cqs6Itwv.js";
|
|
3
|
-
import { _ as applyCommentsGroupAttr, b as commentsLocaleNamespace, d as hasCommentMessageValue, o as CommentInput } from "./useComments-
|
|
4
|
-
import { n as ThreadCard, t as CommentsListItem } from "./CommentsListItem-
|
|
3
|
+
import { _ as applyCommentsGroupAttr, b as commentsLocaleNamespace, d as hasCommentMessageValue, o as CommentInput } from "./useComments-DuEOnDkA.js";
|
|
4
|
+
import { n as ThreadCard, t as CommentsListItem } from "./CommentsListItem-C2Ac0esL.js";
|
|
5
5
|
import { n as LoadingBlock } from "./useDidUpdate-Br1Dx-yJ.js";
|
|
6
6
|
import { t as Translate } from "./Translate-0HIWr1eF.js";
|
|
7
7
|
import { Fragment, memo, useRef, useState } from "react";
|
|
@@ -414,4 +414,4 @@ function useCommentsTelemetry() {
|
|
|
414
414
|
}
|
|
415
415
|
export { CommentsList as n, useCommentsTelemetry as t };
|
|
416
416
|
|
|
417
|
-
//# sourceMappingURL=useCommentsTelemetry-
|
|
417
|
+
//# sourceMappingURL=useCommentsTelemetry-BgNdQdz5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCommentsTelemetry-D1kYRuPU.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, commentViewedF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AA,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-BgNdQdz5.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,MAAxB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AFyCK,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,5 +1,5 @@
|
|
|
1
|
-
import { gn as useSchema, r as useDocumentPreviewStore } from "./datastores-
|
|
2
|
-
import { bi as usePerspective, is as getPreviewStateObservable } from "./useBundleDocuments-
|
|
1
|
+
import { gn as useSchema, r as useDocumentPreviewStore } from "./datastores-DpJ5Y313.js";
|
|
2
|
+
import { bi as usePerspective, is as getPreviewStateObservable } from "./useBundleDocuments-DvVAF6cf.js";
|
|
3
3
|
import { of } from "rxjs";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { useObservable } from "react-rx";
|
|
@@ -36,4 +36,4 @@ function useDocumentPreviewValues(options) {
|
|
|
36
36
|
}
|
|
37
37
|
export { useDocumentPreviewValues as t };
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=useDocumentPreviewValues-
|
|
39
|
+
//# sourceMappingURL=useDocumentPreviewValues-B1zNjl_D.js.map
|
package/lib/{useDocumentPreviewValues-DJvES8Wi.js.map → useDocumentPreviewValues-B1zNjl_D.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentPreviewValues-
|
|
1
|
+
{"version":3,"file":"useDocumentPreviewValues-B1zNjl_D.js","names":["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/tasks/hooks/useDocumentPreviewValues.ts"],"sourcesContent":["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":";;;;;;AA6BA,SAAOmB,yBAAAC,SAAA;CAAA,IAAAC,IAAAC,EAAA,EAAA,GAAAC;CAAA,AAAAF,EAAA,OAAAD,UAMYG,KAAAF,EAAA,MAAbE,KAAAH,WAAA,CAAY,GAACC,EAAA,KAAAD,SAAAC,EAAA,KAAAE;CALjB,IAAA,EAAAZ,YAAAC,cAAAC,kBAAAW,6BAAAV,YAKIS,IACeE,KAAAnB,UAAU,GAACoB;CAAA,AAAAL,EAAA,OAAAT,gBAAAS,EAAA,OAAAI,MAAXC,KAAAD,GAAWE,IAAKf,YAAY,GAACS,EAAA,KAAAT,cAAAS,EAAA,KAAAI,IAAAJ,EAAA,KAAAK,MAAAA,KAAAL,EAAA;CAAhD,IAAAO,aAAmBF,IAEnBG,uBAA6BpB,wBAAwB,GAKrD,EAAAI,qBAA2BN,eAAe,GAACuB;CAAAC,KAAA;EAEzC,IAAI,CAACpB,cAAD,CAAgBiB,YAAU;GAAA,IAAAI;GAAEF,AAAFT,EAAA,OAAAY,OAAAC,IAAA,2BAAA,KAASF,KAAA3B,GAAG,IAAI,GAACgB,EAAA,KAAAW,MAAAA,KAAAX,EA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A,KARMwB;AAQN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-
|
|
1
|
+
import { i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-CwMJwOTd.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-
|
|
69
|
+
//# sourceMappingURL=useFeatureEnabled-4qCpV_mX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFeatureEnabled-
|
|
1
|
+
{"version":3,"file":"useFeatureEnabled-4qCpV_mX.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":";;;;;AA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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 { mn as isRecord } from "./datastores-
|
|
1
|
+
import { mn as isRecord } from "./datastores-DpJ5Y313.js";
|
|
2
2
|
import { useContext } from "react";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -125,4 +125,4 @@ function useFieldActions() {
|
|
|
125
125
|
}
|
|
126
126
|
export { getItemKey as a, isEmptyObject as c, normalizeKeySegment as d, normalizePathSegment as f, stringToPath as h, findIndex as i, normalizeIndexSegment as l, pathsAreEqual as m, FormValueProvider as n, getItemKeySegment as o, pathToString as p, useFormValue as r, getValueAtPath as s, useFieldActions as t, normalizeIndexTupleSegment as u };
|
|
127
127
|
|
|
128
|
-
//# sourceMappingURL=useFieldActions-
|
|
128
|
+
//# sourceMappingURL=useFieldActions-uDe2qh98.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldActions-BV_qfe65.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","Path","pathFor","ReactNode","useContext","useMemo","FormValueContext","getValueAtPath","FormDocumentValue","FormValueContextValue","value","FormValueProvider","props","$","_c","t0","t1","children","useFormValue","path","uniquePath","ctx","Error","useContext","FieldActionsContext","FieldActionsContextValue","useFieldActions"],"sources":["../src/core/field/paths/helpers.ts","../src/core/form/contexts/FormValue.tsx","../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 {type Path} from '@sanity/types'\nimport {pathFor} from '@sanity/util/paths'\nimport {type ReactNode, useContext, useMemo} from 'react'\nimport {FormValueContext} from 'sanity/_singletons'\n\nimport {getValueAtPath} from '../../field/paths/helpers'\nimport {type FormDocumentValue} from '../types/formDocumentValue'\n\n/**\n * @internal\n * @hidden\n */\nexport interface FormValueContextValue {\n value: FormDocumentValue | undefined\n}\n\n/**\n *\n * @internal\n * @hidden\n */\nexport function FormValueProvider(props: {\n value: FormDocumentValue | undefined\n children: ReactNode\n}) {\n const value = useMemo(() => ({value: props.value}), [props.value])\n return <FormValueContext.Provider value={value}>{props.children}</FormValueContext.Provider>\n}\n\n/**\n * React hook that returns the value of the field specified by a path.\n * @public\n *\n * @param path - An array notation with segments that are either strings representing field names, index integers for arrays with simple values, or objects with a _key for arrays containing objects\n *\n * @returns The value of the field specified by the path\n *\n * @example Using the `useFormValue` hook\n * ```ts\n * function MyComponent() {\n * // get value of field 'name' in object 'author'\n * const authorName = useFormValue(['author', 'name'])\n * // get value of the second item in array 'tags' of type 'string'\n * const secondTag = useFormValue(['tags', 1])\n * // get value of the reference with the matching key in an array of references\n * const specificBook = useFormValue([ 'bibliography', {_key: '<key>'} ])\n * // ... do something with the form values ...\n * }\n * ```\n */\n\nexport function useFormValue(path: Path): unknown {\n const uniquePath = pathFor(path)\n const ctx = useContext(FormValueContext)\n if (!ctx) {\n throw new Error('useFormValue must be used within a FormValueProvider')\n }\n\n return getValueAtPath(ctx?.value, uniquePath)\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,GAAGD,SADQE,MAAM,IAAI,KAAK,MACFD;EAGjC,MAAUH,MAAM,8BAA8BS,KAAKC,UAAUP,OAAO,EAAC,GAAI;CAC3E,GAAG,EAAE;AACP;;AAGA,SAAgBQ,eAAeC,WAAoBf,MAAqB;CACtE,IAAMM,UAAUN,KAAK;CACrB,IAAWM,YAAY,QACrB,OAAOS;CAGT,IAAMC,OAAOhB,KAAKiB,MAAM,CAAC;CACzB,IAAI5B,eAAeiB,OAAO,GACxB,OAAOQ,eAAeb,MAAMC,QAAQa,SAAS,IAAIA,UAAUT,WAAWY,KAAAA,GAAWF,IAAI;CAGvF,IAAIxB,aAAac,OAAO,GACtB,OAAOQ,eACLb,MAAMC,QAAQa,SAAS,IAAIA,UAAUI,MAAMC,SAASA,KAAKZ,SAASF,QA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G,MAAAA,KAAAH,EAAA,IAArFG;AAAqF;;;;;;;;;;;;;;;;;;;;;;AAyB9F,SAAOE,aAAAC,MAAA;CACL,IAAAC,aAAmBlB,QAAQiB,IAAI,GAC/BE,MAAYjB,WAAWE,gBAAgB;CACvC,IAAI,CAACe,KACH,MAAUC,MAAM,sDAAsD;CACvE,OAEMf,eAAec,KAAGX,OAASU,UAAU;AAAC;;ACtD/C,SAAOM,kBAAA;CAAA,OACEH,WAAWC,mBAAmB;AAAC"}
|
|
1
|
+
{"version":3,"file":"useFieldActions-uDe2qh98.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","Path","pathFor","ReactNode","useContext","useMemo","FormValueContext","getValueAtPath","FormDocumentValue","FormValueContextValue","value","FormValueProvider","props","$","_c","t0","t1","children","useFormValue","path","uniquePath","ctx","Error","useContext","FieldActionsContext","FieldActionsContextValue","useFieldActions"],"sources":["../src/core/field/paths/helpers.ts","../src/core/form/contexts/FormValue.tsx","../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 {type Path} from '@sanity/types'\nimport {pathFor} from '@sanity/util/paths'\nimport {type ReactNode, useContext, useMemo} from 'react'\nimport {FormValueContext} from 'sanity/_singletons'\n\nimport {getValueAtPath} from '../../field/paths/helpers'\nimport {type FormDocumentValue} from '../types/formDocumentValue'\n\n/**\n * @internal\n * @hidden\n */\nexport interface FormValueContextValue {\n value: FormDocumentValue | undefined\n}\n\n/**\n *\n * @internal\n * @hidden\n */\nexport function FormValueProvider(props: {\n value: FormDocumentValue | undefined\n children: ReactNode\n}) {\n const value = useMemo(() => ({value: props.value}), [props.value])\n return <FormValueContext.Provider value={value}>{props.children}</FormValueContext.Provider>\n}\n\n/**\n * React hook that returns the value of the field specified by a path.\n * @public\n *\n * @param path - An array notation with segments that are either strings representing field names, index integers for arrays with simple values, or objects with a _key for arrays containing objects\n *\n * @returns The value of the field specified by the path\n *\n * @example Using the `useFormValue` hook\n * ```ts\n * function MyComponent() {\n * // get value of field 'name' in object 'author'\n * const authorName = useFormValue(['author', 'name'])\n * // get value of the second item in array 'tags' of type 'string'\n * const secondTag = useFormValue(['tags', 1])\n * // get value of the reference with the matching key in an array of references\n * const specificBook = useFormValue([ 'bibliography', {_key: '<key>'} ])\n * // ... do something with the form values ...\n * }\n * ```\n */\n\nexport function useFormValue(path: Path): unknown {\n const uniquePath = pathFor(path)\n const ctx = useContext(FormValueContext)\n if (!ctx) {\n throw new Error('useFormValue must be used within a FormValueProvider')\n }\n\n return getValueAtPath(ctx?.value, uniquePath)\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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C7B;;AAGA,SAAgB6B,cAAc3B,MAAwB;CACpD,OAAO,OAAOA,QAAS,cAAYA,QAAiB4B,OAAOC,KAAK7B,IAAI,CAAC,CAACkB,UAAU;AAClF;;;;;;ACpJA,SAAOsB,kBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAAC;CAAA,AAAAF,EAAA,OAAAD,MAAAF,QAI4CK,KAAAF,EAAA,MAApBE,KAAA,EAAAL,OAAQE,MAAKF,MAAM,GAACG,EAAA,KAAAD,MAAAF,OAAAG,EAAA,KAAAE;CAAjD,IAAAL,QAA6BK,IAAqCC;CAC0B,OAD1BH,EAAA,OAAAD,MAAAK,YAAAJ,EAAA,OAAAH,SAC3DM,KAAA,oBAAA,iBAAA,UAAA;EAAkCN;EAAQE,UAAAA,MAAKK;CAAU,CAAA,GAA4BJ,EAAA,KAAAD,MAAAK,UAAAJ,EAAA,KAAAH,OAAAG,EAAA,KAAAG,MAAAA,KAAAH,EAAA,IAArFG;AAAqF;;;;;;;;;;;;;;;;;;;;;;AAyB9F,SAAOE,aAAAC,MAAA;CACL,IAAAC,aAAmBlB,QAAQiB,IAAI,GAC/BE,MAAYjB,WAAWE,gBAAgB;CACvC,IAAI,CAACe,KACH,MAAUC,MAAM,sDAAsD;CACvE,OAEMf,eAAec,KAAGX,OAASU,UAAU;AAAC;;ACtD/C,SAAOM,kBAAA;CAAA,OACEH,WAAWC,mBAAmB;AAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as useWorkspace } from "./studioClient-
|
|
2
|
-
import { n as SCHEDULES_TOOL_NAME } from "./plugin-
|
|
1
|
+
import { c as useWorkspace } from "./studioClient-CwMJwOTd.js";
|
|
2
|
+
import { n as SCHEDULES_TOOL_NAME } from "./plugin-DqqaZdOH.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-
|
|
23
|
+
//# sourceMappingURL=useReleasesToolAvailable-DDuNc6HV.js.map
|
package/lib/{useReleasesToolAvailable-Duu10qV0.js.map → useReleasesToolAvailable-DDuNc6HV.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReleasesToolAvailable-
|
|
1
|
+
{"version":3,"file":"useReleasesToolAvailable-DDuNc6HV.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"}
|
package/lib/{useScheduledDraftMenuActions-Byiy3-k3.js → useScheduledDraftMenuActions-DqkHlC0c.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as Dialog$1 } from "./ConfirmPopover-CD1rDyuk.js";
|
|
2
2
|
import { d as getVersionId, l as getPublishedId, s as getDraftId } from "./draftUtils-D3HJGQaW.js";
|
|
3
|
-
import { i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-
|
|
4
|
-
import { gn as useSchema, lt as getReleaseIdFromReleaseDocumentId, on as RELEASES_STUDIO_CLIENT_OPTIONS, r as useDocumentPreviewStore } from "./datastores-
|
|
3
|
+
import { i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-CwMJwOTd.js";
|
|
4
|
+
import { gn as useSchema, lt as getReleaseIdFromReleaseDocumentId, on as RELEASES_STUDIO_CLIENT_OPTIONS, r as useDocumentPreviewStore } from "./datastores-DpJ5Y313.js";
|
|
5
5
|
import { t as useTranslation } from "./useTranslation-Cqs6Itwv.js";
|
|
6
|
-
import { Ct as DateTimeInput, Jn as unstable_useValuePreview, St as getCalendarLabels, To as useReleasesStore, Tt as MONTH_PICKER_VARIANT, Vo as createReleaseId, Xn as isGoingToUnpublish, Xo as isPausedCardinalityOneRelease, d as Preview, ha as getReleaseDocumentIdFromReleaseId, hn as getDocumentVersionInfoFromVersions, i as useReleaseOperations, r as useAllReleases, t as getBundleDocumentsObservable, vi as useDocumentVersions, zo as isReleaseScheduledOrScheduling } from "./useBundleDocuments-
|
|
6
|
+
import { Ct as DateTimeInput, Jn as unstable_useValuePreview, St as getCalendarLabels, To as useReleasesStore, Tt as MONTH_PICKER_VARIANT, Vo as createReleaseId, Xn as isGoingToUnpublish, Xo as isPausedCardinalityOneRelease, d as Preview, ha as getReleaseDocumentIdFromReleaseId, hn as getDocumentVersionInfoFromVersions, i as useReleaseOperations, r as useAllReleases, t as getBundleDocumentsObservable, vi as useDocumentVersions, zo as isReleaseScheduledOrScheduling } from "./useBundleDocuments-DvVAF6cf.js";
|
|
7
7
|
import { n as LoadingBlock } from "./useDidUpdate-Br1Dx-yJ.js";
|
|
8
8
|
import { t as Translate } from "./Translate-0HIWr1eF.js";
|
|
9
|
-
import { t as useTimeZone } from "./useTimeZone-
|
|
9
|
+
import { t as useTimeZone } from "./useTimeZone-8Wd1UR4j.js";
|
|
10
10
|
import { useCallback, useState } from "react";
|
|
11
11
|
import { EMPTY, of } from "rxjs";
|
|
12
12
|
import { c } from "react/compiler-runtime";
|
|
@@ -870,4 +870,4 @@ function useScheduledDraftMenuActions(options) {
|
|
|
870
870
|
}
|
|
871
871
|
export { Z_OFFSET as a, useReleaseDocuments as c, singleDocReleaseUsEnglishLocaleBundle as d, SCHEDULED_PUBLISHING_TIME_ZONE_SCOPE as i, getErrorMessage as l, ScheduleDraftDialog as n, useScheduleDraftOperations as o, CONTENT_RELEASES_TIME_ZONE_SCOPE as r, useScheduledDraftDocument as s, useScheduledDraftMenuActions as t, singleDocReleaseNamespace as u };
|
|
872
872
|
|
|
873
|
-
//# sourceMappingURL=useScheduledDraftMenuActions-
|
|
873
|
+
//# sourceMappingURL=useScheduledDraftMenuActions-DqkHlC0c.js.map
|