sanity 6.8.0-next.2 → 6.8.0-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/lib/{AddonDatasetProvider-DKjnqxwO.js → AddonDatasetProvider-Cp0gK33v.js} +2 -2
  2. package/lib/{AddonDatasetProvider-DKjnqxwO.js.map → AddonDatasetProvider-Cp0gK33v.js.map} +1 -1
  3. package/lib/{CalendarFilter-B5Bb9eze.js → CalendarFilter-Cgz5picy.js} +3 -3
  4. package/lib/{CalendarFilter-B5Bb9eze.js.map → CalendarFilter-Cgz5picy.js.map} +1 -1
  5. package/lib/{CommandList-Q4ua5avE.js → CommandList-BeDeX_Tr.js} +23 -6
  6. package/lib/CommandList-BeDeX_Tr.js.map +1 -0
  7. package/lib/{CommentsDocumentLayout-Brt2OR56.js → CommentsDocumentLayout-BJMRXrxl.js} +2 -2
  8. package/lib/{CommentsDocumentLayout-Brt2OR56.js.map → CommentsDocumentLayout-BJMRXrxl.js.map} +1 -1
  9. package/lib/{CommentsField-Cmmta6uT.js → CommentsField-DV6bhirZ.js} +3 -3
  10. package/lib/{CommentsField-Cmmta6uT.js.map → CommentsField-DV6bhirZ.js.map} +1 -1
  11. package/lib/{CommentsInput-C7Kq5XMu.js → CommentsInput-DQ4WCdZJ.js} +5 -5
  12. package/lib/{CommentsInput-C7Kq5XMu.js.map → CommentsInput-DQ4WCdZJ.js.map} +1 -1
  13. package/lib/{CommentsInspector-H5CpN_XH.js → CommentsInspector-PkVZw8uv.js} +5 -5
  14. package/lib/{CommentsInspector-H5CpN_XH.js.map → CommentsInspector-PkVZw8uv.js.map} +1 -1
  15. package/lib/{CommentsListItem-x7FKz_CM.js → CommentsListItem-BjWNEXPU.js} +3 -3
  16. package/lib/{CommentsListItem-x7FKz_CM.js.map → CommentsListItem-BjWNEXPU.js.map} +1 -1
  17. package/lib/{CommentsSelectedPathProvider-Bt8q7wL8.js → CommentsSelectedPathProvider-x5f1q0eW.js} +3 -3
  18. package/lib/{CommentsSelectedPathProvider-Bt8q7wL8.js.map → CommentsSelectedPathProvider-x5f1q0eW.js.map} +1 -1
  19. package/lib/{CommentsStudioLayout-BTJ8Jz1o.js → CommentsStudioLayout-CxZq2lGu.js} +4 -4
  20. package/lib/{CommentsStudioLayout-BTJ8Jz1o.js.map → CommentsStudioLayout-CxZq2lGu.js.map} +1 -1
  21. package/lib/{PaneContainer-D8iNUpZk.js → PaneContainer-B_cWaSSe.js} +8 -8
  22. package/lib/{PaneContainer-D8iNUpZk.js.map → PaneContainer-B_cWaSSe.js.map} +1 -1
  23. package/lib/{PresentationToolGrantsCheck-CxqDuu8I.js → PresentationToolGrantsCheck-CITNu5DG.js} +14 -6
  24. package/lib/PresentationToolGrantsCheck-CITNu5DG.js.map +1 -0
  25. package/lib/{ReleasesMetadataProvider-CZ8jrkBT.js → ReleasesMetadataProvider-CpYsTC5J.js} +2 -2
  26. package/lib/{ReleasesMetadataProvider-CZ8jrkBT.js.map → ReleasesMetadataProvider-CpYsTC5J.js.map} +1 -1
  27. package/lib/{ReleasesNav-BmGRLcrk.js → ReleasesNav-BuqDytPb.js} +59 -19
  28. package/lib/ReleasesNav-BuqDytPb.js.map +1 -0
  29. package/lib/{ReleasesStudioLayout-6V5oDb3h.js → ReleasesStudioLayout-mJZnbUum.js} +8 -8
  30. package/lib/{ReleasesStudioLayout-6V5oDb3h.js.map → ReleasesStudioLayout-mJZnbUum.js.map} +1 -1
  31. package/lib/{ReleasesTool-CMABMGcE.js → ReleasesTool-BFOV2VEc.js} +14 -14
  32. package/lib/{ReleasesTool-CMABMGcE.js.map → ReleasesTool-BFOV2VEc.js.map} +1 -1
  33. package/lib/{SchedulePublishingStudioLayout-BJDA4FBy.js → SchedulePublishingStudioLayout-D2ptE43I.js} +3 -3
  34. package/lib/{SchedulePublishingStudioLayout-BJDA4FBy.js.map → SchedulePublishingStudioLayout-D2ptE43I.js.map} +1 -1
  35. package/lib/{SchedulePublishingUpsellProvider-DfmpnFZz.js → SchedulePublishingUpsellProvider-DvCfqtdZ.js} +2 -2
  36. package/lib/{SchedulePublishingUpsellProvider-DfmpnFZz.js.map → SchedulePublishingUpsellProvider-DvCfqtdZ.js.map} +1 -1
  37. package/lib/{ScheduledPublishingEnabledProvider-C2jEx3t4.js → ScheduledPublishingEnabledProvider-B5yA7hHi.js} +3 -3
  38. package/lib/{ScheduledPublishingEnabledProvider-C2jEx3t4.js.map → ScheduledPublishingEnabledProvider-B5yA7hHi.js.map} +1 -1
  39. package/lib/{SearchProvider-Dk7IfeRS.js → SearchProvider-Cpl3WUyR.js} +25 -25
  40. package/lib/SearchProvider-Cpl3WUyR.js.map +1 -0
  41. package/lib/{SingleDocReleaseLayout-DW02L2zA.js → SingleDocReleaseLayout-CfPCP1Ur.js} +2 -2
  42. package/lib/{SingleDocReleaseLayout-DW02L2zA.js.map → SingleDocReleaseLayout-CfPCP1Ur.js.map} +1 -1
  43. package/lib/{SingleDocReleaseUpsellProvider-9OXN223n.js → SingleDocReleaseUpsellProvider-4ib7kMdI.js} +4 -4
  44. package/lib/{SingleDocReleaseUpsellProvider-9OXN223n.js.map → SingleDocReleaseUpsellProvider-4ib7kMdI.js.map} +1 -1
  45. package/lib/{TasksStudioActiveToolLayout-grF1qQvq.js → TasksStudioActiveToolLayout-lrH8y1Kh.js} +11 -11
  46. package/lib/{TasksStudioActiveToolLayout-grF1qQvq.js.map → TasksStudioActiveToolLayout-lrH8y1Kh.js.map} +1 -1
  47. package/lib/{TasksStudioLayout-Dq72bdM2.js → TasksStudioLayout-CITzoP_1.js} +5 -5
  48. package/lib/{TasksStudioLayout-Dq72bdM2.js.map → TasksStudioLayout-CITzoP_1.js.map} +1 -1
  49. package/lib/{Tool-DNTYDreC.js → Tool-DxqXi1AF.js} +12 -12
  50. package/lib/{Tool-DNTYDreC.js.map → Tool-DxqXi1AF.js.map} +1 -1
  51. package/lib/{UnpublishVersionDialog-B0kX1dt6.js → UnpublishVersionDialog-VZflky9U.js} +4 -4
  52. package/lib/{UnpublishVersionDialog-B0kX1dt6.js.map → UnpublishVersionDialog-VZflky9U.js.map} +1 -1
  53. package/lib/{UpsellDialog-B3IbZqLA.js → UpsellDialog-BmQSjdJg.js} +2 -2
  54. package/lib/{UpsellDialog-B3IbZqLA.js.map → UpsellDialog-BmQSjdJg.js.map} +1 -1
  55. package/lib/{VariantsStudioNavbar-N-cvStJh.js → VariantsStudioNavbar-HsA97lVy.js} +7 -27
  56. package/lib/VariantsStudioNavbar-HsA97lVy.js.map +1 -0
  57. package/lib/{VariantsTool-Bj3RjgBN.js → VariantsTool-rOcVMkln.js} +7 -7
  58. package/lib/{VariantsTool-Bj3RjgBN.js.map → VariantsTool-rOcVMkln.js.map} +1 -1
  59. package/lib/{WorkspaceLoader-BZD0-fj6.js → WorkspaceLoader-kepBjrsn.js} +25 -25
  60. package/lib/{WorkspaceLoader-BZD0-fj6.js.map → WorkspaceLoader-kepBjrsn.js.map} +1 -1
  61. package/lib/_createContext.js +1 -1
  62. package/lib/_singletons.d.ts +1 -1
  63. package/lib/{buildTextSelectionFromFragment-BXiSMql4.js → buildTextSelectionFromFragment-Dj_WBTDa.js} +3 -3
  64. package/lib/{buildTextSelectionFromFragment-BXiSMql4.js.map → buildTextSelectionFromFragment-Dj_WBTDa.js.map} +1 -1
  65. package/lib/{datastores-CFWEadl-.js → datastores-CrRYBoDP.js} +12 -2
  66. package/lib/datastores-CrRYBoDP.js.map +1 -0
  67. package/lib/desk.d.ts +1 -1
  68. package/lib/desk.js +2 -2
  69. package/lib/{index-Dhee2Ms1.d.ts → index-Bic9X2KM.d.ts} +43 -11
  70. package/lib/index.d.ts +2 -2
  71. package/lib/index.js +642 -258
  72. package/lib/index.js.map +1 -1
  73. package/lib/{inputResolver-BHxsuFDP.js → inputResolver-Czq6o5Gh.js} +4 -4
  74. package/lib/{inputResolver-BHxsuFDP.js.map → inputResolver-Czq6o5Gh.js.map} +1 -1
  75. package/lib/{list-CwENPuWS.js → list-BgF8Q_09.js} +2 -2
  76. package/lib/{list-CwENPuWS.js.map → list-BgF8Q_09.js.map} +1 -1
  77. package/lib/{navigation.telemetry-C6drHR5a.js → navigation.telemetry-DSG23KnM.js} +7 -7
  78. package/lib/{navigation.telemetry-C6drHR5a.js.map → navigation.telemetry-DSG23KnM.js.map} +1 -1
  79. package/lib/pane-BXoiwAkI.js +2 -0
  80. package/lib/pane-W85qO-M2.js +2 -0
  81. package/lib/{plugin-Cr5EXfrh.js → plugin-CLeQ5x8I.js} +4 -4
  82. package/lib/{plugin-Cr5EXfrh.js.map → plugin-CLeQ5x8I.js.map} +1 -1
  83. package/lib/{plugin-C1y-_vWr.js → plugin-CgIJubgG.js} +3 -3
  84. package/lib/{plugin-C1y-_vWr.js.map → plugin-CgIJubgG.js.map} +1 -1
  85. package/lib/{plugin-BHRmn24Q.js → plugin-CqWxiAAn.js} +6 -6
  86. package/lib/{plugin-BHRmn24Q.js.map → plugin-CqWxiAAn.js.map} +1 -1
  87. package/lib/{plugin-DkiEMpfN.js → plugin-DkdjF8sO.js} +5 -5
  88. package/lib/{plugin-DkiEMpfN.js.map → plugin-DkdjF8sO.js.map} +1 -1
  89. package/lib/presentation.js +1 -1
  90. package/lib/{scheduleItem-u5-b4stD.js → scheduleItem-CqReiIMI.js} +8 -8
  91. package/lib/{scheduleItem-u5-b4stD.js.map → scheduleItem-CqReiIMI.js.map} +1 -1
  92. package/lib/{schedules-D0WwNN6x.js → schedules-DoZXofxj.js} +3 -3
  93. package/lib/{schedules-D0WwNN6x.js.map → schedules-DoZXofxj.js.map} +1 -1
  94. package/lib/structure.js +2 -2
  95. package/lib/{structureTool-BCCGiqpF.js → structureTool-By2eJI8F.js} +60 -49
  96. package/lib/structureTool-By2eJI8F.js.map +1 -0
  97. package/lib/{structureTool-B5ch7u4I.js → structureTool-UGWPEr2I.js} +6 -6
  98. package/lib/{structureTool-B5ch7u4I.js.map → structureTool-UGWPEr2I.js.map} +1 -1
  99. package/lib/{studioClient-DvoDxN44.js → studioClient-DqAy4dnu.js} +2 -2
  100. package/lib/{studioClient-DvoDxN44.js.map → studioClient-DqAy4dnu.js.map} +1 -1
  101. package/lib/{useBundleDocuments-CWvP-dZI.js → useBundleDocuments-Dyop3VGZ.js} +15 -13
  102. package/lib/useBundleDocuments-Dyop3VGZ.js.map +1 -0
  103. package/lib/{useComments-KoRXRvW7.js → useComments-CzNBSPgQ.js} +3 -3
  104. package/lib/{useComments-KoRXRvW7.js.map → useComments-CzNBSPgQ.js.map} +1 -1
  105. package/lib/{useCommentsTelemetry-LlKtxi5d.js → useCommentsTelemetry-CkplhYJa.js} +3 -3
  106. package/lib/{useCommentsTelemetry-LlKtxi5d.js.map → useCommentsTelemetry-CkplhYJa.js.map} +1 -1
  107. package/lib/{useDocumentPreviewValues-DcVumcdT.js → useDocumentPreviewValues-BPzq1mWh.js} +3 -3
  108. package/lib/{useDocumentPreviewValues-DcVumcdT.js.map → useDocumentPreviewValues-BPzq1mWh.js.map} +1 -1
  109. package/lib/{useFeatureEnabled-D7BsN6xF.js → useFeatureEnabled-B_ywe2up.js} +2 -2
  110. package/lib/{useFeatureEnabled-D7BsN6xF.js.map → useFeatureEnabled-B_ywe2up.js.map} +1 -1
  111. package/lib/{useFieldActions-NrjLdjo8.js → useFieldActions-DbRTTr6-.js} +2 -2
  112. package/lib/{useFieldActions-NrjLdjo8.js.map → useFieldActions-DbRTTr6-.js.map} +1 -1
  113. package/lib/{useReleasesToolAvailable-Cki52QI6.js → useReleasesToolAvailable-CUvya3HF.js} +3 -3
  114. package/lib/{useReleasesToolAvailable-Cki52QI6.js.map → useReleasesToolAvailable-CUvya3HF.js.map} +1 -1
  115. package/lib/{useScheduledDraftMenuActions-DIa5I8rU.js → useScheduledDraftMenuActions-BBEMJkNE.js} +5 -5
  116. package/lib/{useScheduledDraftMenuActions-DIa5I8rU.js.map → useScheduledDraftMenuActions-BBEMJkNE.js.map} +1 -1
  117. package/lib/{useSetVariant-MvLHJC9A.js → useSetVariant-Cz8brFbQ.js} +3 -3
  118. package/lib/{useSetVariant-MvLHJC9A.js.map → useSetVariant-Cz8brFbQ.js.map} +1 -1
  119. package/lib/{useStudioUrl-DN_xMGIS.js → useStudioUrl-DFAbTA0R.js} +5 -5
  120. package/lib/{useStudioUrl-DN_xMGIS.js.map → useStudioUrl-DFAbTA0R.js.map} +1 -1
  121. package/lib/{useTimeZone-B5fBFjsR.js → useTimeZone-CNjAZCdC.js} +2 -2
  122. package/lib/{useTimeZone-B5fBFjsR.js.map → useTimeZone-CNjAZCdC.js.map} +1 -1
  123. package/lib/{userComponent-BQj9BWzn.js → userComponent-MPULaxdQ.js} +2 -2
  124. package/lib/{userComponent-BQj9BWzn.js.map → userComponent-MPULaxdQ.js.map} +1 -1
  125. package/lib/{validationUtils-RTzFL-p1.js → validationUtils-C9y0bJZd.js} +4 -4
  126. package/lib/{validationUtils-RTzFL-p1.js.map → validationUtils-C9y0bJZd.js.map} +1 -1
  127. package/lib/{version-CY300aPw.js → version-BZCsk4ue.js} +2 -2
  128. package/lib/{version-CY300aPw.js.map → version-BZCsk4ue.js.map} +1 -1
  129. package/package.json +12 -11
  130. package/lib/CommandList-Q4ua5avE.js.map +0 -1
  131. package/lib/Delay-DjgiAi06.js +0 -21
  132. package/lib/Delay-DjgiAi06.js.map +0 -1
  133. package/lib/PresentationToolGrantsCheck-CxqDuu8I.js.map +0 -1
  134. package/lib/ReleasesNav-BmGRLcrk.js.map +0 -1
  135. package/lib/SearchProvider-Dk7IfeRS.js.map +0 -1
  136. package/lib/VariantsStudioNavbar-N-cvStJh.js.map +0 -1
  137. package/lib/datastores-CFWEadl-.js.map +0 -1
  138. package/lib/pane-CEegQ2Kh.js +0 -2
  139. package/lib/pane-DHrjuFiG.js +0 -2
  140. package/lib/structureTool-BCCGiqpF.js.map +0 -1
  141. package/lib/useBundleDocuments-CWvP-dZI.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { l as getPublishedId } from "./draftUtils-C1C4OKjo.js";
2
- import { o as useSource } from "./studioClient-DvoDxN44.js";
3
- import { n as useFeatureEnabled, t as FEATURES } from "./useFeatureEnabled-D7BsN6xF.js";
2
+ import { o as useSource } from "./studioClient-DqAy4dnu.js";
3
+ import { n as useFeatureEnabled, t as FEATURES } from "./useFeatureEnabled-B_ywe2up.js";
4
4
  import { memo, useState } from "react";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { jsx } from "react/jsx-runtime";
@@ -87,4 +87,4 @@ const CommentsEnabledProvider = memo(function CommentsEnabledProvider(props) {
87
87
  });
88
88
  export { CommentsEnabledProvider as n, CommentsAuthoringPathProvider as r, CommentsSelectedPathProvider as t };
89
89
 
90
- //# sourceMappingURL=CommentsSelectedPathProvider-Bt8q7wL8.js.map
90
+ //# sourceMappingURL=CommentsSelectedPathProvider-x5f1q0eW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommentsSelectedPathProvider-Bt8q7wL8.js","names":["ReactNode","useCallback","useMemo","useState","CommentsAuthoringPathContext","CommentsAuthoringPathContextValue","CommentsAuthoringPathProviderProps","children","CommentsAuthoringPathProvider","props","$","_c","authoringPath","setAuthoringPath","t0","Symbol","for","nextAuthoringPath","handleSetAuthoringPath","t1","value","t2","useMemo","useFeatureEnabled","FEATURES","useSource","getPublishedId","CommentsUIMode","ResolveCommentsEnabled","enabled","mode","useResolveCommentsEnabled","documentId","documentType","$","_c","featureEnabled","isLoading","error","studioComments","document","comments","enabledFromConfig","t0","bb0","t1","Symbol","for","t2","value","memo","ReactNode","CommentsEnabledContext","useResolveCommentsEnabled","CommentsEnabledProviderProps","children","documentId","documentType","CommentsEnabledProvider","props","$","_c","value","t0","isEqual","memo","useCallback","useMemo","useState","CommentsSelectedPathContext","CommentsSelectedPath","CommentsSelectedPathContextValue","CommentsSelectedPathProviderProps","children","React","ReactNode","CommentsSelectedPathProvider","props","$","_c","selectedPath","setSelectedPath","t0","nextPath","handleSelectPath","t1","ctxValue","t2"],"sources":["../src/core/comments/context/authoring-path/CommentsAuthoringPathProvider.tsx","../src/core/comments/hooks/useResolveCommentsEnabled.ts","../src/core/comments/context/enabled/CommentsEnabledProvider.tsx","../src/core/comments/context/selected-path/CommentsSelectedPathProvider.tsx"],"sourcesContent":["import {type ReactNode, useCallback, useMemo, useState} from 'react'\nimport {CommentsAuthoringPathContext} from 'sanity/_singletons'\n\nimport {type CommentsAuthoringPathContextValue} from './types'\n\ninterface CommentsAuthoringPathProviderProps {\n children: ReactNode\n}\n\n/**\n * @beta\n * @hidden\n * This provider keeps track of the path that the user is currently authoring a comment for.\n * This is needed to make sure that we consistently keep the editor open when the user is\n * authoring a comment. The state is kept in a context to make sure that it is preserved\n * across re-renders. If this state was kept in a component, it would be reset every time\n * the component re-renders, for example, when the form is temporarily set to `readOnly`\n * while reconnecting.\n */\nexport function CommentsAuthoringPathProvider(props: CommentsAuthoringPathProviderProps) {\n const {children} = props\n const [authoringPath, setAuthoringPath] = useState<string | null>(null)\n\n const handleSetAuthoringPath = useCallback((nextAuthoringPath: string | null) => {\n setAuthoringPath(nextAuthoringPath)\n }, [])\n\n const value = useMemo(\n (): CommentsAuthoringPathContextValue => ({\n authoringPath,\n setAuthoringPath: handleSetAuthoringPath,\n }),\n [authoringPath, handleSetAuthoringPath],\n )\n\n return (\n <CommentsAuthoringPathContext.Provider value={value}>\n {children}\n </CommentsAuthoringPathContext.Provider>\n )\n}\n","import {useMemo} from 'react'\n\nimport {useFeatureEnabled, FEATURES} from '../../hooks/useFeatureEnabled'\nimport {useSource} from '../../studio/source'\nimport {getPublishedId} from '../../util/draftUtils'\nimport {type CommentsUIMode} from '../types'\n\ntype ResolveCommentsEnabled =\n | {\n enabled: false\n mode: null\n }\n | {\n enabled: true\n mode: CommentsUIMode\n }\n\n/**\n * @internal\n * A hook that resolves if comments are enabled for the current document and document type\n * and if the feature is enabled for the current project.\n */\nexport function useResolveCommentsEnabled(\n documentId: string,\n documentType: string,\n): ResolveCommentsEnabled {\n // Check if the projects plan has the feature enabled\n const {enabled: featureEnabled, isLoading, error} = useFeatureEnabled(FEATURES.studioComments)\n\n const {enabled} = useSource().document.comments\n // Check if the feature is enabled for the current document in the config\n const enabledFromConfig = useMemo(\n () => enabled({documentType, documentId: getPublishedId(documentId)}),\n [documentId, documentType, enabled],\n )\n\n const value: ResolveCommentsEnabled = useMemo(() => {\n // The feature is not enabled if:\n // - the feature is loading (`isLoading` is true)\n // - the feature is not enabled in the project (`enabledFromConfig` is false)\n // - there's an error when fetching the list of enabled features (`error` is set)\n if (isLoading || !enabledFromConfig || error) {\n return {enabled: false, mode: null}\n }\n\n return {\n enabled: true,\n mode: featureEnabled ? 'default' : 'upsell',\n }\n }, [isLoading, enabledFromConfig, error, featureEnabled])\n\n return value\n}\n","import {memo, type ReactNode} from 'react'\nimport {CommentsEnabledContext} from 'sanity/_singletons'\n\nimport {useResolveCommentsEnabled} from '../../hooks/useResolveCommentsEnabled'\n\ninterface CommentsEnabledProviderProps {\n children: ReactNode\n documentId: string\n documentType: string\n}\n\n/**\n * @beta\n * @hidden\n */\nexport const CommentsEnabledProvider = memo(function CommentsEnabledProvider(\n props: CommentsEnabledProviderProps,\n) {\n const {children, documentId, documentType} = props\n\n const value = useResolveCommentsEnabled(documentId, documentType)\n\n return <CommentsEnabledContext.Provider value={value}>{children}</CommentsEnabledContext.Provider>\n})\n","import isEqual from 'lodash-es/isEqual.js'\nimport {memo, useCallback, useMemo, useState} from 'react'\nimport {CommentsSelectedPathContext} from 'sanity/_singletons'\n\nimport {type CommentsSelectedPath, type CommentsSelectedPathContextValue} from './types'\n\ninterface CommentsSelectedPathProviderProps {\n children: React.ReactNode\n}\n\n/**\n * @internal\n */\nexport const CommentsSelectedPathProvider = memo(function CommentsSelectedPathProvider(\n props: CommentsSelectedPathProviderProps,\n) {\n const {children} = props\n const [selectedPath, setSelectedPath] = useState<CommentsSelectedPath | null>(null)\n\n const handleSelectPath = useCallback(\n (nextPath: CommentsSelectedPath | null) => {\n if (isEqual(selectedPath, nextPath)) return\n\n setSelectedPath(nextPath)\n },\n [selectedPath],\n )\n\n const ctxValue = useMemo(\n (): CommentsSelectedPathContextValue => ({\n selectedPath,\n setSelectedPath: handleSelectPath,\n }),\n [selectedPath, handleSelectPath],\n )\n\n return (\n <CommentsSelectedPathContext.Provider value={ctxValue}>\n {children}\n </CommentsSelectedPathContext.Provider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,SAAOQ,8BAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACL,EAAAJ,aAAmBE,OACnB,CAAAG,eAAAC,oBAA0CV,SAAwB,IAAI,GAACW;CAAA,AAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,KAE5BF,MAAAG,sBAAA;EACzCJ,iBAAiBI,iBAAiB;CAAC,GACpCP,EAAA,KAAAI,MAAAA,KAAAJ,EAAA;CAFD,IAAAQ,yBAA+BJ,IAEzBK;CAAA,AAAAT,EAAA,OAAAE,gBAMHO,KAAAT,EAAA,MAHyCS,KAAA;EAAAP;EAAAC,kBAEtBK;CACpB,GAACR,EAAA,KAAAE,eAAAF,EAAA,KAAAS;CAJH,IAAAC,QAC4CD,IAK3CE;CAKyC,OALzCX,EAAA,OAAAH,YAAAG,EAAA,OAAAU,SAGCC,KAAA,oBAAA,6BAAA,UAAA;EAA8CD;EAC3Cb;CACH,CAAA,GAAwCG,EAAA,KAAAH,UAAAG,EAAA,KAAAU,OAAAV,EAAA,KAAAW,MAAAA,KAAAX,EAAA,IAFxCW;AAEwC;;;;;;AChB5C,SAAOU,0BAAAC,YAAAC,cAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAKL,EAAAN,SAAAO,gBAAAC,WAAAC,UAAoDf,kBAAkBC,SAAQe,cAAe,GAE7F,EAAAV,YAAkBJ,UAAU,CAAC,CAAAe,SAASC,UAEtCC,oBACQb,QAAQ;EAAAI;EAAAD,YAA2BN,eAAeM,UAAU;CAAC,CAAC,GAErEW;CAAAC,KAAA;EAOC,IAAIP,aAAA,CAAcK,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AAL;EAAAC,iBAEtBG;CACnB,GAACN,EAAA,KAAAM,kBAAAN,EAAA,KAAAE,cAAAF,EAAA,KAAAO,MAAAA,KAAAP,EAAA;CAJH,IAAAQ,WAC2CD,IAK1CE;CAKwC,OALxCT,EAAA,OAAAL,YAAAK,EAAA,OAAAQ,YAGCC,KAAA,oBAAA,4BAAA,UAAA;EAA6CD,OAAAA;EAC1Cb;CACH,CAAA,GAAuCK,EAAA,KAAAL,UAAAK,EAAA,KAAAQ,UAAAR,EAAA,KAAAS,MAAAA,KAAAT,EAAA,IAFvCS;AAEuC,CAE1C"}
1
+ {"version":3,"file":"CommentsSelectedPathProvider-x5f1q0eW.js","names":["ReactNode","useCallback","useMemo","useState","CommentsAuthoringPathContext","CommentsAuthoringPathContextValue","CommentsAuthoringPathProviderProps","children","CommentsAuthoringPathProvider","props","$","_c","authoringPath","setAuthoringPath","t0","Symbol","for","nextAuthoringPath","handleSetAuthoringPath","t1","value","t2","useMemo","useFeatureEnabled","FEATURES","useSource","getPublishedId","CommentsUIMode","ResolveCommentsEnabled","enabled","mode","useResolveCommentsEnabled","documentId","documentType","$","_c","featureEnabled","isLoading","error","studioComments","document","comments","enabledFromConfig","t0","bb0","t1","Symbol","for","t2","value","memo","ReactNode","CommentsEnabledContext","useResolveCommentsEnabled","CommentsEnabledProviderProps","children","documentId","documentType","CommentsEnabledProvider","props","$","_c","value","t0","isEqual","memo","useCallback","useMemo","useState","CommentsSelectedPathContext","CommentsSelectedPath","CommentsSelectedPathContextValue","CommentsSelectedPathProviderProps","children","React","ReactNode","CommentsSelectedPathProvider","props","$","_c","selectedPath","setSelectedPath","t0","nextPath","handleSelectPath","t1","ctxValue","t2"],"sources":["../src/core/comments/context/authoring-path/CommentsAuthoringPathProvider.tsx","../src/core/comments/hooks/useResolveCommentsEnabled.ts","../src/core/comments/context/enabled/CommentsEnabledProvider.tsx","../src/core/comments/context/selected-path/CommentsSelectedPathProvider.tsx"],"sourcesContent":["import {type ReactNode, useCallback, useMemo, useState} from 'react'\nimport {CommentsAuthoringPathContext} from 'sanity/_singletons'\n\nimport {type CommentsAuthoringPathContextValue} from './types'\n\ninterface CommentsAuthoringPathProviderProps {\n children: ReactNode\n}\n\n/**\n * @beta\n * @hidden\n * This provider keeps track of the path that the user is currently authoring a comment for.\n * This is needed to make sure that we consistently keep the editor open when the user is\n * authoring a comment. The state is kept in a context to make sure that it is preserved\n * across re-renders. If this state was kept in a component, it would be reset every time\n * the component re-renders, for example, when the form is temporarily set to `readOnly`\n * while reconnecting.\n */\nexport function CommentsAuthoringPathProvider(props: CommentsAuthoringPathProviderProps) {\n const {children} = props\n const [authoringPath, setAuthoringPath] = useState<string | null>(null)\n\n const handleSetAuthoringPath = useCallback((nextAuthoringPath: string | null) => {\n setAuthoringPath(nextAuthoringPath)\n }, [])\n\n const value = useMemo(\n (): CommentsAuthoringPathContextValue => ({\n authoringPath,\n setAuthoringPath: handleSetAuthoringPath,\n }),\n [authoringPath, handleSetAuthoringPath],\n )\n\n return (\n <CommentsAuthoringPathContext.Provider value={value}>\n {children}\n </CommentsAuthoringPathContext.Provider>\n )\n}\n","import {useMemo} from 'react'\n\nimport {useFeatureEnabled, FEATURES} from '../../hooks/useFeatureEnabled'\nimport {useSource} from '../../studio/source'\nimport {getPublishedId} from '../../util/draftUtils'\nimport {type CommentsUIMode} from '../types'\n\ntype ResolveCommentsEnabled =\n | {\n enabled: false\n mode: null\n }\n | {\n enabled: true\n mode: CommentsUIMode\n }\n\n/**\n * @internal\n * A hook that resolves if comments are enabled for the current document and document type\n * and if the feature is enabled for the current project.\n */\nexport function useResolveCommentsEnabled(\n documentId: string,\n documentType: string,\n): ResolveCommentsEnabled {\n // Check if the projects plan has the feature enabled\n const {enabled: featureEnabled, isLoading, error} = useFeatureEnabled(FEATURES.studioComments)\n\n const {enabled} = useSource().document.comments\n // Check if the feature is enabled for the current document in the config\n const enabledFromConfig = useMemo(\n () => enabled({documentType, documentId: getPublishedId(documentId)}),\n [documentId, documentType, enabled],\n )\n\n const value: ResolveCommentsEnabled = useMemo(() => {\n // The feature is not enabled if:\n // - the feature is loading (`isLoading` is true)\n // - the feature is not enabled in the project (`enabledFromConfig` is false)\n // - there's an error when fetching the list of enabled features (`error` is set)\n if (isLoading || !enabledFromConfig || error) {\n return {enabled: false, mode: null}\n }\n\n return {\n enabled: true,\n mode: featureEnabled ? 'default' : 'upsell',\n }\n }, [isLoading, enabledFromConfig, error, featureEnabled])\n\n return value\n}\n","import {memo, type ReactNode} from 'react'\nimport {CommentsEnabledContext} from 'sanity/_singletons'\n\nimport {useResolveCommentsEnabled} from '../../hooks/useResolveCommentsEnabled'\n\ninterface CommentsEnabledProviderProps {\n children: ReactNode\n documentId: string\n documentType: string\n}\n\n/**\n * @beta\n * @hidden\n */\nexport const CommentsEnabledProvider = memo(function CommentsEnabledProvider(\n props: CommentsEnabledProviderProps,\n) {\n const {children, documentId, documentType} = props\n\n const value = useResolveCommentsEnabled(documentId, documentType)\n\n return <CommentsEnabledContext.Provider value={value}>{children}</CommentsEnabledContext.Provider>\n})\n","import isEqual from 'lodash-es/isEqual.js'\nimport {memo, useCallback, useMemo, useState} from 'react'\nimport {CommentsSelectedPathContext} from 'sanity/_singletons'\n\nimport {type CommentsSelectedPath, type CommentsSelectedPathContextValue} from './types'\n\ninterface CommentsSelectedPathProviderProps {\n children: React.ReactNode\n}\n\n/**\n * @internal\n */\nexport const CommentsSelectedPathProvider = memo(function CommentsSelectedPathProvider(\n props: CommentsSelectedPathProviderProps,\n) {\n const {children} = props\n const [selectedPath, setSelectedPath] = useState<CommentsSelectedPath | null>(null)\n\n const handleSelectPath = useCallback(\n (nextPath: CommentsSelectedPath | null) => {\n if (isEqual(selectedPath, nextPath)) return\n\n setSelectedPath(nextPath)\n },\n [selectedPath],\n )\n\n const ctxValue = useMemo(\n (): CommentsSelectedPathContextValue => ({\n selectedPath,\n setSelectedPath: handleSelectPath,\n }),\n [selectedPath, handleSelectPath],\n )\n\n return (\n <CommentsSelectedPathContext.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,EAAA,OAAAL,YAAAK,EAAA,OAAAQ,YAGCC,KAAA,oBAAA,4BAAA,UAAA;EAA6CD,OAAAA;EAC1Cb;CACH,CAAA,GAAuCK,EAAA,KAAAL,UAAAK,EAAA,KAAAQ,UAAAR,EAAA,KAAAS,MAAAA,KAAAT,EAAA,IAFvCS;AAEuC,CAE1C"}
@@ -1,6 +1,6 @@
1
- import { n as useFeatureEnabled, t as FEATURES } from "./useFeatureEnabled-D7BsN6xF.js";
2
- import { n as getDialogPropsFromContext, r as useUpsellContext, t as UpsellDialog } from "./UpsellDialog-B3IbZqLA.js";
3
- import { t as AddonDatasetProvider } from "./AddonDatasetProvider-DKjnqxwO.js";
1
+ import { n as useFeatureEnabled, t as FEATURES } from "./useFeatureEnabled-B_ywe2up.js";
2
+ import { n as getDialogPropsFromContext, r as useUpsellContext, t as UpsellDialog } from "./UpsellDialog-BmQSjdJg.js";
3
+ import { t as AddonDatasetProvider } from "./AddonDatasetProvider-Cp0gK33v.js";
4
4
  import { useState } from "react";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -65,4 +65,4 @@ function CommentsStudioLayout(props) {
65
65
  }
66
66
  export { CommentsStudioLayout };
67
67
 
68
- //# sourceMappingURL=CommentsStudioLayout-BTJ8Jz1o.js.map
68
+ //# sourceMappingURL=CommentsStudioLayout-CxZq2lGu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommentsStudioLayout-BTJ8Jz1o.js","names":["ReactNode","useCallback","useMemo","useState","CommentsOnboardingContext","CommentsOnboardingContextValue","VERSION","LOCAL_STORAGE_KEY","setLocalStorage","value","window","localStorage","setItem","JSON","stringify","getLocalStorage","getItem","parse","CommentsOnboardingProviderProps","children","CommentsOnboardingProvider","props","$","_c","t0","Symbol","for","dismissed","setDismissed","t1","handleDismiss","t2","isDismissed","ctxValue","t3","CommentsUpsellContext","getDialogPropsFromContext","useUpsellContext","UpsellDialog","CommentsUpsellProvider","props","$","_c","t0","Symbol","for","dataUri","feature","contextValue","t1","children","t2","t3","t4","LayoutProps","useFeatureEnabled","FEATURES","AddonDatasetProvider","CommentsOnboardingProvider","CommentsUpsellProvider","CommentsStudioLayout","props","$","_c","enabled","isLoading","studioComments","t0","renderDefault","children","t1","t2"],"sources":["../src/core/comments/context/onboarding/CommentsOnboardingProvider.tsx","../src/core/comments/context/upsell/CommentsUpsellProvider.tsx","../src/core/comments/plugin/studio-layout/CommentsStudioLayout.tsx"],"sourcesContent":["import {type ReactNode, useCallback, useMemo, useState} from 'react'\nimport {CommentsOnboardingContext} from 'sanity/_singletons'\n\nimport {type CommentsOnboardingContextValue} from './types'\n\nconst VERSION = 1\nconst LOCAL_STORAGE_KEY = `sanityStudio:comments:inspector:onboarding:dismissed:v${VERSION}`\n\nconst setLocalStorage = (value: boolean) => {\n try {\n window.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(value))\n } catch {\n // Fail silently\n }\n}\n\nconst getLocalStorage = (): boolean => {\n try {\n const value = window.localStorage.getItem(LOCAL_STORAGE_KEY)\n return value ? JSON.parse(value) : false\n } catch {\n return false\n }\n}\n\ninterface CommentsOnboardingProviderProps {\n children: ReactNode\n}\n\nexport function CommentsOnboardingProvider(props: CommentsOnboardingProviderProps) {\n const {children} = props\n const [dismissed, setDismissed] = useState<boolean>(getLocalStorage())\n\n const handleDismiss = useCallback(() => {\n setDismissed(true)\n setLocalStorage(true)\n }, [setDismissed])\n\n const ctxValue = useMemo(\n (): CommentsOnboardingContextValue => ({\n setDismissed: handleDismiss,\n isDismissed: dismissed,\n }),\n [handleDismiss, dismissed],\n )\n\n return (\n <CommentsOnboardingContext.Provider value={ctxValue}>\n {children}\n </CommentsOnboardingContext.Provider>\n )\n}\n","import {CommentsUpsellContext} from 'sanity/_singletons'\n\nimport {getDialogPropsFromContext, useUpsellContext} from '../../../hooks/useUpsellContext'\nimport {UpsellDialog} from '../../../studio/upsell/UpsellDialog'\n\n/**\n * @beta\n * @hidden\n */\nexport function CommentsUpsellProvider(props: {children: React.ReactNode}) {\n const contextValue = useUpsellContext({\n dataUri: '/journey/comments',\n feature: 'comments',\n })\n\n return (\n <CommentsUpsellContext.Provider value={contextValue}>\n {props.children}\n <UpsellDialog {...getDialogPropsFromContext(contextValue)} />\n </CommentsUpsellContext.Provider>\n )\n}\n","import {type LayoutProps} from '../../../config/studio/types'\nimport {useFeatureEnabled, FEATURES} from '../../../hooks/useFeatureEnabled'\nimport {AddonDatasetProvider} from '../../../studio/addonDataset/AddonDatasetProvider'\nimport {CommentsOnboardingProvider} from '../../context/onboarding/CommentsOnboardingProvider'\nimport {CommentsUpsellProvider} from '../../context/upsell/CommentsUpsellProvider'\n\nexport function CommentsStudioLayout(props: LayoutProps) {\n const {enabled, isLoading} = useFeatureEnabled(FEATURES.studioComments)\n const children = props.renderDefault(props)\n\n return (\n <AddonDatasetProvider>\n <CommentsOnboardingProvider>\n {!enabled && !isLoading ? (\n <CommentsUpsellProvider>{children}</CommentsUpsellProvider>\n ) : (\n children\n )}\n </CommentsOnboardingProvider>\n </AddonDatasetProvider>\n )\n}\n"],"mappings":";;;;;;;AAMA,MAAMO,oBAAoB,2DAEpBC,mBAAmBC,UAAmB;CAC1C,IAAI;EACFC,OAAOC,aAAaC,QAAQL,mBAAmBM,KAAKC,UAAUL,KAAK,CAAC;CACtE,QAAQ,CACN;AAEJ,GAEMM,wBAAiC;CACrC,IAAI;EACF,IAAMN,QAAQC,OAAOC,aAAaK,QAAQT,iBAAiB;EAC3D,OAAOE,QAAQI,KAAKI,MAAMR,KAAK,IAAI;CACrC,QAAQ;EACN,OAAO;CACT;AACF;AAMA,SAAOW,2BAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACL,EAAAJ,aAAmBE,OAAKG;CAAA,AAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,KAC4BF,KAAAT,gBAAgB,GAACO,EAAA,KAAAE,MAAAA,KAAAF,EAAA;CAArE,IAAA,CAAAK,WAAAC,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EAAA,OAAAW,MAF/DC,KAAA,qBAAA,sBAAA,UAAA;EAAuCL,OAAAA;EAAvC,UAAA,CACGC,IACDG,EACF;KAAiCX,EAAA,KAAAO,cAAAP,EAAA,KAAAD,MAAAU,UAAAT,EAAA,KAAAW,IAAAX,EAAA,KAAAY,MAAAA,KAAAZ,EAAA,IAHjCY;AAGiC;ACbrC,SAAOO,qBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACL,EAAAC,SAAAC,cAA6BV,kBAAkBC,SAAQU,cAAe,GAACC;CAAA,AAAAL,EAAA,OAAAD,QAC5BM,KAAAL,EAAA,MAA1BK,KAAAN,MAAKO,cAAeP,KAAK,GAACC,EAAA,KAAAD,OAAAC,EAAA,KAAAK;CAA3C,IAAAE,WAAiBF,IAA0BG;CAAA,AAAAR,EAAA,OAAAO,YAAAP,EAAA,OAAAE,WAAAF,EAAA,OAAAG,aAKpCK,KAAA,CAACN,WAAD,CAAaC,YACZ,oBAAC,wBAAD,EAAyBI,SAAF,CAAA,IADxBA,UAIAP,EAAA,KAAAO,UAAAP,EAAA,KAAAE,SAAAF,EAAA,KAAAG,WAAAH,EAAA,KAAAQ,MAAAA,KAAAR,EAAA;CAAA,IAAAS;CAEkB,OAFlBT,EAAA,OAAAQ,KAEkBC,KAAAT,EAAA,MARvBS,KAAA,oBAAC,sBAAD,EAAA,UACE,oBAAC,4BAAD,EAAA,UACGD,GADwB,CAAA,EADR,CAAA,GAQER,EAAA,KAAAQ,IAAAR,EAAA,KAAAS,KARvBA;AAQuB"}
1
+ {"version":3,"file":"CommentsStudioLayout-CxZq2lGu.js","names":["ReactNode","useCallback","useMemo","useState","CommentsOnboardingContext","CommentsOnboardingContextValue","VERSION","LOCAL_STORAGE_KEY","setLocalStorage","value","window","localStorage","setItem","JSON","stringify","getLocalStorage","getItem","parse","CommentsOnboardingProviderProps","children","CommentsOnboardingProvider","props","$","_c","t0","Symbol","for","dismissed","setDismissed","t1","handleDismiss","t2","isDismissed","ctxValue","t3","CommentsUpsellContext","getDialogPropsFromContext","useUpsellContext","UpsellDialog","CommentsUpsellProvider","props","$","_c","t0","Symbol","for","dataUri","feature","contextValue","t1","children","t2","t3","t4","LayoutProps","useFeatureEnabled","FEATURES","AddonDatasetProvider","CommentsOnboardingProvider","CommentsUpsellProvider","CommentsStudioLayout","props","$","_c","enabled","isLoading","studioComments","t0","renderDefault","children","t1","t2"],"sources":["../src/core/comments/context/onboarding/CommentsOnboardingProvider.tsx","../src/core/comments/context/upsell/CommentsUpsellProvider.tsx","../src/core/comments/plugin/studio-layout/CommentsStudioLayout.tsx"],"sourcesContent":["import {type ReactNode, useCallback, useMemo, useState} from 'react'\nimport {CommentsOnboardingContext} from 'sanity/_singletons'\n\nimport {type CommentsOnboardingContextValue} from './types'\n\nconst VERSION = 1\nconst LOCAL_STORAGE_KEY = `sanityStudio:comments:inspector:onboarding:dismissed:v${VERSION}`\n\nconst setLocalStorage = (value: boolean) => {\n try {\n window.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(value))\n } catch {\n // Fail silently\n }\n}\n\nconst getLocalStorage = (): boolean => {\n try {\n const value = window.localStorage.getItem(LOCAL_STORAGE_KEY)\n return value ? JSON.parse(value) : false\n } catch {\n return false\n }\n}\n\ninterface CommentsOnboardingProviderProps {\n children: ReactNode\n}\n\nexport function CommentsOnboardingProvider(props: CommentsOnboardingProviderProps) {\n const {children} = props\n const [dismissed, setDismissed] = useState<boolean>(getLocalStorage())\n\n const handleDismiss = useCallback(() => {\n setDismissed(true)\n setLocalStorage(true)\n }, [setDismissed])\n\n const ctxValue = useMemo(\n (): CommentsOnboardingContextValue => ({\n setDismissed: handleDismiss,\n isDismissed: dismissed,\n }),\n [handleDismiss, dismissed],\n )\n\n return (\n <CommentsOnboardingContext.Provider value={ctxValue}>\n {children}\n </CommentsOnboardingContext.Provider>\n )\n}\n","import {CommentsUpsellContext} from 'sanity/_singletons'\n\nimport {getDialogPropsFromContext, useUpsellContext} from '../../../hooks/useUpsellContext'\nimport {UpsellDialog} from '../../../studio/upsell/UpsellDialog'\n\n/**\n * @beta\n * @hidden\n */\nexport function CommentsUpsellProvider(props: {children: React.ReactNode}) {\n const contextValue = useUpsellContext({\n dataUri: '/journey/comments',\n feature: 'comments',\n })\n\n return (\n <CommentsUpsellContext.Provider value={contextValue}>\n {props.children}\n <UpsellDialog {...getDialogPropsFromContext(contextValue)} />\n </CommentsUpsellContext.Provider>\n )\n}\n","import {type LayoutProps} from '../../../config/studio/types'\nimport {useFeatureEnabled, FEATURES} from '../../../hooks/useFeatureEnabled'\nimport {AddonDatasetProvider} from '../../../studio/addonDataset/AddonDatasetProvider'\nimport {CommentsOnboardingProvider} from '../../context/onboarding/CommentsOnboardingProvider'\nimport {CommentsUpsellProvider} from '../../context/upsell/CommentsUpsellProvider'\n\nexport function CommentsStudioLayout(props: LayoutProps) {\n const {enabled, isLoading} = useFeatureEnabled(FEATURES.studioComments)\n const children = props.renderDefault(props)\n\n return (\n <AddonDatasetProvider>\n <CommentsOnboardingProvider>\n {!enabled && !isLoading ? (\n <CommentsUpsellProvider>{children}</CommentsUpsellProvider>\n ) : (\n children\n )}\n </CommentsOnboardingProvider>\n </AddonDatasetProvider>\n )\n}\n"],"mappings":";;;;;;;AAMA,MAAMO,oBAAoB,2DAEpBC,mBAAmBC,UAAmB;CAC1C,IAAI;EACFC,OAAOC,aAAaC,QAAQL,mBAAmBM,KAAKC,UAAUL,KAAK,CAAC;CACtE,QAAQ,CACN;AAEJ,GAEMM,wBAAiC;CACrC,IAAI;EACF,IAAMN,QAAQC,OAAOC,aAAaK,QAAQT,iBAAiB;EAC3D,OAAOE,QAAQI,KAAKI,MAAMR,KAAK,IAAI;CACrC,QAAQ;EACN,OAAO;CACT;AACF;AAMA,SAAOW,2BAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACL,EAAAJ,aAAmBE,OAAKG;CAAA,AAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,KAC4BF,KAA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AAA,IAAAC;CAC9B,OAD8BZ,EAAA,OAAAO,gBAAAP,EAAA,OAAAD,MAAAU,YAAAT,EAAA,OAAAW,MAF/DC,KAAA,qBAAA,sBAAA,UAAA;EAAuCL,OAAAA;EAAvC,UAAA,CACGC,IACDG,EACF;KAAiCX,EAAA,KAAAO,cAAAP,EAAA,KAAAD,MAAAU,UAAAT,EAAA,KAAAW,IAAAX,EAAA,KAAAY,MAAAA,KAAAZ,EAAA,IAHjCY;AAGiC;ACbrC,SAAOO,qBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACL,EAAAC,SAAAC,cAA6BV,kBAAkBC,SAAQU,cAAe,GAACC;CAAA,AAAAL,EAAA,OAAAD,QAC5BM,KAAAL,EAAA,MAA1BK,KAAAN,MAAKO,cAAeP,KAAK,GAACC,EAAA,KAAAD,OAAAC,EAAA,KAAAK;CAA3C,IAAAE,WAAiBF,IAA0BG;CAAA,AAAAR,EAAA,OAAAO,YAAAP,EAAA,OAAAE,WAAAF,EAAA,OAAAG,aAKpCK,KAAA,CAACN,WAAD,CAAaC,YACZ,oBAAC,wBAAD,EAAyBI,SAAF,CAAA,IADxBA,UAIAP,EAAA,KAAAO,UAAAP,EAAA,KAAAE,SAAAF,EAAA,KAAAG,WAAAH,EAAA,KAAAQ,MAAAA,KAAAR,EAAA;CAAA,IAAAS;CAEkB,OAFlBT,EAAA,OAAAQ,KAEkBC,KAAAT,EAAA,MARvBS,KAAA,oBAAC,sBAAD,EAAA,UACE,oBAAC,4BAAD,EAAA,UACGD,GADwB,CAAA,EADR,CAAA,GAQER,EAAA,KAAAQ,IAAAR,EAAA,KAAAS,KARvBA;AAQuB"}
@@ -1,15 +1,14 @@
1
1
  import { I as structureLocaleNamespace } from "./StructureToolProvider-bqgHqZki.js";
2
2
  import { a as Button$1, i as TooltipDelayGroupProvider$1, r as MenuButton$1, t as MenuItem$1 } from "./MenuItem-B0ry3E4J.js";
3
- import { d as PaneItem, f as assignId, l as BackLink, u as PaneHeaderActions, v as useStructureToolSetting } from "./structureTool-BCCGiqpF.js";
3
+ import { d as PaneItem, f as assignId, l as BackLink, u as PaneHeaderActions, v as useStructureToolSetting } from "./structureTool-By2eJI8F.js";
4
4
  import { a as usePaneLayout, i as Pane, n as PaneHeader$1, r as usePane, t as useStructureTool } from "./useStructureTool-CX6y4EKI.js";
5
5
  import { i as PaneContent } from "./constants-CEn05wvv.js";
6
- import { t as Delay } from "./Delay-DjgiAi06.js";
7
6
  import { memo, useEffect, useId, useState } from "react";
8
7
  import { NEVER, asyncScheduler, concat, debounce, defer, filter, fromEvent, map, merge, mergeMap, of, partition, share, tap, throttleTime, throwError, timer } from "rxjs";
9
8
  import { c } from "react/compiler-runtime";
10
9
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
10
  import { Box, Container, Flex, Heading, Menu, MenuDivider, Stack, Text, TextInput } from "@sanity/ui";
12
- import { CommandList, DEFAULT_STUDIO_CLIENT_OPTIONS, EMPTY_ARRAY, ErrorActions, LoadingBlock, SanityDefaultPreview, SourceProvider, Translate, catchWithCount, collate, compileFieldPath, createSWR, createSearch, getPublishedId, getSearchableTypes, isDev, measureFirstMatch, useActiveReleases, useClient, useGetI18nText, useI18nText, usePerspective, useReconnectingToast, useSchema, useSearchMaxFieldDepth, useSource, useTranslation, useUnique, useWorkspace } from "sanity";
11
+ import { CommandList, DEFAULT_STUDIO_CLIENT_OPTIONS, Delay, EMPTY_ARRAY, ErrorActions, LoadingBlock, SanityDefaultPreview, SourceProvider, Translate, catchWithCount, collate, compileFieldPath, createSWR, createSearch, getPublishedId, getSearchableTypes, isDev, measureFirstMatch, useActiveReleases, useClient, useGetI18nText, useI18nText, usePerspective, useReconnectingToast, useSchema, useSearchMaxFieldDepth, useSource, useTranslation, useUnique, useWorkspace } from "sanity";
13
12
  import { keyframes, styled } from "styled-components";
14
13
  import { useObservable, useObservableEvent } from "react-rx";
15
14
  import { filter as filter$1, map as map$1, mergeMap as mergeMap$1, scan as scan$1, share as share$1, shareReplay as shareReplay$1, switchMap as switchMap$1, take as take$1, takeUntil as takeUntil$1, withLatestFrom } from "rxjs/operators";
@@ -22,6 +21,7 @@ import { ArrowLeftIcon } from "@sanity/icons/ArrowLeft";
22
21
  import shallowEquals from "shallow-equals";
23
22
  import { SpinnerIcon } from "@sanity/icons/Spinner";
24
23
  import { isArraySchemaType, isIndexSegment, isKeySegment, isReferenceSchemaType } from "@sanity/types";
24
+ import { Box as Box$1 } from "@sanity-labs/ui-poc";
25
25
  import { SortIcon } from "@sanity/icons/Sort";
26
26
  import { parse } from "groq-js";
27
27
  import { ChannelError, ClientError, ServerError } from "@sanity/client";
@@ -32,10 +32,10 @@ const FULL_LIST_LIMIT = 2e3, DEFAULT_ORDERING = { by: [{
32
32
  direction: "desc"
33
33
  }] }, EMPTY_RECORD = {}, RootBox = styled(Box).withConfig({
34
34
  displayName: "RootBox",
35
- componentId: "sc-tol1b5-0"
35
+ componentId: "sc-3qadbj-0"
36
36
  })`position:relative;opacity:${(props) => props.$opacity || 1};transition:opacity 0.4s;`, CommandListBox = styled(Box).withConfig({
37
37
  displayName: "CommandListBox",
38
- componentId: "sc-tol1b5-1"
38
+ componentId: "sc-3qadbj-1"
39
39
  })`position:absolute;left:0;right:0;top:0;bottom:0;`, SKELETON_ITEMS = [...Array(30).keys()];
40
40
  function LoadingView(props) {
41
41
  let $ = c(4), { layout } = props, t0;
@@ -318,7 +318,7 @@ const DocumentListPaneSearchOrdering = memo(function DocumentListPaneSearchOrder
318
318
  let buttonText = t2;
319
319
  if (orderings.length === 0) {
320
320
  let t3;
321
- return $[9] === buttonText ? t3 = $[10] : (t3 = /* @__PURE__ */ jsx(Box, {
321
+ return $[9] === buttonText ? t3 = $[10] : (t3 = /* @__PURE__ */ jsx(Box$1, {
322
322
  paddingX: 2,
323
323
  paddingBottom: 1,
324
324
  children: /* @__PURE__ */ jsx(Text, {
@@ -375,7 +375,7 @@ const DocumentListPaneSearchOrdering = memo(function DocumentListPaneSearchOrder
375
375
  radius: 2
376
376
  }, $[33] = t11) : t11 = $[33];
377
377
  let t12;
378
- return $[34] !== menuButtonId || $[35] !== t10 || $[36] !== t4 ? (t12 = /* @__PURE__ */ jsx(Box, {
378
+ return $[34] !== menuButtonId || $[35] !== t10 || $[36] !== t4 ? (t12 = /* @__PURE__ */ jsx(Box$1, {
379
379
  paddingBottom: 1,
380
380
  children: /* @__PURE__ */ jsx(MenuButton$1, {
381
381
  button: t4,
@@ -1277,4 +1277,4 @@ const PaneContainer = memo(function PaneContainer(props) {
1277
1277
  PaneContainer.displayName = "Memo(PaneContainer)";
1278
1278
  export { ORDER_BY_IDS_PARAM_FIELD as n, PaneContainer as t };
1279
1279
 
1280
- //# sourceMappingURL=PaneContainer-D8iNUpZk.js.map
1280
+ //# sourceMappingURL=PaneContainer-B_cWaSSe.js.map