vue-datocms 6.0.3 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +43 -32
- package/dist/index.d.ts +23 -4
- package/dist/index.esm.mjs +43 -32
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -286,6 +286,9 @@ const Image$1 = vue.defineComponent({
|
|
|
286
286
|
pictureClass: {
|
|
287
287
|
type: String
|
|
288
288
|
},
|
|
289
|
+
imgClass: {
|
|
290
|
+
type: String
|
|
291
|
+
},
|
|
289
292
|
placeholderClass: {
|
|
290
293
|
type: String
|
|
291
294
|
},
|
|
@@ -307,6 +310,10 @@ const Image$1 = vue.defineComponent({
|
|
|
307
310
|
type: Object,
|
|
308
311
|
default: () => ({})
|
|
309
312
|
},
|
|
313
|
+
imgStyle: {
|
|
314
|
+
type: Object,
|
|
315
|
+
default: () => ({})
|
|
316
|
+
},
|
|
310
317
|
placeholderStyle: {
|
|
311
318
|
type: Object,
|
|
312
319
|
default: () => ({})
|
|
@@ -419,8 +426,8 @@ const Image$1 = vue.defineComponent({
|
|
|
419
426
|
const { width, aspectRatio } = this.data;
|
|
420
427
|
const height = (_a = this.data.height) != null ? _a : aspectRatio ? width / aspectRatio : 0;
|
|
421
428
|
const sizer = this.layout !== "fill" ? vue.h(Sizer, {
|
|
422
|
-
sizerClass: this.
|
|
423
|
-
sizerStyle: this.
|
|
429
|
+
sizerClass: this.imgClass,
|
|
430
|
+
sizerStyle: this.imgStyle,
|
|
424
431
|
width,
|
|
425
432
|
height
|
|
426
433
|
}) : null;
|
|
@@ -436,7 +443,7 @@ const Image$1 = vue.defineComponent({
|
|
|
436
443
|
[
|
|
437
444
|
sizer,
|
|
438
445
|
placeholder,
|
|
439
|
-
addImage && vue.h("picture",
|
|
446
|
+
addImage && vue.h("picture", { class: this.pictureClass, style: this.pictureStyle }, [
|
|
440
447
|
webpSource,
|
|
441
448
|
regularSource,
|
|
442
449
|
this.data.src && vue.h("img", {
|
|
@@ -446,44 +453,48 @@ const Image$1 = vue.defineComponent({
|
|
|
446
453
|
fetchpriority: this.priority ? "high" : void 0,
|
|
447
454
|
onLoad: this.handleLoad,
|
|
448
455
|
ref: "imageRef",
|
|
449
|
-
class: this.
|
|
456
|
+
class: this.imgClass,
|
|
450
457
|
style: __spreadValues$5(__spreadProps$3(__spreadValues$5({
|
|
451
458
|
opacity: showImage ? 1 : 0,
|
|
452
459
|
transition
|
|
453
460
|
}, absolutePositioning), {
|
|
454
461
|
objectFit: this.objectFit,
|
|
455
462
|
objectPosition: this.objectPosition
|
|
456
|
-
}), this.
|
|
463
|
+
}), this.imgStyle)
|
|
457
464
|
})
|
|
458
465
|
]),
|
|
459
466
|
vue.h("noscript", {
|
|
460
|
-
innerHTML: tag(
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
this.
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
467
|
+
innerHTML: tag(
|
|
468
|
+
"picture",
|
|
469
|
+
{ class: this.pictureClass, style: toCss(this.pictureStyle) },
|
|
470
|
+
[
|
|
471
|
+
this.data.webpSrcSet && tag("source", {
|
|
472
|
+
srcset: this.data.webpSrcSet,
|
|
473
|
+
sizes: (_c = (_b = this.sizes) != null ? _b : this.data.sizes) != null ? _c : void 0,
|
|
474
|
+
type: "image/webp"
|
|
475
|
+
}),
|
|
476
|
+
tag("source", {
|
|
477
|
+
srcset: (_d = this.data.srcSet) != null ? _d : buildSrcSet(
|
|
478
|
+
this.data.src,
|
|
479
|
+
this.data.width,
|
|
480
|
+
this.srcSetCandidates
|
|
481
|
+
),
|
|
482
|
+
sizes: (_f = (_e = this.sizes) != null ? _e : this.data.sizes) != null ? _f : void 0
|
|
483
|
+
}),
|
|
484
|
+
tag("img", {
|
|
485
|
+
src: this.data.src,
|
|
486
|
+
alt: this.data.alt,
|
|
487
|
+
title: this.data.title,
|
|
488
|
+
class: this.imgClass,
|
|
489
|
+
style: toCss(__spreadValues$5(__spreadProps$3(__spreadValues$5({}, absolutePositioning), {
|
|
490
|
+
objectFit: this.objectFit,
|
|
491
|
+
objectPosition: this.objectPosition
|
|
492
|
+
}), this.imgStyle)),
|
|
493
|
+
loading: this.priority ? void 0 : "lazy",
|
|
494
|
+
fetchpriority: this.priority ? "high" : void 0
|
|
495
|
+
})
|
|
496
|
+
]
|
|
497
|
+
)
|
|
487
498
|
})
|
|
488
499
|
]
|
|
489
500
|
);
|
package/dist/index.d.ts
CHANGED
|
@@ -39,10 +39,14 @@ declare const Image: vue.DefineComponent<{
|
|
|
39
39
|
type: PropType<ResponsiveImageType>;
|
|
40
40
|
required: true;
|
|
41
41
|
};
|
|
42
|
-
/** Additional CSS class for the
|
|
42
|
+
/** Additional CSS class for the `<picture />` tag */
|
|
43
43
|
pictureClass: {
|
|
44
44
|
type: StringConstructor;
|
|
45
45
|
};
|
|
46
|
+
/** Additional CSS class for the image inside the `<picture />` tag */
|
|
47
|
+
imgClass: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
};
|
|
46
50
|
/** Additional CSS class for the placeholder image */
|
|
47
51
|
placeholderClass: {
|
|
48
52
|
type: StringConstructor;
|
|
@@ -65,11 +69,16 @@ declare const Image: vue.DefineComponent<{
|
|
|
65
69
|
type: StringConstructor;
|
|
66
70
|
default: string;
|
|
67
71
|
};
|
|
68
|
-
/** Additional CSS rules to add to the
|
|
72
|
+
/** Additional CSS rules to add to the `<picture />` tag */
|
|
69
73
|
pictureStyle: {
|
|
70
74
|
type: ObjectConstructor;
|
|
71
75
|
default: () => {};
|
|
72
76
|
};
|
|
77
|
+
/** Additional CSS rules to add to the image inside the `<picture />` tag */
|
|
78
|
+
imgStyle: {
|
|
79
|
+
type: ObjectConstructor;
|
|
80
|
+
default: () => {};
|
|
81
|
+
};
|
|
73
82
|
/** Additional CSS rules to add to the placeholder image */
|
|
74
83
|
placeholderStyle: {
|
|
75
84
|
type: ObjectConstructor;
|
|
@@ -144,10 +153,14 @@ declare const Image: vue.DefineComponent<{
|
|
|
144
153
|
type: PropType<ResponsiveImageType>;
|
|
145
154
|
required: true;
|
|
146
155
|
};
|
|
147
|
-
/** Additional CSS class for the
|
|
156
|
+
/** Additional CSS class for the `<picture />` tag */
|
|
148
157
|
pictureClass: {
|
|
149
158
|
type: StringConstructor;
|
|
150
159
|
};
|
|
160
|
+
/** Additional CSS class for the image inside the `<picture />` tag */
|
|
161
|
+
imgClass: {
|
|
162
|
+
type: StringConstructor;
|
|
163
|
+
};
|
|
151
164
|
/** Additional CSS class for the placeholder image */
|
|
152
165
|
placeholderClass: {
|
|
153
166
|
type: StringConstructor;
|
|
@@ -170,11 +183,16 @@ declare const Image: vue.DefineComponent<{
|
|
|
170
183
|
type: StringConstructor;
|
|
171
184
|
default: string;
|
|
172
185
|
};
|
|
173
|
-
/** Additional CSS rules to add to the
|
|
186
|
+
/** Additional CSS rules to add to the `<picture />` tag */
|
|
174
187
|
pictureStyle: {
|
|
175
188
|
type: ObjectConstructor;
|
|
176
189
|
default: () => {};
|
|
177
190
|
};
|
|
191
|
+
/** Additional CSS rules to add to the image inside the `<picture />` tag */
|
|
192
|
+
imgStyle: {
|
|
193
|
+
type: ObjectConstructor;
|
|
194
|
+
default: () => {};
|
|
195
|
+
};
|
|
178
196
|
/** Additional CSS rules to add to the placeholder image */
|
|
179
197
|
placeholderStyle: {
|
|
180
198
|
type: ObjectConstructor;
|
|
@@ -244,6 +262,7 @@ declare const Image: vue.DefineComponent<{
|
|
|
244
262
|
intersectionTreshold: number;
|
|
245
263
|
intersectionMargin: string;
|
|
246
264
|
pictureStyle: Record<string, any>;
|
|
265
|
+
imgStyle: Record<string, any>;
|
|
247
266
|
placeholderStyle: Record<string, any>;
|
|
248
267
|
layout: string;
|
|
249
268
|
usePlaceholder: boolean;
|
package/dist/index.esm.mjs
CHANGED
|
@@ -262,6 +262,9 @@ const Image$1 = defineComponent({
|
|
|
262
262
|
pictureClass: {
|
|
263
263
|
type: String
|
|
264
264
|
},
|
|
265
|
+
imgClass: {
|
|
266
|
+
type: String
|
|
267
|
+
},
|
|
265
268
|
placeholderClass: {
|
|
266
269
|
type: String
|
|
267
270
|
},
|
|
@@ -283,6 +286,10 @@ const Image$1 = defineComponent({
|
|
|
283
286
|
type: Object,
|
|
284
287
|
default: () => ({})
|
|
285
288
|
},
|
|
289
|
+
imgStyle: {
|
|
290
|
+
type: Object,
|
|
291
|
+
default: () => ({})
|
|
292
|
+
},
|
|
286
293
|
placeholderStyle: {
|
|
287
294
|
type: Object,
|
|
288
295
|
default: () => ({})
|
|
@@ -395,8 +402,8 @@ const Image$1 = defineComponent({
|
|
|
395
402
|
const { width, aspectRatio } = this.data;
|
|
396
403
|
const height = (_a = this.data.height) != null ? _a : aspectRatio ? width / aspectRatio : 0;
|
|
397
404
|
const sizer = this.layout !== "fill" ? h(Sizer, {
|
|
398
|
-
sizerClass: this.
|
|
399
|
-
sizerStyle: this.
|
|
405
|
+
sizerClass: this.imgClass,
|
|
406
|
+
sizerStyle: this.imgStyle,
|
|
400
407
|
width,
|
|
401
408
|
height
|
|
402
409
|
}) : null;
|
|
@@ -412,7 +419,7 @@ const Image$1 = defineComponent({
|
|
|
412
419
|
[
|
|
413
420
|
sizer,
|
|
414
421
|
placeholder,
|
|
415
|
-
addImage && h("picture",
|
|
422
|
+
addImage && h("picture", { class: this.pictureClass, style: this.pictureStyle }, [
|
|
416
423
|
webpSource,
|
|
417
424
|
regularSource,
|
|
418
425
|
this.data.src && h("img", {
|
|
@@ -422,44 +429,48 @@ const Image$1 = defineComponent({
|
|
|
422
429
|
fetchpriority: this.priority ? "high" : void 0,
|
|
423
430
|
onLoad: this.handleLoad,
|
|
424
431
|
ref: "imageRef",
|
|
425
|
-
class: this.
|
|
432
|
+
class: this.imgClass,
|
|
426
433
|
style: __spreadValues$5(__spreadProps$3(__spreadValues$5({
|
|
427
434
|
opacity: showImage ? 1 : 0,
|
|
428
435
|
transition
|
|
429
436
|
}, absolutePositioning), {
|
|
430
437
|
objectFit: this.objectFit,
|
|
431
438
|
objectPosition: this.objectPosition
|
|
432
|
-
}), this.
|
|
439
|
+
}), this.imgStyle)
|
|
433
440
|
})
|
|
434
441
|
]),
|
|
435
442
|
h("noscript", {
|
|
436
|
-
innerHTML: tag(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
this.
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
443
|
+
innerHTML: tag(
|
|
444
|
+
"picture",
|
|
445
|
+
{ class: this.pictureClass, style: toCss(this.pictureStyle) },
|
|
446
|
+
[
|
|
447
|
+
this.data.webpSrcSet && tag("source", {
|
|
448
|
+
srcset: this.data.webpSrcSet,
|
|
449
|
+
sizes: (_c = (_b = this.sizes) != null ? _b : this.data.sizes) != null ? _c : void 0,
|
|
450
|
+
type: "image/webp"
|
|
451
|
+
}),
|
|
452
|
+
tag("source", {
|
|
453
|
+
srcset: (_d = this.data.srcSet) != null ? _d : buildSrcSet(
|
|
454
|
+
this.data.src,
|
|
455
|
+
this.data.width,
|
|
456
|
+
this.srcSetCandidates
|
|
457
|
+
),
|
|
458
|
+
sizes: (_f = (_e = this.sizes) != null ? _e : this.data.sizes) != null ? _f : void 0
|
|
459
|
+
}),
|
|
460
|
+
tag("img", {
|
|
461
|
+
src: this.data.src,
|
|
462
|
+
alt: this.data.alt,
|
|
463
|
+
title: this.data.title,
|
|
464
|
+
class: this.imgClass,
|
|
465
|
+
style: toCss(__spreadValues$5(__spreadProps$3(__spreadValues$5({}, absolutePositioning), {
|
|
466
|
+
objectFit: this.objectFit,
|
|
467
|
+
objectPosition: this.objectPosition
|
|
468
|
+
}), this.imgStyle)),
|
|
469
|
+
loading: this.priority ? void 0 : "lazy",
|
|
470
|
+
fetchpriority: this.priority ? "high" : void 0
|
|
471
|
+
})
|
|
472
|
+
]
|
|
473
|
+
)
|
|
463
474
|
})
|
|
464
475
|
]
|
|
465
476
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-datocms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"datocms-listen": "^0.1.15",
|
|
45
|
-
"datocms-structured-text-generic-html-renderer": "^
|
|
46
|
-
"datocms-structured-text-utils": "^
|
|
45
|
+
"datocms-structured-text-generic-html-renderer": "^4.0.1",
|
|
46
|
+
"datocms-structured-text-utils": "^4.0.1",
|
|
47
47
|
"hyphenate-style-name": "^1.0.4"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|