@sanity/react-loader
Advanced tools
Comparing version
@@ -101,3 +101,5 @@ import type {ClientPerspective} from '@sanity/client' | ||
options?: UseQueryOptionsUndefinedInitial, | ||
): QueryStoreState<QueryResponseResult, QueryResponseError> & WithEncodeDataAttribute | ||
): QueryStoreState<QueryResponseResult, QueryResponseError> & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} | ||
<QueryResponseResult = unknown, QueryResponseError = unknown>( | ||
@@ -109,3 +111,5 @@ query: string, | ||
data: QueryResponseResult | ||
} & WithEncodeDataAttribute | ||
} & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} | ||
} | ||
@@ -179,3 +183,3 @@ | ||
export declare type WithEncodeDataAttribute = { | ||
declare type WithEncodeDataAttribute = { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
@@ -182,0 +186,0 @@ } |
@@ -125,3 +125,2 @@ import { createQueryStore as createQueryStore$1 } from "@sanity/core-loader"; | ||
}, | ||
// @ts-expect-error - update typings | ||
useQuery: useQuery2, | ||
@@ -128,0 +127,0 @@ setServerClient: () => { |
@@ -101,3 +101,5 @@ import type {ClientPerspective} from '@sanity/client' | ||
options?: UseQueryOptionsUndefinedInitial, | ||
): QueryStoreState<QueryResponseResult, QueryResponseError> & WithEncodeDataAttribute | ||
): QueryStoreState<QueryResponseResult, QueryResponseError> & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} | ||
<QueryResponseResult = unknown, QueryResponseError = unknown>( | ||
@@ -109,3 +111,5 @@ query: string, | ||
data: QueryResponseResult | ||
} & WithEncodeDataAttribute | ||
} & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} | ||
} | ||
@@ -179,3 +183,3 @@ | ||
export declare type WithEncodeDataAttribute = { | ||
declare type WithEncodeDataAttribute = { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
@@ -182,0 +186,0 @@ } |
@@ -101,3 +101,5 @@ import type {ClientPerspective} from '@sanity/client' | ||
options?: UseQueryOptionsUndefinedInitial, | ||
): QueryStoreState<QueryResponseResult, QueryResponseError> & WithEncodeDataAttribute | ||
): QueryStoreState<QueryResponseResult, QueryResponseError> & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} | ||
<QueryResponseResult = unknown, QueryResponseError = unknown>( | ||
@@ -109,3 +111,5 @@ query: string, | ||
data: QueryResponseResult | ||
} & WithEncodeDataAttribute | ||
} & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} | ||
} | ||
@@ -179,3 +183,3 @@ | ||
export declare type WithEncodeDataAttribute = { | ||
declare type WithEncodeDataAttribute = { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
@@ -182,0 +186,0 @@ } |
@@ -16,3 +16,2 @@ import { createQueryStore as createQueryStore$1 } from "@sanity/core-loader"; | ||
}, | ||
// @ts-expect-error - update typings | ||
useQuery: useQuery2, | ||
@@ -19,0 +18,0 @@ setServerClient: () => { |
@@ -6,4 +6,5 @@ import type {ClientPerspective} from '@sanity/client' | ||
import type {EnableLiveModeOptions} from '@sanity/core-loader' | ||
import type {EncodeDataAttributeFunction} from '@sanity/core-loader/encode-data-attribute' | ||
import {EncodeDataAttributeFunction} from '@sanity/core-loader/encode-data-attribute' | ||
import type {QueryParams} from '@sanity/client' | ||
import {QueryResponseInitial as QueryResponseInitial_2} from './client-only' | ||
import {QueryStoreState} from '@sanity/core-loader' | ||
@@ -15,2 +16,5 @@ import type {ResolveStudioUrl} from '@sanity/client/csm' | ||
import type {StudioUrl} from '@sanity/client/csm' | ||
import {UseLiveModeHook as UseLiveModeHook_2} from './client-only' | ||
import {UseQueryOptionsDefinedInitial as UseQueryOptionsDefinedInitial_2} from './client-only' | ||
import {UseQueryOptionsUndefinedInitial as UseQueryOptionsUndefinedInitial_2} from './client-only' | ||
@@ -26,3 +30,3 @@ export declare const createQueryStore: (options: CreateQueryStoreOptions) => QueryStore | ||
>, | ||
) => Promise<QueryResponseInitial<QueryResponseResult>> | ||
) => Promise<QueryResponseInitial_2<QueryResponseResult>> | ||
@@ -73,3 +77,3 @@ export declare type NonUndefinedGuard<T> = T extends undefined ? never : T | ||
export declare const useLiveMode: UseLiveModeHook | ||
export declare const useLiveMode: UseLiveModeHook_2 | ||
@@ -89,11 +93,15 @@ export declare type UseLiveModeHook = ( | ||
params?: QueryParams, | ||
options?: UseQueryOptionsUndefinedInitial, | ||
): QueryStoreState<QueryResponseResult, QueryResponseError> & WithEncodeDataAttribute | ||
options?: UseQueryOptionsUndefinedInitial_2, | ||
): QueryStoreState<QueryResponseResult, QueryResponseError> & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} | ||
<QueryResponseResult = unknown, QueryResponseError = unknown>( | ||
query: string, | ||
params?: QueryParams, | ||
options?: UseQueryOptionsDefinedInitial<QueryResponseResult>, | ||
options?: UseQueryOptionsDefinedInitial_2<QueryResponseResult>, | ||
): Omit<QueryStoreState<QueryResponseResult, QueryResponseError>, 'data'> & { | ||
data: QueryResponseResult | ||
} & WithEncodeDataAttribute | ||
} & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} | ||
} | ||
@@ -167,3 +175,3 @@ | ||
export declare type WithEncodeDataAttribute = { | ||
declare type WithEncodeDataAttribute = { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
@@ -170,0 +178,0 @@ } |
{ | ||
"name": "@sanity/react-loader", | ||
"version": "1.11.14", | ||
"version": "1.11.15", | ||
"homepage": "https://github.com/sanity-io/visual-editing/tree/main/packages/react-loader#readme", | ||
@@ -79,7 +79,7 @@ "bugs": { | ||
"@sanity/client": "^7.8.0", | ||
"@sanity/core-loader": "^1.8.13", | ||
"@sanity/visual-editing-csm": "^2.0.20" | ||
"@sanity/core-loader": "^1.8.14", | ||
"@sanity/visual-editing-csm": "^2.0.21" | ||
}, | ||
"devDependencies": { | ||
"@sanity/pkg-utils": "6.13.4", | ||
"@sanity/pkg-utils": "^7.9.8", | ||
"@types/react": "^19.1.8", | ||
@@ -91,5 +91,5 @@ "eslint": "^8.57.1", | ||
"vitest": "^3.2.4", | ||
"@repo/eslint-config": "0.0.0", | ||
"@repo/prettier-config": "0.0.0", | ||
"@repo/package.config": "0.0.0" | ||
"@repo/package.config": "0.0.0", | ||
"@repo/eslint-config": "0.0.0" | ||
}, | ||
@@ -96,0 +96,0 @@ "peerDependencies": { |
@@ -226,2 +226,1 @@ # @sanity/react-loader | ||
[bundlephobia]: https://bundlephobia.com/package/@sanity/react-loader | ||
@@ -25,3 +25,4 @@ import { | ||
const studioUrlStore = defineStudioUrlStore(options.client) | ||
const useQuery = defineUseQuery({createFetcherStore, studioUrlStore}) | ||
// @ts-expect-error - update typings | ||
const useQuery: QueryStore['useQuery'] = defineUseQuery({createFetcherStore, studioUrlStore}) | ||
const useLiveMode: UseLiveModeHook = defineUseLiveMode({ | ||
@@ -42,3 +43,2 @@ enableLiveMode, | ||
loadQuery, | ||
// @ts-expect-error - update typings | ||
useQuery, | ||
@@ -45,0 +45,0 @@ setServerClient, |
@@ -6,4 +6,5 @@ import type {QueryParams} from '@sanity/client' | ||
import {defineStudioUrlStore} from './defineStudioUrlStore' | ||
import type {UseQueryOptions, WithEncodeDataAttribute} from './types' | ||
import type {UseQueryOptions} from './types' | ||
import {useEncodeDataAttribute} from './useEncodeDataAttribute' | ||
import type {EncodeDataAttributeFunction} from '@sanity/core-loader/encode-data-attribute' | ||
@@ -19,3 +20,5 @@ export function defineUseQuery({ | ||
options?: UseQueryOptions<QueryResponseResult>, | ||
) => QueryStoreState<QueryResponseResult, QueryResponseError> & WithEncodeDataAttribute { | ||
) => QueryStoreState<QueryResponseResult, QueryResponseError> & { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
} { | ||
const DEFAULT_PARAMS = {} | ||
@@ -22,0 +25,0 @@ return <QueryResponseResult, QueryResponseError>( |
@@ -17,3 +17,3 @@ import type { | ||
export type WithEncodeDataAttribute = { | ||
type WithEncodeDataAttribute = { | ||
encodeDataAttribute: EncodeDataAttributeFunction | ||
@@ -20,0 +20,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
328700
0.53%3447
0.55%226
-0.44%