@sanity/sdk-react 0.0.0-alpha.27 → 0.0.0-alpha.29
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/dist/index.d.ts +22 -61
- package/dist/index.js +1018 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/_exports/sdk-react.ts +1 -1
- package/src/hooks/dashboard/useNavigateToStudioDocument.test.ts +120 -4
- package/src/hooks/dashboard/useNavigateToStudioDocument.ts +51 -16
- package/src/hooks/dashboard/useStudioWorkspacesByProjectIdDataset.test.tsx +103 -90
- package/src/hooks/dashboard/useStudioWorkspacesByProjectIdDataset.ts +21 -13
- package/src/hooks/document/useDocumentPermissions.ts +1 -1
- package/src/hooks/projection/useProjection.ts +1 -1
- package/dist/_chunks-es/index.js +0 -5820
- package/dist/_chunks-es/index.js.map +0 -1
- package/dist/_chunks-es/node.js +0 -256
- package/dist/_chunks-es/node.js.map +0 -1
- package/dist/_chunks-es/stegaEncodeSourceMap.js +0 -340
- package/dist/_chunks-es/stegaEncodeSourceMap.js.map +0 -1
- package/src/components/auth/LoginFooter.test.tsx +0 -19
- package/src/components/auth/LoginFooter.tsx +0 -51
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {CanvasResource} from '@sanity/message-protocol'
|
|
|
5
5
|
import {ClientOptions} from '@sanity/sdk'
|
|
6
6
|
import {CurrentUser} from '@sanity/sdk'
|
|
7
7
|
import {DatasetHandle} from '@sanity/sdk'
|
|
8
|
+
import {DatasetsResponse} from '@sanity/client'
|
|
8
9
|
import {DocumentAction} from '@sanity/sdk'
|
|
9
10
|
import {DocumentEvent} from '@sanity/sdk'
|
|
10
11
|
import {DocumentHandle} from '@sanity/sdk'
|
|
@@ -25,6 +26,8 @@ import {SanityConfig} from '@sanity/sdk'
|
|
|
25
26
|
import {SanityDocument} from '@sanity/types'
|
|
26
27
|
import {SanityInstance} from '@sanity/sdk'
|
|
27
28
|
import {SanityProject} from '@sanity/sdk'
|
|
29
|
+
import {SanityProject as SanityProject_2} from '@sanity/client'
|
|
30
|
+
import {SanityProjectMember} from '@sanity/client'
|
|
28
31
|
import {SanityUser} from '@sanity/sdk'
|
|
29
32
|
import {SortOrderingItem} from '@sanity/types'
|
|
30
33
|
import {StudioResource} from '@sanity/message-protocol'
|
|
@@ -96,20 +99,19 @@ declare interface AuthBoundaryProps {
|
|
|
96
99
|
*/
|
|
97
100
|
export declare type ComlinkStatus = 'idle' | 'handshaking' | 'connected' | 'disconnected'
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/** @public */
|
|
103
|
-
export declare type DatasetsResponse = {
|
|
102
|
+
declare interface DashboardResource {
|
|
103
|
+
id: string
|
|
104
104
|
name: string
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
105
|
+
title: string
|
|
106
|
+
basePath: string
|
|
107
|
+
projectId: string
|
|
108
|
+
dataset: string
|
|
109
|
+
type: string
|
|
110
|
+
userApplicationId: string
|
|
111
|
+
url: string
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export {DatasetsResponse}
|
|
113
115
|
|
|
114
116
|
declare interface DocumentInteractionHistory {
|
|
115
117
|
recordEvent: (eventType: 'viewed' | 'edited' | 'created' | 'deleted') => void
|
|
@@ -484,41 +486,7 @@ export declare interface SanityAppProps {
|
|
|
484
486
|
|
|
485
487
|
export {SanityDocument}
|
|
486
488
|
|
|
487
|
-
|
|
488
|
-
declare interface SanityProject_2 {
|
|
489
|
-
id: string
|
|
490
|
-
displayName: string
|
|
491
|
-
/**
|
|
492
|
-
* @deprecated Use the `/user-applications` endpoint instead, which lists all deployed studios/applications
|
|
493
|
-
* @see https://www.sanity.io/help/studio-host-user-applications
|
|
494
|
-
*/
|
|
495
|
-
studioHost: string | null
|
|
496
|
-
organizationId: string | null
|
|
497
|
-
isBlocked: boolean
|
|
498
|
-
isDisabled: boolean
|
|
499
|
-
isDisabledByUser: boolean
|
|
500
|
-
createdAt: string
|
|
501
|
-
pendingInvites?: number
|
|
502
|
-
maxRetentionDays?: number
|
|
503
|
-
members: SanityProjectMember[]
|
|
504
|
-
metadata: {
|
|
505
|
-
cliInitializedAt?: string
|
|
506
|
-
color?: string
|
|
507
|
-
/**
|
|
508
|
-
* @deprecated Use the `/user-applications` endpoint instead, which lists all deployed studios/applications
|
|
509
|
-
* @see https://www.sanity.io/help/studio-host-user-applications
|
|
510
|
-
*/
|
|
511
|
-
externalStudioHost?: string
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
/** @public */
|
|
516
|
-
export declare interface SanityProjectMember {
|
|
517
|
-
id: string
|
|
518
|
-
role: string
|
|
519
|
-
isRobot: boolean
|
|
520
|
-
isCurrentUser: boolean
|
|
521
|
-
}
|
|
489
|
+
export {SanityProjectMember}
|
|
522
490
|
|
|
523
491
|
/**
|
|
524
492
|
* @internal
|
|
@@ -864,7 +832,7 @@ export declare function useDocumentEvent(
|
|
|
864
832
|
|
|
865
833
|
/**
|
|
866
834
|
*
|
|
867
|
-
* @
|
|
835
|
+
* @public
|
|
868
836
|
*
|
|
869
837
|
* Check if the current user has the specified permissions for the given document actions.
|
|
870
838
|
*
|
|
@@ -1271,6 +1239,8 @@ declare interface UseManageFavoriteProps extends DocumentHandle {
|
|
|
1271
1239
|
*
|
|
1272
1240
|
* @category Documents
|
|
1273
1241
|
* @param documentHandle - The document handle for the document to navigate to
|
|
1242
|
+
* @param preferredStudioUrl - The preferred studio url to navigate to if you have multiple
|
|
1243
|
+
* studios with the same projectId and dataset
|
|
1274
1244
|
* @returns An object containing:
|
|
1275
1245
|
* - `navigateToStudioDocument` - Function that when called will navigate to the studio document
|
|
1276
1246
|
* - `isConnected` - Boolean indicating if connection to Dashboard is established
|
|
@@ -1292,6 +1262,7 @@ declare interface UseManageFavoriteProps extends DocumentHandle {
|
|
|
1292
1262
|
*/
|
|
1293
1263
|
export declare function useNavigateToStudioDocument(
|
|
1294
1264
|
documentHandle: DocumentHandle,
|
|
1265
|
+
preferredStudioUrl?: string,
|
|
1295
1266
|
): NavigateToStudioResult
|
|
1296
1267
|
|
|
1297
1268
|
/**
|
|
@@ -1451,7 +1422,7 @@ declare type UseProject = {
|
|
|
1451
1422
|
export declare const useProject: UseProject
|
|
1452
1423
|
|
|
1453
1424
|
/**
|
|
1454
|
-
* @
|
|
1425
|
+
* @public
|
|
1455
1426
|
*
|
|
1456
1427
|
* Returns the projection values of a document (specified via a `DocumentHandle`),
|
|
1457
1428
|
* based on the provided projection string. These values are live and will update in realtime.
|
|
@@ -1854,18 +1825,8 @@ export declare type WindowMessageHandler<TFrameMessage extends FrameMessage> = (
|
|
|
1854
1825
|
event: TFrameMessage['data'],
|
|
1855
1826
|
) => TFrameMessage['response']
|
|
1856
1827
|
|
|
1857
|
-
declare interface Workspace {
|
|
1858
|
-
name: string
|
|
1859
|
-
title: string
|
|
1860
|
-
basePath: string
|
|
1861
|
-
dataset: string
|
|
1862
|
-
userApplicationId: string
|
|
1863
|
-
url: string
|
|
1864
|
-
_ref: string
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
1828
|
declare interface WorkspacesByProjectIdDataset {
|
|
1868
|
-
[key: `${string}:${string}`]:
|
|
1829
|
+
[key: `${string}:${string}`]: DashboardResource[]
|
|
1869
1830
|
}
|
|
1870
1831
|
|
|
1871
1832
|
export * from '@sanity/sdk'
|