@prismicio/vue 4.3.0 → 4.3.2
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/components/PrismicEmbed.cjs.map +1 -1
- package/dist/components/PrismicEmbed.d.ts +7 -7
- package/dist/components/PrismicEmbed.js.map +1 -1
- package/dist/components/PrismicImage.cjs.map +1 -1
- package/dist/components/PrismicImage.d.ts +10 -8
- package/dist/components/PrismicImage.js.map +1 -1
- package/dist/components/PrismicLink.cjs.map +1 -1
- package/dist/components/PrismicLink.d.ts +10 -8
- package/dist/components/PrismicLink.js.map +1 -1
- package/dist/components/PrismicRichText.cjs +5 -1
- package/dist/components/PrismicRichText.cjs.map +1 -1
- package/dist/components/PrismicRichText.d.ts +8 -8
- package/dist/components/PrismicRichText.js +6 -2
- package/dist/components/PrismicRichText.js.map +1 -1
- package/dist/components/PrismicText.cjs.map +1 -1
- package/dist/components/PrismicText.d.ts +8 -8
- package/dist/components/PrismicText.js.map +1 -1
- package/dist/components/SliceZone.cjs.map +1 -1
- package/dist/components/SliceZone.d.ts +14 -12
- package/dist/components/SliceZone.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/composables.cjs.map +1 -1
- package/dist/composables.d.ts +20 -2
- package/dist/composables.js.map +1 -1
- package/dist/createPrismic.cjs.map +1 -1
- package/dist/createPrismic.js.map +1 -1
- package/dist/injectionSymbols.cjs.map +1 -1
- package/dist/injectionSymbols.js.map +1 -1
- package/dist/lib/__PRODUCTION__.cjs.map +1 -1
- package/dist/lib/__PRODUCTION__.js.map +1 -1
- package/dist/lib/getSlots.cjs +7 -5
- package/dist/lib/getSlots.cjs.map +1 -1
- package/dist/lib/getSlots.d.ts +2 -2
- package/dist/lib/getSlots.js +7 -5
- package/dist/lib/getSlots.js.map +1 -1
- package/dist/lib/isInternalURL.cjs.map +1 -1
- package/dist/lib/isInternalURL.js.map +1 -1
- package/dist/lib/simplyResolveComponent.cjs.map +1 -1
- package/dist/lib/simplyResolveComponent.d.ts +1 -1
- package/dist/lib/simplyResolveComponent.js.map +1 -1
- package/dist/types.d.ts +11 -2
- package/dist/usePrismic.cjs.map +1 -1
- package/dist/usePrismic.d.ts +5 -5
- package/dist/usePrismic.js.map +1 -1
- package/dist/useStatefulPrismicClientMethod.cjs.map +1 -1
- package/dist/useStatefulPrismicClientMethod.d.ts +4 -3
- package/dist/useStatefulPrismicClientMethod.js.map +1 -1
- package/package.json +27 -28
- package/src/components/PrismicEmbed.ts +16 -17
- package/src/components/PrismicImage.ts +57 -59
- package/src/components/PrismicLink.ts +68 -70
- package/src/components/PrismicRichText.ts +71 -68
- package/src/components/PrismicText.ts +30 -32
- package/src/components/SliceZone.ts +94 -96
- package/src/components/index.ts +12 -16
- package/src/composables.ts +41 -23
- package/src/createPrismic.ts +40 -34
- package/src/globalExtensions.ts +2 -2
- package/src/index.ts +10 -10
- package/src/injectionSymbols.ts +4 -4
- package/src/lib/__PRODUCTION__.ts +2 -2
- package/src/lib/getSlots.ts +18 -12
- package/src/lib/isInternalURL.ts +4 -4
- package/src/lib/simplyResolveComponent.ts +4 -9
- package/src/types.ts +61 -52
- package/src/usePrismic.ts +9 -9
- package/src/useStatefulPrismicClientMethod.ts +42 -40
package/dist/composables.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { PrismicDocument, Query } from "@prismicio/client";
|
|
2
|
-
import { ClientComposableReturnType, ComposableOnlyParameters } from "./useStatefulPrismicClientMethod";
|
|
1
|
+
import type { PrismicDocument, Query } from "@prismicio/client";
|
|
2
|
+
import type { ClientComposableReturnType, ClientMethodParameters, ComposableOnlyParameters } from "./useStatefulPrismicClientMethod";
|
|
3
3
|
/**
|
|
4
4
|
* A composable that queries content from the Prismic repository.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* An additional `@prismicio/client` instance can be provided at
|
|
8
8
|
* `params.client`.
|
|
9
|
+
*
|
|
9
10
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
10
11
|
*
|
|
11
12
|
* @param params - Parameters to filter, sort, and paginate results
|
|
@@ -22,6 +23,7 @@ export declare const usePrismicDocuments: <TDocument extends PrismicDocument>(pa
|
|
|
22
23
|
* @remarks
|
|
23
24
|
* An additional `@prismicio/client` instance can be provided at
|
|
24
25
|
* `params.client`.
|
|
26
|
+
*
|
|
25
27
|
* @typeParam TDocument - Type of the Prismic document returned
|
|
26
28
|
*
|
|
27
29
|
* @param params - Parameters to filter, sort, and paginate results
|
|
@@ -38,6 +40,7 @@ export declare const useFirstPrismicDocument: <TDocument extends PrismicDocument
|
|
|
38
40
|
* @remarks
|
|
39
41
|
* An additional `@prismicio/client` instance can be provided at
|
|
40
42
|
* `params.client`.
|
|
43
|
+
*
|
|
41
44
|
* @typeParam TDocument - Type of the Prismic document returned
|
|
42
45
|
*
|
|
43
46
|
* @param id - ID of the document
|
|
@@ -55,6 +58,7 @@ export declare const usePrismicDocumentByID: <TDocument extends PrismicDocument>
|
|
|
55
58
|
* @remarks
|
|
56
59
|
* An additional `@prismicio/client` instance can be provided at
|
|
57
60
|
* `params.client`.
|
|
61
|
+
*
|
|
58
62
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
59
63
|
*
|
|
60
64
|
* @param ids - A list of document IDs
|
|
@@ -72,6 +76,7 @@ export declare const usePrismicDocumentsByIDs: <TDocument extends PrismicDocumen
|
|
|
72
76
|
* @remarks
|
|
73
77
|
* An additional `@prismicio/client` instance can be provided at
|
|
74
78
|
* `params.client`.
|
|
79
|
+
*
|
|
75
80
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
76
81
|
*
|
|
77
82
|
* @param ids - A list of document IDs
|
|
@@ -91,6 +96,7 @@ export declare const useAllPrismicDocumentsByIDs: <TDocument extends PrismicDocu
|
|
|
91
96
|
* @remarks
|
|
92
97
|
* An additional `@prismicio/client` instance can be provided at
|
|
93
98
|
* `params.client`.
|
|
99
|
+
*
|
|
94
100
|
* @typeParam TDocument - Type of the Prismic document returned
|
|
95
101
|
*
|
|
96
102
|
* @param documentType - The API ID of the document's Custom Type
|
|
@@ -109,6 +115,7 @@ export declare const usePrismicDocumentByUID: <TDocument extends PrismicDocument
|
|
|
109
115
|
* @remarks
|
|
110
116
|
* An additional `@prismicio/client` instance can be provided at
|
|
111
117
|
* `params.client`.
|
|
118
|
+
*
|
|
112
119
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
113
120
|
*
|
|
114
121
|
* @param documentType - The API ID of the document's Custom Type
|
|
@@ -127,6 +134,7 @@ export declare const usePrismicDocumentsByUIDs: <TDocument extends PrismicDocume
|
|
|
127
134
|
* @remarks
|
|
128
135
|
* An additional `@prismicio/client` instance can be provided at
|
|
129
136
|
* `params.client`.
|
|
137
|
+
*
|
|
130
138
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
131
139
|
*
|
|
132
140
|
* @param documentType - The API ID of the document's Custom Type
|
|
@@ -147,6 +155,7 @@ export declare const useAllPrismicDocumentsByUIDs: <TDocument extends PrismicDoc
|
|
|
147
155
|
* @remarks
|
|
148
156
|
* An additional `@prismicio/client` instance can be provided at
|
|
149
157
|
* `params.client`.
|
|
158
|
+
*
|
|
150
159
|
* @typeParam TDocument - Type of the Prismic document returned
|
|
151
160
|
*
|
|
152
161
|
* @param documentType - The API ID of the singleton Custom Type
|
|
@@ -164,6 +173,7 @@ export declare const useSinglePrismicDocument: <TDocument extends PrismicDocumen
|
|
|
164
173
|
* @remarks
|
|
165
174
|
* An additional `@prismicio/client` instance can be provided at
|
|
166
175
|
* `params.client`.
|
|
176
|
+
*
|
|
167
177
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
168
178
|
*
|
|
169
179
|
* @param documentType - The API ID of the Custom Type
|
|
@@ -181,6 +191,7 @@ export declare const usePrismicDocumentsByType: <TDocument extends PrismicDocume
|
|
|
181
191
|
* @remarks
|
|
182
192
|
* An additional `@prismicio/client` instance can be provided at
|
|
183
193
|
* `params.client`.
|
|
194
|
+
*
|
|
184
195
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
185
196
|
*
|
|
186
197
|
* @param documentType - The API ID of the Custom Type
|
|
@@ -200,6 +211,7 @@ export declare const useAllPrismicDocumentsByType: <TDocument extends PrismicDoc
|
|
|
200
211
|
* @remarks
|
|
201
212
|
* An additional `@prismicio/client` instance can be provided at
|
|
202
213
|
* `params.client`.
|
|
214
|
+
*
|
|
203
215
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
204
216
|
*
|
|
205
217
|
* @param tag - The tag that must be included on a document
|
|
@@ -217,6 +229,7 @@ export declare const usePrismicDocumentsByTag: <TDocument extends PrismicDocumen
|
|
|
217
229
|
* @remarks
|
|
218
230
|
* An additional `@prismicio/client` instance can be provided at
|
|
219
231
|
* `params.client`.
|
|
232
|
+
*
|
|
220
233
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
221
234
|
*
|
|
222
235
|
* @param tag - The tag that must be included on a document
|
|
@@ -236,6 +249,7 @@ export declare const useAllPrismicDocumentsByTag: <TDocument extends PrismicDocu
|
|
|
236
249
|
* @remarks
|
|
237
250
|
* An additional `@prismicio/client` instance can be provided at
|
|
238
251
|
* `params.client`.
|
|
252
|
+
*
|
|
239
253
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
240
254
|
*
|
|
241
255
|
* @param tags - A list of tags that must be included on a document
|
|
@@ -254,6 +268,7 @@ export declare const usePrismicDocumentsByEveryTag: <TDocument extends PrismicDo
|
|
|
254
268
|
* @remarks
|
|
255
269
|
* An additional `@prismicio/client` instance can be provided at
|
|
256
270
|
* `params.client`.
|
|
271
|
+
*
|
|
257
272
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
258
273
|
*
|
|
259
274
|
* @param tags - A list of tags that must be included on a document
|
|
@@ -274,6 +289,7 @@ export declare const useAllPrismicDocumentsByEveryTag: <TDocument extends Prismi
|
|
|
274
289
|
* @remarks
|
|
275
290
|
* An additional `@prismicio/client` instance can be provided at
|
|
276
291
|
* `params.client`.
|
|
292
|
+
*
|
|
277
293
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
278
294
|
*
|
|
279
295
|
* @param tags - A list of tags that must be included on a document
|
|
@@ -292,6 +308,7 @@ export declare const usePrismicDocumentsBySomeTags: <TDocument extends PrismicDo
|
|
|
292
308
|
* @remarks
|
|
293
309
|
* An additional `@prismicio/client` instance can be provided at
|
|
294
310
|
* `params.client`.
|
|
311
|
+
*
|
|
295
312
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
296
313
|
*
|
|
297
314
|
* @param tags - A list of tags that must be included on a document
|
|
@@ -317,6 +334,7 @@ export declare const useAllPrismicDocumentsBySomeTags: <TDocument extends Prismi
|
|
|
317
334
|
* @remarks
|
|
318
335
|
* An additional `@prismicio/client` instance can be provided at
|
|
319
336
|
* `params.client`.
|
|
337
|
+
*
|
|
320
338
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
321
339
|
*
|
|
322
340
|
* @param params - Parameters to filter and sort results
|
package/dist/composables.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composables.js","sources":["../../src/composables.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n// Imports for @link references:\nimport type { Client } from \"@prismicio/client\";\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\nimport { PrismicDocument, Query } from \"@prismicio/client\";\n\nimport {\n\tClientComposableReturnType,\n\tClientMethodParameters,\n\tComposableOnlyParameters,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\n// Composables\n\n/**\n * A composable 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.get}\n */\nexport const usePrismicDocuments = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"get\">[0] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args);\n\n/**\n * A composable that queries content from the Prismic repository and returns\n * only the 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getFirst}\n */\nexport const useFirstPrismicDocument = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"getFirst\">[0] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args);\n\n/**\n * A composable that queries a document from the Prismic repository with a\n * specific 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByID}\n */\nexport const usePrismicDocumentByID = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args);\n\n/**\n * A composable that queries 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, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tids: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * 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 and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tids: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args);\n\n/**\n * A composable that queries a document from the Prismic repository with a\n * specific 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByUID}\n */\nexport const usePrismicDocumentByUID = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * UIDs.\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 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByIDs}\n */\nexport const usePrismicDocumentsByUIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific UIDs.\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 document's Custom Type\n * @param uids - A list of document UIDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByUIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByUIDs\">[0],\n\t\tids: ClientMethodParameters<\"getAllByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getAllByUIDs\">[2] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args);\n\n/**\n * A composable that queries a singleton document from the Prismic repository\n * for a 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getSingle}\n */\nexport const useSinglePrismicDocument = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args);\n\n/**\n * A composable that queries documents 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 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByType}\n */\nexport const usePrismicDocumentsByType = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args);\n\n/**\n * A composable that queries all documents 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 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args);\n\n/**\n * A composable that queries documents from the Prismic repository with a\n * specific 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTag}\n */\nexport const usePrismicDocumentsByTag = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with a\n * specific 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args);\n\n/**\n * A composable that queries 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, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific tags. A document must be tagged with all 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args);\n\n/**\n * A composable that queries 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, sort, and paginate results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args);\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific tags. A document must be tagged with at least one of the queried\n * 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args);\n\n/**\n * **IMPORTANT**: Avoid using `dangerouslyUseAllPrismicDocuments` as it may be\n * slower and require more resources than other composables. Prefer using other\n * composables that filter by predicates such as\n * `useAllPrismicDocumentsByType`.\n *\n * A composable 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAll}\n */\nexport const dangerouslyUseAllPrismicDocuments = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args);\n"],"names":[],"mappings":";AA8BO,MAAM,sBAAsB,IAC/B,SAIH,+BAA+B,OAAO,IAAI;AAiBpC,MAAM,0BAA0B,IACnC,SAIH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,yBAAyB,IAClC,SAKH,+BAA+B,WAAW,IAAI;AAkBxC,MAAM,2BAA2B,IACpC,SAKH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IACvC,SAMH,+BAA+B,eAAe,IAAI;AAmB5C,MAAM,0BAA0B,IACnC,SAMH,+BAA+B,YAAY,IAAI;AAmBzC,MAAM,4BAA4B,IACrC,SAMH,+BAA+B,aAAa,IAAI;AAmB1C,MAAM,+BAA+B,IACxC,SAOH,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IACpC,SAKH,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,4BAA4B,IACrC,SAKH,+BAA+B,aAAa,IAAI;AAkB1C,MAAM,+BAA+B,IACxC,SAMH,+BAA+B,gBAAgB,IAAI;AAkB7C,MAAM,2BAA2B,IACpC,SAKH,+BAA+B,YAAY,IAAI;AAkBzC,MAAM,8BAA8B,IACvC,SAMH,+BAA+B,eAAe,IAAI;AAkB5C,MAAM,gCAAgC,IAGzC,SAMH,+BAA+B,iBAAiB,IAAI;AAmB9C,MAAM,mCAAmC,IAG5C,SAMH,+BAA+B,oBAAoB,IAAI;AAmBjD,MAAM,gCAAgC,IAGzC,SAMH,+BAA+B,iBAAiB,IAAI;AAmB9C,MAAM,mCAAmC,IAG5C,SAMH,+BAA+B,oBAAoB,IAAI;AAuBjD,MAAM,oCAAoC,IAG7C,SAKH,+BAA+B,qBAAqB,IAAI;"}
|
|
1
|
+
{"version":3,"file":"composables.js","sources":["../../src/composables.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n// Imports for @link references:\nimport type { Client } from \"@prismicio/client\"\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\nimport type { PrismicDocument, Query } from \"@prismicio/client\"\n\nimport type {\n\tClientComposableReturnType,\n\tClientMethodParameters,\n\tComposableOnlyParameters,\n} from \"./useStatefulPrismicClientMethod\"\nimport { useStatefulPrismicClientMethod } from \"./useStatefulPrismicClientMethod\"\n\n// Composables\n\n/**\n * A composable that queries content from the Prismic repository.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.get}\n */\nexport const usePrismicDocuments = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"get\">[0] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args)\n\n/**\n * A composable that queries content from the Prismic repository and returns\n * only the first result, if any.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getFirst}\n */\nexport const useFirstPrismicDocument = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"getFirst\">[0] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args)\n\n/**\n * A composable that queries a document from the Prismic repository with a\n * specific ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByID}\n */\nexport const usePrismicDocumentByID = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args)\n\n/**\n * A composable that queries 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 *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tids: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args)\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tids: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args)\n\n/**\n * A composable that queries a document from the Prismic repository with a\n * specific UID and Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByUID}\n */\nexport const usePrismicDocumentByUID = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args)\n\n/**\n * A composable that queries documents from the Prismic repository with specific\n * UIDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents 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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByIDs}\n */\nexport const usePrismicDocumentsByUIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args)\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific UIDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents 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 and sort results\n *\n * @returns The composable payload {@link ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByUIDs = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByUIDs\">[0],\n\t\tids: ClientMethodParameters<\"getAllByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getAllByUIDs\">[2] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args)\n\n/**\n * A composable that queries a singleton document from the Prismic repository\n * for a specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getSingle}\n */\nexport const useSinglePrismicDocument = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args)\n\n/**\n * A composable that queries documents 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 *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByType}\n */\nexport const usePrismicDocumentsByType = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args)\n\n/**\n * A composable that queries all documents 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 *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args)\n\n/**\n * A composable that queries documents from the Prismic repository with a\n * specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTag}\n */\nexport const usePrismicDocumentsByTag = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & ComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args)\n\n/**\n * A composable that queries all documents from the Prismic repository with a\n * specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <TDocument extends PrismicDocument>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args)\n\n/**\n * A composable that queries 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 *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args)\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific tags. A document must be tagged with all 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 *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args)\n\n/**\n * A composable that queries 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 *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args)\n\n/**\n * A composable that queries all documents from the Prismic repository with\n * specific tags. A document must be tagged with at least one of the queried\n * tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at\n * `params.client`.\n *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\ttags: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args)\n\n/**\n * **IMPORTANT**: Avoid using `dangerouslyUseAllPrismicDocuments` as it may be\n * slower and require more resources than other composables. Prefer using other\n * composables that filter by predicates such as\n * `useAllPrismicDocumentsByType`.\n *\n * A composable 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 *\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 ClientComposableReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link Client.getAll}\n */\nexport const dangerouslyUseAllPrismicDocuments = <\n\tTDocument extends PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tComposableOnlyParameters,\n\t]\n): ClientComposableReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args)\n"],"names":[],"mappings":";AA+BO,MAAM,sBAAsB,IAC/B,SAIH,+BAA+B,OAAO,IAAI;AAkBpC,MAAM,0BAA0B,IACnC,SAIH,+BAA+B,YAAY,IAAI;AAmBzC,MAAM,yBAAyB,IAClC,SAKH,+BAA+B,WAAW,IAAI;AAmBxC,MAAM,2BAA2B,IACpC,SAKH,+BAA+B,YAAY,IAAI;AAmBzC,MAAM,8BAA8B,IACvC,SAMH,+BAA+B,eAAe,IAAI;AAoB5C,MAAM,0BAA0B,IACnC,SAMH,+BAA+B,YAAY,IAAI;AAoBzC,MAAM,4BAA4B,IACrC,SAMH,+BAA+B,aAAa,IAAI;AAoB1C,MAAM,+BAA+B,IACxC,SAOH,+BAA+B,gBAAgB,IAAI;AAmB7C,MAAM,2BAA2B,IACpC,SAKH,+BAA+B,aAAa,IAAI;AAmB1C,MAAM,4BAA4B,IACrC,SAKH,+BAA+B,aAAa,IAAI;AAmB1C,MAAM,+BAA+B,IACxC,SAMH,+BAA+B,gBAAgB,IAAI;AAmB7C,MAAM,2BAA2B,IACpC,SAKH,+BAA+B,YAAY,IAAI;AAmBzC,MAAM,8BAA8B,IACvC,SAMH,+BAA+B,eAAe,IAAI;AAmB5C,MAAM,gCAAgC,IAGzC,SAMH,+BAA+B,iBAAiB,IAAI;AAoB9C,MAAM,mCAAmC,IAG5C,SAMH,+BAA+B,oBAAoB,IAAI;AAoBjD,MAAM,gCAAgC,IAGzC,SAMH,+BAA+B,iBAAiB,IAAI;AAoB9C,MAAM,mCAAmC,IAG5C,SAMH,+BAA+B,oBAAoB,IAAI;AAwBjD,MAAM,oCAAoC,IAG7C,SAKH,+BAA+B,qBAAqB,IAAI;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPrismic.cjs","sources":["../../src/createPrismic.ts"],"sourcesContent":["import {\n\tClient,\n\tFetchLike,\n\tLinkResolverFunction,\n\tasDate,\n\tasHTML,\n\tasImagePixelDensitySrcSet,\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasLink,\n\tasLinkAttrs,\n\tasText,\n\tcookie,\n\tcreateClient,\n\tdocumentToLinkField,\n\tfilter,\n\tisFilled,\n} from \"@prismicio/client\"
|
|
1
|
+
{"version":3,"file":"createPrismic.cjs","sources":["../../src/createPrismic.ts"],"sourcesContent":["import type {\n\tClient,\n\tFetchLike,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n\tLinkResolverFunction,\n} from \"@prismicio/client\"\nimport {\n\tasDate,\n\tasHTML,\n\tasImagePixelDensitySrcSet,\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasLink,\n\tasLinkAttrs,\n\tasText,\n\tcookie,\n\tcreateClient,\n\tdocumentToLinkField,\n\tfilter,\n\tisFilled,\n} from \"@prismicio/client\"\nimport type { App } from \"vue\"\n\nimport type {\n\tPrismicPlugin,\n\tPrismicPluginClient,\n\tPrismicPluginHelpers,\n\tPrismicPluginOptions,\n} from \"./types\"\n\nimport {\n\tPrismicEmbed,\n\tPrismicImage,\n\tPrismicLink,\n\tPrismicRichText,\n\tPrismicText,\n\tSliceZone,\n} from \"./components\"\nimport { prismicKey } from \"./injectionSymbols\"\n\n/**\n * Creates a `@prismicio/vue` plugin instance that can be used by a Vue app.\n *\n * @param options - {@link PrismicPluginOptions}\n *\n * @returns `@prismicio/vue` plugin instance {@link PrismicPlugin}\n *\n * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}\n * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}\n */\nexport const createPrismic = (options: PrismicPluginOptions): PrismicPlugin => {\n\t// Create plugin client\n\tlet client: Client\n\tif (options.client) {\n\t\tclient = options.client\n\t} else {\n\t\tclient = createClient(options.endpoint, {\n\t\t\tfetch: async (endpoint, options) => {\n\t\t\t\tlet fetchFunction: FetchLike\n\t\t\t\tif (typeof globalThis.fetch === \"function\") {\n\t\t\t\t\tfetchFunction = globalThis.fetch\n\t\t\t\t} else {\n\t\t\t\t\tfetchFunction = (await import(\"isomorphic-unfetch\")).default\n\t\t\t\t}\n\n\t\t\t\treturn await fetchFunction(endpoint, options)\n\t\t\t},\n\t\t\t...options.clientConfig,\n\t\t})\n\t}\n\n\tconst prismicClient: PrismicPluginClient = {\n\t\tclient,\n\t\tfilter,\n\t\tcookie,\n\t}\n\n\t// Create plugin helpers\n\tconst prismicHelpers: PrismicPluginHelpers = {\n\t\tasText,\n\t\tasHTML: (richTextField, ...config) => {\n\t\t\tconst [configOrLinkResolver, maybeHTMLSerializer] = config\n\n\t\t\treturn asHTML(\n\t\t\t\trichTextField,\n\t\t\t\ttypeof configOrLinkResolver === \"function\" ||\n\t\t\t\t\tconfigOrLinkResolver == null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tlinkResolver: configOrLinkResolver || options.linkResolver,\n\t\t\t\t\t\t\tserializer:\n\t\t\t\t\t\t\t\t(maybeHTMLSerializer as\n\t\t\t\t\t\t\t\t\t| HTMLRichTextFunctionSerializer\n\t\t\t\t\t\t\t\t\t| HTMLRichTextMapSerializer) ||\n\t\t\t\t\t\t\t\toptions.richTextSerializer ||\n\t\t\t\t\t\t\t\toptions.htmlSerializer,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\tserializer: options.richTextSerializer || options.htmlSerializer,\n\t\t\t\t\t\t\t...configOrLinkResolver,\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLink: (linkField, config) => {\n\t\t\treturn asLink(\n\t\t\t\tlinkField,\n\t\t\t\ttypeof config === \"function\"\n\t\t\t\t\t? { linkResolver: config }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\t// TODO: For some reasons, TypeScript narrows the type to \"unknown\" where it's supposed to be a union\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\t...(config as any),\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLinkAttrs: (linkField, config) => {\n\t\t\treturn asLinkAttrs(linkField, {\n\t\t\t\t// TODO: We can't really retrieve the generic type here, this might cause some unexpected type error in some edge-case scenario\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\tlinkResolver: options.linkResolver as LinkResolverFunction<any>,\n\t\t\t\t...config,\n\t\t\t})\n\t\t},\n\t\tasDate,\n\t\tasImageSrc,\n\t\tasImageWidthSrcSet,\n\t\tasImagePixelDensitySrcSet,\n\t\tisFilled,\n\t\tdocumentToLinkField,\n\t}\n\n\t// Create plugin interface\n\tconst prismic: PrismicPlugin = {\n\t\toptions,\n\n\t\t...prismicClient,\n\t\t...prismicHelpers,\n\n\t\tinstall(app: App): void {\n\t\t\tapp.provide(prismicKey, this)\n\t\t\tapp.config.globalProperties.$prismic = this\n\n\t\t\tif (options.injectComponents !== false) {\n\t\t\t\tapp.component(PrismicLink.name, PrismicLink)\n\t\t\t\tapp.component(PrismicEmbed.name, PrismicEmbed)\n\t\t\t\tapp.component(PrismicImage.name, PrismicImage)\n\t\t\t\tapp.component(PrismicText.name, PrismicText)\n\t\t\t\tapp.component(PrismicRichText.name, PrismicRichText)\n\t\t\t\tapp.component(SliceZone.name, SliceZone)\n\t\t\t}\n\t\t},\n\t}\n\n\treturn prismic\n}\n"],"names":["client","createClient","options","filter","cookie","asText","asHTML","asLink","asLinkAttrs","asDate","asImageSrc","asImageWidthSrcSet","asImagePixelDensitySrcSet","isFilled","documentToLinkField","prismicKey","PrismicLink","PrismicEmbed","PrismicImage","PrismicText","PrismicRichText","SliceZone"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDa,MAAA,gBAAgB,CAAC,YAAgD;AAEzE,MAAAA;AACJ,MAAI,QAAQ,QAAQ;AACnBA,eAAS,QAAQ;AAAA,EAAA,OACX;AACGA,eAAAC,OAAAA,aAAa,QAAQ,UAAU;AAAA,MACvC,OAAO,OAAO,UAAUC,aAAW;AAC9B,YAAA;AACA,YAAA,OAAO,WAAW,UAAU,YAAY;AAC3C,0BAAgB,WAAW;AAAA,QAAA,OACrB;AACW,2BAAA,MAAM,OAAO,oBAAoB,GAAG;AAAA,QAAA;AAG/C,eAAA,MAAM,cAAc,UAAUA,QAAO;AAAA,MAC7C;AAAA,MACA,GAAG,QAAQ;AAAA,IAAA,CACX;AAAA,EAAA;AAGF,QAAM,gBAAqC;AAAA,IAAA,QAC1CF;AAAAA,IAAA,QACAG,OAAA;AAAA,IACAC,QAAAA,OAAAA;AAAAA;AAID,QAAM,iBAAuC;AAAA,IAAA,QAC5CC,OAAA;AAAA,IACA,QAAQ,CAAC,kBAAkB,WAAU;AAC9B,YAAA,CAAC,sBAAsB,mBAAmB,IAAI;AAEpD,aAAOC,OAAAA,OACN,eACA,OAAO,yBAAyB,cAC/B,wBAAwB,OACtB;AAAA,QACA,cAAc,wBAAwB,QAAQ;AAAA,QAC9C,YACE,uBAGD,QAAQ,sBACR,QAAQ;AAAA,MAAA,IAET;AAAA,QACA,cAAc,QAAQ;AAAA,QACtB,YAAY,QAAQ,sBAAsB,QAAQ;AAAA,QAClD,GAAG;AAAA,MAAA,CACH;AAAA,IAEL;AAAA,IACA,QAAQ,CAAC,WAAW,WAAU;AACtB,aAAAC,OAAAA,OACN,WACA,OAAO,WAAW,aACf,EAAE,cAAc,WAChB;AAAA,QACA,cAAc,QAAQ;AAAA;AAAA;AAAA,QAGtB,GAAI;AAAA,MAAA,CACJ;AAAA,IAEL;AAAA,IACA,aAAa,CAAC,WAAW,WAAU;AAClC,aAAOC,OAAAA,YAAY,WAAW;AAAA;AAAA;AAAA,QAG7B,cAAc,QAAQ;AAAA,QACtB,GAAG;AAAA,MAAA,CACH;AAAA,IACF;AAAA,IAAA,QACAC,OAAA;AAAA,IAAA,YACAC,OAAA;AAAA,IAAA,oBACAC,OAAA;AAAA,IAAA,2BACAC,OAAA;AAAA,IAAA,UACAC,OAAA;AAAA,IACAC,qBAAAA,OAAAA;AAAAA;AAID,QAAM,UAAyB;AAAA,IAC9B;AAAA,IAEA,GAAG;AAAA,IACH,GAAG;AAAA,IAEH,QAAQ,KAAQ;AACX,UAAA,QAAQC,6BAAY,IAAI;AACxB,UAAA,OAAO,iBAAiB,WAAW;AAEnC,UAAA,QAAQ,qBAAqB,OAAO;AACnC,YAAA,UAAUC,wBAAY,MAAMA,YAAAA,WAAW;AACvC,YAAA,UAAUC,0BAAa,MAAMA,aAAAA,YAAY;AACzC,YAAA,UAAUC,0BAAa,MAAMA,aAAAA,YAAY;AACzC,YAAA,UAAUC,wBAAY,MAAMA,YAAAA,WAAW;AACvC,YAAA,UAAUC,gCAAgB,MAAMA,gBAAAA,eAAe;AAC/C,YAAA,UAAUC,oBAAU,MAAMA,UAAAA,SAAS;AAAA,MAAA;AAAA,IACxC;AAAA;AAIK,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPrismic.js","sources":["../../src/createPrismic.ts"],"sourcesContent":["import {\n\tClient,\n\tFetchLike,\n\tLinkResolverFunction,\n\tasDate,\n\tasHTML,\n\tasImagePixelDensitySrcSet,\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasLink,\n\tasLinkAttrs,\n\tasText,\n\tcookie,\n\tcreateClient,\n\tdocumentToLinkField,\n\tfilter,\n\tisFilled,\n} from \"@prismicio/client\"
|
|
1
|
+
{"version":3,"file":"createPrismic.js","sources":["../../src/createPrismic.ts"],"sourcesContent":["import type {\n\tClient,\n\tFetchLike,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n\tLinkResolverFunction,\n} from \"@prismicio/client\"\nimport {\n\tasDate,\n\tasHTML,\n\tasImagePixelDensitySrcSet,\n\tasImageSrc,\n\tasImageWidthSrcSet,\n\tasLink,\n\tasLinkAttrs,\n\tasText,\n\tcookie,\n\tcreateClient,\n\tdocumentToLinkField,\n\tfilter,\n\tisFilled,\n} from \"@prismicio/client\"\nimport type { App } from \"vue\"\n\nimport type {\n\tPrismicPlugin,\n\tPrismicPluginClient,\n\tPrismicPluginHelpers,\n\tPrismicPluginOptions,\n} from \"./types\"\n\nimport {\n\tPrismicEmbed,\n\tPrismicImage,\n\tPrismicLink,\n\tPrismicRichText,\n\tPrismicText,\n\tSliceZone,\n} from \"./components\"\nimport { prismicKey } from \"./injectionSymbols\"\n\n/**\n * Creates a `@prismicio/vue` plugin instance that can be used by a Vue app.\n *\n * @param options - {@link PrismicPluginOptions}\n *\n * @returns `@prismicio/vue` plugin instance {@link PrismicPlugin}\n *\n * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}\n * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}\n */\nexport const createPrismic = (options: PrismicPluginOptions): PrismicPlugin => {\n\t// Create plugin client\n\tlet client: Client\n\tif (options.client) {\n\t\tclient = options.client\n\t} else {\n\t\tclient = createClient(options.endpoint, {\n\t\t\tfetch: async (endpoint, options) => {\n\t\t\t\tlet fetchFunction: FetchLike\n\t\t\t\tif (typeof globalThis.fetch === \"function\") {\n\t\t\t\t\tfetchFunction = globalThis.fetch\n\t\t\t\t} else {\n\t\t\t\t\tfetchFunction = (await import(\"isomorphic-unfetch\")).default\n\t\t\t\t}\n\n\t\t\t\treturn await fetchFunction(endpoint, options)\n\t\t\t},\n\t\t\t...options.clientConfig,\n\t\t})\n\t}\n\n\tconst prismicClient: PrismicPluginClient = {\n\t\tclient,\n\t\tfilter,\n\t\tcookie,\n\t}\n\n\t// Create plugin helpers\n\tconst prismicHelpers: PrismicPluginHelpers = {\n\t\tasText,\n\t\tasHTML: (richTextField, ...config) => {\n\t\t\tconst [configOrLinkResolver, maybeHTMLSerializer] = config\n\n\t\t\treturn asHTML(\n\t\t\t\trichTextField,\n\t\t\t\ttypeof configOrLinkResolver === \"function\" ||\n\t\t\t\t\tconfigOrLinkResolver == null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tlinkResolver: configOrLinkResolver || options.linkResolver,\n\t\t\t\t\t\t\tserializer:\n\t\t\t\t\t\t\t\t(maybeHTMLSerializer as\n\t\t\t\t\t\t\t\t\t| HTMLRichTextFunctionSerializer\n\t\t\t\t\t\t\t\t\t| HTMLRichTextMapSerializer) ||\n\t\t\t\t\t\t\t\toptions.richTextSerializer ||\n\t\t\t\t\t\t\t\toptions.htmlSerializer,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\tserializer: options.richTextSerializer || options.htmlSerializer,\n\t\t\t\t\t\t\t...configOrLinkResolver,\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLink: (linkField, config) => {\n\t\t\treturn asLink(\n\t\t\t\tlinkField,\n\t\t\t\ttypeof config === \"function\"\n\t\t\t\t\t? { linkResolver: config }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\t// TODO: For some reasons, TypeScript narrows the type to \"unknown\" where it's supposed to be a union\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\t...(config as any),\n\t\t\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tasLinkAttrs: (linkField, config) => {\n\t\t\treturn asLinkAttrs(linkField, {\n\t\t\t\t// TODO: We can't really retrieve the generic type here, this might cause some unexpected type error in some edge-case scenario\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\tlinkResolver: options.linkResolver as LinkResolverFunction<any>,\n\t\t\t\t...config,\n\t\t\t})\n\t\t},\n\t\tasDate,\n\t\tasImageSrc,\n\t\tasImageWidthSrcSet,\n\t\tasImagePixelDensitySrcSet,\n\t\tisFilled,\n\t\tdocumentToLinkField,\n\t}\n\n\t// Create plugin interface\n\tconst prismic: PrismicPlugin = {\n\t\toptions,\n\n\t\t...prismicClient,\n\t\t...prismicHelpers,\n\n\t\tinstall(app: App): void {\n\t\t\tapp.provide(prismicKey, this)\n\t\t\tapp.config.globalProperties.$prismic = this\n\n\t\t\tif (options.injectComponents !== false) {\n\t\t\t\tapp.component(PrismicLink.name, PrismicLink)\n\t\t\t\tapp.component(PrismicEmbed.name, PrismicEmbed)\n\t\t\t\tapp.component(PrismicImage.name, PrismicImage)\n\t\t\t\tapp.component(PrismicText.name, PrismicText)\n\t\t\t\tapp.component(PrismicRichText.name, PrismicRichText)\n\t\t\t\tapp.component(SliceZone.name, SliceZone)\n\t\t\t}\n\t\t},\n\t}\n\n\treturn prismic\n}\n"],"names":["options"],"mappings":";;;;;;;;AAmDa,MAAA,gBAAgB,CAAC,YAAgD;AAEzE,MAAA;AACJ,MAAI,QAAQ,QAAQ;AACnB,aAAS,QAAQ;AAAA,EAAA,OACX;AACG,aAAA,aAAa,QAAQ,UAAU;AAAA,MACvC,OAAO,OAAO,UAAUA,aAAW;AAC9B,YAAA;AACA,YAAA,OAAO,WAAW,UAAU,YAAY;AAC3C,0BAAgB,WAAW;AAAA,QAAA,OACrB;AACW,2BAAA,MAAM,OAAO,oBAAoB,GAAG;AAAA,QAAA;AAG/C,eAAA,MAAM,cAAc,UAAUA,QAAO;AAAA,MAC7C;AAAA,MACA,GAAG,QAAQ;AAAA,IAAA,CACX;AAAA,EAAA;AAGF,QAAM,gBAAqC;AAAA,IAC1C;AAAA,IACA;AAAA,IACA;AAAA;AAID,QAAM,iBAAuC;AAAA,IAC5C;AAAA,IACA,QAAQ,CAAC,kBAAkB,WAAU;AAC9B,YAAA,CAAC,sBAAsB,mBAAmB,IAAI;AAEpD,aAAO,OACN,eACA,OAAO,yBAAyB,cAC/B,wBAAwB,OACtB;AAAA,QACA,cAAc,wBAAwB,QAAQ;AAAA,QAC9C,YACE,uBAGD,QAAQ,sBACR,QAAQ;AAAA,MAAA,IAET;AAAA,QACA,cAAc,QAAQ;AAAA,QACtB,YAAY,QAAQ,sBAAsB,QAAQ;AAAA,QAClD,GAAG;AAAA,MAAA,CACH;AAAA,IAEL;AAAA,IACA,QAAQ,CAAC,WAAW,WAAU;AACtB,aAAA,OACN,WACA,OAAO,WAAW,aACf,EAAE,cAAc,WAChB;AAAA,QACA,cAAc,QAAQ;AAAA;AAAA;AAAA,QAGtB,GAAI;AAAA,MAAA,CACJ;AAAA,IAEL;AAAA,IACA,aAAa,CAAC,WAAW,WAAU;AAClC,aAAO,YAAY,WAAW;AAAA;AAAA;AAAA,QAG7B,cAAc,QAAQ;AAAA,QACtB,GAAG;AAAA,MAAA,CACH;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAID,QAAM,UAAyB;AAAA,IAC9B;AAAA,IAEA,GAAG;AAAA,IACH,GAAG;AAAA,IAEH,QAAQ,KAAQ;AACX,UAAA,QAAQ,YAAY,IAAI;AACxB,UAAA,OAAO,iBAAiB,WAAW;AAEnC,UAAA,QAAQ,qBAAqB,OAAO;AACnC,YAAA,UAAU,YAAY,MAAM,WAAW;AACvC,YAAA,UAAU,aAAa,MAAM,YAAY;AACzC,YAAA,UAAU,aAAa,MAAM,YAAY;AACzC,YAAA,UAAU,YAAY,MAAM,WAAW;AACvC,YAAA,UAAU,gBAAgB,MAAM,eAAe;AAC/C,YAAA,UAAU,UAAU,MAAM,SAAS;AAAA,MAAA;AAAA,IACxC;AAAA;AAIK,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectionSymbols.cjs","sources":["../../src/injectionSymbols.ts"],"sourcesContent":["import type { InjectionKey } from \"vue\"
|
|
1
|
+
{"version":3,"file":"injectionSymbols.cjs","sources":["../../src/injectionSymbols.ts"],"sourcesContent":["import type { InjectionKey } from \"vue\"\n\nimport type { PrismicPlugin } from \"./types\"\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n// Imports for @link references:\nimport type { usePrismic } from \"./usePrismic\"\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * `@prismicio/vue` plugin interface interface location used for\n * {@link usePrismic}.\n *\n * @internal\n */\nexport const prismicKey = Symbol(\"prismic\") as InjectionKey<PrismicPlugin>\n"],"names":[],"mappings":";;AAgBa,MAAA,aAAa,OAAO,SAAS;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectionSymbols.js","sources":["../../src/injectionSymbols.ts"],"sourcesContent":["import type { InjectionKey } from \"vue\"
|
|
1
|
+
{"version":3,"file":"injectionSymbols.js","sources":["../../src/injectionSymbols.ts"],"sourcesContent":["import type { InjectionKey } from \"vue\"\n\nimport type { PrismicPlugin } from \"./types\"\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n// Imports for @link references:\nimport type { usePrismic } from \"./usePrismic\"\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * `@prismicio/vue` plugin interface interface location used for\n * {@link usePrismic}.\n *\n * @internal\n */\nexport const prismicKey = Symbol(\"prismic\") as InjectionKey<PrismicPlugin>\n"],"names":[],"mappings":"AAgBa,MAAA,aAAa,OAAO,SAAS;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__PRODUCTION__.cjs","sources":["../../../src/lib/__PRODUCTION__.ts"],"sourcesContent":["// We need to polyfill process if it doesn't exist, such as in the browser.\nif (typeof process === \"undefined\") {\n\tglobalThis.process = { env: {} } as typeof process
|
|
1
|
+
{"version":3,"file":"__PRODUCTION__.cjs","sources":["../../../src/lib/__PRODUCTION__.ts"],"sourcesContent":["// We need to polyfill process if it doesn't exist, such as in the browser.\nif (typeof process === \"undefined\") {\n\tglobalThis.process = { env: {} } as typeof process\n}\n\n/**\n * `true` if in the production environment, `false` otherwise.\n *\n * This boolean can be used to perform actions only in development environments,\n * such as logging.\n */\nexport const __PRODUCTION__ = process.env.NODE_ENV === \"production\"\n"],"names":[],"mappings":";;AACA,IAAI,OAAO,YAAY,aAAa;AACnC,aAAW,UAAU,EAAE,KAAK;AAC7B;AAQa,MAAA,iBAAiB,QAAQ,IAAI,aAAa;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__PRODUCTION__.js","sources":["../../../src/lib/__PRODUCTION__.ts"],"sourcesContent":["// We need to polyfill process if it doesn't exist, such as in the browser.\nif (typeof process === \"undefined\") {\n\tglobalThis.process = { env: {} } as typeof process
|
|
1
|
+
{"version":3,"file":"__PRODUCTION__.js","sources":["../../../src/lib/__PRODUCTION__.ts"],"sourcesContent":["// We need to polyfill process if it doesn't exist, such as in the browser.\nif (typeof process === \"undefined\") {\n\tglobalThis.process = { env: {} } as typeof process\n}\n\n/**\n * `true` if in the production environment, `false` otherwise.\n *\n * This boolean can be used to perform actions only in development environments,\n * such as logging.\n */\nexport const __PRODUCTION__ = process.env.NODE_ENV === \"production\"\n"],"names":[],"mappings":"AACA,IAAI,OAAO,YAAY,aAAa;AACnC,aAAW,UAAU,EAAE,KAAK;AAC7B;AAQa,MAAA,iBAAiB,QAAQ,IAAI,aAAa;"}
|
package/dist/lib/getSlots.cjs
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue = require("vue");
|
|
3
4
|
const getSlots = (parent, slots, defaultPayload, fallback) => {
|
|
5
|
+
const fallbackSlot = fallback ? () => [vue.h(vue.Text, fallback)] : void 0;
|
|
4
6
|
if (typeof parent === "string") {
|
|
5
|
-
return slots.default ? slots.default(defaultPayload) :
|
|
7
|
+
return slots.default ? slots.default(defaultPayload) : fallbackSlot == null ? void 0 : fallbackSlot();
|
|
6
8
|
} else {
|
|
7
9
|
if (slots.default) {
|
|
8
10
|
const content = slots.default(defaultPayload);
|
|
9
|
-
return
|
|
11
|
+
return {
|
|
10
12
|
...slots,
|
|
11
|
-
default: () => content
|
|
12
|
-
}
|
|
13
|
+
default: content.length ? () => content : fallbackSlot
|
|
14
|
+
};
|
|
13
15
|
} else {
|
|
14
|
-
return
|
|
16
|
+
return fallbackSlot;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSlots.cjs","sources":["../../../src/lib/getSlots.ts"],"sourcesContent":["import { ConcreteComponent
|
|
1
|
+
{"version":3,"file":"getSlots.cjs","sources":["../../../src/lib/getSlots.ts"],"sourcesContent":["import {\n\ttype ConcreteComponent,\n\ttype Slot,\n\ttype Slots,\n\tText,\n\ttype VNode,\n\th,\n} from \"vue\"\n\n/**\n * Get the appropriate `slots` object/array according to the provided parent,\n * fixing `Non-function value encountered for default slot.` warnings.\n *\n * @param parent - The parent inheriting slots\n * @param slots - The `slots` to transform for parent\n * @param defaultParams - The parameters to provide to the default slot\n *\n * @returns The appropriate slots object/array\n *\n * @internal\n */\nexport const getSlots = (\n\tparent: string | ConcreteComponent,\n\tslots: Slots,\n\tdefaultPayload?: unknown,\n\tfallback?: string,\n): VNode[] | Slots | Slot | undefined => {\n\tconst fallbackSlot = fallback ? () => [h(Text, fallback)] : undefined\n\tif (typeof parent === \"string\") {\n\t\treturn slots.default ? slots.default(defaultPayload) : fallbackSlot?.()\n\t} else {\n\t\tif (slots.default) {\n\t\t\tconst content = slots.default(defaultPayload)\n\n\t\t\treturn {\n\t\t\t\t...slots,\n\t\t\t\tdefault: content.length ? () => content : fallbackSlot,\n\t\t\t}\n\t\t} else {\n\t\t\treturn fallbackSlot\n\t\t}\n\t}\n}\n"],"names":["h","Text"],"mappings":";;;AAqBO,MAAM,WAAW,CACvB,QACA,OACA,gBACA,aACuC;AACjC,QAAA,eAAe,WAAW,MAAM,CAACA,IAAAA,EAAEC,IAAAA,MAAM,QAAQ,CAAC,IAAI;AACxD,MAAA,OAAO,WAAW,UAAU;AAC/B,WAAO,MAAM,UAAU,MAAM,QAAQ,cAAc,IAAI;AAAA,SACjD;AACN,QAAI,MAAM,SAAS;AACZ,YAAA,UAAU,MAAM,QAAQ,cAAc;AAErC,aAAA;AAAA,QACN,GAAG;AAAA,QACH,SAAS,QAAQ,SAAS,MAAM,UAAU;AAAA;WAErC;AACC,aAAA;AAAA,IAAA;AAAA,EACR;AAEF;;"}
|
package/dist/lib/getSlots.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConcreteComponent, Slots, VNode } from "vue";
|
|
1
|
+
import { type ConcreteComponent, type Slot, type Slots, type VNode } from "vue";
|
|
2
2
|
/**
|
|
3
3
|
* Get the appropriate `slots` object/array according to the provided parent,
|
|
4
4
|
* fixing `Non-function value encountered for default slot.` warnings.
|
|
@@ -11,4 +11,4 @@ import { ConcreteComponent, Slots, VNode } from "vue";
|
|
|
11
11
|
*
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
|
-
export declare const getSlots: (parent: string | ConcreteComponent, slots: Slots, defaultPayload?: unknown, fallback?: string) => VNode[] |
|
|
14
|
+
export declare const getSlots: (parent: string | ConcreteComponent, slots: Slots, defaultPayload?: unknown, fallback?: string) => VNode[] | Slots | Slot | undefined;
|
package/dist/lib/getSlots.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { h, Text } from "vue";
|
|
1
2
|
const getSlots = (parent, slots, defaultPayload, fallback) => {
|
|
3
|
+
const fallbackSlot = fallback ? () => [h(Text, fallback)] : void 0;
|
|
2
4
|
if (typeof parent === "string") {
|
|
3
|
-
return slots.default ? slots.default(defaultPayload) :
|
|
5
|
+
return slots.default ? slots.default(defaultPayload) : fallbackSlot == null ? void 0 : fallbackSlot();
|
|
4
6
|
} else {
|
|
5
7
|
if (slots.default) {
|
|
6
8
|
const content = slots.default(defaultPayload);
|
|
7
|
-
return
|
|
9
|
+
return {
|
|
8
10
|
...slots,
|
|
9
|
-
default: () => content
|
|
10
|
-
}
|
|
11
|
+
default: content.length ? () => content : fallbackSlot
|
|
12
|
+
};
|
|
11
13
|
} else {
|
|
12
|
-
return
|
|
14
|
+
return fallbackSlot;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
};
|
package/dist/lib/getSlots.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSlots.js","sources":["../../../src/lib/getSlots.ts"],"sourcesContent":["import { ConcreteComponent
|
|
1
|
+
{"version":3,"file":"getSlots.js","sources":["../../../src/lib/getSlots.ts"],"sourcesContent":["import {\n\ttype ConcreteComponent,\n\ttype Slot,\n\ttype Slots,\n\tText,\n\ttype VNode,\n\th,\n} from \"vue\"\n\n/**\n * Get the appropriate `slots` object/array according to the provided parent,\n * fixing `Non-function value encountered for default slot.` warnings.\n *\n * @param parent - The parent inheriting slots\n * @param slots - The `slots` to transform for parent\n * @param defaultParams - The parameters to provide to the default slot\n *\n * @returns The appropriate slots object/array\n *\n * @internal\n */\nexport const getSlots = (\n\tparent: string | ConcreteComponent,\n\tslots: Slots,\n\tdefaultPayload?: unknown,\n\tfallback?: string,\n): VNode[] | Slots | Slot | undefined => {\n\tconst fallbackSlot = fallback ? () => [h(Text, fallback)] : undefined\n\tif (typeof parent === \"string\") {\n\t\treturn slots.default ? slots.default(defaultPayload) : fallbackSlot?.()\n\t} else {\n\t\tif (slots.default) {\n\t\t\tconst content = slots.default(defaultPayload)\n\n\t\t\treturn {\n\t\t\t\t...slots,\n\t\t\t\tdefault: content.length ? () => content : fallbackSlot,\n\t\t\t}\n\t\t} else {\n\t\t\treturn fallbackSlot\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAqBO,MAAM,WAAW,CACvB,QACA,OACA,gBACA,aACuC;AACjC,QAAA,eAAe,WAAW,MAAM,CAAC,EAAE,MAAM,QAAQ,CAAC,IAAI;AACxD,MAAA,OAAO,WAAW,UAAU;AAC/B,WAAO,MAAM,UAAU,MAAM,QAAQ,cAAc,IAAI;AAAA,SACjD;AACN,QAAI,MAAM,SAAS;AACZ,YAAA,UAAU,MAAM,QAAQ,cAAc;AAErC,aAAA;AAAA,QACN,GAAG;AAAA,QACH,SAAS,QAAQ,SAAS,MAAM,UAAU;AAAA;WAErC;AACC,aAAA;AAAA,IAAA;AAAA,EACR;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isInternalURL.cjs","sources":["../../../src/lib/isInternalURL.ts"],"sourcesContent":["/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external\n *\n * @returns `true` if `url` is internal, `false` otherwise\n */\n// TODO: This does not detect all relative URLs as internal, such as `about` or `./about`. This function assumes relative URLs start with a \"/\"`.\nexport const isInternalURL = (url: string): boolean => {\n\t/**\n\t * @see Regex101 expression: {@link https://regex101.com/r/1y7iod/1}\n\t */\n\tconst isInternal = /^\\/(?!\\/)/.test(url)
|
|
1
|
+
{"version":3,"file":"isInternalURL.cjs","sources":["../../../src/lib/isInternalURL.ts"],"sourcesContent":["/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external\n *\n * @returns `true` if `url` is internal, `false` otherwise\n */\n// TODO: This does not detect all relative URLs as internal, such as `about` or `./about`. This function assumes relative URLs start with a \"/\"`.\nexport const isInternalURL = (url: string): boolean => {\n\t/**\n\t * @see Regex101 expression: {@link https://regex101.com/r/1y7iod/1}\n\t */\n\tconst isInternal = /^\\/(?!\\/)/.test(url)\n\t/**\n\t * @see Regex101 expression: {@link https://regex101.com/r/RnUseS/1}\n\t */\n\tconst isSpecialLink = !isInternal && !/^https?:\\/\\//i.test(url)\n\n\treturn isInternal && !isSpecialLink\n}\n"],"names":[],"mappings":";;AAQa,MAAA,gBAAgB,CAAC,QAAwB;AAI/C,QAAA,aAAa,YAAY,KAAK,GAAG;AAIvC,QAAM,gBAAgB,CAAC,cAAc,CAAC,gBAAgB,KAAK,GAAG;AAE9D,SAAO,cAAc,CAAC;AACvB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isInternalURL.js","sources":["../../../src/lib/isInternalURL.ts"],"sourcesContent":["/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external\n *\n * @returns `true` if `url` is internal, `false` otherwise\n */\n// TODO: This does not detect all relative URLs as internal, such as `about` or `./about`. This function assumes relative URLs start with a \"/\"`.\nexport const isInternalURL = (url: string): boolean => {\n\t/**\n\t * @see Regex101 expression: {@link https://regex101.com/r/1y7iod/1}\n\t */\n\tconst isInternal = /^\\/(?!\\/)/.test(url)
|
|
1
|
+
{"version":3,"file":"isInternalURL.js","sources":["../../../src/lib/isInternalURL.ts"],"sourcesContent":["/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external\n *\n * @returns `true` if `url` is internal, `false` otherwise\n */\n// TODO: This does not detect all relative URLs as internal, such as `about` or `./about`. This function assumes relative URLs start with a \"/\"`.\nexport const isInternalURL = (url: string): boolean => {\n\t/**\n\t * @see Regex101 expression: {@link https://regex101.com/r/1y7iod/1}\n\t */\n\tconst isInternal = /^\\/(?!\\/)/.test(url)\n\t/**\n\t * @see Regex101 expression: {@link https://regex101.com/r/RnUseS/1}\n\t */\n\tconst isSpecialLink = !isInternal && !/^https?:\\/\\//i.test(url)\n\n\treturn isInternal && !isSpecialLink\n}\n"],"names":[],"mappings":"AAQa,MAAA,gBAAgB,CAAC,QAAwB;AAI/C,QAAA,aAAa,YAAY,KAAK,GAAG;AAIvC,QAAM,gBAAgB,CAAC,cAAc,CAAC,gBAAgB,KAAK,GAAG;AAE9D,SAAO,cAAc,CAAC;AACvB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplyResolveComponent.cjs","sources":["../../../src/lib/simplyResolveComponent.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"simplyResolveComponent.cjs","sources":["../../../src/lib/simplyResolveComponent.ts"],"sourcesContent":["import type { ConcreteComponent, DefineComponent, Raw, VNode } from \"vue\"\nimport { resolveDynamicComponent } from \"vue\"\n\n/**\n * A stricter version of {@link resolveDynamicComponent} that resolves only type\n * {@link VNode} for existing components or provided `string`.\n *\n * @param component - An HTML tag name, a component, or a functional component\n *\n * @returns Resolved component as a {@link VNode} or provided `string`.\n *\n * @internal\n */\nexport const simplyResolveComponent = (\n\tcomponent: string | ConcreteComponent | Raw<DefineComponent>,\n): string | VNode => {\n\treturn resolveDynamicComponent(component) as string | VNode\n}\n"],"names":["resolveDynamicComponent"],"mappings":";;;AAaa,MAAA,yBAAyB,CACrC,cACmB;AACnB,SAAOA,IAAAA,wBAAwB,SAAS;AACzC;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConcreteComponent, DefineComponent, Raw, VNode } from "vue";
|
|
1
|
+
import type { ConcreteComponent, DefineComponent, Raw, VNode } from "vue";
|
|
2
2
|
/**
|
|
3
3
|
* A stricter version of {@link resolveDynamicComponent} that resolves only type
|
|
4
4
|
* {@link VNode} for existing components or provided `string`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplyResolveComponent.js","sources":["../../../src/lib/simplyResolveComponent.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"simplyResolveComponent.js","sources":["../../../src/lib/simplyResolveComponent.ts"],"sourcesContent":["import type { ConcreteComponent, DefineComponent, Raw, VNode } from \"vue\"\nimport { resolveDynamicComponent } from \"vue\"\n\n/**\n * A stricter version of {@link resolveDynamicComponent} that resolves only type\n * {@link VNode} for existing components or provided `string`.\n *\n * @param component - An HTML tag name, a component, or a functional component\n *\n * @returns Resolved component as a {@link VNode} or provided `string`.\n *\n * @internal\n */\nexport const simplyResolveComponent = (\n\tcomponent: string | ConcreteComponent | Raw<DefineComponent>,\n): string | VNode => {\n\treturn resolveDynamicComponent(component) as string | VNode\n}\n"],"names":[],"mappings":";AAaa,MAAA,yBAAyB,CACrC,cACmB;AACnB,SAAO,wBAAwB,SAAS;AACzC;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ type PrismicPluginComponentsOptions = {
|
|
|
22
22
|
* @remarks
|
|
23
23
|
* Components will be rendered using Vue Router {@link RouterLink} interface
|
|
24
24
|
* (`to` props).
|
|
25
|
+
*
|
|
25
26
|
* @defaultValue {@link RouterLink}
|
|
26
27
|
*/
|
|
27
28
|
linkInternalComponent?: string | ConcreteComponent | Raw<DefineComponent>;
|
|
@@ -35,6 +36,7 @@ type PrismicPluginComponentsOptions = {
|
|
|
35
36
|
* @remarks
|
|
36
37
|
* Components will be rendered using Vue Router {@link RouterLink} interface
|
|
37
38
|
* (`to` props).
|
|
39
|
+
*
|
|
38
40
|
* @defaultValue `"a"`
|
|
39
41
|
*/
|
|
40
42
|
linkExternalComponent?: string | ConcreteComponent | Raw<DefineComponent>;
|
|
@@ -46,6 +48,7 @@ type PrismicPluginComponentsOptions = {
|
|
|
46
48
|
* HTML tag names and components will be rendered using the `img` tag
|
|
47
49
|
* interface (`src` and `alt` attribute). Components will also receive an
|
|
48
50
|
* additional `copyright` props.
|
|
51
|
+
*
|
|
49
52
|
* @defaultValue `"img"`
|
|
50
53
|
*/
|
|
51
54
|
imageComponent?: string | ConcreteComponent | Raw<DefineComponent>;
|
|
@@ -56,6 +59,7 @@ type PrismicPluginComponentsOptions = {
|
|
|
56
59
|
* Consider configuring image widths within your content type definition and
|
|
57
60
|
* using `widths="auto"` instead to give content writers the ability to crop
|
|
58
61
|
* images in the editor.
|
|
62
|
+
*
|
|
59
63
|
* @defaultValue `@prismicio/client` defaults
|
|
60
64
|
*/
|
|
61
65
|
imageWidthSrcSetDefaults?: number[];
|
|
@@ -132,6 +136,7 @@ type PrismicPluginOptionsWithClient = PrismicPluginOptionsBase & {
|
|
|
132
136
|
* The client will be used by `@prismicio/vue` composables, such as
|
|
133
137
|
* {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
|
|
134
138
|
* `usePrismic().client`.
|
|
139
|
+
*
|
|
135
140
|
* @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
|
|
136
141
|
*/
|
|
137
142
|
client: ReturnType<CreateClient>;
|
|
@@ -162,14 +167,15 @@ type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
|
|
|
162
167
|
* Said client will be used by `@prismicio/vue` composables, such as
|
|
163
168
|
* {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
|
|
164
169
|
* `usePrismic().client`.
|
|
170
|
+
*
|
|
165
171
|
* @example
|
|
166
172
|
*
|
|
167
173
|
* ```javascript
|
|
168
174
|
* // A repository ID
|
|
169
|
-
* "my-repo"
|
|
175
|
+
* "my-repo"
|
|
170
176
|
*
|
|
171
177
|
* //A full repository endpoint
|
|
172
|
-
* "https://my-repo.cdn.prismic.io/api/v2"
|
|
178
|
+
* "https://my-repo.cdn.prismic.io/api/v2"
|
|
173
179
|
* ```
|
|
174
180
|
*
|
|
175
181
|
* @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
|
|
@@ -266,6 +272,7 @@ export type PrismicPluginHelpers = {
|
|
|
266
272
|
* @remarks
|
|
267
273
|
* If no `htmlSerializer` is provided the function will use the one provided
|
|
268
274
|
* to the plugin at {@link PrismicPluginOptions.htmlSerializer} if available.
|
|
275
|
+
*
|
|
269
276
|
* @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
|
|
270
277
|
*/
|
|
271
278
|
asHTML: typeof asHTML;
|
|
@@ -276,6 +283,7 @@ export type PrismicPluginHelpers = {
|
|
|
276
283
|
* @remarks
|
|
277
284
|
* If no `linkResolver` is provided the function will use the one provided to
|
|
278
285
|
* the plugin at {@link PrismicPluginOptions.linkResolver} if available.
|
|
286
|
+
*
|
|
279
287
|
* @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
|
|
280
288
|
*/
|
|
281
289
|
asLink: typeof asLink;
|
|
@@ -286,6 +294,7 @@ export type PrismicPluginHelpers = {
|
|
|
286
294
|
* @remarks
|
|
287
295
|
* If no `linkResolver` is provided the function will use the one provided to
|
|
288
296
|
* the plugin at {@link PrismicPluginOptions.linkResolver} if available.
|
|
297
|
+
*
|
|
289
298
|
* @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
|
|
290
299
|
*/
|
|
291
300
|
asLinkAttrs: typeof asLinkAttrs;
|
package/dist/usePrismic.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePrismic.cjs","sources":["../../src/usePrismic.ts"],"sourcesContent":["import { inject } from \"vue\"
|
|
1
|
+
{"version":3,"file":"usePrismic.cjs","sources":["../../src/usePrismic.ts"],"sourcesContent":["import { inject } from \"vue\"\n\nimport type { PrismicPlugin } from \"./types\"\n\nimport { prismicKey } from \"./injectionSymbols\"\n\n/**\n * Accesses `@prismicio/vue` plugin interface.\n *\n * @example\n *\n * ```javascript\n * // With the composition API\n * import { usePrismic } from \"@prismicio/vue\"\n *\n * export default {\n * \tsetup() {\n * \t\tconst prismic = usePrismic()\n *\n * \t\treturn {}\n * \t},\n * }\n * ```\n *\n * @returns The interface {@link PrismicPlugin}\n */\nexport const usePrismic = (): PrismicPlugin => {\n\treturn inject(prismicKey, { options: { endpoint: \"\" } } as PrismicPlugin)\n}\n"],"names":["inject","prismicKey"],"mappings":";;;;AA0BO,MAAM,aAAa,MAAoB;AACtC,SAAAA,IAAAA,OAAOC,iBAAAA,YAAY,EAAE,SAAS,EAAE,UAAU,GAAA,GAAuB;AACzE;;"}
|
package/dist/usePrismic.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PrismicPlugin } from "./types";
|
|
1
|
+
import type { PrismicPlugin } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Accesses `@prismicio/vue` plugin interface.
|
|
4
4
|
*
|
|
@@ -6,15 +6,15 @@ import { PrismicPlugin } from "./types";
|
|
|
6
6
|
*
|
|
7
7
|
* ```javascript
|
|
8
8
|
* // With the composition API
|
|
9
|
-
* import { usePrismic } from "@prismicio/vue"
|
|
9
|
+
* import { usePrismic } from "@prismicio/vue"
|
|
10
10
|
*
|
|
11
11
|
* export default {
|
|
12
12
|
* setup() {
|
|
13
|
-
* const prismic = usePrismic()
|
|
13
|
+
* const prismic = usePrismic()
|
|
14
14
|
*
|
|
15
|
-
* return {}
|
|
15
|
+
* return {}
|
|
16
16
|
* },
|
|
17
|
-
* }
|
|
17
|
+
* }
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
20
|
* @returns The interface {@link PrismicPlugin}
|
package/dist/usePrismic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePrismic.js","sources":["../../src/usePrismic.ts"],"sourcesContent":["import { inject } from \"vue\"
|
|
1
|
+
{"version":3,"file":"usePrismic.js","sources":["../../src/usePrismic.ts"],"sourcesContent":["import { inject } from \"vue\"\n\nimport type { PrismicPlugin } from \"./types\"\n\nimport { prismicKey } from \"./injectionSymbols\"\n\n/**\n * Accesses `@prismicio/vue` plugin interface.\n *\n * @example\n *\n * ```javascript\n * // With the composition API\n * import { usePrismic } from \"@prismicio/vue\"\n *\n * export default {\n * \tsetup() {\n * \t\tconst prismic = usePrismic()\n *\n * \t\treturn {}\n * \t},\n * }\n * ```\n *\n * @returns The interface {@link PrismicPlugin}\n */\nexport const usePrismic = (): PrismicPlugin => {\n\treturn inject(prismicKey, { options: { endpoint: \"\" } } as PrismicPlugin)\n}\n"],"names":[],"mappings":";;AA0BO,MAAM,aAAa,MAAoB;AACtC,SAAA,OAAO,YAAY,EAAE,SAAS,EAAE,UAAU,GAAA,GAAuB;AACzE;"}
|