@prismicio/vue 3.0.0-beta.1 → 3.0.0-beta.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/README.md +1 -1
- package/dist/index.cjs +78 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +340 -43
- package/dist/index.js +79 -9
- package/dist/index.js.map +1 -1
- package/package.json +24 -21
- package/src/components/PrismicImage.ts +189 -11
- package/src/components/PrismicLink.ts +1 -0
- package/src/components/PrismicRichText.ts +4 -1
- package/src/components/PrismicText.ts +2 -2
- package/src/components/SliceZone.ts +5 -1
- package/src/components/index.ts +6 -2
- package/src/composables.ts +54 -0
- package/src/createPrismic.ts +9 -3
- package/src/index.ts +2 -0
- package/src/lib/getSlots.ts +1 -0
- package/src/lib/simplyResolveComponent.ts +1 -0
- package/src/types.ts +24 -0
- package/src/useStatefulPrismicClientMethod.ts +2 -0
- package/vetur/attributes.json +10 -2
- package/vetur/tags.json +3 -1
package/src/types.ts
CHANGED
|
@@ -15,6 +15,9 @@ import type {
|
|
|
15
15
|
HTMLFunctionSerializer,
|
|
16
16
|
HTMLMapSerializer,
|
|
17
17
|
LinkResolverFunction,
|
|
18
|
+
asImageSrc,
|
|
19
|
+
asImageWidthSrcSet,
|
|
20
|
+
asImagePixelDensitySrcSet,
|
|
18
21
|
} from "@prismicio/helpers";
|
|
19
22
|
|
|
20
23
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -89,6 +92,7 @@ type PrismicPluginComponentsOptions = {
|
|
|
89
92
|
*
|
|
90
93
|
* @remarks
|
|
91
94
|
* Components will be rendered using the {@link SliceComponentProps} interface.
|
|
95
|
+
*
|
|
92
96
|
* @defaultValue `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}
|
|
93
97
|
*/
|
|
94
98
|
sliceZoneDefaultComponent?: SliceComponentType;
|
|
@@ -308,6 +312,26 @@ export type PrismicPluginHelpers = {
|
|
|
308
312
|
*/
|
|
309
313
|
asDate: typeof asDate;
|
|
310
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Returns the URL of an Image field with optional image transformations (via
|
|
317
|
+
* Imgix URL parameters). This is `@prismicio/helpers` {@link asImageSrc} function.
|
|
318
|
+
*/
|
|
319
|
+
asImageSrc: typeof asImageSrc;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Creates a width-based `srcset` from an Image field with optional image
|
|
323
|
+
* transformations (via Imgix URL parameters). This is `@prismicio/helpers`
|
|
324
|
+
* {@link asImageWidthSrcSet} function.
|
|
325
|
+
*/
|
|
326
|
+
asImageWidthSrcSet: typeof asImageWidthSrcSet;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Creates a pixel-density-based `srcset` from an Image field with optional
|
|
330
|
+
* image transformations (via Imgix URL parameters). This is
|
|
331
|
+
* `@prismicio/helpers` {@link asImagePixelDensitySrcSet} function.
|
|
332
|
+
*/
|
|
333
|
+
asImagePixelDensitySrcSet: typeof asImagePixelDensitySrcSet;
|
|
334
|
+
|
|
311
335
|
/**
|
|
312
336
|
* Converts a document into a link field. This is `@prismicio/helpers`
|
|
313
337
|
* {@link documentToLinkField} function.
|
|
@@ -91,10 +91,12 @@ const isParams = (
|
|
|
91
91
|
* @typeParam TClientMethodName - A method name from `@prismicio/client`
|
|
92
92
|
* @typeParam TClientMethodArguments - The method expected arguments
|
|
93
93
|
* @typeParam TClientMethodReturnType - The method expected return type
|
|
94
|
+
*
|
|
94
95
|
* @param method - The `@prismicio/client` method name to use
|
|
95
96
|
* @param args - The arguments to use with requested method
|
|
96
97
|
*
|
|
97
98
|
* @returns The composable payload {@link ClientComposableReturnType}
|
|
99
|
+
*
|
|
98
100
|
* @internal
|
|
99
101
|
*/
|
|
100
102
|
export const useStatefulPrismicClientMethod = <
|
package/vetur/attributes.json
CHANGED
|
@@ -16,9 +16,17 @@
|
|
|
16
16
|
"type": "string | object | function",
|
|
17
17
|
"description": "An HTML tag name, a component, or a functional component used to render images. Defaults to the one provided to `@prismicio/vue` plugin if configured, `\"img\"` otherwise."
|
|
18
18
|
},
|
|
19
|
-
"prismic-image/
|
|
19
|
+
"prismic-image/imgix-params": {
|
|
20
20
|
"type": "object",
|
|
21
|
-
"description": "
|
|
21
|
+
"description": "An object of Imgix URL API parameters."
|
|
22
|
+
},
|
|
23
|
+
"prismic-image/widths": {
|
|
24
|
+
"type": "array | string",
|
|
25
|
+
"description": "Adds an additional `srcset` attribute to the image following given widths."
|
|
26
|
+
},
|
|
27
|
+
"prismic-image/pixel-densities": {
|
|
28
|
+
"type": "array | string",
|
|
29
|
+
"description": "Adds an additional `srcset` attribute to the image following giving pixel densities."
|
|
22
30
|
},
|
|
23
31
|
|
|
24
32
|
"prismic-link/field": {
|