@prismicio/react 2.6.2 → 2.7.0
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/PrismicRichText.d.ts +1 -1
- package/dist/SliceZone.cjs +26 -36
- package/dist/SliceZone.cjs.map +1 -1
- package/dist/SliceZone.d.ts +36 -33
- package/dist/SliceZone.js +26 -19
- package/dist/SliceZone.js.map +1 -1
- package/dist/clientHooks.cjs.map +1 -1
- package/dist/clientHooks.d.ts +44 -44
- package/dist/clientHooks.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +13 -13
- package/src/SliceZone.tsx +111 -96
- package/src/clientHooks.ts +26 -26
package/dist/clientHooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as prismic from "@prismicio/client";
|
|
2
2
|
import { ClientHookReturnType, HookOnlyParameters } from "./useStatefulPrismicClientMethod";
|
|
3
3
|
/**
|
|
4
4
|
* A hook that queries content from the Prismic repository.
|
|
@@ -14,10 +14,10 @@ import { ClientHookReturnType, HookOnlyParameters } from "./useStatefulPrismicCl
|
|
|
14
14
|
*
|
|
15
15
|
* @see Underlying `@prismicio/client` method {@link proto.get}
|
|
16
16
|
*/
|
|
17
|
-
export declare const usePrismicDocuments: <TDocument extends
|
|
18
|
-
fetchOptions?:
|
|
17
|
+
export declare const usePrismicDocuments: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
18
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
19
19
|
signal?: any;
|
|
20
|
-
} & HookOnlyParameters) | undefined) => ClientHookReturnType<
|
|
20
|
+
} & HookOnlyParameters) | undefined) => ClientHookReturnType<prismic.Query<TDocument>>;
|
|
21
21
|
/**
|
|
22
22
|
* A hook that queries content from the Prismic repository and returns only the
|
|
23
23
|
* first result, if any.
|
|
@@ -33,8 +33,8 @@ export declare const usePrismicDocuments: <TDocument extends prismicT.PrismicDoc
|
|
|
33
33
|
*
|
|
34
34
|
* @see Underlying `@prismicio/client` method {@link proto.getFirst}
|
|
35
35
|
*/
|
|
36
|
-
export declare const useFirstPrismicDocument: <TDocument extends
|
|
37
|
-
fetchOptions?:
|
|
36
|
+
export declare const useFirstPrismicDocument: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
37
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
38
38
|
signal?: any;
|
|
39
39
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument>;
|
|
40
40
|
/**
|
|
@@ -53,10 +53,10 @@ export declare const useFirstPrismicDocument: <TDocument extends prismicT.Prismi
|
|
|
53
53
|
*
|
|
54
54
|
* @see Underlying `@prismicio/client` method {@link proto.getAll}
|
|
55
55
|
*/
|
|
56
|
-
export declare const useAllPrismicDocumentsDangerously: <TDocument extends
|
|
56
|
+
export declare const useAllPrismicDocumentsDangerously: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<Omit<prismic.BuildQueryURLArgs, "page">> & {
|
|
57
57
|
limit?: number | undefined;
|
|
58
58
|
} & {
|
|
59
|
-
fetchOptions?:
|
|
59
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
60
60
|
signal?: any;
|
|
61
61
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument[]>;
|
|
62
62
|
/**
|
|
@@ -75,8 +75,8 @@ export declare const useAllPrismicDocumentsDangerously: <TDocument extends prism
|
|
|
75
75
|
*
|
|
76
76
|
* @see Underlying `@prismicio/client` method {@link proto.getByID}
|
|
77
77
|
*/
|
|
78
|
-
export declare const usePrismicDocumentByID: <TDocument extends
|
|
79
|
-
fetchOptions?:
|
|
78
|
+
export declare const usePrismicDocumentByID: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(id: string, params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
79
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
80
80
|
signal?: any;
|
|
81
81
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument>;
|
|
82
82
|
/**
|
|
@@ -94,10 +94,10 @@ export declare const usePrismicDocumentByID: <TDocument extends prismicT.Prismic
|
|
|
94
94
|
*
|
|
95
95
|
* @see Underlying `@prismicio/client` method {@link proto.getByIDs}
|
|
96
96
|
*/
|
|
97
|
-
export declare const usePrismicDocumentsByIDs: <TDocument extends
|
|
98
|
-
fetchOptions?:
|
|
97
|
+
export declare const usePrismicDocumentsByIDs: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(id: string[], params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
98
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
99
99
|
signal?: any;
|
|
100
|
-
} & HookOnlyParameters) | undefined) => ClientHookReturnType<
|
|
100
|
+
} & HookOnlyParameters) | undefined) => ClientHookReturnType<prismic.Query<TDocument>>;
|
|
101
101
|
/**
|
|
102
102
|
* A hook that queries all documents from the Prismic repository with specific
|
|
103
103
|
* IDs.
|
|
@@ -114,10 +114,10 @@ export declare const usePrismicDocumentsByIDs: <TDocument extends prismicT.Prism
|
|
|
114
114
|
*
|
|
115
115
|
* @see Underlying `@prismicio/client` method {@link proto.getAllByIDs}
|
|
116
116
|
*/
|
|
117
|
-
export declare const useAllPrismicDocumentsByIDs: <TDocument extends
|
|
117
|
+
export declare const useAllPrismicDocumentsByIDs: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(id: string[], params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
118
118
|
limit?: number | undefined;
|
|
119
119
|
} & {
|
|
120
|
-
fetchOptions?:
|
|
120
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
121
121
|
signal?: any;
|
|
122
122
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument[]>;
|
|
123
123
|
/**
|
|
@@ -137,8 +137,8 @@ export declare const useAllPrismicDocumentsByIDs: <TDocument extends prismicT.Pr
|
|
|
137
137
|
*
|
|
138
138
|
* @see Underlying `@prismicio/client` method {@link proto.getByUID}
|
|
139
139
|
*/
|
|
140
|
-
export declare const usePrismicDocumentByUID: <TDocument extends
|
|
141
|
-
fetchOptions?:
|
|
140
|
+
export declare const usePrismicDocumentByUID: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(documentType: any, uid: string, params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
141
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
142
142
|
signal?: any;
|
|
143
143
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument>;
|
|
144
144
|
/**
|
|
@@ -158,10 +158,10 @@ export declare const usePrismicDocumentByUID: <TDocument extends prismicT.Prismi
|
|
|
158
158
|
*
|
|
159
159
|
* @see Underlying `@prismicio/client` method {@link proto.getByUID}
|
|
160
160
|
*/
|
|
161
|
-
export declare const usePrismicDocumentsByUIDs: <TDocument extends
|
|
162
|
-
fetchOptions?:
|
|
161
|
+
export declare const usePrismicDocumentsByUIDs: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(documentType: any, uids: string[], params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
162
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
163
163
|
signal?: any;
|
|
164
|
-
} & HookOnlyParameters) | undefined) => ClientHookReturnType<
|
|
164
|
+
} & HookOnlyParameters) | undefined) => ClientHookReturnType<prismic.Query<TDocument>>;
|
|
165
165
|
/**
|
|
166
166
|
* A hook that queries all documents from the Prismic repository with specific
|
|
167
167
|
* UIDs of a Custom Type.
|
|
@@ -179,8 +179,8 @@ export declare const usePrismicDocumentsByUIDs: <TDocument extends prismicT.Pris
|
|
|
179
179
|
*
|
|
180
180
|
* @see Underlying `@prismicio/client` method {@link proto.getByUID}
|
|
181
181
|
*/
|
|
182
|
-
export declare const useAllPrismicDocumentsByUIDs: <TDocument extends
|
|
183
|
-
fetchOptions?:
|
|
182
|
+
export declare const useAllPrismicDocumentsByUIDs: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(documentType: any, uids: string[], params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
183
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
184
184
|
signal?: any;
|
|
185
185
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument[]>;
|
|
186
186
|
/**
|
|
@@ -199,8 +199,8 @@ export declare const useAllPrismicDocumentsByUIDs: <TDocument extends prismicT.P
|
|
|
199
199
|
*
|
|
200
200
|
* @see Underlying `@prismicio/client` method {@link proto.getSingle}
|
|
201
201
|
*/
|
|
202
|
-
export declare const useSinglePrismicDocument: <TDocument extends
|
|
203
|
-
fetchOptions?:
|
|
202
|
+
export declare const useSinglePrismicDocument: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
203
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
204
204
|
signal?: any;
|
|
205
205
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument>;
|
|
206
206
|
/**
|
|
@@ -219,10 +219,10 @@ export declare const useSinglePrismicDocument: <TDocument extends prismicT.Prism
|
|
|
219
219
|
*
|
|
220
220
|
* @see Underlying `@prismicio/client` method {@link proto.getByType}
|
|
221
221
|
*/
|
|
222
|
-
export declare const usePrismicDocumentsByType: <TDocument extends
|
|
223
|
-
fetchOptions?:
|
|
222
|
+
export declare const usePrismicDocumentsByType: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
223
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
224
224
|
signal?: any;
|
|
225
|
-
} & HookOnlyParameters) | undefined) => ClientHookReturnType<
|
|
225
|
+
} & HookOnlyParameters) | undefined) => ClientHookReturnType<prismic.Query<TDocument>>;
|
|
226
226
|
/**
|
|
227
227
|
* A hook that queries all documents from the Prismic repository for a specific
|
|
228
228
|
* Custom Type.
|
|
@@ -239,10 +239,10 @@ export declare const usePrismicDocumentsByType: <TDocument extends prismicT.Pris
|
|
|
239
239
|
*
|
|
240
240
|
* @see Underlying `@prismicio/client` method {@link proto.getAllByType}
|
|
241
241
|
*/
|
|
242
|
-
export declare const useAllPrismicDocumentsByType: <TDocument extends
|
|
242
|
+
export declare const useAllPrismicDocumentsByType: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<Omit<prismic.BuildQueryURLArgs, "page">> & {
|
|
243
243
|
limit?: number | undefined;
|
|
244
244
|
} & {
|
|
245
|
-
fetchOptions?:
|
|
245
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
246
246
|
signal?: any;
|
|
247
247
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument[]>;
|
|
248
248
|
/**
|
|
@@ -261,10 +261,10 @@ export declare const useAllPrismicDocumentsByType: <TDocument extends prismicT.P
|
|
|
261
261
|
*
|
|
262
262
|
* @see Underlying `@prismicio/client` method {@link proto.getByTag}
|
|
263
263
|
*/
|
|
264
|
-
export declare const usePrismicDocumentsByTag: <TDocument extends
|
|
265
|
-
fetchOptions?:
|
|
264
|
+
export declare const usePrismicDocumentsByTag: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(tag: string, params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
265
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
266
266
|
signal?: any;
|
|
267
|
-
} & HookOnlyParameters) | undefined) => ClientHookReturnType<
|
|
267
|
+
} & HookOnlyParameters) | undefined) => ClientHookReturnType<prismic.Query<TDocument>>;
|
|
268
268
|
/**
|
|
269
269
|
* A hook that queries all documents from the Prismic repository with a specific
|
|
270
270
|
* tag.
|
|
@@ -281,10 +281,10 @@ export declare const usePrismicDocumentsByTag: <TDocument extends prismicT.Prism
|
|
|
281
281
|
*
|
|
282
282
|
* @see Underlying `@prismicio/client` method {@link proto.getAllByTag}
|
|
283
283
|
*/
|
|
284
|
-
export declare const useAllPrismicDocumentsByTag: <TDocument extends
|
|
284
|
+
export declare const useAllPrismicDocumentsByTag: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(tag: string, params?: (Partial<Omit<prismic.BuildQueryURLArgs, "page">> & {
|
|
285
285
|
limit?: number | undefined;
|
|
286
286
|
} & {
|
|
287
|
-
fetchOptions?:
|
|
287
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
288
288
|
signal?: any;
|
|
289
289
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument[]>;
|
|
290
290
|
/**
|
|
@@ -304,10 +304,10 @@ export declare const useAllPrismicDocumentsByTag: <TDocument extends prismicT.Pr
|
|
|
304
304
|
*
|
|
305
305
|
* @see Underlying `@prismicio/client` method {@link proto.getByTags}
|
|
306
306
|
*/
|
|
307
|
-
export declare const usePrismicDocumentsBySomeTags: <TDocument extends
|
|
308
|
-
fetchOptions?:
|
|
307
|
+
export declare const usePrismicDocumentsBySomeTags: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(tag: string[], params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
308
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
309
309
|
signal?: any;
|
|
310
|
-
} & HookOnlyParameters) | undefined) => ClientHookReturnType<
|
|
310
|
+
} & HookOnlyParameters) | undefined) => ClientHookReturnType<prismic.Query<TDocument>>;
|
|
311
311
|
/**
|
|
312
312
|
* A hook that queries all documents from the Prismic repository with specific
|
|
313
313
|
* tags. A document must be tagged with at least one of the queried tags to be
|
|
@@ -325,10 +325,10 @@ export declare const usePrismicDocumentsBySomeTags: <TDocument extends prismicT.
|
|
|
325
325
|
*
|
|
326
326
|
* @see Underlying `@prismicio/client` method {@link proto.getAllByTags}
|
|
327
327
|
*/
|
|
328
|
-
export declare const useAllPrismicDocumentsBySomeTags: <TDocument extends
|
|
328
|
+
export declare const useAllPrismicDocumentsBySomeTags: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(tag: string[], params?: (Partial<Omit<prismic.BuildQueryURLArgs, "page">> & {
|
|
329
329
|
limit?: number | undefined;
|
|
330
330
|
} & {
|
|
331
|
-
fetchOptions?:
|
|
331
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
332
332
|
signal?: any;
|
|
333
333
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument[]>;
|
|
334
334
|
/**
|
|
@@ -347,10 +347,10 @@ export declare const useAllPrismicDocumentsBySomeTags: <TDocument extends prismi
|
|
|
347
347
|
*
|
|
348
348
|
* @see Underlying `@prismicio/client` method {@link proto.getByTags}
|
|
349
349
|
*/
|
|
350
|
-
export declare const usePrismicDocumentsByEveryTag: <TDocument extends
|
|
351
|
-
fetchOptions?:
|
|
350
|
+
export declare const usePrismicDocumentsByEveryTag: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(tag: string[], params?: (Partial<prismic.BuildQueryURLArgs> & {
|
|
351
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
352
352
|
signal?: any;
|
|
353
|
-
} & HookOnlyParameters) | undefined) => ClientHookReturnType<
|
|
353
|
+
} & HookOnlyParameters) | undefined) => ClientHookReturnType<prismic.Query<TDocument>>;
|
|
354
354
|
/**
|
|
355
355
|
* A hook that queries all documents from the Prismic repository with specific
|
|
356
356
|
* tags. A document must be tagged with all of the queried tags to be included.
|
|
@@ -367,9 +367,9 @@ export declare const usePrismicDocumentsByEveryTag: <TDocument extends prismicT.
|
|
|
367
367
|
*
|
|
368
368
|
* @see Underlying `@prismicio/client` method {@link proto.getAllByTags}
|
|
369
369
|
*/
|
|
370
|
-
export declare const useAllPrismicDocumentsByEveryTag: <TDocument extends
|
|
370
|
+
export declare const useAllPrismicDocumentsByEveryTag: <TDocument extends prismic.PrismicDocument<Record<string, any>, string, string>>(tag: string[], params?: (Partial<Omit<prismic.BuildQueryURLArgs, "page">> & {
|
|
371
371
|
limit?: number | undefined;
|
|
372
372
|
} & {
|
|
373
|
-
fetchOptions?:
|
|
373
|
+
fetchOptions?: prismic.RequestInitLike | undefined;
|
|
374
374
|
signal?: any;
|
|
375
375
|
} & HookOnlyParameters) | undefined) => ClientHookReturnType<TDocument[]>;
|
package/dist/clientHooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientHooks.js","sources":["../../src/clientHooks.ts"],"sourcesContent":["import type * as prismicT from \"@prismicio/types\";\n\nimport {\n\tClientHookReturnType,\n\tClientMethodParameters,\n\tHookOnlyParameters,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\n/**\n * A hook that queries content from the Prismic repository.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.get}\n */\nexport const usePrismicDocuments = <TDocument extends prismicT.PrismicDocument>(\n\t...args: [params?: ClientMethodParameters<\"get\">[0] & HookOnlyParameters]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns only the\n * first result, if any.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getFirst}\n */\nexport const useFirstPrismicDocument = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [params?: ClientMethodParameters<\"getFirst\">[0] & HookOnlyParameters]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns all\n * matching content. If no predicates are provided, all documents will be\n * fetched.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAll}\n */\nexport const useAllPrismicDocumentsDangerously = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tHookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific\n * ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param id - ID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByID}\n */\nexport const usePrismicDocumentByID = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific\n * UID and Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uid - UID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentByUID = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific UIDs\n * of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentsByUIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * UIDs of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const useAllPrismicDocumentsByUIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args);\n\n/**\n * A hook that queries a singleton document from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the singleton Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getSingle}\n */\nexport const useSinglePrismicDocument = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args);\n\n/**\n * A hook that queries documents from the Prismic repository for a specific\n * Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByType}\n */\nexport const usePrismicDocumentsByType = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository for a specific\n * Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with a specific\n * tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTag}\n */\nexport const usePrismicDocumentsByTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with a specific\n * tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with at least one of the queried tags to be\n * included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with at least one of the queried tags to be\n * included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args);\n"],"names":[],"mappings":";AAuBO,MAAM,sBAAsB,IAC/B,SAEH,+BAA+B,OAAO,IAAI;AAiBpC,MAAM,0BAA0B,IAGnC,SAEH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,oCAAoC,IAG7C,SAKH,+BAA+B,qBAAqB,IAAI;AAkBlD,MAAM,yBAAyB,IAGlC,SAKH,+BAA+B,WAAW,IAAI;AAiBxC,MAAM,2BAA2B,IAGpC,SAKH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IAGvC,SAKH,+BAA+B,eAAe,IAAI;AAmB5C,MAAM,0BAA0B,IAGnC,SAMH,+BAA+B,YAAY,IAAI;AAmBzC,MAAM,4BAA4B,IAGrC,SAMH,+BAA+B,aAAa,IAAI;AAmB1C,MAAM,+BAA+B,IAGxC,SAMH,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IAGpC,SAKH,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,4BAA4B,IAGrC,SAKH,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,+BAA+B,IAGxC,SAKH,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IAGpC,SAKH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IAGvC,SAKH,+BAA+B,eAAe,IAAI;AAmB5C,MAAM,gCAAgC,IAGzC,SAKH,+BAA+B,iBAAiB,IAAI;AAmB9C,MAAM,mCAAmC,IAG5C,SAKH,+BAA+B,oBAAoB,IAAI;AAkBjD,MAAM,gCAAgC,IAGzC,SAKH,+BAA+B,iBAAiB,IAAI;AAkB9C,MAAM,mCAAmC,IAG5C,SAKH,+BAA+B,oBAAoB,IAAI;"}
|
|
1
|
+
{"version":3,"file":"clientHooks.js","sources":["../../src/clientHooks.ts"],"sourcesContent":["import type * as prismic from \"@prismicio/client\";\n\nimport {\n\tClientHookReturnType,\n\tClientMethodParameters,\n\tHookOnlyParameters,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\n/**\n * A hook that queries content from the Prismic repository.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.get}\n */\nexport const usePrismicDocuments = <TDocument extends prismic.PrismicDocument>(\n\t...args: [params?: ClientMethodParameters<\"get\">[0] & HookOnlyParameters]\n): ClientHookReturnType<prismic.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns only the\n * first result, if any.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getFirst}\n */\nexport const useFirstPrismicDocument = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [params?: ClientMethodParameters<\"getFirst\">[0] & HookOnlyParameters]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns all\n * matching content. If no predicates are provided, all documents will be\n * fetched.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAll}\n */\nexport const useAllPrismicDocumentsDangerously = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tHookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific\n * ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param id - ID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByID}\n */\nexport const usePrismicDocumentByID = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismic.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific\n * UID and Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uid - UID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentByUID = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific UIDs\n * of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentsByUIDs = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismic.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * UIDs of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const useAllPrismicDocumentsByUIDs = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args);\n\n/**\n * A hook that queries a singleton document from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the singleton Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getSingle}\n */\nexport const useSinglePrismicDocument = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args);\n\n/**\n * A hook that queries documents from the Prismic repository for a specific\n * Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByType}\n */\nexport const usePrismicDocumentsByType = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismic.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository for a specific\n * Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with a specific\n * tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTag}\n */\nexport const usePrismicDocumentsByTag = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismic.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with a specific\n * tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with at least one of the queried tags to be\n * included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismic.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with at least one of the queried tags to be\n * included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismic.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends prismic.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args);\n"],"names":[],"mappings":";AAuBO,MAAM,sBAAsB,IAC/B,SAEH,+BAA+B,OAAO,IAAI;AAiBpC,MAAM,0BAA0B,IAGnC,SAEH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,oCAAoC,IAG7C,SAKH,+BAA+B,qBAAqB,IAAI;AAkBlD,MAAM,yBAAyB,IAGlC,SAKH,+BAA+B,WAAW,IAAI;AAiBxC,MAAM,2BAA2B,IAGpC,SAKH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IAGvC,SAKH,+BAA+B,eAAe,IAAI;AAmB5C,MAAM,0BAA0B,IAGnC,SAMH,+BAA+B,YAAY,IAAI;AAmBzC,MAAM,4BAA4B,IAGrC,SAMH,+BAA+B,aAAa,IAAI;AAmB1C,MAAM,+BAA+B,IAGxC,SAMH,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IAGpC,SAKH,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,4BAA4B,IAGrC,SAKH,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,+BAA+B,IAGxC,SAKH,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IAGpC,SAKH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IAGvC,SAKH,+BAA+B,eAAe,IAAI;AAmB5C,MAAM,gCAAgC,IAGzC,SAKH,+BAA+B,iBAAiB,IAAI;AAmB9C,MAAM,mCAAmC,IAG5C,SAKH,+BAA+B,oBAAoB,IAAI;AAkBjD,MAAM,gCAAgC,IAGzC,SAKH,+BAA+B,iBAAiB,IAAI;AAkB9C,MAAM,mCAAmC,IAG5C,SAKH,+BAA+B,oBAAoB,IAAI;"}
|
package/dist/package.json.cjs
CHANGED
package/dist/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "React components and hooks to fetch and present Prismic content",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -69,38 +69,38 @@
|
|
|
69
69
|
"@prismicio/richtext": "^2.1.5"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@prismicio/client": "^7.0
|
|
73
|
-
"@prismicio/mock": "^0.
|
|
72
|
+
"@prismicio/client": "^7.1.0",
|
|
73
|
+
"@prismicio/mock": "^0.3.1",
|
|
74
74
|
"@size-limit/preset-small-lib": "^8.2.4",
|
|
75
75
|
"@testing-library/react": "^14.0.0",
|
|
76
76
|
"@types/node-fetch": "^3.0.3",
|
|
77
|
-
"@types/react": "^18.
|
|
77
|
+
"@types/react": "^18.2.9",
|
|
78
78
|
"@types/react-test-renderer": "^18.0.0",
|
|
79
|
-
"@typescript-eslint/eslint-plugin": "^5.59.
|
|
80
|
-
"@typescript-eslint/parser": "^5.59.
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
|
80
|
+
"@typescript-eslint/parser": "^5.59.9",
|
|
81
81
|
"@vitejs/plugin-react": "^4.0.0",
|
|
82
|
-
"@vitest/coverage-
|
|
83
|
-
"eslint": "^8.
|
|
82
|
+
"@vitest/coverage-v8": "^0.32.0",
|
|
83
|
+
"eslint": "^8.42.0",
|
|
84
84
|
"eslint-config-prettier": "^8.8.0",
|
|
85
85
|
"eslint-plugin-prettier": "^4.2.1",
|
|
86
86
|
"eslint-plugin-react": "^7.32.2",
|
|
87
87
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
88
88
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
89
|
-
"happy-dom": "^9.
|
|
89
|
+
"happy-dom": "^9.20.3",
|
|
90
90
|
"msw": "^1.2.1",
|
|
91
91
|
"node-fetch": "^3.3.1",
|
|
92
|
-
"prettier": "^2.8.
|
|
92
|
+
"prettier": "^2.8.8",
|
|
93
93
|
"prettier-plugin-jsdoc": "^0.4.2",
|
|
94
94
|
"react": "^18.2.0",
|
|
95
95
|
"react-dom": "^18.2.0",
|
|
96
96
|
"react-test-renderer": "^18.2.0",
|
|
97
|
-
"rollup-plugin-preserve-directives": "^0.
|
|
97
|
+
"rollup-plugin-preserve-directives": "^0.2.0",
|
|
98
98
|
"size-limit": "^8.2.4",
|
|
99
99
|
"standard-version": "^9.5.0",
|
|
100
100
|
"typescript": "^5.0.4",
|
|
101
|
-
"vite": "^4.3.
|
|
101
|
+
"vite": "^4.3.9",
|
|
102
102
|
"vite-plugin-sdk": "^0.1.1",
|
|
103
|
-
"vitest": "^0.
|
|
103
|
+
"vitest": "^0.32.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"@prismicio/client": "^6 || ^7",
|