{"_id":"@argann-jse/vue-datocms","_rev":"2-fe3e8f9b44ce72e5f1fae3c4f8795812","name":"@argann-jse/vue-datocms","dist-tags":{"latest":"1.1.7"},"versions":{"1.1.5":{"name":"@argann-jse/vue-datocms","version":"1.1.5","description":"A set of components and utilities to work faster with DatoCMS in Vue.js environments","keywords":["datocms","vue.js","vue","vuejs"],"main":"./dist/index.umd.js","module":"./dist/index.esm.js","unpkg":"./dist/index.min.js","types":"./dist/index.d.ts","license":"MIT","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.umd.js"}},"scripts":{"build":"rimraf dist && rollup -c","prepublishOnly":"npm run test && npm run build","test":"jest src"},"dependencies":{"datocms-structured-text-generic-html-renderer":"^1.3.0","datocms-structured-text-utils":"^1.1.0","hyphenate-style-name":"^1.0.4","vue-demi":"^0.13.11"},"peerDependencies":{"@vue/composition-api":"^1.0.0-rc.1","vue":"^2.0.0 || >=3.0.0-rc.1"},"peerDependenciesMeta":{"@vue/composition-api":{"optional":true}},"devDependencies":{"@types/hyphenate-style-name":"^1.0.0","@types/jest":"^26.0.22","@types/node":"^14.14.41","@vue/compiler-sfc":"^3.0.5","@vue/test-utils":"^2.0.0-rc.6","@vuedx/typescript-plugin-vue":"^0.6.3","jest":"^26.6.3","rimraf":"^2.7.1","rollup":"^2.45.2","rollup-plugin-dts":"^3.0.1","rollup-plugin-esbuild":"^4.1.0","ts-jest":"^26.5.5","typescript":"^4.1.3","vue":"^3.0.5","vue-jest":"^5.0.0-alpha.7","vue-tsc":"^0.0.24"},"directories":{"example":"examples"},"repository":{"type":"git","url":"git@github.com-jse:jesuisentrepreneur-fr/vue-datocms-2.7-compatible.git"},"author":"","gitHead":"29fca1a160df84c660922e6693905820e93e675a","_id":"@argann-jse/vue-datocms@1.1.5","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-zC5PbuyceVaN3MmjOnW6fMg7Ekr7YBQTPb1N8GvLZn5VNHlRvr6/j4aHGthB3cLO6tpM2/jovR1NfkqPbRgT+A==","shasum":"757fc4e1fd5da8a9a14325892232e350d4141503","tarball":"https://registry.npmjs.org/@argann-jse/vue-datocms/-/vue-datocms-1.1.5.tgz","fileCount":7,"unpackedSize":105715,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9ksjCS/JzmTHUiff3LIgntM0/1Nl5yOKpkl2M0unpqQIgGX076OhlzcsS0topKWWVfugwo2Mqxc6eVNnrTJ0FJRU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQJvfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopYBAAja16swPSiMvo+N5YfrkkTUyNkK1tu1I2qhPl0RZdj4/DKHA1\r\nH6phdh9fMF2x3dYFqKkWSrhepaWBBrcphPAb3dIuSwxQX7vbeSbQIp1PhlMD\r\na5i1xnrqvi8+A873oGqSUI7e9RkhSRn/EVHxf+scHqUen2Nj2TPwcMdoiMuO\r\nmKTi9XdY/r5jH7KDY5y9EUvkcyrVZT9cZZGwZKTgr0ZdwHDxI63xNl7ZKJ7f\r\nk1AOgUA8lW4Wl/uCIoKXSh1mZguR3ioXV43QOBrMJXOfkFuZGO1hLOZQGyb9\r\nCKNIS1MSychvUGgOtU5fEfWIk+Pc109q1tei2MvdACnO+0u4FkEu4POAlTFH\r\nb+Mc7m3YeWiSZs1BrGyEStji64yvTxaLUJuv8qNeEXz37pBXb/LP0SHgW3jJ\r\nElVX4NpYlRINDL81b6+DOi9gA14AwOQPYEDzRFqUybc+7gUb24BdTS4FFUB4\r\nq3z8dlpTFORtuMmKTYjiffbT5KBu9WrbKPCsEtVhHCj8n0VJxWNbkfq1707y\r\nfHtWjgTfjewljFPaNdriF5+Pio6ZSRRo6hnKMnDhWWUJtoJOqkmnd2L4A0vG\r\nUAsSsY4d6UBWkBo8HU4OOuXy9qjdJcl16XFMsrzjTgH22tkKYZB9WJuVCfn3\r\nRx/sVfcixMW1Of0KfS+7P0l36+D5Ds14830=\r\n=Gu3n\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"argann-jse","email":"argann.bay-eymere@jesuisentrepreneur.fr"},"maintainers":[{"name":"argann-jse","email":"argann.bay-eymere@jesuisentrepreneur.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-datocms_1.1.5_1665178590942_0.7672629217421385"},"_hasShrinkwrap":false},"1.1.6":{"name":"@argann-jse/vue-datocms","version":"1.1.6","description":"A set of components and utilities to work faster with DatoCMS in Vue.js environments","keywords":["datocms","vue.js","vue","vuejs"],"main":"./dist/index.umd.js","module":"./dist/index.esm.js","unpkg":"./dist/index.min.js","types":"./dist/index.d.ts","license":"MIT","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.umd.js"}},"scripts":{"build":"rimraf dist && rollup -c","prepublishOnly":"npm run test && npm run build","test":"jest src"},"dependencies":{"datocms-structured-text-generic-html-renderer":"^1.3.0","datocms-structured-text-utils":"^1.1.0","hyphenate-style-name":"^1.0.4","vue-demi":"^0.13.11"},"peerDependencies":{"@vue/composition-api":"^1.0.0-rc.1","vue":"^2.0.0 || >=3.0.0"},"peerDependenciesMeta":{"@vue/composition-api":{"optional":true}},"devDependencies":{"@types/hyphenate-style-name":"^1.0.0","@types/jest":"^26.0.22","@types/node":"^14.14.41","@vue/compiler-sfc":"^3.0.5","@vue/test-utils":"^2.0.0-rc.6","@vuedx/typescript-plugin-vue":"^0.6.3","jest":"^26.6.3","rimraf":"^2.7.1","rollup":"^2.45.2","rollup-plugin-dts":"^3.0.1","rollup-plugin-esbuild":"^4.1.0","ts-jest":"^26.5.5","typescript":"^4.1.3","vue":"^3.0.5","vue-jest":"^5.0.0-alpha.7","vue-tsc":"^0.0.24"},"directories":{"example":"examples"},"repository":{"type":"git","url":"git@github.com-jse:jesuisentrepreneur-fr/vue-datocms-2.7-compatible.git"},"author":{"name":"Argann BAY-EYMERE","url":"JSE"},"gitHead":"e75d4659a0f7af9f5d3a5e9e6ddc2aa55515eef0","_id":"@argann-jse/vue-datocms@1.1.6","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-JNOIp1C+ITNZ/Jvc3uTmyehUF5oyQzd5IDjXoyIiNCaVyHLF58W9DMCeNMDGthStDLxbrVcx4lSBE82f8xWOLg==","shasum":"2abe40755094252dc23aa4ea2a79b1fe6c557670","tarball":"https://registry.npmjs.org/@argann-jse/vue-datocms/-/vue-datocms-1.1.6.tgz","fileCount":7,"unpackedSize":105778,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICtU/90KOM3zcHaZgsu8cVGmheGxGSA/9u6+EVbsYEQ2AiEAr3gbsnbkSEqA/Gk3v7lIZj035xus3OiyTwcM8/dnCkY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRB6AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr09RAAkjqU32XFC652o4jPavwFSTsWihHMlyZHmDAmJFOATDcU+8pb\r\nvul5bcCRqk5ASeAD/SnYwKaFB1NSAm1KGn4/X+i4qxB9ZaxIMF1sxATnveEE\r\nlaEUMJUiq28GFSxEK9dbKARXKpu4SMC7UHNlMjjHjWJ1e4HlR0zP2MYO26KP\r\nKgyZJ+RiIqkKJ1+oDP71zSK+vxDiiErPPboZ60JSIyF/Sgv2s/kG2unvHiQ+\r\nv9AHmNbOwjL9iOI7jLrI/hlBIw/zwVv32N6N0IY5CXrMJ04qAwBtEA+GEqpZ\r\nHMWrVoA1gsN36z36ujm0ogHqN2Vcdejds2cMCBy6S0J496fLABEQLpifrY+L\r\nfSAgp3dqS7JLZdSY/cMakcfpgrOuyZej3/SyjZ5n1UfjPWLAV1WRn28GjFsp\r\nSBwbEAEpd5rvAl8MSy6iDhWTp7WA7I589MJoFdHiXK1pV5MHqiWj6+DnM04y\r\ntMguHG7j4Ht56L/ziu+g3aci9fd4wEG6CMO2wqbjrYVcQFBy8bLMVFZ6dAUo\r\nltw+xXYp1QiyyOG6zUaMqVly5JCPEf+/HGfd0grWPa52d3jxZBVvCRU+NXRM\r\niK4Dh02e3XrB4fPluAPnat6JozGuVorP2rsabDFWZ8O6Ky7/S3r4/DXhnvN3\r\n387QvwOl9pgOVMyWOIo2O7d8DYEEC1FobTQ=\r\n=WJKD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"argann-jse","email":"argann.bay-eymere@jesuisentrepreneur.fr"},"maintainers":[{"name":"argann-jse","email":"argann.bay-eymere@jesuisentrepreneur.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-datocms_1.1.6_1665408640194_0.5268011287288434"},"_hasShrinkwrap":false},"1.1.7":{"name":"@argann-jse/vue-datocms","version":"1.1.7","description":"A set of components and utilities to work faster with DatoCMS in Vue.js environments","keywords":["datocms","vue.js","vue","vuejs"],"main":"./dist/index.umd.js","module":"./dist/index.esm.js","unpkg":"./dist/index.min.js","types":"./dist/index.d.ts","license":"MIT","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.umd.js"}},"scripts":{"build":"rimraf dist && rollup -c","prepublishOnly":"npm run test && npm run build","test":"jest src"},"dependencies":{"datocms-structured-text-generic-html-renderer":"^1.3.0","datocms-structured-text-utils":"^1.1.0","hyphenate-style-name":"^1.0.4","vue-demi":"^0.13.11"},"peerDependencies":{"vue":"^2.0.0 || >=3.0.0"},"devDependencies":{"@types/hyphenate-style-name":"^1.0.0","@types/jest":"^26.0.22","@types/node":"^14.14.41","@vue/compiler-sfc":"^3.0.5","@vue/test-utils":"^2.0.0-rc.6","@vuedx/typescript-plugin-vue":"^0.6.3","jest":"^26.6.3","rimraf":"^2.7.1","rollup":"^2.45.2","rollup-plugin-dts":"^3.0.1","rollup-plugin-esbuild":"^4.1.0","ts-jest":"^26.5.5","typescript":"^4.1.3","vue":"^3.0.5","vue-jest":"^5.0.0-alpha.7","vue-tsc":"^0.0.24"},"directories":{"example":"examples"},"repository":{"type":"git","url":"git@github.com-jse:jesuisentrepreneur-fr/vue-datocms-2.7-compatible.git"},"author":{"name":"Argann BAY-EYMERE","url":"JSE"},"gitHead":"b367ecec20a3a098e9fbd171704241073fef7aef","_id":"@argann-jse/vue-datocms@1.1.7","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"integrity":"sha512-WLZ2T90kY5NYnV7yW2txDki0Nh+ebPuw6cXo6YlFGhrzmhhzO5zbpaYA/addWWdbW40S4uORcNIOA19pDYGxEw==","shasum":"d76942776b69b5984879ad27715b584e69ddedb0","tarball":"https://registry.npmjs.org/@argann-jse/vue-datocms/-/vue-datocms-1.1.7.tgz","fileCount":7,"unpackedSize":105642,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUdsUBy3VJP9fw2sS9ub2ypTrarHpYd1VZPBGwe414DwIgYD9ZB1q07LtKUxv7eQRjlnIefc9MYzCNEA+/HejcpnU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhJbLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogTxAAjPQ6nXYF9voN2Y1a1juqZ5jDHr6HgdekRuoVTOubEyzXyjMP\r\nYMcetU+se6LWjfnmFjQcQ3H1CxZsewill27b61U72hSthS7Tb+krULQRYCmw\r\nb35vCq/wV43RbIfptUx42j9Jqvfu3Jvw4eX2LTmFKin6rzLRToYTEiwjWHhw\r\ngWaq+oA776JdseuAjvG6Orltvm0wynwkC4Ao9rhQqivEnAUxDp0jt/rjwS/Z\r\nv7NH62K1L3ne2wZUZSJfWrqzIPrlf3pWgtHavp+KN0dZ03War8gyott7gqNs\r\nnZX5qxKfskqegFoSSR2bY6TRr/OEku1ceSzQspaseLpy1rLijjC+hE0+W0UT\r\n24PCJezlYd7slKmrjXLZYmmlYiVyPHALGUnPOJKdp5246ENS6ih0XHjEO/zC\r\nl0dvHjvG9TRKsIRXoNoesOYS+2aEducRAq4RqGSWTvkW05ovDhu0h/G1cCwP\r\ngvjS3G4AUmLwJkpTlWHOwHukz9GkPnFMG135cPU2M6n5Wu67kiezN1NhYA29\r\nP+MLbNUYyM1pMlY2Bt5Um13KAD3c+AkBmgyl9GY6x+CvrJF8NmO6CfvZ8EmJ\r\nKzNAj1/8HJabe7a8UFxRUl75IX5HtExNv+n36FgztNPFZz5LdYLdFrCu/oq3\r\nNBY4rvdqx8wMhWuxxYWkH8aJ7pY4QqSF56U=\r\n=MtHL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"argann-jse","email":"argann.bay-eymere@jesuisentrepreneur.fr"},"maintainers":[{"name":"argann-jse","email":"argann.bay-eymere@jesuisentrepreneur.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-datocms_1.1.7_1669633739655_0.6615320796757205"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-07T21:36:30.895Z","1.1.5":"2022-10-07T21:36:31.391Z","modified":"2022-11-28T11:08:59.886Z","1.1.6":"2022-10-10T13:30:40.388Z","1.1.7":"2022-11-28T11:08:59.816Z"},"maintainers":[{"name":"argann-jse","email":"argann.bay-eymere@jesuisentrepreneur.fr"}],"description":"A set of components and utilities to work faster with DatoCMS in Vue.js environments","keywords":["datocms","vue.js","vue","vuejs"],"repository":{"type":"git","url":"git@github.com-jse:jesuisentrepreneur-fr/vue-datocms-2.7-compatible.git"},"license":"MIT","readme":"# vue-datocms\n\n![MIT](https://img.shields.io/npm/l/vue-datocms?style=for-the-badge) ![MIT](https://img.shields.io/npm/v/vue-datocms?style=for-the-badge) [![Build Status](https://img.shields.io/travis/datocms/vue-datocms?style=for-the-badge)](https://travis-ci.org/datocms/vue-datocms)\n\nA set of components and utilities to work faster with [DatoCMS](https://www.datocms.com/) in Vue.js environments. Integrates seamlessy with [DatoCMS's GraphQL Content Delivery API](https://www.datocms.com/docs/content-delivery-api).\n\n- Works with both Vue 2 (only on JS projects, not TypeScript) and Vue 3;\n- TypeScript ready;\n- Compatible with any data-fetching library (axios, Apollo);\n- Usable both client and server side;\n- Compatible with vanilla Vue, Nuxt.js and pretty much any other Vue-based solution;\n\n<br /><br />\n<a href=\"https://www.datocms.com/\">\n<img src=\"https://www.datocms.com/images/full_logo.svg\" height=\"60\">\n</a>\n<br /><br />\n\n## Table of Contents\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n- [Demos](#demos)\n- [Installation](#installation)\n- [Live real-time updates](#live-real-time-updates)\n- [Progressive/responsive image](#progressiveresponsive-image)\n  - [Out-of-the-box features](#out-of-the-box-features)\n  - [Setup](#setup)\n  - [Usage](#usage)\n  - [Example](#example)\n  - [Props](#props)\n    - [The `ResponsiveImage` object](#the-responsiveimage-object)\n- [Social share, SEO and Favicon meta tags](#social-share-seo-and-favicon-meta-tags)\n  - [Usage](#usage-1)\n  - [Example](#example-1)\n- [Structured text](#structured-text)\n  - [Setup](#setup-1)\n  - [Basic usage](#basic-usage)\n  - [Custom renderers](#custom-renderers)\n  - [Props](#props-1)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n## Demos\n\n- Pure Vue: [https://vue-datocms-example.netlify.com/](https://vue-datocms-example.netlify.com/)\n- Server side rendering with Nuxt.js: [https://vue-datocms-components.now.sh](https://vue-datocms-components.now.sh)\n\n## Installation\n\n```\nnpm install vue-datocms\n```\n\nIn Vue 2, also install `@vue/composition-api` as a dependency. Everything else should be similar to the example above for Vue 3. Please note that with Vue 2 support is limited to JS-only projects. TypeScript + Vue 2 is not supported at the moment, sorry.\n\n## Live real-time updates\n\nThanks to the `subscribeToQuery` helper provided by the [datocms-listen](https://www.npmjs.com/package/datocms-listen) package you can get real-time updates for the page when the content changes. This helper connects to the DatoCMS's [Real-time Updates API](https://www.datocms.com/docs/real-time-updates-api/api-reference) to receive the updated query results in real-time, and is able to reconnect in case of network failures.\n\nLive updates are great both to get instant previews of your content while editing it inside DatoCMS, or to offer real-time updates of content to your visitors (ie. news site).\n\n### Reference\n\n`subscribeToQuery` provides a way to create a subscription to DatoCMS's [Real-time Updates API](https://www.datocms.com/docs/real-time-updates-api/api-reference).\n\nPlease consult the [datocms-listen package documentation](https://www.npmjs.com/package/datocms-listen) to learn more about how to configure `subscribeToQuery`.\n\nIn Vue.js v2, the subscription can be created inside of the [`mounted`](https://vuejs.org/v2/api/#mounted) lifecycle method. Please refer to the [query-subscription example](./examples/query-subscription/src/App.vue#L47) for a sample implementation.\n\nIn Vue.js v3, `subscribeToQuery` can be used to implement a custom hook. Please take a look at the [React.js one](https://github.com/datocms/react-datocms/blob/master/src/useQuerySubscription/index.ts) for a sample implementation.\n\n## Progressive/responsive image\n\n`<datocms-image>` is a Vue component specially designed to work seamlessly with DatoCMS’s [`responsiveImage` GraphQL query](https://www.datocms.com/docs/content-delivery-api/uploads#responsive-images) that optimizes image loading for your sites.\n\n![](docs/image-component.gif?raw=true)\n\n### Out-of-the-box features\n\n- Offers WebP version of images for browsers that support the format\n- Generates multiple smaller images so smartphones and tablets don’t download desktop-sized images\n- Efficiently lazy loads images to speed initial page load and save bandwidth\n- Holds the image position so your page doesn’t jump while images load\n- Uses either blur-up or background color techniques to show a preview of the image while it loads\n\n## Intersection Observer\n\nIntersection Observer is the API used to determine if the image is inside the viewport or not. [Browser support is really good](https://caniuse.com/intersectionobserver) - With Safari adding support in 12.1, all major browsers now support Intersection Observers natively.\n\nIf the IntersectionObserver object is not available, the component treats the image as it's always visible in the viewport. Feel free to add a [polyfill](https://www.npmjs.com/package/intersection-observer) so that it will also 100% work on older versions of iOS and IE11.\n\n### Setup\n\nYou can register the component globally so it's available in all your apps:\n\n```js\nimport Vue from 'vue';\nimport { DatocmsImagePlugin } from 'vue-datocms';\n\nVue.use(DatocmsImagePlugin);\n```\n\nOr use it locally in any of your components:\n\n```js\nimport { Image } from 'vue-datocms';\n\nexport default {\n  components: {\n    'datocms-image': Image,\n  },\n};\n```\n\n### Usage\n\n1. Use `<datocms-image>` it in place of the regular `<img />` tag\n2. Write a GraphQL query to your DatoCMS project using the [`responsiveImage` query](https://www.datocms.com/docs/content-delivery-api/images-and-videos#responsive-images)\n\nThe GraphQL query returns multiple thumbnails with optimized compression. The `<datocms-image>` component automatically sets up the \"blur-up\" effect as well as lazy loading of images further down the screen.\n\n### Example\n\nFor a fully working example take a look at our [examples directory](https://github.com/datocms/vue-datocms/tree/master/examples).\n\n```vue\n<template>\n  <article>\n    <div v-if=\"data\">\n      <h1>{{ data.blogPost.title }}</h1>\n      <datocms-image :data=\"data.blogPost.cover.responsiveImage\" />\n    </div>\n  </article>\n</template>\n\n<script>\nimport { request } from './lib/datocms';\nimport { Image } from 'vue-datocms';\n\nconst query = gql`\n  query {\n    blogPost {\n      title\n      cover {\n        responsiveImage(\n          imgixParams: { fit: crop, w: 300, h: 300, auto: format }\n        ) {\n          # HTML5 src/srcset/sizes attributes\n          srcSet\n          webpSrcSet\n          sizes\n          src\n\n          # size information (post-transformations)\n          width\n          height\n          aspectRatio\n\n          # SEO attributes\n          alt\n          title\n\n          # background color placeholder or...\n          bgColor\n\n          # blur-up placeholder, JPEG format, base64-encoded\n          base64\n        }\n      }\n    }\n  }\n`;\n\nexport default {\n  components: {\n    'datocms-image': Image,\n  },\n  data() {\n    return {\n      data: null,\n    };\n  },\n  async mounted() {\n    this.data = await request({ query });\n  },\n};\n</script>\n```\n\n### Props\n\n| prop                  | type                     | default           | required           | description                                                                                                                                                                                                                                                                                   |\n| --------------------- | ------------------------ | ----------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| data                  | `ResponsiveImage` object |                   | :white_check_mark: | The actual response you get from a DatoCMS `responsiveImage` GraphQL query.                                                                                                                                                                                                                   |\n| class                 | string                   | null              | :x:                | Additional CSS class of root node                                                                                                                                                                                                                                                             |\n| root-style            | CSS properties           | null              | :x:                | Additional CSS rules to add to the root node                                                                                                                                                                                                                                                  |\n| picture-class         | string                   | null              | :x:                | Additional CSS class for the inner `<picture />` tag                                                                                                                                                                                                                                          |\n| picture-style         | CSS properties           | null              | :x:                | Additional CSS rules to add to the inner `<picture />` tag                                                                                                                                                                                                                                    |\n| fade-in-duration      | integer                  | 500               | :x:                | Duration (in ms) of the fade-in transition effect upoad image loading                                                                                                                                                                                                                         |\n| intersection-treshold | float                    | 0                 | :x:                | Indicate at what percentage of the placeholder visibility the loading of the image should be triggered. A value of 0 means that as soon as even one pixel is visible, the callback will be run. A value of 1.0 means that the threshold isn't considered passed until every pixel is visible. |\n| intersection-tmargin  | string                   | \"0px 0px 0px 0px\" | :x:                | Margin around the placeholder. Can have values similar to the CSS margin property (top, right, bottom, left). The values can be percentages. This set of values serves to grow or shrink each side of the placeholder element's bounding box before computing intersections.                  |\n| lazy-load             | Boolean                  | true              | :x:                | Wheter enable lazy loading or not                                                                                                                                                                                                                                                             |\n| explicitWidth         | Boolean                  | false             | :x:                | Wheter the image wrapper should explicitely declare the width of the image or keep it fluid                                                                                                                                                                                                   |\n\n#### The `ResponsiveImage` object\n\nThe `data` prop expects an object with the same shape as the one returned by `responsiveImage` GraphQL call. It's up to you to make a GraphQL query that will return the properties you need for a specific use of the `<datocms-image>` component.\n\n- The minimum required properties for `data` are: `aspectRatio`, `width`, `sizes`, `srcSet` and `src`;\n- `alt` and `title`, while not mandatory, are all highly suggested, so remember to use them!\n- You either want to add the `webpSrcSet` field or specify `{ auto: format }` in your `imgixParams`, to automatically use WebP images in browsers that support the format;\n- If you provide both the `bgColor` and `base64` property, the latter will take precedence, so just avoiding querying both fields at the same time, it will only make the response bigger :wink:\n\nHere's a complete recap of what `responsiveImage` offers:\n\n| property    | type    | required           | description                                                                                     |\n| ----------- | ------- | ------------------ | ----------------------------------------------------------------------------------------------- |\n| aspectRatio | float   | :white_check_mark: | The aspect ratio (width/height) of the image                                                    |\n| width       | integer | :white_check_mark: | The width of the image                                                                          |\n| sizes       | string  | :white_check_mark: | The HTML5 `sizes` attribute for the image                                                       |\n| srcSet      | string  | :white_check_mark: | The HTML5 `srcSet` attribute for the image                                                      |\n| src         | string  | :white_check_mark: | The fallback `src` attribute for the image                                                      |\n| webpSrcSet  | string  | :x:                | The HTML5 `srcSet` attribute for the image in WebP format, for browsers that support the format |\n| alt         | string  | :x:                | Alternate text (`alt`) for the image                                                            |\n| title       | string  | :x:                | Title attribute (`title`) for the image                                                         |\n| bgColor     | string  | :x:                | The background color for the image placeholder                                                  |\n| base64      | string  | :x:                | A base64-encoded thumbnail to offer during image loading                                        |\n\n## Social share, SEO and Favicon meta tags\n\nJust like the image component, `toHead()` is a helper specially designed to work seamlessly with DatoCMS’s [`_seoMetaTags` and `faviconMetaTags` GraphQL queries](https://www.datocms.com/docs/content-delivery-api/seo) so that you can handle proper SEO in your pages.\n\nYou can use `toHead()` inside the `metaInfo` (or `head`, in Nuxt.js) property of your components, and it will return meta tags as required by the [`vue-meta`](https://vue-meta.nuxtjs.org/guide/metainfo.html) package.\n\n### Usage\n\n`toHead()` takes an array of `Tag`s in the exact form they're returned by the following [DatoCMS GraphQL API](https://www.datocms.com/docs/content-delivery-api/seo) queries:\n\n- `_seoMetaTags` query on any record, or\n- `faviconMetaTags` on the global `_site` object.\n\nYou can pass multiple arrays of `Tag`s together and pass them to a single `toHead()` call.\n\n### Example\n\nFor a working example take a look at our [examples directory](https://github.com/datocms/vue-datocms/tree/master/examples).\n\n```vue\n<template>\n  <article>\n    <h1 v-if=\"data\">{{ data.page.title }}</h1>\n  </article>\n</template>\n\n<script>\nimport { request } from './lib/datocms';\nimport { toHead } from 'vue-datocms';\n\nconst query = gql`\n  query {\n    page: homepage {\n      title\n      seo: _seoMetaTags {\n        attributes\n        content\n        tag\n      }\n    }\n\n    site: _site {\n      favicon: faviconMetaTags {\n        attributes\n        content\n        tag\n      }\n    }\n  }\n`;\n\nexport default {\n  data() {\n    return {\n      data: null,\n    };\n  },\n  async mounted() {\n    this.data = await request({ query });\n  },\n  metaInfo() {\n    if (!this || !this.data) {\n      return;\n    }\n    return toHead(this.data.page.seo, this.data.site.favicon);\n  },\n};\n</script>\n```\n\n# Structured text\n\n`<datocms-structured-text />` is a Vue component that you can use to render the value contained inside a DatoCMS [Structured Text field type](https://www.datocms.com/docs/structured-text/dast).\n\n### Setup\n\nYou can register the component globally so it's available in all your apps:\n\n```js\nimport Vue from 'vue';\nimport { DatocmsStructuredTextPlugin } from 'vue-datocms';\n\nVue.use(DatocmsStructuredTextPlugin);\n```\n\nOr use it locally in any of your components:\n\n```js\nimport { StructuredText } from 'vue-datocms';\n\nexport default {\n  components: {\n    'datocms-structured-text': StructuredText,\n  },\n};\n```\n\n## Basic usage\n\n```vue\n<template>\n  <article>\n    <div v-if=\"data\">\n      <h1>{{ data.blogPost.title }}</h1>\n      <datocms-structured-text :data=\"data.blogPost.content\" />\n      <!--\n        Final result:\n        <h1>Hello <strong>world!</strong></h1>\n      -->\n    </div>\n  </article>\n</template>\n\n<script>\nimport { request } from './lib/datocms';\nimport { StructuredText } from 'vue-datocms';\n\nconst query = gql`\n  query {\n    blogPost {\n      title\n      content {\n        value\n      }\n    }\n  }\n`;\n\nexport default {\n  components: {\n    'datocms-structured-text': StructuredText,\n  },\n  data() {\n    return {\n      data: null,\n    };\n  },\n  async mounted() {\n    this.data = await request({ query });\n    // data.blogPost.content ->\n    // {\n    //   value: {\n    //     schema: \"dast\",\n    //     document: {\n    //       type: \"root\",\n    //       children: [\n    //         {\n    //           type: \"heading\",\n    //           level: 1,\n    //           children: [\n    //             {\n    //               type: \"span\",\n    //               value: \"Hello \",\n    //             },\n    //             {\n    //               type: \"span\",\n    //               marks: [\"strong\"],\n    //               value: \"world!\",\n    //             },\n    //           ],\n    //         },\n    //       ],\n    //     },\n    //   },\n    // }\n  },\n};\n</script>\n```\n\n## Custom renderers\n\nYou can also pass custom renderers for special nodes (inline records, record links and blocks) as an optional parameter like so:\n\n```vue\n<template>\n  <article>\n    <div v-if=\"data\">\n      <h1>{{ data.blogPost.title }}</h1>\n      <datocms-structured-text\n        :data=\"data.blogPost.content\"\n        :renderInlineRecord=\"renderInlineRecord\"\n        :renderLinkToRecord=\"renderLinkToRecord\"\n        :renderBlock=\"renderBlock\"\n      />\n      <!--\n        Final result:\n\n        <h1>Welcome onboard <a href=\"/team/mark-smith\">Mark</a></h1>\n        <p>\n          So happy to have\n          <a href=\"/team/mark-smith\">this awesome humang being</a> in our team!\n        </p>\n        <img\n          src=\"https://www.datocms-assets.com/205/1597757278-austin-distel-wd1lrb9oeeo-unsplash.jpg\"\n          alt=\"Our team at work\"\n        />\n      -->\n    </div>\n  </article>\n</template>\n\n<script>\nimport { request } from './lib/datocms';\nimport { StructuredText, Image } from 'vue-datocms';\nimport { h } from 'vue-demi';\n\nconst query = gql`\n  query {\n    blogPost {\n      title\n      content {\n        value\n        links {\n          __typename\n          ... on TeamMemberRecord {\n            id\n            firstName\n            slug\n          }\n        }\n        blocks {\n          __typename\n          ... on ImageRecord {\n            id\n            image {\n              responsiveImage(\n                imgixParams: { fit: crop, w: 300, h: 300, auto: format }\n              ) {\n                srcSet\n                webpSrcSet\n                sizes\n                src\n                width\n                height\n                aspectRatio\n                alt\n                title\n                base64\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n`;\n\nexport default {\n  components: {\n    'datocms-structured-text': StructuredText,\n    'datocms-image': Image,\n  },\n  data() {\n    return {\n      data: null,\n    };\n  },\n  methods: {\n    renderInlineRecord: ({ record }) => {\n      switch (record.__typename) {\n        case 'TeamMemberRecord':\n          return h('a', { href: `/team/${record.slug}` }, record.firstName);\n        default:\n          return null;\n      }\n    },\n    renderLinkToRecord: ({ record, children, transformedMeta }) => {\n      switch (record.__typename) {\n        case 'TeamMemberRecord':\n          return h(\n            'a',\n            { ...transformedMeta, href: `/team/${record.slug}` },\n            children,\n          );\n        default:\n          return null;\n      }\n    },\n    renderBlock: ({ record }) => {\n      switch (record.__typename) {\n        case 'ImageRecord':\n          return h('datocms-image', {\n            data: record.image.responsiveImage,\n          });\n        default:\n          return null;\n      }\n    },\n  },\n  async mounted() {\n    this.data = await request({ query });\n    // data.blogPost.content ->\n    // {\n    //   value: {\n    //     schema: \"dast\",\n    //     document: {\n    //       type: \"root\",\n    //       children: [\n    //         {\n    //           type: \"heading\",\n    //           level: 1,\n    //           children: [\n    //             { type: \"span\", value: \"Welcome onboard \" },\n    //             { type: \"inlineItem\", item: \"324321\" },\n    //           ],\n    //         },\n    //         {\n    //           type: \"paragraph\",\n    //           children: [\n    //             { type: \"span\", value: \"So happy to have \" },\n    //             {\n    //               type: \"itemLink\",\n    //               item: \"324321\",\n    //               children: [\n    //                 {\n    //                   type: \"span\",\n    //                   marks: [\"strong\"],\n    //                   value: \"this awesome humang being\",\n    //                 },\n    //               ]\n    //             },\n    //             { type: \"span\", value: \" in our team!\" },\n    //           ]\n    //         },\n    //         { type: \"block\", item: \"1984559\" }\n    //       ],\n    //     },\n    //   },\n    //   links: [\n    //     {\n    //       id: \"324321\",\n    //       __typename: \"TeamMemberRecord\",\n    //       firstName: \"Mark\",\n    //       slug: \"mark-smith\",\n    //     },\n    //   ],\n    //   blocks: [\n    //     {\n    //       id: \"324321\",\n    //       __typename: \"ImageRecord\",\n    //       image: {\n    //         responsiveImage: { ... },\n    //       },\n    //     },\n    //   ],\n    // }\n  },\n};\n</script>\n```\n\n## Override default rendering of nodes\n\nThis component automatically renders all nodes except for `inline_item`, `item_link` and `block` using a set of default rules, but you might want to customize those. For example:\n\n- For `heading` nodes, you might want to add an anchor;\n- For `code` nodes, you might want to use a custom sytax highlighting component;\n\nIn this case, you can easily override default rendering rules with the `customNodeRules` and `customMarkRules` props.\n\n```vue\n<template>\n  <datocms-structured-text\n    :data=\"data.blogPost.content\"\n    :customNodeRules=\"customNodeRules\"\n    :customMarkRules=\"customMarkRules\"\n  />\n</template>\n\n<script>\nimport { StructuredText, renderNodeRule, renderMarkRule } from \"vue-datocms\";\nimport { isHeading, isCode } from \"datocms-structured-text-utils\";\nimport { render as toPlainText } from 'datocms-structured-text-to-plain-text';\nimport SyntaxHighlight from './components/SyntaxHighlight';\n\nexport default {\n  components: {\n    \"datocms-structured-text\": StructuredText,\n    \"syntax-highlight\": SyntaxHighlight,\n  },\n  data() {\n    return {\n      data: /* ... */,\n      customNodeRules: [\n        renderNodeRule(isHeading, ({ adapter: { renderNode: h }, node, children, key }) => {\n          const anchor = toPlainText(node)\n            .toLowerCase()\n            .replace(/ /g, '-')\n            .replace(/[^\\w-]+/g, '');\n\n          return h(\n            `h${node.level}`, { key }, [\n              ...children,\n              h('a', { attrs: { id: anchor } }, []),\n              h('a', { attrs: { href: `#${anchor}` } }, []),\n            ]\n          );\n        }),\n        renderNodeRule(isCode, ({ adapter: { renderNode: h }, node, key }) => {\n          return h('syntax-highlight', {\n            key,\n            code: node.code,\n            language: node.language,\n            linesToBeHighlighted: node.highlight,\n          }, []);\n        }),\n      ],\n      customMarkRules: [\n        // convert \"strong\" marks into <b> tags\n        renderMarkRule('strong', ({ adapter: { renderNode: h }, mark, children, key }) => {\n          return h('b', {key}, children);\n        }),\n      ],\n    };\n  },\n};\n</script>\n```\n\nNote: if you override the rules for `inline_item`, `item_link` or `block` nodes, then the `renderInlineRecord`, `renderLinkToRecord` and `renderBlock` props won't be considered!\n\n## Props\n\n| prop               | type                                                       | required                                              | description                                                                                      | default                                                                                                              |\n| ------------------ | ---------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |\n| data               | `StructuredTextGraphQlResponse \\| DastNode`                | :white_check_mark:                                    | The actual [field value](https://www.datocms.com/docs/structured-text/dast) you get from DatoCMS |                                                                                                                      |\n| renderInlineRecord | `({ record }) => VNode \\| null`                            | Only required if document contains `inlineItem` nodes | Convert an `inlineItem` DAST node into a VNode                                                   | `[]`                                                                                                                 |\n| renderLinkToRecord | `({ record, children, transformedMeta }) => VNode \\| null` | Only required if document contains `itemLink` nodes   | Convert an `itemLink` DAST node into a VNode                                                     | `null`                                                                                                               |\n| renderBlock        | `({ record }) => VNode \\| null`                            | Only required if document contains `block` nodes      | Convert a `block` DAST node into a VNode                                                         | `null`                                                                                                               |\n| metaTransformer    | `({ node, meta }) => Object \\| null`                       | :x:                                                   | Transform `link` and `itemLink` meta property into HTML props                                    | [See function](https://github.com/datocms/structured-text/blob/main/packages/generic-html-renderer/src/index.ts#L61) |\n| customNodeRules    | `Array<RenderRule>`                                        | :x:                                                   | Customize how nodes are converted in JSX (use `renderNodeRule()` to generate)                    | `null`                                                                                                               |\n| customMarkRules    | `Array<RenderMarkRule>`                                    | :x:                                                   | Customize how marks are converted in JSX (use `renderMarkRule()` to generate)                    | `null`                                                                                                               |\n| renderText         | `(text: string, key: string) => VNode \\| string \\| null`   | :x:                                                   | Convert a simple string text into a VNode                                                        | `(text) => text`                                                                                                     |\n","readmeFilename":"README.md","author":{"name":"Argann BAY-EYMERE","url":"JSE"}}