@coras-io/embed 0.11.0 → 0.13.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.
- package/CHANGELOG.md +21 -0
- package/README.md +18 -8
- package/dist/components/attraction-card/base/attraction-card.mixin.js +17 -0
- package/dist/components/attraction-card/base/attraction-card.styles.js +10 -0
- package/dist/components/attraction-card/base/attraction-card.types.d.ts +2 -0
- package/dist/components/attraction-card/long/attraction-long-card.component.js +4 -2
- package/dist/components/attraction-card/short/attraction-short-card.component.d.ts +2 -0
- package/dist/components/attraction-card/short/attraction-short-card.component.js +16 -4
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +5 -0
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +16 -3
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.js +3 -1
- package/dist/components/button/button.component.d.ts +6 -0
- package/dist/components/button/button.component.js +31 -8
- package/dist/components/button/button.styles.js +8 -1
- package/dist/components/image/image.component.d.ts +12 -0
- package/dist/components/image/image.component.js +49 -6
- package/dist/components/text-section/text-section.component.js +1 -1
- package/dist/components/text-section/text-section.styles.js +1 -1
- package/dist/containers/footer/footer.component.d.ts +2 -0
- package/dist/containers/footer/footer.component.js +29 -22
- package/dist/containers/navbar/navbar.component.d.ts +3 -0
- package/dist/containers/navbar/navbar.component.js +33 -10
- package/dist/contexts/events.context.d.ts +8 -0
- package/dist/contexts/events.context.js +6 -0
- package/dist/core/images/srcset.d.ts +16 -0
- package/dist/core/images/srcset.js +21 -0
- package/dist/core/images/url.d.ts +1 -0
- package/dist/core/images/url.js +3 -1
- package/dist/core/utils/link-click.d.ts +8 -0
- package/dist/core/utils/link-click.js +20 -0
- package/dist/index.d.ts +1 -1
- package/dist/mixins/base.mixin.d.ts +3 -0
- package/dist/mixins/base.mixin.js +29 -1
- package/dist/sdk/mount.js +1 -0
- package/dist/sdk/types.d.ts +12 -0
- package/dist/sdk/url.d.ts +44 -2
- package/dist/sdk/url.js +54 -6
- package/dist/views/chrome-only-page/chrome-only-page.component.d.ts +2 -0
- package/dist/views/details-page/details-page.component.d.ts +4 -1
- package/dist/views/details-page/details-page.component.js +22 -41
- package/dist/views/details-page/partials/location-categories/location-categories.component.d.ts +2 -1
- package/dist/views/details-page/partials/location-categories/location-categories.component.js +18 -5
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.d.ts +2 -1
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.js +12 -5
- package/dist/views/help-page/help-page.component.d.ts +2 -0
- package/dist/views/landing-page/landing-page.component.d.ts +4 -1
- package/dist/views/landing-page/landing-page.component.js +21 -16
- package/dist/views/payment-page/partials/confirmation/confirmation.component.d.ts +2 -0
- package/dist/views/payment-page/partials/confirmation/confirmation.component.js +26 -6
- package/dist/views/payment-page/partials/confirmation/confirmation.styles.js +4 -0
- package/dist/views/payment-page/payment-page.component.d.ts +2 -0
- package/dist/views/search-page/search-page.component.d.ts +5 -2
- package/dist/views/search-page/search-page.component.js +41 -48
- package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +6 -3
- package/dist/views/suggestion-widget/suggestion-widget.component.js +18 -8
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ import { state, property } from "lit/decorators.js";
|
|
|
11
11
|
import { Task, TaskStatus } from "@lit/task";
|
|
12
12
|
import { localized, msg, str } from "@lit/localize";
|
|
13
13
|
import { classMap } from "lit/directives/class-map.js";
|
|
14
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
14
15
|
import { fireEvent } from "../../core/events.js";
|
|
15
16
|
import { map } from "lit/directives/map.js";
|
|
16
17
|
import { consume } from "@lit/context";
|
|
@@ -439,6 +440,8 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(BaseMixin(
|
|
|
439
440
|
src=${image.url}
|
|
440
441
|
width=${IMAGE_CAROUSEL_WIDTH}
|
|
441
442
|
height=${IMAGE_CAROUSEL_HEIGHT}
|
|
443
|
+
source-width=${image.width ?? nothing}
|
|
444
|
+
source-height=${image.height ?? nothing}
|
|
442
445
|
preset="carousel-hero"
|
|
443
446
|
loading=${index === 0 ? "eager" : "lazy"}
|
|
444
447
|
fetch-priority=${index === 0 ? "high" : "auto"}
|
|
@@ -1383,50 +1386,28 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(BaseMixin(
|
|
|
1383
1386
|
if (!summary)
|
|
1384
1387
|
return nothing;
|
|
1385
1388
|
const { cityName, citySlug, countryName, countrySlug } = summary;
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
});
|
|
1403
|
-
};
|
|
1404
|
-
const handleCategoryClick = () => {
|
|
1405
|
-
if (!countrySlug || !citySlug)
|
|
1406
|
-
return;
|
|
1407
|
-
this.dispatchPageUpdate({
|
|
1408
|
-
page: "landing",
|
|
1409
|
-
country: countrySlug,
|
|
1410
|
-
city: citySlug,
|
|
1411
|
-
categories: attraction.main_category.slug,
|
|
1412
|
-
});
|
|
1413
|
-
};
|
|
1389
|
+
const countryTarget = countrySlug
|
|
1390
|
+
? { page: "landing", country: countrySlug, city: "" }
|
|
1391
|
+
: null;
|
|
1392
|
+
const cityTarget = countrySlug && citySlug
|
|
1393
|
+
? { page: "landing", country: countrySlug, city: citySlug }
|
|
1394
|
+
: null;
|
|
1395
|
+
const categoryTarget = cityTarget
|
|
1396
|
+
? { ...cityTarget, categories: attraction.main_category.slug }
|
|
1397
|
+
: null;
|
|
1398
|
+
const renderLink = (label, target) => html `<coras-breadcrumb-item
|
|
1399
|
+
href=${ifDefined(target ? this.pageUpdateHref(target) : undefined)}
|
|
1400
|
+
@click=${() => target && this.dispatchPageUpdate(target)}
|
|
1401
|
+
clickable
|
|
1402
|
+
>
|
|
1403
|
+
${label}
|
|
1404
|
+
</coras-breadcrumb-item>`;
|
|
1414
1405
|
return html `
|
|
1415
1406
|
<coras-breadcrumbs assets-url="${this.assetsURL}">
|
|
1416
|
-
${countryName
|
|
1417
|
-
|
|
1418
|
-
${countryName}
|
|
1419
|
-
</coras-breadcrumb-item>`
|
|
1420
|
-
: nothing}
|
|
1421
|
-
${cityName
|
|
1422
|
-
? html `<coras-breadcrumb-item @click=${handleCityClick} clickable>
|
|
1423
|
-
${cityName}
|
|
1424
|
-
</coras-breadcrumb-item>`
|
|
1425
|
-
: nothing}
|
|
1407
|
+
${countryName ? renderLink(countryName, countryTarget) : nothing}
|
|
1408
|
+
${cityName ? renderLink(cityName, cityTarget) : nothing}
|
|
1426
1409
|
${attraction.main_category.name
|
|
1427
|
-
?
|
|
1428
|
-
${attraction.main_category.name}
|
|
1429
|
-
</coras-breadcrumb-item>`
|
|
1410
|
+
? renderLink(attraction.main_category.name, categoryTarget)
|
|
1430
1411
|
: nothing}
|
|
1431
1412
|
<coras-breadcrumb-item>
|
|
1432
1413
|
${attraction.attraction_name}
|
package/dist/views/details-page/partials/location-categories/location-categories.component.d.ts
CHANGED
|
@@ -22,8 +22,9 @@ export declare class CorasLocationCategories extends LitElement {
|
|
|
22
22
|
locale: SupportedLocales;
|
|
23
23
|
currency: SupportedCurrencies;
|
|
24
24
|
dispatchPageUpdate: (params: PageDispatchInput) => void;
|
|
25
|
+
pageUpdateHref?: (params: PageDispatchInput) => string | undefined;
|
|
25
26
|
private categoriesTask;
|
|
26
|
-
private
|
|
27
|
+
private categoryTarget;
|
|
27
28
|
private renderCategory;
|
|
28
29
|
render(): typeof nothing | import("lit").TemplateResult<1> | undefined;
|
|
29
30
|
}
|
package/dist/views/details-page/partials/location-categories/location-categories.component.js
CHANGED
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html, nothing } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
9
10
|
import { consume } from "@lit/context";
|
|
10
11
|
import { localized, msg, str } from "@lit/localize";
|
|
11
12
|
import { Task } from "@lit/task";
|
|
@@ -17,7 +18,8 @@ import { apiGet } from "../../../../core/api/queries.js";
|
|
|
17
18
|
import { APIError } from "../../../../core/api/api-error.js";
|
|
18
19
|
import { clientContext } from "../../../../contexts/client.context.js";
|
|
19
20
|
import { assetsURLContext, currencyContext, distributorIdContext, localeContext, } from "../../../../contexts/properties.context.js";
|
|
20
|
-
import { pageDispatchContext, } from "../../../../contexts/events.context.js";
|
|
21
|
+
import { pageDispatchContext, pageHrefContext, } from "../../../../contexts/events.context.js";
|
|
22
|
+
import { claimLinkClick } from "../../../../core/utils/link-click.js";
|
|
21
23
|
import styles from "./location-categories.styles.js";
|
|
22
24
|
/**
|
|
23
25
|
* Below this the row is too thin to read as a set of things to explore, and
|
|
@@ -67,17 +69,21 @@ let CorasLocationCategories = class CorasLocationCategories extends LitElement {
|
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
71
|
static { this.styles = styles; }
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
categoryTarget(category) {
|
|
73
|
+
return {
|
|
72
74
|
page: "landing",
|
|
73
75
|
country: this.country,
|
|
74
76
|
city: this.city,
|
|
75
77
|
categories: category.slug,
|
|
76
78
|
locale: this.locale,
|
|
77
79
|
currency: this.currency,
|
|
78
|
-
}
|
|
80
|
+
};
|
|
79
81
|
}
|
|
82
|
+
// A link when the host builds URLs, a button otherwise; a plain click
|
|
83
|
+
// navigates in the app either way.
|
|
80
84
|
renderCategory(category) {
|
|
85
|
+
const target = this.categoryTarget(category);
|
|
86
|
+
const href = this.pageUpdateHref?.(target);
|
|
81
87
|
return html `
|
|
82
88
|
<coras-explore-card
|
|
83
89
|
image=${category.image}
|
|
@@ -87,7 +93,11 @@ let CorasLocationCategories = class CorasLocationCategories extends LitElement {
|
|
|
87
93
|
<coras-button
|
|
88
94
|
slot="button"
|
|
89
95
|
variant="outlined"
|
|
90
|
-
|
|
96
|
+
href=${ifDefined(href)}
|
|
97
|
+
@click=${(event) => {
|
|
98
|
+
if (!href || claimLinkClick(event))
|
|
99
|
+
this.dispatchPageUpdate(target);
|
|
100
|
+
}}
|
|
91
101
|
>
|
|
92
102
|
${msg("Explore")}
|
|
93
103
|
</coras-button>
|
|
@@ -143,6 +153,9 @@ __decorate([
|
|
|
143
153
|
__decorate([
|
|
144
154
|
consume({ context: pageDispatchContext })
|
|
145
155
|
], CorasLocationCategories.prototype, "dispatchPageUpdate", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
consume({ context: pageHrefContext })
|
|
158
|
+
], CorasLocationCategories.prototype, "pageUpdateHref", void 0);
|
|
146
159
|
CorasLocationCategories = __decorate([
|
|
147
160
|
localized()
|
|
148
161
|
], CorasLocationCategories);
|
package/dist/views/details-page/partials/location-highlights/location-highlights.component.d.ts
CHANGED
|
@@ -21,8 +21,9 @@ export declare class CorasLocationHighlights extends LitElement {
|
|
|
21
21
|
currency: SupportedCurrencies;
|
|
22
22
|
loyaltyProgramme: LoyaltyProgramme | null;
|
|
23
23
|
dispatchPageUpdate: (params: PageDispatchInput) => void;
|
|
24
|
+
private _pageHref?;
|
|
24
25
|
private highlightsTask;
|
|
25
|
-
private
|
|
26
|
+
private cardTarget;
|
|
26
27
|
private renderCard;
|
|
27
28
|
render(): typeof nothing | import("lit").TemplateResult<1> | undefined;
|
|
28
29
|
}
|
package/dist/views/details-page/partials/location-highlights/location-highlights.component.js
CHANGED
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html, nothing } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
9
10
|
import { consume } from "@lit/context";
|
|
10
11
|
import { localized, msg, str } from "@lit/localize";
|
|
11
12
|
import { Task } from "@lit/task";
|
|
@@ -16,7 +17,7 @@ import { APIError } from "../../../../core/api/api-error.js";
|
|
|
16
17
|
import { convertToLocaleCurrency } from "../../../../core/currency/index.js";
|
|
17
18
|
import { clientContext } from "../../../../contexts/client.context.js";
|
|
18
19
|
import { currencyContext, distributorIdContext, localeContext, loyaltyProgrammeContext, } from "../../../../contexts/properties.context.js";
|
|
19
|
-
import { pageDispatchContext, } from "../../../../contexts/events.context.js";
|
|
20
|
+
import { pageDispatchContext, pageHrefContext, } from "../../../../contexts/events.context.js";
|
|
20
21
|
import styles from "./location-highlights.styles.js";
|
|
21
22
|
import { renderLoyaltyBadge } from "../../../../components/loyalty-badge/loyalty-badge.utils.js";
|
|
22
23
|
/**
|
|
@@ -74,20 +75,22 @@ let CorasLocationHighlights = class CorasLocationHighlights extends LitElement {
|
|
|
74
75
|
});
|
|
75
76
|
}
|
|
76
77
|
static { this.styles = styles; }
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
cardTarget(card) {
|
|
79
|
+
return {
|
|
79
80
|
page: "details",
|
|
80
81
|
id: card.id,
|
|
81
82
|
date: formatISO(parseISO(card.date), { representation: "date" }),
|
|
82
83
|
locale: this.locale,
|
|
83
84
|
currency: this.currency,
|
|
84
|
-
}
|
|
85
|
+
};
|
|
85
86
|
}
|
|
86
87
|
renderCard(card) {
|
|
87
88
|
const price = card.price[this.currency];
|
|
89
|
+
const target = this.cardTarget(card);
|
|
88
90
|
return html `
|
|
89
91
|
<coras-attraction-short-card
|
|
90
92
|
.images=${card.images}
|
|
93
|
+
loading="lazy"
|
|
91
94
|
?label=${false}
|
|
92
95
|
name=${card.title}
|
|
93
96
|
rating=${card.rating || 0}
|
|
@@ -102,7 +105,8 @@ let CorasLocationHighlights = class CorasLocationHighlights extends LitElement {
|
|
|
102
105
|
date=${card.date}
|
|
103
106
|
timezone=${card.timezone}
|
|
104
107
|
locale=${this.locale}
|
|
105
|
-
|
|
108
|
+
href=${ifDefined(this._pageHref?.(target))}
|
|
109
|
+
@click=${() => this.dispatchPageUpdate(target)}
|
|
106
110
|
>
|
|
107
111
|
${renderLoyaltyBadge({
|
|
108
112
|
loyalty: card.loyalty,
|
|
@@ -166,6 +170,9 @@ __decorate([
|
|
|
166
170
|
__decorate([
|
|
167
171
|
consume({ context: pageDispatchContext })
|
|
168
172
|
], CorasLocationHighlights.prototype, "dispatchPageUpdate", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
consume({ context: pageHrefContext })
|
|
175
|
+
], CorasLocationHighlights.prototype, "_pageHref", void 0);
|
|
169
176
|
CorasLocationHighlights = __decorate([
|
|
170
177
|
localized()
|
|
171
178
|
], CorasLocationHighlights);
|
|
@@ -25,9 +25,11 @@ declare const CorasHelpPage_base: import("../../contexts/utils.js").Constructor<
|
|
|
25
25
|
loyaltyPoints: boolean;
|
|
26
26
|
loyaltyProgramme: import("../../index.js").CorasLoyaltyProgramme | null;
|
|
27
27
|
logger: import("../../core/logger.js").Logger;
|
|
28
|
+
hrefFor: import("../../index.js").CorasHrefFor | null;
|
|
28
29
|
client: import("openapi-fetch").Client<import("../../core/types/api-schema.js").paths>;
|
|
29
30
|
getPageProperties(): HelpPageParamsEvent;
|
|
30
31
|
dispatchPageUpdate(params: import("../../contexts/events.context.js").PageDispatchInput): void;
|
|
32
|
+
pageUpdateHref(params: import("../../contexts/events.context.js").PageDispatchInput): string | undefined;
|
|
31
33
|
}> & typeof LitElement;
|
|
32
34
|
/**
|
|
33
35
|
* Help page component for FAQs, contact form, and policy pages.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CSSResultGroup, LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import type { LandingPageParamsEvent } from "../../core/pages.js";
|
|
3
|
+
import type { PageDispatchInput } from "../../contexts/events.context.js";
|
|
3
4
|
import type { PageName } from "../../core/types/shared.js";
|
|
4
5
|
import "../../components/location-image/location-image.js";
|
|
5
6
|
import "../../components/dropdown/dropdown.js";
|
|
@@ -38,9 +39,11 @@ declare const CorasLandingPage_base: import("../../contexts/utils.js").Construct
|
|
|
38
39
|
loyaltyPoints: boolean;
|
|
39
40
|
loyaltyProgramme: import("../../index.js").CorasLoyaltyProgramme | null;
|
|
40
41
|
logger: import("../../core/logger.js").Logger;
|
|
42
|
+
hrefFor: import("../../index.js").CorasHrefFor | null;
|
|
41
43
|
client: import("openapi-fetch").Client<import("../../core/types/api-schema.js").paths>;
|
|
42
44
|
getPageProperties(): LandingPageParamsEvent;
|
|
43
|
-
dispatchPageUpdate(params:
|
|
45
|
+
dispatchPageUpdate(params: PageDispatchInput): void;
|
|
46
|
+
pageUpdateHref(params: PageDispatchInput): string | undefined;
|
|
44
47
|
}> & typeof LitElement;
|
|
45
48
|
/**
|
|
46
49
|
* @fires coras:navigate
|
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement, nothing, } from "lit";
|
|
8
8
|
import { when } from "lit/directives/when.js";
|
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
9
10
|
import { property, query, state } from "lit/decorators.js";
|
|
10
11
|
import { msg, localized } from "@lit/localize";
|
|
11
12
|
import { Task } from "@lit/task";
|
|
@@ -830,6 +831,15 @@ let CorasLandingPage = class CorasLandingPage extends ErrorModalMixin(LocationSe
|
|
|
830
831
|
|
|
831
832
|
<div class="cards">
|
|
832
833
|
${cards.map((card) => {
|
|
834
|
+
const target = {
|
|
835
|
+
locale: this.locale,
|
|
836
|
+
currency: this.currency,
|
|
837
|
+
page: "details",
|
|
838
|
+
id: card.id,
|
|
839
|
+
date: formatISO(parseISO(card.date), {
|
|
840
|
+
representation: "date",
|
|
841
|
+
}),
|
|
842
|
+
};
|
|
833
843
|
return html `
|
|
834
844
|
<coras-attraction-short-card
|
|
835
845
|
.images=${card.images}
|
|
@@ -845,15 +855,8 @@ let CorasLandingPage = class CorasLandingPage extends ErrorModalMixin(LocationSe
|
|
|
845
855
|
date=${card.date}
|
|
846
856
|
timezone=${card.timezone}
|
|
847
857
|
locale=${this.locale}
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
currency: this.currency,
|
|
851
|
-
page: "details",
|
|
852
|
-
id: card.id,
|
|
853
|
-
date: formatISO(parseISO(card.date), {
|
|
854
|
-
representation: "date",
|
|
855
|
-
}),
|
|
856
|
-
})}
|
|
858
|
+
href=${ifDefined(this.pageUpdateHref(target))}
|
|
859
|
+
@click=${() => this.dispatchPageUpdate(target)}
|
|
857
860
|
>
|
|
858
861
|
${renderLoyaltyBadge({
|
|
859
862
|
loyalty: card.loyalty,
|
|
@@ -911,17 +914,19 @@ let CorasLandingPage = class CorasLandingPage extends ErrorModalMixin(LocationSe
|
|
|
911
914
|
if (!matchingCity) {
|
|
912
915
|
return nothing;
|
|
913
916
|
}
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
city: "",
|
|
919
|
-
});
|
|
917
|
+
const countryTarget = {
|
|
918
|
+
page: "landing",
|
|
919
|
+
country: this.resolvedCountry,
|
|
920
|
+
city: "",
|
|
920
921
|
};
|
|
921
922
|
return html `
|
|
922
923
|
<div class="breadcrumbs-container">
|
|
923
924
|
<coras-breadcrumbs assets-url="${this.assetsURL}">
|
|
924
|
-
<coras-breadcrumb-item
|
|
925
|
+
<coras-breadcrumb-item
|
|
926
|
+
href=${ifDefined(this.pageUpdateHref(countryTarget))}
|
|
927
|
+
@click=${() => this.dispatchPageUpdate(countryTarget)}
|
|
928
|
+
clickable
|
|
929
|
+
>
|
|
925
930
|
${matchingCountry.name}
|
|
926
931
|
</coras-breadcrumb-item>
|
|
927
932
|
<coras-breadcrumb-item> ${matchingCity.name} </coras-breadcrumb-item>
|
|
@@ -10,7 +10,9 @@ export declare class CorasConfirmation extends LitElement {
|
|
|
10
10
|
reservations: ReservationSummary[];
|
|
11
11
|
loyalty: boolean;
|
|
12
12
|
private dispatchPageUpdate;
|
|
13
|
+
private pageUpdateHref?;
|
|
13
14
|
private handleHelpClick;
|
|
15
|
+
private renderHelpLink;
|
|
14
16
|
private getImgixParams;
|
|
15
17
|
private renderTicketImage;
|
|
16
18
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -15,7 +15,9 @@ import { getLoyaltyAmount } from "../../../../core/utils/loyalty.js";
|
|
|
15
15
|
import { formatDateTimeForDisplay, formatTimeForDisplay, } from "../../../../core/utils/datetime.js";
|
|
16
16
|
import { getSeatDetails } from "../../../../core/utils/seats.js";
|
|
17
17
|
import { consume } from "@lit/context";
|
|
18
|
-
import { pageDispatchContext, } from "../../../../contexts/events.context.js";
|
|
18
|
+
import { pageDispatchContext, pageHrefContext, } from "../../../../contexts/events.context.js";
|
|
19
|
+
import { claimLinkClick } from "../../../../core/utils/link-click.js";
|
|
20
|
+
const HELP_PAGE = { page: "help" };
|
|
19
21
|
let CorasConfirmation = class CorasConfirmation extends LitElement {
|
|
20
22
|
constructor() {
|
|
21
23
|
super(...arguments);
|
|
@@ -27,8 +29,25 @@ let CorasConfirmation = class CorasConfirmation extends LitElement {
|
|
|
27
29
|
}
|
|
28
30
|
static { this.styles = styles; }
|
|
29
31
|
handleHelpClick(event) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
const linked = Boolean(this.pageUpdateHref?.(HELP_PAGE));
|
|
33
|
+
if (!linked || claimLinkClick(event))
|
|
34
|
+
this.dispatchPageUpdate?.(HELP_PAGE);
|
|
35
|
+
}
|
|
36
|
+
// A link to the help page when the host builds URLs, a button otherwise.
|
|
37
|
+
renderHelpLink() {
|
|
38
|
+
const href = this.pageUpdateHref?.(HELP_PAGE);
|
|
39
|
+
const label = msg("Help Centre");
|
|
40
|
+
return href
|
|
41
|
+
? html `<a class="help-link" href=${href} @click=${this.handleHelpClick}
|
|
42
|
+
>${label}</a
|
|
43
|
+
>`
|
|
44
|
+
: html `<button
|
|
45
|
+
type="button"
|
|
46
|
+
class="help-link"
|
|
47
|
+
@click=${this.handleHelpClick}
|
|
48
|
+
>
|
|
49
|
+
${label}
|
|
50
|
+
</button>`;
|
|
32
51
|
}
|
|
33
52
|
getImgixParams() {
|
|
34
53
|
const params = new URLSearchParams({
|
|
@@ -183,9 +202,7 @@ let CorasConfirmation = class CorasConfirmation extends LitElement {
|
|
|
183
202
|
|
|
184
203
|
<div class="help-text">
|
|
185
204
|
${msg("If you need help with your order, please visit our")}
|
|
186
|
-
|
|
187
|
-
${msg("Help Centre")}
|
|
188
|
-
</span>
|
|
205
|
+
${this.renderHelpLink()}
|
|
189
206
|
</div>
|
|
190
207
|
`;
|
|
191
208
|
}
|
|
@@ -208,6 +225,9 @@ __decorate([
|
|
|
208
225
|
__decorate([
|
|
209
226
|
consume({ context: pageDispatchContext })
|
|
210
227
|
], CorasConfirmation.prototype, "dispatchPageUpdate", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
consume({ context: pageHrefContext })
|
|
230
|
+
], CorasConfirmation.prototype, "pageUpdateHref", void 0);
|
|
211
231
|
CorasConfirmation = __decorate([
|
|
212
232
|
localized()
|
|
213
233
|
], CorasConfirmation);
|
|
@@ -158,6 +158,10 @@ export default css `
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
.help-link {
|
|
161
|
+
padding: 0;
|
|
162
|
+
border: 0;
|
|
163
|
+
background: none;
|
|
164
|
+
font: inherit;
|
|
161
165
|
color: var(--confirmation-help-link-color);
|
|
162
166
|
text-decoration: none;
|
|
163
167
|
font-weight: var(--confirmation-help-link-font-weight);
|
|
@@ -39,9 +39,11 @@ declare const CorasPaymentPage_base: import("../../contexts/utils.js").Construct
|
|
|
39
39
|
loyaltyPoints: boolean;
|
|
40
40
|
loyaltyProgramme: import("../../core/utils/loyalty.js").LoyaltyProgramme | null;
|
|
41
41
|
logger: Logger;
|
|
42
|
+
hrefFor: import("../../index.js").CorasHrefFor | null;
|
|
42
43
|
client: import("openapi-fetch").Client<import("../../core/types/api-schema.js").paths>;
|
|
43
44
|
getPageProperties(): PaymentPageParamsEvent;
|
|
44
45
|
dispatchPageUpdate(params: import("../../contexts/events.context.js").PageDispatchInput): void;
|
|
46
|
+
pageUpdateHref(params: import("../../contexts/events.context.js").PageDispatchInput): string | undefined;
|
|
45
47
|
}> & typeof LitElement;
|
|
46
48
|
/**
|
|
47
49
|
* Payment page component for processing checkout and payments.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSResultGroup, LitElement, type PropertyValues } from "lit";
|
|
2
|
+
import type { PageDispatchInput } from "../../contexts/events.context.js";
|
|
2
3
|
import "../../components/attraction-card/long/attraction-long-card.js";
|
|
3
4
|
import "../../components/button/button.js";
|
|
4
5
|
import "../../components/loading-spinner/loading-spinner.js";
|
|
@@ -20,9 +21,11 @@ declare const CorasSearchPage_base: import("../../contexts/utils.js").Constructo
|
|
|
20
21
|
loyaltyPoints: boolean;
|
|
21
22
|
loyaltyProgramme: import("../../index.js").CorasLoyaltyProgramme | null;
|
|
22
23
|
logger: import("../../core/logger.js").Logger;
|
|
24
|
+
hrefFor: import("../../index.js").CorasHrefFor | null;
|
|
23
25
|
client: Client<paths>;
|
|
24
26
|
getPageProperties(): SearchPageParamsEvent;
|
|
25
|
-
dispatchPageUpdate(params:
|
|
27
|
+
dispatchPageUpdate(params: PageDispatchInput): void;
|
|
28
|
+
pageUpdateHref(params: PageDispatchInput): string | undefined;
|
|
26
29
|
}> & typeof LitElement;
|
|
27
30
|
/**
|
|
28
31
|
* Search page component for displaying search results.
|
|
@@ -58,7 +61,7 @@ export declare class CorasSearchPage extends CorasSearchPage_base {
|
|
|
58
61
|
updated(changedProperties: PropertyValues): void;
|
|
59
62
|
private renderSkeleton;
|
|
60
63
|
private renderAttractions;
|
|
61
|
-
private
|
|
64
|
+
private renderBreadcrumbLink;
|
|
62
65
|
private renderBottomSection;
|
|
63
66
|
render(): import("lit").TemplateResult<1>;
|
|
64
67
|
}
|
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html, nothing, } from "lit";
|
|
8
8
|
import { property, state } from "lit/decorators.js";
|
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
9
10
|
import { consume } from "@lit/context";
|
|
10
11
|
import { msg, str, localized } from "@lit/localize";
|
|
11
12
|
import { LocationSearchMixin } from "../../mixins/location-search/location-search.js";
|
|
@@ -128,36 +129,18 @@ let CorasSearchPage = class CorasSearchPage extends ErrorModalMixin(LocationSear
|
|
|
128
129
|
: null;
|
|
129
130
|
const countryName = country?.name;
|
|
130
131
|
const countrySlug = country?.slug;
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
city: "",
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
const handleCityClick = () => {
|
|
141
|
-
if (!countrySlug || !citySlug)
|
|
142
|
-
return;
|
|
143
|
-
this.dispatchPageUpdate({
|
|
144
|
-
page: "landing",
|
|
145
|
-
country: countrySlug,
|
|
146
|
-
city: citySlug,
|
|
147
|
-
});
|
|
148
|
-
};
|
|
132
|
+
const countryTarget = countrySlug
|
|
133
|
+
? { page: "landing", country: countrySlug, city: "" }
|
|
134
|
+
: null;
|
|
135
|
+
const cityTarget = countrySlug && citySlug
|
|
136
|
+
? { page: "landing", country: countrySlug, city: citySlug }
|
|
137
|
+
: null;
|
|
149
138
|
return html `
|
|
150
139
|
<coras-breadcrumbs assets-url="${this.assetsURL}">
|
|
151
140
|
${countryName
|
|
152
|
-
?
|
|
153
|
-
${countryName}
|
|
154
|
-
</coras-breadcrumb-item>`
|
|
155
|
-
: nothing}
|
|
156
|
-
${cityName
|
|
157
|
-
? html `<coras-breadcrumb-item @click=${handleCityClick} clickable>
|
|
158
|
-
${cityName}
|
|
159
|
-
</coras-breadcrumb-item>`
|
|
141
|
+
? this.renderBreadcrumbLink(countryName, countryTarget)
|
|
160
142
|
: nothing}
|
|
143
|
+
${cityName ? this.renderBreadcrumbLink(cityName, cityTarget) : nothing}
|
|
161
144
|
<coras-breadcrumb-item> ${this.search} </coras-breadcrumb-item>
|
|
162
145
|
</coras-breadcrumbs>
|
|
163
146
|
`;
|
|
@@ -278,7 +261,12 @@ let CorasSearchPage = class CorasSearchPage extends ErrorModalMixin(LocationSear
|
|
|
278
261
|
${this.renderTitle()} ${this.renderBreadcrumbs()}
|
|
279
262
|
|
|
280
263
|
<div class="cards">
|
|
281
|
-
${this.attractions.map((result) =>
|
|
264
|
+
${this.attractions.map((result) => {
|
|
265
|
+
const target = {
|
|
266
|
+
page: "details",
|
|
267
|
+
id: result.attraction_id,
|
|
268
|
+
};
|
|
269
|
+
return html `
|
|
282
270
|
<coras-attraction-long-card
|
|
283
271
|
.images=${adaptPresetImages(result.images)}
|
|
284
272
|
?label=${false}
|
|
@@ -286,37 +274,42 @@ let CorasSearchPage = class CorasSearchPage extends ErrorModalMixin(LocationSear
|
|
|
286
274
|
rating=${result.rating || 0}
|
|
287
275
|
category=${result.main_category.slug}
|
|
288
276
|
price=${convertToLocaleCurrency({
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
277
|
+
value: result.min_price[this.currency] || 0,
|
|
278
|
+
locale: this.locale,
|
|
279
|
+
currency: this.currency,
|
|
280
|
+
})}
|
|
293
281
|
description=${truncate({
|
|
294
|
-
|
|
295
|
-
|
|
282
|
+
text: removeHtmlTags(result.description || ""),
|
|
283
|
+
})}
|
|
296
284
|
date=${result.upcoming_instances[0] ||
|
|
297
|
-
|
|
285
|
+
formatISO(new Date(), { representation: "date" })}
|
|
298
286
|
timezone=${result.timezone || ""}
|
|
299
287
|
locale=${this.locale}
|
|
300
|
-
|
|
288
|
+
href=${ifDefined(this.pageUpdateHref(target))}
|
|
289
|
+
@click=${() => this.dispatchPageUpdate(target)}
|
|
301
290
|
>
|
|
302
291
|
${renderLoyaltyBadge({
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
292
|
+
loyalty: result.loyalty,
|
|
293
|
+
programme: this.loyaltyProgramme,
|
|
294
|
+
locale: this.locale,
|
|
295
|
+
variant: "card",
|
|
296
|
+
slot: "points",
|
|
297
|
+
from: true,
|
|
298
|
+
})}
|
|
310
299
|
</coras-attraction-long-card>
|
|
311
|
-
|
|
300
|
+
`;
|
|
301
|
+
})}
|
|
312
302
|
</div>
|
|
313
303
|
`;
|
|
314
304
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
305
|
+
renderBreadcrumbLink(label, target) {
|
|
306
|
+
return html `<coras-breadcrumb-item
|
|
307
|
+
href=${ifDefined(target ? this.pageUpdateHref(target) : undefined)}
|
|
308
|
+
@click=${() => target && this.dispatchPageUpdate(target)}
|
|
309
|
+
clickable
|
|
310
|
+
>
|
|
311
|
+
${label}
|
|
312
|
+
</coras-breadcrumb-item>`;
|
|
320
313
|
}
|
|
321
314
|
renderBottomSection() {
|
|
322
315
|
const isLoading = this.attractionsSearchTask.status === TaskStatus.PENDING && this.page > 0;
|
|
@@ -4,6 +4,7 @@ import "../../components/button/button.js";
|
|
|
4
4
|
import "../../components/carousel/carousel.js";
|
|
5
5
|
import "../../components/attraction-card/short/attraction-short-card.js";
|
|
6
6
|
import type { PageParamsEvent } from "../../core/pages.js";
|
|
7
|
+
import type { PageDispatchInput } from "../../contexts/events.context.js";
|
|
7
8
|
declare const CorasSuggestionWidget_base: import("../../contexts/utils.js").Constructor<{
|
|
8
9
|
apiHost: string;
|
|
9
10
|
distributorID: string;
|
|
@@ -15,9 +16,11 @@ declare const CorasSuggestionWidget_base: import("../../contexts/utils.js").Cons
|
|
|
15
16
|
loyaltyPoints: boolean;
|
|
16
17
|
loyaltyProgramme: import("../../index.js").CorasLoyaltyProgramme | null;
|
|
17
18
|
logger: import("../../core/logger.js").Logger;
|
|
19
|
+
hrefFor: import("../../index.js").CorasHrefFor | null;
|
|
18
20
|
client: import("openapi-fetch").Client<import("../../core/types/api-schema.js").paths>;
|
|
19
21
|
getPageProperties(): PageParamsEvent;
|
|
20
|
-
dispatchPageUpdate(params:
|
|
22
|
+
dispatchPageUpdate(params: PageDispatchInput): void;
|
|
23
|
+
pageUpdateHref(params: PageDispatchInput): string | undefined;
|
|
21
24
|
}> & typeof LitElement;
|
|
22
25
|
export declare class CorasSuggestionWidget extends CorasSuggestionWidget_base {
|
|
23
26
|
static styles: CSSResultGroup;
|
|
@@ -29,8 +32,8 @@ export declare class CorasSuggestionWidget extends CorasSuggestionWidget_base {
|
|
|
29
32
|
/** Turn a location slug ("gran-canaria") into a display name ("Gran Canaria"). */
|
|
30
33
|
private humanize;
|
|
31
34
|
private suggestionsTask;
|
|
32
|
-
private
|
|
33
|
-
private
|
|
35
|
+
private cardTarget;
|
|
36
|
+
private exploreTarget;
|
|
34
37
|
private renderCard;
|
|
35
38
|
private renderExploreCard;
|
|
36
39
|
private renderContent;
|