@coras-io/embed 0.6.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @coras-io/embed
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - eccd52d: Crop the destination banner to the width it actually renders at, so its edges are no longer trimmed
8
+
3
9
  ## 0.6.0
4
10
 
5
11
  ### Minor Changes
@@ -9,10 +9,10 @@ export declare class CorasLocationImage extends LitElement {
9
9
  imageExtension: string;
10
10
  alt: string;
11
11
  /**
12
- * Intrinsic size of the banner. Kept in sync with the rendered box
13
- * (`--location-image-max-width` / `--location-image-height`) so imgix crops
14
- * to the ratio that is actually displayed and `object-fit` has nothing left
15
- * to trim.
12
+ * Intrinsic size of the banner, matching the box it actually renders in:
13
+ * `--coras-page-max-width` less `--coras-content-padding` by
14
+ * `--location-image-height`. imgix then crops to the ratio that is
15
+ * displayed and `object-fit` has nothing left to trim.
16
16
  */
17
17
  width: number;
18
18
  height: number;
@@ -15,7 +15,7 @@ import styles from "./location-image.styles.js";
15
15
  * assets (1160px) - wider candidates only make imgix upscale the same pixels
16
16
  * and ship more bytes for no extra detail.
17
17
  */
18
- const BANNER_WIDTHS = "480,640,768,952,1160";
18
+ const BANNER_WIDTHS = "480,640,768,918,1160";
19
19
  let CorasLocationImage = class CorasLocationImage extends LitElement {
20
20
  constructor() {
21
21
  super(...arguments);
@@ -25,12 +25,12 @@ let CorasLocationImage = class CorasLocationImage extends LitElement {
25
25
  this.imageExtension = "png";
26
26
  this.alt = msg("Location image");
27
27
  /**
28
- * Intrinsic size of the banner. Kept in sync with the rendered box
29
- * (`--location-image-max-width` / `--location-image-height`) so imgix crops
30
- * to the ratio that is actually displayed and `object-fit` has nothing left
31
- * to trim.
28
+ * Intrinsic size of the banner, matching the box it actually renders in:
29
+ * `--coras-page-max-width` less `--coras-content-padding` by
30
+ * `--location-image-height`. imgix then crops to the ratio that is
31
+ * displayed and `object-fit` has nothing left to trim.
32
32
  */
33
- this.width = 952;
33
+ this.width = 918;
34
34
  this.height = 148;
35
35
  this.loading = false;
36
36
  this.currentSrc = "";
@@ -38,14 +38,14 @@ export function buildSrcset(src, widths = RESPONSIVE_WIDTHS, options = {}) {
38
38
  * - `carousel-hero` - better-carousel item on the details page
39
39
  * - `gallery` - image-carousel item (legacy 780px hero)
40
40
  * - `thumbnail` - basket-item, tour-ticket-type thumbs
41
- * - `header-banner` - location-image banner, capped at 952px by its own CSS
41
+ * - `header-banner` - location-image banner, 918px of page content width
42
42
  */
43
43
  const SIZES_PRESETS = {
44
44
  "card-grid": "(min-width: 1001px) 25vw, (min-width: 501px) 50vw, 100vw",
45
45
  "carousel-hero": "(min-width: 1024px) 480px, 90vw",
46
46
  gallery: "(min-width: 1024px) 780px, 100vw",
47
47
  thumbnail: "70px",
48
- "header-banner": "952px",
48
+ "header-banner": "918px",
49
49
  };
50
50
  export function buildSizes(preset) {
51
51
  return SIZES_PRESETS[preset];
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
23
- "version": "0.6.0",
23
+ "version": "0.6.1",
24
24
  "private": false,
25
25
  "homepage": "https://docs.coras.io",
26
26
  "bugs": {