@loczer/storefront-sdk 0.234.0 → 0.236.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/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +113 -109
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +42 -43
- package/dist/components/TestimonialsSection/index.d.ts.map +1 -1
- package/dist/components/TestimonialsSection/index.js +1 -1
- package/dist/i18n/en.d.ts +0 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +0 -1
- package/dist/i18n/fr.d.ts +0 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/lib/storefrontReviews.d.ts +5 -20
- package/dist/lib/storefrontReviews.d.ts.map +1 -1
- package/dist/lib/storefrontReviews.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAMtE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAQD,wBAAgB,MAAM,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,WAAW,2CA8PlG"}
|
|
@@ -1,273 +1,277 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getLocalizedValue as
|
|
3
|
-
import { useStorefrontCart as
|
|
1
|
+
import { pickBookingSearchParams as e, resolveBookingSearchParamsFromSessionStorage as t } from "../../lib/booking.js";
|
|
2
|
+
import { getLocalizedValue as n } from "../../localization.js";
|
|
3
|
+
import { useStorefrontCart as ee } from "../../lib/cart.js";
|
|
4
4
|
import { buildStorefrontImageUrl as r } from "../../lib/storefrontImage.js";
|
|
5
|
-
import
|
|
6
|
-
import { MISSING_SHOP_EMAIL as
|
|
7
|
-
import { formatStorefrontAddressTagline as
|
|
8
|
-
import { Badge as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { LanguageSelector as
|
|
11
|
-
import { Drawer as
|
|
12
|
-
import { useOptionalStorefront as
|
|
13
|
-
import { useState as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { useMediaQuery as
|
|
16
|
-
import { Link as
|
|
17
|
-
import { useTranslation as
|
|
18
|
-
import { cn as
|
|
19
|
-
import { ArrowRight as _, Menu as
|
|
5
|
+
import te from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
|
|
6
|
+
import { MISSING_SHOP_EMAIL as ne } from "../../lib/storefrontMissingValues.js";
|
|
7
|
+
import { formatStorefrontAddressTagline as re } from "../../lib/storefrontAddress.js";
|
|
8
|
+
import { Badge as ie } from "../../ui/badge.js";
|
|
9
|
+
import { Button as i } from "../../ui/button.js";
|
|
10
|
+
import { LanguageSelector as a } from "../LanguageSelector/index.js";
|
|
11
|
+
import { Drawer as ae, DrawerClose as o, DrawerContent as oe, DrawerDescription as se, DrawerHeader as ce, DrawerTitle as le, DrawerTrigger as s } from "../../ui/drawer.js";
|
|
12
|
+
import { useOptionalStorefront as ue } from "../../StorefrontContext.js";
|
|
13
|
+
import { useEffect as de, useState as c } from "react";
|
|
14
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
15
|
+
import { useMediaQuery as fe, useThrottledMeasure as pe } from "@rpcbase/client";
|
|
16
|
+
import { Link as d, useLocation as f, useParams as p } from "@rpcbase/router";
|
|
17
|
+
import { useTranslation as m } from "react-i18next";
|
|
18
|
+
import { cn as h, useScrollHideOnDown as g } from "@rpcbase/ui";
|
|
19
|
+
import { ArrowRight as _, Menu as me, ShoppingCart as he } from "lucide-react";
|
|
20
20
|
//#region src/components/Header/index.tsx
|
|
21
|
-
var
|
|
21
|
+
var ge = 36, v = (e, t) => {
|
|
22
22
|
let n = e?.trim() ?? "";
|
|
23
23
|
return n ? r(n, t ?? "") : "";
|
|
24
24
|
};
|
|
25
|
-
function
|
|
26
|
-
let { t:
|
|
27
|
-
|
|
25
|
+
function y({ storefrontConfiguration: r, whatsappHref: y, whatsappPhoneDisplay: b }) {
|
|
26
|
+
let { t: x, i18n: S } = m(), C = ue(), { storeSlug: w } = p(), _e = f(), { itemCount: T, isReady: E } = ee(), D = fe("(max-width: 640px)"), [O, k] = c(!1), [A, j] = c(!1);
|
|
27
|
+
de(() => {
|
|
28
|
+
k(!0);
|
|
29
|
+
}, []);
|
|
30
|
+
let [M, N] = pe(), P = N?.height ?? ge, F = g({
|
|
31
|
+
enabled: D,
|
|
28
32
|
thresholdPx: P
|
|
29
|
-
}), I =
|
|
33
|
+
}), I = D && F ? `translateY(-${P}px)` : "translateY(0)", L = `/${w ?? ""}`, R = new URLSearchParams(_e.search), z = O ? t(R, w) : e(R), B = z.toString(), ve = !!(z.get("start_time")?.trim() && z.get("end_time")?.trim()), V = B ? `?${B}` : "", H = `${L}/booking${V}`, ye = `${L}/checkout${V}`, be = T > 0 && ve ? ye : H, U = r?.shop.name?.trim() ?? "", W = r?.shop.emailAddress?.trim() ?? "", G = r?.workspace?.workspaceLanguage, K = r?.workspace?.languages, q = n(r?.content?.tagline, S.language, G).trim(), J = re(r?.shop), Y = q || J || "[Missing shop address]", xe = !q && !J, Se = n(r?.content?.topBannerMessage, S.language, G).trim() || x("top_bar_message"), X = v(r?.content?.logoWideImageId, w), Z = v(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, w), Q = X.length > 0, $ = Z.length > 0, Ce = [
|
|
30
34
|
{
|
|
31
|
-
label:
|
|
35
|
+
label: x("nav_categories"),
|
|
32
36
|
to: `${L}${V}#categories`
|
|
33
37
|
},
|
|
34
38
|
{
|
|
35
|
-
label:
|
|
39
|
+
label: x("nav_featured"),
|
|
36
40
|
to: `${L}${V}#featured`
|
|
37
41
|
},
|
|
38
42
|
{
|
|
39
|
-
label:
|
|
43
|
+
label: x("nav_products"),
|
|
40
44
|
to: H
|
|
41
45
|
},
|
|
42
|
-
...(
|
|
43
|
-
label:
|
|
46
|
+
...(C?.itineraries.length ?? 0) > 0 ? [{
|
|
47
|
+
label: x("nav_itineraries"),
|
|
44
48
|
to: `${L}/itineraries`
|
|
45
49
|
}] : [],
|
|
46
50
|
{
|
|
47
|
-
label:
|
|
51
|
+
label: x("nav_contact"),
|
|
48
52
|
to: `${L}${V}#contact`
|
|
49
53
|
}
|
|
50
54
|
];
|
|
51
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ u("div", {
|
|
52
56
|
className: "sticky top-0 z-30",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ l("div", {
|
|
54
58
|
className: "transition-transform duration-300",
|
|
55
59
|
style: { transform: I },
|
|
56
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ l("div", {
|
|
57
61
|
ref: M,
|
|
58
62
|
className: "bg-slate-950 text-white",
|
|
59
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ u("div", {
|
|
60
64
|
className: "mx-auto flex max-w-7xl items-center justify-start gap-3 px-4 py-2 text-left text-xs leading-4 sm:justify-between sm:px-6",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ l("p", {
|
|
62
66
|
className: "w-full min-w-0 break-words sm:w-auto",
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
}), /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ l("span", { children: Se })
|
|
68
|
+
}), /* @__PURE__ */ u("div", {
|
|
65
69
|
className: "hidden items-center gap-4 sm:flex",
|
|
66
|
-
children: [
|
|
70
|
+
children: [y ? /* @__PURE__ */ u("a", {
|
|
67
71
|
className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
|
|
68
|
-
href:
|
|
72
|
+
href: y,
|
|
69
73
|
target: "_blank",
|
|
70
74
|
rel: "noreferrer",
|
|
71
|
-
"aria-label": `WhatsApp${
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
-
src:
|
|
75
|
+
"aria-label": `WhatsApp${b ? ` ${b}` : ""}`,
|
|
76
|
+
children: [/* @__PURE__ */ l("img", {
|
|
77
|
+
src: te,
|
|
74
78
|
className: "h-5 w-5 shrink-0",
|
|
75
79
|
alt: "",
|
|
76
80
|
"aria-hidden": "true"
|
|
77
|
-
}),
|
|
78
|
-
}) : null, W ? /* @__PURE__ */
|
|
81
|
+
}), b ? /* @__PURE__ */ l("span", { children: b }) : null]
|
|
82
|
+
}) : null, W ? /* @__PURE__ */ l("a", {
|
|
79
83
|
className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
|
|
80
84
|
href: `mailto:${W}`,
|
|
81
85
|
"aria-label": W,
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
-
}) : /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ l("span", { children: W })
|
|
87
|
+
}) : /* @__PURE__ */ l("span", {
|
|
84
88
|
className: "inline-flex items-center rounded-md px-2 py-1 text-destructive",
|
|
85
|
-
children:
|
|
89
|
+
children: ne
|
|
86
90
|
})]
|
|
87
91
|
})]
|
|
88
92
|
})
|
|
89
93
|
})
|
|
90
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ l("header", {
|
|
91
95
|
className: "sticky top-0 z-30 border-b bg-white/90 backdrop-blur transition-transform duration-300",
|
|
92
96
|
style: { transform: I },
|
|
93
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ u("div", {
|
|
94
98
|
className: "mx-auto flex max-w-7xl min-w-0 items-center gap-2 px-4 py-3 sm:gap-4 sm:px-6",
|
|
95
99
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ u(d, {
|
|
97
101
|
to: L,
|
|
98
102
|
className: "flex min-w-0 flex-1 items-center gap-2 sm:gap-3",
|
|
99
|
-
children: [$ ? /* @__PURE__ */
|
|
103
|
+
children: [$ ? /* @__PURE__ */ l("span", {
|
|
100
104
|
className: "inline-flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-slate-200 bg-white",
|
|
101
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ l("img", {
|
|
102
106
|
src: Z,
|
|
103
107
|
alt: "",
|
|
104
108
|
className: "h-full w-full object-contain",
|
|
105
109
|
"aria-hidden": "true"
|
|
106
110
|
})
|
|
107
|
-
}) : Q ? null : /* @__PURE__ */
|
|
111
|
+
}) : Q ? null : /* @__PURE__ */ l("span", {
|
|
108
112
|
className: "inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border-2 border-dashed border-slate-300 bg-slate-50 text-slate-400",
|
|
109
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ l("span", {
|
|
110
114
|
className: "text-lg font-semibold leading-none",
|
|
111
115
|
"aria-hidden": "true",
|
|
112
116
|
children: "?"
|
|
113
117
|
})
|
|
114
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ u("span", {
|
|
115
119
|
className: "flex min-w-0 flex-col leading-tight",
|
|
116
|
-
children: [Q && !$ ? /* @__PURE__ */
|
|
120
|
+
children: [Q && !$ ? /* @__PURE__ */ l("img", {
|
|
117
121
|
src: X,
|
|
118
122
|
alt: U,
|
|
119
123
|
className: "h-8 max-w-[10rem] object-contain object-left sm:max-w-[14rem]"
|
|
120
|
-
}) : /* @__PURE__ */
|
|
124
|
+
}) : /* @__PURE__ */ l("span", {
|
|
121
125
|
className: "truncate text-sm font-semibold",
|
|
122
126
|
children: U
|
|
123
|
-
}), /* @__PURE__ */
|
|
124
|
-
className:
|
|
127
|
+
}), /* @__PURE__ */ l("span", {
|
|
128
|
+
className: h("truncate text-xs text-slate-600", xe && "text-destructive"),
|
|
125
129
|
children: Y
|
|
126
130
|
})]
|
|
127
131
|
})]
|
|
128
132
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ u("nav", {
|
|
130
134
|
className: "hidden items-center gap-6 text-sm font-medium text-slate-700 md:flex",
|
|
131
135
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ l(d, {
|
|
133
137
|
className: "hover:text-slate-950",
|
|
134
138
|
to: `${L}${V}#categories`,
|
|
135
|
-
children: /* @__PURE__ */
|
|
139
|
+
children: /* @__PURE__ */ l("span", { children: x("nav_categories") })
|
|
136
140
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ l(d, {
|
|
138
142
|
className: "hover:text-slate-950",
|
|
139
143
|
to: `${L}${V}#featured`,
|
|
140
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ l("span", { children: x("nav_featured") })
|
|
141
145
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ l(d, {
|
|
143
147
|
className: "hover:text-slate-950",
|
|
144
148
|
to: H,
|
|
145
|
-
children: /* @__PURE__ */
|
|
149
|
+
children: /* @__PURE__ */ l("span", { children: x("nav_products") })
|
|
146
150
|
}),
|
|
147
|
-
(
|
|
151
|
+
(C?.itineraries.length ?? 0) > 0 ? /* @__PURE__ */ l(d, {
|
|
148
152
|
className: "hover:text-slate-950",
|
|
149
153
|
to: `${L}/itineraries`,
|
|
150
|
-
children: /* @__PURE__ */
|
|
154
|
+
children: /* @__PURE__ */ l("span", { children: x("nav_itineraries") })
|
|
151
155
|
}) : null,
|
|
152
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ l(d, {
|
|
153
157
|
className: "hover:text-slate-950",
|
|
154
158
|
to: `${L}${V}#contact`,
|
|
155
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ l("span", { children: x("nav_contact") })
|
|
156
160
|
})
|
|
157
161
|
]
|
|
158
162
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ u("div", {
|
|
160
164
|
className: "flex shrink-0 items-center gap-1.5 sm:gap-2",
|
|
161
165
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ l(a, {
|
|
163
167
|
languages: K,
|
|
164
168
|
className: "hidden sm:inline-flex"
|
|
165
169
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ l(i, {
|
|
167
171
|
asChild: !0,
|
|
168
172
|
variant: "outline",
|
|
169
173
|
size: "sm",
|
|
170
174
|
className: "relative h-9 w-9 gap-2 px-0 sm:w-auto sm:px-3",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
-
to:
|
|
173
|
-
"aria-label":
|
|
175
|
+
children: /* @__PURE__ */ u(d, {
|
|
176
|
+
to: be,
|
|
177
|
+
"aria-label": E ? `${x("cart_button")} (${T})` : x("cart_button"),
|
|
174
178
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ l(he, {
|
|
176
180
|
className: "h-4 w-4",
|
|
177
181
|
"aria-hidden": "true"
|
|
178
182
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ l("span", {
|
|
180
184
|
className: "hidden sm:inline",
|
|
181
|
-
children:
|
|
185
|
+
children: x("cart_button")
|
|
182
186
|
}),
|
|
183
|
-
|
|
187
|
+
E && T > 0 ? /* @__PURE__ */ l(ie, {
|
|
184
188
|
className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-xs",
|
|
185
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ l("span", { children: T })
|
|
186
190
|
}) : null
|
|
187
191
|
]
|
|
188
192
|
})
|
|
189
193
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ l(i, {
|
|
191
195
|
asChild: !0,
|
|
192
196
|
size: "sm",
|
|
193
197
|
className: "h-9 gap-1.5 px-2 sm:gap-2 sm:px-3",
|
|
194
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ u(d, {
|
|
195
199
|
to: H,
|
|
196
|
-
"aria-label":
|
|
200
|
+
"aria-label": x("cta_book_now"),
|
|
197
201
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ l("span", {
|
|
199
203
|
className: "sm:hidden",
|
|
200
|
-
children:
|
|
204
|
+
children: x("cta_book_short")
|
|
201
205
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ l("span", {
|
|
203
207
|
className: "hidden sm:inline",
|
|
204
|
-
children:
|
|
208
|
+
children: x("cta_book_now")
|
|
205
209
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ l(_, {
|
|
207
211
|
className: "h-4 w-4",
|
|
208
212
|
"aria-hidden": "true"
|
|
209
213
|
})
|
|
210
214
|
]
|
|
211
215
|
})
|
|
212
216
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ u(ae, {
|
|
214
218
|
open: A,
|
|
215
219
|
onOpenChange: j,
|
|
216
220
|
direction: "right",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ l(s, {
|
|
218
222
|
asChild: !0,
|
|
219
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ l(i, {
|
|
220
224
|
type: "button",
|
|
221
225
|
variant: "outline",
|
|
222
226
|
size: "icon",
|
|
223
227
|
className: "h-9 w-9 md:hidden",
|
|
224
|
-
"aria-label":
|
|
225
|
-
children: /* @__PURE__ */
|
|
228
|
+
"aria-label": x("mobile_menu_open"),
|
|
229
|
+
children: /* @__PURE__ */ l(me, {
|
|
226
230
|
className: "h-4 w-4",
|
|
227
231
|
"aria-hidden": "true"
|
|
228
232
|
})
|
|
229
233
|
})
|
|
230
|
-
}), /* @__PURE__ */
|
|
234
|
+
}), /* @__PURE__ */ u(oe, {
|
|
231
235
|
className: "w-[min(22rem,calc(100vw-1.5rem))] bg-white",
|
|
232
|
-
"aria-label":
|
|
233
|
-
closeLabel:
|
|
236
|
+
"aria-label": x("mobile_menu_label"),
|
|
237
|
+
closeLabel: x("mobile_menu_close"),
|
|
234
238
|
showCloseButton: !0,
|
|
235
239
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ u(ce, {
|
|
237
241
|
className: "border-b border-slate-200 px-5 pb-4 pt-6 text-left",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ l(le, { children: U }), /* @__PURE__ */ l(se, {
|
|
239
243
|
className: "break-words",
|
|
240
244
|
children: Y
|
|
241
245
|
})]
|
|
242
246
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ l("nav", {
|
|
244
248
|
className: "grid gap-1 overflow-y-auto p-3",
|
|
245
|
-
"aria-label":
|
|
246
|
-
children:
|
|
249
|
+
"aria-label": x("mobile_menu_label"),
|
|
250
|
+
children: Ce.map((e) => /* @__PURE__ */ l(o, {
|
|
247
251
|
asChild: !0,
|
|
248
|
-
children: /* @__PURE__ */
|
|
252
|
+
children: /* @__PURE__ */ l(d, {
|
|
249
253
|
to: e.to,
|
|
250
254
|
className: "flex min-h-11 items-center rounded-lg px-3 py-2 text-sm font-medium text-slate-700 transition-colors hover:bg-slate-100 hover:text-slate-950",
|
|
251
255
|
children: e.label
|
|
252
256
|
})
|
|
253
257
|
}, `${e.to}-${e.label}`))
|
|
254
258
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ u("div", {
|
|
256
260
|
className: "mt-auto grid gap-3 border-t border-slate-200 p-4",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ l(o, {
|
|
258
262
|
asChild: !0,
|
|
259
|
-
children: /* @__PURE__ */
|
|
263
|
+
children: /* @__PURE__ */ l(i, {
|
|
260
264
|
asChild: !0,
|
|
261
265
|
className: "w-full gap-2",
|
|
262
|
-
children: /* @__PURE__ */
|
|
266
|
+
children: /* @__PURE__ */ u(d, {
|
|
263
267
|
to: H,
|
|
264
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ l("span", { children: x("cta_book_now") }), /* @__PURE__ */ l(_, {
|
|
265
269
|
className: "h-4 w-4",
|
|
266
270
|
"aria-hidden": "true"
|
|
267
271
|
})]
|
|
268
272
|
})
|
|
269
273
|
})
|
|
270
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ l(a, {
|
|
271
275
|
languages: K,
|
|
272
276
|
className: "h-10 w-full justify-between"
|
|
273
277
|
})]
|
|
@@ -283,4 +287,4 @@ function x({ storefrontConfiguration: r, whatsappHref: x, whatsappPhoneDisplay:
|
|
|
283
287
|
});
|
|
284
288
|
}
|
|
285
289
|
//#endregion
|
|
286
|
-
export {
|
|
290
|
+
export { y as Header };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAIvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAItE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,kBAAkB,EAAE,6BAA6B,CAAA;CAClD,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,uBAAuB,EACvB,kBAAkB,GACnB,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAIvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAItE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,kBAAkB,EAAE,6BAA6B,CAAA;CAClD,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,uBAAuB,EACvB,kBAAkB,GACnB,EAAE,WAAW,2CA4Eb"}
|
|
@@ -10,62 +10,61 @@ import "../WhatsAppFloatingButton/index.js";
|
|
|
10
10
|
import { hasStorefrontRichTextContent as c } from "../../lib/richText.js";
|
|
11
11
|
import { STOREFRONT_TOASTER_ID as l } from "../../lib/toast.js";
|
|
12
12
|
import { Provider as u } from "../../ui/tooltip.js";
|
|
13
|
-
import { useEffect as d } from "react";
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { RootProvider as
|
|
16
|
-
import { Outlet as
|
|
17
|
-
import { useTranslation as
|
|
18
|
-
import { Toaster as
|
|
13
|
+
import { useEffect as d, useState as f } from "react";
|
|
14
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
+
import { RootProvider as g } from "@rpcbase/client";
|
|
16
|
+
import { Outlet as _, useLocation as v, useParams as y } from "@rpcbase/router";
|
|
17
|
+
import { useTranslation as b } from "react-i18next";
|
|
18
|
+
import { Toaster as x } from "sonner";
|
|
19
19
|
//#region src/components/Layout/index.tsx
|
|
20
|
-
function
|
|
21
|
-
let { storeSlug:
|
|
20
|
+
function S({ storefrontConfiguration: S, storefrontProducts: C }) {
|
|
21
|
+
let { storeSlug: w, referenceId: T } = y(), E = v(), { i18n: D } = b(), [O, k] = f(!1);
|
|
22
22
|
d(() => {
|
|
23
|
-
document.documentElement.setAttribute("data-hydrated", "true");
|
|
23
|
+
k(!0), document.documentElement.setAttribute("data-hydrated", "true");
|
|
24
24
|
}, []);
|
|
25
|
-
let
|
|
26
|
-
storefrontConfiguration:
|
|
27
|
-
language:
|
|
28
|
-
}),
|
|
29
|
-
return /* @__PURE__ */
|
|
25
|
+
let A = t({
|
|
26
|
+
storefrontConfiguration: S,
|
|
27
|
+
language: D.language
|
|
28
|
+
}), j = A?.href, M = typeof T == "string" && T.trim().length > 0, N = M && new URLSearchParams(E.search).get("pdf") === "1";
|
|
29
|
+
return /* @__PURE__ */ h(g, { children: [/* @__PURE__ */ m(x, {
|
|
30
30
|
id: l,
|
|
31
31
|
closeButton: !0,
|
|
32
32
|
position: "bottom-center",
|
|
33
33
|
theme: "dark"
|
|
34
|
-
}), /* @__PURE__ */
|
|
35
|
-
storeSlug:
|
|
36
|
-
products:
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
-
className: `loczer-storefront flex w-full min-w-0 flex-col overflow-x-clip bg-background text-foreground ${
|
|
39
|
-
children:
|
|
40
|
-
className: `flex-1 ${
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
}) : /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
storefrontConfiguration:
|
|
45
|
-
whatsappHref:
|
|
46
|
-
whatsappPhoneDisplay:
|
|
34
|
+
}), /* @__PURE__ */ m(u, { children: /* @__PURE__ */ m(e, {
|
|
35
|
+
storeSlug: w ?? "",
|
|
36
|
+
products: C,
|
|
37
|
+
children: /* @__PURE__ */ m("div", {
|
|
38
|
+
className: `loczer-storefront flex w-full min-w-0 flex-col overflow-x-clip bg-background text-foreground ${M && !N ? "h-dvh overflow-hidden" : "min-h-screen"}`,
|
|
39
|
+
children: M ? /* @__PURE__ */ m("main", {
|
|
40
|
+
className: `flex-1 ${N ? "bg-white" : "overflow-hidden"}`,
|
|
41
|
+
children: /* @__PURE__ */ m(_, {})
|
|
42
|
+
}) : /* @__PURE__ */ h(p, { children: [
|
|
43
|
+
/* @__PURE__ */ m(r, {
|
|
44
|
+
storefrontConfiguration: S,
|
|
45
|
+
whatsappHref: j,
|
|
46
|
+
whatsappPhoneDisplay: A?.phoneDisplay
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ m("main", {
|
|
49
49
|
className: "min-w-0 flex-1",
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ m(_, {})
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
storeSlug:
|
|
54
|
-
shop:
|
|
55
|
-
whatsappHref:
|
|
56
|
-
whatsappPhoneDisplay:
|
|
57
|
-
openingHours:
|
|
58
|
-
openingHoursOverrides:
|
|
59
|
-
timeZone:
|
|
60
|
-
showInsuranceTerms: c(
|
|
52
|
+
/* @__PURE__ */ m(n, {
|
|
53
|
+
storeSlug: w,
|
|
54
|
+
shop: S?.shop,
|
|
55
|
+
whatsappHref: j,
|
|
56
|
+
whatsappPhoneDisplay: A?.phoneDisplay,
|
|
57
|
+
openingHours: S?.bookingEngine.shop.openingHours,
|
|
58
|
+
openingHoursOverrides: S?.bookingEngine.shop.openingHoursOverrides,
|
|
59
|
+
timeZone: S?.bookingEngine.shop.timeZone,
|
|
60
|
+
showInsuranceTerms: c(S?.information?.insuranceTerms)
|
|
61
61
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
O &&
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */ p(o, { storefrontConfiguration: x })
|
|
62
|
+
/* @__PURE__ */ m(i, {}),
|
|
63
|
+
O ? /* @__PURE__ */ h(p, { children: [j && S?.content?.showWhatsappFloatingButton !== !1 ? /* @__PURE__ */ m(s, { href: j }) : null, /* @__PURE__ */ m(a, {})] }) : null,
|
|
64
|
+
/* @__PURE__ */ m(o, { storefrontConfiguration: S })
|
|
66
65
|
] })
|
|
67
66
|
})
|
|
68
67
|
}) })] });
|
|
69
68
|
}
|
|
70
69
|
//#endregion
|
|
71
|
-
export {
|
|
70
|
+
export { S as Layout };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TestimonialsSection/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TestimonialsSection/index.tsx"],"names":[],"mappings":"AA4KA,eAAO,MAAM,mBAAmB,sDAmP/B,CAAA"}
|
|
@@ -49,7 +49,7 @@ var p = ({ className: t }) => /* @__PURE__ */ c("div", {
|
|
|
49
49
|
]
|
|
50
50
|
});
|
|
51
51
|
function h({ review: t, enableExpand: n = !0, defaultOriginalUrl: r }) {
|
|
52
|
-
let { t: s } = u(), d = i(a(t.name)), p = t.source === "
|
|
52
|
+
let { t: s } = u(), d = i(a(t.name)), p = t.source === "google" ? s("testimonials.google_review") : void 0, [m, h] = o.useState(!1), [g, v] = o.useState(!1), y = o.useRef(null), b = n && m ? 6 : 4, x = _(t.originalUrl || r), S = n && g, C = typeof x == "string" && x.length > 0;
|
|
53
53
|
return o.useEffect(() => {
|
|
54
54
|
if (!n) return;
|
|
55
55
|
let e = y.current;
|
package/dist/i18n/en.d.ts
CHANGED
package/dist/i18n/en.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4gBtB,CAAA"}
|
package/dist/i18n/en.js
CHANGED
package/dist/i18n/fr.d.ts
CHANGED
package/dist/i18n/fr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6gBtB,CAAA"}
|
package/dist/i18n/fr.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4317,7 +4317,6 @@ export declare const storefrontEn: {
|
|
|
4317
4317
|
view_original: string;
|
|
4318
4318
|
google_user: string;
|
|
4319
4319
|
google_review: string;
|
|
4320
|
-
tripadvisor_review: string;
|
|
4321
4320
|
see_more: string;
|
|
4322
4321
|
see_less: string;
|
|
4323
4322
|
};
|
|
@@ -4875,7 +4874,6 @@ export declare const storefrontFr: {
|
|
|
4875
4874
|
view_original: string;
|
|
4876
4875
|
google_user: string;
|
|
4877
4876
|
google_review: string;
|
|
4878
|
-
tripadvisor_review: string;
|
|
4879
4877
|
see_more: string;
|
|
4880
4878
|
see_less: string;
|
|
4881
4879
|
};
|
|
@@ -5,16 +5,10 @@ export declare const requestSchema: z.ZodObject<{
|
|
|
5
5
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
export type RequestPayload = z.infer<typeof requestSchema>;
|
|
8
|
-
export declare const reviewSourceSchema: z.
|
|
9
|
-
google: "google";
|
|
10
|
-
tripadvisor: "tripadvisor";
|
|
11
|
-
}>;
|
|
8
|
+
export declare const reviewSourceSchema: z.ZodLiteral<"google">;
|
|
12
9
|
export type ReviewSource = z.infer<typeof reviewSourceSchema>;
|
|
13
10
|
export declare const shopReviewsProviderSchema: z.ZodObject<{
|
|
14
|
-
source: z.
|
|
15
|
-
google: "google";
|
|
16
|
-
tripadvisor: "tripadvisor";
|
|
17
|
-
}>;
|
|
11
|
+
source: z.ZodLiteral<"google">;
|
|
18
12
|
rating: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
13
|
totalReviewsCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
20
14
|
providerUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -26,10 +20,7 @@ export declare const shopReviewsProviderSchema: z.ZodObject<{
|
|
|
26
20
|
export type ShopReviewsProvider = z.infer<typeof shopReviewsProviderSchema>;
|
|
27
21
|
export declare const publicReviewItemSchema: z.ZodObject<{
|
|
28
22
|
id: z.ZodString;
|
|
29
|
-
source: z.
|
|
30
|
-
google: "google";
|
|
31
|
-
tripadvisor: "tripadvisor";
|
|
32
|
-
}>;
|
|
23
|
+
source: z.ZodLiteral<"google">;
|
|
33
24
|
authorMasked: z.ZodString;
|
|
34
25
|
avatarSeed: z.ZodNumber;
|
|
35
26
|
rating: z.ZodNumber;
|
|
@@ -42,10 +33,7 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
42
33
|
success: z.ZodBoolean;
|
|
43
34
|
message: z.ZodOptional<z.ZodString>;
|
|
44
35
|
providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
45
|
-
source: z.
|
|
46
|
-
google: "google";
|
|
47
|
-
tripadvisor: "tripadvisor";
|
|
48
|
-
}>;
|
|
36
|
+
source: z.ZodLiteral<"google">;
|
|
49
37
|
rating: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
50
38
|
totalReviewsCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
51
39
|
providerUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -56,10 +44,7 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
56
44
|
}, z.core.$strip>>>;
|
|
57
45
|
reviews: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
58
46
|
id: z.ZodString;
|
|
59
|
-
source: z.
|
|
60
|
-
google: "google";
|
|
61
|
-
tripadvisor: "tripadvisor";
|
|
62
|
-
}>;
|
|
47
|
+
source: z.ZodLiteral<"google">;
|
|
63
48
|
authorMasked: z.ZodString;
|
|
64
49
|
avatarSeed: z.ZodNumber;
|
|
65
50
|
rating: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefrontReviews.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontReviews.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,mCAAmC,CAAA;AAErD,eAAO,MAAM,aAAa;;;iBAGxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"storefrontReviews.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontReviews.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,mCAAmC,CAAA;AAErD,eAAO,MAAM,aAAa;;;iBAGxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,eAAO,MAAM,kBAAkB,wBAAsB,CAAA;AACrD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,yBAAyB;;;;;;;;;iBASpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,sBAAsB;;;;;;;;;iBASjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;iBAKzB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { z as e } from "zod";
|
|
|
3
3
|
var t = "/api/public/storefront/reviews", n = e.object({
|
|
4
4
|
storeSlug: e.string().trim().min(1).toLowerCase(),
|
|
5
5
|
limit: e.number().int().positive().max(200).optional()
|
|
6
|
-
}), r = e.
|
|
6
|
+
}), r = e.literal("google"), i = e.object({
|
|
7
7
|
source: r,
|
|
8
8
|
rating: e.number().min(0).max(5).nullable().optional(),
|
|
9
9
|
totalReviewsCount: e.number().int().nonnegative().nullable().optional(),
|