vue-datocms 7.0.0 → 7.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 CHANGED
@@ -91,8 +91,7 @@ Trusted by over 25,000 enterprise businesses, agency partners, and individuals a
91
91
  - [datocms/js-rest-api-clients](https://github.com/datocms/js-rest-api-clients): Node and browser JavaScript clients for updating and administering your content. For frontend fetches, we recommend using our [GraphQL Content Delivery API](https://www.datocms.com/docs/content-delivery-api) instead.
92
92
  - [datocms/cli](https://github.com/datocms/cli): Command-line interface that includes our [Contentful importer](https://github.com/datocms/cli/tree/main/packages/cli-plugin-contentful) and [Wordpress importer](https://github.com/datocms/cli/tree/main/packages/cli-plugin-wordpress)
93
93
  - [datocms/plugins](https://github.com/datocms/plugins): Example plugins we've made that extend the editor/admin dashboard
94
- - [datocms/gatsby-source-datocms](https://github.com/datocms/gatsby-source-datocms): Our Gatsby source plugin to pull data from DatoCMS
95
- - Frontend examples in different frameworks: [Next.js](https://github.com/datocms/nextjs-demo), [Vue](https://github.com/datocms/vue-datocms) and [Nuxt](https://github.com/datocms/nuxtjs-demo), [Svelte](https://github.com/datocms/datocms-svelte) and [SvelteKit](https://github.com/datocms/sveltekit-demo), [Astro](https://github.com/datocms/datocms-astro-blog-demo), [Remix](https://github.com/datocms/remix-example). See [all our starter templates](https://www.datocms.com/marketplace/starters).
94
+ - [DatoCMS Starters](https://www.datocms.com/marketplace/starters) has examples for various Javascript frontend frameworks
96
95
 
97
96
  Or see [all our public repos](https://github.com/orgs/datocms/repositories?q=&type=public&language=&sort=stargazers)
98
97
  <!--datocms-autoinclude-footer end-->
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
@@ -9,29 +9,30 @@ import { StreamTypes, MaxResolutionValue, MinResolutionValue, CmcdTypes, Playbac
9
9
  import MuxPlayerElement, { Tokens } from '@mux/mux-player';
10
10
  import { Options, ConnectionStatus } from 'datocms-listen';
11
11
 
12
+ type Maybe$2<T> = T | null;
12
13
  type ResponsiveImageType = {
13
- /** The aspect ratio (width/height) of the image */
14
- aspectRatio?: number;
15
14
  /** A base64-encoded thumbnail to offer during image loading */
16
- base64?: string;
15
+ base64?: Maybe$2<string>;
17
16
  /** The height of the image */
18
- height?: number;
17
+ height?: Maybe$2<number>;
19
18
  /** The width of the image */
20
19
  width: number;
20
+ /** The aspect ratio (width/height) of the image */
21
+ aspectRatio?: number;
21
22
  /** The HTML5 `sizes` attribute for the image */
22
- sizes?: string;
23
+ sizes?: Maybe$2<string>;
23
24
  /** The fallback `src` attribute for the image */
24
- src?: string;
25
+ src?: Maybe$2<string>;
25
26
  /** The HTML5 `srcSet` attribute for the image */
26
- srcSet?: string;
27
+ srcSet?: Maybe$2<string>;
27
28
  /** The HTML5 `srcSet` attribute for the image in WebP format, for browsers that support the format */
28
- webpSrcSet?: string;
29
+ webpSrcSet?: Maybe$2<string>;
29
30
  /** The background color for the image placeholder */
30
- bgColor?: string;
31
+ bgColor?: Maybe$2<string>;
31
32
  /** Alternate text (`alt`) for the image */
32
- alt?: string;
33
+ alt?: Maybe$2<string>;
33
34
  /** Title attribute (`title`) for the image */
34
- title?: string;
35
+ title?: Maybe$2<string>;
35
36
  };
36
37
  declare const Image: vue.DefineComponent<{
37
38
  /** The actual response you get from a DatoCMS `responsiveImage` GraphQL query */
@@ -309,9 +310,27 @@ declare const NakedImage: vue.DefineComponent<{
309
310
  **/
310
311
  srcSetCandidates: {
311
312
  type: ArrayConstructor;
312
- validator: (values: any[]) => values is number[];
313
+ validator: (values: unknown[]) => values is number[];
313
314
  default: () => number[];
314
315
  };
316
+ /** Additional CSS class for the root `<picture />` tag */
317
+ pictureClass: {
318
+ type: StringConstructor;
319
+ };
320
+ /** Additional CSS rules to add to the root `<picture />` tag */
321
+ pictureStyle: {
322
+ type: ObjectConstructor;
323
+ default: () => {};
324
+ };
325
+ /** Additional CSS class for the `<img />` tag */
326
+ imgClass: {
327
+ type: StringConstructor;
328
+ };
329
+ /** Additional CSS rules to add to the `<img />` tag */
330
+ imgStyle: {
331
+ type: ObjectConstructor;
332
+ default: () => {};
333
+ };
315
334
  }, {
316
335
  loaded: vue.Ref<boolean>;
317
336
  handleLoad: () => void;
@@ -353,11 +372,31 @@ declare const NakedImage: vue.DefineComponent<{
353
372
  **/
354
373
  srcSetCandidates: {
355
374
  type: ArrayConstructor;
356
- validator: (values: any[]) => values is number[];
375
+ validator: (values: unknown[]) => values is number[];
357
376
  default: () => number[];
358
377
  };
378
+ /** Additional CSS class for the root `<picture />` tag */
379
+ pictureClass: {
380
+ type: StringConstructor;
381
+ };
382
+ /** Additional CSS rules to add to the root `<picture />` tag */
383
+ pictureStyle: {
384
+ type: ObjectConstructor;
385
+ default: () => {};
386
+ };
387
+ /** Additional CSS class for the `<img />` tag */
388
+ imgClass: {
389
+ type: StringConstructor;
390
+ };
391
+ /** Additional CSS rules to add to the `<img />` tag */
392
+ imgStyle: {
393
+ type: ObjectConstructor;
394
+ default: () => {};
395
+ };
359
396
  }>>, {
360
397
  priority: boolean;
398
+ pictureStyle: Record<string, any>;
399
+ imgStyle: Record<string, any>;
361
400
  usePlaceholder: boolean;
362
401
  srcSetCandidates: unknown[];
363
402
  }, {}>;
@@ -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.2",
4
4
  "description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
5
5
  "keywords": [
6
6
  "datocms",