vue-datocms 5.1.2 → 6.0.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 +19 -18
- package/dist/index.cjs.js +341 -172
- package/dist/index.d.ts +119 -37
- package/dist/index.esm.mjs +339 -172
- package/package.json +7 -3
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,10 @@ declare const Image: vue.DefineComponent<{
|
|
|
43
43
|
pictureClass: {
|
|
44
44
|
type: StringConstructor;
|
|
45
45
|
};
|
|
46
|
+
/** Additional CSS class for the placeholder image */
|
|
47
|
+
placeholderClass: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
};
|
|
46
50
|
/** Duration (in ms) of the fade-in transition effect upoad image loading */
|
|
47
51
|
fadeInDuration: {
|
|
48
52
|
type: NumberConstructor;
|
|
@@ -61,24 +65,15 @@ declare const Image: vue.DefineComponent<{
|
|
|
61
65
|
type: StringConstructor;
|
|
62
66
|
default: string;
|
|
63
67
|
};
|
|
64
|
-
/** Wheter enable lazy loading or not */
|
|
65
|
-
lazyLoad: {
|
|
66
|
-
type: BooleanConstructor;
|
|
67
|
-
default: boolean;
|
|
68
|
-
};
|
|
69
|
-
/** Additional CSS rules to add to the root node */
|
|
70
|
-
rootStyle: {
|
|
71
|
-
type: ObjectConstructor;
|
|
72
|
-
default: () => {};
|
|
73
|
-
};
|
|
74
68
|
/** Additional CSS rules to add to the image inside the `<picture />` tag */
|
|
75
69
|
pictureStyle: {
|
|
76
70
|
type: ObjectConstructor;
|
|
77
71
|
default: () => {};
|
|
78
72
|
};
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
type:
|
|
73
|
+
/** Additional CSS rules to add to the placeholder image */
|
|
74
|
+
placeholderStyle: {
|
|
75
|
+
type: ObjectConstructor;
|
|
76
|
+
default: () => {};
|
|
82
77
|
};
|
|
83
78
|
/**
|
|
84
79
|
* The layout behavior of the image as the viewport changes size
|
|
@@ -87,7 +82,7 @@ declare const Image: vue.DefineComponent<{
|
|
|
87
82
|
*
|
|
88
83
|
* * `intrinsic`: the image will scale the dimensions down for smaller viewports, but maintain the original dimensions for larger viewports
|
|
89
84
|
* * `fixed`: the image dimensions will not change as the viewport changes (no responsiveness) similar to the native img element
|
|
90
|
-
* * `responsive` (default): the image will
|
|
85
|
+
* * `responsive` (default): the image will scale the dimensions down for smaller viewports and scale up for larger viewports
|
|
91
86
|
* * `fill`: image will stretch both width and height to the dimensions of the parent element, provided the parent element is `relative`
|
|
92
87
|
**/
|
|
93
88
|
layout: {
|
|
@@ -139,12 +134,11 @@ declare const Image: vue.DefineComponent<{
|
|
|
139
134
|
};
|
|
140
135
|
}, {
|
|
141
136
|
inView: vue.Ref<boolean>;
|
|
142
|
-
|
|
137
|
+
rootRef: vue.Ref<HTMLElement | null>;
|
|
143
138
|
loaded: vue.Ref<boolean>;
|
|
144
139
|
handleLoad: () => void;
|
|
145
|
-
computedLazyLoad: vue.Ref<boolean>;
|
|
146
140
|
imageRef: vue.Ref<HTMLImageElement | undefined>;
|
|
147
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin,
|
|
141
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "load"[], "load", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
148
142
|
/** The actual response you get from a DatoCMS `responsiveImage` GraphQL query */
|
|
149
143
|
data: {
|
|
150
144
|
type: PropType<ResponsiveImageType>;
|
|
@@ -154,6 +148,10 @@ declare const Image: vue.DefineComponent<{
|
|
|
154
148
|
pictureClass: {
|
|
155
149
|
type: StringConstructor;
|
|
156
150
|
};
|
|
151
|
+
/** Additional CSS class for the placeholder image */
|
|
152
|
+
placeholderClass: {
|
|
153
|
+
type: StringConstructor;
|
|
154
|
+
};
|
|
157
155
|
/** Duration (in ms) of the fade-in transition effect upoad image loading */
|
|
158
156
|
fadeInDuration: {
|
|
159
157
|
type: NumberConstructor;
|
|
@@ -172,24 +170,15 @@ declare const Image: vue.DefineComponent<{
|
|
|
172
170
|
type: StringConstructor;
|
|
173
171
|
default: string;
|
|
174
172
|
};
|
|
175
|
-
/** Wheter enable lazy loading or not */
|
|
176
|
-
lazyLoad: {
|
|
177
|
-
type: BooleanConstructor;
|
|
178
|
-
default: boolean;
|
|
179
|
-
};
|
|
180
|
-
/** Additional CSS rules to add to the root node */
|
|
181
|
-
rootStyle: {
|
|
182
|
-
type: ObjectConstructor;
|
|
183
|
-
default: () => {};
|
|
184
|
-
};
|
|
185
173
|
/** Additional CSS rules to add to the image inside the `<picture />` tag */
|
|
186
174
|
pictureStyle: {
|
|
187
175
|
type: ObjectConstructor;
|
|
188
176
|
default: () => {};
|
|
189
177
|
};
|
|
190
|
-
/**
|
|
191
|
-
|
|
192
|
-
type:
|
|
178
|
+
/** Additional CSS rules to add to the placeholder image */
|
|
179
|
+
placeholderStyle: {
|
|
180
|
+
type: ObjectConstructor;
|
|
181
|
+
default: () => {};
|
|
193
182
|
};
|
|
194
183
|
/**
|
|
195
184
|
* The layout behavior of the image as the viewport changes size
|
|
@@ -198,7 +187,7 @@ declare const Image: vue.DefineComponent<{
|
|
|
198
187
|
*
|
|
199
188
|
* * `intrinsic`: the image will scale the dimensions down for smaller viewports, but maintain the original dimensions for larger viewports
|
|
200
189
|
* * `fixed`: the image dimensions will not change as the viewport changes (no responsiveness) similar to the native img element
|
|
201
|
-
* * `responsive` (default): the image will
|
|
190
|
+
* * `responsive` (default): the image will scale the dimensions down for smaller viewports and scale up for larger viewports
|
|
202
191
|
* * `fill`: image will stretch both width and height to the dimensions of the parent element, provided the parent element is `relative`
|
|
203
192
|
**/
|
|
204
193
|
layout: {
|
|
@@ -248,22 +237,115 @@ declare const Image: vue.DefineComponent<{
|
|
|
248
237
|
validator: (values: any[]) => values is number[];
|
|
249
238
|
default: () => number[];
|
|
250
239
|
};
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
240
|
+
}>> & {
|
|
241
|
+
onLoad?: ((...args: any[]) => any) | undefined;
|
|
242
|
+
}, {
|
|
243
|
+
priority: boolean;
|
|
254
244
|
intersectionTreshold: number;
|
|
255
245
|
intersectionMargin: string;
|
|
256
|
-
rootStyle: Record<string, any>;
|
|
257
246
|
pictureStyle: Record<string, any>;
|
|
247
|
+
placeholderStyle: Record<string, any>;
|
|
258
248
|
layout: string;
|
|
259
249
|
usePlaceholder: boolean;
|
|
260
|
-
priority: boolean;
|
|
261
250
|
srcSetCandidates: unknown[];
|
|
262
251
|
}, {}>;
|
|
263
252
|
declare const DatocmsImagePlugin: {
|
|
264
253
|
install: (Vue: any) => void;
|
|
265
254
|
};
|
|
266
255
|
|
|
256
|
+
declare const NakedImage: vue.DefineComponent<{
|
|
257
|
+
/** The actual response you get from a DatoCMS `responsiveImage` GraphQL query */
|
|
258
|
+
data: {
|
|
259
|
+
type: PropType<ResponsiveImageType>;
|
|
260
|
+
required: true;
|
|
261
|
+
};
|
|
262
|
+
/** Whether the component should use a blurred image placeholder */
|
|
263
|
+
usePlaceholder: {
|
|
264
|
+
type: BooleanConstructor;
|
|
265
|
+
default: boolean;
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* The HTML5 `sizes` attribute for the image
|
|
269
|
+
*
|
|
270
|
+
* Learn more about srcset and sizes:
|
|
271
|
+
* -> https://web.dev/learn/design/responsive-images/#sizes
|
|
272
|
+
* -> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-sizes
|
|
273
|
+
**/
|
|
274
|
+
sizes: {
|
|
275
|
+
type: StringConstructor;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* When true, the image will be considered high priority. Lazy loading is automatically disabled, and fetchpriority="high" is added to the image.
|
|
279
|
+
* You should use the priority property on any image detected as the Largest Contentful Paint (LCP) element. It may be appropriate to have multiple priority images, as different images may be the LCP element for different viewport sizes.
|
|
280
|
+
* Should only be used when the image is visible above the fold.
|
|
281
|
+
**/
|
|
282
|
+
priority: {
|
|
283
|
+
type: BooleanConstructor;
|
|
284
|
+
default: boolean;
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* If `data` does not contain `srcSet`, the candidates for the `srcset` of the image will be auto-generated based on these width multipliers
|
|
288
|
+
*
|
|
289
|
+
* Default candidate multipliers are [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
|
|
290
|
+
**/
|
|
291
|
+
srcSetCandidates: {
|
|
292
|
+
type: ArrayConstructor;
|
|
293
|
+
validator: (values: any[]) => values is number[];
|
|
294
|
+
default: () => number[];
|
|
295
|
+
};
|
|
296
|
+
}, {
|
|
297
|
+
loaded: vue.Ref<boolean>;
|
|
298
|
+
handleLoad: () => void;
|
|
299
|
+
imageRef: vue.Ref<HTMLImageElement | undefined>;
|
|
300
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
301
|
+
/** The actual response you get from a DatoCMS `responsiveImage` GraphQL query */
|
|
302
|
+
data: {
|
|
303
|
+
type: PropType<ResponsiveImageType>;
|
|
304
|
+
required: true;
|
|
305
|
+
};
|
|
306
|
+
/** Whether the component should use a blurred image placeholder */
|
|
307
|
+
usePlaceholder: {
|
|
308
|
+
type: BooleanConstructor;
|
|
309
|
+
default: boolean;
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* The HTML5 `sizes` attribute for the image
|
|
313
|
+
*
|
|
314
|
+
* Learn more about srcset and sizes:
|
|
315
|
+
* -> https://web.dev/learn/design/responsive-images/#sizes
|
|
316
|
+
* -> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-sizes
|
|
317
|
+
**/
|
|
318
|
+
sizes: {
|
|
319
|
+
type: StringConstructor;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* When true, the image will be considered high priority. Lazy loading is automatically disabled, and fetchpriority="high" is added to the image.
|
|
323
|
+
* You should use the priority property on any image detected as the Largest Contentful Paint (LCP) element. It may be appropriate to have multiple priority images, as different images may be the LCP element for different viewport sizes.
|
|
324
|
+
* Should only be used when the image is visible above the fold.
|
|
325
|
+
**/
|
|
326
|
+
priority: {
|
|
327
|
+
type: BooleanConstructor;
|
|
328
|
+
default: boolean;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* If `data` does not contain `srcSet`, the candidates for the `srcset` of the image will be auto-generated based on these width multipliers
|
|
332
|
+
*
|
|
333
|
+
* Default candidate multipliers are [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
|
|
334
|
+
**/
|
|
335
|
+
srcSetCandidates: {
|
|
336
|
+
type: ArrayConstructor;
|
|
337
|
+
validator: (values: any[]) => values is number[];
|
|
338
|
+
default: () => number[];
|
|
339
|
+
};
|
|
340
|
+
}>>, {
|
|
341
|
+
priority: boolean;
|
|
342
|
+
usePlaceholder: boolean;
|
|
343
|
+
srcSetCandidates: unknown[];
|
|
344
|
+
}, {}>;
|
|
345
|
+
declare const DatocmsNakedImagePlugin: {
|
|
346
|
+
install: (Vue: any) => void;
|
|
347
|
+
};
|
|
348
|
+
|
|
267
349
|
type AdapterReturn = VNode | string | null;
|
|
268
350
|
declare const defaultAdapter: {
|
|
269
351
|
renderNode: (tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn;
|
|
@@ -1148,4 +1230,4 @@ declare const toHead: (...args: ToMetaTagsType[]) => {
|
|
|
1148
1230
|
}[];
|
|
1149
1231
|
};
|
|
1150
1232
|
|
|
1151
|
-
export { DatocmsImagePlugin, DatocmsStructuredTextPlugin, DatocmsVideoPlayerPlugin, DisabledQueryListenerOptions, EnabledQueryListenerOptions, GenericClient, Image, QueryListenerOptions, RawSearchResult, RenderBlockContext, RenderInlineRecordContext, RenderRecordLinkContext, ResponsiveImageType, SeoMetaTagType, StructuredText, SubscribeToQueryOptions, ToMetaTagsType, UseSiteSearchConfig, UseSiteSearchData, UseSiteSearchResult, Video, VideoPlayer, appendKeyToValidElement, defaultAdapter, isKeyOf, isNil, toHead, toNativeAttrName, toNativeAttrValue, useQuerySubscription, useSiteSearch, useVideoPlayer };
|
|
1233
|
+
export { DatocmsImagePlugin, DatocmsNakedImagePlugin, DatocmsStructuredTextPlugin, DatocmsVideoPlayerPlugin, DisabledQueryListenerOptions, EnabledQueryListenerOptions, GenericClient, Image, NakedImage, QueryListenerOptions, RawSearchResult, RenderBlockContext, RenderInlineRecordContext, RenderRecordLinkContext, ResponsiveImageType, SeoMetaTagType, StructuredText, SubscribeToQueryOptions, ToMetaTagsType, UseSiteSearchConfig, UseSiteSearchData, UseSiteSearchResult, Video, VideoPlayer, appendKeyToValidElement, defaultAdapter, isKeyOf, isNil, toHead, toNativeAttrName, toNativeAttrValue, useQuerySubscription, useSiteSearch, useVideoPlayer };
|