@sanity/sdk-react 3.8.0-next.20261002083245 → 3.8.0-next.20261002153042

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 (60) hide show
  1. package/dist/_exports/dashboard.d.ts +90 -13
  2. package/dist/_exports/dashboard.d.ts.map +1 -1
  3. package/dist/_exports/dashboard.js +15 -2
  4. package/dist/_exports/dashboard.js.map +1 -1
  5. package/dist/index.d.ts +72 -3
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +29 -3
  8. package/dist/index.js.map +1 -1
  9. package/dist/{useStudioWorkspacesByProjectIdDataset-C959ma9B.js → useStudioWorkspacesByProjectIdDataset-DFWEMnrV.js} +4 -1
  10. package/dist/useStudioWorkspacesByProjectIdDataset-DFWEMnrV.js.map +1 -0
  11. package/package.json +2 -2
  12. package/src/components/SanityApp.tsx +1 -0
  13. package/src/config/handles.ts +6 -0
  14. package/src/context/ComlinkTokenRefresh.tsx +1 -0
  15. package/src/context/DashboardTokenRefresh.tsx +1 -0
  16. package/src/context/SDKStudioContext.ts +3 -0
  17. package/src/context/SanityInstanceProvider.tsx +2 -0
  18. package/src/dashboard/createRemoteInstance.ts +4 -0
  19. package/src/dashboard/urlFor.ts +49 -12
  20. package/src/hooks/access/useCheckPermissions.ts +1 -0
  21. package/src/hooks/applications/useApplication.ts +1 -0
  22. package/src/hooks/applications/useApplications.ts +1 -0
  23. package/src/hooks/auth/useHandleOAuthCallback.tsx +1 -0
  24. package/src/hooks/auth/useOAuthAuthorize.tsx +1 -0
  25. package/src/hooks/auth/useOAuthTokens.tsx +3 -0
  26. package/src/hooks/comments/useCommentActions.ts +1 -0
  27. package/src/hooks/comments/useCommentThreads.ts +1 -0
  28. package/src/hooks/comments/useComments.ts +1 -0
  29. package/src/hooks/dashboard/useAgentResourceContext.ts +3 -1
  30. package/src/hooks/dashboard/useApplication.ts +1 -0
  31. package/src/hooks/dashboard/useApplicationBasePath.ts +1 -0
  32. package/src/hooks/dashboard/useApplicationConfig.ts +3 -0
  33. package/src/hooks/dashboard/useApplicationConfigs.ts +1 -0
  34. package/src/hooks/dashboard/useApplicationForegroundId.ts +1 -0
  35. package/src/hooks/dashboard/useApplications.ts +11 -0
  36. package/src/hooks/dashboard/useAuthToken.ts +1 -0
  37. package/src/hooks/dashboard/useCapabilities.ts +1 -0
  38. package/src/hooks/dashboard/useCurrentUser.ts +1 -0
  39. package/src/hooks/dashboard/useEmit.ts +3 -0
  40. package/src/hooks/dashboard/useNavigate.ts +5 -0
  41. package/src/hooks/dashboard/useNavigateToStudioDocument.ts +1 -0
  42. package/src/hooks/dashboard/useRemoteClient.ts +1 -0
  43. package/src/hooks/dashboard/useTopic.ts +1 -0
  44. package/src/hooks/dashboard/useWindowTitle.ts +1 -0
  45. package/src/hooks/document/useCreateDocument.ts +2 -0
  46. package/src/hooks/documents/useDocuments.ts +2 -0
  47. package/src/hooks/helpers/createFetcherHook.ts +2 -0
  48. package/src/hooks/helpers/createMutationHook.tsx +2 -0
  49. package/src/hooks/installations/useInstallation.ts +1 -0
  50. package/src/hooks/installations/useInstallations.ts +1 -0
  51. package/src/hooks/paginatedDocuments/usePaginatedDocuments.ts +2 -0
  52. package/src/hooks/presence/usePresence.ts +1 -0
  53. package/src/hooks/presence/usePresenceForDocument.ts +6 -1
  54. package/src/hooks/presence/useReportPresence.ts +6 -1
  55. package/src/hooks/preview/useDocumentPreview.tsx +2 -0
  56. package/src/hooks/projection/useDocumentProjection.ts +2 -0
  57. package/src/hooks/releases/usePerspective.ts +17 -23
  58. package/src/hooks/users/useUser.ts +1 -0
  59. package/src/hooks/users/useUsers.ts +1 -0
  60. package/dist/useStudioWorkspacesByProjectIdDataset-C959ma9B.js.map +0 -1
@@ -42,11 +42,13 @@ import { UserOptions } from "@module-federation/runtime/types";
42
42
  * ```
43
43
  *
44
44
  * @public
45
+ * @category Dashboard
45
46
  */
46
47
  declare const DashboardTokenRefreshProvider: React.FC<PropsWithChildren>;
47
48
  type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
48
49
  /**
49
50
  * @public
51
+ * @category Remote Modules
50
52
  */
51
53
  type FederationRemote = {
52
54
  name: string;
@@ -54,10 +56,12 @@ type FederationRemote = {
54
56
  };
55
57
  /**
56
58
  * @public
59
+ * @category Remote Modules
57
60
  */
58
61
  type CreateRemoteInstanceOptions = MakeOptional<Pick<UserOptions, 'name' | 'remotes' | 'shared' | 'plugins'>, 'remotes' | 'plugins'>;
59
62
  /**
60
63
  * @public
64
+ * @category Remote Modules
61
65
  */
62
66
  interface RemoteInstance {
63
67
  registerRemotes(remotes: FederationRemote[]): void;
@@ -69,9 +73,13 @@ interface RemoteInstance {
69
73
  /**
70
74
  * Creates a client for registering, loading, and preloading federated modules.
71
75
  * @public
76
+ * @category Remote Modules
72
77
  */
73
78
  export declare function createRemoteInstance(options: CreateRemoteInstanceOptions): RemoteInstance;
74
- /** @public */
79
+ /**
80
+ * @public
81
+ * @category URLs
82
+ */
75
83
  interface DashboardUrl {
76
84
  url(options?: {
77
85
  origin?: string;
@@ -81,7 +89,10 @@ interface DashboardUrl {
81
89
  }): URL;
82
90
  toString(): string;
83
91
  }
84
- /** @public */
92
+ /**
93
+ * @public
94
+ * @category URLs
95
+ */
85
96
  interface EditIntentParameters {
86
97
  id: string;
87
98
  /** The document schema type, for example `post`. */
@@ -89,16 +100,25 @@ interface EditIntentParameters {
89
100
  /** Requests a Studio edit mode, such as `structure` or `presentation`. */
90
101
  mode?: 'structure' | 'presentation' | (string & Record<never, never>);
91
102
  }
92
- /** @public */
103
+ /**
104
+ * @public
105
+ * @category URLs
106
+ */
93
107
  interface CreateIntentParameters {
94
108
  template: string;
95
109
  type: string;
96
110
  }
97
- /** @public */
111
+ /**
112
+ * @public
113
+ * @category URLs
114
+ */
98
115
  interface ReleaseIntentParameters {
99
116
  id: string;
100
117
  }
101
- /** @public */
118
+ /**
119
+ * @public
120
+ * @category URLs
121
+ */
102
122
  interface StudioWorkspaceUrl extends DashboardUrl {
103
123
  intent(intent: 'edit', parameters: EditIntentParameters): StudioIntentUrl;
104
124
  intent(intent: 'create', parameters: CreateIntentParameters): StudioIntentUrl;
@@ -106,26 +126,41 @@ interface StudioWorkspaceUrl extends DashboardUrl {
106
126
  path(...path: string[]): DashboardUrl;
107
127
  task(taskId: string): DashboardUrl;
108
128
  }
109
- /** @public */
129
+ /**
130
+ * @public
131
+ * @category URLs
132
+ */
110
133
  interface StudioUrl extends StudioWorkspaceUrl {
111
134
  workspace(workspace: string): StudioWorkspaceUrl;
112
135
  }
113
- /** @public */
136
+ /**
137
+ * @public
138
+ * @category URLs
139
+ */
114
140
  interface StudioIntentUrl extends DashboardUrl {
115
141
  perspective(perspective: string): StudioIntentUrl;
116
142
  comment(commentId: string): StudioIntentUrl;
117
143
  task(taskId: string): DashboardUrl;
118
144
  }
119
- /** @public */
145
+ /**
146
+ * @public
147
+ * @category URLs
148
+ */
120
149
  interface CoreApplicationUrl extends DashboardUrl {
121
150
  path(...path: string[]): DashboardUrl;
122
151
  }
123
- /** @public */
152
+ /**
153
+ * @public
154
+ * @category URLs
155
+ */
124
156
  interface MediaLibraryUrl extends DashboardUrl {
125
157
  asset(assetId: string): DashboardUrl;
126
158
  collection(collectionId: string): DashboardUrl;
127
159
  }
128
- /** @public */
160
+ /**
161
+ * @public
162
+ * @category URLs
163
+ */
129
164
  interface CanvasUrl extends DashboardUrl {
130
165
  document(documentId: string): DashboardUrl;
131
166
  }
@@ -133,6 +168,7 @@ interface CanvasUrl extends DashboardUrl {
133
168
  * Base class for immutable URL grammars.
134
169
  *
135
170
  * @public
171
+ * @category URLs
136
172
  */
137
173
  export declare class UrlBuilder implements DashboardUrl {
138
174
  #private;
@@ -265,7 +301,10 @@ export declare class UrlBuilder implements DashboardUrl {
265
301
  */
266
302
  toString(): string;
267
303
  }
268
- /** @public */
304
+ /**
305
+ * @public
306
+ * @category URLs
307
+ */
269
308
  interface Urls {
270
309
  studios(): DashboardUrl;
271
310
  studios(appId: string): StudioUrl;
@@ -279,10 +318,15 @@ interface Urls {
279
318
  new (url: URL): UrlBuilder;
280
319
  }>>>(builders: Builders & Partial<Record<keyof this, never>>): this & { readonly [Name in keyof Builders]: () => InstanceType<Builders[Name]>; };
281
320
  }
282
- /** @public */
321
+ /**
322
+ * @public
323
+ * @category URLs
324
+ */
283
325
  export declare const urlFor: Urls;
284
326
  /**
285
327
  * @public
328
+ * @category Types
329
+ * @category Agent Actions
286
330
  */
287
331
  interface AgentResourceContextOptions {
288
332
  /**
@@ -309,7 +353,7 @@ interface AgentResourceContextOptions {
309
353
  * - In a federated app (message bus), it publishes {@link useApplicationContext}'s
310
354
  * `applications.context.update` topic. Reach for `useApplicationContext` directly in new code.
311
355
  *
312
- * @category Agent
356
+ * @category Agent Actions
313
357
  * @param options - The resource context options containing projectId, dataset, and optional documentId
314
358
  *
315
359
  * @example
@@ -346,6 +390,8 @@ type ViewInterface = Exclude<DashboardApplicationInterface, {
346
390
  * {@link DashboardWebWorker.application}, and the input to module loading. Widens
347
391
  * {@link ApplicationBase} so `type` also covers installations.
348
392
  * @public
393
+ * @category Types
394
+ * @category Dashboard
349
395
  */
350
396
  type DashboardApplicationBase = Omit<ApplicationBase, 'type'> & {
351
397
  readonly type: ApplicationBase['type'] | 'installation';
@@ -355,6 +401,8 @@ type DashboardApplicationBase = Omit<ApplicationBase, 'type'> & {
355
401
  /**
356
402
  * A dashboard view exposed by an application or installation.
357
403
  * @public
404
+ * @category Types
405
+ * @category Dashboard
358
406
  */
359
407
  type DashboardView = { [Type in ViewInterface['type']]: Omit<Extract<ViewInterface, {
360
408
  type: Type;
@@ -366,6 +414,8 @@ type DashboardView = { [Type in ViewInterface['type']]: Omit<Extract<ViewInterfa
366
414
  /**
367
415
  * A web worker exposed by an application or installation.
368
416
  * @public
417
+ * @category Types
418
+ * @category Dashboard
369
419
  */
370
420
  type DashboardWebWorker = Extract<DashboardApplicationInterface, {
371
421
  type: 'worker';
@@ -377,6 +427,8 @@ type DashboardWebWorker = Extract<DashboardApplicationInterface, {
377
427
  * An installation shaped into the shared application base, with its raw record kept under
378
428
  * `installation` for consumers that need the full record.
379
429
  * @public
430
+ * @category Types
431
+ * @category Dashboard
380
432
  */
381
433
  type DashboardInstallation = Omit<DashboardApplicationBase, 'type'> & {
382
434
  readonly type: 'installation';
@@ -387,6 +439,8 @@ type DashboardInstallation = Omit<DashboardApplicationBase, 'type'> & {
387
439
  * loadable views and web workers. `type` distinguishes the kinds and `isLocal` marks dev-server
388
440
  * applications; render a list without branching.
389
441
  * @public
442
+ * @category Types
443
+ * @category Dashboard
390
444
  */
391
445
  type DashboardApplication = (DashboardTopicApplication | DashboardInstallation) & Pick<DashboardApplicationBase, 'isLocal'> & {
392
446
  readonly views: DashboardView[];
@@ -410,6 +464,7 @@ type DashboardApplication = (DashboardTopicApplication | DashboardInstallation)
410
464
  * ```
411
465
  *
412
466
  * @public
467
+ * @category Dashboard
413
468
  */
414
469
  export declare function useApplications(): DashboardApplication[];
415
470
  /**
@@ -426,6 +481,7 @@ export declare function useApplications(): DashboardApplication[];
426
481
  * ```
427
482
  *
428
483
  * @public
484
+ * @category Dashboard
429
485
  */
430
486
  export declare function useApplication(applicationId: DashboardApplication['id']): DashboardApplication | null;
431
487
  /**
@@ -443,11 +499,14 @@ export declare function useApplication(applicationId: DashboardApplication['id']
443
499
  * ```
444
500
  *
445
501
  * @public
502
+ * @category Dashboard
446
503
  */
447
504
  export declare function useApplicationBasePath(): TopicData$1<'applications.base-path'>;
448
505
  /**
449
506
  * Selects an application configuration by application id or application type.
450
507
  * @public
508
+ * @category Types
509
+ * @category Dashboard
451
510
  */
452
511
  type ApplicationConfigSelector = {
453
512
  appId: Application['id'];
@@ -475,6 +534,7 @@ type ApplicationConfigSelector = {
475
534
  * ```
476
535
  *
477
536
  * @public
537
+ * @category Dashboard
478
538
  */
479
539
  export declare function useApplicationConfig(selector: ApplicationConfigSelector): ApplicationConfig$1 | null;
480
540
  /**
@@ -491,6 +551,7 @@ export declare function useApplicationConfig(selector: ApplicationConfigSelector
491
551
  * ```
492
552
  *
493
553
  * @public
554
+ * @category Dashboard
494
555
  */
495
556
  export declare function useApplicationConfigs(): readonly ApplicationConfig$1[];
496
557
  /**
@@ -540,6 +601,7 @@ export declare function useApplicationContext(context: ApplicationContext$1 | nu
540
601
  * ```
541
602
  *
542
603
  * @public
604
+ * @category Dashboard
543
605
  */
544
606
  export declare function useApplicationForegroundId(): Application['id'] | null;
545
607
  /**
@@ -556,6 +618,7 @@ export declare function useApplicationForegroundId(): Application['id'] | null;
556
618
  * ```
557
619
  *
558
620
  * @public
621
+ * @category Dashboard
559
622
  */
560
623
  export declare function useAuthToken(): string | null;
561
624
  /**
@@ -577,6 +640,7 @@ export declare function useAuthToken(): string | null;
577
640
  * ```
578
641
  *
579
642
  * @public
643
+ * @category Dashboard
580
644
  */
581
645
  export declare function useCapabilities(): TopicData$1<'applications.capabilities'>;
582
646
  /**
@@ -593,11 +657,14 @@ export declare function useCapabilities(): TopicData$1<'applications.capabilitie
593
657
  * ```
594
658
  *
595
659
  * @public
660
+ * @category Dashboard
596
661
  */
597
662
  export declare function useCurrentUser(): CurrentUser$1 | null;
598
663
  /**
599
664
  * Emits a dashboard event topic, typed to the topic's payload and reply.
600
665
  * @public
666
+ * @category Types
667
+ * @category Dashboard
601
668
  */
602
669
  type TopicEmitter<K extends EventTopic$1> = (...args: PayloadOf$1<K> extends void ? [payload?: void, options?: MessageBusEmitOptions$1] : [payload: PayloadOf$1<K>, options?: MessageBusEmitOptions$1]) => MessageBusEmitResult$1<ReplyOf$1<K>>;
603
670
  /**
@@ -647,6 +714,7 @@ type TopicEmitter<K extends EventTopic$1> = (...args: PayloadOf$1<K> extends voi
647
714
  * ```
648
715
  *
649
716
  * @public
717
+ * @category Dashboard
650
718
  */
651
719
  export declare function useEmit<K extends EventTopic$1>(topic: K): TopicEmitter<K>;
652
720
  /**
@@ -654,6 +722,8 @@ export declare function useEmit<K extends EventTopic$1>(topic: K): TopicEmitter<
654
722
  * `path` is relative to the app's own route, with no leading slash (`'documents/abc'`), and may
655
723
  * carry a query string and hash.
656
724
  * @public
725
+ * @category Types
726
+ * @category Dashboard
657
727
  */
658
728
  type DashboardNavigation = PathChangeMessage['data'];
659
729
  /**
@@ -665,6 +735,8 @@ type DashboardNavigation = PathChangeMessage['data'];
665
735
  * `'dashboard'`, `path` is a Dashboard URL from {@link urlFor} and is navigated to as-is; only
666
736
  * the federated runtime supports it.
667
737
  * @public
738
+ * @category Types
739
+ * @category Dashboard
668
740
  */
669
741
  type NavigateToDashboardPath = (options: {
670
742
  path: string;
@@ -717,11 +789,13 @@ type NavigateToDashboardPath = (options: {
717
789
  * return null
718
790
  * }
719
791
  * ```
792
+ * @category Dashboard
720
793
  */
721
794
  export declare function useNavigate(navigateFn: (options: DashboardNavigation) => void): NavigateToDashboardPath;
722
795
  /**
723
796
  * @public
724
797
  * @category Types
798
+ * @category Documents
725
799
  */
726
800
  interface NavigateToStudioResult {
727
801
  navigateToStudioDocument: () => void;
@@ -802,6 +876,7 @@ export declare function useOrganizationId(): string | undefined;
802
876
  * Returns a remote client shared by hooks using the same Sanity instance.
803
877
  * The first call creates the client; later calls reuse it.
804
878
  * @public
879
+ * @category Dashboard
805
880
  */
806
881
  export declare const useRemoteClient: () => RemoteInstance;
807
882
  /**
@@ -820,6 +895,7 @@ export declare const useRemoteClient: () => RemoteInstance;
820
895
  * ```
821
896
  *
822
897
  * @public
898
+ * @category Dashboard
823
899
  */
824
900
  export declare const useTopic: <K extends StateTopic$1>(topic: K) => TopicData$1<K>;
825
901
  /**
@@ -863,6 +939,7 @@ export declare const useTopic: <K extends StateTopic$1>(topic: K) => TopicData$1
863
939
  * ```
864
940
  *
865
941
  * @public
942
+ * @category Dashboard
866
943
  */
867
944
  export declare function useWindowTitle(viewTitle?: string): void;
868
945
  export { type AgentResourceContextOptions, type ApplicationConfig, type ApplicationConfigAppType, type ApplicationConfigSelector, type ApplicationContext, type CanvasUrl, type Capability, type CapabilityRecord, type ConnectMessageBusOptions, type CoreApplicationUrl, type CreateIntentParameters, type CreateRemoteInstanceOptions, type DashboardApplication, type DashboardApplicationBase, type DashboardInstallation, type DashboardNavigation, type DashboardTopics, type DashboardUrl, type DashboardView, type DashboardWebWorker, type EditIntentParameters, type EventTopic, type EventTopicDef, type FederationRemote, type MediaLibraryUrl, type MessageBus, type MessageBusAbortOptions, type MessageBusClient, type MessageBusConnection, type MessageBusEmitOptions, type MessageBusEmitResult, MessageBusError, type MessageBusErrorCode, type MessageBusHost, type MessageBusMessage, type MessageBusMeta, type MessageBusQueryOptions, type MessageBusStateSource, type NavigateToDashboardPath, type NavigateToStudioResult, type NavigationLocation, type NavigationTarget, type PayloadOf, type ReleaseIntentParameters, type RemoteInstance, type RemoteModuleRef, type ReplyOf, type StateTopic, type StateTopicDef, type StudioIntentUrl, type StudioUrl, type StudioWorkspaceUrl, DashboardTokenRefreshProvider as TokenRefreshProvider, type TopicData, type TopicEmitter, TopicError, type TopicName, type TopicResult, type Topics, type Urls, type ValueOf, capabilities, connectMessageBus };
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.d.ts","names":["React","PropsWithChildren","DashboardTokenRefreshProvider","FC","UserOptions","MakeOptional","T","K","Omit","Pick","Partial","FederationRemote","CreateRemoteInstanceOptions","RemoteInstance","Promise","createRemoteInstance","DashboardUrl","URL","EditIntentParameters","Record","CreateIntentParameters","ReleaseIntentParameters","StudioWorkspaceUrl","StudioIntentUrl","StudioUrl","CoreApplicationUrl","MediaLibraryUrl","CanvasUrl","UrlBuilder","Builder","origin","Urls","Builders","Readonly","Partial","Name","InstanceType","urlFor","AgentResourceContextOptions","useAgentResourceContext","ApplicationBase","Installation","InstallationInclude","RemoteModuleRef","ValueOf","DashboardTopicEntry","NonNullable","Extract","DashboardTopicApplication","DashboardApplicationInterface","ViewInterface","Exclude","DashboardApplicationBase","Omit","DashboardView","Type","DashboardWebWorker","DashboardInstallation","DashboardApplication","Pick","useApplications","ValueOf","RemoteModuleRef","DashboardApplication","useApplication","TopicData","useApplicationBasePath","TopicData","Application","ApplicationConfig","ApplicationConfigAppType","ApplicationConfigSelector","useApplicationConfig","ApplicationConfigAppType","ApplicationConfig","ApplicationConfig","useApplicationConfigs","ApplicationConfig","ApplicationContext","useApplicationContext","ApplicationContext","Application","useApplicationForegroundId","useAuthToken","TopicData","useCapabilities","TopicData","CurrentUser","useCurrentUser","CurrentUser","EventTopic","MessageBusEmitOptions","MessageBusEmitResult","PayloadOf","ReplyOf","TopicEmitter","K","useEmit","EventTopic","PayloadOf","MessageBusEmitOptions","ReplyOf","MessageBusEmitResult","PathChangeMessage","DashboardNavigation","NavigateToDashboardPath","useNavigate","DocumentHandle","NavigateToStudioResult","useNavigateToStudioDocument","useOrganizationId","RemoteInstance","useRemoteClient","StateTopic","TopicData","useTopic","K","StateTopic","TopicData","useWindowTitle"],"sources":["../../src/context/DashboardTokenRefresh.tsx","../../src/dashboard/createRemoteInstance.ts","../../src/dashboard/urlFor.ts","../../src/hooks/dashboard/useAgentResourceContext.ts","../../src/hooks/dashboard/useApplications.ts","../../src/hooks/dashboard/useApplication.ts","../../src/hooks/dashboard/useApplicationBasePath.ts","../../src/hooks/dashboard/useApplicationConfig.ts","../../src/hooks/dashboard/useApplicationConfigs.ts","../../src/hooks/dashboard/useApplicationContext.ts","../../src/hooks/dashboard/useApplicationForegroundId.ts","../../src/hooks/dashboard/useAuthToken.ts","../../src/hooks/dashboard/useCapabilities.ts","../../src/hooks/dashboard/useCurrentUser.ts","../../src/hooks/dashboard/useEmit.ts","../../src/hooks/dashboard/useNavigate.ts","../../src/hooks/dashboard/useNavigateToStudioDocument.ts","../../src/hooks/dashboard/useOrganizationId.tsx","../../src/hooks/dashboard/useRemoteClient.ts","../../src/hooks/dashboard/useTopic.ts","../../src/hooks/dashboard/useWindowTitle.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+FaE,+BAA+BF,MAAM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I,8BAA8BD;;;;;;;;;;;;;;;;wBCF9BE;;;;;;;;;;;;;;;;;;;;;wBCOAE,mBAAmBD;;;;;;;;;;;;;;;;wBCLnBI,kBAAkBD;;;;;KCHtBQ,aAAa,UAAUL,oBAC9B,MAAMG,YAAUG,mBACd,gBAAgB,UAAUL,4BAC1B,SAASE,YAAUG,IAAI,UAAUL,6BACnCC,uBAAqBE,UAAQE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkDlBC,QAAQ,UAAUP,cAAY,OAAOM,IAAID,aAAaC;;;;;;;KC/C1DQ,sBAAsBD;;;;;;;;;;;KAYtBE,2BAA2B;EACrC;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkDcC,YACd,aAAa,SAASF,+BACrBC;;;;;UCxEcG;EACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0GcC,4BACd,gBAAgBF,gBAChB,8BACCC;;;;;;;;;;;;;;;;;;;;;;;wBClGaE;;;;;;qBCrBHE,uBAAuBD;;;;;;;;;;;;;;;;;;qBCavBI,WAMN,UAAUF,cAAY,OAAOG,MAAMF,YAAUE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBC4CpCG,eAAe"}
1
+ {"version":3,"file":"dashboard.d.ts","names":["React","PropsWithChildren","DashboardTokenRefreshProvider","FC","UserOptions","MakeOptional","T","K","Omit","Pick","Partial","FederationRemote","CreateRemoteInstanceOptions","RemoteInstance","Promise","createRemoteInstance","DashboardUrl","URL","EditIntentParameters","Record","CreateIntentParameters","ReleaseIntentParameters","StudioWorkspaceUrl","StudioIntentUrl","StudioUrl","CoreApplicationUrl","MediaLibraryUrl","CanvasUrl","UrlBuilder","Builder","origin","Urls","Builders","Readonly","Partial","Name","InstanceType","urlFor","AgentResourceContextOptions","useAgentResourceContext","ApplicationBase","Installation","InstallationInclude","RemoteModuleRef","ValueOf","DashboardTopicEntry","NonNullable","Extract","DashboardTopicApplication","DashboardApplicationInterface","ViewInterface","Exclude","DashboardApplicationBase","Omit","DashboardView","Type","DashboardWebWorker","DashboardInstallation","DashboardApplication","Pick","useApplications","ValueOf","RemoteModuleRef","DashboardApplication","useApplication","TopicData","useApplicationBasePath","TopicData","Application","ApplicationConfig","ApplicationConfigAppType","ApplicationConfigSelector","useApplicationConfig","ApplicationConfigAppType","ApplicationConfig","ApplicationConfig","useApplicationConfigs","ApplicationConfig","ApplicationContext","useApplicationContext","ApplicationContext","Application","useApplicationForegroundId","useAuthToken","TopicData","useCapabilities","TopicData","CurrentUser","useCurrentUser","CurrentUser","EventTopic","MessageBusEmitOptions","MessageBusEmitResult","PayloadOf","ReplyOf","TopicEmitter","K","useEmit","EventTopic","PayloadOf","MessageBusEmitOptions","ReplyOf","MessageBusEmitResult","PathChangeMessage","DashboardNavigation","NavigateToDashboardPath","useNavigate","DocumentHandle","NavigateToStudioResult","useNavigateToStudioDocument","useOrganizationId","RemoteInstance","useRemoteClient","StateTopic","TopicData","useTopic","K","StateTopic","TopicData","useWindowTitle"],"sources":["../../src/context/DashboardTokenRefresh.tsx","../../src/dashboard/createRemoteInstance.ts","../../src/dashboard/urlFor.ts","../../src/hooks/dashboard/useAgentResourceContext.ts","../../src/hooks/dashboard/useApplications.ts","../../src/hooks/dashboard/useApplication.ts","../../src/hooks/dashboard/useApplicationBasePath.ts","../../src/hooks/dashboard/useApplicationConfig.ts","../../src/hooks/dashboard/useApplicationConfigs.ts","../../src/hooks/dashboard/useApplicationContext.ts","../../src/hooks/dashboard/useApplicationForegroundId.ts","../../src/hooks/dashboard/useAuthToken.ts","../../src/hooks/dashboard/useCapabilities.ts","../../src/hooks/dashboard/useCurrentUser.ts","../../src/hooks/dashboard/useEmit.ts","../../src/hooks/dashboard/useNavigate.ts","../../src/hooks/dashboard/useNavigateToStudioDocument.ts","../../src/hooks/dashboard/useOrganizationId.tsx","../../src/hooks/d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KCV9BM;EACP,OAAOH;EAAmB;;EAC1B;EAAe,SAASE;;;;;;;;;;;;;;;;;;;;;;;wBAuBbE,qBACd,UAAUD,4BACTF;;;;;;;;;;;;;;;;;wBCdaO,kCAAkCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBCalCI,sBAAsB,SAASD;;;;;;;;;;;;;;;;;wBCjB/BI,8BAA8BD;;;;;;;;;;;;;;;;;wBCF9BE;;;;;;;;;;;;;;;;;;;;;;wBCOAE,mBAAmBD;;;;;;;;;;;;;;;;;wBCLnBI,kBAAkBD;;;;;;;KCFtBQ,aAAa,UAAUL,oBAC9B,MAAMG,YAAUG,mBACd,gBAAgB,UAAUL,4BAC1B,SAASE,YAAUG,IAAI,UAAUL,6BACnCC,uBAAqBE,UAAQE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmDlBC,QAAQ,UAAUP,cAAY,OAAOM,IAAID,aAAaC;;;;;;;;;KChD1DQ,sBAAsBD;;;;;;;;;;;;;KActBE,2BAA2B;EACrC;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmDcC,YACd,aAAa,SAASF,+BACrBC;;;;;;UC5EcG;EACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0GcC,4BACd,gBAAgBF,gBAChB,8BACCC;;;;;;;;;;;;;;;;;;;;;;;wBCnGaE;;;;;;;qBCpBHE,uBAAuBD;;;;;;;;;;;;;;;;;;;qBCavBI,WAMN,UAAUF,cAAY,OAAOG,MAAMF,YAAUE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBC4CpCG,eAAe"}
@@ -1,4 +1,4 @@
1
- import { a as DashboardTokenRefreshProvider, c as createStateSourceHook, i as useOrganizationId, l as useSanityInstance, n as useTopic, o as useWindowConnection, r as useEmit, t as useStudioWorkspacesByProjectIdDataset } from "../useStudioWorkspacesByProjectIdDataset-C959ma9B.js";
1
+ import { a as DashboardTokenRefreshProvider, c as createStateSourceHook, i as useOrganizationId, l as useSanityInstance, n as useTopic, o as useWindowConnection, r as useEmit, t as useStudioWorkspacesByProjectIdDataset } from "../useStudioWorkspacesByProjectIdDataset-DFWEMnrV.js";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import "@sanity/sdk";
4
4
  import { createLogger, getApplicationOrigin, isMessageBusEnvironment, requireDashboardMessageBus } from "@sanity/sdk/_internal";
@@ -22,6 +22,7 @@ function withManifest(remote) {
22
22
  /**
23
23
  * Creates a client for registering, loading, and preloading federated modules.
24
24
  * @public
25
+ * @category Remote Modules
25
26
  */
26
27
  function createRemoteInstance(options) {
27
28
  let logger = createLogger(options.name), instance = createInstance({
@@ -430,7 +431,7 @@ function useApplicationContext(context) {
430
431
  * - In a federated app (message bus), it publishes {@link useApplicationContext}'s
431
432
  * `applications.context.update` topic. Reach for `useApplicationContext` directly in new code.
432
433
  *
433
- * @category Agent
434
+ * @category Agent Actions
434
435
  * @param options - The resource context options containing projectId, dataset, and optional documentId
435
436
  *
436
437
  * @example
@@ -584,6 +585,7 @@ const loadableInterfaces = ({ activeDeployment, config }, isLocal) => isLocal ||
584
585
  * ```
585
586
  *
586
587
  * @public
588
+ * @category Dashboard
587
589
  */
588
590
  function useApplications() {
589
591
  let $ = c(2), applications = useTopic("applications.list"), t0;
@@ -606,6 +608,7 @@ function _temp$2(entry) {
606
608
  * ```
607
609
  *
608
610
  * @public
611
+ * @category Dashboard
609
612
  */
610
613
  function useApplication(applicationId) {
611
614
  return useApplications().find((t0) => {
@@ -628,6 +631,7 @@ function useApplication(applicationId) {
628
631
  * ```
629
632
  *
630
633
  * @public
634
+ * @category Dashboard
631
635
  */
632
636
  function useApplicationBasePath() {
633
637
  return useTopic("applications.base-path");
@@ -647,6 +651,7 @@ const NO_CONFIGS = Object.freeze([]);
647
651
  * ```
648
652
  *
649
653
  * @public
654
+ * @category Dashboard
650
655
  */
651
656
  function useApplicationConfigs() {
652
657
  return useTopic("applications.config") ?? NO_CONFIGS;
@@ -670,6 +675,7 @@ function useApplicationConfigs() {
670
675
  * ```
671
676
  *
672
677
  * @public
678
+ * @category Dashboard
673
679
  */
674
680
  function useApplicationConfig(selector) {
675
681
  let $ = c(3), configs = useApplicationConfigs(), t0;
@@ -689,6 +695,7 @@ function useApplicationConfig(selector) {
689
695
  * ```
690
696
  *
691
697
  * @public
698
+ * @category Dashboard
692
699
  */
693
700
  function useApplicationForegroundId() {
694
701
  return useTopic("applications.foreground");
@@ -707,6 +714,7 @@ function useApplicationForegroundId() {
707
714
  * ```
708
715
  *
709
716
  * @public
717
+ * @category Dashboard
710
718
  */
711
719
  function useAuthToken() {
712
720
  return useTopic("auth.token");
@@ -730,6 +738,7 @@ function useAuthToken() {
730
738
  * ```
731
739
  *
732
740
  * @public
741
+ * @category Dashboard
733
742
  */
734
743
  function useCapabilities() {
735
744
  return useTopic("applications.capabilities");
@@ -748,6 +757,7 @@ function useCapabilities() {
748
757
  * ```
749
758
  *
750
759
  * @public
760
+ * @category Dashboard
751
761
  */
752
762
  function useCurrentUser() {
753
763
  return useTopic("users.current");
@@ -798,6 +808,7 @@ function useCurrentUser() {
798
808
  * return null
799
809
  * }
800
810
  * ```
811
+ * @category Dashboard
801
812
  */
802
813
  function useNavigate(navigateFn) {
803
814
  return isMessageBusEnvironment() ? useBusNavigate(navigateFn) : useComlinkNavigate(navigateFn);
@@ -995,6 +1006,7 @@ function getRemoteClientState(instance) {
995
1006
  * Returns a remote client shared by hooks using the same Sanity instance.
996
1007
  * The first call creates the client; later calls reuse it.
997
1008
  * @public
1009
+ * @category Dashboard
998
1010
  */
999
1011
  const useRemoteClient = createStateSourceHook(getRemoteClientState);
1000
1012
  function resolveAppTitle(resource) {
@@ -1041,6 +1053,7 @@ function resolveAppTitle(resource) {
1041
1053
  * ```
1042
1054
  *
1043
1055
  * @public
1056
+ * @category Dashboard
1044
1057
  */
1045
1058
  function useWindowTitle(viewTitle) {
1046
1059
  isMessageBusEnvironment() || useComlinkWindowTitle(viewTitle);