@datocms/svelte 4.2.0 → 4.2.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.
@@ -27,6 +27,7 @@ export let usePlaceholder = true;
27
27
  export let sizes = null;
28
28
  export let priority = false;
29
29
  export let srcSetCandidates = [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4];
30
+ export let referrerPolicy = "no-referrer-when-downgrade";
30
31
  const dispatch = createEventDispatcher();
31
32
  let rootEl;
32
33
  let inView = false;
@@ -153,6 +154,7 @@ $:
153
154
  'object-position': objectPosition,
154
155
  ...parseStyleAttributes(imgStyle)
155
156
  })}
157
+ referrerpolicy={referrerPolicy}
156
158
  data-testid="img"
157
159
  />
158
160
  {/if}
@@ -45,6 +45,12 @@ declare const __propDef: {
45
45
  *
46
46
  * Default candidate multipliers are [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
47
47
  **/ srcSetCandidates?: number[] | undefined;
48
+ /**
49
+ * Defines which referrer is sent when fetching the image
50
+ * Read more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#referrerpolicy
51
+ *
52
+ * Defaults to `no-referrer-when-downgrade` to give more useful stats in DatoCMS Project Usages
53
+ **/ referrerPolicy?: ReferrerPolicy | undefined;
48
54
  };
49
55
  events: {
50
56
  load: CustomEvent<any>;
@@ -19,7 +19,6 @@
19
19
  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
20
20
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
21
21
 
22
- - [Setup](#setup)
23
22
  - [Usage](#usage)
24
23
  - [`<Image />` vs `<NakedImage />`](#image--vs-nakedimage-)
25
24
  - [Example](#example)
@@ -164,6 +163,7 @@ Here's a complete recap of what `responsiveImage` offers:
164
163
  | 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) |
165
164
  | usePlaceholder | Boolean | true | :x: | Whether the image should use a blurred image placeholder |
166
165
  | 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 |
166
+ | referrerPolicy | string | `no-referrer-when-downgrade` | :x: | Defines which referrer is sent when fetching the image. Defaults to `no-referrer-when-downgrade` to give more useful stats in DatoCMS Project Usages |
167
167
 
168
168
  ### Events
169
169
 
@@ -197,6 +197,7 @@ Here's a complete recap of what `responsiveImage` offers:
197
197
  | 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) |
198
198
  | onLoad | () => void | undefined | :x: | Function triggered when the image has finished loading |
199
199
  | usePlaceholder | Boolean | true | :x: | Whether the component should use a blurred image placeholder |
200
+ | referrerPolicy | string | `no-referrer-when-downgrade` | :x: | Defines which referrer is sent when fetching the image. Defaults to `no-referrer-when-downgrade` to give more useful stats in DatoCMS Project Usages |
200
201
 
201
202
  ### Events
202
203
 
@@ -14,6 +14,7 @@ export let usePlaceholder = true;
14
14
  export let sizes = null;
15
15
  export let priority = false;
16
16
  export let srcSetCandidates = [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4];
17
+ export let referrerPolicy = "no-referrer-when-downgrade";
17
18
  const dispatch = createEventDispatcher();
18
19
  let loaded = false;
19
20
  let placeholderStyle;
@@ -66,6 +67,7 @@ $:
66
67
  ...sizingStyle,
67
68
  ...parseStyleAttributes(imgStyle)
68
69
  })}
70
+ referrerpolicy={referrerPolicy}
69
71
  data-testid="img"
70
72
  />
71
73
  {/if}
@@ -25,6 +25,12 @@ declare const __propDef: {
25
25
  *
26
26
  * Default candidate multipliers are [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
27
27
  **/ srcSetCandidates?: number[] | undefined;
28
+ /**
29
+ * Defines which referrer is sent when fetching the image
30
+ * Read more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#referrerpolicy
31
+ *
32
+ * Defaults to `no-referrer-when-downgrade` to give more useful stats in DatoCMS Project Usages
33
+ **/ referrerPolicy?: ReferrerPolicy | undefined;
28
34
  };
29
35
  events: {
30
36
  load: CustomEvent<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datocms/svelte",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "A set of components and utilities to work faster with DatoCMS in Svelte",
5
5
  "license": "MIT",
6
6
  "repository": {