@datocms/svelte 0.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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -0
  3. package/components/Head/Head.svelte +14 -0
  4. package/components/Head/Head.svelte.d.ts +61 -0
  5. package/components/Head/README.md +68 -0
  6. package/components/Head/__tests__/Head.test.d.ts +1 -0
  7. package/components/Head/__tests__/Head.test.js +11 -0
  8. package/components/Head/__tests__/__fixtures__/head.d.ts +2 -0
  9. package/components/Head/__tests__/__fixtures__/head.js +280 -0
  10. package/components/Head/__tests__/__snapshots__/Head.test.ts.snap +221 -0
  11. package/components/Image/Image.svelte +172 -0
  12. package/components/Image/Image.svelte.d.ts +83 -0
  13. package/components/Image/Placeholder.svelte +31 -0
  14. package/components/Image/Placeholder.svelte.d.ts +22 -0
  15. package/components/Image/README.md +167 -0
  16. package/components/Image/Sizer.svelte +17 -0
  17. package/components/Image/Sizer.svelte.d.ts +19 -0
  18. package/components/Image/Source.svelte +6 -0
  19. package/components/Image/Source.svelte.d.ts +18 -0
  20. package/components/Image/__tests__/Image.svelte.test.d.ts +1 -0
  21. package/components/Image/__tests__/Image.svelte.test.js +44 -0
  22. package/components/Image/__tests__/__fixtures__/image.d.ts +40 -0
  23. package/components/Image/__tests__/__fixtures__/image.js +40 -0
  24. package/components/Image/__tests__/__snapshots__/Image.svelte.test.ts.snap +927 -0
  25. package/components/StructuredText/Node.svelte +112 -0
  26. package/components/StructuredText/Node.svelte.d.ts +22 -0
  27. package/components/StructuredText/README.md +201 -0
  28. package/components/StructuredText/StructuredText.svelte +15 -0
  29. package/components/StructuredText/StructuredText.svelte.d.ts +19 -0
  30. package/components/StructuredText/__tests__/StructuredText.svelte.test.d.ts +1 -0
  31. package/components/StructuredText/__tests__/StructuredText.svelte.test.js +163 -0
  32. package/components/StructuredText/__tests__/__fixtures__/Block.svelte +11 -0
  33. package/components/StructuredText/__tests__/__fixtures__/Block.svelte.d.ts +19 -0
  34. package/components/StructuredText/__tests__/__fixtures__/CustomSpan.svelte +49 -0
  35. package/components/StructuredText/__tests__/__fixtures__/CustomSpan.svelte.d.ts +19 -0
  36. package/components/StructuredText/__tests__/__fixtures__/IncreasedLevelHeading.svelte +8 -0
  37. package/components/StructuredText/__tests__/__fixtures__/IncreasedLevelHeading.svelte.d.ts +19 -0
  38. package/components/StructuredText/__tests__/__fixtures__/InlineItem.svelte +8 -0
  39. package/components/StructuredText/__tests__/__fixtures__/InlineItem.svelte.d.ts +19 -0
  40. package/components/StructuredText/__tests__/__fixtures__/ItemLink.svelte +15 -0
  41. package/components/StructuredText/__tests__/__fixtures__/ItemLink.svelte.d.ts +21 -0
  42. package/components/StructuredText/__tests__/__fixtures__/structuredText.d.ts +6 -0
  43. package/components/StructuredText/__tests__/__fixtures__/structuredText.js +537 -0
  44. package/components/StructuredText/__tests__/__fixtures__/types.d.ts +27 -0
  45. package/components/StructuredText/__tests__/__fixtures__/types.js +1 -0
  46. package/components/StructuredText/__tests__/__snapshots__/StructuredText.svelte.test.ts.snap +463 -0
  47. package/components/StructuredText/nodes/Blockquote.svelte +5 -0
  48. package/components/StructuredText/nodes/Blockquote.svelte.d.ts +19 -0
  49. package/components/StructuredText/nodes/Code.svelte +6 -0
  50. package/components/StructuredText/nodes/Code.svelte.d.ts +17 -0
  51. package/components/StructuredText/nodes/Heading.svelte +8 -0
  52. package/components/StructuredText/nodes/Heading.svelte.d.ts +19 -0
  53. package/components/StructuredText/nodes/Link.svelte +6 -0
  54. package/components/StructuredText/nodes/Link.svelte.d.ts +19 -0
  55. package/components/StructuredText/nodes/List.svelte +10 -0
  56. package/components/StructuredText/nodes/List.svelte.d.ts +19 -0
  57. package/components/StructuredText/nodes/ListItem.svelte +5 -0
  58. package/components/StructuredText/nodes/ListItem.svelte.d.ts +19 -0
  59. package/components/StructuredText/nodes/Paragraph.svelte +5 -0
  60. package/components/StructuredText/nodes/Paragraph.svelte.d.ts +19 -0
  61. package/components/StructuredText/nodes/Root.svelte +5 -0
  62. package/components/StructuredText/nodes/Root.svelte.d.ts +19 -0
  63. package/components/StructuredText/nodes/Span.svelte +49 -0
  64. package/components/StructuredText/nodes/Span.svelte.d.ts +19 -0
  65. package/components/StructuredText/nodes/ThematicBreak.svelte +5 -0
  66. package/components/StructuredText/nodes/ThematicBreak.svelte.d.ts +17 -0
  67. package/components/StructuredText/utils/Lines.svelte +11 -0
  68. package/components/StructuredText/utils/Lines.svelte.d.ts +16 -0
  69. package/index.d.ts +9 -0
  70. package/index.js +3 -0
  71. package/package.json +61 -0
@@ -0,0 +1,167 @@
1
+ ## Progressive responsive image
2
+
3
+ `<Image>` is a Svelte 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.
4
+
5
+ ### Table of contents
6
+
7
+ - [Out-of-the-box features](#out-of-the-box-features)
8
+ - [Setup](#setup)
9
+ - [Usage](#usage)
10
+ - [Example](#example)
11
+ - [Props](#props)
12
+ - [Layout mode](#layout-mode)
13
+ - [The `ResponsiveImage` object](#the-responsiveimage-object)
14
+
15
+ ### Out-of-the-box features
16
+
17
+ - Offers optimized version of images for browsers that support WebP/AVIF format
18
+ - Generates multiple smaller images so smartphones and tablets don’t download desktop-sized images
19
+ - Efficiently lazy loads images to speed initial page load and save bandwidth
20
+ - Holds the image position so your page doesn’t jump while images load
21
+ - Uses either blur-up or background color techniques to show a preview of the image while it loads
22
+
23
+ ## Intersection Observer
24
+
25
+ Intersection 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.
26
+
27
+ If 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.
28
+
29
+ ### Setup
30
+
31
+ You can import the components like this:
32
+
33
+ ```js
34
+ import { Image } from '@datocms/svelte';
35
+ ```
36
+
37
+ ### Usage
38
+
39
+ 1. Use `<Image>` it in place of the regular `<img />` tag
40
+ 2. 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)
41
+
42
+ The GraphQL query returns multiple thumbnails with optimized compression. The `<Image>` component automatically sets up the "blur-up" effect as well as lazy loading of images further down the screen.
43
+
44
+ ### Example
45
+
46
+ For a fully working example take a look at [`routes` directory](https://github.com/datocms/datocms-svelte/tree/main/src/routes/image/+page.svelte).
47
+
48
+ Here is a minimal starting point:
49
+
50
+ ```svelte
51
+ <script>
52
+
53
+ import { onMount } from 'svelte';
54
+
55
+ import { Image } from '@datocms/svelte';
56
+
57
+ const query = gql`
58
+ query {
59
+ blogPost {
60
+ title
61
+ cover {
62
+ responsiveImage(
63
+ imgixParams: { fit: crop, w: 300, h: 300, auto: format }
64
+ ) {
65
+ # always required
66
+ src
67
+ width
68
+ height
69
+ # not required, but strongly suggested!
70
+ alt
71
+ title
72
+ # blur-up placeholder, JPEG format, base64-encoded, or...
73
+ base64
74
+ # background color placeholder
75
+ bgColor
76
+ # you can omit `sizes` if you explicitly pass the `sizes` prop to the image component
77
+ sizes
78
+ }
79
+ }
80
+ }
81
+ }
82
+ `;
83
+
84
+ export let data = null;
85
+
86
+ onMount(async () => {
87
+ const response = await fetch('https://graphql.datocms.com/', {
88
+ method: 'POST',
89
+ headers: {
90
+ 'Content-Type': 'application/json',
91
+ Authorization: "Bearer faeb9172e232a75339242faafb9e56de8c8f13b735f7090964",
92
+ },
93
+ body: JSON.stringify({ query })
94
+ })
95
+
96
+ const json = await response.json()
97
+
98
+ data = json.data;
99
+ });
100
+
101
+ </script>
102
+
103
+ {#if data}
104
+ <Image data={data.blogPost.cover.responsiveImage} />
105
+ {/if}
106
+ ```
107
+
108
+ ### Props
109
+
110
+ | prop | type | default | required | description |
111
+ | --------------------- | ------------------------------------------------ | ----------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
112
+ | data | `ResponsiveImage` object | | :white_check_mark: | The actual response you get from a DatoCMS `responsiveImage` GraphQL query. |
113
+ | class | string | null | :x: | Additional CSS class of root node |
114
+ | style | CSS properties | null | :x: | Additional CSS rules to add to the root node |
115
+ | pictureClass | string | null | :x: | Additional CSS class for the inner `<picture />` tag |
116
+ | pictureStyle | CSS properties | null | :x: | Additional CSS rules to add to the inner `<picture />` tag |
117
+ | layout | 'intrinsic' \| 'fixed' \| 'responsive' \| 'fill' | "intrinsic" | :x: | The layout behavior of the image as the viewport changes size |
118
+ | fadeInDuration | integer | 500 | :x: | Duration (in ms) of the fade-in transition effect upoad image loading |
119
+ | intersectionThreshold | 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. |
120
+ | intersectionMargin | 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. |
121
+ | lazyLoad | Boolean | true | :x: | Wheter enable lazy loading or not |
122
+ | explicitWidth | Boolean | false | :x: | Wheter the image wrapper should explicitely declare the width of the image or keep it fluid |
123
+ | objectFit | String | null | :x: | Defines how the image will fit into its parent container when using layout="fill" |
124
+ | objectPosition | String | null | :x: | Defines how the image is positioned within its parent element when using layout="fill". |
125
+ | priority | Boolean | false | :x: | Disables lazy loading, and sets the image [fetchPriority](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority) to "high" |
126
+ | srcSetCandidates | Array<number> | [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4] | :x: | If `data` does not contain `srcSet`, the candidates for the `srcset` attribute of the image will be auto-generated based on these width multipliers |
127
+ | sizes | string | undefined | :x: | The HTML5 [`sizes`](https://web.dev/learn/design/responsive-images/#sizes) attribute for the image (will be used `data.sizes` as a fallback) |
128
+ | onLoad | () => void | undefined | :x: | Function triggered when the image has finished loading |
129
+ | usePlaceholder | Boolean | true | :x: | Whether the component should use a blurred image placeholder |
130
+
131
+ #### Layout mode
132
+
133
+ With the `layout` property, you can configure the behavior of the image as the viewport changes size:
134
+
135
+ - When `intrinsic`, the image will scale the dimensions down for smaller viewports, but maintain the original dimensions for larger viewports.
136
+ - When `fixed`, the image dimensions will not change as the viewport changes (no responsiveness) similar to the native `img` element.
137
+ - When `responsive` (default behaviour), the image will scale the dimensions down for smaller viewports and scale up for larger viewports.
138
+ - When `fill`, the image will stretch both width and height to the dimensions of the parent element, provided the parent element is relative.
139
+ - This is usually paired with the `objectFit` and `objectPosition` properties.
140
+ - Ensure the parent element has `position: relative` in their stylesheet.
141
+
142
+ #### The `ResponsiveImage` object
143
+
144
+ The `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.
145
+
146
+ - The minimum required properties for `data` are: `src`, `width` and `height`;
147
+ - `alt` and `title`, while not mandatory, are all highly suggested, so remember to use them!
148
+ - If you don't request `srcSet`, the component will auto-generate an `srcset` based on `src` + the `srcSetCandidates` prop (it can help reducing the GraphQL response size drammatically when many images are returned);
149
+ - We strongly to suggest to always specify [`{ auto: format }`](https://docs.imgix.com/apis/rendering/auto/auto#format) in your `imgixParams`, instead of requesting `webpSrcSet`, so that you can also take advantage of more performant optimizations (AVIF), without increasing GraphQL response size;
150
+ - If you request both the `bgColor` and `base64` property, the latter will take precedence, so just avoid querying both fields at the same time, as it will only make the GraphQL response bigger :wink:;
151
+ - You can avoid requesting `sizes` and directly pass a `sizes` prop to the component to reduce the GraphQL response size;
152
+
153
+ Here's a complete recap of what `responsiveImage` offers:
154
+
155
+ | property | type | required | description |
156
+ | ----------- | ------- | ------------------ | ----------------------------------------------------------------------------------------------- |
157
+ | src | string | :white_check_mark: | The `src` attribute for the image |
158
+ | width | integer | :white_check_mark: | The width of the image |
159
+ | height | integer | :white_check_mark: | The height of the image |
160
+ | alt | string | :x: | Alternate text (`alt`) for the image (not required, but strongly suggested!) |
161
+ | title | string | :x: | Title attribute (`title`) for the image (not required, but strongly suggested!) |
162
+ | sizes | string | :x: | The HTML5 `sizes` attribute for the image (omit it if you're already passing a `sizes` prop to the Image component) |
163
+ | base64 | string | :x: | A base64-encoded thumbnail to offer during image loading |
164
+ | bgColor | string | :x: | The background color for the image placeholder (omit it if you're already requesting `base64`) |
165
+ | srcSet | string | :x: | The HTML5 `srcSet` attribute for the image (can be omitted, the Image component knows how to build it based on `src`) |
166
+ | webpSrcSet | string | :x: | The HTML5 `srcSet` attribute for the image in WebP format (deprecated, it's better to use the [`auto=format`](https://docs.imgix.com/apis/rendering/auto/auto#format) Imgix transform instead) |
167
+ | aspectRatio | float | :x: | The aspect ratio (width/height) of the image |
@@ -0,0 +1,17 @@
1
+ <script>import { encode } from "universal-base64";
2
+ let klass = null;
3
+ export { klass as class };
4
+ export let width;
5
+ export let height;
6
+ export let aspectRatio;
7
+ let svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height ?? (aspectRatio ? width / aspectRatio : 0)}"></svg>`;
8
+ </script>
9
+
10
+ <img
11
+ class={klass}
12
+ style:display="block"
13
+ style:width="100%"
14
+ src="data:image/svg+xml;base64,{encode(svg)}"
15
+ aria-hidden="true"
16
+ alt=""
17
+ />
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ class?: string | null | undefined;
5
+ width: number;
6
+ height: number | null | undefined;
7
+ aspectRatio: number | undefined;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {};
13
+ };
14
+ export type SizerProps = typeof __propDef.props;
15
+ export type SizerEvents = typeof __propDef.events;
16
+ export type SizerSlots = typeof __propDef.slots;
17
+ export default class Sizer extends SvelteComponentTyped<SizerProps, SizerEvents, SizerSlots> {
18
+ }
19
+ export {};
@@ -0,0 +1,6 @@
1
+ <script>export let srcset;
2
+ export let sizes;
3
+ export let type = null;
4
+ </script>
5
+
6
+ <source {srcset} {sizes} {type} />
@@ -0,0 +1,18 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ srcset: string | null;
5
+ sizes: string | null;
6
+ type?: string | null | undefined;
7
+ };
8
+ events: {
9
+ [evt: string]: CustomEvent<any>;
10
+ };
11
+ slots: {};
12
+ };
13
+ export type SourceProps = typeof __propDef.props;
14
+ export type SourceEvents = typeof __propDef.events;
15
+ export type SourceSlots = typeof __propDef.slots;
16
+ export default class Source extends SvelteComponentTyped<SourceProps, SourceEvents, SourceSlots> {
17
+ }
18
+ export {};
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,44 @@
1
+ import { describe, expect, it, vi } from 'vitest';
2
+ import '@testing-library/jest-dom';
3
+ import { act, fireEvent, render, screen } from '@testing-library/svelte';
4
+ import { mockIntersectionObserver } from 'jsdom-testing-mocks';
5
+ import { completeData, minimalData, minimalDataWithRelativeUrl } from './__fixtures__/image';
6
+ import { Image } from '../../..';
7
+ const io = mockIntersectionObserver();
8
+ describe('Image', () => {
9
+ ['intrinsic', 'fixed', 'responsive', 'fill'].forEach((layout) => {
10
+ Object.entries({ completeData, minimalData, minimalDataWithRelativeUrl }).forEach(([name, data]) => {
11
+ describe(`layout=${layout}`, () => {
12
+ describe(`data=${name}`, () => {
13
+ describe("when the component doesn't intersect the viewport", () => {
14
+ it('only renders the placeholder elements ', () => {
15
+ const onLoad = vi.fn();
16
+ const { container, component } = render(Image, { props: { data, layout } });
17
+ component.$on('load', onLoad);
18
+ const picture = screen.queryByTestId('picture');
19
+ expect(picture).not.toBeInTheDocument();
20
+ expect(onLoad).not.toHaveBeenCalled();
21
+ expect(container).toMatchSnapshot();
22
+ });
23
+ });
24
+ describe('when the component intersects the viewport', () => {
25
+ it('shows the image ', async () => {
26
+ const onLoad = vi.fn();
27
+ const { container, component } = render(Image, { props: { data, layout } });
28
+ component.$on('load', onLoad);
29
+ await act(async () => {
30
+ io.enterNode(await screen.findByTestId('image'));
31
+ });
32
+ const picture = screen.getByTestId('picture');
33
+ const img = screen.getByTestId('img');
34
+ fireEvent.load(img);
35
+ expect(picture).toBeInTheDocument();
36
+ expect(onLoad).toHaveBeenCalled();
37
+ expect(container).toMatchSnapshot();
38
+ });
39
+ });
40
+ });
41
+ });
42
+ });
43
+ });
44
+ });
@@ -0,0 +1,40 @@
1
+ export declare const completeData: {
2
+ alt: string;
3
+ aspectRatio: number;
4
+ base64: string;
5
+ height: number;
6
+ sizes: string;
7
+ src: string;
8
+ srcSet: string;
9
+ title: string;
10
+ width: number;
11
+ };
12
+ export declare const minimalData: {
13
+ base64: string;
14
+ height: number;
15
+ src: string;
16
+ width: number;
17
+ };
18
+ export declare const minimalDataWithRelativeUrl: {
19
+ base64: string;
20
+ height: number;
21
+ src: string;
22
+ width: number;
23
+ };
24
+ export declare const completeData2: {
25
+ alt: null;
26
+ base64: string;
27
+ aspectRatio: number;
28
+ height: number;
29
+ sizes: string;
30
+ src: string;
31
+ srcSet: string;
32
+ title: null;
33
+ width: number;
34
+ };
35
+ export declare const minimalData2: {
36
+ base64: string;
37
+ height: number;
38
+ src: string;
39
+ width: number;
40
+ };
@@ -0,0 +1,40 @@
1
+ export const completeData = {
2
+ alt: 'DatoCMS swag',
3
+ aspectRatio: 1.7777777777777777,
4
+ base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICAgLFQoLDhgQDg0NDh0eHREYIx8lJCIrHB0dLSs7GikyKSEuKjUlKDk1MjIyHyo4PTc+PDcxPjUBCgsLDg0OHBAQHDsoIig7Ozs7Ozs7OzsvOzs7Ozs7Ozs7Lzs7Ozs7Ozs7OzsvOzs7NTsvLy87NTU1Ly8vLzsvL//AABEIAA0AGAMBIgACEQEDEQH/xAAYAAACAwAAAAAAAAAAAAAAAAAGBwABBP/EACEQAAEEAAYDAAAAAAAAAAAAAAEAAgMEBQYHESEiFWFx/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwL/xAAZEQADAAMAAAAAAAAAAAAAAAAAAQIRITH/2gAMAwEAAhEDEQA/AFxLgDWTsAd1J5TGy7hEYqNAaNgECX7sjLMQAHJTEy1Zcarfia4lJMauAxqBhLY6ZlaOzDurWvUOd3jZPfCiEh4xs//Z',
5
+ height: 421,
6
+ sizes: '(max-width: 750px) 100vw, 750px',
7
+ src: 'https://www.datocms-assets.com/205/image.png?ar=16%3A9&fit=crop&w=750',
8
+ srcSet: 'https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=0.25&fit=crop&w=750 187w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=0.5&fit=crop&w=750 375w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=0.75&fit=crop&w=750 562w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=1&fit=crop&w=750 750w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=1.5&fit=crop&w=750 1125w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=2&fit=crop&w=750 1500w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=3&fit=crop&w=750 2250w,↵https://www.datocms-assets.com/205/image.png?ar=16%3A9&dpr=4&fit=crop&w=750 3000w',
9
+ title: 'These are awesome, we know that.',
10
+ width: 750
11
+ };
12
+ export const minimalData = {
13
+ base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICAgLFQoLDhgQDg0NDh0eHREYIx8lJCIrHB0dLSs7GikyKSEuKjUlKDk1MjIyHyo4PTc+PDcxPjUBCgsLDg0OHBAQHDsoIig7Ozs7Ozs7OzsvOzs7Ozs7Ozs7Lzs7Ozs7Ozs7OzsvOzs7NTsvLy87NTU1Ly8vLzsvL//AABEIAA0AGAMBIgACEQEDEQH/xAAYAAACAwAAAAAAAAAAAAAAAAAGBwABBP/EACEQAAEEAAYDAAAAAAAAAAAAAAEAAgMEBQYHESEiFWFx/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwL/xAAZEQADAAMAAAAAAAAAAAAAAAAAAQIRITH/2gAMAwEAAhEDEQA/AFxLgDWTsAd1J5TGy7hEYqNAaNgECX7sjLMQAHJTEy1Zcarfia4lJMauAxqBhLY6ZlaOzDurWvUOd3jZPfCiEh4xs//Z',
14
+ height: 421,
15
+ src: 'https://www.datocms-assets.com/205/image.png?ar=16%3A9&fit=crop&w=750',
16
+ width: 750
17
+ };
18
+ export const minimalDataWithRelativeUrl = {
19
+ base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICAgLFQoLDhgQDg0NDh0eHREYIx8lJCIrHB0dLSs7GikyKSEuKjUlKDk1MjIyHyo4PTc+PDcxPjUBCgsLDg0OHBAQHDsoIig7Ozs7Ozs7OzsvOzs7Ozs7Ozs7Lzs7Ozs7Ozs7OzsvOzs7NTsvLy87NTU1Ly8vLzsvL//AABEIAA0AGAMBIgACEQEDEQH/xAAYAAACAwAAAAAAAAAAAAAAAAAGBwABBP/EACEQAAEEAAYDAAAAAAAAAAAAAAEAAgMEBQYHESEiFWFx/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwL/xAAZEQADAAMAAAAAAAAAAAAAAAAAAQIRITH/2gAMAwEAAhEDEQA/AFxLgDWTsAd1J5TGy7hEYqNAaNgECX7sjLMQAHJTEy1Zcarfia4lJMauAxqBhLY6ZlaOzDurWvUOd3jZPfCiEh4xs//Z',
20
+ height: 421,
21
+ src: '/205/image.png?ar=16%3A9&fit=crop&w=750',
22
+ width: 750
23
+ };
24
+ export const completeData2 = {
25
+ alt: null,
26
+ base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoIFAgLChEXDg0VDg0NGRUVDREVFxMZHRYVFiEaHysjGh0oHRUWJDUlKC0vMjIyHSI4PTcwPCsxMi8BCgsLDg0OFRAQHC8cIigvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL//AABEIABAAGAMBIgACEQEDEQH/xAAYAAACAwAAAAAAAAAAAAAAAAAABQEDBv/EAB0QAAEEAgMAAAAAAAAAAAAAAAQAAQIDETEFEhP/xAAVAQEBAAAAAAAAAAAAAAAAAAACAf/EABoRAAICAwAAAAAAAAAAAAAAAAABAgMSEzH/2gAMAwEAAhEDEQA/AN2QdCbbVNRUYvtJOXukFX2yo4Ilz3zlVzZFTHrHt17WMhBA3lDKEc5C1Vn/2Q==',
27
+ aspectRatio: 1.5,
28
+ height: 3456,
29
+ sizes: '(max-width: 5184px) 100vw, 5184px',
30
+ src: 'https://www.datocms-assets.com/23796/1612503468-jairph-ypl0a8v9qgo-unsplash.jpg',
31
+ srcSet: 'https://www.datocms-assets.com/23796/1612503468-jairph-ypl0a8v9qgo-unsplash.jpg?dpr=0.25 1296w,https://www.datocms-assets.com/23796/1612503468-jairph-ypl0a8v9qgo-unsplash.jpg?dpr=0.5 2592w,https://www.datocms-assets.com/23796/1612503468-jairph-ypl0a8v9qgo-unsplash.jpg?dpr=0.75 3888w,https://www.datocms-assets.com/23796/1612503468-jairph-ypl0a8v9qgo-unsplash.jpg 5184w',
32
+ title: null,
33
+ width: 5184
34
+ };
35
+ export const minimalData2 = {
36
+ base64: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICBELERULDg8VDg0NDxUOFhEPFxgrGRYfFiEaHysjJh0oKRcWJDUxKC0vMjIyGSI4PTcwPCsxMi8BCgsLDg0OHBAQHDslIig7Ozs7NTs7Ly81Lzw7Ozs7Ly8vLy8vLy8vLy8vLy8vLy8vLy8vLy81Ly8vLy8vLy8vL//AABEIABgAGAMBIgACEQEDEQH/xAAaAAACAgMAAAAAAAAAAAAAAAAABQEHAwQG/8QAHxAAAgEEAgMAAAAAAAAAAAAAAAEDAgQFEVFxEiFB/8QAFQEBAQAAAAAAAAAAAAAAAAAAAwT/xAAbEQEAAgMBAQAAAAAAAAAAAAABAAIREiETA//aAAwDAQACEQMRAD8Ap1LdQ/sIW4kJKqfCVHT41JwroNztH4kUZdOOjtgbGfibjTXxgKNoCA8ii79NMe4m43Et8EAM1G8mtdr8xJmv0pVokAH1JB6WXM//2Q==',
37
+ height: 1994,
38
+ src: 'https://www.datocms-assets.com/23796/1583844698-gift-habeshaw-pgxxjrtfnjq-unsplash-edited.png',
39
+ width: 1994
40
+ };