@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
|
@@ -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 { localized, msg, str } from "@lit/localize";
|
|
10
11
|
import { Task } from "@lit/task";
|
|
11
12
|
import { formatISO, parseISO } from "date-fns";
|
|
@@ -21,6 +22,7 @@ import { BaseMixin } from "../../mixins/base.mixin.js";
|
|
|
21
22
|
import { apiGet } from "../../core/api/queries.js";
|
|
22
23
|
import { convertToLocaleCurrency } from "../../core/currency/index.js";
|
|
23
24
|
import { renderLoyaltyBadge } from "../../components/loyalty-badge/loyalty-badge.utils.js";
|
|
25
|
+
import { claimLinkClick } from "../../core/utils/link-click.js";
|
|
24
26
|
let CorasSuggestionWidget = class CorasSuggestionWidget extends BaseMixin(LitElement) {
|
|
25
27
|
constructor() {
|
|
26
28
|
super(...arguments);
|
|
@@ -60,26 +62,27 @@ let CorasSuggestionWidget = class CorasSuggestionWidget extends BaseMixin(LitEle
|
|
|
60
62
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
61
63
|
.join(" ");
|
|
62
64
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
cardTarget(card) {
|
|
66
|
+
return {
|
|
65
67
|
page: "details",
|
|
66
68
|
id: card.id,
|
|
67
69
|
date: formatISO(parseISO(card.date), { representation: "date" }),
|
|
68
70
|
locale: this.locale,
|
|
69
71
|
currency: this.currency,
|
|
70
|
-
}
|
|
72
|
+
};
|
|
71
73
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
exploreTarget(country, city) {
|
|
75
|
+
return {
|
|
74
76
|
page: "landing",
|
|
75
77
|
country,
|
|
76
78
|
city,
|
|
77
79
|
locale: this.locale,
|
|
78
80
|
currency: this.currency,
|
|
79
|
-
}
|
|
81
|
+
};
|
|
80
82
|
}
|
|
81
83
|
renderCard(card) {
|
|
82
84
|
const price = card.price[this.currency];
|
|
85
|
+
const target = this.cardTarget(card);
|
|
83
86
|
return html `
|
|
84
87
|
<coras-attraction-short-card
|
|
85
88
|
.images=${card.images}
|
|
@@ -97,7 +100,8 @@ let CorasSuggestionWidget = class CorasSuggestionWidget extends BaseMixin(LitEle
|
|
|
97
100
|
date=${card.date}
|
|
98
101
|
timezone=${card.timezone}
|
|
99
102
|
locale=${this.locale}
|
|
100
|
-
|
|
103
|
+
href=${ifDefined(this.pageUpdateHref(target))}
|
|
104
|
+
@click=${() => this.dispatchPageUpdate(target)}
|
|
101
105
|
>
|
|
102
106
|
${renderLoyaltyBadge({
|
|
103
107
|
loyalty: card.loyalty,
|
|
@@ -122,6 +126,8 @@ let CorasSuggestionWidget = class CorasSuggestionWidget extends BaseMixin(LitEle
|
|
|
122
126
|
imageExtension: "png",
|
|
123
127
|
params: { auto: "compress,format", ar: "2:3", fit: "crop" },
|
|
124
128
|
});
|
|
129
|
+
const target = this.exploreTarget(country, city);
|
|
130
|
+
const href = this.pageUpdateHref(target);
|
|
125
131
|
return html `
|
|
126
132
|
<coras-explore-card
|
|
127
133
|
image=${imageUrl}
|
|
@@ -131,7 +137,11 @@ let CorasSuggestionWidget = class CorasSuggestionWidget extends BaseMixin(LitEle
|
|
|
131
137
|
<coras-button
|
|
132
138
|
slot="button"
|
|
133
139
|
variant="outlined"
|
|
134
|
-
|
|
140
|
+
href=${ifDefined(href)}
|
|
141
|
+
@click=${(event) => {
|
|
142
|
+
if (!href || claimLinkClick(event))
|
|
143
|
+
this.dispatchPageUpdate(target);
|
|
144
|
+
}}
|
|
135
145
|
>
|
|
136
146
|
${msg("See all activities")}
|
|
137
147
|
</coras-button>
|