@coras-io/embed 0.9.0 → 0.11.0

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 (51) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +1 -0
  3. package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +9 -2
  4. package/dist/components/image/image.component.d.ts +3 -0
  5. package/dist/components/image/image.component.js +6 -0
  6. package/dist/components/locations-results/locations-results.component.d.ts +2 -0
  7. package/dist/components/locations-results/locations-results.component.js +11 -0
  8. package/dist/core/events.d.ts +1 -0
  9. package/dist/core/types/api-schema.d.ts +2 -0
  10. package/dist/locales/ar-SA.d.ts +1 -0
  11. package/dist/locales/ar-SA.js +1 -0
  12. package/dist/locales/da-DK.d.ts +1 -0
  13. package/dist/locales/da-DK.js +1 -0
  14. package/dist/locales/de-DE.d.ts +1 -0
  15. package/dist/locales/de-DE.js +1 -0
  16. package/dist/locales/en-IE.d.ts +1 -0
  17. package/dist/locales/en-IE.js +1 -0
  18. package/dist/locales/en-US.d.ts +1 -0
  19. package/dist/locales/en-US.js +1 -0
  20. package/dist/locales/es-ES.d.ts +1 -0
  21. package/dist/locales/es-ES.js +1 -0
  22. package/dist/locales/fr-FR.d.ts +1 -0
  23. package/dist/locales/fr-FR.js +1 -0
  24. package/dist/locales/fr-MA.d.ts +1 -0
  25. package/dist/locales/fr-MA.js +1 -0
  26. package/dist/locales/is-IS.d.ts +1 -0
  27. package/dist/locales/is-IS.js +1 -0
  28. package/dist/locales/it-IT.d.ts +1 -0
  29. package/dist/locales/it-IT.js +1 -0
  30. package/dist/locales/ms-MY.d.ts +1 -0
  31. package/dist/locales/ms-MY.js +1 -0
  32. package/dist/locales/nb-NO.d.ts +1 -0
  33. package/dist/locales/nb-NO.js +1 -0
  34. package/dist/locales/pl-PL.d.ts +1 -0
  35. package/dist/locales/pl-PL.js +1 -0
  36. package/dist/locales/pt-PT.d.ts +1 -0
  37. package/dist/locales/pt-PT.js +1 -0
  38. package/dist/locales/sv-SE.d.ts +1 -0
  39. package/dist/locales/sv-SE.js +1 -0
  40. package/dist/locales/th-TH.d.ts +1 -0
  41. package/dist/locales/th-TH.js +1 -0
  42. package/dist/locales/tr-TR.d.ts +1 -0
  43. package/dist/locales/tr-TR.js +1 -0
  44. package/dist/locales/zh-CN.d.ts +1 -0
  45. package/dist/locales/zh-CN.js +1 -0
  46. package/dist/locales/zh-HK.d.ts +1 -0
  47. package/dist/locales/zh-HK.js +1 -0
  48. package/dist/mixins/location-search/location-search.js +74 -3
  49. package/dist/views/details-page/details-page.component.js +5 -2
  50. package/dist/views/details-page/details-page.styles.js +3 -0
  51. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @coras-io/embed
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3686a85: Load the first image of the details page at once and ahead of the other images, so the page's main image shows sooner. `coras-image` takes a new `fetch-priority` attribute for this
8
+
9
+ ### Patch Changes
10
+
11
+ - 3686a85: Make breadcrumb items real items of the breadcrumb list for screen readers
12
+ - 3686a85: Stop the footer from jumping while the details page loads: the loading skeleton now fills the screen, as the loaded page does
13
+
14
+ ## 0.10.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 2f0d761: Open the location search on a country or city page with that country and its top cities, and add an "All locations" option next to "Near me"
19
+
3
20
  ## 0.9.0
4
21
 
5
22
  ### Minor Changes
@@ -2,5 +2,6 @@ import { type CSSResultGroup, LitElement } from "lit";
2
2
  export declare class CorasBreadcrumbItem extends LitElement {
3
3
  static styles: CSSResultGroup;
4
4
  clickable: boolean;
5
+ connectedCallback(): void;
5
6
  render(): import("lit").TemplateResult<1>;
6
7
  }
@@ -13,13 +13,20 @@ export class CorasBreadcrumbItem extends LitElement {
13
13
  this.clickable = false;
14
14
  }
15
15
  static { this.styles = styles; }
16
+ // The list item is the host: an <li> inside this shadow root would not be a
17
+ // child of the list that <coras-breadcrumbs> renders.
18
+ connectedCallback() {
19
+ super.connectedCallback();
20
+ if (!this.hasAttribute("role"))
21
+ this.setAttribute("role", "listitem");
22
+ }
16
23
  render() {
17
24
  return html `
18
- <li part="base" class="breadcrumb-item">
25
+ <div part="base" class="breadcrumb-item">
19
26
  ${this.clickable
20
27
  ? html `<button type="button" class="link"><slot></slot></button>`
21
28
  : html `<span aria-current="page"><slot></slot></span>`}
22
- </li>
29
+ </div>
23
30
  `;
24
31
  }
25
32
  }
@@ -2,6 +2,7 @@ import { type CSSResultGroup, LitElement, nothing } from "lit";
2
2
  import { type ImagePreset } from "../../core/images/srcset.js";
3
3
  import { type ImgixCrop } from "../../core/images/url.js";
4
4
  type Loading = "lazy" | "eager";
5
+ type FetchPriority = "high" | "low" | "auto";
5
6
  type Decoding = "async" | "sync" | "auto";
6
7
  type Fit = "cover" | "contain";
7
8
  type Placeholder = "skeleton" | "color" | "none";
@@ -34,6 +35,8 @@ export declare class CorasImage extends LitElement {
34
35
  height: number;
35
36
  alt: string;
36
37
  loading: Loading;
38
+ /** Set to `high` on the one image that is the page's main content. */
39
+ fetchPriority: FetchPriority;
37
40
  decoding: Decoding;
38
41
  fit: Fit;
39
42
  placeholder: Placeholder;
@@ -41,6 +41,8 @@ export class CorasImage extends LitElement {
41
41
  this.height = 0;
42
42
  this.alt = "";
43
43
  this.loading = "lazy";
44
+ /** Set to `high` on the one image that is the page's main content. */
45
+ this.fetchPriority = "auto";
44
46
  this.decoding = "async";
45
47
  this.fit = "cover";
46
48
  this.placeholder = "skeleton";
@@ -188,6 +190,7 @@ export class CorasImage extends LitElement {
188
190
  height=${this.height || nothing}
189
191
  alt=${this.alt}
190
192
  loading=${this.loading}
193
+ fetchpriority=${this.fetchPriority}
191
194
  decoding=${this.decoding}
192
195
  @load=${this.handleLoad}
193
196
  @error=${this.handleError}
@@ -252,6 +255,9 @@ __decorate([
252
255
  __decorate([
253
256
  property({ type: String })
254
257
  ], CorasImage.prototype, "loading", void 0);
258
+ __decorate([
259
+ property({ type: String, attribute: "fetch-priority" })
260
+ ], CorasImage.prototype, "fetchPriority", void 0);
255
261
  __decorate([
256
262
  property({ type: String })
257
263
  ], CorasImage.prototype, "decoding", void 0);
@@ -9,6 +9,7 @@ export interface GeolocationFailedEventDetail {
9
9
  code: number;
10
10
  }
11
11
  /**
12
+ * @fires all-locations-selected - When "All locations" is chosen
12
13
  * @fires geolocation-selected - The device position when "Near me" succeeds
13
14
  * @fires geolocation-failed - Detail `{ code }` when the position is denied or unavailable
14
15
  */
@@ -18,6 +19,7 @@ export declare class CorasLocationsResults extends LitElement {
18
19
  items: components["schemas"]["LocationSchema"][];
19
20
  private near;
20
21
  private reportGeolocationFailure;
22
+ private selectAllLocations;
21
23
  private renderPopular;
22
24
  render(): TemplateResult<1>;
23
25
  }
@@ -15,6 +15,7 @@ import "../select-list/select-option/select-option.js";
15
15
  /** Browsers without the Geolocation API get a code outside the spec's 1-3. */
16
16
  export const GEOLOCATION_UNSUPPORTED_CODE = 0;
17
17
  /**
18
+ * @fires all-locations-selected - When "All locations" is chosen
18
19
  * @fires geolocation-selected - The device position when "Near me" succeeds
19
20
  * @fires geolocation-failed - Detail `{ code }` when the position is denied or unavailable
20
21
  */
@@ -41,6 +42,9 @@ let CorasLocationsResults = class CorasLocationsResults extends LitElement {
41
42
  reportGeolocationFailure(code) {
42
43
  fireInternalEvent(this, "geolocation-failed", { code });
43
44
  }
45
+ selectAllLocations() {
46
+ fireInternalEvent(this, "all-locations-selected", {});
47
+ }
44
48
  renderPopular() {
45
49
  return html `
46
50
  <div class="popular">
@@ -49,6 +53,13 @@ let CorasLocationsResults = class CorasLocationsResults extends LitElement {
49
53
  <button type="button" class="near-me" @click=${this.near}>
50
54
  ${msg("Near me")}
51
55
  </button>
56
+ <button
57
+ type="button"
58
+ class="near-me"
59
+ @click=${this.selectAllLocations}
60
+ >
61
+ ${msg("All locations")}
62
+ </button>
52
63
  </div>
53
64
  </div>
54
65
  `;
@@ -119,6 +119,7 @@ export interface InternalEventMap {
119
119
  "seats-confirmed": SeatsConfirmedEventDetail;
120
120
  "geolocation-selected": GeolocationSelectedEventDetail;
121
121
  "geolocation-failed": GeolocationFailedEventDetail;
122
+ "all-locations-selected": Record<string, never>;
122
123
  "tab-changed": TabChangeEventDetail;
123
124
  "chip-removed": Record<string, never>;
124
125
  "coras-image-load": Record<string, never>;
@@ -7386,6 +7386,8 @@ export interface operations {
7386
7386
  latitude?: number | null;
7387
7387
  /** @description Longitude for location search (optional) */
7388
7388
  longitude?: number | null;
7389
+ /** @description Country slug. Returns that country followed by its cities with the most attractions. Cannot be combined with query or coordinates. */
7390
+ country?: string | null;
7389
7391
  };
7390
7392
  header: {
7391
7393
  /** @description Content type of the request body */
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `البحث عن الفعاليات`,
259
259
  'sffdadf0a576fd802': `ارتفاع`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Søg efter begivenheder`,
259
259
  'sffdadf0a576fd802': `Højde`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Ereignisse suchen`,
259
259
  'sffdadf0a576fd802': `Höhe`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Search events`,
259
259
  'sffdadf0a576fd802': `Height`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Search events`,
259
259
  'sffdadf0a576fd802': `Height`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Buscar eventos`,
259
259
  'sffdadf0a576fd802': `Altura`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Rechercher des événements`,
259
259
  'sffdadf0a576fd802': `Hauteur`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Rechercher des événements`,
259
259
  'sffdadf0a576fd802': `Hauteur`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Leita að viðburðum`,
259
259
  'sffdadf0a576fd802': `Hæð`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Cerca eventi`,
259
259
  'sffdadf0a576fd802': `Altezza`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Cari acara`,
259
259
  'sffdadf0a576fd802': `Ketinggian`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Søk etter hendelser`,
259
259
  'sffdadf0a576fd802': `Høyde`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Wyszukaj wydarzenia`,
259
259
  'sffdadf0a576fd802': `Wysokość`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Pesquisar eventos`,
259
259
  'sffdadf0a576fd802': `Altura`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Sök händelser`,
259
259
  'sffdadf0a576fd802': `Höjd`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `ค้นหาเหตุการณ์`,
259
259
  'sffdadf0a576fd802': `ความสูง`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `Olayları ara`,
259
259
  'sffdadf0a576fd802': `Yükseklik`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `搜索事件`,
259
259
  'sffdadf0a576fd802': `高度`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -252,6 +252,7 @@ export declare const templates: {
252
252
  sfd25dcb1e3a468be: string;
253
253
  sffdadf0a576fd802: string;
254
254
  s8ffdc67bd6500a2f: string;
255
+ sfe5857d2790cdd68: string;
255
256
  s43d13a9f9be37bd6: import("@lit/localize").StrResult;
256
257
  sb4f1dffbb6be6302: string;
257
258
  scd0ddab5a7a0f930: string;
@@ -258,6 +258,7 @@ export const templates = {
258
258
  'sfd25dcb1e3a468be': `搜尋事件`,
259
259
  'sffdadf0a576fd802': `高度`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
+ 'sfe5857d2790cdd68': `All locations`,
261
262
  's43d13a9f9be37bd6': str `All ${0} locations`,
262
263
  'sb4f1dffbb6be6302': `Clear`,
263
264
  'scd0ddab5a7a0f930': `Drawer`,
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { html, } from "lit";
7
+ import { html, nothing, } from "lit";
8
8
  import { property, state } from "lit/decorators.js";
9
9
  import { classMap } from "lit/directives/class-map.js";
10
10
  import { ifDefined } from "lit/directives/if-defined.js";
@@ -21,6 +21,7 @@ import { APIError } from "../../core/api/api-error.js";
21
21
  import { getApiLanguageCode } from "../../core/utils/locale.js";
22
22
  import { getRecentlySelectedSearches } from "../../containers/navbar/navbar.utils.js";
23
23
  const RECENT_LOCATIONS_LIMIT = 5;
24
+ const SEARCH_RESULTS_LIMIT = 11;
24
25
  function findSingleLocationMatch(results) {
25
26
  const [first, ...rest] = results ?? [];
26
27
  if (rest.length === 0) {
@@ -47,6 +48,7 @@ export const LocationSearchMixin = (superClass) => {
47
48
  this.cachedPopularLocations = null;
48
49
  this.selectedLocation = null;
49
50
  this.locationsData = null;
51
+ this.countryLocationsCache = new Map();
50
52
  this.handleFieldFocus = () => {
51
53
  this.isFieldFocused = true;
52
54
  };
@@ -73,6 +75,7 @@ export const LocationSearchMixin = (superClass) => {
73
75
  };
74
76
  if (query) {
75
77
  searchParams.query = query;
78
+ searchParams.size = SEARCH_RESULTS_LIMIT;
76
79
  }
77
80
  else if (latitude != null && longitude != null) {
78
81
  searchParams.latitude = Number(latitude);
@@ -98,6 +101,44 @@ export const LocationSearchMixin = (superClass) => {
98
101
  this.isLocationsDropdownOpen,
99
102
  ],
100
103
  });
104
+ this.countryLocationsTask = new Task(this, {
105
+ task: async ([locale, countrySlug, isDropdownOpen]) => {
106
+ if (!isDropdownOpen || !countrySlug) {
107
+ return [];
108
+ }
109
+ const cacheKey = `${locale}:${countrySlug}`;
110
+ const cached = this.countryLocationsCache.get(cacheKey);
111
+ if (cached) {
112
+ return cached;
113
+ }
114
+ try {
115
+ const { data } = await apiGet({
116
+ client: this.client,
117
+ distributorID: this.distributorID,
118
+ locale,
119
+ endpoint: "/{api_version}/locations/search",
120
+ query: {
121
+ language_code: getApiLanguageCode(locale),
122
+ country: countrySlug,
123
+ },
124
+ });
125
+ const countryLocations = data?.results ?? [];
126
+ this.countryLocationsCache.set(cacheKey, countryLocations);
127
+ return countryLocations;
128
+ }
129
+ catch (error) {
130
+ if (error instanceof APIError) {
131
+ return [];
132
+ }
133
+ throw error;
134
+ }
135
+ },
136
+ args: () => [
137
+ this.locale,
138
+ this.pageCountrySlug,
139
+ this.isLocationsDropdownOpen,
140
+ ],
141
+ });
101
142
  this.throttledLocationSearch = debounce({ delay: 200 }, (event) => this.handleLocationSearch(event));
102
143
  this.handleLocationSearch = (event) => {
103
144
  this.locationSearchTerm = event.detail.value;
@@ -129,6 +170,13 @@ export const LocationSearchMixin = (superClass) => {
129
170
  });
130
171
  this.isLocationsDropdownOpen = false;
131
172
  };
173
+ this.handleAllLocationsSelected = () => {
174
+ this.selectedLocation = null;
175
+ this.locationSearchTerm = "";
176
+ this.locationNamePlaceholder = "";
177
+ this.dispatchPageUpdate({ city: "", country: "" });
178
+ this.isLocationsDropdownOpen = false;
179
+ };
132
180
  this.handleRecentLocationSelected = (item) => {
133
181
  this.selectedLocation = null;
134
182
  this.locationSearchTerm = "";
@@ -155,6 +203,18 @@ export const LocationSearchMixin = (superClass) => {
155
203
  };
156
204
  }
157
205
  static { this.styles = styles; }
206
+ get pageCountrySlug() {
207
+ if (this.country) {
208
+ return this.country;
209
+ }
210
+ if (!this.city) {
211
+ return "";
212
+ }
213
+ const cityCountry = (this.locationsData ?? [])
214
+ .flatMap((continent) => continent.countries ?? [])
215
+ .find((country) => country?.cities?.some((city) => city?.slug === this.city));
216
+ return cityCountry?.slug ?? "";
217
+ }
158
218
  toggleLocationsDropdown() {
159
219
  if (!this.isLocationsDropdownOpen) {
160
220
  this.isLocationsDropdownOpen = true;
@@ -206,11 +266,21 @@ export const LocationSearchMixin = (superClass) => {
206
266
  if ((response.results?.length ?? 0) > 0) {
207
267
  return this.renderLocationOptions(response.results);
208
268
  }
269
+ const countryLocations = this.countryLocationsTask.value ?? [];
270
+ const isListedAbove = (item) => (item.type === "city" && item.value === this.city) ||
271
+ countryLocations.some((location) => location.location_type === item.type &&
272
+ location.slug === item.value);
209
273
  const recentLocations = getRecentlySelectedSearches()
210
274
  .filter((item) => item.type === "city" || item.type === "country")
275
+ .filter((item) => !isListedAbove(item))
211
276
  .slice(0, RECENT_LOCATIONS_LIMIT);
212
- if (recentLocations.length > 0) {
213
- return this.renderRecentLocations(recentLocations);
277
+ if (countryLocations.length > 0 || recentLocations.length > 0) {
278
+ return html `
279
+ ${this.renderLocationOptions(countryLocations)}
280
+ ${recentLocations.length > 0
281
+ ? this.renderRecentLocations(recentLocations)
282
+ : nothing}
283
+ `;
214
284
  }
215
285
  const popular = response.popular ?? [];
216
286
  if (popular.length === 0) {
@@ -332,6 +402,7 @@ export const LocationSearchMixin = (superClass) => {
332
402
  ></coras-icon>
333
403
  </coras-field>
334
404
  <coras-locations-results
405
+ @all-locations-selected=${this.handleAllLocationsSelected}
335
406
  @geolocation-selected=${this.handleGeolocationSelected}
336
407
  @geolocation-failed=${this.handleGeolocationFailed}
337
408
  >
@@ -431,14 +431,17 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(BaseMixin(
431
431
  if (!images) {
432
432
  return html ``;
433
433
  }
434
- return html `${map(images, (image) => html `
434
+ // The first image is the page's largest content, so it loads at once and
435
+ // ahead of the other images. The rest wait until the carousel shows them.
436
+ return html `${map(images, (image, index) => html `
435
437
  <coras-better-carousel-item>
436
438
  <coras-image
437
439
  src=${image.url}
438
440
  width=${IMAGE_CAROUSEL_WIDTH}
439
441
  height=${IMAGE_CAROUSEL_HEIGHT}
440
442
  preset="carousel-hero"
441
- loading="lazy"
443
+ loading=${index === 0 ? "eager" : "lazy"}
444
+ fetch-priority=${index === 0 ? "high" : "auto"}
442
445
  alt=""
443
446
  ></coras-image>
444
447
  </coras-better-carousel-item>
@@ -10,6 +10,9 @@ export default css `
10
10
  display: flex;
11
11
  flex-direction: column;
12
12
  gap: 1.75rem;
13
+ /* The loaded page is taller than the screen. Without this the footer
14
+ shows under the short skeleton and jumps away when the content comes. */
15
+ min-height: 100dvh;
13
16
 
14
17
  .sk-breadcrumb {
15
18
  width: 14rem;
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
23
- "version": "0.9.0",
23
+ "version": "0.11.0",
24
24
  "private": false,
25
25
  "homepage": "https://docs.coras.io",
26
26
  "bugs": {