vue-datocms 7.0.0 → 7.0.1

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 CHANGED
@@ -547,6 +547,20 @@ const NakedImage = vue.defineComponent({
547
547
  return typeof value === "number";
548
548
  }),
549
549
  default: () => [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
550
+ },
551
+ pictureClass: {
552
+ type: String
553
+ },
554
+ pictureStyle: {
555
+ type: Object,
556
+ default: () => ({})
557
+ },
558
+ imgClass: {
559
+ type: String
560
+ },
561
+ imgStyle: {
562
+ type: Object,
563
+ default: () => ({})
550
564
  }
551
565
  },
552
566
  setup(_props, { emit, expose }) {
@@ -599,21 +613,28 @@ const NakedImage = vue.defineComponent({
599
613
  backgroundColor: this.data.bgColor,
600
614
  color: "transparent"
601
615
  } : void 0;
602
- return vue.h("picture", null, [
603
- webpSource,
604
- regularSource,
605
- this.data.src && vue.h("img", {
606
- ref: "imageRef",
607
- src: this.data.src,
608
- alt: this.data.alt,
609
- onLoad: this.handleLoad,
610
- title: this.data.title,
611
- fetchpriority: this.priority ? "high" : void 0,
612
- loading: this.priority ? void 0 : "lazy",
613
- style: __spreadValues$4(__spreadValues$4(__spreadValues$4({}, placeholderStyle), sizingStyle), this.$attrs.style || {}),
614
- class: this.$attrs.class
615
- })
616
- ]);
616
+ return vue.h(
617
+ "picture",
618
+ {
619
+ style: this.pictureStyle,
620
+ class: this.pictureClass
621
+ },
622
+ [
623
+ webpSource,
624
+ regularSource,
625
+ this.data.src && vue.h("img", {
626
+ ref: "imageRef",
627
+ src: this.data.src,
628
+ alt: this.data.alt,
629
+ onLoad: this.handleLoad,
630
+ title: this.data.title,
631
+ fetchpriority: this.priority ? "high" : void 0,
632
+ loading: this.priority ? void 0 : "lazy",
633
+ style: __spreadValues$4(__spreadValues$4(__spreadValues$4({}, placeholderStyle), sizingStyle), this.imgStyle || {}),
634
+ class: this.imgClass
635
+ })
636
+ ]
637
+ );
617
638
  }
618
639
  });
619
640
  const DatocmsNakedImagePlugin = {
package/dist/index.d.ts CHANGED
@@ -309,9 +309,27 @@ declare const NakedImage: vue.DefineComponent<{
309
309
  **/
310
310
  srcSetCandidates: {
311
311
  type: ArrayConstructor;
312
- validator: (values: any[]) => values is number[];
312
+ validator: (values: unknown[]) => values is number[];
313
313
  default: () => number[];
314
314
  };
315
+ /** Additional CSS class for the root `<picture />` tag */
316
+ pictureClass: {
317
+ type: StringConstructor;
318
+ };
319
+ /** Additional CSS rules to add to the root `<picture />` tag */
320
+ pictureStyle: {
321
+ type: ObjectConstructor;
322
+ default: () => {};
323
+ };
324
+ /** Additional CSS class for the `<img />` tag */
325
+ imgClass: {
326
+ type: StringConstructor;
327
+ };
328
+ /** Additional CSS rules to add to the `<img />` tag */
329
+ imgStyle: {
330
+ type: ObjectConstructor;
331
+ default: () => {};
332
+ };
315
333
  }, {
316
334
  loaded: vue.Ref<boolean>;
317
335
  handleLoad: () => void;
@@ -353,11 +371,31 @@ declare const NakedImage: vue.DefineComponent<{
353
371
  **/
354
372
  srcSetCandidates: {
355
373
  type: ArrayConstructor;
356
- validator: (values: any[]) => values is number[];
374
+ validator: (values: unknown[]) => values is number[];
357
375
  default: () => number[];
358
376
  };
377
+ /** Additional CSS class for the root `<picture />` tag */
378
+ pictureClass: {
379
+ type: StringConstructor;
380
+ };
381
+ /** Additional CSS rules to add to the root `<picture />` tag */
382
+ pictureStyle: {
383
+ type: ObjectConstructor;
384
+ default: () => {};
385
+ };
386
+ /** Additional CSS class for the `<img />` tag */
387
+ imgClass: {
388
+ type: StringConstructor;
389
+ };
390
+ /** Additional CSS rules to add to the `<img />` tag */
391
+ imgStyle: {
392
+ type: ObjectConstructor;
393
+ default: () => {};
394
+ };
359
395
  }>>, {
360
396
  priority: boolean;
397
+ pictureStyle: Record<string, any>;
398
+ imgStyle: Record<string, any>;
361
399
  usePlaceholder: boolean;
362
400
  srcSetCandidates: unknown[];
363
401
  }, {}>;
@@ -523,6 +523,20 @@ const NakedImage = defineComponent({
523
523
  return typeof value === "number";
524
524
  }),
525
525
  default: () => [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
526
+ },
527
+ pictureClass: {
528
+ type: String
529
+ },
530
+ pictureStyle: {
531
+ type: Object,
532
+ default: () => ({})
533
+ },
534
+ imgClass: {
535
+ type: String
536
+ },
537
+ imgStyle: {
538
+ type: Object,
539
+ default: () => ({})
526
540
  }
527
541
  },
528
542
  setup(_props, { emit, expose }) {
@@ -575,21 +589,28 @@ const NakedImage = defineComponent({
575
589
  backgroundColor: this.data.bgColor,
576
590
  color: "transparent"
577
591
  } : void 0;
578
- return h("picture", null, [
579
- webpSource,
580
- regularSource,
581
- this.data.src && h("img", {
582
- ref: "imageRef",
583
- src: this.data.src,
584
- alt: this.data.alt,
585
- onLoad: this.handleLoad,
586
- title: this.data.title,
587
- fetchpriority: this.priority ? "high" : void 0,
588
- loading: this.priority ? void 0 : "lazy",
589
- style: __spreadValues$4(__spreadValues$4(__spreadValues$4({}, placeholderStyle), sizingStyle), this.$attrs.style || {}),
590
- class: this.$attrs.class
591
- })
592
- ]);
592
+ return h(
593
+ "picture",
594
+ {
595
+ style: this.pictureStyle,
596
+ class: this.pictureClass
597
+ },
598
+ [
599
+ webpSource,
600
+ regularSource,
601
+ this.data.src && h("img", {
602
+ ref: "imageRef",
603
+ src: this.data.src,
604
+ alt: this.data.alt,
605
+ onLoad: this.handleLoad,
606
+ title: this.data.title,
607
+ fetchpriority: this.priority ? "high" : void 0,
608
+ loading: this.priority ? void 0 : "lazy",
609
+ style: __spreadValues$4(__spreadValues$4(__spreadValues$4({}, placeholderStyle), sizingStyle), this.imgStyle || {}),
610
+ class: this.imgClass
611
+ })
612
+ ]
613
+ );
593
614
  }
594
615
  });
595
616
  const DatocmsNakedImagePlugin = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-datocms",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
5
5
  "keywords": [
6
6
  "datocms",