@prismicio/vue 4.0.3 → 4.2.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.
@@ -1,57 +1,63 @@
1
- import { EmbedField } from "@prismicio/client";
2
- import { AllowedComponentProps, ComponentCustomProps, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
3
- /**
4
- * Props for `<PrismicEmbed />`.
5
- */
6
- export type PrismicEmbedProps = {
7
- /**
8
- * The Prismic embed field to render.
9
- */
10
- field: EmbedField;
11
- /**
12
- * An HTML tag name, a component, or a functional component used to wrap the
13
- * output.
14
- *
15
- * @defaultValue `"div"`
16
- */
17
- wrapper?: string | ConcreteComponent | Raw<DefineComponent>;
18
- };
19
- /**
20
- * `<PrismicEmbed />` implementation.
21
- *
22
- * @internal
23
- */
24
- export declare const PrismicEmbedImpl: DefineComponent<{
25
- field: {
26
- type: PropType<EmbedField>;
27
- required: true;
28
- };
29
- wrapper: {
30
- type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
31
- default: undefined;
32
- required: false;
33
- };
34
- }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
35
- [key: string]: any;
36
- }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
37
- field: {
38
- type: PropType<EmbedField>;
39
- required: true;
40
- };
41
- wrapper: {
42
- type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
43
- default: undefined;
44
- required: false;
45
- };
46
- }>>, {
47
- wrapper: string | ConcreteComponent | Raw<DefineComponent>;
48
- }, {}>;
49
- /**
50
- * Component to render a Prismic embed field.
51
- *
52
- * @see Component props {@link PrismicEmbedProps}
53
- * @see Templating embed fields {@link https://prismic.io/docs/technologies/vue-template-content#embeds}
54
- */
55
- export declare const PrismicEmbed: new () => {
56
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicEmbedProps;
57
- };
1
+ import { EmbedField } from "@prismicio/client";
2
+ import { AllowedComponentProps, ComponentCustomProps, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
3
+ /**
4
+ * Props for `<PrismicEmbed />`.
5
+ */
6
+ export declare type PrismicEmbedProps = {
7
+ /**
8
+ * The Prismic embed field to render.
9
+ */
10
+ field: EmbedField;
11
+ /**
12
+ * An HTML tag name, a component, or a functional component used to wrap the
13
+ * output.
14
+ *
15
+ * @defaultValue `"div"`
16
+ */
17
+ wrapper?: string | ConcreteComponent | Raw<DefineComponent>;
18
+ };
19
+ /**
20
+ * `<PrismicEmbed />` implementation.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare const PrismicEmbedImpl: DefineComponent<{
25
+ field: {
26
+ type: PropType<import("@prismicio/client/dist/types/value/types").EmptyObjectField | ((import("@prismicio/client").AnyOEmbed & import("@prismicio/client").OEmbedExtra) & {
27
+ embed_url: string;
28
+ html: string | null;
29
+ })>;
30
+ required: true;
31
+ };
32
+ wrapper: {
33
+ type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
34
+ default: undefined;
35
+ required: false;
36
+ };
37
+ }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
38
+ [key: string]: any;
39
+ }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
40
+ field: {
41
+ type: PropType<import("@prismicio/client/dist/types/value/types").EmptyObjectField | ((import("@prismicio/client").AnyOEmbed & import("@prismicio/client").OEmbedExtra) & {
42
+ embed_url: string;
43
+ html: string | null;
44
+ })>;
45
+ required: true;
46
+ };
47
+ wrapper: {
48
+ type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
49
+ default: undefined;
50
+ required: false;
51
+ };
52
+ }>>, {
53
+ wrapper: string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
54
+ }, {}>;
55
+ /**
56
+ * Component to render a Prismic embed field.
57
+ *
58
+ * @see Component props {@link PrismicEmbedProps}
59
+ * @see Templating embed fields {@link https://prismic.io/docs/technologies/vue-template-content#embeds}
60
+ */
61
+ export declare const PrismicEmbed: new () => {
62
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicEmbedProps;
63
+ };
@@ -1,161 +1,161 @@
1
- import { ImageField, asImagePixelDensitySrcSet, asImageSrc, asImageWidthSrcSet } from "@prismicio/client";
2
- import { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
3
- import { VueUseOptions } from "../types";
4
- /**
5
- * Props for `<PrismicImage />`.
6
- */
7
- export type PrismicImageProps = {
8
- /**
9
- * The Prismic image field to render.
10
- */
11
- field: ImageField | ImageField<string>;
12
- /**
13
- * An HTML tag name, a component, or a functional component used to render
14
- * images.
15
- *
16
- * @remarks
17
- * HTML tag names and components will be rendered using the `img` tag
18
- * interface (`src`, `srcset`, and `alt` attribute). Components will also
19
- * receive an additional `copyright` props.
20
- * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"img"` otherwise.
21
- */
22
- imageComponent?: string | ConcreteComponent | Raw<DefineComponent>;
23
- /**
24
- * An object of Imgix URL API parameters.
25
- *
26
- * @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering
27
- */
28
- imgixParams?: Parameters<typeof asImageSrc>[1];
29
- /**
30
- * Adds an additional `srcset` attribute to the image following given widths.
31
- *
32
- * @remarks
33
- * A special value of `"thumbnails"` is accepted to automatically use image
34
- * widths coming from the API.
35
- * @remarks
36
- * A special value of `"defaults"` is accepted to automatically use image
37
- * widths coming from the plugin configuration.
38
- * @remarks
39
- * This prop is not compatible with the `pixelDensities` prop. When both are
40
- * used the `pixelDensities` prop will be ignored.
41
- */
42
- widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
43
- /**
44
- * Adds an additional `srcset` attribute to the image following giving pixel
45
- * densities.
46
- *
47
- * @remarks
48
- * A special value of `"defaults"` is accepted to automatically use image
49
- * pixel densities coming from the plugin configuration.
50
- * @remarks
51
- * This prop is not compatible with the `widths` prop. When both are used, the
52
- * `pixelDensities` prop will be ignored.
53
- */
54
- pixelDensities?: NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
55
- };
56
- /**
57
- * Options for {@link usePrismicImage}.
58
- */
59
- export type UsePrismicImageOptions = VueUseOptions<Omit<PrismicImageProps, "imageComponent">>;
60
- /**
61
- * Return type of {@link usePrismicImage}.
62
- */
63
- export type UsePrismicImageReturnType = {
64
- /**
65
- * Resolved image `src` value.
66
- */
67
- src: ComputedRef<string | null>;
68
- /**
69
- * Resolved image `srcset` value.
70
- */
71
- srcset: ComputedRef<string | null>;
72
- /**
73
- * Resolved image `alt` value.
74
- */
75
- alt: ComputedRef<string>;
76
- /**
77
- * Resolved image `copyright` value.
78
- */
79
- copyright: ComputedRef<string | null>;
80
- };
81
- /**
82
- * A low level composable that returns a resolved information about a Prismic
83
- * image field.
84
- *
85
- * @param props - {@link UsePrismicImageOptions}
86
- *
87
- * @returns - Resolved image information {@link UsePrismicImageReturnType}
88
- */
89
- export declare const usePrismicImage: (props: UsePrismicImageOptions) => UsePrismicImageReturnType;
90
- /**
91
- * `<PrismicImage />` implementation.
92
- *
93
- * @internal
94
- */
95
- export declare const PrismicImageImpl: DefineComponent<{
96
- field: {
97
- type: PropType<ImageField | ImageField<string>>;
98
- required: true;
99
- };
100
- imageComponent: {
101
- type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
102
- default: undefined;
103
- required: false;
104
- };
105
- imgixParams: {
106
- type: PropType<import("imgix-url-builder").ImgixURLParams | undefined>;
107
- default: undefined;
108
- required: false;
109
- };
110
- widths: {
111
- type: PropType<number[] | "thumbnails" | "defaults" | undefined>;
112
- default: undefined;
113
- required: false;
114
- };
115
- pixelDensities: {
116
- type: PropType<number[] | "defaults" | undefined>;
117
- default: undefined;
118
- required: false;
119
- };
120
- }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
121
- [key: string]: any;
122
- }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
123
- field: {
124
- type: PropType<ImageField | ImageField<string>>;
125
- required: true;
126
- };
127
- imageComponent: {
128
- type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
129
- default: undefined;
130
- required: false;
131
- };
132
- imgixParams: {
133
- type: PropType<import("imgix-url-builder").ImgixURLParams | undefined>;
134
- default: undefined;
135
- required: false;
136
- };
137
- widths: {
138
- type: PropType<number[] | "thumbnails" | "defaults" | undefined>;
139
- default: undefined;
140
- required: false;
141
- };
142
- pixelDensities: {
143
- type: PropType<number[] | "defaults" | undefined>;
144
- default: undefined;
145
- required: false;
146
- };
147
- }>>, {
148
- widths: number[] | "thumbnails" | "defaults" | undefined;
149
- pixelDensities: number[] | "defaults" | undefined;
150
- imageComponent: string | ConcreteComponent | Raw<DefineComponent>;
151
- imgixParams: import("imgix-url-builder").ImgixURLParams | undefined;
152
- }, {}>;
153
- /**
154
- * Component to render a Prismic image field.
155
- *
156
- * @see Component props {@link PrismicImageProps}
157
- * @see Templating image fields {@link https://prismic.io/docs/technologies/vue-template-content#images}
158
- */
159
- export declare const PrismicImage: new () => {
160
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicImageProps;
161
- };
1
+ import { ImageField, asImagePixelDensitySrcSet, asImageSrc, asImageWidthSrcSet } from "@prismicio/client";
2
+ import { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
3
+ import { VueUseOptions } from "../types";
4
+ /**
5
+ * Props for `<PrismicImage />`.
6
+ */
7
+ export declare type PrismicImageProps = {
8
+ /**
9
+ * The Prismic image field to render.
10
+ */
11
+ field: ImageField | ImageField<string>;
12
+ /**
13
+ * An HTML tag name, a component, or a functional component used to render
14
+ * images.
15
+ *
16
+ * @remarks
17
+ * HTML tag names and components will be rendered using the `img` tag
18
+ * interface (`src`, `srcset`, and `alt` attribute). Components will also
19
+ * receive an additional `copyright` props.
20
+ * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"img"` otherwise.
21
+ */
22
+ imageComponent?: string | ConcreteComponent | Raw<DefineComponent>;
23
+ /**
24
+ * An object of Imgix URL API parameters.
25
+ *
26
+ * @see Imgix URL parameters reference: https://docs.imgix.com/apis/rendering
27
+ */
28
+ imgixParams?: Parameters<typeof asImageSrc>[1];
29
+ /**
30
+ * Adds an additional `srcset` attribute to the image following given widths.
31
+ *
32
+ * @remarks
33
+ * A special value of `"thumbnails"` is accepted to automatically use image
34
+ * widths coming from the API.
35
+ * @remarks
36
+ * A special value of `"defaults"` is accepted to automatically use image
37
+ * widths coming from the plugin configuration.
38
+ * @remarks
39
+ * This prop is not compatible with the `pixelDensities` prop. When both are
40
+ * used the `pixelDensities` prop will be ignored.
41
+ */
42
+ widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
43
+ /**
44
+ * Adds an additional `srcset` attribute to the image following giving pixel
45
+ * densities.
46
+ *
47
+ * @remarks
48
+ * A special value of `"defaults"` is accepted to automatically use image
49
+ * pixel densities coming from the plugin configuration.
50
+ * @remarks
51
+ * This prop is not compatible with the `widths` prop. When both are used, the
52
+ * `pixelDensities` prop will be ignored.
53
+ */
54
+ pixelDensities?: NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
55
+ };
56
+ /**
57
+ * Options for {@link usePrismicImage}.
58
+ */
59
+ export declare type UsePrismicImageOptions = VueUseOptions<Omit<PrismicImageProps, "imageComponent">>;
60
+ /**
61
+ * Return type of {@link usePrismicImage}.
62
+ */
63
+ export declare type UsePrismicImageReturnType = {
64
+ /**
65
+ * Resolved image `src` value.
66
+ */
67
+ src: ComputedRef<string | null>;
68
+ /**
69
+ * Resolved image `srcset` value.
70
+ */
71
+ srcset: ComputedRef<string | null>;
72
+ /**
73
+ * Resolved image `alt` value.
74
+ */
75
+ alt: ComputedRef<string>;
76
+ /**
77
+ * Resolved image `copyright` value.
78
+ */
79
+ copyright: ComputedRef<string | null>;
80
+ };
81
+ /**
82
+ * A low level composable that returns a resolved information about a Prismic
83
+ * image field.
84
+ *
85
+ * @param props - {@link UsePrismicImageOptions}
86
+ *
87
+ * @returns - Resolved image information {@link UsePrismicImageReturnType}
88
+ */
89
+ export declare const usePrismicImage: (props: UsePrismicImageOptions) => UsePrismicImageReturnType;
90
+ /**
91
+ * `<PrismicImage />` implementation.
92
+ *
93
+ * @internal
94
+ */
95
+ export declare const PrismicImageImpl: DefineComponent<{
96
+ field: {
97
+ type: PropType<import("@prismicio/client/dist/types/value/types").Simplify<(import("@prismicio/client").EmptyImageFieldImage & Record<never, import("@prismicio/client").EmptyImageFieldImage>) | (import("@prismicio/client").FilledImageFieldImage & Record<never, import("@prismicio/client").FilledImageFieldImage>)> | import("@prismicio/client/dist/types/value/types").Simplify<(import("@prismicio/client").EmptyImageFieldImage & Record<string, import("@prismicio/client").EmptyImageFieldImage>) | (import("@prismicio/client").FilledImageFieldImage & Record<string, import("@prismicio/client").FilledImageFieldImage>)>>;
98
+ required: true;
99
+ };
100
+ imageComponent: {
101
+ type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
102
+ default: undefined;
103
+ required: false;
104
+ };
105
+ imgixParams: {
106
+ type: PropType<import("imgix-url-builder").ImgixURLParams | undefined>;
107
+ default: undefined;
108
+ required: false;
109
+ };
110
+ widths: {
111
+ type: PropType<number[] | "thumbnails" | "defaults" | undefined>;
112
+ default: undefined;
113
+ required: false;
114
+ };
115
+ pixelDensities: {
116
+ type: PropType<number[] | "defaults" | undefined>;
117
+ default: undefined;
118
+ required: false;
119
+ };
120
+ }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
121
+ [key: string]: any;
122
+ }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
123
+ field: {
124
+ type: PropType<import("@prismicio/client/dist/types/value/types").Simplify<(import("@prismicio/client").EmptyImageFieldImage & Record<never, import("@prismicio/client").EmptyImageFieldImage>) | (import("@prismicio/client").FilledImageFieldImage & Record<never, import("@prismicio/client").FilledImageFieldImage>)> | import("@prismicio/client/dist/types/value/types").Simplify<(import("@prismicio/client").EmptyImageFieldImage & Record<string, import("@prismicio/client").EmptyImageFieldImage>) | (import("@prismicio/client").FilledImageFieldImage & Record<string, import("@prismicio/client").FilledImageFieldImage>)>>;
125
+ required: true;
126
+ };
127
+ imageComponent: {
128
+ type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
129
+ default: undefined;
130
+ required: false;
131
+ };
132
+ imgixParams: {
133
+ type: PropType<import("imgix-url-builder").ImgixURLParams | undefined>;
134
+ default: undefined;
135
+ required: false;
136
+ };
137
+ widths: {
138
+ type: PropType<number[] | "thumbnails" | "defaults" | undefined>;
139
+ default: undefined;
140
+ required: false;
141
+ };
142
+ pixelDensities: {
143
+ type: PropType<number[] | "defaults" | undefined>;
144
+ default: undefined;
145
+ required: false;
146
+ };
147
+ }>>, {
148
+ widths: number[] | "thumbnails" | "defaults" | undefined;
149
+ pixelDensities: number[] | "defaults" | undefined;
150
+ imageComponent: string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
151
+ imgixParams: import("imgix-url-builder").ImgixURLParams | undefined;
152
+ }, {}>;
153
+ /**
154
+ * Component to render a Prismic image field.
155
+ *
156
+ * @see Component props {@link PrismicImageProps}
157
+ * @see Templating image fields {@link https://prismic.io/docs/technologies/vue-template-content#images}
158
+ */
159
+ export declare const PrismicImage: new () => {
160
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicImageProps;
161
+ };