@loczer/storefront-sdk 0.185.0 → 0.187.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/StorefrontProvider.d.ts +3 -0
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/components/Header/index.js +30 -29
- package/dist/components/PlaygroundDevFloatingButton/index.d.ts.map +1 -1
- package/dist/components/PlaygroundDevFloatingButton/index.js +109 -102
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +3 -2
- package/dist/index.d.ts +25 -0
- package/dist/index.js +59 -59
- package/dist/lib/checkoutPaymentDecision.d.ts +4 -0
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +4 -3
- package/dist/lib/checkoutSubmit.d.ts +3 -0
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +32 -30
- package/dist/lib/playgroundDevSettings.d.ts +3 -2
- package/dist/lib/playgroundDevSettings.d.ts.map +1 -1
- package/dist/lib/playgroundDevSettings.js +28 -27
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +120 -120
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +305 -303
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +2 -2
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +17 -0
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +26 -21
- package/package.json +1 -1
|
@@ -125,6 +125,7 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
|
|
|
125
125
|
languages?: string[] | undefined;
|
|
126
126
|
} | undefined;
|
|
127
127
|
content?: {
|
|
128
|
+
heroMode: "current_booking_hero" | "booking_bar_overlay_hero" | "vertical_marquee_hero";
|
|
128
129
|
galleryImageIds: string[];
|
|
129
130
|
whatsappPhone1Enabled: boolean;
|
|
130
131
|
whatsappPhone2Enabled: boolean;
|
|
@@ -358,6 +359,7 @@ export declare function useStorefrontConfig(): {
|
|
|
358
359
|
languages?: string[] | undefined;
|
|
359
360
|
} | undefined;
|
|
360
361
|
content?: {
|
|
362
|
+
heroMode: "current_booking_hero" | "booking_bar_overlay_hero" | "vertical_marquee_hero";
|
|
361
363
|
galleryImageIds: string[];
|
|
362
364
|
whatsappPhone1Enabled: boolean;
|
|
363
365
|
whatsappPhone2Enabled: boolean;
|
|
@@ -581,6 +583,7 @@ export declare function useStorefrontConfig(): {
|
|
|
581
583
|
languages?: string[] | undefined;
|
|
582
584
|
} | undefined;
|
|
583
585
|
content?: {
|
|
586
|
+
heroMode: "current_booking_hero" | "booking_bar_overlay_hero" | "vertical_marquee_hero";
|
|
584
587
|
galleryImageIds: string[];
|
|
585
588
|
whatsappPhone1Enabled: boolean;
|
|
586
589
|
whatsappPhone2Enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorefrontProvider.d.ts","sourceRoot":"","sources":["../src/StorefrontProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAiC,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAEjG,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAGvB,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,uBAAuB,EAAE,uBAAuB,CAAA;IAChD,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,WAAW,EAAE,gBAAgB,EAAE,CAAA;IAC/B,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,kBAAkB,EAAE,gBAAgB,EAAE,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,sBAAsB,CAAA;CACjC,CAAA;AAKD,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"StorefrontProvider.d.ts","sourceRoot":"","sources":["../src/StorefrontProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAiC,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAEjG,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAGvB,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,uBAAuB,EAAE,uBAAuB,CAAA;IAChD,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,WAAW,EAAE,gBAAgB,EAAE,CAAA;IAC/B,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,kBAAkB,EAAE,gBAAgB,EAAE,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,sBAAsB,CAAA;CACjC,CAAA;AAKD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DA,CAAA;AAGnB,MAAM,CAAC,OAAO,UAAU,kBAAkB,4CAqBzC;AAED,wBAAgB,aAAa,2BAQ5B;AAED,wBAAgB,qBAAqB,uCAEpC;AAED,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMlC;AAED,wBAAgB,8BAA8B,IAAI,sBAAsB,CAGvE;AAED,wBAAgB,qBAAqB;;;EAGpC;AAED,wBAAgB,4BAA4B;;;EAG3C"}
|
|
@@ -12,27 +12,27 @@ import { cn as d, useScrollHideOnDown as f } from "@rpcbase/ui";
|
|
|
12
12
|
import { useMediaQuery as p, useThrottledMeasure as m } from "@rpcbase/client";
|
|
13
13
|
import { Link as h, useLocation as g, useParams as _ } from "@rpcbase/router";
|
|
14
14
|
import { useTranslation as v } from "react-i18next";
|
|
15
|
-
import { ArrowRight as y,
|
|
15
|
+
import { ArrowRight as y, ShoppingCart as b } from "lucide-react";
|
|
16
16
|
//#region src/components/Header/index.tsx
|
|
17
|
-
var
|
|
17
|
+
var x = 36, S = (e, t) => {
|
|
18
18
|
let n = e?.trim() ?? "";
|
|
19
19
|
return n ? r(n, t ?? "") : "";
|
|
20
20
|
};
|
|
21
|
-
function
|
|
22
|
-
let { t:
|
|
23
|
-
enabled:
|
|
21
|
+
function C({ storefrontConfiguration: r, whatsappHref: C, whatsappPhoneDisplay: w }) {
|
|
22
|
+
let { t: T, i18n: E } = v(), { storeSlug: D } = _(), O = g(), { itemCount: k } = t(), A = p("(max-width: 640px)"), [j, M] = m(), N = M?.height ?? x, P = f({
|
|
23
|
+
enabled: A,
|
|
24
24
|
thresholdPx: N
|
|
25
|
-
}), F =
|
|
26
|
-
let e =
|
|
27
|
-
|
|
28
|
-
}, L = `/${
|
|
25
|
+
}), F = A && P ? `translateY(-${N}px)` : "translateY(0)", I = () => {
|
|
26
|
+
let e = E.language.startsWith("fr") ? "en" : "fr";
|
|
27
|
+
E.changeLanguage(e);
|
|
28
|
+
}, L = `/${D ?? ""}`, R = e(new URLSearchParams(O.search), D).toString(), z = R ? `?${R}` : "", B = `${L}/booking${z}`, V = `${L}/checkout${z}`, H = r?.shop.name?.trim() ?? "", U = r?.shop.emailAddress?.trim() ?? "", W = r?.workspace?.workspaceLanguage, G = n(r?.content?.tagline, E.language, W).trim(), K = o(r?.shop), q = G || K || "[Missing shop address]", J = !G && !K, Y = n(r?.content?.topBannerMessage, E.language, W).trim() || T("top_bar_message"), X = S(r?.content?.logoWideImageId, D), Z = S(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, D), Q = X.length > 0, $ = Z.length > 0;
|
|
29
29
|
return /* @__PURE__ */ u("div", {
|
|
30
30
|
className: "sticky top-0 z-30",
|
|
31
31
|
children: [/* @__PURE__ */ l("div", {
|
|
32
32
|
className: "transition-transform duration-300",
|
|
33
33
|
style: { transform: F },
|
|
34
34
|
children: /* @__PURE__ */ l("div", {
|
|
35
|
-
ref:
|
|
35
|
+
ref: j,
|
|
36
36
|
className: "bg-slate-950 text-white",
|
|
37
37
|
children: /* @__PURE__ */ u("div", {
|
|
38
38
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-3 px-4 py-2 text-xs sm:px-6",
|
|
@@ -49,18 +49,18 @@ function w({ storefrontConfiguration: r, whatsappHref: w, whatsappPhoneDisplay:
|
|
|
49
49
|
}) : /* @__PURE__ */ l("span", {
|
|
50
50
|
className: "inline-flex items-center rounded-md px-2 py-1 text-destructive",
|
|
51
51
|
children: a
|
|
52
|
-
}),
|
|
52
|
+
}), C ? /* @__PURE__ */ u("a", {
|
|
53
53
|
className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
|
|
54
|
-
href:
|
|
54
|
+
href: C,
|
|
55
55
|
target: "_blank",
|
|
56
56
|
rel: "noreferrer",
|
|
57
|
-
"aria-label": `WhatsApp${
|
|
57
|
+
"aria-label": `WhatsApp${w ? ` ${w}` : ""}`,
|
|
58
58
|
children: [/* @__PURE__ */ l("img", {
|
|
59
59
|
src: i,
|
|
60
60
|
className: "h-5 w-5 shrink-0",
|
|
61
61
|
alt: "",
|
|
62
62
|
"aria-hidden": "true"
|
|
63
|
-
}),
|
|
63
|
+
}), w ? /* @__PURE__ */ l("span", { children: w }) : null]
|
|
64
64
|
}) : null]
|
|
65
65
|
})]
|
|
66
66
|
})
|
|
@@ -83,10 +83,11 @@ function w({ storefrontConfiguration: r, whatsappHref: w, whatsappPhoneDisplay:
|
|
|
83
83
|
"aria-hidden": "true"
|
|
84
84
|
})
|
|
85
85
|
}) : Q ? null : /* @__PURE__ */ l("span", {
|
|
86
|
-
className: "inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-
|
|
87
|
-
children: /* @__PURE__ */ l(
|
|
88
|
-
className: "
|
|
89
|
-
"aria-hidden": "true"
|
|
86
|
+
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",
|
|
87
|
+
children: /* @__PURE__ */ l("span", {
|
|
88
|
+
className: "text-lg font-semibold leading-none",
|
|
89
|
+
"aria-hidden": "true",
|
|
90
|
+
children: "?"
|
|
90
91
|
})
|
|
91
92
|
}), /* @__PURE__ */ u("span", {
|
|
92
93
|
className: "flex min-w-0 flex-col leading-tight",
|
|
@@ -109,22 +110,22 @@ function w({ storefrontConfiguration: r, whatsappHref: w, whatsappPhoneDisplay:
|
|
|
109
110
|
/* @__PURE__ */ l(h, {
|
|
110
111
|
className: "hover:text-slate-950",
|
|
111
112
|
to: `${L}${z}#categories`,
|
|
112
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
113
|
+
children: /* @__PURE__ */ l("span", { children: T("nav_categories") })
|
|
113
114
|
}),
|
|
114
115
|
/* @__PURE__ */ l(h, {
|
|
115
116
|
className: "hover:text-slate-950",
|
|
116
117
|
to: `${L}${z}#featured`,
|
|
117
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
118
|
+
children: /* @__PURE__ */ l("span", { children: T("nav_featured") })
|
|
118
119
|
}),
|
|
119
120
|
/* @__PURE__ */ l(h, {
|
|
120
121
|
className: "hover:text-slate-950",
|
|
121
122
|
to: B,
|
|
122
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
123
|
+
children: /* @__PURE__ */ l("span", { children: T("nav_products") })
|
|
123
124
|
}),
|
|
124
125
|
/* @__PURE__ */ l(h, {
|
|
125
126
|
className: "hover:text-slate-950",
|
|
126
127
|
to: `${L}${z}#contact`,
|
|
127
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
128
|
+
children: /* @__PURE__ */ l("span", { children: T("nav_contact") })
|
|
128
129
|
})
|
|
129
130
|
]
|
|
130
131
|
}),
|
|
@@ -136,24 +137,24 @@ function w({ storefrontConfiguration: r, whatsappHref: w, whatsappPhoneDisplay:
|
|
|
136
137
|
size: "sm",
|
|
137
138
|
className: "hidden sm:inline-flex",
|
|
138
139
|
onClick: I,
|
|
139
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
140
|
+
children: /* @__PURE__ */ l("span", { children: T("language_toggle") })
|
|
140
141
|
}),
|
|
141
142
|
/* @__PURE__ */ l(c, {
|
|
142
143
|
asChild: !0,
|
|
143
144
|
variant: "outline",
|
|
144
145
|
size: "sm",
|
|
145
|
-
className: d("relative gap-2",
|
|
146
|
+
className: d("relative gap-2", k > 0 ? "inline-flex" : "hidden"),
|
|
146
147
|
children: /* @__PURE__ */ u(h, {
|
|
147
148
|
to: V,
|
|
148
149
|
children: [
|
|
149
|
-
/* @__PURE__ */ l(
|
|
150
|
+
/* @__PURE__ */ l(b, {
|
|
150
151
|
className: "h-4 w-4",
|
|
151
152
|
"aria-hidden": "true"
|
|
152
153
|
}),
|
|
153
|
-
/* @__PURE__ */ l("span", { children:
|
|
154
|
+
/* @__PURE__ */ l("span", { children: T("cart_button") }),
|
|
154
155
|
/* @__PURE__ */ l(s, {
|
|
155
156
|
className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-xs",
|
|
156
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
157
|
+
children: /* @__PURE__ */ l("span", { children: k })
|
|
157
158
|
})
|
|
158
159
|
]
|
|
159
160
|
})
|
|
@@ -164,7 +165,7 @@ function w({ storefrontConfiguration: r, whatsappHref: w, whatsappPhoneDisplay:
|
|
|
164
165
|
className: "gap-2",
|
|
165
166
|
children: /* @__PURE__ */ u(h, {
|
|
166
167
|
to: B,
|
|
167
|
-
children: [/* @__PURE__ */ l("span", { children:
|
|
168
|
+
children: [/* @__PURE__ */ l("span", { children: T("cta_book_now") }), /* @__PURE__ */ l(y, {
|
|
168
169
|
className: "h-4 w-4",
|
|
169
170
|
"aria-hidden": "true"
|
|
170
171
|
})]
|
|
@@ -178,4 +179,4 @@ function w({ storefrontConfiguration: r, whatsappHref: w, whatsappPhoneDisplay:
|
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
181
|
//#endregion
|
|
181
|
-
export {
|
|
182
|
+
export { C as Header };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PlaygroundDevFloatingButton/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PlaygroundDevFloatingButton/index.tsx"],"names":[],"mappings":"AAqDA,eAAO,MAAM,2BAA2B,sDAoWvC,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import { Button as t } from "../../ui/button.js";
|
|
3
3
|
import n from "../../chunks/assets/dev-D2oG3j7S.js";
|
|
4
|
-
import {
|
|
5
|
-
import { useCallback as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import
|
|
4
|
+
import { resetPlaygroundDevSettings as r, usePlaygroundDevSettings as i, writePlaygroundDevSettings as a } from "../../lib/playgroundDevSettings.js";
|
|
5
|
+
import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import p from "interactjs";
|
|
8
8
|
//#region src/components/PlaygroundDevFloatingButton/index.tsx
|
|
9
|
-
var
|
|
9
|
+
var m = [
|
|
10
10
|
{
|
|
11
11
|
value: "current_booking_hero",
|
|
12
12
|
label: "Current booking hero",
|
|
@@ -22,58 +22,58 @@ var h = [
|
|
|
22
22
|
label: "Vertical marquee hero",
|
|
23
23
|
hint: "Keep the overlay booking bar and swap the static image for a vertical animated gallery"
|
|
24
24
|
}
|
|
25
|
-
],
|
|
26
|
-
let
|
|
25
|
+
], h = () => {
|
|
26
|
+
let h = i(), [g, _] = u(!1), [v, y] = u({
|
|
27
27
|
horizontal: "left",
|
|
28
28
|
vertical: "above"
|
|
29
|
-
}),
|
|
29
|
+
}), b = l(null), x = l(null), S = l(null), C = l(!1), w = l(!1), T = l({
|
|
30
30
|
x: 0,
|
|
31
31
|
y: 0
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
...
|
|
32
|
+
}), E = l(null), D = l(null), O = h.heroMode !== null, k = o((e) => {
|
|
33
|
+
a({
|
|
34
|
+
...h,
|
|
35
35
|
heroMode: e
|
|
36
36
|
});
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, []),
|
|
40
|
-
let e =
|
|
37
|
+
}, [h]), A = o(() => {
|
|
38
|
+
b.current != null && (window.clearTimeout(b.current), b.current = null);
|
|
39
|
+
}, []), j = o(() => {
|
|
40
|
+
let e = x.current, t = S.current;
|
|
41
41
|
if (!e || !t || typeof window > "u") return;
|
|
42
42
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = n.left + r.width + 16 > i ? "right" : "left", o = n.top - r.height - 16 < 0 ? "below" : "above";
|
|
43
|
-
|
|
43
|
+
y((e) => e.horizontal === a && e.vertical === o ? e : {
|
|
44
44
|
horizontal: a,
|
|
45
45
|
vertical: o
|
|
46
46
|
});
|
|
47
|
-
}, []),
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
}, []), M = o(() => {
|
|
48
|
+
C.current || w.current || (A(), _(!0), window.requestAnimationFrame(() => {
|
|
49
|
+
j();
|
|
50
50
|
}));
|
|
51
|
-
}, [
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
}, [A, j]), N = o(() => {
|
|
52
|
+
C.current || w.current || (A(), b.current = window.setTimeout(() => {
|
|
53
|
+
_(!1), b.current = null;
|
|
54
54
|
}, 120));
|
|
55
|
-
}, [
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
return
|
|
59
|
-
if (!
|
|
60
|
-
|
|
61
|
-
let e = () =>
|
|
55
|
+
}, [A]), P = o(() => {
|
|
56
|
+
A(), _(!1);
|
|
57
|
+
}, [A]);
|
|
58
|
+
return s(() => {
|
|
59
|
+
if (!g) return;
|
|
60
|
+
j();
|
|
61
|
+
let e = () => j();
|
|
62
62
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
63
|
-
}, [
|
|
64
|
-
let e =
|
|
63
|
+
}, [g, j]), s(() => () => A(), [A]), s(() => {
|
|
64
|
+
let e = x.current;
|
|
65
65
|
if (!e || typeof window > "u") return;
|
|
66
66
|
let t = e.getBoundingClientRect();
|
|
67
|
-
|
|
67
|
+
E.current = {
|
|
68
68
|
left: t.left,
|
|
69
69
|
top: t.top,
|
|
70
70
|
width: t.width,
|
|
71
71
|
height: t.height
|
|
72
72
|
};
|
|
73
73
|
let n = () => {
|
|
74
|
-
if (!
|
|
75
|
-
let { left: e, top: t, width: n, height: r } =
|
|
76
|
-
return
|
|
74
|
+
if (!E.current) return T.current;
|
|
75
|
+
let { left: e, top: t, width: n, height: r } = E.current, i = 8 - e, a = 8 - t, o = window.innerWidth - 8 - n - e, s = window.innerHeight - 8 - r - t, c = Math.min(Math.max(T.current.x, i), o), l = Math.min(Math.max(T.current.y, a), s);
|
|
76
|
+
return T.current = {
|
|
77
77
|
x: c,
|
|
78
78
|
y: l
|
|
79
79
|
}, {
|
|
@@ -88,124 +88,131 @@ var h = [
|
|
|
88
88
|
let { x: t, y: r } = n();
|
|
89
89
|
e.style.transform = `translate3d(${t}px, ${r}px, 0)`;
|
|
90
90
|
}, i = () => {
|
|
91
|
-
|
|
91
|
+
D.current != null && (cancelAnimationFrame(D.current), D.current = null), w.current = !1;
|
|
92
92
|
}, a = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches, o = (t, o) => {
|
|
93
93
|
if (a) {
|
|
94
|
-
r(),
|
|
94
|
+
r(), w.current = !1;
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
let s = performance.now();
|
|
98
|
-
|
|
98
|
+
w.current = !0;
|
|
99
99
|
let c = .92, l = .7, u = (r) => {
|
|
100
100
|
let a = (r - s) / 1e3;
|
|
101
|
-
s = r,
|
|
101
|
+
s = r, T.current.x += t * a, T.current.y += o * a;
|
|
102
102
|
let { minX: d, minY: f, maxX: p, maxY: m } = n();
|
|
103
|
-
if (
|
|
103
|
+
if (T.current.x <= d + .001 && t < 0 ? (T.current.x = d, t = -t * l) : T.current.x >= p - .001 && t > 0 && (T.current.x = p, t = -t * l), T.current.y <= f + .001 && o < 0 ? (T.current.y = f, o = -o * l) : T.current.y >= m - .001 && o > 0 && (T.current.y = m, o = -o * l), t *= c, o *= c, e.style.transform = `translate3d(${T.current.x}px, ${T.current.y}px, 0)`, Math.hypot(t, o) < 20) {
|
|
104
104
|
i();
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
D.current = requestAnimationFrame(u);
|
|
108
108
|
};
|
|
109
|
-
|
|
110
|
-
}, s =
|
|
111
|
-
i(),
|
|
109
|
+
D.current = requestAnimationFrame(u);
|
|
110
|
+
}, s = p(e).draggable({ inertia: !1 }).styleCursor(!1).on("dragstart", () => {
|
|
111
|
+
i(), C.current = !0, _(!1), A();
|
|
112
112
|
}).on("dragmove", (e) => {
|
|
113
|
-
|
|
113
|
+
T.current.x += e.dx, T.current.y += e.dy, r();
|
|
114
114
|
}).on("dragend", (e) => {
|
|
115
115
|
let t = Number.isFinite(e.velocityX) ? e.velocityX : 0, n = Number.isFinite(e.velocityY) ? e.velocityY : 0;
|
|
116
|
-
|
|
116
|
+
C.current = !1, Math.hypot(t, n) >= 10 ? o(t, n) : (r(), i()), j();
|
|
117
117
|
}), c = () => {
|
|
118
118
|
let t = e.getBoundingClientRect();
|
|
119
|
-
|
|
120
|
-
left: t.left -
|
|
121
|
-
top: t.top -
|
|
119
|
+
E.current = {
|
|
120
|
+
left: t.left - T.current.x,
|
|
121
|
+
top: t.top - T.current.y,
|
|
122
122
|
width: t.width,
|
|
123
123
|
height: t.height
|
|
124
|
-
}, r(),
|
|
124
|
+
}, r(), j();
|
|
125
125
|
};
|
|
126
|
-
return window.addEventListener("resize", c), r(),
|
|
126
|
+
return window.addEventListener("resize", c), r(), j(), () => {
|
|
127
127
|
s.unset(), i(), window.removeEventListener("resize", c);
|
|
128
128
|
};
|
|
129
|
-
}, [
|
|
129
|
+
}, [A, j]), c(() => !1, []) ? /* @__PURE__ */ d("div", {
|
|
130
130
|
className: "fixed bottom-4 left-4 z-50 pointer-events-none select-none",
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
-
ref:
|
|
131
|
+
children: /* @__PURE__ */ d("div", {
|
|
132
|
+
ref: x,
|
|
133
133
|
className: "pointer-events-auto",
|
|
134
134
|
style: { touchAction: "none" },
|
|
135
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ f("div", {
|
|
136
136
|
className: "relative",
|
|
137
|
-
onMouseEnter:
|
|
138
|
-
onMouseLeave:
|
|
139
|
-
onFocusCapture:
|
|
137
|
+
onMouseEnter: M,
|
|
138
|
+
onMouseLeave: N,
|
|
139
|
+
onFocusCapture: M,
|
|
140
140
|
onBlurCapture: (e) => {
|
|
141
141
|
let t = e.relatedTarget;
|
|
142
|
-
(!t || !e.currentTarget.contains(t)) &&
|
|
142
|
+
(!t || !e.currentTarget.contains(t)) && N();
|
|
143
143
|
},
|
|
144
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ d("button", {
|
|
145
145
|
type: "button",
|
|
146
146
|
"aria-label": "Playground developer tools",
|
|
147
147
|
className: e("inline-flex h-14 w-14 md:h-12 md:w-12 items-center justify-center rounded-full shadow-lg ring-1 transition-colors p-1 cursor-pointer", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/90 focus-visible:ring-offset-2 focus-visible:ring-offset-pink-600", "bg-pink-600 hover:bg-pink-700 ring-pink-700"),
|
|
148
|
-
onMouseDown:
|
|
149
|
-
onTouchStart:
|
|
150
|
-
onFocus:
|
|
148
|
+
onMouseDown: P,
|
|
149
|
+
onTouchStart: P,
|
|
150
|
+
onFocus: M,
|
|
151
151
|
onKeyDown: (e) => {
|
|
152
|
-
e.key === "Escape" && (
|
|
152
|
+
e.key === "Escape" && (_(!1), A());
|
|
153
153
|
},
|
|
154
|
-
children: /* @__PURE__ */
|
|
154
|
+
children: /* @__PURE__ */ d("img", {
|
|
155
155
|
src: n,
|
|
156
156
|
className: "h-9 w-9 md:h-8 md:w-8",
|
|
157
157
|
alt: "",
|
|
158
158
|
draggable: !1
|
|
159
159
|
})
|
|
160
|
-
}), /* @__PURE__ */
|
|
161
|
-
ref:
|
|
162
|
-
className: e("absolute w-80 rounded-xl border border-pink-500/40 bg-gray-950/95 text-gray-100 shadow-xl backdrop-blur-sm transition-all duration-150",
|
|
163
|
-
onMouseEnter:
|
|
164
|
-
onMouseLeave:
|
|
160
|
+
}), /* @__PURE__ */ f("div", {
|
|
161
|
+
ref: S,
|
|
162
|
+
className: e("absolute w-80 rounded-xl border border-pink-500/40 bg-gray-950/95 text-gray-100 shadow-xl backdrop-blur-sm transition-all duration-150", v.vertical === "above" ? "bottom-full mb-3" : "top-full mt-3", v.horizontal === "left" ? "left-0" : "right-0", g ? "pointer-events-auto opacity-100 translate-y-0" : "pointer-events-none opacity-0 translate-y-2"),
|
|
163
|
+
onMouseEnter: M,
|
|
164
|
+
onMouseLeave: N,
|
|
165
165
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ d("div", {
|
|
167
167
|
className: "px-4 py-3 border-b border-pink-500/40",
|
|
168
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ d("p", {
|
|
169
169
|
className: "text-sm font-semibold text-pink-200",
|
|
170
170
|
children: "Playground overrides"
|
|
171
171
|
})
|
|
172
172
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ f("div", {
|
|
174
174
|
className: "px-4 py-3 space-y-3",
|
|
175
|
-
children: [
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
className: "
|
|
182
|
-
children:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
className: "
|
|
192
|
-
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ d("p", {
|
|
177
|
+
className: "text-xs font-semibold uppercase tracking-wide text-pink-200",
|
|
178
|
+
children: "Hero layout"
|
|
179
|
+
}),
|
|
180
|
+
O ? null : /* @__PURE__ */ d("p", {
|
|
181
|
+
className: "text-xs text-gray-400",
|
|
182
|
+
children: "Using the saved storefront configuration."
|
|
183
|
+
}),
|
|
184
|
+
m.map((t) => {
|
|
185
|
+
let n = h.heroMode === t.value;
|
|
186
|
+
return /* @__PURE__ */ f("label", {
|
|
187
|
+
className: "flex cursor-pointer items-start gap-3 rounded-lg border border-pink-500/30 p-2",
|
|
188
|
+
children: [/* @__PURE__ */ d("input", {
|
|
189
|
+
type: "radio",
|
|
190
|
+
name: "playground-hero-mode",
|
|
191
|
+
className: "mt-0.5 h-4 w-4 accent-pink-500",
|
|
192
|
+
checked: n,
|
|
193
|
+
onChange: () => k(t.value)
|
|
193
194
|
}), /* @__PURE__ */ f("span", {
|
|
194
|
-
className:
|
|
195
|
-
children:
|
|
195
|
+
className: "flex flex-col gap-1",
|
|
196
|
+
children: [/* @__PURE__ */ d("span", {
|
|
197
|
+
className: "text-sm font-medium text-gray-100",
|
|
198
|
+
children: t.label
|
|
199
|
+
}), /* @__PURE__ */ d("span", {
|
|
200
|
+
className: e("text-xs", n ? "text-pink-300" : "text-gray-400"),
|
|
201
|
+
children: t.hint
|
|
202
|
+
})]
|
|
196
203
|
})]
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
|
-
|
|
204
|
+
}, t.value);
|
|
205
|
+
})
|
|
206
|
+
]
|
|
200
207
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ d("div", {
|
|
202
209
|
className: "px-4 pb-4",
|
|
203
|
-
children: /* @__PURE__ */
|
|
210
|
+
children: /* @__PURE__ */ d(t, {
|
|
204
211
|
type: "button",
|
|
205
212
|
variant: "outline",
|
|
206
|
-
className: e("w-full border border-pink-500/60 bg-pink-500/10 text-pink-100 hover:text-white hover:bg-pink-500/30 cursor-pointer", !
|
|
207
|
-
onClick:
|
|
208
|
-
disabled: !
|
|
213
|
+
className: e("w-full border border-pink-500/60 bg-pink-500/10 text-pink-100 hover:text-white hover:bg-pink-500/30 cursor-pointer", !O && "pointer-events-none opacity-60"),
|
|
214
|
+
onClick: r,
|
|
215
|
+
disabled: !O,
|
|
209
216
|
children: "Reset overrides"
|
|
210
217
|
})
|
|
211
218
|
})
|
|
@@ -216,4 +223,4 @@ var h = [
|
|
|
216
223
|
}) : null;
|
|
217
224
|
};
|
|
218
225
|
//#endregion
|
|
219
|
-
export {
|
|
226
|
+
export { h as PlaygroundDevFloatingButton };
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwZtB,CAAA"}
|
package/dist/i18n/fr.js
CHANGED
|
@@ -58,8 +58,8 @@ var e = {
|
|
|
58
58
|
featured_title: "Vélos les plus populaires",
|
|
59
59
|
featured_description: "Apperçu des vélos les plus loués",
|
|
60
60
|
featured_view_all: "Voir tous les vélos",
|
|
61
|
-
about_section_title: "
|
|
62
|
-
about_section_heading: "
|
|
61
|
+
about_section_title: "Présentation",
|
|
62
|
+
about_section_heading: "Présentation de la boutique",
|
|
63
63
|
about_section_fallback: "Présentez ce qui rend votre boutique unique : votre équipe, votre service et ce que les cyclistes peuvent attendre ici.",
|
|
64
64
|
testimonials: {
|
|
65
65
|
title: "Nos clients adorent nos vélos et notre service",
|
|
@@ -100,6 +100,7 @@ var e = {
|
|
|
100
100
|
add_to_cart: "Ajouter au panier",
|
|
101
101
|
add_short: "Ajouter",
|
|
102
102
|
cart_title: "Panier",
|
|
103
|
+
cart_items_count_zero: "{{count}} articles",
|
|
103
104
|
cart_items_count_one: "{{count}} article",
|
|
104
105
|
cart_items_count_other: "{{count}} articles",
|
|
105
106
|
cart_empty: "Votre panier est vide.",
|
package/dist/index.d.ts
CHANGED
|
@@ -1892,6 +1892,7 @@ export declare const loader: ({ ctx, params }: LoaderArgs) => Promise<{
|
|
|
1892
1892
|
languages?: string[] | undefined;
|
|
1893
1893
|
} | undefined;
|
|
1894
1894
|
content?: {
|
|
1895
|
+
heroMode: "current_booking_hero" | "booking_bar_overlay_hero" | "vertical_marquee_hero";
|
|
1895
1896
|
galleryImageIds: string[];
|
|
1896
1897
|
whatsappPhone1Enabled: boolean;
|
|
1897
1898
|
whatsappPhone2Enabled: boolean;
|
|
@@ -2792,6 +2793,8 @@ export declare const STOREFRONT_AVAILABILITY_ROUTE = "/api/public/storefront/ava
|
|
|
2792
2793
|
|
|
2793
2794
|
export declare const STOREFRONT_CHECKOUT_SUBMIT_ROUTE = "/api/public/storefront/checkout/submit";
|
|
2794
2795
|
|
|
2796
|
+
export declare const STOREFRONT_HERO_MODES: readonly ["current_booking_hero", "booking_bar_overlay_hero", "vertical_marquee_hero"];
|
|
2797
|
+
|
|
2795
2798
|
export declare const STOREFRONT_IMAGE_ROUTE = "/api/public/storefront/images/get";
|
|
2796
2799
|
|
|
2797
2800
|
export declare const STOREFRONT_PRODUCTS_ROUTE = "/api/public/storefront/products";
|
|
@@ -3032,6 +3035,7 @@ export declare type StorefrontCheckoutSubmitResponsePayload = z.infer<typeof sto
|
|
|
3032
3035
|
export declare const storefrontCheckoutSubmitResponseSchema: z.ZodObject<{
|
|
3033
3036
|
success: z.ZodBoolean;
|
|
3034
3037
|
message: z.ZodOptional<z.ZodString>;
|
|
3038
|
+
errorCode: z.ZodOptional<z.ZodLiteral<"online_payment_provider_missing">>;
|
|
3035
3039
|
checkout: z.ZodOptional<z.ZodObject<{
|
|
3036
3040
|
bookingExternalId: z.ZodString;
|
|
3037
3041
|
saleId: z.ZodString;
|
|
@@ -3247,6 +3251,11 @@ export declare const storefrontConfigurationSchema: z.ZodObject<{
|
|
|
3247
3251
|
};
|
|
3248
3252
|
}, unknown>>;
|
|
3249
3253
|
content: z.ZodOptional<z.ZodObject<{
|
|
3254
|
+
heroMode: z.ZodDefault<z.ZodEnum<{
|
|
3255
|
+
current_booking_hero: "current_booking_hero";
|
|
3256
|
+
booking_bar_overlay_hero: "booking_bar_overlay_hero";
|
|
3257
|
+
vertical_marquee_hero: "vertical_marquee_hero";
|
|
3258
|
+
}>>;
|
|
3250
3259
|
tagline: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3251
3260
|
value: z.ZodString;
|
|
3252
3261
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
@@ -3353,6 +3362,11 @@ declare type StorefrontContactShop = Pick<StorefrontShop, "address" | "contactPh
|
|
|
3353
3362
|
export declare type StorefrontContent = z.infer<typeof storefrontContentSchema>;
|
|
3354
3363
|
|
|
3355
3364
|
export declare const storefrontContentSchema: z.ZodObject<{
|
|
3365
|
+
heroMode: z.ZodDefault<z.ZodEnum<{
|
|
3366
|
+
current_booking_hero: "current_booking_hero";
|
|
3367
|
+
booking_bar_overlay_hero: "booking_bar_overlay_hero";
|
|
3368
|
+
vertical_marquee_hero: "vertical_marquee_hero";
|
|
3369
|
+
}>>;
|
|
3356
3370
|
tagline: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3357
3371
|
value: z.ZodString;
|
|
3358
3372
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
@@ -3999,6 +4013,7 @@ export declare const storefrontFr: {
|
|
|
3999
4013
|
add_to_cart: string;
|
|
4000
4014
|
add_short: string;
|
|
4001
4015
|
cart_title: string;
|
|
4016
|
+
cart_items_count_zero: string;
|
|
4002
4017
|
cart_items_count_one: string;
|
|
4003
4018
|
cart_items_count_other: string;
|
|
4004
4019
|
cart_empty: string;
|
|
@@ -4285,6 +4300,14 @@ export declare const storefrontFulfillmentModeSchema: z.ZodEnum<{
|
|
|
4285
4300
|
delivery: "delivery";
|
|
4286
4301
|
}>;
|
|
4287
4302
|
|
|
4303
|
+
export declare type StorefrontHeroMode = z.infer<typeof storefrontHeroModeSchema>;
|
|
4304
|
+
|
|
4305
|
+
export declare const storefrontHeroModeSchema: z.ZodEnum<{
|
|
4306
|
+
current_booking_hero: "current_booking_hero";
|
|
4307
|
+
booking_bar_overlay_hero: "booking_bar_overlay_hero";
|
|
4308
|
+
vertical_marquee_hero: "vertical_marquee_hero";
|
|
4309
|
+
}>;
|
|
4310
|
+
|
|
4288
4311
|
declare type StorefrontI18nLanguage = "en" | "fr";
|
|
4289
4312
|
|
|
4290
4313
|
export declare type StorefrontImageRequestPayload = z.infer<typeof storefrontImageRequestSchema>;
|
|
@@ -5069,6 +5092,7 @@ export declare function useStorefrontConfig(): {
|
|
|
5069
5092
|
languages?: string[] | undefined;
|
|
5070
5093
|
} | undefined;
|
|
5071
5094
|
content?: {
|
|
5095
|
+
heroMode: "current_booking_hero" | "booking_bar_overlay_hero" | "vertical_marquee_hero";
|
|
5072
5096
|
galleryImageIds: string[];
|
|
5073
5097
|
whatsappPhone1Enabled: boolean;
|
|
5074
5098
|
whatsappPhone2Enabled: boolean;
|
|
@@ -5292,6 +5316,7 @@ export declare function useStorefrontConfig(): {
|
|
|
5292
5316
|
languages?: string[] | undefined;
|
|
5293
5317
|
} | undefined;
|
|
5294
5318
|
content?: {
|
|
5319
|
+
heroMode: "current_booking_hero" | "booking_bar_overlay_hero" | "vertical_marquee_hero";
|
|
5295
5320
|
galleryImageIds: string[];
|
|
5296
5321
|
whatsappPhone1Enabled: boolean;
|
|
5297
5322
|
whatsappPhone2Enabled: boolean;
|