sanity 6.14.0 → 6.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{AddonDatasetProvider-0aiLWkZg.js → AddonDatasetProvider-C9tdum2G.js} +2 -2
- package/lib/{AddonDatasetProvider-0aiLWkZg.js.map → AddonDatasetProvider-C9tdum2G.js.map} +1 -1
- package/lib/{CalendarFilter-DVz369RP.js → CalendarFilter-C80uOkw-.js} +3 -3
- package/lib/{CalendarFilter-DVz369RP.js.map → CalendarFilter-C80uOkw-.js.map} +1 -1
- package/lib/{CommandList-CTDV_QZY.js → CommandList-duj-LVnd.js} +2 -2
- package/lib/{CommandList-CTDV_QZY.js.map → CommandList-duj-LVnd.js.map} +1 -1
- package/lib/{CommentInput-B5T1Iwnt.js → CommentInput-BXYQnGhq.js} +5 -5
- package/lib/{CommentInput-B5T1Iwnt.js.map → CommentInput-BXYQnGhq.js.map} +1 -1
- package/lib/{CommentsDocumentLayout-ByFwej_y.js → CommentsDocumentLayout-DAwAhx7q.js} +2 -2
- package/lib/{CommentsDocumentLayout-ByFwej_y.js.map → CommentsDocumentLayout-DAwAhx7q.js.map} +1 -1
- package/lib/{CommentsDocumentLayout-Czb6fC0_.js → CommentsDocumentLayout-pfM29WSy.js} +2 -2
- package/lib/{CommentsDocumentLayout-Czb6fC0_.js.map → CommentsDocumentLayout-pfM29WSy.js.map} +1 -1
- package/lib/{CommentsEnabledProvider-D2gutvsb.js → CommentsEnabledProvider-DN_oXwXM.js} +3 -3
- package/lib/{CommentsEnabledProvider-D2gutvsb.js.map → CommentsEnabledProvider-DN_oXwXM.js.map} +1 -1
- package/lib/{CommentsField-D2Fum0Jx.js → CommentsField-B7wTBRMB.js} +5 -5
- package/lib/{CommentsField-D2Fum0Jx.js.map → CommentsField-B7wTBRMB.js.map} +1 -1
- package/lib/{CommentsField-YM3cp3fA.js → CommentsField-BxoVuJOl.js} +4 -4
- package/lib/{CommentsField-YM3cp3fA.js.map → CommentsField-BxoVuJOl.js.map} +1 -1
- package/lib/{CommentsInput-Bx2t5AW_.js → CommentsInput-C3rEb5L8.js} +6 -6
- package/lib/{CommentsInput-Bx2t5AW_.js.map → CommentsInput-C3rEb5L8.js.map} +1 -1
- package/lib/{CommentsInput-BBBng3CJ.js → CommentsInput-CU-PFXmu.js} +7 -7
- package/lib/{CommentsInput-BBBng3CJ.js.map → CommentsInput-CU-PFXmu.js.map} +1 -1
- package/lib/{CommentsInspector-BnSG5Mq0.js → CommentsInspector-BJ1qwj6P.js} +6 -6
- package/lib/{CommentsInspector-BnSG5Mq0.js.map → CommentsInspector-BJ1qwj6P.js.map} +1 -1
- package/lib/{CommentsInspector-B5V_Bpz5.js → CommentsInspector-BQiMPjvm.js} +6 -6
- package/lib/{CommentsInspector-B5V_Bpz5.js.map → CommentsInspector-BQiMPjvm.js.map} +1 -1
- package/lib/{CommentsListItem-DnqAlN4p.js → CommentsListItem-QyYan1DB.js} +5 -5
- package/lib/{CommentsListItem-DnqAlN4p.js.map → CommentsListItem-QyYan1DB.js.map} +1 -1
- package/lib/{CommentsListItem-DVE4IMls.js → CommentsListItem-dvKmANi3.js} +4 -4
- package/lib/{CommentsListItem-DVE4IMls.js.map → CommentsListItem-dvKmANi3.js.map} +1 -1
- package/lib/{CommentsSelectedPathProvider-DRJ3Xqs4.js → CommentsSelectedPathProvider-COcPb3W3.js} +3 -3
- package/lib/{CommentsSelectedPathProvider-DRJ3Xqs4.js.map → CommentsSelectedPathProvider-COcPb3W3.js.map} +1 -1
- package/lib/{CommentsStudioLayout-Di510XhD.js → CommentsStudioLayout-BkX6o14w.js} +3 -3
- package/lib/{CommentsStudioLayout-Di510XhD.js.map → CommentsStudioLayout-BkX6o14w.js.map} +1 -1
- package/lib/{CommentsStudioLayout-Z09s50bM.js → CommentsStudioLayout-dIXEz52s.js} +3 -3
- package/lib/{CommentsStudioLayout-Z09s50bM.js.map → CommentsStudioLayout-dIXEz52s.js.map} +1 -1
- package/lib/{GlobalPerspectiveMenu-Cwur4_iD.js → GlobalPerspectiveMenu-0Hs276Z-.js} +15 -15
- package/lib/{GlobalPerspectiveMenu-Cwur4_iD.js.map → GlobalPerspectiveMenu-0Hs276Z-.js.map} +1 -1
- package/lib/{LoadingBlock-Ch_dBXfn.js → LoadingBlock-CElIdb7F.js} +3 -3
- package/lib/{LoadingBlock-Ch_dBXfn.js.map → LoadingBlock-CElIdb7F.js.map} +1 -1
- package/lib/{PerspectiveProvider-Yk7lgugx.js → PerspectiveProvider-D-6sweQH.js} +130 -97
- package/lib/PerspectiveProvider-D-6sweQH.js.map +1 -0
- package/lib/{ReleaseAvatar-C68bGuVQ.js → ReleaseAvatar-Bqp_Ci7r.js} +4 -4
- package/lib/{ReleaseAvatar-C68bGuVQ.js.map → ReleaseAvatar-Bqp_Ci7r.js.map} +1 -1
- package/lib/{ReleasesMetadataProvider-DabLuMD8.js → ReleasesMetadataProvider-BD6XRcpT.js} +2 -2
- package/lib/{ReleasesMetadataProvider-DabLuMD8.js.map → ReleasesMetadataProvider-BD6XRcpT.js.map} +1 -1
- package/lib/{ReleasesStudioLayout-DsygG30q.js → ReleasesStudioLayout-C6mmxoaY.js} +7 -7
- package/lib/{ReleasesStudioLayout-DsygG30q.js.map → ReleasesStudioLayout-C6mmxoaY.js.map} +1 -1
- package/lib/{ReleasesTool-CNXNODI_.js → ReleasesTool-DIDmkzic.js} +23 -23
- package/lib/{ReleasesTool-CNXNODI_.js.map → ReleasesTool-DIDmkzic.js.map} +1 -1
- package/lib/{SchedulePublishingStudioLayout-EsgEGZ7F.js → SchedulePublishingStudioLayout-DrZO-qbI.js} +3 -3
- package/lib/{SchedulePublishingStudioLayout-EsgEGZ7F.js.map → SchedulePublishingStudioLayout-DrZO-qbI.js.map} +1 -1
- package/lib/{SchedulePublishingUpsellProvider-CWxgqzFp.js → SchedulePublishingUpsellProvider-DeZ_jZIX.js} +2 -2
- package/lib/{SchedulePublishingUpsellProvider-CWxgqzFp.js.map → SchedulePublishingUpsellProvider-DeZ_jZIX.js.map} +1 -1
- package/lib/{ScheduledPublishingEnabledProvider-CQ-T1Y96.js → ScheduledPublishingEnabledProvider-B8C0_tc5.js} +3 -3
- package/lib/{ScheduledPublishingEnabledProvider-CQ-T1Y96.js.map → ScheduledPublishingEnabledProvider-B8C0_tc5.js.map} +1 -1
- package/lib/{SearchProvider-CEXmRg1N.js → SearchProvider-T8fsDJV5.js} +8 -8
- package/lib/{SearchProvider-CEXmRg1N.js.map → SearchProvider-T8fsDJV5.js.map} +1 -1
- package/lib/{SingleDocReleaseLayout-ByDXFS8N.js → SingleDocReleaseLayout-BpMXU9KY.js} +2 -2
- package/lib/{SingleDocReleaseLayout-ByDXFS8N.js.map → SingleDocReleaseLayout-BpMXU9KY.js.map} +1 -1
- package/lib/{SingleDocReleaseUpsellProvider-ByuDpBIG.js → SingleDocReleaseUpsellProvider-7_OXHySY.js} +3 -3
- package/lib/{SingleDocReleaseUpsellProvider-ByuDpBIG.js.map → SingleDocReleaseUpsellProvider-7_OXHySY.js.map} +1 -1
- package/lib/{TasksFooterOpenTasks-BSO8TgVF.js → TasksFooterOpenTasks-IFtOEGnB.js} +2 -2
- package/lib/{TasksFooterOpenTasks-BSO8TgVF.js.map → TasksFooterOpenTasks-IFtOEGnB.js.map} +1 -1
- package/lib/{TasksStudioActiveToolLayout-BXktrH08.js → TasksStudioActiveToolLayout-C99LQz4S.js} +20 -20
- package/lib/{TasksStudioActiveToolLayout-BXktrH08.js.map → TasksStudioActiveToolLayout-C99LQz4S.js.map} +1 -1
- package/lib/{TasksStudioLayout-BfN-M93c.js → TasksStudioLayout-CmFbUpnB.js} +4 -4
- package/lib/{TasksStudioLayout-BfN-M93c.js.map → TasksStudioLayout-CmFbUpnB.js.map} +1 -1
- package/lib/{TasksStudioNavbar-CfqloSfP.js → TasksStudioNavbar-DB7DJC4e.js} +2 -2
- package/lib/{TasksStudioNavbar-CfqloSfP.js.map → TasksStudioNavbar-DB7DJC4e.js.map} +1 -1
- package/lib/{TimeZoneButton-FCwCyJ1J.js → TimeZoneButton-B_ki5v8q.js} +7 -7
- package/lib/{TimeZoneButton-FCwCyJ1J.js.map → TimeZoneButton-B_ki5v8q.js.map} +1 -1
- package/lib/{Tool-PzN5dskE.js → Tool-DlkZrcrD.js} +15 -15
- package/lib/{Tool-PzN5dskE.js.map → Tool-DlkZrcrD.js.map} +1 -1
- package/lib/{UpsellPanel-T-5ZD_7k.js → UpsellPanel-ITWwjktp.js} +2 -2
- package/lib/{UpsellPanel-T-5ZD_7k.js.map → UpsellPanel-ITWwjktp.js.map} +1 -1
- package/lib/{VariantsStudioNavbar-D0XbvL1D.js → VariantsStudioNavbar-DwEV1roH.js} +9 -9
- package/lib/{VariantsStudioNavbar-D0XbvL1D.js.map → VariantsStudioNavbar-DwEV1roH.js.map} +1 -1
- package/lib/{VariantsTool-B3EEDrQT.js → VariantsTool-Dzhy3PST.js} +12 -12
- package/lib/{VariantsTool-B3EEDrQT.js.map → VariantsTool-Dzhy3PST.js.map} +1 -1
- package/lib/{WorkspaceLoader-BH_VDaY4.js → WorkspaceLoader-Ck4TMoR5.js} +31 -31
- package/lib/{WorkspaceLoader-BH_VDaY4.js.map → WorkspaceLoader-Ck4TMoR5.js.map} +1 -1
- package/lib/_createContext.js +1 -1
- package/lib/_unstable-embedded.js +5 -5
- package/lib/{buildRangeDecorationSelectionsFromComments-B1-tJPvG.js → buildRangeDecorationSelectionsFromComments-BnlhrvDK.js} +3 -3
- package/lib/{buildRangeDecorationSelectionsFromComments-B1-tJPvG.js.map → buildRangeDecorationSelectionsFromComments-BnlhrvDK.js.map} +1 -1
- package/lib/{buildTextSelectionFromFragment-BiLg851R.js → buildTextSelectionFromFragment-BXrYd9lr.js} +3 -3
- package/lib/{buildTextSelectionFromFragment-BiLg851R.js.map → buildTextSelectionFromFragment-BXrYd9lr.js.map} +1 -1
- package/lib/{constants-DdgHySkY.js → constants-BQItnHll.js} +2 -2
- package/lib/{constants-DdgHySkY.js.map → constants-BQItnHll.js.map} +1 -1
- package/lib/{datastores-D1tF4HQA.js → datastores-DNOJm1LF.js} +2 -2
- package/lib/{datastores-D1tF4HQA.js.map → datastores-DNOJm1LF.js.map} +1 -1
- package/lib/{i18n-Cl_y4bbR.js → i18n-JUYUb7y_.js} +2 -2
- package/lib/{i18n-Cl_y4bbR.js.map → i18n-JUYUb7y_.js.map} +1 -1
- package/lib/index.js +38 -38
- package/lib/{inputResolver-CUWPjdGU.js → inputResolver-Ce1lTBE-.js} +4 -4
- package/lib/{inputResolver-CUWPjdGU.js.map → inputResolver-Ce1lTBE-.js.map} +1 -1
- package/lib/{navigation.telemetry-rXclq03x.js → navigation.telemetry-BPxX2IEN.js} +10 -10
- package/lib/{navigation.telemetry-rXclq03x.js.map → navigation.telemetry-BPxX2IEN.js.map} +1 -1
- package/lib/{plugin-CSp8hwQE.js → plugin-Bvxhb5ko.js} +8 -8
- package/lib/{plugin-CSp8hwQE.js.map → plugin-Bvxhb5ko.js.map} +1 -1
- package/lib/{plugin-Daxe5hwG.js → plugin-Cv6TLYbE.js} +6 -6
- package/lib/{plugin-Daxe5hwG.js.map → plugin-Cv6TLYbE.js.map} +1 -1
- package/lib/{plugin-BFTpdKKH.js → plugin-D6-7jrXf.js} +3 -3
- package/lib/{plugin-BFTpdKKH.js.map → plugin-D6-7jrXf.js.map} +1 -1
- package/lib/{plugin-dtgDcBsL.js → plugin-D_GVPwTR.js} +6 -6
- package/lib/{plugin-dtgDcBsL.js.map → plugin-D_GVPwTR.js.map} +1 -1
- package/lib/{releases.telemetry-B6tRA9U2.js → releases.telemetry-BAO7xaO7.js} +6 -6
- package/lib/{releases.telemetry-B6tRA9U2.js.map → releases.telemetry-BAO7xaO7.js.map} +1 -1
- package/lib/{resources-BjljYbUa.js → resources-Bw1bpPhG.js} +2 -2
- package/lib/{resources-BjljYbUa.js.map → resources-Bw1bpPhG.js.map} +1 -1
- package/lib/{resources-DYxnNjS8.js → resources-CC1qBsSO.js} +2 -2
- package/lib/{resources-DYxnNjS8.js.map → resources-CC1qBsSO.js.map} +1 -1
- package/lib/{resources-D7Mp6N-8.js → resources-CH42UqhC.js} +2 -2
- package/lib/{resources-D7Mp6N-8.js.map → resources-CH42UqhC.js.map} +1 -1
- package/lib/{resources-GpX0LblP.js → resources-Cq1lXH8T.js} +2 -2
- package/lib/{resources-GpX0LblP.js.map → resources-Cq1lXH8T.js.map} +1 -1
- package/lib/{resources-B7mfG9Km.js → resources-D7XsFe7y.js} +2 -2
- package/lib/{resources-B7mfG9Km.js.map → resources-D7XsFe7y.js.map} +1 -1
- package/lib/{resources-CmmAynkL.js → resources-DYn0yzEW.js} +2 -2
- package/lib/{resources-CmmAynkL.js.map → resources-DYn0yzEW.js.map} +1 -1
- package/lib/{resources-C79qQva3.js → resources-TsgtFPi7.js} +2 -2
- package/lib/{resources-C79qQva3.js.map → resources-TsgtFPi7.js.map} +1 -1
- package/lib/{scheduleItem-Bdvl81Kb.js → scheduleItem-5fXCZgfo.js} +13 -13
- package/lib/{scheduleItem-Bdvl81Kb.js.map → scheduleItem-5fXCZgfo.js.map} +1 -1
- package/lib/{schedules-D7bPbTPm.js → schedules-BsE0_g47.js} +3 -3
- package/lib/{schedules-D7bPbTPm.js.map → schedules-BsE0_g47.js.map} +1 -1
- package/lib/{searchDocumentRelease-v1o9dMnE.js → searchDocumentRelease-Bang3A8l.js} +5 -5
- package/lib/{searchDocumentRelease-v1o9dMnE.js.map → searchDocumentRelease-Bang3A8l.js.map} +1 -1
- package/lib/{studioClient-EJDu6kOb.js → studioClient-C7B6Aobi.js} +2 -2
- package/lib/{studioClient-EJDu6kOb.js.map → studioClient-C7B6Aobi.js.map} +1 -1
- package/lib/{useActiveReleases-Bh_Q6f7G.js → useActiveReleases-DxYjyTB1.js} +5 -5
- package/lib/{useActiveReleases-Bh_Q6f7G.js.map → useActiveReleases-DxYjyTB1.js.map} +1 -1
- package/lib/{useBundleDocuments-zP6JiTzz.js → useBundleDocuments-2YaaN-2l.js} +3 -3
- package/lib/{useBundleDocuments-zP6JiTzz.js.map → useBundleDocuments-2YaaN-2l.js.map} +1 -1
- package/lib/{useComments-BGOJwUe0.js → useComments-DWh1k0kS.js} +5 -5
- package/lib/{useComments-BGOJwUe0.js.map → useComments-DWh1k0kS.js.map} +1 -1
- package/lib/{useCommentsTelemetry-BMkf6MTO.js → useCommentsTelemetry-BbJ8lTKN.js} +4 -4
- package/lib/{useCommentsTelemetry-BMkf6MTO.js.map → useCommentsTelemetry-BbJ8lTKN.js.map} +1 -1
- package/lib/{useDocumentPreviewValues-CryTvfKc.js → useDocumentPreviewValues-CK5VteK3.js} +4 -4
- package/lib/{useDocumentPreviewValues-CryTvfKc.js.map → useDocumentPreviewValues-CK5VteK3.js.map} +1 -1
- package/lib/{useFieldActions-BTj7VsW5.js → useFieldActions-BmY1Kh3s.js} +2 -2
- package/lib/{useFieldActions-BTj7VsW5.js.map → useFieldActions-BmY1Kh3s.js.map} +1 -1
- package/lib/{useProjectId-BN6GCdwS.js → useProjectId-C8pZxybz.js} +2 -2
- package/lib/{useProjectId-BN6GCdwS.js.map → useProjectId-C8pZxybz.js.map} +1 -1
- package/lib/{useReleasesToolAvailable-CQ9-I8Tt.js → useReleasesToolAvailable-DjaSujLo.js} +3 -3
- package/lib/{useReleasesToolAvailable-CQ9-I8Tt.js.map → useReleasesToolAvailable-DjaSujLo.js.map} +1 -1
- package/lib/{useScheduledDraftMenuActions-OSkdxONo.js → useScheduledDraftMenuActions-DSJU6xQa.js} +9 -9
- package/lib/{useScheduledDraftMenuActions-OSkdxONo.js.map → useScheduledDraftMenuActions-DSJU6xQa.js.map} +1 -1
- package/lib/{useStudioUrl-DUBI_S4K.js → useStudioUrl-DcTGV00c.js} +5 -5
- package/lib/{useStudioUrl-DUBI_S4K.js.map → useStudioUrl-DcTGV00c.js.map} +1 -1
- package/lib/{useTasksNavigation-fohCXW6l.js → useTasksNavigation-tAXFJd2V.js} +2 -2
- package/lib/{useTasksNavigation-fohCXW6l.js.map → useTasksNavigation-tAXFJd2V.js.map} +1 -1
- package/lib/{useTimeZone-DM8ZmUO2.js → useTimeZone-Dj7C8tfZ.js} +2 -2
- package/lib/{useTimeZone-DM8ZmUO2.js.map → useTimeZone-Dj7C8tfZ.js.map} +1 -1
- package/lib/{utils-D-4rueJZ.js → utils-CT034e4q.js} +3 -3
- package/lib/{utils-D-4rueJZ.js.map → utils-CT034e4q.js.map} +1 -1
- package/lib/{validationUtils-jTd1rxfY.js → validationUtils-BZPoHEYN.js} +4 -4
- package/lib/{validationUtils-jTd1rxfY.js.map → validationUtils-BZPoHEYN.js.map} +1 -1
- package/lib/{version-D0Vx4cX1.js → version-BDSMcNU7.js} +2 -2
- package/lib/{version-D0Vx4cX1.js.map → version-BDSMcNU7.js.map} +1 -1
- package/package.json +17 -17
- package/lib/PerspectiveProvider-Yk7lgugx.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { an as postTask } from "./datastores-
|
|
2
|
-
import { c as useWorkspace, i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-
|
|
3
|
-
import { jt as useActiveWorkspace } from "./useActiveReleases-
|
|
1
|
+
import { an as postTask } from "./datastores-DNOJm1LF.js";
|
|
2
|
+
import { c as useWorkspace, i as useClient, n as DEFAULT_STUDIO_CLIENT_OPTIONS, o as useSource } from "./studioClient-C7B6Aobi.js";
|
|
3
|
+
import { jt as useActiveWorkspace } from "./useActiveReleases-DxYjyTB1.js";
|
|
4
4
|
import { C as isNonNullable } from "./draftUtils-D3HJGQaW.js";
|
|
5
|
-
import { D as useRenderingContext, O as useProjectOrganizationId, c as useStudioAppIdStore } from "./SearchProvider-
|
|
5
|
+
import { D as useRenderingContext, O as useProjectOrganizationId, c as useStudioAppIdStore } from "./SearchProvider-T8fsDJV5.js";
|
|
6
6
|
import { memo, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
7
7
|
import { of } from "rxjs";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
@@ -400,4 +400,4 @@ const getDashboardPath = ({ organizationId, dashboardDomain, appId, workspaceNam
|
|
|
400
400
|
};
|
|
401
401
|
export { getDiscardDocumentActionId as a, useConfiguredDocumentActionIds as c, useThrottledCallback as d, useProjectSubscriptions as i, Resizable as l, useEnvAwareSanityWebsiteUrl as n, getDocumentVersionType as o, getIsScheduledDateInPast as r, getVersionContextMenuActionsContext as s, useStudioUrl as t, GetHookCollectionState as u };
|
|
402
402
|
|
|
403
|
-
//# sourceMappingURL=useStudioUrl-
|
|
403
|
+
//# sourceMappingURL=useStudioUrl-DcTGV00c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStudioUrl-DUBI_S4K.js","names":["{\n args,\n handleNext,\n }: {\n args: Args\n handleNext: (id: string, hookState: State | null) => void\n }","() => {\n if (hookState) {\n handleNext(id, {...hookState, action: useHook.action})\n } else {\n handleNext(id, hookState)\n }\n }","[handleNext, hookState]","{\n hooks,\n args,\n handleNext,\n}: HookCollectionStateProps<Args, State>","hooks.map((hook) => {\n const id = getHookId(hook)\n return <RenderHook key={id} args={args} id={id} hook={hook} handleNext={handleNext} />\n })","(hook) => {\n const id = getHookId(hook)\n return <RenderHook key={id} args={args} id={id} hook={hook} handleNext={handleNext} />\n }","useMemo(\n () =>\n hooks.map((hook) => {\n const id = getHookId(hook)\n return <RenderHook key={id} args={args} id={id} hook={hook} handleNext={handleNext} />\n }),\n [args, hooks, handleNext],\n )","{\n args,\n hook,\n id,\n handleNext,\n}: {\n args: Args\n hook: HookCollectionActionHook<Args, State>\n id: string\n handleNext: (id: string, hookState: State | null) => void\n}","defineHookStateComponent<Args, State>({\n hook,\n id,\n })","useMemo(\n () =>\n defineHookStateComponent<Args, State>({\n hook,\n id,\n }),\n [hook, id],\n )","<HookState args={args} handleNext={handleNext} />","throttle(callback, wait, options)","useMemo(\n () => throttle(callback, wait, options),\n [callback, options, wait],\n )","{\n hooks,\n}: Pick<GetHookCollectionStateProps<Args, State>, 'hooks'>","() => new Map<string, State>()","() =>\n mapHooksToStates(states, {hooks})","() => {\n abortControllerRef.current?.abort()\n abortControllerRef.current = new AbortController()\n\n postTask(\n () => {\n setSnapshot(mapHooksToStates(states, {hooks}))\n },\n {signal: abortControllerRef.current.signal},\n )?.catch((error) => {\n if (error.name === 'AbortError') {\n return\n }\n\n throw error\n })\n }","(error) => {\n if (error.name === 'AbortError') {\n return\n }\n\n throw error\n }","useCallback(() => {\n abortControllerRef.current?.abort()\n abortControllerRef.current = new AbortController()\n\n postTask(\n () => {\n setSnapshot(mapHooksToStates(states, {hooks}))\n },\n {signal: abortControllerRef.current.signal},\n )?.catch((error) => {\n if (error.name === 'AbortError') {\n return\n }\n\n throw error\n })\n }, [hooks, states])","(id: string, hookState: State | null) => {\n let shouldUpdateSnapshot = true\n\n if (hookState === null) {\n states.delete(id)\n } else {\n if (states.has(id)) {\n const prev = states.get(id)\n shouldUpdateSnapshot = !deepCompare(prev, hookState)\n }\n states.set(id, hookState)\n }\n\n if (shouldUpdateSnapshot) {\n requestUpdateSnapshot()\n }\n }","useCallback(\n (id: string, hookState: State | null) => {\n let shouldUpdateSnapshot = true\n\n if (hookState === null) {\n states.delete(id)\n } else {\n if (states.has(id)) {\n const prev = states.get(id)\n shouldUpdateSnapshot = !deepCompare(prev, hookState)\n }\n states.set(id, hookState)\n }\n\n if (shouldUpdateSnapshot) {\n requestUpdateSnapshot()\n }\n },\n [requestUpdateSnapshot, states],\n )","{states: snapshot, handleNext}","{hooks}","children({states})","useMemo(() => children({states}), [children, states])","() => () => setForceReset((n) => n + 1)","[]","(n) => n + 1","<HookCollectionState<Args, State>\n key={`render-${forceReset}`}\n hooks={hooks}\n args={args}\n handleNext={handleNext}\n />","`render-${forceReset}`","<>\n <HookCollectionState<Args, State>\n key={`render-${forceReset}`}\n hooks={hooks}\n args={args}\n handleNext={handleNext}\n />\n {result}\n </>","(event: MouseEvent) => {\n event.preventDefault()\n\n mouseXRef.current = event.pageX\n\n onResizeStart()\n\n const handleMouseMove = (e: globalThis.MouseEvent) => {\n e.preventDefault()\n onResize(mouseXRef.current - e.pageX)\n }\n\n const controller = new AbortController()\n const handleMouseUp = () => controller.abort()\n\n const {signal} = controller\n window.addEventListener('mousemove', handleMouseMove, {signal})\n window.addEventListener('mouseup', handleMouseUp, {signal})\n }","useCallback(\n (event: MouseEvent) => {\n event.preventDefault()\n\n mouseXRef.current = event.pageX\n\n onResizeStart()\n\n const handleMouseMove = (e: globalThis.MouseEvent) => {\n e.preventDefault()\n onResize(mouseXRef.current - e.pageX)\n }\n\n const controller = new AbortController()\n const handleMouseUp = () => controller.abort()\n\n const {signal} = controller\n window.addEventListener('mousemove', handleMouseMove, {signal})\n window.addEventListener('mouseup', handleMouseUp, {signal})\n },\n [onResize, onResizeStart],\n )","<span />","<Root onMouseDown={handleMouseDown} position={position}>\n {/* Hover effect */}\n <span />\n\n {/* Border */}\n <span />\n </Root>","resizerPosition = 'right'","() => {\n elementWidthRef.current = element?.offsetWidth\n }","offsetWidth","useCallback(() => {\n elementWidthRef.current = element?.offsetWidth\n }, [element])","(deltaX: number) => {\n const w = elementWidthRef.current\n if (!w) return\n if (resizerPosition === 'right') {\n setTargetWidth(Math.min(Math.max(w - deltaX, minWidth), maxWidth))\n } else {\n setTargetWidth(Math.min(Math.max(w + deltaX, minWidth), maxWidth))\n }\n }","useCallback(\n (deltaX: number) => {\n const w = elementWidthRef.current\n if (!w) return\n if (resizerPosition === 'right') {\n setTargetWidth(Math.min(Math.max(w - deltaX, minWidth), maxWidth))\n } else {\n setTargetWidth(Math.min(Math.max(w + deltaX, minWidth), maxWidth))\n }\n },\n [minWidth, maxWidth, resizerPosition],\n )","targetWidth ? {flex: 'none', width: targetWidth} : {minWidth, maxWidth}","useMemo(\n () => (targetWidth ? {flex: 'none', width: targetWidth} : {minWidth, maxWidth}),\n [minWidth, maxWidth, targetWidth],\n )","resizerPosition === 'left' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"left\" />\n )","resizerPosition === 'right' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"right\" />\n )","<Root as={forwardedAs} {...restProps} ref={setElement} style={style}>\n {resizerPosition === 'left' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"left\" />\n )}\n {children}\n {resizerPosition === 'right' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"right\" />\n )}\n </Root>","useMemo(() => {\n // Resolving without an identity would hand a `ctx.schemaType` predicate an undefined value.\n if (schemaType === undefined || versionType === undefined) return NO_ACTION_IDS\n\n const configured = resolveDocumentActions({\n schemaType,\n documentId,\n versionType,\n releaseId,\n })\n return new Set(configured.flatMap(({action}) => (action ? [action] : [])))\n }, [schemaType, documentId, versionType, releaseId, resolveDocumentActions])","new Set(configured.flatMap(({action}) => (action ? [action] : [])))","({action}) => (action ? [action] : [])","{action}","useMemo(() => {\n const projectSubscriptions$ = cachedProjectSubscriptionsRequest.get(projectId)\n\n if (!projectSubscriptions$)\n return of<ProjectSubscriptions>({\n isLoading: false,\n error: null,\n projectSubscriptions: null,\n })\n\n return projectSubscriptions$.pipe(\n map((cachedSubscriptions) => ({\n isLoading: false,\n projectSubscriptions: cachedSubscriptions,\n error: null,\n })),\n startWith(INITIAL_LOADING_STATE),\n catchError((error: Error) =>\n of<ProjectSubscriptions>({\n isLoading: false,\n projectSubscriptions: null,\n error,\n }),\n ),\n )\n }, [projectId])","of<ProjectSubscriptions>({\n isLoading: false,\n error: null,\n projectSubscriptions: null,\n })","(cachedSubscriptions) => ({\n isLoading: false,\n projectSubscriptions: cachedSubscriptions,\n error: null,\n })","(error: Error) =>\n of<ProjectSubscriptions>({\n isLoading: false,\n projectSubscriptions: null,\n error,\n })","{\n enabled: true,\n }","useMemo(() => {\n if (!isCoreUi || isLoading || !appId || !organizationId) {\n return defaultUrl || window.location.origin\n }\n\n return getDashboardPath({\n dashboardDomain: sanityWebsiteUrl,\n organizationId,\n appId: appId,\n workspaceName: activeWorkspace.name,\n })\n }, [\n activeWorkspace.name,\n defaultUrl,\n isCoreUi,\n isLoading,\n organizationId,\n appId,\n sanityWebsiteUrl,\n ])","getDashboardPath({\n dashboardDomain: sanityWebsiteUrl,\n organizationId,\n appId: appId,\n workspaceName: activeWorkspace.name,\n })","name","({coreUi, studio}: StudioUrlModifier) => {\n const urlModifier = isCoreUi ? coreUi : studio\n\n return urlModifier?.(studioUrl) || studioUrl\n }","{coreUi, studio}: StudioUrlModifier","useCallback(\n ({coreUi, studio}: StudioUrlModifier) => {\n const urlModifier = isCoreUi ? coreUi : studio\n\n return urlModifier?.(studioUrl) || studioUrl\n },\n [isCoreUi, studioUrl],\n )","(intentLink: string) => {\n if (isCoreUi && basePath !== '/') {\n return `${studioUrl}${intentLink.slice(basePath.length)}`\n }\n return `${studioUrl}${intentLink}`\n }","useCallback(\n (intentLink: string) => {\n if (isCoreUi && basePath !== '/') {\n return `${studioUrl}${intentLink.slice(basePath.length)}`\n }\n return `${studioUrl}${intentLink}`\n },\n [basePath, isCoreUi, studioUrl],\n )","{\n buildIntentUrl,\n buildStudioUrl,\n studioUrl,\n }"],"sources":["../src/core/components/hookCollection/actionId.ts","../src/core/components/hookCollection/defineHookStateComponent.tsx","../src/core/components/hookCollection/HookCollectionState.tsx","../src/core/util/useThrottledCallback.ts","../src/core/components/hookCollection/useHookCollectionStates.tsx","../src/core/components/hookCollection/GetHookCollectionState.tsx","../src/core/components/resizer/Resizer.tsx","../src/core/components/resizer/Resizable.tsx","../src/core/config/document/useConfiguredDocumentActionIds.ts","../src/core/hooks/useProjectSubscriptions.ts","../src/core/releases/util/getIsScheduledDateInPast.ts","../src/core/studio/hooks/useEnvAwareSanityWebsiteUrl.ts","../src/core/util/dashboardPath.ts","../src/core/hooks/useStudioUrl.ts"],"sourcesContent":["import {type HookCollectionActionHook} from './types'\n\nconst actionIds = new WeakMap<HookCollectionActionHook<any, any>, string>()\n\nlet counter = 0\n\n/** @internal */\nexport function getHookId<T, K>(actionHook: HookCollectionActionHook<T, K>): string {\n const cachedId = actionIds.get(actionHook)\n\n if (cachedId) return cachedId\n\n const id = `${(actionHook as any).displayName || actionHook.name || '<anonymous>'}-${counter++}`\n\n actionIds.set(actionHook, id)\n\n return id\n}\n","import {useEffect} from 'react'\n\nimport {type HookCollectionActionHook} from './types'\n\nexport function defineHookStateComponent<Args, State>({\n hook: useHook,\n id,\n}: {\n hook: HookCollectionActionHook<Args, State>\n id: string\n}) {\n const HookStateComponent = ({\n args,\n handleNext,\n }: {\n args: Args\n handleNext: (id: string, hookState: State | null) => void\n }) => {\n const hookState = useHook(args)\n\n useEffect(() => {\n if (hookState) {\n handleNext(id, {...hookState, action: useHook.action})\n } else {\n handleNext(id, hookState)\n }\n }, [handleNext, hookState])\n\n return null\n }\n // Massively helps debugging and profiling by setting the display name\n const {displayName = id.replace(/-[0-9]+$/, '')} = useHook\n HookStateComponent.displayName = displayName\n return HookStateComponent\n}\n","import {memo, useMemo} from 'react'\nimport deepEqual from 'react-fast-compare'\n\nimport {getHookId} from './actionId'\nimport {defineHookStateComponent} from './defineHookStateComponent'\nimport {type HookCollectionActionHook} from './types'\n\ninterface HookCollectionStateProps<Args, State> {\n hooks: HookCollectionActionHook<Args, State>[]\n args: Args\n handleNext: (id: string, hookState: State | null) => void\n}\n\nconst HookCollectionStateComponent = <Args, State>({\n hooks,\n args,\n handleNext,\n}: HookCollectionStateProps<Args, State>) => {\n return useMemo(\n () =>\n hooks.map((hook) => {\n const id = getHookId(hook)\n return <RenderHook key={id} args={args} id={id} hook={hook} handleNext={handleNext} />\n }),\n [args, hooks, handleNext],\n )\n}\nHookCollectionStateComponent.displayName = 'HookCollectionState'\n\n/** @internal */\nexport const HookCollectionState = memo(\n HookCollectionStateComponent,\n // react-fast-compare handles react specifis and allows us to bail on `args` values that are still the same as before, like `<>A</>`\n deepEqual,\n) as <Args, State>(props: HookCollectionStateProps<Args, State>) => React.ReactNode\n\nfunction RenderHook<Args, State>({\n args,\n hook,\n id,\n handleNext,\n}: {\n args: Args\n hook: HookCollectionActionHook<Args, State>\n id: string\n handleNext: (id: string, hookState: State | null) => void\n}) {\n const HookState = useMemo(\n () =>\n defineHookStateComponent<Args, State>({\n hook,\n id,\n }),\n [hook, id],\n )\n\n // oxlint-disable-next-line react/static-components -- yes this is bad, but we can't fix it without a new document actions API that will be a breaking change\n return <HookState args={args} handleNext={handleNext} />\n}\n","import throttle, {type ThrottleSettings} from 'lodash-es/throttle.js'\nimport {useMemo} from 'react'\n\n/**\n * @internal\n *\n * @example\n * ```tsx\n * // First create a callback using React’s `useCallback` hook\n * const myCallback = useCallback(() => {\n * // this is not throttled\n * }, [])\n *\n * // Then make a throttled version using the `useThrottledCallback` hook\n * const myThrottledCallback = useThrottledCallback(myCallback, 100)\n *\n * // Call the throttled callback\n * <Button onClick={myThrottledCallback} />\n * ```\n */\nexport function useThrottledCallback(\n callback: (...args: any[]) => any,\n wait: number,\n options: ThrottleSettings,\n): (...args: any[]) => any {\n const throttledCallback = useMemo(\n () => throttle(callback, wait, options),\n [callback, options, wait],\n )\n\n return throttledCallback\n}\n","import {type ThrottleSettings} from 'lodash-es/throttle.js'\nimport {useCallback, useRef, useState} from 'react'\nimport deepCompare from 'react-fast-compare'\n\nimport {isNonNullable} from '../../util/isNonNullable'\nimport {postTask} from '../../util/postTask'\nimport {useThrottledCallback} from '../../util/useThrottledCallback'\nimport {getHookId} from './actionId'\nimport {type GetHookCollectionStateProps} from './types'\n\nconst throttleOptions: ThrottleSettings = {trailing: true}\n\nfunction mapHooksToStates<Args, State>(\n states: Map<string, State>,\n {hooks}: Pick<GetHookCollectionStateProps<Args, State>, 'hooks'>,\n) {\n return hooks\n .map((hook) => {\n const id = getHookId(hook)\n return states.get(id)\n })\n .filter(isNonNullable)\n}\n\nexport function useHookCollectionStates<Args, State>({\n hooks,\n}: Pick<GetHookCollectionStateProps<Args, State>, 'hooks'>) {\n const [states] = useState(() => new Map<string, State>())\n const [snapshot, setSnapshot] = useState<NonNullable<State>[]>(() =>\n mapHooksToStates(states, {hooks}),\n )\n\n const abortControllerRef = useRef<AbortController | null>(null)\n\n const updateSnapshot = useCallback(() => {\n abortControllerRef.current?.abort()\n abortControllerRef.current = new AbortController()\n\n postTask(\n () => {\n setSnapshot(mapHooksToStates(states, {hooks}))\n },\n {signal: abortControllerRef.current.signal},\n )?.catch((error) => {\n if (error.name === 'AbortError') {\n return\n }\n\n throw error\n })\n }, [hooks, states])\n\n const requestUpdateSnapshot = useThrottledCallback(\n updateSnapshot,\n 60,\n throttleOptions,\n ) as typeof updateSnapshot\n\n const handleNext = useCallback(\n (id: string, hookState: State | null) => {\n let shouldUpdateSnapshot = true\n\n if (hookState === null) {\n states.delete(id)\n } else {\n if (states.has(id)) {\n const prev = states.get(id)\n shouldUpdateSnapshot = !deepCompare(prev, hookState)\n }\n states.set(id, hookState)\n }\n\n if (shouldUpdateSnapshot) {\n requestUpdateSnapshot()\n }\n },\n [requestUpdateSnapshot, states],\n )\n\n return {states: snapshot, handleNext}\n}\n","import {useImperativeHandle, useMemo, useState} from 'react'\n\nimport {HookCollectionState} from './HookCollectionState'\nimport {type GetHookCollectionStateProps} from './types'\nimport {useHookCollectionStates} from './useHookCollectionStates'\n\n/** @internal */\nexport function GetHookCollectionState<Args, State>(\n props: GetHookCollectionStateProps<Args, State>,\n) {\n const {hooks, args, children, resetRef} = props\n\n const {states, handleNext} = useHookCollectionStates({hooks})\n\n const result = useMemo(() => children({states}), [children, states])\n\n /**\n * Legacy pattern that should not be used in new code\n */\n const [forceReset, setForceReset] = useState(0)\n useImperativeHandle(resetRef, () => () => setForceReset((n) => n + 1), [])\n\n return (\n <>\n <HookCollectionState<Args, State>\n key={`render-${forceReset}`}\n hooks={hooks}\n args={args}\n handleNext={handleNext}\n />\n {result}\n </>\n )\n}\n","import {type MouseEvent, useCallback, useRef} from 'react'\nimport {css, styled} from 'styled-components'\n\ninterface PositionProps {\n position: 'left' | 'right'\n}\n\nconst Root = styled.div<PositionProps>`\n position: absolute;\n top: 0;\n bottom: 0;\n width: 9px;\n z-index: 201;\n cursor: ew-resize;\n\n ${({position}) =>\n position === 'right'\n ? css`\n right: -4px;\n `\n : css`\n left: -4px;\n `}\n\n /* Border */\n & > span:nth-child(1) {\n display: block;\n border-left: 1px solid var(--card-border-color);\n position: absolute;\n top: 0;\n ${({position}) =>\n position === 'right'\n ? css`\n right: 4px;\n `\n : css`\n left: 4px;\n `}\n bottom: 0;\n transition: opacity 200ms;\n }\n\n /* Hover effect */\n & > span:nth-child(2) {\n display: block;\n position: absolute;\n top: 0;\n ${({position}) =>\n position === 'right'\n ? css`\n right: 0px;\n `\n : css`\n left: 0px;\n `}\n width: 9px;\n bottom: 0;\n background-color: var(--card-border-color);\n opacity: 0;\n transition: opacity 150ms;\n }\n\n @media (hover: hover) {\n &:hover > span:nth-child(2) {\n opacity: 0.2;\n }\n }\n`\n\nexport function Resizer(props: {\n onResize: (delta: number) => void\n onResizeStart: () => void\n position: 'left' | 'right'\n}) {\n const {onResize, onResizeStart, position} = props\n\n const mouseXRef = useRef(0)\n\n const handleMouseDown = useCallback(\n (event: MouseEvent) => {\n event.preventDefault()\n\n mouseXRef.current = event.pageX\n\n onResizeStart()\n\n const handleMouseMove = (e: globalThis.MouseEvent) => {\n e.preventDefault()\n onResize(mouseXRef.current - e.pageX)\n }\n\n const controller = new AbortController()\n const handleMouseUp = () => controller.abort()\n\n const {signal} = controller\n window.addEventListener('mousemove', handleMouseMove, {signal})\n window.addEventListener('mouseup', handleMouseUp, {signal})\n },\n [onResize, onResizeStart],\n )\n\n return (\n <Root onMouseDown={handleMouseDown} position={position}>\n {/* Hover effect */}\n <span />\n\n {/* Border */}\n <span />\n </Root>\n )\n}\n","import {type ElementType, type HTMLProps, useCallback, useMemo, useRef, useState} from 'react'\nimport {styled} from 'styled-components'\nimport {Box, type BoxProps} from 'ui5'\n\nimport {Resizer} from './Resizer'\n\ninterface ResizableProps {\n minWidth: number\n maxWidth: number\n initialWidth?: number\n resizerPosition?: 'left' | 'right'\n}\n\nconst Root = styled(Box)`\n position: relative;\n flex: 1;\n padding-left: 1px;\n`\n\n/**\n * @internal\n * Provides a resizable container with a resizer handle.\n */\nexport function Resizable(\n props: ResizableProps &\n Omit<BoxProps<ElementType>, 'maxWidth' | 'minWidth'> &\n Omit<HTMLProps<HTMLDivElement>, 'as'>,\n) {\n const {\n as: forwardedAs,\n children,\n minWidth,\n maxWidth,\n initialWidth,\n resizerPosition = 'right',\n ...restProps\n } = props\n const [element, setElement] = useState<HTMLDivElement | null>(null)\n const elementWidthRef = useRef<number>(undefined)\n const [targetWidth, setTargetWidth] = useState<number | undefined>(initialWidth)\n\n const handleResizeStart = useCallback(() => {\n elementWidthRef.current = element?.offsetWidth\n }, [element])\n\n const handleResize = useCallback(\n (deltaX: number) => {\n const w = elementWidthRef.current\n if (!w) return\n if (resizerPosition === 'right') {\n setTargetWidth(Math.min(Math.max(w - deltaX, minWidth), maxWidth))\n } else {\n setTargetWidth(Math.min(Math.max(w + deltaX, minWidth), maxWidth))\n }\n },\n [minWidth, maxWidth, resizerPosition],\n )\n\n const style = useMemo(\n () => (targetWidth ? {flex: 'none', width: targetWidth} : {minWidth, maxWidth}),\n [minWidth, maxWidth, targetWidth],\n )\n\n return (\n <Root as={forwardedAs} {...restProps} ref={setElement} style={style}>\n {resizerPosition === 'left' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"left\" />\n )}\n {children}\n {resizerPosition === 'right' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"right\" />\n )}\n </Root>\n )\n}\n","import {useMemo} from 'react'\n\nimport {useSource} from '../../studio/source'\nimport {\n type DocumentActionsContext,\n type DocumentActionsVersionType,\n type PartialContext,\n} from '../types'\nimport {type DocumentActionKeys} from './actions'\n\nconst NO_ACTION_IDS: ReadonlySet<keyof DocumentActionKeys> = new Set()\n\n/**\n * Resolves the set of configured document action identifiers for a given\n * document context. Reflects `document.actions` filtering from the studio\n * config (and plugins), so callers can hide surfaces that mirror those\n * actions — for example the version chip / document group inventory context menu.\n *\n * @internal\n */\nexport function useConfiguredDocumentActionIds(\n context: PartialContext<DocumentActionsContext> | null,\n): ReadonlySet<keyof DocumentActionKeys> {\n // oxlint-disable-next-line no-deprecated -- deprecated for external consumers; the document pane resolves document.actions from this same source instance\n const source = useSource()\n const resolveDocumentActions = source.document.actions\n\n const schemaType = context?.schemaType\n const documentId = context?.documentId\n const versionType = context?.versionType\n const releaseId = context?.releaseId\n\n return useMemo(() => {\n // Resolving without an identity would hand a `ctx.schemaType` predicate an undefined value.\n if (schemaType === undefined || versionType === undefined) return NO_ACTION_IDS\n\n const configured = resolveDocumentActions({\n schemaType,\n documentId,\n versionType,\n releaseId,\n })\n return new Set(configured.flatMap(({action}) => (action ? [action] : [])))\n }, [schemaType, documentId, versionType, releaseId, resolveDocumentActions])\n}\n\n/**\n * Resolves the document-actions version type from pane or chip flags.\n *\n * Callers pass `isScheduledDraft`. Do not look the release up here: the chip's\n * `releases` prop is notCurrentReleases and the chip's own release is absent from it.\n *\n * @internal\n */\nexport function getDocumentVersionType(options: {\n isRevision?: boolean\n isScheduledDraft?: boolean\n isVersionDocument?: boolean\n perspectiveName?: string\n draftsEnabled?: boolean\n}): DocumentActionsVersionType {\n const {\n isRevision = false,\n isScheduledDraft = false,\n isVersionDocument = false,\n perspectiveName,\n draftsEnabled = false,\n } = options\n\n if (isRevision) return 'revision'\n if (isScheduledDraft) return 'scheduled-draft'\n if (isVersionDocument) return 'version'\n if (perspectiveName === 'published') return 'published'\n if (draftsEnabled) return 'draft'\n return 'published'\n}\n\nfunction isReleaseBundleId(bundleId: string): boolean {\n return bundleId !== 'published' && bundleId !== 'draft'\n}\n\n/**\n * Derives the document-actions context for a version chip / inventory row\n * context menu from the chip's release identity.\n *\n * @internal\n */\nexport function getVersionContextMenuActionsContext(options: {\n schemaType: string\n documentGroupId: string\n fromRelease: string\n isScheduledDraft?: boolean\n}): PartialContext<DocumentActionsContext> {\n const {schemaType, documentGroupId, fromRelease, isScheduledDraft = false} = options\n\n const isRelease = isReleaseBundleId(fromRelease)\n\n const versionType = getDocumentVersionType({\n isScheduledDraft,\n isVersionDocument: isRelease,\n perspectiveName: fromRelease,\n draftsEnabled: true,\n })\n\n const releaseId = isRelease ? fromRelease : undefined\n\n return {schemaType, documentId: documentGroupId, versionType, releaseId}\n}\n\n/**\n * The document action identifier that corresponds to discarding the version\n * represented by a context menu (draft discard vs version discard).\n *\n * @internal\n */\nexport function getDiscardDocumentActionId(options: {\n fromRelease: string\n isScheduledDraft?: boolean\n}): keyof DocumentActionKeys | null {\n const {fromRelease, isScheduledDraft = false} = options\n\n if (fromRelease === 'published') return null\n if (fromRelease === 'draft') {\n return isScheduledDraft ? 'discardVersion' : 'discardChanges'\n }\n return 'discardVersion'\n}\n","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\ntype FeatureAttributes = Record<string, string | number | boolean | null>\n\ninterface Feature {\n id: string\n variantId: string\n name: string\n price: number\n included: boolean\n attributes: FeatureAttributes\n}\n\ninterface FeatureType {\n id: string\n name: string\n singular: boolean\n features: Feature[]\n}\n\ninterface Resource {\n id: string\n name: string\n unit: string\n type: string\n quota: number | null\n custom: boolean\n overageAllowed: boolean\n overageChunkSize: number\n overageChunkPrice: number\n maxOverageQuota: number | null\n}\n\ninterface Plan {\n id: string\n planTypeId: string\n variantId: string | null\n productType: string\n variantOfPlanId: string | null\n name: string\n variantName: string | null\n price: number\n trialDays: number\n createdAt: string\n supersededAt: string | null\n default: boolean\n public: boolean\n orderable: boolean\n isBasePlan: boolean\n pricingModel: string\n resources: Record<string, Resource>\n featureTypes: Record<string, FeatureType>\n}\n\n/**\n * @internal\n */\nexport interface ProjectSubscriptionsResponse {\n id: string\n projectId: string\n productType: string\n productId: string\n customerId: string | null\n planId: string\n previousSubscriptionId: string | null\n status: string\n startedAt: string\n startedBy: string\n endedAt: string\n endedBy: string\n trialUntil: string | null\n plan: Plan\n resources: Record<string, Resource>\n featureTypes: Record<string, FeatureType>\n}\n\ninterface ProjectSubscriptions {\n error: Error | null\n projectSubscriptions: ProjectSubscriptionsResponse | null\n isLoading: boolean\n}\n\nconst INITIAL_LOADING_STATE: ProjectSubscriptions = {\n error: null,\n projectSubscriptions: null,\n isLoading: true,\n}\n\n/**\n * @internal\n * fetches subscriptions for this project\n */\nfunction fetchProjectSubscriptions({\n versionedClient,\n}: {\n versionedClient: SanityClient\n}): Observable<ProjectSubscriptionsResponse> {\n return versionedClient.observable.request<ProjectSubscriptionsResponse>({\n url: `/subscriptions/project/${versionedClient.config().projectId}`,\n tag: 'project-subscriptions',\n })\n}\n\nconst cachedProjectSubscriptionsRequest = new Map<\n string,\n Observable<ProjectSubscriptionsResponse>\n>()\n\n/** @internal */\nexport function useProjectSubscriptions(): ProjectSubscriptions {\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 if (!cachedProjectSubscriptionsRequest.get(projectId)) {\n const projectSubscriptions = fetchProjectSubscriptions({versionedClient}).pipe(shareReplay())\n cachedProjectSubscriptionsRequest.set(projectId, projectSubscriptions)\n }\n\n const projectSubscriptionsObservable = useMemo(() => {\n const projectSubscriptions$ = cachedProjectSubscriptionsRequest.get(projectId)\n\n if (!projectSubscriptions$)\n return of<ProjectSubscriptions>({\n isLoading: false,\n error: null,\n projectSubscriptions: null,\n })\n\n return projectSubscriptions$.pipe(\n map((cachedSubscriptions) => ({\n isLoading: false,\n projectSubscriptions: cachedSubscriptions,\n error: null,\n })),\n startWith(INITIAL_LOADING_STATE),\n catchError((error: Error) =>\n of<ProjectSubscriptions>({\n isLoading: false,\n projectSubscriptions: null,\n error,\n }),\n ),\n )\n }, [projectId])\n\n return useObservable(projectSubscriptionsObservable, INITIAL_LOADING_STATE)\n}\n","import {type EditableReleaseDocument} from '@sanity/client'\nimport {isPast} from 'date-fns/isPast'\n\n/** @internal */\nexport const getIsScheduledDateInPast = (value: EditableReleaseDocument) =>\n Boolean(\n value.metadata.releaseType === 'scheduled' &&\n value.metadata.intendedPublishAt &&\n isPast(new Date(value.metadata.intendedPublishAt)),\n )\n","import {useMemo} from 'react'\n\nimport {useWorkspace} from '../workspace'\n\nexport function useEnvAwareSanityWebsiteUrl() {\n const {getClient} = useWorkspace()\n return useMemo(() => {\n const apiHost = getClient({apiVersion: '2025-08-15'}).config().apiHost\n return apiHost.endsWith('.work') ? 'https://www.sanity.work' : 'https://www.sanity.io'\n }, [getClient])\n}\n","/**\n * @internal\n */\nexport const getDashboardPath = ({\n organizationId,\n dashboardDomain,\n appId,\n workspaceName,\n}: {\n dashboardDomain: string\n organizationId: string\n appId: string\n workspaceName: string\n}) => `${dashboardDomain}/@${organizationId}/studio/${appId}/${workspaceName}`\n","import {useCallback, useMemo} from 'react'\n\nimport {useProjectOrganizationId} from '../store/project/useProjectOrganizationId'\nimport {useRenderingContext} from '../store/renderingContext/useRenderingContext'\nimport {useStudioAppIdStore} from '../store/studio-app/useStudioAppIdStore'\nimport {useActiveWorkspace} from '../studio/activeWorkspaceMatcher/useActiveWorkspace'\nimport {useEnvAwareSanityWebsiteUrl} from '../studio/hooks/useEnvAwareSanityWebsiteUrl'\nimport {getDashboardPath} from '../util/dashboardPath'\n\ntype StudioUrlBuilder = (url: string) => string\ntype StudioUrlModifier = {coreUi?: StudioUrlBuilder; studio?: StudioUrlBuilder} & (\n | {coreUi: StudioUrlBuilder}\n | {studio: StudioUrlBuilder}\n)\n\ninterface UseStudioUrlReturnType {\n studioUrl: string\n buildStudioUrl: (modifiers: StudioUrlModifier) => string\n buildIntentUrl: (intentLink: string) => string\n}\n\n/**\n * @internal\n */\nexport const useStudioUrl = (defaultUrl?: string): UseStudioUrlReturnType => {\n const renderingContext = useRenderingContext()\n const {studioApp, loading: appIdLoading} = useStudioAppIdStore({\n enabled: true,\n })\n const {activeWorkspace} = useActiveWorkspace()\n const {value: organizationId, loading: organizationIdLoading} = useProjectOrganizationId()\n const isLoading = appIdLoading || organizationIdLoading\n const isCoreUi = renderingContext?.name === 'coreUi'\n const sanityWebsiteUrl = useEnvAwareSanityWebsiteUrl()\n\n const appId = studioApp?.appId || ''\n const studioUrl = useMemo(() => {\n if (!isCoreUi || isLoading || !appId || !organizationId) {\n return defaultUrl || window.location.origin\n }\n\n return getDashboardPath({\n dashboardDomain: sanityWebsiteUrl,\n organizationId,\n appId: appId,\n workspaceName: activeWorkspace.name,\n })\n }, [\n activeWorkspace.name,\n defaultUrl,\n isCoreUi,\n isLoading,\n organizationId,\n appId,\n sanityWebsiteUrl,\n ])\n\n const basePath = activeWorkspace.basePath\n\n const buildStudioUrl = useCallback(\n ({coreUi, studio}: StudioUrlModifier) => {\n const urlModifier = isCoreUi ? coreUi : studio\n\n return urlModifier?.(studioUrl) || studioUrl\n },\n [isCoreUi, studioUrl],\n )\n\n const buildIntentUrl = useCallback(\n (intentLink: string) => {\n if (isCoreUi && basePath !== '/') {\n return `${studioUrl}${intentLink.slice(basePath.length)}`\n }\n return `${studioUrl}${intentLink}`\n },\n [basePath, isCoreUi, studioUrl],\n )\n\n return {\n buildIntentUrl,\n buildStudioUrl,\n studioUrl,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,MAAM,4BAAY,IAAI,QAAoD;AAE1E,IAAI,UAAU;;AAGd,SAAgB,UAAgB,YAAoD;CAClF,IAAM,WAAW,UAAU,IAAI,UAAU;CAEzC,IAAI,UAAU,OAAO;CAErB,IAAM,KAAK,GAAI,WAAmB,eAAe,WAAW,QAAQ,cAAc,GAAG;CAIrF,OAFA,UAAU,IAAI,YAAY,EAAE,GAErB;AACT;ACbA,SAAgB,yBAAsC,EACpD,MAAM,SACN,MAIC;CACD,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ACF,GAHE,EAAA,MAAA,gBACA,EAAA,MAAA,gBACA,EAAA,MAAA,qCAHKA;AAKT"}
|
|
1
|
+
{"version":3,"file":"useStudioUrl-DcTGV00c.js","names":["{\n args,\n handleNext,\n }: {\n args: Args\n handleNext: (id: string, hookState: State | null) => void\n }","() => {\n if (hookState) {\n handleNext(id, {...hookState, action: useHook.action})\n } else {\n handleNext(id, hookState)\n }\n }","[handleNext, hookState]","{\n hooks,\n args,\n handleNext,\n}: HookCollectionStateProps<Args, State>","hooks.map((hook) => {\n const id = getHookId(hook)\n return <RenderHook key={id} args={args} id={id} hook={hook} handleNext={handleNext} />\n })","(hook) => {\n const id = getHookId(hook)\n return <RenderHook key={id} args={args} id={id} hook={hook} handleNext={handleNext} />\n }","useMemo(\n () =>\n hooks.map((hook) => {\n const id = getHookId(hook)\n return <RenderHook key={id} args={args} id={id} hook={hook} handleNext={handleNext} />\n }),\n [args, hooks, handleNext],\n )","{\n args,\n hook,\n id,\n handleNext,\n}: {\n args: Args\n hook: HookCollectionActionHook<Args, State>\n id: string\n handleNext: (id: string, hookState: State | null) => void\n}","defineHookStateComponent<Args, State>({\n hook,\n id,\n })","useMemo(\n () =>\n defineHookStateComponent<Args, State>({\n hook,\n id,\n }),\n [hook, id],\n )","<HookState args={args} handleNext={handleNext} />","throttle(callback, wait, options)","useMemo(\n () => throttle(callback, wait, options),\n [callback, options, wait],\n )","{\n hooks,\n}: Pick<GetHookCollectionStateProps<Args, State>, 'hooks'>","() => new Map<string, State>()","() =>\n mapHooksToStates(states, {hooks})","() => {\n abortControllerRef.current?.abort()\n abortControllerRef.current = new AbortController()\n\n postTask(\n () => {\n setSnapshot(mapHooksToStates(states, {hooks}))\n },\n {signal: abortControllerRef.current.signal},\n )?.catch((error) => {\n if (error.name === 'AbortError') {\n return\n }\n\n throw error\n })\n }","(error) => {\n if (error.name === 'AbortError') {\n return\n }\n\n throw error\n }","useCallback(() => {\n abortControllerRef.current?.abort()\n abortControllerRef.current = new AbortController()\n\n postTask(\n () => {\n setSnapshot(mapHooksToStates(states, {hooks}))\n },\n {signal: abortControllerRef.current.signal},\n )?.catch((error) => {\n if (error.name === 'AbortError') {\n return\n }\n\n throw error\n })\n }, [hooks, states])","(id: string, hookState: State | null) => {\n let shouldUpdateSnapshot = true\n\n if (hookState === null) {\n states.delete(id)\n } else {\n if (states.has(id)) {\n const prev = states.get(id)\n shouldUpdateSnapshot = !deepCompare(prev, hookState)\n }\n states.set(id, hookState)\n }\n\n if (shouldUpdateSnapshot) {\n requestUpdateSnapshot()\n }\n }","useCallback(\n (id: string, hookState: State | null) => {\n let shouldUpdateSnapshot = true\n\n if (hookState === null) {\n states.delete(id)\n } else {\n if (states.has(id)) {\n const prev = states.get(id)\n shouldUpdateSnapshot = !deepCompare(prev, hookState)\n }\n states.set(id, hookState)\n }\n\n if (shouldUpdateSnapshot) {\n requestUpdateSnapshot()\n }\n },\n [requestUpdateSnapshot, states],\n )","{states: snapshot, handleNext}","{hooks}","children({states})","useMemo(() => children({states}), [children, states])","() => () => setForceReset((n) => n + 1)","[]","(n) => n + 1","<HookCollectionState<Args, State>\n key={`render-${forceReset}`}\n hooks={hooks}\n args={args}\n handleNext={handleNext}\n />","`render-${forceReset}`","<>\n <HookCollectionState<Args, State>\n key={`render-${forceReset}`}\n hooks={hooks}\n args={args}\n handleNext={handleNext}\n />\n {result}\n </>","(event: MouseEvent) => {\n event.preventDefault()\n\n mouseXRef.current = event.pageX\n\n onResizeStart()\n\n const handleMouseMove = (e: globalThis.MouseEvent) => {\n e.preventDefault()\n onResize(mouseXRef.current - e.pageX)\n }\n\n const controller = new AbortController()\n const handleMouseUp = () => controller.abort()\n\n const {signal} = controller\n window.addEventListener('mousemove', handleMouseMove, {signal})\n window.addEventListener('mouseup', handleMouseUp, {signal})\n }","useCallback(\n (event: MouseEvent) => {\n event.preventDefault()\n\n mouseXRef.current = event.pageX\n\n onResizeStart()\n\n const handleMouseMove = (e: globalThis.MouseEvent) => {\n e.preventDefault()\n onResize(mouseXRef.current - e.pageX)\n }\n\n const controller = new AbortController()\n const handleMouseUp = () => controller.abort()\n\n const {signal} = controller\n window.addEventListener('mousemove', handleMouseMove, {signal})\n window.addEventListener('mouseup', handleMouseUp, {signal})\n },\n [onResize, onResizeStart],\n )","<span />","<Root onMouseDown={handleMouseDown} position={position}>\n {/* Hover effect */}\n <span />\n\n {/* Border */}\n <span />\n </Root>","resizerPosition = 'right'","() => {\n elementWidthRef.current = element?.offsetWidth\n }","offsetWidth","useCallback(() => {\n elementWidthRef.current = element?.offsetWidth\n }, [element])","(deltaX: number) => {\n const w = elementWidthRef.current\n if (!w) return\n if (resizerPosition === 'right') {\n setTargetWidth(Math.min(Math.max(w - deltaX, minWidth), maxWidth))\n } else {\n setTargetWidth(Math.min(Math.max(w + deltaX, minWidth), maxWidth))\n }\n }","useCallback(\n (deltaX: number) => {\n const w = elementWidthRef.current\n if (!w) return\n if (resizerPosition === 'right') {\n setTargetWidth(Math.min(Math.max(w - deltaX, minWidth), maxWidth))\n } else {\n setTargetWidth(Math.min(Math.max(w + deltaX, minWidth), maxWidth))\n }\n },\n [minWidth, maxWidth, resizerPosition],\n )","targetWidth ? {flex: 'none', width: targetWidth} : {minWidth, maxWidth}","useMemo(\n () => (targetWidth ? {flex: 'none', width: targetWidth} : {minWidth, maxWidth}),\n [minWidth, maxWidth, targetWidth],\n )","resizerPosition === 'left' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"left\" />\n )","resizerPosition === 'right' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"right\" />\n )","<Root as={forwardedAs} {...restProps} ref={setElement} style={style}>\n {resizerPosition === 'left' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"left\" />\n )}\n {children}\n {resizerPosition === 'right' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"right\" />\n )}\n </Root>","useMemo(() => {\n // Resolving without an identity would hand a `ctx.schemaType` predicate an undefined value.\n if (schemaType === undefined || versionType === undefined) return NO_ACTION_IDS\n\n const configured = resolveDocumentActions({\n schemaType,\n documentId,\n versionType,\n releaseId,\n })\n return new Set(configured.flatMap(({action}) => (action ? [action] : [])))\n }, [schemaType, documentId, versionType, releaseId, resolveDocumentActions])","new Set(configured.flatMap(({action}) => (action ? [action] : [])))","({action}) => (action ? [action] : [])","{action}","useMemo(() => {\n const projectSubscriptions$ = cachedProjectSubscriptionsRequest.get(projectId)\n\n if (!projectSubscriptions$)\n return of<ProjectSubscriptions>({\n isLoading: false,\n error: null,\n projectSubscriptions: null,\n })\n\n return projectSubscriptions$.pipe(\n map((cachedSubscriptions) => ({\n isLoading: false,\n projectSubscriptions: cachedSubscriptions,\n error: null,\n })),\n startWith(INITIAL_LOADING_STATE),\n catchError((error: Error) =>\n of<ProjectSubscriptions>({\n isLoading: false,\n projectSubscriptions: null,\n error,\n }),\n ),\n )\n }, [projectId])","of<ProjectSubscriptions>({\n isLoading: false,\n error: null,\n projectSubscriptions: null,\n })","(cachedSubscriptions) => ({\n isLoading: false,\n projectSubscriptions: cachedSubscriptions,\n error: null,\n })","(error: Error) =>\n of<ProjectSubscriptions>({\n isLoading: false,\n projectSubscriptions: null,\n error,\n })","{\n enabled: true,\n }","useMemo(() => {\n if (!isCoreUi || isLoading || !appId || !organizationId) {\n return defaultUrl || window.location.origin\n }\n\n return getDashboardPath({\n dashboardDomain: sanityWebsiteUrl,\n organizationId,\n appId: appId,\n workspaceName: activeWorkspace.name,\n })\n }, [\n activeWorkspace.name,\n defaultUrl,\n isCoreUi,\n isLoading,\n organizationId,\n appId,\n sanityWebsiteUrl,\n ])","getDashboardPath({\n dashboardDomain: sanityWebsiteUrl,\n organizationId,\n appId: appId,\n workspaceName: activeWorkspace.name,\n })","name","({coreUi, studio}: StudioUrlModifier) => {\n const urlModifier = isCoreUi ? coreUi : studio\n\n return urlModifier?.(studioUrl) || studioUrl\n }","{coreUi, studio}: StudioUrlModifier","useCallback(\n ({coreUi, studio}: StudioUrlModifier) => {\n const urlModifier = isCoreUi ? coreUi : studio\n\n return urlModifier?.(studioUrl) || studioUrl\n },\n [isCoreUi, studioUrl],\n )","(intentLink: string) => {\n if (isCoreUi && basePath !== '/') {\n return `${studioUrl}${intentLink.slice(basePath.length)}`\n }\n return `${studioUrl}${intentLink}`\n }","useCallback(\n (intentLink: string) => {\n if (isCoreUi && basePath !== '/') {\n return `${studioUrl}${intentLink.slice(basePath.length)}`\n }\n return `${studioUrl}${intentLink}`\n },\n [basePath, isCoreUi, studioUrl],\n )","{\n buildIntentUrl,\n buildStudioUrl,\n studioUrl,\n }"],"sources":["../src/core/components/hookCollection/actionId.ts","../src/core/components/hookCollection/defineHookStateComponent.tsx","../src/core/components/hookCollection/HookCollectionState.tsx","../src/core/util/useThrottledCallback.ts","../src/core/components/hookCollection/useHookCollectionStates.tsx","../src/core/components/hookCollection/GetHookCollectionState.tsx","../src/core/components/resizer/Resizer.tsx","../src/core/components/resizer/Resizable.tsx","../src/core/config/document/useConfiguredDocumentActionIds.ts","../src/core/hooks/useProjectSubscriptions.ts","../src/core/releases/util/getIsScheduledDateInPast.ts","../src/core/studio/hooks/useEnvAwareSanityWebsiteUrl.ts","../src/core/util/dashboardPath.ts","../src/core/hooks/useStudioUrl.ts"],"sourcesContent":["import {type HookCollectionActionHook} from './types'\n\nconst actionIds = new WeakMap<HookCollectionActionHook<any, any>, string>()\n\nlet counter = 0\n\n/** @internal */\nexport function getHookId<T, K>(actionHook: HookCollectionActionHook<T, K>): string {\n const cachedId = actionIds.get(actionHook)\n\n if (cachedId) return cachedId\n\n const id = `${(actionHook as any).displayName || actionHook.name || '<anonymous>'}-${counter++}`\n\n actionIds.set(actionHook, id)\n\n return id\n}\n","import {useEffect} from 'react'\n\nimport {type HookCollectionActionHook} from './types'\n\nexport function defineHookStateComponent<Args, State>({\n hook: useHook,\n id,\n}: {\n hook: HookCollectionActionHook<Args, State>\n id: string\n}) {\n const HookStateComponent = ({\n args,\n handleNext,\n }: {\n args: Args\n handleNext: (id: string, hookState: State | null) => void\n }) => {\n const hookState = useHook(args)\n\n useEffect(() => {\n if (hookState) {\n handleNext(id, {...hookState, action: useHook.action})\n } else {\n handleNext(id, hookState)\n }\n }, [handleNext, hookState])\n\n return null\n }\n // Massively helps debugging and profiling by setting the display name\n const {displayName = id.replace(/-[0-9]+$/, '')} = useHook\n HookStateComponent.displayName = displayName\n return HookStateComponent\n}\n","import {memo, useMemo} from 'react'\nimport deepEqual from 'react-fast-compare'\n\nimport {getHookId} from './actionId'\nimport {defineHookStateComponent} from './defineHookStateComponent'\nimport {type HookCollectionActionHook} from './types'\n\ninterface HookCollectionStateProps<Args, State> {\n hooks: HookCollectionActionHook<Args, State>[]\n args: Args\n handleNext: (id: string, hookState: State | null) => void\n}\n\nconst HookCollectionStateComponent = <Args, State>({\n hooks,\n args,\n handleNext,\n}: HookCollectionStateProps<Args, State>) => {\n return useMemo(\n () =>\n hooks.map((hook) => {\n const id = getHookId(hook)\n return <RenderHook key={id} args={args} id={id} hook={hook} handleNext={handleNext} />\n }),\n [args, hooks, handleNext],\n )\n}\nHookCollectionStateComponent.displayName = 'HookCollectionState'\n\n/** @internal */\nexport const HookCollectionState = memo(\n HookCollectionStateComponent,\n // react-fast-compare handles react specifis and allows us to bail on `args` values that are still the same as before, like `<>A</>`\n deepEqual,\n) as <Args, State>(props: HookCollectionStateProps<Args, State>) => React.ReactNode\n\nfunction RenderHook<Args, State>({\n args,\n hook,\n id,\n handleNext,\n}: {\n args: Args\n hook: HookCollectionActionHook<Args, State>\n id: string\n handleNext: (id: string, hookState: State | null) => void\n}) {\n const HookState = useMemo(\n () =>\n defineHookStateComponent<Args, State>({\n hook,\n id,\n }),\n [hook, id],\n )\n\n // oxlint-disable-next-line react/static-components -- yes this is bad, but we can't fix it without a new document actions API that will be a breaking change\n return <HookState args={args} handleNext={handleNext} />\n}\n","import throttle, {type ThrottleSettings} from 'lodash-es/throttle.js'\nimport {useMemo} from 'react'\n\n/**\n * @internal\n *\n * @example\n * ```tsx\n * // First create a callback using React’s `useCallback` hook\n * const myCallback = useCallback(() => {\n * // this is not throttled\n * }, [])\n *\n * // Then make a throttled version using the `useThrottledCallback` hook\n * const myThrottledCallback = useThrottledCallback(myCallback, 100)\n *\n * // Call the throttled callback\n * <Button onClick={myThrottledCallback} />\n * ```\n */\nexport function useThrottledCallback(\n callback: (...args: any[]) => any,\n wait: number,\n options: ThrottleSettings,\n): (...args: any[]) => any {\n const throttledCallback = useMemo(\n () => throttle(callback, wait, options),\n [callback, options, wait],\n )\n\n return throttledCallback\n}\n","import {type ThrottleSettings} from 'lodash-es/throttle.js'\nimport {useCallback, useRef, useState} from 'react'\nimport deepCompare from 'react-fast-compare'\n\nimport {isNonNullable} from '../../util/isNonNullable'\nimport {postTask} from '../../util/postTask'\nimport {useThrottledCallback} from '../../util/useThrottledCallback'\nimport {getHookId} from './actionId'\nimport {type GetHookCollectionStateProps} from './types'\n\nconst throttleOptions: ThrottleSettings = {trailing: true}\n\nfunction mapHooksToStates<Args, State>(\n states: Map<string, State>,\n {hooks}: Pick<GetHookCollectionStateProps<Args, State>, 'hooks'>,\n) {\n return hooks\n .map((hook) => {\n const id = getHookId(hook)\n return states.get(id)\n })\n .filter(isNonNullable)\n}\n\nexport function useHookCollectionStates<Args, State>({\n hooks,\n}: Pick<GetHookCollectionStateProps<Args, State>, 'hooks'>) {\n const [states] = useState(() => new Map<string, State>())\n const [snapshot, setSnapshot] = useState<NonNullable<State>[]>(() =>\n mapHooksToStates(states, {hooks}),\n )\n\n const abortControllerRef = useRef<AbortController | null>(null)\n\n const updateSnapshot = useCallback(() => {\n abortControllerRef.current?.abort()\n abortControllerRef.current = new AbortController()\n\n postTask(\n () => {\n setSnapshot(mapHooksToStates(states, {hooks}))\n },\n {signal: abortControllerRef.current.signal},\n )?.catch((error) => {\n if (error.name === 'AbortError') {\n return\n }\n\n throw error\n })\n }, [hooks, states])\n\n const requestUpdateSnapshot = useThrottledCallback(\n updateSnapshot,\n 60,\n throttleOptions,\n ) as typeof updateSnapshot\n\n const handleNext = useCallback(\n (id: string, hookState: State | null) => {\n let shouldUpdateSnapshot = true\n\n if (hookState === null) {\n states.delete(id)\n } else {\n if (states.has(id)) {\n const prev = states.get(id)\n shouldUpdateSnapshot = !deepCompare(prev, hookState)\n }\n states.set(id, hookState)\n }\n\n if (shouldUpdateSnapshot) {\n requestUpdateSnapshot()\n }\n },\n [requestUpdateSnapshot, states],\n )\n\n return {states: snapshot, handleNext}\n}\n","import {useImperativeHandle, useMemo, useState} from 'react'\n\nimport {HookCollectionState} from './HookCollectionState'\nimport {type GetHookCollectionStateProps} from './types'\nimport {useHookCollectionStates} from './useHookCollectionStates'\n\n/** @internal */\nexport function GetHookCollectionState<Args, State>(\n props: GetHookCollectionStateProps<Args, State>,\n) {\n const {hooks, args, children, resetRef} = props\n\n const {states, handleNext} = useHookCollectionStates({hooks})\n\n const result = useMemo(() => children({states}), [children, states])\n\n /**\n * Legacy pattern that should not be used in new code\n */\n const [forceReset, setForceReset] = useState(0)\n useImperativeHandle(resetRef, () => () => setForceReset((n) => n + 1), [])\n\n return (\n <>\n <HookCollectionState<Args, State>\n key={`render-${forceReset}`}\n hooks={hooks}\n args={args}\n handleNext={handleNext}\n />\n {result}\n </>\n )\n}\n","import {type MouseEvent, useCallback, useRef} from 'react'\nimport {css, styled} from 'styled-components'\n\ninterface PositionProps {\n position: 'left' | 'right'\n}\n\nconst Root = styled.div<PositionProps>`\n position: absolute;\n top: 0;\n bottom: 0;\n width: 9px;\n z-index: 201;\n cursor: ew-resize;\n\n ${({position}) =>\n position === 'right'\n ? css`\n right: -4px;\n `\n : css`\n left: -4px;\n `}\n\n /* Border */\n & > span:nth-child(1) {\n display: block;\n border-left: 1px solid var(--card-border-color);\n position: absolute;\n top: 0;\n ${({position}) =>\n position === 'right'\n ? css`\n right: 4px;\n `\n : css`\n left: 4px;\n `}\n bottom: 0;\n transition: opacity 200ms;\n }\n\n /* Hover effect */\n & > span:nth-child(2) {\n display: block;\n position: absolute;\n top: 0;\n ${({position}) =>\n position === 'right'\n ? css`\n right: 0px;\n `\n : css`\n left: 0px;\n `}\n width: 9px;\n bottom: 0;\n background-color: var(--card-border-color);\n opacity: 0;\n transition: opacity 150ms;\n }\n\n @media (hover: hover) {\n &:hover > span:nth-child(2) {\n opacity: 0.2;\n }\n }\n`\n\nexport function Resizer(props: {\n onResize: (delta: number) => void\n onResizeStart: () => void\n position: 'left' | 'right'\n}) {\n const {onResize, onResizeStart, position} = props\n\n const mouseXRef = useRef(0)\n\n const handleMouseDown = useCallback(\n (event: MouseEvent) => {\n event.preventDefault()\n\n mouseXRef.current = event.pageX\n\n onResizeStart()\n\n const handleMouseMove = (e: globalThis.MouseEvent) => {\n e.preventDefault()\n onResize(mouseXRef.current - e.pageX)\n }\n\n const controller = new AbortController()\n const handleMouseUp = () => controller.abort()\n\n const {signal} = controller\n window.addEventListener('mousemove', handleMouseMove, {signal})\n window.addEventListener('mouseup', handleMouseUp, {signal})\n },\n [onResize, onResizeStart],\n )\n\n return (\n <Root onMouseDown={handleMouseDown} position={position}>\n {/* Hover effect */}\n <span />\n\n {/* Border */}\n <span />\n </Root>\n )\n}\n","import {type ElementType, type HTMLProps, useCallback, useMemo, useRef, useState} from 'react'\nimport {styled} from 'styled-components'\nimport {Box, type BoxProps} from 'ui5'\n\nimport {Resizer} from './Resizer'\n\ninterface ResizableProps {\n minWidth: number\n maxWidth: number\n initialWidth?: number\n resizerPosition?: 'left' | 'right'\n}\n\nconst Root = styled(Box)`\n position: relative;\n flex: 1;\n padding-left: 1px;\n`\n\n/**\n * @internal\n * Provides a resizable container with a resizer handle.\n */\nexport function Resizable(\n props: ResizableProps &\n Omit<BoxProps<ElementType>, 'maxWidth' | 'minWidth'> &\n Omit<HTMLProps<HTMLDivElement>, 'as'>,\n) {\n const {\n as: forwardedAs,\n children,\n minWidth,\n maxWidth,\n initialWidth,\n resizerPosition = 'right',\n ...restProps\n } = props\n const [element, setElement] = useState<HTMLDivElement | null>(null)\n const elementWidthRef = useRef<number>(undefined)\n const [targetWidth, setTargetWidth] = useState<number | undefined>(initialWidth)\n\n const handleResizeStart = useCallback(() => {\n elementWidthRef.current = element?.offsetWidth\n }, [element])\n\n const handleResize = useCallback(\n (deltaX: number) => {\n const w = elementWidthRef.current\n if (!w) return\n if (resizerPosition === 'right') {\n setTargetWidth(Math.min(Math.max(w - deltaX, minWidth), maxWidth))\n } else {\n setTargetWidth(Math.min(Math.max(w + deltaX, minWidth), maxWidth))\n }\n },\n [minWidth, maxWidth, resizerPosition],\n )\n\n const style = useMemo(\n () => (targetWidth ? {flex: 'none', width: targetWidth} : {minWidth, maxWidth}),\n [minWidth, maxWidth, targetWidth],\n )\n\n return (\n <Root as={forwardedAs} {...restProps} ref={setElement} style={style}>\n {resizerPosition === 'left' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"left\" />\n )}\n {children}\n {resizerPosition === 'right' && (\n <Resizer onResize={handleResize} onResizeStart={handleResizeStart} position=\"right\" />\n )}\n </Root>\n )\n}\n","import {useMemo} from 'react'\n\nimport {useSource} from '../../studio/source'\nimport {\n type DocumentActionsContext,\n type DocumentActionsVersionType,\n type PartialContext,\n} from '../types'\nimport {type DocumentActionKeys} from './actions'\n\nconst NO_ACTION_IDS: ReadonlySet<keyof DocumentActionKeys> = new Set()\n\n/**\n * Resolves the set of configured document action identifiers for a given\n * document context. Reflects `document.actions` filtering from the studio\n * config (and plugins), so callers can hide surfaces that mirror those\n * actions — for example the version chip / document group inventory context menu.\n *\n * @internal\n */\nexport function useConfiguredDocumentActionIds(\n context: PartialContext<DocumentActionsContext> | null,\n): ReadonlySet<keyof DocumentActionKeys> {\n // oxlint-disable-next-line no-deprecated -- deprecated for external consumers; the document pane resolves document.actions from this same source instance\n const source = useSource()\n const resolveDocumentActions = source.document.actions\n\n const schemaType = context?.schemaType\n const documentId = context?.documentId\n const versionType = context?.versionType\n const releaseId = context?.releaseId\n\n return useMemo(() => {\n // Resolving without an identity would hand a `ctx.schemaType` predicate an undefined value.\n if (schemaType === undefined || versionType === undefined) return NO_ACTION_IDS\n\n const configured = resolveDocumentActions({\n schemaType,\n documentId,\n versionType,\n releaseId,\n })\n return new Set(configured.flatMap(({action}) => (action ? [action] : [])))\n }, [schemaType, documentId, versionType, releaseId, resolveDocumentActions])\n}\n\n/**\n * Resolves the document-actions version type from pane or chip flags.\n *\n * Callers pass `isScheduledDraft`. Do not look the release up here: the chip's\n * `releases` prop is notCurrentReleases and the chip's own release is absent from it.\n *\n * @internal\n */\nexport function getDocumentVersionType(options: {\n isRevision?: boolean\n isScheduledDraft?: boolean\n isVersionDocument?: boolean\n perspectiveName?: string\n draftsEnabled?: boolean\n}): DocumentActionsVersionType {\n const {\n isRevision = false,\n isScheduledDraft = false,\n isVersionDocument = false,\n perspectiveName,\n draftsEnabled = false,\n } = options\n\n if (isRevision) return 'revision'\n if (isScheduledDraft) return 'scheduled-draft'\n if (isVersionDocument) return 'version'\n if (perspectiveName === 'published') return 'published'\n if (draftsEnabled) return 'draft'\n return 'published'\n}\n\nfunction isReleaseBundleId(bundleId: string): boolean {\n return bundleId !== 'published' && bundleId !== 'draft'\n}\n\n/**\n * Derives the document-actions context for a version chip / inventory row\n * context menu from the chip's release identity.\n *\n * @internal\n */\nexport function getVersionContextMenuActionsContext(options: {\n schemaType: string\n documentGroupId: string\n fromRelease: string\n isScheduledDraft?: boolean\n}): PartialContext<DocumentActionsContext> {\n const {schemaType, documentGroupId, fromRelease, isScheduledDraft = false} = options\n\n const isRelease = isReleaseBundleId(fromRelease)\n\n const versionType = getDocumentVersionType({\n isScheduledDraft,\n isVersionDocument: isRelease,\n perspectiveName: fromRelease,\n draftsEnabled: true,\n })\n\n const releaseId = isRelease ? fromRelease : undefined\n\n return {schemaType, documentId: documentGroupId, versionType, releaseId}\n}\n\n/**\n * The document action identifier that corresponds to discarding the version\n * represented by a context menu (draft discard vs version discard).\n *\n * @internal\n */\nexport function getDiscardDocumentActionId(options: {\n fromRelease: string\n isScheduledDraft?: boolean\n}): keyof DocumentActionKeys | null {\n const {fromRelease, isScheduledDraft = false} = options\n\n if (fromRelease === 'published') return null\n if (fromRelease === 'draft') {\n return isScheduledDraft ? 'discardVersion' : 'discardChanges'\n }\n return 'discardVersion'\n}\n","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\ntype FeatureAttributes = Record<string, string | number | boolean | null>\n\ninterface Feature {\n id: string\n variantId: string\n name: string\n price: number\n included: boolean\n attributes: FeatureAttributes\n}\n\ninterface FeatureType {\n id: string\n name: string\n singular: boolean\n features: Feature[]\n}\n\ninterface Resource {\n id: string\n name: string\n unit: string\n type: string\n quota: number | null\n custom: boolean\n overageAllowed: boolean\n overageChunkSize: number\n overageChunkPrice: number\n maxOverageQuota: number | null\n}\n\ninterface Plan {\n id: string\n planTypeId: string\n variantId: string | null\n productType: string\n variantOfPlanId: string | null\n name: string\n variantName: string | null\n price: number\n trialDays: number\n createdAt: string\n supersededAt: string | null\n default: boolean\n public: boolean\n orderable: boolean\n isBasePlan: boolean\n pricingModel: string\n resources: Record<string, Resource>\n featureTypes: Record<string, FeatureType>\n}\n\n/**\n * @internal\n */\nexport interface ProjectSubscriptionsResponse {\n id: string\n projectId: string\n productType: string\n productId: string\n customerId: string | null\n planId: string\n previousSubscriptionId: string | null\n status: string\n startedAt: string\n startedBy: string\n endedAt: string\n endedBy: string\n trialUntil: string | null\n plan: Plan\n resources: Record<string, Resource>\n featureTypes: Record<string, FeatureType>\n}\n\ninterface ProjectSubscriptions {\n error: Error | null\n projectSubscriptions: ProjectSubscriptionsResponse | null\n isLoading: boolean\n}\n\nconst INITIAL_LOADING_STATE: ProjectSubscriptions = {\n error: null,\n projectSubscriptions: null,\n isLoading: true,\n}\n\n/**\n * @internal\n * fetches subscriptions for this project\n */\nfunction fetchProjectSubscriptions({\n versionedClient,\n}: {\n versionedClient: SanityClient\n}): Observable<ProjectSubscriptionsResponse> {\n return versionedClient.observable.request<ProjectSubscriptionsResponse>({\n url: `/subscriptions/project/${versionedClient.config().projectId}`,\n tag: 'project-subscriptions',\n })\n}\n\nconst cachedProjectSubscriptionsRequest = new Map<\n string,\n Observable<ProjectSubscriptionsResponse>\n>()\n\n/** @internal */\nexport function useProjectSubscriptions(): ProjectSubscriptions {\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 if (!cachedProjectSubscriptionsRequest.get(projectId)) {\n const projectSubscriptions = fetchProjectSubscriptions({versionedClient}).pipe(shareReplay())\n cachedProjectSubscriptionsRequest.set(projectId, projectSubscriptions)\n }\n\n const projectSubscriptionsObservable = useMemo(() => {\n const projectSubscriptions$ = cachedProjectSubscriptionsRequest.get(projectId)\n\n if (!projectSubscriptions$)\n return of<ProjectSubscriptions>({\n isLoading: false,\n error: null,\n projectSubscriptions: null,\n })\n\n return projectSubscriptions$.pipe(\n map((cachedSubscriptions) => ({\n isLoading: false,\n projectSubscriptions: cachedSubscriptions,\n error: null,\n })),\n startWith(INITIAL_LOADING_STATE),\n catchError((error: Error) =>\n of<ProjectSubscriptions>({\n isLoading: false,\n projectSubscriptions: null,\n error,\n }),\n ),\n )\n }, [projectId])\n\n return useObservable(projectSubscriptionsObservable, INITIAL_LOADING_STATE)\n}\n","import {type EditableReleaseDocument} from '@sanity/client'\nimport {isPast} from 'date-fns/isPast'\n\n/** @internal */\nexport const getIsScheduledDateInPast = (value: EditableReleaseDocument) =>\n Boolean(\n value.metadata.releaseType === 'scheduled' &&\n value.metadata.intendedPublishAt &&\n isPast(new Date(value.metadata.intendedPublishAt)),\n )\n","import {useMemo} from 'react'\n\nimport {useWorkspace} from '../workspace'\n\nexport function useEnvAwareSanityWebsiteUrl() {\n const {getClient} = useWorkspace()\n return useMemo(() => {\n const apiHost = getClient({apiVersion: '2025-08-15'}).config().apiHost\n return apiHost.endsWith('.work') ? 'https://www.sanity.work' : 'https://www.sanity.io'\n }, [getClient])\n}\n","/**\n * @internal\n */\nexport const getDashboardPath = ({\n organizationId,\n dashboardDomain,\n appId,\n workspaceName,\n}: {\n dashboardDomain: string\n organizationId: string\n appId: string\n workspaceName: string\n}) => `${dashboardDomain}/@${organizationId}/studio/${appId}/${workspaceName}`\n","import {useCallback, useMemo} from 'react'\n\nimport {useProjectOrganizationId} from '../store/project/useProjectOrganizationId'\nimport {useRenderingContext} from '../store/renderingContext/useRenderingContext'\nimport {useStudioAppIdStore} from '../store/studio-app/useStudioAppIdStore'\nimport {useActiveWorkspace} from '../studio/activeWorkspaceMatcher/useActiveWorkspace'\nimport {useEnvAwareSanityWebsiteUrl} from '../studio/hooks/useEnvAwareSanityWebsiteUrl'\nimport {getDashboardPath} from '../util/dashboardPath'\n\ntype StudioUrlBuilder = (url: string) => string\ntype StudioUrlModifier = {coreUi?: StudioUrlBuilder; studio?: StudioUrlBuilder} & (\n | {coreUi: StudioUrlBuilder}\n | {studio: StudioUrlBuilder}\n)\n\ninterface UseStudioUrlReturnType {\n studioUrl: string\n buildStudioUrl: (modifiers: StudioUrlModifier) => string\n buildIntentUrl: (intentLink: string) => string\n}\n\n/**\n * @internal\n */\nexport const useStudioUrl = (defaultUrl?: string): UseStudioUrlReturnType => {\n const renderingContext = useRenderingContext()\n const {studioApp, loading: appIdLoading} = useStudioAppIdStore({\n enabled: true,\n })\n const {activeWorkspace} = useActiveWorkspace()\n const {value: organizationId, loading: organizationIdLoading} = useProjectOrganizationId()\n const isLoading = appIdLoading || organizationIdLoading\n const isCoreUi = renderingContext?.name === 'coreUi'\n const sanityWebsiteUrl = useEnvAwareSanityWebsiteUrl()\n\n const appId = studioApp?.appId || ''\n const studioUrl = useMemo(() => {\n if (!isCoreUi || isLoading || !appId || !organizationId) {\n return defaultUrl || window.location.origin\n }\n\n return getDashboardPath({\n dashboardDomain: sanityWebsiteUrl,\n organizationId,\n appId: appId,\n workspaceName: activeWorkspace.name,\n })\n }, [\n activeWorkspace.name,\n defaultUrl,\n isCoreUi,\n isLoading,\n organizationId,\n appId,\n sanityWebsiteUrl,\n ])\n\n const basePath = activeWorkspace.basePath\n\n const buildStudioUrl = useCallback(\n ({coreUi, studio}: StudioUrlModifier) => {\n const urlModifier = isCoreUi ? coreUi : studio\n\n return urlModifier?.(studioUrl) || studioUrl\n },\n [isCoreUi, studioUrl],\n )\n\n const buildIntentUrl = useCallback(\n (intentLink: string) => {\n if (isCoreUi && basePath !== '/') {\n return `${studioUrl}${intentLink.slice(basePath.length)}`\n }\n return `${studioUrl}${intentLink}`\n },\n [basePath, isCoreUi, studioUrl],\n )\n\n return {\n buildIntentUrl,\n buildStudioUrl,\n studioUrl,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,MAAM,4BAAY,IAAI,QAAoD;AAE1E,IAAI,UAAU;;AAGd,SAAgB,UAAgB,YAAoD;CAClF,IAAM,WAAW,UAAU,IAAI,UAAU;CAEzC,IAAI,UAAU,OAAO;CAErB,IAAM,KAAK,GAAI,WAAmB,eAAe,WAAW,QAAQ,cAAc,GAAG;CAIrF,OAFA,UAAU,IAAI,YAAY,EAAE,GAErB;AACT;ACbA,SAAgB,yBAAsC,EACpD,MAAM,SACN,MAIC;CACD,IAAM,sBAAA,OAMA;gBANsB,EAC1B,MACA,eAF0BA,IAOpB,YAAY,QAAQ,IAAI,GAEpBC,IAMPC;EAEH,OANI,EAAA,OAAA,cAAA,EAAA,OADE,aADI,WAAM;GACd,AAAI,YACF,WAAW,IAAI;IAAC,GAAG;IAAW,QAAQ,QAAQ;GAAM,CAAC,IAErD,WAAW,IAAI,SAAS;EAE5B,GAAG,KAAA,CAAC,YAAY,SAAS,GAJrB,EAAA,KAAA,YADE,EAAA,KAAA,2DADN,UAAUD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,OAAO,SAAS;GAArC,MAAA;EACF;EAEOC,IAAAA;EAAP,AAIiCC,EAAAA,OAAAA,gBAAAA,QAAAA,EAAAA,OADxB,SAAA,EAAA,OADP,kBAAA,EAAA,OADiB,oBADZ,KAAA,iBAAiB;GACtB,iBAAiB;GACjB;GACO;GACP,eAAe,gBAAgB;EACjC,CAAC,GADgCA,EAAAA,KAAAA,gBAAAA,MADxB,EAAA,KAAA,OADP,EAAA,KAAA,gBADiB,EAAA,KAAA,0CADnB,KAAOD;;CALT,IAAM,YAAYD,IAqBZ,WAAW,gBAAgB,UAG/BG;CACsB,AAAA,EAAA,OAAA,YAAA,EAAA,OAEC,aAHvB,MAAA,OAAyC;EAAxC,IAAA,EAAC,QAAQ,WAATC;EAGC,QAFoB,WAAW,SAAS,OAAA,GAEnB,SAAS,KAAK;CACrC,GAHsB,EAAA,KAAA,UAEC,EAAA,KAAA;CAJzB,IAAM,iBAAiBC,IAUrBC;CACkB,AAAA,EAAA,OAAA,YAAA,EAAA,QAAZ,YAAA,EAAA,QACQ,aAFd,MAAC,eACK,YAAY,aAAa,MACpB,GAAG,YAAY,WAAW,MAAM,SAAS,MAAM,MAEjD,GAAG,YAAY,cAHN,EAAA,KAAA,UAAZ,EAAA,MAAA,UACQ,EAAA,MAAA;CAHhB,IAAM,iBAAiBC,IAUhBC;CAAP,OACE,EAAA,QAAA,kBAAA,EAAA,QACA,kBAAA,EAAA,QACA,aAHK,KAAA;EACL;EACA;EACA;CACF,GAHE,EAAA,MAAA,gBACA,EAAA,MAAA,gBACA,EAAA,MAAA,qCAHKA;AAKT"}
|
|
@@ -8,7 +8,7 @@ import { TasksNavigationContext } from "sanity/_singletons";
|
|
|
8
8
|
const tasksLocaleNamespace = "tasks", tasksUsEnglishLocaleBundle = {
|
|
9
9
|
locale: "en-US",
|
|
10
10
|
namespace: tasksLocaleNamespace,
|
|
11
|
-
resources: () => import("./resources-
|
|
11
|
+
resources: () => import("./resources-Bw1bpPhG.js")
|
|
12
12
|
};
|
|
13
13
|
function useTasksNavigation() {
|
|
14
14
|
return useContext(TasksNavigationContext) || FALLBACK_CONTEXT_VALUE;
|
|
@@ -29,4 +29,4 @@ const FALLBACK_CONTEXT_VALUE = {
|
|
|
29
29
|
};
|
|
30
30
|
export { tasksLocaleNamespace as n, tasksUsEnglishLocaleBundle as r, useTasksNavigation as t };
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=useTasksNavigation-
|
|
32
|
+
//# sourceMappingURL=useTasksNavigation-tAXFJd2V.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTasksNavigation-
|
|
1
|
+
{"version":3,"file":"useTasksNavigation-tAXFJd2V.js","names":[],"sources":["../src/core/tasks/i18n/index.ts","../src/core/tasks/context/navigation/useTasksNavigation.ts"],"sourcesContent":["import {type LocaleResourceBundle} from '../../i18n/types'\n\n/**\n * The locale namespace for the task tool\n *\n * @public\n */\nexport const tasksLocaleNamespace = 'tasks' as const\n\n/**\n * The default locale bundle for the task tool, which is US English.\n *\n * @internal\n */\nexport const tasksUsEnglishLocaleBundle: LocaleResourceBundle = {\n locale: 'en-US',\n namespace: tasksLocaleNamespace,\n resources: () => import('./resources'),\n}\n","import {useContext} from 'react'\nimport {TasksNavigationContext} from 'sanity/_singletons'\n\nimport {type TasksNavigationContextValue} from './types'\n\nexport function useTasksNavigation(): TasksNavigationContextValue {\n const context = useContext(TasksNavigationContext)\n\n if (!context) {\n // Providers are not mounted when tasks enabled is disabled, but we still need to provide a\n // default value for the context to avoid runtime errors in `TasksFooterAction` and `TaskCreateAction`\n return FALLBACK_CONTEXT_VALUE\n }\n\n return context\n}\n\nconst FALLBACK_CONTEXT_VALUE = {\n state: {\n activeTabId: 'assigned',\n viewMode: 'list',\n selectedTask: null,\n isOpen: false,\n duplicateTaskValues: null,\n },\n setActiveTab: () => null,\n setViewMode: () => null,\n handleCloseTasks: () => null,\n handleCopyLinkToTask: () => null,\n handleOpenTasks: () => null,\n} satisfies TasksNavigationContextValue\n"],"mappings":";;;;;;;AAOA,MAAa,uBAAuB,SAOvB,6BAAmD;CAC9D,QAAQ;CACR,WAAW;CACX,iBAAiB,OAAO;AAC1B;ACbA,SAAgB,qBAAkD;CAShE,OARgB,WAAW,sBAEtB,KAGI;AAIX;AAEA,MAAM,yBAAyB;CAC7B,OAAO;EACL,aAAa;EACb,UAAU;EACV,cAAc;EACd,QAAQ;EACR,qBAAqB;CACvB;CACA,oBAAoB;CACpB,mBAAmB;CACnB,wBAAwB;CACxB,4BAA4B;CAC5B,uBAAuB;AACzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as useKeyValueStore } from "./datastores-
|
|
1
|
+
import { s as useKeyValueStore } from "./datastores-DNOJm1LF.js";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -234,4 +234,4 @@ function _temp(timeZone) {
|
|
|
234
234
|
}
|
|
235
235
|
export { debugWithName as n, DATE_FORMAT as r, useTimeZone as t };
|
|
236
236
|
|
|
237
|
-
//# sourceMappingURL=useTimeZone-
|
|
237
|
+
//# sourceMappingURL=useTimeZone-Dj7C8tfZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTimeZone-DM8ZmUO2.js","names":["<CalendarIcon />","title && (\n <Text size={2} weight=\"semibold\">\n {title}\n </Text>\n )","<Inline gap={2}>\n <CalendarIcon />\n {title && (\n <Text size={2} weight=\"semibold\">\n {title}\n </Text>\n )}\n </Inline>","body && <Text size={1}>{body}</Text>","<Stack paddingY={1} gap={3}>\n <Inline gap={2}>\n <CalendarIcon />\n {title && (\n <Text size={2} weight=\"semibold\">\n {title}\n </Text>\n )}\n </Inline>\n {body && <Text size={1}>{body}</Text>}\n </Stack>","() => {\n if (scope.type === 'scheduledPublishing') {\n const legacyKey = 'scheduled-publishing::time-zone'\n // the original value was kept as an object with the name\n const legacyValue = localStorage.getItem(legacyKey)\n\n if (legacyValue) {\n // Migrate the value to key-value store\n const scheduledPublishingValue = JSON.parse(legacyValue)\n void keyValueStore.setKey(keyStoreId, scheduledPublishingValue.name)\n // Remove the legacy key\n localStorage.removeItem(legacyKey)\n }\n }\n // oxlint-disable-next-line react/exhaustive-effect-dependencies -- pre-existing violation, to be fixed in a follow-up\n }","type","[scope.type, keyValueStore, keyStoreId, currentLocale, relativeDate]","getGloballyCachedTimeZones(currentLocale, relativeDate)","useMemo(() => {\n return getGloballyCachedTimeZones(currentLocale, relativeDate)\n }, [currentLocale, relativeDate])","(): NormalizedTimeZone | undefined => {\n const normalizedDefaultTimezone = defaultTimeZone\n ? allTimeZones.find((tz: NormalizedTimeZone) => tz.name === defaultTimeZone)\n : undefined\n return normalizedDefaultTimezone\n }","useCallback((): NormalizedTimeZone | undefined => {\n const normalizedDefaultTimezone = defaultTimeZone\n ? allTimeZones.find((tz: NormalizedTimeZone) => tz.name === defaultTimeZone)\n : undefined\n return normalizedDefaultTimezone\n }, [allTimeZones, defaultTimeZone])","keyValueStore.getKey(keyStoreId).pipe(startWith(null))","useMemo(\n () => keyValueStore.getKey(keyStoreId).pipe(startWith(null)),\n [keyValueStore, keyStoreId],\n )","(): NormalizedTimeZone | undefined => {\n if (!storedTimeZone) return undefined\n\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n const wholeTimeZone = allTimeZones.find((tz) => tz.name === storedTimeZone)\n\n if (\n wholeTimeZone &&\n allTimeZones.some((tz: NormalizedTimeZone) => tz.name === wholeTimeZone.name)\n ) {\n return wholeTimeZone\n }\n\n const fallbackTimeZone = allTimeZones.find((tz) => tz.offset === wholeTimeZone?.offset)\n if (fallbackTimeZone) {\n void keyValueStore.setKey(keyStoreId, fallbackTimeZone.name)\n return fallbackTimeZone\n }\n return undefined\n }\n try {\n return run()\n } catch {\n return undefined\n }\n }","tz","useCallback((): NormalizedTimeZone | undefined => {\n if (!storedTimeZone) return undefined\n\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n const wholeTimeZone = allTimeZones.find((tz) => tz.name === storedTimeZone)\n\n if (\n wholeTimeZone &&\n allTimeZones.some((tz: NormalizedTimeZone) => tz.name === wholeTimeZone.name)\n ) {\n return wholeTimeZone\n }\n\n const fallbackTimeZone = allTimeZones.find((tz) => tz.offset === wholeTimeZone?.offset)\n if (fallbackTimeZone) {\n void keyValueStore.setKey(keyStoreId, fallbackTimeZone.name)\n return fallbackTimeZone\n }\n return undefined\n }\n try {\n return run()\n } catch {\n return undefined\n }\n }, [allTimeZones, keyStoreId, keyValueStore, storedTimeZone])","(): NormalizedTimeZone => {\n const localTzName = Intl.DateTimeFormat().resolvedOptions().timeZone\n const foundLocal = allTimeZones.find((tz) => tz.name === localTzName)\n if (foundLocal) return foundLocal\n\n // Fallback\n const gmt = allTimeZones.find((timeZone) => timeZone.abbreviation === 'GMT')\n if (gmt) return gmt\n\n return allTimeZones[0]\n }","(timeZone) => timeZone.abbreviation === 'GMT'","useCallback((): NormalizedTimeZone => {\n const localTzName = Intl.DateTimeFormat().resolvedOptions().timeZone\n const foundLocal = allTimeZones.find((tz) => tz.name === localTzName)\n if (foundLocal) return foundLocal\n\n // Fallback\n const gmt = allTimeZones.find((timeZone) => timeZone.abbreviation === 'GMT')\n if (gmt) return gmt\n\n return allTimeZones[0]\n }, [allTimeZones])","(): NormalizedTimeZone => {\n return getStoredTimeZone() || getDefaultTimeZone() || getLocalTimeZone()\n }","useCallback((): NormalizedTimeZone => {\n return getStoredTimeZone() || getDefaultTimeZone() || getLocalTimeZone()\n }, [getStoredTimeZone, getDefaultTimeZone, getLocalTimeZone])","() => getInitialTimeZone()","timeZone","[getInitialTimeZone]","() => {\n // oxlint-disable-next-line react/no-deriving-state-in-effects, react/set-state-in-effect -- @todo fix later\n setTimeZone(getInitialTimeZone())\n }","() => {\n const handler = () => {\n setTimeZone(getInitialTimeZone())\n }\n\n window.addEventListener(TimeZoneEvents.update, handler)\n return () => {\n window.removeEventListener(TimeZoneEvents.update, handler)\n }\n }","({\n date,\n format = DATE_FORMAT.LARGE,\n includeTimeZone,\n prefix,\n }: {\n date: Date\n format?: string\n includeTimeZone?: boolean\n prefix?: string\n }) => {\n let dateFormat = format\n if (prefix) {\n dateFormat = `'${prefix}'${format}`\n }\n if (includeTimeZone) {\n dateFormat = `${format} (zzzz)`\n }\n return dateFnsFormat(date, dateFormat, {\n in: tzHelper(timeZone?.name || getLocalTimeZone()?.name || 'UTC'),\n })\n }","name","{\n date,\n format = DATE_FORMAT.LARGE,\n includeTimeZone,\n prefix,\n }: {\n date: Date\n format?: string\n includeTimeZone?: boolean\n prefix?: string\n }","format = DATE_FORMAT.LARGE","useCallback(\n ({\n date,\n format = DATE_FORMAT.LARGE,\n includeTimeZone,\n prefix,\n }: {\n date: Date\n format?: string\n includeTimeZone?: boolean\n prefix?: string\n }) => {\n let dateFormat = format\n if (prefix) {\n dateFormat = `'${prefix}'${format}`\n }\n if (includeTimeZone) {\n dateFormat = `${format} (zzzz)`\n }\n return dateFnsFormat(date, dateFormat, {\n in: tzHelper(timeZone?.name || getLocalTimeZone()?.name || 'UTC'),\n })\n },\n [timeZone, getLocalTimeZone],\n )","() => {\n if (!timeZone) return new Date()\n return new TZDate(new Date(), timeZone.name)\n }","useCallback(() => {\n if (!timeZone) return new Date()\n return new TZDate(new Date(), timeZone.name)\n }, [timeZone])","(tzValue: string): NormalizedTimeZone =>\n allTimeZones.find((tz) => tzValue === tz.value) || getInitialTimeZone()","useCallback(\n (tzValue: string): NormalizedTimeZone =>\n allTimeZones.find((tz) => tzValue === tz.value) || getInitialTimeZone(),\n [allTimeZones, getInitialTimeZone],\n )","(tz: NormalizedTimeZone) => {\n debug('handleNewValue:', tz)\n\n setTimeZone((prevTz) => {\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n if (prevTz?.name !== tz.name) {\n void keyValueStore.setKey(keyStoreId, tz.name)\n window.dispatchEvent(new Event(TimeZoneEvents.update))\n }\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription\n body={`${tz.alternativeName} (${tz.namePretty})`}\n title=\"Time zone updated\"\n />\n ),\n duration: 15000,\n status: 'info',\n })\n }\n try {\n run()\n } catch (err) {\n console.error(err)\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription body={getErrorMessage(err)} title=\"Unable to update time zone\" />\n ),\n status: 'error',\n })\n }\n\n return tz\n })\n }","run","err","useCallback(\n (tz: NormalizedTimeZone) => {\n debug('handleNewValue:', tz)\n\n setTimeZone((prevTz) => {\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n if (prevTz?.name !== tz.name) {\n void keyValueStore.setKey(keyStoreId, tz.name)\n window.dispatchEvent(new Event(TimeZoneEvents.update))\n }\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription\n body={`${tz.alternativeName} (${tz.namePretty})`}\n title=\"Time zone updated\"\n />\n ),\n duration: 15000,\n status: 'info',\n })\n }\n try {\n run()\n } catch (err) {\n console.error(err)\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription body={getErrorMessage(err)} title=\"Unable to update time zone\" />\n ),\n status: 'error',\n })\n }\n\n return tz\n })\n },\n [keyStoreId, toast, keyValueStore],\n )","(date: Date) => {\n if (!timeZone) return date\n return new TZDate(date, timeZone.name)\n }","date","useCallback(\n (date: Date) => {\n if (!timeZone) return date\n return new TZDate(date, timeZone.name)\n },\n [timeZone],\n )","(date: Date) => {\n if (!timeZone) return date\n // Create a TZDate by interpreting the date components as being in the timezone\n const tzDate = createTZDateFromComponents(date, timeZone.name)\n // Convert to regular Date to save as UTC instead of preserving timezone offset\n const utcDate = new Date(tzDate)\n return utcDate\n }","useCallback(\n (date: Date) => {\n if (!timeZone) return date\n // Create a TZDate by interpreting the date components as being in the timezone\n const tzDate = createTZDateFromComponents(date, timeZone.name)\n // Convert to regular Date to save as UTC instead of preserving timezone offset\n const utcDate = new Date(tzDate)\n return utcDate\n },\n [timeZone],\n )","{\n formatDateTz,\n getCurrentZoneDate,\n setTimeZone: handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n }","useMemo(\n () => ({\n formatDateTz,\n getCurrentZoneDate,\n setTimeZone: handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n }),\n [\n formatDateTz,\n getCurrentZoneDate,\n handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n ],\n )"],"sources":["../src/core/studio/timezones/constants.tsx","../src/core/studio/timezones/toastDescription/ToastDescription.tsx","../src/core/studio/timezones/utils/debug.ts","../src/core/hooks/useTimeZone.tsx"],"sourcesContent":["// date-fns compatible date formats\n// https://date-fns.org/v2.28.0/docs/format\nexport const DATE_FORMAT = {\n // 1 Oct 22, 10:00 PM\n SMALL: `d MMM yy',' p`,\n // 1 October 2022, 10:00 PM\n MEDIUM: `d MMMM yyyy',' p`,\n // Saturday, 1 October 2022, 10:00 PM\n LARGE: `iiii',' d MMMM yyyy',' p`,\n}\n","import {CalendarIcon} from '@sanity/icons/Calendar'\nimport {Inline, Stack, Text} from '@sanity/ui'\n\ninterface Props {\n body?: string\n title: string\n}\n\nconst ToastDescription = (props: Props) => {\n const {body, title} = props\n return (\n <Stack paddingY={1} gap={3}>\n <Inline gap={2}>\n <CalendarIcon />\n {title && (\n <Text size={2} weight=\"semibold\">\n {title}\n </Text>\n )}\n </Inline>\n {body && <Text size={1}>{body}</Text>}\n </Stack>\n )\n}\n\nexport default ToastDescription\n","import {createDebug, enabled, type Debugger} from 'obug'\n\nconst rootName = 'scheduled-publishing:'\n\nexport function debugWithName(name: string): Debugger {\n const namespace = `${rootName}${name}`\n if (enabled(namespace)) {\n return createDebug(namespace)\n }\n return createDebug(rootName)\n}\n","import {tz as tzHelper, TZDate} from '@date-fns/tz'\nimport {type ClientError} from '@sanity/client'\nimport {useToast} from '@sanity/ui/toast'\nimport {sanitizeLocale} from '@sanity/util/legacyDateFormat'\nimport {format as dateFnsFormat} from 'date-fns/format'\nimport {useCallback, useEffect, useMemo, useState} from 'react'\nimport {useSyncObservable} from 'react-rx'\nimport {startWith} from 'rxjs/operators'\n\nimport {useKeyValueStore} from '../store/datastores'\nimport {DATE_FORMAT} from '../studio/timezones/constants'\nimport ToastDescription from '../studio/timezones/toastDescription/ToastDescription'\nimport {type NormalizedTimeZone} from '../studio/timezones/types'\nimport {debugWithName} from '../studio/timezones/utils/debug'\n\n/**\n * Helper function to create a TZDate from a Date's components in a specific timezone.\n * This is useful for interpreting local date/time values as being in a specific timezone.\n */\nfunction createTZDateFromComponents(date: Date, timeZone: string): TZDate {\n return new TZDate(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n timeZone,\n )\n}\n\nconst TimeZoneEvents = {\n update: 'timeZoneEventUpdate' as const,\n}\n\nexport type TimeZoneScopeType = 'scheduledPublishing' | 'contentReleases' | 'input'\n\ntype NoIdRequiredTypes = 'scheduledPublishing' | 'contentReleases'\ntype IdRequiredTypes = 'input'\n\ntype ReleasesOrScheduledPublishingScope = {\n type: NoIdRequiredTypes\n defaultTimeZone?: string\n}\n\ntype InputScope = {\n type: IdRequiredTypes\n id: string\n defaultTimeZone?: string\n relativeDate?: Date // offsets can change over time, so we use a relative date to get the offset\n}\n\nexport type TimeZoneScope = ReleasesOrScheduledPublishingScope | InputScope\n\nconst debug = debugWithName('useScheduleOperation')\n\nexport const timeZoneLocalStorageNamespace = 'studio.timezone.'\n\nconst timeZoneCache = new Map<string, NormalizedTimeZone[]>()\nconst offsetCache = new Map<\n string,\n {abbreviation: string; alternativeName: string; offset: string}\n>()\n\nconst offsetToMinutes = (offset: string): number => {\n if (!offset) return 0\n const multiplier = offset.startsWith('-') ? -1 : 1\n if (!offset.includes(':')) return multiplier * Number(offset.replace(/[+-]/, '')) * 60\n\n const [hours, minutes] = offset.replace(/[+-]/, '').split(':').map(Number)\n return multiplier * (hours * 60 + minutes)\n}\n\nfunction getCachedTimeZoneInfo(\n locale: string,\n canonicalIdentifier: string,\n relativeDateForZones?: Date,\n): {abbreviation: string; alternativeName: string; offset: string} {\n const dateKey = relativeDateForZones?.toISOString().slice(0, 10) || 'now'\n const cacheKey = `${locale}_${canonicalIdentifier}_${dateKey}`\n // relative date is not used for caching, but it's used to invalidate the cache when it changes\n if (offsetCache.has(cacheKey)) {\n return offsetCache.get(cacheKey)!\n }\n\n const formatter = new Intl.DateTimeFormat(sanitizeLocale(locale), {\n timeZone: canonicalIdentifier,\n timeZoneName: 'long',\n })\n\n const shortFormatter = new Intl.DateTimeFormat(sanitizeLocale(locale), {\n timeZone: canonicalIdentifier,\n timeZoneName: 'short',\n })\n\n const dateToUse = relativeDateForZones ?? new Date()\n const parts = formatter.formatToParts(dateToUse)\n const shortParts = shortFormatter.formatToParts(dateToUse)\n const rawOffset = dateFnsFormat(dateToUse, 'xxx', {in: tzHelper(canonicalIdentifier)})\n // If the offset is +02:00 then we can just show +2, if it has +13:45 then we should show +13:45, remove the leading +0 and just leave a + if a number under 10, remove the :00 at the end\n const offset = rawOffset\n .replace(/([+-])0(\\d)/, '$1$2')\n .replace(/([+-])0$/, '$1')\n .replace(/:00$/, '')\n .replace(/[+]0$/, '')\n\n const info = {\n abbreviation: shortParts.find(({type}) => type === 'timeZoneName')?.value || '',\n alternativeName: parts.find(({type}) => type === 'timeZoneName')?.value || '',\n offset,\n }\n\n offsetCache.set(cacheKey, info)\n return info\n}\n\nfunction computeAllTimeZones(locale: string, relativeDate?: Date): NormalizedTimeZone[] {\n const timeZones = Intl.supportedValuesOf('timeZone')\n .map((tzName): NormalizedTimeZone | null => {\n // Skip if timezone name doesn't contain a city (should have a '/')\n if (!tzName.includes('/')) return null\n\n const {alternativeName, abbreviation, offset} = getCachedTimeZoneInfo(\n locale,\n tzName,\n relativeDate,\n )\n const [, city] = tzName.split('/')\n return {\n abbreviation,\n alternativeName,\n city: city.replaceAll('_', ' '),\n name: tzName,\n namePretty: tzName.replaceAll('_', ' '),\n offset,\n value: `${offset} ${abbreviation} ${tzName} ${alternativeName}`,\n }\n })\n .filter((tz): tz is NormalizedTimeZone => tz !== null)\n .sort(\n (a: NormalizedTimeZone, b: NormalizedTimeZone) =>\n offsetToMinutes(a.offset) - offsetToMinutes(b.offset),\n )\n\n return timeZones\n}\n\nfunction getGloballyCachedTimeZones(locale: string, relativeDate?: Date): NormalizedTimeZone[] {\n const cacheKey = `${locale}_${relativeDate?.toISOString().slice(0, 10) || 'now'}`\n\n if (timeZoneCache.has(cacheKey)) {\n return timeZoneCache.get(cacheKey)!\n }\n\n const computedTimeZones = computeAllTimeZones(locale, relativeDate)\n timeZoneCache.set(cacheKey, computedTimeZones)\n return computedTimeZones\n}\n\nexport const TIME_ZONE_SCOPE_TYPE = {\n scheduledPublishing: 'scheduled-publishing',\n contentReleases: 'content-releases',\n input: 'input',\n}\n\nexport const useTimeZone = (scope: TimeZoneScope) => {\n const toast = useToast()\n const keyValueStore = useKeyValueStore()\n const currentLocale = navigator.language\n const {defaultTimeZone} = scope\n\n // used for the key to match formatting in cellar\n const type = TIME_ZONE_SCOPE_TYPE[scope.type]\n const keyStoreId =\n 'id' in scope\n ? `${timeZoneLocalStorageNamespace}${type}.${scope.id}`\n : `${timeZoneLocalStorageNamespace}${type}`\n const relativeDate = 'relativeDate' in scope ? scope.relativeDate : undefined\n\n // Check for legacy localStorage key and migrate if needed\n // fall back for old way of handling timezones\n useEffect(() => {\n if (scope.type === 'scheduledPublishing') {\n const legacyKey = 'scheduled-publishing::time-zone'\n // the original value was kept as an object with the name\n const legacyValue = localStorage.getItem(legacyKey)\n\n if (legacyValue) {\n // Migrate the value to key-value store\n const scheduledPublishingValue = JSON.parse(legacyValue)\n void keyValueStore.setKey(keyStoreId, scheduledPublishingValue.name)\n // Remove the legacy key\n localStorage.removeItem(legacyKey)\n }\n }\n // oxlint-disable-next-line react/exhaustive-effect-dependencies -- pre-existing violation, to be fixed in a follow-up\n }, [scope.type, keyValueStore, keyStoreId, currentLocale, relativeDate])\n\n const allTimeZones: NormalizedTimeZone[] = useMemo(() => {\n return getGloballyCachedTimeZones(currentLocale, relativeDate)\n }, [currentLocale, relativeDate])\n\n const getDefaultTimeZone = useCallback((): NormalizedTimeZone | undefined => {\n const normalizedDefaultTimezone = defaultTimeZone\n ? allTimeZones.find((tz: NormalizedTimeZone) => tz.name === defaultTimeZone)\n : undefined\n return normalizedDefaultTimezone\n }, [allTimeZones, defaultTimeZone])\n\n const keyValueTimeZone$ = useMemo(\n () => keyValueStore.getKey(keyStoreId).pipe(startWith(null)),\n [keyValueStore, keyStoreId],\n )\n\n // Kept synchronous: `getStoredTimeZone` migrates legacy values by writing\n // back to the key-value store, so a deferred snapshot could trigger stale or\n // redundant writes after the store has already advanced.\n const storedTimeZone = useSyncObservable(keyValueTimeZone$, null)\n\n const getStoredTimeZone = useCallback((): NormalizedTimeZone | undefined => {\n if (!storedTimeZone) return undefined\n\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n const wholeTimeZone = allTimeZones.find((tz) => tz.name === storedTimeZone)\n\n if (\n wholeTimeZone &&\n allTimeZones.some((tz: NormalizedTimeZone) => tz.name === wholeTimeZone.name)\n ) {\n return wholeTimeZone\n }\n\n const fallbackTimeZone = allTimeZones.find((tz) => tz.offset === wholeTimeZone?.offset)\n if (fallbackTimeZone) {\n void keyValueStore.setKey(keyStoreId, fallbackTimeZone.name)\n return fallbackTimeZone\n }\n return undefined\n }\n try {\n return run()\n } catch {\n return undefined\n }\n }, [allTimeZones, keyStoreId, keyValueStore, storedTimeZone])\n\n const getLocalTimeZone = useCallback((): NormalizedTimeZone => {\n const localTzName = Intl.DateTimeFormat().resolvedOptions().timeZone\n const foundLocal = allTimeZones.find((tz) => tz.name === localTzName)\n if (foundLocal) return foundLocal\n\n // Fallback\n const gmt = allTimeZones.find((timeZone) => timeZone.abbreviation === 'GMT')\n if (gmt) return gmt\n\n return allTimeZones[0]\n }, [allTimeZones])\n\n const getInitialTimeZone = useCallback((): NormalizedTimeZone => {\n return getStoredTimeZone() || getDefaultTimeZone() || getLocalTimeZone()\n }, [getStoredTimeZone, getDefaultTimeZone, getLocalTimeZone])\n\n const [timeZone, setTimeZone] = useState<NormalizedTimeZone>(() => getInitialTimeZone())\n\n useEffect(() => {\n // oxlint-disable-next-line react/no-deriving-state-in-effects, react/set-state-in-effect -- @todo fix later\n setTimeZone(getInitialTimeZone())\n }, [getInitialTimeZone])\n\n useEffect(() => {\n const handler = () => {\n setTimeZone(getInitialTimeZone())\n }\n\n window.addEventListener(TimeZoneEvents.update, handler)\n return () => {\n window.removeEventListener(TimeZoneEvents.update, handler)\n }\n }, [getInitialTimeZone])\n\n const formatDateTz = useCallback(\n ({\n date,\n format = DATE_FORMAT.LARGE,\n includeTimeZone,\n prefix,\n }: {\n date: Date\n format?: string\n includeTimeZone?: boolean\n prefix?: string\n }) => {\n let dateFormat = format\n if (prefix) {\n dateFormat = `'${prefix}'${format}`\n }\n if (includeTimeZone) {\n dateFormat = `${format} (zzzz)`\n }\n return dateFnsFormat(date, dateFormat, {\n in: tzHelper(timeZone?.name || getLocalTimeZone()?.name || 'UTC'),\n })\n },\n [timeZone, getLocalTimeZone],\n )\n\n const getCurrentZoneDate = useCallback(() => {\n if (!timeZone) return new Date()\n return new TZDate(new Date(), timeZone.name)\n }, [timeZone])\n\n const getTimeZone = useCallback(\n (tzValue: string): NormalizedTimeZone =>\n allTimeZones.find((tz) => tzValue === tz.value) || getInitialTimeZone(),\n [allTimeZones, getInitialTimeZone],\n )\n\n const handleNewValue = useCallback(\n (tz: NormalizedTimeZone) => {\n debug('handleNewValue:', tz)\n\n setTimeZone((prevTz) => {\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n if (prevTz?.name !== tz.name) {\n void keyValueStore.setKey(keyStoreId, tz.name)\n window.dispatchEvent(new Event(TimeZoneEvents.update))\n }\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription\n body={`${tz.alternativeName} (${tz.namePretty})`}\n title=\"Time zone updated\"\n />\n ),\n duration: 15000,\n status: 'info',\n })\n }\n try {\n run()\n } catch (err) {\n console.error(err)\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription body={getErrorMessage(err)} title=\"Unable to update time zone\" />\n ),\n status: 'error',\n })\n }\n\n return tz\n })\n },\n [keyStoreId, toast, keyValueStore],\n )\n\n const utcToCurrentZoneDate = useCallback(\n (date: Date) => {\n if (!timeZone) return date\n return new TZDate(date, timeZone.name)\n },\n [timeZone],\n )\n\n const zoneDateToUtc = useCallback(\n (date: Date) => {\n if (!timeZone) return date\n // Create a TZDate by interpreting the date components as being in the timezone\n const tzDate = createTZDateFromComponents(date, timeZone.name)\n // Convert to regular Date to save as UTC instead of preserving timezone offset\n const utcDate = new Date(tzDate)\n return utcDate\n },\n [timeZone],\n )\n\n return useMemo(\n () => ({\n formatDateTz,\n getCurrentZoneDate,\n setTimeZone: handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n }),\n [\n formatDateTz,\n getCurrentZoneDate,\n handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n ],\n )\n}\n\n// this is used in place of `instanceof` so the matching can be more robust and\n// won't have any issues with dual packages etc\n// https://nodejs.org/api/packages.html#dual-package-hazard\nfunction isClientError(e: unknown): e is ClientError {\n if (typeof e !== 'object') return false\n if (!e) return false\n return 'statusCode' in e && 'response' in e\n}\n\nfunction getErrorMessage(err: unknown): string {\n let message\n\n if (isClientError(err)) {\n // The request was made and the server responded with a status code\n if (err.response.statusCode === 403) {\n message = 'Forbidden. Please check that your project has access to the feature.'\n } else {\n message = err.message\n }\n } else {\n if (err instanceof Error) {\n message = err.message\n }\n message = String(err)\n }\n\n return message\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAa,cAAc;CAEzB,OAAO;CAEP,QAAQ;CAER,OAAO;AACT,GCDM,oBAAoB,UAAiB;gBACnC,EAAC,MAAM,UAAS,OAIhBA;qDAAC,KAAA,oBAAA,cAAD,CAAe,CAAA;CACdC,IAAAA;+BACC,KAAA,SAAA,oBAAC,MAAD;EAAM,MAAM;EAAG,QAAO;EACnB,UAAA;CACG,CAAA,GAHP,EAAA,KAAA;CAFHC,IAAAA;CAEGD,AAAAA,EAAAA,OAAAA,kBAFH,KAAA,qBAAC,QAAD;EAAQ,KAAK;EAAb,UAAA,CACED,IACCC,EAKK;KALLA,EAAAA,KAAAA;CAMFE,IAAAA;8BAAQ,KAAA,QAAA,oBAAC,MAAD;EAAM,MAAM;EAAI,UAAA;CAAW,CAAA,GAAnC,EAAA,KAAA;CATHC,IAAAA;CADF,OAEIF,EAAAA,OAAAA,MAAAA,EAAAA,OAQCC,MATH,KAAA,qBAAC,OAAD;EAAO,UAAU;EAAG,KAAK;EAAzB,UAAA,CACED,IAQCC,EACI;KATLD,EAAAA,KAAAA,IAQCC,EAAAA,KAAAA,4BATHC;AAYJ,GCrBM,WAAW;AAEjB,SAAgB,cAAc,MAAwB;CACpD,IAAM,YAAY,GAAG,WAAW;CAIhC,OAHI,QAAQ,SAAS,IACZ,YAAY,SAAS,IAEvB,YAAY,QAAQ;AAC7B;;;;;ACSA,SAAS,2BAA2B,MAAY,UAA0B;CACxE,OAAO,IAAI,OACT,KAAK,YAAY,GACjB,KAAK,SAAS,GACd,KAAK,QAAQ,GACb,KAAK,SAAS,GACd,KAAK,WAAW,GAChB,KAAK,WAAW,GAChB,KAAK,gBAAgB,GACrB,QACF;AACF;AAEA,MAAM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A;EACA;EACA;EACA;EACA;CACF,GALE,EAAA,MAAA,cAJA,EAAA,MAAA,cACA,EAAA,MAAA,oBAIA,EAAA,MAAA,kBACA,EAAA,MAAA,aAJa,EAAA,MAAA,gBACbA,EAAAA,MAAAA,YAIA,EAAA,MAAA,sBACA,EAAA,MAAA,2CAVGuB;AAwBT;AAKA,SAAS,cAAc,GAA8B;CAGnD,OAFI,OAAO,KAAM,YACb,CAAC,IAAU,KACR,gBAAgB,KAAK,cAAc;AAC5C;AAEA,SAAS,gBAAgB,KAAsB;CAC7C,IAAI;CAgBJ,OAdI,cAAc,GAAG,IAEnB,AAGE,UAHE,IAAI,SAAS,eAAe,MACpB,yEAEA,IAAI,WAGZ,eAAe,UACjB,UAAU,IAAI,UAEhB,UAAU,OAAO,GAAG,IAGf;AACT;AAtLkC,SAAA,MAAC,UAAA;CAAa,OAAA,SAAS,iBAAiB"}
|
|
1
|
+
{"version":3,"file":"useTimeZone-Dj7C8tfZ.js","names":["<CalendarIcon />","title && (\n <Text size={2} weight=\"semibold\">\n {title}\n </Text>\n )","<Inline gap={2}>\n <CalendarIcon />\n {title && (\n <Text size={2} weight=\"semibold\">\n {title}\n </Text>\n )}\n </Inline>","body && <Text size={1}>{body}</Text>","<Stack paddingY={1} gap={3}>\n <Inline gap={2}>\n <CalendarIcon />\n {title && (\n <Text size={2} weight=\"semibold\">\n {title}\n </Text>\n )}\n </Inline>\n {body && <Text size={1}>{body}</Text>}\n </Stack>","() => {\n if (scope.type === 'scheduledPublishing') {\n const legacyKey = 'scheduled-publishing::time-zone'\n // the original value was kept as an object with the name\n const legacyValue = localStorage.getItem(legacyKey)\n\n if (legacyValue) {\n // Migrate the value to key-value store\n const scheduledPublishingValue = JSON.parse(legacyValue)\n void keyValueStore.setKey(keyStoreId, scheduledPublishingValue.name)\n // Remove the legacy key\n localStorage.removeItem(legacyKey)\n }\n }\n // oxlint-disable-next-line react/exhaustive-effect-dependencies -- pre-existing violation, to be fixed in a follow-up\n }","type","[scope.type, keyValueStore, keyStoreId, currentLocale, relativeDate]","getGloballyCachedTimeZones(currentLocale, relativeDate)","useMemo(() => {\n return getGloballyCachedTimeZones(currentLocale, relativeDate)\n }, [currentLocale, relativeDate])","(): NormalizedTimeZone | undefined => {\n const normalizedDefaultTimezone = defaultTimeZone\n ? allTimeZones.find((tz: NormalizedTimeZone) => tz.name === defaultTimeZone)\n : undefined\n return normalizedDefaultTimezone\n }","useCallback((): NormalizedTimeZone | undefined => {\n const normalizedDefaultTimezone = defaultTimeZone\n ? allTimeZones.find((tz: NormalizedTimeZone) => tz.name === defaultTimeZone)\n : undefined\n return normalizedDefaultTimezone\n }, [allTimeZones, defaultTimeZone])","keyValueStore.getKey(keyStoreId).pipe(startWith(null))","useMemo(\n () => keyValueStore.getKey(keyStoreId).pipe(startWith(null)),\n [keyValueStore, keyStoreId],\n )","(): NormalizedTimeZone | undefined => {\n if (!storedTimeZone) return undefined\n\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n const wholeTimeZone = allTimeZones.find((tz) => tz.name === storedTimeZone)\n\n if (\n wholeTimeZone &&\n allTimeZones.some((tz: NormalizedTimeZone) => tz.name === wholeTimeZone.name)\n ) {\n return wholeTimeZone\n }\n\n const fallbackTimeZone = allTimeZones.find((tz) => tz.offset === wholeTimeZone?.offset)\n if (fallbackTimeZone) {\n void keyValueStore.setKey(keyStoreId, fallbackTimeZone.name)\n return fallbackTimeZone\n }\n return undefined\n }\n try {\n return run()\n } catch {\n return undefined\n }\n }","tz","useCallback((): NormalizedTimeZone | undefined => {\n if (!storedTimeZone) return undefined\n\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n const wholeTimeZone = allTimeZones.find((tz) => tz.name === storedTimeZone)\n\n if (\n wholeTimeZone &&\n allTimeZones.some((tz: NormalizedTimeZone) => tz.name === wholeTimeZone.name)\n ) {\n return wholeTimeZone\n }\n\n const fallbackTimeZone = allTimeZones.find((tz) => tz.offset === wholeTimeZone?.offset)\n if (fallbackTimeZone) {\n void keyValueStore.setKey(keyStoreId, fallbackTimeZone.name)\n return fallbackTimeZone\n }\n return undefined\n }\n try {\n return run()\n } catch {\n return undefined\n }\n }, [allTimeZones, keyStoreId, keyValueStore, storedTimeZone])","(): NormalizedTimeZone => {\n const localTzName = Intl.DateTimeFormat().resolvedOptions().timeZone\n const foundLocal = allTimeZones.find((tz) => tz.name === localTzName)\n if (foundLocal) return foundLocal\n\n // Fallback\n const gmt = allTimeZones.find((timeZone) => timeZone.abbreviation === 'GMT')\n if (gmt) return gmt\n\n return allTimeZones[0]\n }","(timeZone) => timeZone.abbreviation === 'GMT'","useCallback((): NormalizedTimeZone => {\n const localTzName = Intl.DateTimeFormat().resolvedOptions().timeZone\n const foundLocal = allTimeZones.find((tz) => tz.name === localTzName)\n if (foundLocal) return foundLocal\n\n // Fallback\n const gmt = allTimeZones.find((timeZone) => timeZone.abbreviation === 'GMT')\n if (gmt) return gmt\n\n return allTimeZones[0]\n }, [allTimeZones])","(): NormalizedTimeZone => {\n return getStoredTimeZone() || getDefaultTimeZone() || getLocalTimeZone()\n }","useCallback((): NormalizedTimeZone => {\n return getStoredTimeZone() || getDefaultTimeZone() || getLocalTimeZone()\n }, [getStoredTimeZone, getDefaultTimeZone, getLocalTimeZone])","() => getInitialTimeZone()","timeZone","[getInitialTimeZone]","() => {\n // oxlint-disable-next-line react/no-deriving-state-in-effects, react/set-state-in-effect -- @todo fix later\n setTimeZone(getInitialTimeZone())\n }","() => {\n const handler = () => {\n setTimeZone(getInitialTimeZone())\n }\n\n window.addEventListener(TimeZoneEvents.update, handler)\n return () => {\n window.removeEventListener(TimeZoneEvents.update, handler)\n }\n }","({\n date,\n format = DATE_FORMAT.LARGE,\n includeTimeZone,\n prefix,\n }: {\n date: Date\n format?: string\n includeTimeZone?: boolean\n prefix?: string\n }) => {\n let dateFormat = format\n if (prefix) {\n dateFormat = `'${prefix}'${format}`\n }\n if (includeTimeZone) {\n dateFormat = `${format} (zzzz)`\n }\n return dateFnsFormat(date, dateFormat, {\n in: tzHelper(timeZone?.name || getLocalTimeZone()?.name || 'UTC'),\n })\n }","name","{\n date,\n format = DATE_FORMAT.LARGE,\n includeTimeZone,\n prefix,\n }: {\n date: Date\n format?: string\n includeTimeZone?: boolean\n prefix?: string\n }","format = DATE_FORMAT.LARGE","useCallback(\n ({\n date,\n format = DATE_FORMAT.LARGE,\n includeTimeZone,\n prefix,\n }: {\n date: Date\n format?: string\n includeTimeZone?: boolean\n prefix?: string\n }) => {\n let dateFormat = format\n if (prefix) {\n dateFormat = `'${prefix}'${format}`\n }\n if (includeTimeZone) {\n dateFormat = `${format} (zzzz)`\n }\n return dateFnsFormat(date, dateFormat, {\n in: tzHelper(timeZone?.name || getLocalTimeZone()?.name || 'UTC'),\n })\n },\n [timeZone, getLocalTimeZone],\n )","() => {\n if (!timeZone) return new Date()\n return new TZDate(new Date(), timeZone.name)\n }","useCallback(() => {\n if (!timeZone) return new Date()\n return new TZDate(new Date(), timeZone.name)\n }, [timeZone])","(tzValue: string): NormalizedTimeZone =>\n allTimeZones.find((tz) => tzValue === tz.value) || getInitialTimeZone()","useCallback(\n (tzValue: string): NormalizedTimeZone =>\n allTimeZones.find((tz) => tzValue === tz.value) || getInitialTimeZone(),\n [allTimeZones, getInitialTimeZone],\n )","(tz: NormalizedTimeZone) => {\n debug('handleNewValue:', tz)\n\n setTimeZone((prevTz) => {\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n if (prevTz?.name !== tz.name) {\n void keyValueStore.setKey(keyStoreId, tz.name)\n window.dispatchEvent(new Event(TimeZoneEvents.update))\n }\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription\n body={`${tz.alternativeName} (${tz.namePretty})`}\n title=\"Time zone updated\"\n />\n ),\n duration: 15000,\n status: 'info',\n })\n }\n try {\n run()\n } catch (err) {\n console.error(err)\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription body={getErrorMessage(err)} title=\"Unable to update time zone\" />\n ),\n status: 'error',\n })\n }\n\n return tz\n })\n }","run","err","useCallback(\n (tz: NormalizedTimeZone) => {\n debug('handleNewValue:', tz)\n\n setTimeZone((prevTz) => {\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n if (prevTz?.name !== tz.name) {\n void keyValueStore.setKey(keyStoreId, tz.name)\n window.dispatchEvent(new Event(TimeZoneEvents.update))\n }\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription\n body={`${tz.alternativeName} (${tz.namePretty})`}\n title=\"Time zone updated\"\n />\n ),\n duration: 15000,\n status: 'info',\n })\n }\n try {\n run()\n } catch (err) {\n console.error(err)\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription body={getErrorMessage(err)} title=\"Unable to update time zone\" />\n ),\n status: 'error',\n })\n }\n\n return tz\n })\n },\n [keyStoreId, toast, keyValueStore],\n )","(date: Date) => {\n if (!timeZone) return date\n return new TZDate(date, timeZone.name)\n }","date","useCallback(\n (date: Date) => {\n if (!timeZone) return date\n return new TZDate(date, timeZone.name)\n },\n [timeZone],\n )","(date: Date) => {\n if (!timeZone) return date\n // Create a TZDate by interpreting the date components as being in the timezone\n const tzDate = createTZDateFromComponents(date, timeZone.name)\n // Convert to regular Date to save as UTC instead of preserving timezone offset\n const utcDate = new Date(tzDate)\n return utcDate\n }","useCallback(\n (date: Date) => {\n if (!timeZone) return date\n // Create a TZDate by interpreting the date components as being in the timezone\n const tzDate = createTZDateFromComponents(date, timeZone.name)\n // Convert to regular Date to save as UTC instead of preserving timezone offset\n const utcDate = new Date(tzDate)\n return utcDate\n },\n [timeZone],\n )","{\n formatDateTz,\n getCurrentZoneDate,\n setTimeZone: handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n }","useMemo(\n () => ({\n formatDateTz,\n getCurrentZoneDate,\n setTimeZone: handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n }),\n [\n formatDateTz,\n getCurrentZoneDate,\n handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n ],\n )"],"sources":["../src/core/studio/timezones/constants.tsx","../src/core/studio/timezones/toastDescription/ToastDescription.tsx","../src/core/studio/timezones/utils/debug.ts","../src/core/hooks/useTimeZone.tsx"],"sourcesContent":["// date-fns compatible date formats\n// https://date-fns.org/v2.28.0/docs/format\nexport const DATE_FORMAT = {\n // 1 Oct 22, 10:00 PM\n SMALL: `d MMM yy',' p`,\n // 1 October 2022, 10:00 PM\n MEDIUM: `d MMMM yyyy',' p`,\n // Saturday, 1 October 2022, 10:00 PM\n LARGE: `iiii',' d MMMM yyyy',' p`,\n}\n","import {CalendarIcon} from '@sanity/icons/Calendar'\nimport {Inline, Stack, Text} from '@sanity/ui'\n\ninterface Props {\n body?: string\n title: string\n}\n\nconst ToastDescription = (props: Props) => {\n const {body, title} = props\n return (\n <Stack paddingY={1} gap={3}>\n <Inline gap={2}>\n <CalendarIcon />\n {title && (\n <Text size={2} weight=\"semibold\">\n {title}\n </Text>\n )}\n </Inline>\n {body && <Text size={1}>{body}</Text>}\n </Stack>\n )\n}\n\nexport default ToastDescription\n","import {createDebug, enabled, type Debugger} from 'obug'\n\nconst rootName = 'scheduled-publishing:'\n\nexport function debugWithName(name: string): Debugger {\n const namespace = `${rootName}${name}`\n if (enabled(namespace)) {\n return createDebug(namespace)\n }\n return createDebug(rootName)\n}\n","import {tz as tzHelper, TZDate} from '@date-fns/tz'\nimport {type ClientError} from '@sanity/client'\nimport {useToast} from '@sanity/ui/toast'\nimport {sanitizeLocale} from '@sanity/util/legacyDateFormat'\nimport {format as dateFnsFormat} from 'date-fns/format'\nimport {useCallback, useEffect, useMemo, useState} from 'react'\nimport {useSyncObservable} from 'react-rx'\nimport {startWith} from 'rxjs/operators'\n\nimport {useKeyValueStore} from '../store/datastores'\nimport {DATE_FORMAT} from '../studio/timezones/constants'\nimport ToastDescription from '../studio/timezones/toastDescription/ToastDescription'\nimport {type NormalizedTimeZone} from '../studio/timezones/types'\nimport {debugWithName} from '../studio/timezones/utils/debug'\n\n/**\n * Helper function to create a TZDate from a Date's components in a specific timezone.\n * This is useful for interpreting local date/time values as being in a specific timezone.\n */\nfunction createTZDateFromComponents(date: Date, timeZone: string): TZDate {\n return new TZDate(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n timeZone,\n )\n}\n\nconst TimeZoneEvents = {\n update: 'timeZoneEventUpdate' as const,\n}\n\nexport type TimeZoneScopeType = 'scheduledPublishing' | 'contentReleases' | 'input'\n\ntype NoIdRequiredTypes = 'scheduledPublishing' | 'contentReleases'\ntype IdRequiredTypes = 'input'\n\ntype ReleasesOrScheduledPublishingScope = {\n type: NoIdRequiredTypes\n defaultTimeZone?: string\n}\n\ntype InputScope = {\n type: IdRequiredTypes\n id: string\n defaultTimeZone?: string\n relativeDate?: Date // offsets can change over time, so we use a relative date to get the offset\n}\n\nexport type TimeZoneScope = ReleasesOrScheduledPublishingScope | InputScope\n\nconst debug = debugWithName('useScheduleOperation')\n\nexport const timeZoneLocalStorageNamespace = 'studio.timezone.'\n\nconst timeZoneCache = new Map<string, NormalizedTimeZone[]>()\nconst offsetCache = new Map<\n string,\n {abbreviation: string; alternativeName: string; offset: string}\n>()\n\nconst offsetToMinutes = (offset: string): number => {\n if (!offset) return 0\n const multiplier = offset.startsWith('-') ? -1 : 1\n if (!offset.includes(':')) return multiplier * Number(offset.replace(/[+-]/, '')) * 60\n\n const [hours, minutes] = offset.replace(/[+-]/, '').split(':').map(Number)\n return multiplier * (hours * 60 + minutes)\n}\n\nfunction getCachedTimeZoneInfo(\n locale: string,\n canonicalIdentifier: string,\n relativeDateForZones?: Date,\n): {abbreviation: string; alternativeName: string; offset: string} {\n const dateKey = relativeDateForZones?.toISOString().slice(0, 10) || 'now'\n const cacheKey = `${locale}_${canonicalIdentifier}_${dateKey}`\n // relative date is not used for caching, but it's used to invalidate the cache when it changes\n if (offsetCache.has(cacheKey)) {\n return offsetCache.get(cacheKey)!\n }\n\n const formatter = new Intl.DateTimeFormat(sanitizeLocale(locale), {\n timeZone: canonicalIdentifier,\n timeZoneName: 'long',\n })\n\n const shortFormatter = new Intl.DateTimeFormat(sanitizeLocale(locale), {\n timeZone: canonicalIdentifier,\n timeZoneName: 'short',\n })\n\n const dateToUse = relativeDateForZones ?? new Date()\n const parts = formatter.formatToParts(dateToUse)\n const shortParts = shortFormatter.formatToParts(dateToUse)\n const rawOffset = dateFnsFormat(dateToUse, 'xxx', {in: tzHelper(canonicalIdentifier)})\n // If the offset is +02:00 then we can just show +2, if it has +13:45 then we should show +13:45, remove the leading +0 and just leave a + if a number under 10, remove the :00 at the end\n const offset = rawOffset\n .replace(/([+-])0(\\d)/, '$1$2')\n .replace(/([+-])0$/, '$1')\n .replace(/:00$/, '')\n .replace(/[+]0$/, '')\n\n const info = {\n abbreviation: shortParts.find(({type}) => type === 'timeZoneName')?.value || '',\n alternativeName: parts.find(({type}) => type === 'timeZoneName')?.value || '',\n offset,\n }\n\n offsetCache.set(cacheKey, info)\n return info\n}\n\nfunction computeAllTimeZones(locale: string, relativeDate?: Date): NormalizedTimeZone[] {\n const timeZones = Intl.supportedValuesOf('timeZone')\n .map((tzName): NormalizedTimeZone | null => {\n // Skip if timezone name doesn't contain a city (should have a '/')\n if (!tzName.includes('/')) return null\n\n const {alternativeName, abbreviation, offset} = getCachedTimeZoneInfo(\n locale,\n tzName,\n relativeDate,\n )\n const [, city] = tzName.split('/')\n return {\n abbreviation,\n alternativeName,\n city: city.replaceAll('_', ' '),\n name: tzName,\n namePretty: tzName.replaceAll('_', ' '),\n offset,\n value: `${offset} ${abbreviation} ${tzName} ${alternativeName}`,\n }\n })\n .filter((tz): tz is NormalizedTimeZone => tz !== null)\n .sort(\n (a: NormalizedTimeZone, b: NormalizedTimeZone) =>\n offsetToMinutes(a.offset) - offsetToMinutes(b.offset),\n )\n\n return timeZones\n}\n\nfunction getGloballyCachedTimeZones(locale: string, relativeDate?: Date): NormalizedTimeZone[] {\n const cacheKey = `${locale}_${relativeDate?.toISOString().slice(0, 10) || 'now'}`\n\n if (timeZoneCache.has(cacheKey)) {\n return timeZoneCache.get(cacheKey)!\n }\n\n const computedTimeZones = computeAllTimeZones(locale, relativeDate)\n timeZoneCache.set(cacheKey, computedTimeZones)\n return computedTimeZones\n}\n\nexport const TIME_ZONE_SCOPE_TYPE = {\n scheduledPublishing: 'scheduled-publishing',\n contentReleases: 'content-releases',\n input: 'input',\n}\n\nexport const useTimeZone = (scope: TimeZoneScope) => {\n const toast = useToast()\n const keyValueStore = useKeyValueStore()\n const currentLocale = navigator.language\n const {defaultTimeZone} = scope\n\n // used for the key to match formatting in cellar\n const type = TIME_ZONE_SCOPE_TYPE[scope.type]\n const keyStoreId =\n 'id' in scope\n ? `${timeZoneLocalStorageNamespace}${type}.${scope.id}`\n : `${timeZoneLocalStorageNamespace}${type}`\n const relativeDate = 'relativeDate' in scope ? scope.relativeDate : undefined\n\n // Check for legacy localStorage key and migrate if needed\n // fall back for old way of handling timezones\n useEffect(() => {\n if (scope.type === 'scheduledPublishing') {\n const legacyKey = 'scheduled-publishing::time-zone'\n // the original value was kept as an object with the name\n const legacyValue = localStorage.getItem(legacyKey)\n\n if (legacyValue) {\n // Migrate the value to key-value store\n const scheduledPublishingValue = JSON.parse(legacyValue)\n void keyValueStore.setKey(keyStoreId, scheduledPublishingValue.name)\n // Remove the legacy key\n localStorage.removeItem(legacyKey)\n }\n }\n // oxlint-disable-next-line react/exhaustive-effect-dependencies -- pre-existing violation, to be fixed in a follow-up\n }, [scope.type, keyValueStore, keyStoreId, currentLocale, relativeDate])\n\n const allTimeZones: NormalizedTimeZone[] = useMemo(() => {\n return getGloballyCachedTimeZones(currentLocale, relativeDate)\n }, [currentLocale, relativeDate])\n\n const getDefaultTimeZone = useCallback((): NormalizedTimeZone | undefined => {\n const normalizedDefaultTimezone = defaultTimeZone\n ? allTimeZones.find((tz: NormalizedTimeZone) => tz.name === defaultTimeZone)\n : undefined\n return normalizedDefaultTimezone\n }, [allTimeZones, defaultTimeZone])\n\n const keyValueTimeZone$ = useMemo(\n () => keyValueStore.getKey(keyStoreId).pipe(startWith(null)),\n [keyValueStore, keyStoreId],\n )\n\n // Kept synchronous: `getStoredTimeZone` migrates legacy values by writing\n // back to the key-value store, so a deferred snapshot could trigger stale or\n // redundant writes after the store has already advanced.\n const storedTimeZone = useSyncObservable(keyValueTimeZone$, null)\n\n const getStoredTimeZone = useCallback((): NormalizedTimeZone | undefined => {\n if (!storedTimeZone) return undefined\n\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n const wholeTimeZone = allTimeZones.find((tz) => tz.name === storedTimeZone)\n\n if (\n wholeTimeZone &&\n allTimeZones.some((tz: NormalizedTimeZone) => tz.name === wholeTimeZone.name)\n ) {\n return wholeTimeZone\n }\n\n const fallbackTimeZone = allTimeZones.find((tz) => tz.offset === wholeTimeZone?.offset)\n if (fallbackTimeZone) {\n void keyValueStore.setKey(keyStoreId, fallbackTimeZone.name)\n return fallbackTimeZone\n }\n return undefined\n }\n try {\n return run()\n } catch {\n return undefined\n }\n }, [allTimeZones, keyStoreId, keyValueStore, storedTimeZone])\n\n const getLocalTimeZone = useCallback((): NormalizedTimeZone => {\n const localTzName = Intl.DateTimeFormat().resolvedOptions().timeZone\n const foundLocal = allTimeZones.find((tz) => tz.name === localTzName)\n if (foundLocal) return foundLocal\n\n // Fallback\n const gmt = allTimeZones.find((timeZone) => timeZone.abbreviation === 'GMT')\n if (gmt) return gmt\n\n return allTimeZones[0]\n }, [allTimeZones])\n\n const getInitialTimeZone = useCallback((): NormalizedTimeZone => {\n return getStoredTimeZone() || getDefaultTimeZone() || getLocalTimeZone()\n }, [getStoredTimeZone, getDefaultTimeZone, getLocalTimeZone])\n\n const [timeZone, setTimeZone] = useState<NormalizedTimeZone>(() => getInitialTimeZone())\n\n useEffect(() => {\n // oxlint-disable-next-line react/no-deriving-state-in-effects, react/set-state-in-effect -- @todo fix later\n setTimeZone(getInitialTimeZone())\n }, [getInitialTimeZone])\n\n useEffect(() => {\n const handler = () => {\n setTimeZone(getInitialTimeZone())\n }\n\n window.addEventListener(TimeZoneEvents.update, handler)\n return () => {\n window.removeEventListener(TimeZoneEvents.update, handler)\n }\n }, [getInitialTimeZone])\n\n const formatDateTz = useCallback(\n ({\n date,\n format = DATE_FORMAT.LARGE,\n includeTimeZone,\n prefix,\n }: {\n date: Date\n format?: string\n includeTimeZone?: boolean\n prefix?: string\n }) => {\n let dateFormat = format\n if (prefix) {\n dateFormat = `'${prefix}'${format}`\n }\n if (includeTimeZone) {\n dateFormat = `${format} (zzzz)`\n }\n return dateFnsFormat(date, dateFormat, {\n in: tzHelper(timeZone?.name || getLocalTimeZone()?.name || 'UTC'),\n })\n },\n [timeZone, getLocalTimeZone],\n )\n\n const getCurrentZoneDate = useCallback(() => {\n if (!timeZone) return new Date()\n return new TZDate(new Date(), timeZone.name)\n }, [timeZone])\n\n const getTimeZone = useCallback(\n (tzValue: string): NormalizedTimeZone =>\n allTimeZones.find((tz) => tzValue === tz.value) || getInitialTimeZone(),\n [allTimeZones, getInitialTimeZone],\n )\n\n const handleNewValue = useCallback(\n (tz: NormalizedTimeZone) => {\n debug('handleNewValue:', tz)\n\n setTimeZone((prevTz) => {\n // The try/catch wrapper instead of doing it inline in try/catch is because of the React Compiler not fully supporting the syntax yet\n const run = () => {\n if (prevTz?.name !== tz.name) {\n void keyValueStore.setKey(keyStoreId, tz.name)\n window.dispatchEvent(new Event(TimeZoneEvents.update))\n }\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription\n body={`${tz.alternativeName} (${tz.namePretty})`}\n title=\"Time zone updated\"\n />\n ),\n duration: 15000,\n status: 'info',\n })\n }\n try {\n run()\n } catch (err) {\n console.error(err)\n\n toast.push({\n closable: true,\n description: (\n <ToastDescription body={getErrorMessage(err)} title=\"Unable to update time zone\" />\n ),\n status: 'error',\n })\n }\n\n return tz\n })\n },\n [keyStoreId, toast, keyValueStore],\n )\n\n const utcToCurrentZoneDate = useCallback(\n (date: Date) => {\n if (!timeZone) return date\n return new TZDate(date, timeZone.name)\n },\n [timeZone],\n )\n\n const zoneDateToUtc = useCallback(\n (date: Date) => {\n if (!timeZone) return date\n // Create a TZDate by interpreting the date components as being in the timezone\n const tzDate = createTZDateFromComponents(date, timeZone.name)\n // Convert to regular Date to save as UTC instead of preserving timezone offset\n const utcDate = new Date(tzDate)\n return utcDate\n },\n [timeZone],\n )\n\n return useMemo(\n () => ({\n formatDateTz,\n getCurrentZoneDate,\n setTimeZone: handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n }),\n [\n formatDateTz,\n getCurrentZoneDate,\n handleNewValue,\n timeZone,\n allTimeZones,\n getLocalTimeZone,\n getTimeZone,\n utcToCurrentZoneDate,\n zoneDateToUtc,\n ],\n )\n}\n\n// this is used in place of `instanceof` so the matching can be more robust and\n// won't have any issues with dual packages etc\n// https://nodejs.org/api/packages.html#dual-package-hazard\nfunction isClientError(e: unknown): e is ClientError {\n if (typeof e !== 'object') return false\n if (!e) return false\n return 'statusCode' in e && 'response' in e\n}\n\nfunction getErrorMessage(err: unknown): string {\n let message\n\n if (isClientError(err)) {\n // The request was made and the server responded with a status code\n if (err.response.statusCode === 403) {\n message = 'Forbidden. Please check that your project has access to the feature.'\n } else {\n message = err.message\n }\n } else {\n if (err instanceof Error) {\n message = err.message\n }\n message = String(err)\n }\n\n return message\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAa,cAAc;CAEzB,OAAO;CAEP,QAAQ;CAER,OA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nD,OAFI,OAAO,KAAM,YACb,CAAC,IAAU,KACR,gBAAgB,KAAK,cAAc;AAC5C;AAEA,SAAS,gBAAgB,KAAsB;CAC7C,IAAI;CAgBJ,OAdI,cAAc,GAAG,IAEnB,AAGE,UAHE,IAAI,SAAS,eAAe,MACpB,yEAEA,IAAI,WAGZ,eAAe,UACjB,UAAU,IAAI,UAEhB,UAAU,OAAO,GAAG,IAGf;AACT;AAtLkC,SAAA,MAAC,UAAA;CAAa,OAAA,SAAS,iBAAiB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ft as getVariantId } from "./datastores-
|
|
1
|
+
import { ft as getVariantId } from "./datastores-DNOJm1LF.js";
|
|
2
2
|
import { t as useTranslation } from "./useTranslation-Cqs6Itwv.js";
|
|
3
3
|
import { n as TooltipDelayGroupProvider, o as Button$1 } from "./Tab-Dx6d0Ug4.js";
|
|
4
4
|
import { s as getDraftId, u as getVersionFromId } from "./draftUtils-D3HJGQaW.js";
|
|
5
5
|
import { t as useCurrentLocale } from "./useLocale-ChRJXddd.js";
|
|
6
6
|
import { r as isAgentBundleName } from "./createAgentBundlesStore-BJwwD0vJ.js";
|
|
7
7
|
import { n as Dialog$1, r as Popover } from "./MenuGroup-DwiYr9LF.js";
|
|
8
|
-
import { t as useTimeZone } from "./useTimeZone-
|
|
8
|
+
import { t as useTimeZone } from "./useTimeZone-Dj7C8tfZ.js";
|
|
9
9
|
import { useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1104,4 +1104,4 @@ function getCalendarLabels(t) {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
export { MONTH_PICKER_VARIANT as a, useWeeksOfMonth as c, useDialogTimeZone as d, isDraftVersion as f, readVersionType as g, isVariantVersion as h, DatePicker as i, ARROW_KEYS as l, isReleaseVersion as m, isValidDate as n, LazyTextInput as o, isPublishedVersion as p, DateTimeInput as r, getWeekDayNames as s, getCalendarLabels as t, DEFAULT_MONTH_NAMES as u };
|
|
1106
1106
|
|
|
1107
|
-
//# sourceMappingURL=utils-
|
|
1107
|
+
//# sourceMappingURL=utils-CT034e4q.js.map
|