@loczer/storefront-sdk 0.210.0 → 0.211.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/AdminFloatingButton/AdminFloatingButton.d.ts +7 -0
  2. package/dist/components/AdminFloatingButton/AdminFloatingButton.d.ts.map +1 -0
  3. package/dist/components/AdminFloatingButton/AdminFloatingButton.js +36 -0
  4. package/dist/components/AdminFloatingButton/index.d.ts +3 -0
  5. package/dist/components/AdminFloatingButton/index.d.ts.map +1 -0
  6. package/dist/components/AdminFloatingButton/index.js +2 -0
  7. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  8. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +213 -213
  9. package/dist/components/ContactSection/index.d.ts.map +1 -1
  10. package/dist/components/ContactSection/index.js +4 -7
  11. package/dist/components/Header/index.js +1 -0
  12. package/dist/components/PlaygroundDevFloatingButton/index.d.ts.map +1 -1
  13. package/dist/components/PlaygroundDevFloatingButton/index.js +121 -100
  14. package/dist/components/WhatsAppFloatingButton/useWhatsAppFloatingButton.d.ts +2 -3
  15. package/dist/components/WhatsAppFloatingButton/useWhatsAppFloatingButton.d.ts.map +1 -1
  16. package/dist/components/WhatsAppFloatingButton/useWhatsAppFloatingButton.js +7 -81
  17. package/dist/i18n/en.d.ts +0 -1
  18. package/dist/i18n/en.d.ts.map +1 -1
  19. package/dist/i18n/en.js +0 -1
  20. package/dist/i18n/fr.d.ts +0 -1
  21. package/dist/i18n/fr.d.ts.map +1 -1
  22. package/dist/i18n/fr.js +0 -1
  23. package/dist/index.d.ts +8 -3
  24. package/dist/index.js +22 -20
  25. package/dist/lib/floatingButtonCollision.d.ts +20 -0
  26. package/dist/lib/floatingButtonCollision.d.ts.map +1 -0
  27. package/dist/lib/floatingButtonCollision.js +72 -0
  28. package/dist/lib/useDraggableFloatingButton.d.ts +7 -0
  29. package/dist/lib/useDraggableFloatingButton.d.ts.map +1 -0
  30. package/dist/lib/useDraggableFloatingButton.js +107 -0
  31. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  32. package/dist/pages/CheckoutPage.js +244 -243
  33. package/dist/storefront.css +1 -1
  34. package/dist/ui/day-picker.js +1 -1
  35. package/package.json +1 -1
@@ -1,12 +1,13 @@
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 { 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";
4
+ import { registerFloatingButtonCollisionParticipant as r, resolveFloatingButtonCollisions as i } from "../../lib/floatingButtonCollision.js";
5
+ import { resetPlaygroundDevSettings as a, usePlaygroundDevSettings as o, writePlaygroundDevSettings as s } from "../../lib/playgroundDevSettings.js";
6
+ import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
7
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
+ import h from "interactjs";
8
9
  //#region src/components/PlaygroundDevFloatingButton/index.tsx
9
- var m = [
10
+ var g = [
10
11
  {
11
12
  value: "current_booking_hero",
12
13
  label: "Current booking hero",
@@ -22,58 +23,58 @@ var m = [
22
23
  label: "Vertical marquee hero",
23
24
  hint: "Keep the overlay booking bar and swap the static image for a vertical animated gallery"
24
25
  }
25
- ], h = () => {
26
- let h = i(), [g, _] = u(!1), [v, y] = u({
26
+ ], _ = () => {
27
+ let _ = o(), [v, y] = f(!1), [b, x] = f({
27
28
  horizontal: "left",
28
29
  vertical: "above"
29
- }), b = l(null), x = l(null), S = l(null), C = l(!1), w = l(!1), T = l({
30
+ }), S = d(null), C = d(null), w = d(null), T = d(!1), E = d(!1), D = d({
30
31
  x: 0,
31
32
  y: 0
32
- }), E = l(null), D = l(null), O = h.heroMode !== null, k = o((e) => {
33
- a({
34
- ...h,
33
+ }), O = d(null), k = d(null), A = _.heroMode !== null, j = c((e) => {
34
+ s({
35
+ ..._,
35
36
  heroMode: e
36
37
  });
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;
38
+ }, [_]), M = c(() => {
39
+ S.current != null && (window.clearTimeout(S.current), S.current = null);
40
+ }, []), N = c(() => {
41
+ let e = C.current, t = w.current;
41
42
  if (!e || !t || typeof window > "u") return;
42
43
  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
- y((e) => e.horizontal === a && e.vertical === o ? e : {
44
+ x((e) => e.horizontal === a && e.vertical === o ? e : {
44
45
  horizontal: a,
45
46
  vertical: o
46
47
  });
47
- }, []), M = o(() => {
48
- C.current || w.current || (A(), _(!0), window.requestAnimationFrame(() => {
49
- j();
48
+ }, []), P = c(() => {
49
+ T.current || E.current || (M(), y(!0), window.requestAnimationFrame(() => {
50
+ N();
50
51
  }));
51
- }, [A, j]), N = o(() => {
52
- C.current || w.current || (A(), b.current = window.setTimeout(() => {
53
- _(!1), b.current = null;
52
+ }, [M, N]), F = c(() => {
53
+ T.current || E.current || (M(), S.current = window.setTimeout(() => {
54
+ y(!1), S.current = null;
54
55
  }, 120));
55
- }, [A]), P = o(() => {
56
- A(), _(!1);
57
- }, [A]);
58
- return s(() => {
59
- if (!g) return;
60
- j();
61
- let e = () => j();
56
+ }, [M]), I = c(() => {
57
+ M(), y(!1);
58
+ }, [M]);
59
+ return l(() => {
60
+ if (!v) return;
61
+ N();
62
+ let e = () => N();
62
63
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
63
- }, [g, j]), s(() => () => A(), [A]), s(() => {
64
- let e = x.current;
64
+ }, [v, N]), l(() => () => M(), [M]), l(() => {
65
+ let e = C.current;
65
66
  if (!e || typeof window > "u") return;
66
67
  let t = e.getBoundingClientRect();
67
- E.current = {
68
+ O.current = {
68
69
  left: t.left,
69
70
  top: t.top,
70
71
  width: t.width,
71
72
  height: t.height
72
73
  };
73
74
  let n = () => {
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 = {
75
+ if (!O.current) return D.current;
76
+ let { left: e, top: t, width: n, height: r } = O.current, i = 8 - e, a = 8 - t, o = window.innerWidth - 8 - n - e, s = window.innerHeight - 8 - r - t, c = Math.min(Math.max(D.current.x, i), o), l = Math.min(Math.max(D.current.y, a), s);
77
+ return D.current = {
77
78
  x: c,
78
79
  y: l
79
80
  }, {
@@ -84,119 +85,139 @@ var m = [
84
85
  maxX: o,
85
86
  maxY: s
86
87
  };
87
- }, r = () => {
88
+ }, a = () => {
88
89
  let { x: t, y: r } = n();
89
90
  e.style.transform = `translate3d(${t}px, ${r}px, 0)`;
90
- }, i = () => {
91
- D.current != null && (cancelAnimationFrame(D.current), D.current = null), w.current = !1;
92
- }, a = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches, o = (t, o) => {
93
- if (a) {
94
- r(), w.current = !1;
91
+ }, o = (e, t) => {
92
+ let n = D.current.x, r = D.current.y;
93
+ return D.current.x += e, D.current.y += t, a(), N(), {
94
+ x: D.current.x - n,
95
+ y: D.current.y - r
96
+ };
97
+ }, s = () => {
98
+ k.current != null && (cancelAnimationFrame(k.current), k.current = null), E.current = !1;
99
+ }, c = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches, l = (e = 0, t = 0) => {
100
+ i("dev-floating-button", {
101
+ velocityX: e,
102
+ velocityY: t
103
+ });
104
+ }, u = (t, r) => {
105
+ if (c) {
106
+ a(), l(t, r), E.current = !1;
95
107
  return;
96
108
  }
97
- let s = performance.now();
98
- w.current = !0;
99
- let c = .92, l = .7, u = (r) => {
100
- let a = (r - s) / 1e3;
101
- s = r, T.current.x += t * a, T.current.y += o * a;
102
- let { minX: d, minY: f, maxX: p, maxY: m } = n();
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
- i();
109
+ let i = performance.now();
110
+ E.current = !0;
111
+ let o = .92, u = .7, d = (a) => {
112
+ let c = (a - i) / 1e3;
113
+ i = a, D.current.x += t * c, D.current.y += r * c;
114
+ let { minX: f, minY: p, maxX: m, maxY: h } = n();
115
+ if (D.current.x <= f + .001 && t < 0 ? (D.current.x = f, t = -t * u) : D.current.x >= m - .001 && t > 0 && (D.current.x = m, t = -t * u), D.current.y <= p + .001 && r < 0 ? (D.current.y = p, r = -r * u) : D.current.y >= h - .001 && r > 0 && (D.current.y = h, r = -r * u), t *= o, r *= o, e.style.transform = `translate3d(${D.current.x}px, ${D.current.y}px, 0)`, l(t, r), Math.hypot(t, r) < 20) {
116
+ s();
105
117
  return;
106
118
  }
107
- D.current = requestAnimationFrame(u);
119
+ k.current = requestAnimationFrame(d);
108
120
  };
109
- D.current = requestAnimationFrame(u);
110
- }, s = p(e).draggable({ inertia: !1 }).styleCursor(!1).on("dragstart", () => {
111
- i(), C.current = !0, _(!1), A();
121
+ k.current = requestAnimationFrame(d);
122
+ }, d = r({
123
+ id: "dev-floating-button",
124
+ getRect: () => e.getBoundingClientRect(),
125
+ isDragging: () => T.current,
126
+ moveBy: o,
127
+ cancelMotion: s,
128
+ kick: u
129
+ }), f = h(e).draggable({ inertia: !1 }).styleCursor(!1).on("dragstart", () => {
130
+ s(), T.current = !0, y(!1), M();
112
131
  }).on("dragmove", (e) => {
113
- T.current.x += e.dx, T.current.y += e.dy, r();
132
+ D.current.x += e.dx, D.current.y += e.dy, a();
133
+ let t = Number.isFinite(e.velocityX) ? e.velocityX : 0, n = Number.isFinite(e.velocityY) ? e.velocityY : 0;
134
+ l(t, n);
114
135
  }).on("dragend", (e) => {
115
136
  let t = Number.isFinite(e.velocityX) ? e.velocityX : 0, n = Number.isFinite(e.velocityY) ? e.velocityY : 0;
116
- C.current = !1, Math.hypot(t, n) >= 10 ? o(t, n) : (r(), i()), j();
117
- }), c = () => {
137
+ T.current = !1, Math.hypot(t, n) >= 10 ? u(t, n) : (a(), s(), l(t, n)), N();
138
+ }), p = () => {
118
139
  let t = e.getBoundingClientRect();
119
- E.current = {
120
- left: t.left - T.current.x,
121
- top: t.top - T.current.y,
140
+ O.current = {
141
+ left: t.left - D.current.x,
142
+ top: t.top - D.current.y,
122
143
  width: t.width,
123
144
  height: t.height
124
- }, r(), j();
145
+ }, a(), l(), N();
125
146
  };
126
- return window.addEventListener("resize", c), r(), j(), () => {
127
- s.unset(), i(), window.removeEventListener("resize", c);
147
+ return window.addEventListener("resize", p), a(), l(), N(), () => {
148
+ d(), f.unset(), s(), window.removeEventListener("resize", p);
128
149
  };
129
- }, [A, j]), c(() => !1, []) ? /* @__PURE__ */ d("div", {
150
+ }, [M, N]), u(() => !1, []) ? /* @__PURE__ */ p("div", {
130
151
  className: "fixed bottom-4 left-4 z-50 pointer-events-none select-none",
131
- children: /* @__PURE__ */ d("div", {
132
- ref: x,
152
+ children: /* @__PURE__ */ p("div", {
153
+ ref: C,
133
154
  className: "pointer-events-auto",
134
155
  style: { touchAction: "none" },
135
- children: /* @__PURE__ */ f("div", {
156
+ children: /* @__PURE__ */ m("div", {
136
157
  className: "relative",
137
- onMouseEnter: M,
138
- onMouseLeave: N,
139
- onFocusCapture: M,
158
+ onMouseEnter: P,
159
+ onMouseLeave: F,
160
+ onFocusCapture: P,
140
161
  onBlurCapture: (e) => {
141
162
  let t = e.relatedTarget;
142
- (!t || !e.currentTarget.contains(t)) && N();
163
+ (!t || !e.currentTarget.contains(t)) && F();
143
164
  },
144
- children: [/* @__PURE__ */ d("button", {
165
+ children: [/* @__PURE__ */ p("button", {
145
166
  type: "button",
146
167
  "aria-label": "Playground developer tools",
147
168
  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: P,
149
- onTouchStart: P,
150
- onFocus: M,
169
+ onMouseDown: I,
170
+ onTouchStart: I,
171
+ onFocus: P,
151
172
  onKeyDown: (e) => {
152
- e.key === "Escape" && (_(!1), A());
173
+ e.key === "Escape" && (y(!1), M());
153
174
  },
154
- children: /* @__PURE__ */ d("img", {
175
+ children: /* @__PURE__ */ p("img", {
155
176
  src: n,
156
177
  className: "h-9 w-9 md:h-8 md:w-8",
157
178
  alt: "",
158
179
  draggable: !1
159
180
  })
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,
181
+ }), /* @__PURE__ */ m("div", {
182
+ ref: w,
183
+ 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", b.vertical === "above" ? "bottom-full mb-3" : "top-full mt-3", b.horizontal === "left" ? "left-0" : "right-0", v ? "pointer-events-auto opacity-100 translate-y-0" : "pointer-events-none opacity-0 translate-y-2"),
184
+ onMouseEnter: P,
185
+ onMouseLeave: F,
165
186
  children: [
166
- /* @__PURE__ */ d("div", {
187
+ /* @__PURE__ */ p("div", {
167
188
  className: "px-4 py-3 border-b border-pink-500/40",
168
- children: /* @__PURE__ */ d("p", {
189
+ children: /* @__PURE__ */ p("p", {
169
190
  className: "text-sm font-semibold text-pink-200",
170
191
  children: "Playground overrides"
171
192
  })
172
193
  }),
173
- /* @__PURE__ */ f("div", {
194
+ /* @__PURE__ */ m("div", {
174
195
  className: "px-4 py-3 space-y-3",
175
196
  children: [
176
- /* @__PURE__ */ d("p", {
197
+ /* @__PURE__ */ p("p", {
177
198
  className: "text-xs font-semibold uppercase tracking-wide text-pink-200",
178
199
  children: "Hero layout"
179
200
  }),
180
- O ? null : /* @__PURE__ */ d("p", {
201
+ A ? null : /* @__PURE__ */ p("p", {
181
202
  className: "text-xs text-gray-400",
182
203
  children: "Using the saved storefront configuration."
183
204
  }),
184
- m.map((t) => {
185
- let n = h.heroMode === t.value;
186
- return /* @__PURE__ */ f("label", {
205
+ g.map((t) => {
206
+ let n = _.heroMode === t.value;
207
+ return /* @__PURE__ */ m("label", {
187
208
  className: "flex cursor-pointer items-start gap-3 rounded-lg border border-pink-500/30 p-2",
188
- children: [/* @__PURE__ */ d("input", {
209
+ children: [/* @__PURE__ */ p("input", {
189
210
  type: "radio",
190
211
  name: "playground-hero-mode",
191
212
  className: "mt-0.5 h-4 w-4 accent-pink-500",
192
213
  checked: n,
193
- onChange: () => k(t.value)
194
- }), /* @__PURE__ */ f("span", {
214
+ onChange: () => j(t.value)
215
+ }), /* @__PURE__ */ m("span", {
195
216
  className: "flex flex-col gap-1",
196
- children: [/* @__PURE__ */ d("span", {
217
+ children: [/* @__PURE__ */ p("span", {
197
218
  className: "text-sm font-medium text-gray-100",
198
219
  children: t.label
199
- }), /* @__PURE__ */ d("span", {
220
+ }), /* @__PURE__ */ p("span", {
200
221
  className: e("text-xs", n ? "text-pink-300" : "text-gray-400"),
201
222
  children: t.hint
202
223
  })]
@@ -205,14 +226,14 @@ var m = [
205
226
  })
206
227
  ]
207
228
  }),
208
- /* @__PURE__ */ d("div", {
229
+ /* @__PURE__ */ p("div", {
209
230
  className: "px-4 pb-4",
210
- children: /* @__PURE__ */ d(t, {
231
+ children: /* @__PURE__ */ p(t, {
211
232
  type: "button",
212
233
  variant: "outline",
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,
234
+ 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", !A && "pointer-events-none opacity-60"),
235
+ onClick: a,
236
+ disabled: !A,
216
237
  children: "Reset overrides"
217
238
  })
218
239
  })
@@ -223,4 +244,4 @@ var m = [
223
244
  }) : null;
224
245
  };
225
246
  //#endregion
226
- export { h as PlaygroundDevFloatingButton };
247
+ export { _ as PlaygroundDevFloatingButton };
@@ -1,11 +1,10 @@
1
- import { MouseEventHandler } from 'react';
2
1
  export interface WhatsAppFloatingButtonOptions {
3
2
  href?: string;
4
3
  }
5
4
  export declare const useWhatsAppFloatingButton: (options?: WhatsAppFloatingButtonOptions) => {
6
- href: string | undefined;
7
5
  containerRef: import('react').RefObject<HTMLDivElement | null>;
8
6
  bubbleRef: import('react').RefObject<HTMLDivElement | null>;
9
- onLinkClick: MouseEventHandler<HTMLAnchorElement>;
7
+ onLinkClick: import('react').MouseEventHandler<HTMLAnchorElement>;
8
+ href: string | undefined;
10
9
  };
11
10
  //# sourceMappingURL=useWhatsAppFloatingButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWhatsAppFloatingButton.d.ts","sourceRoot":"","sources":["../../../src/components/WhatsAppFloatingButton/useWhatsAppFloatingButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAI9E,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAiBD,eAAO,MAAM,yBAAyB,GACpC,UAAS,6BAAkC;;;;;CA6K5C,CAAA"}
1
+ {"version":3,"file":"useWhatsAppFloatingButton.d.ts","sourceRoot":"","sources":["../../../src/components/WhatsAppFloatingButton/useWhatsAppFloatingButton.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAGD,eAAO,MAAM,yBAAyB,GACpC,UAAS,6BAAkC;;;;;CAU5C,CAAA"}
@@ -1,85 +1,11 @@
1
- import { useCallback as e, useEffect as t, useRef as n } from "react";
2
- import r from "interactjs";
1
+ import { useDraggableFloatingButton as e } from "../../lib/useDraggableFloatingButton.js";
3
2
  //#region src/components/WhatsAppFloatingButton/useWhatsAppFloatingButton.ts
4
- var i = (i = {}) => {
5
- let { href: a } = i, o = a, s = n(null), c = n(null), l = n(!1), u = n(!1), d = n({
6
- x: 0,
7
- y: 0
8
- }), f = n(null), p = n(null);
9
- return t(() => {
10
- let e = c.current;
11
- if (!e) return;
12
- let t = e.getBoundingClientRect();
13
- f.current = {
14
- left: t.left,
15
- top: t.top,
16
- width: t.width,
17
- height: t.height
18
- };
19
- let n = () => {
20
- if (!f.current) return d.current;
21
- let { left: e, top: t, width: n, height: r } = f.current, i = 8 - e, a = 8 - t, o = window.innerWidth - 8 - n - e, s = window.innerHeight - 8 - r - t, c = Math.min(Math.max(d.current.x, i), o), l = Math.min(Math.max(d.current.y, a), s);
22
- return d.current = {
23
- x: c,
24
- y: l
25
- }, {
26
- x: c,
27
- y: l,
28
- minX: i,
29
- minY: a,
30
- maxX: o,
31
- maxY: s
32
- };
33
- }, i = () => {
34
- let { x: t, y: r } = n();
35
- e.style.transform = `translate3d(${t}px, ${r}px, 0)`;
36
- }, a = () => {
37
- p.current != null && (cancelAnimationFrame(p.current), p.current = null), u.current = !1;
38
- }, o = typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches, s = (t, r) => {
39
- if (o) {
40
- i();
41
- return;
42
- }
43
- let s = performance.now();
44
- u.current = !0;
45
- let c = .92, l = .7, f = (i) => {
46
- let o = (i - s) / 1e3;
47
- s = i, d.current.x += t * o, d.current.y += r * o;
48
- let { minX: u, minY: m, maxX: h, maxY: g } = n();
49
- if (d.current.x <= u + .001 && t < 0 ? (d.current.x = u, t = -t * l) : d.current.x >= h - .001 && t > 0 && (d.current.x = h, t = -t * l), d.current.y <= m + .001 && r < 0 ? (d.current.y = m, r = -r * l) : d.current.y >= g - .001 && r > 0 && (d.current.y = g, r = -r * l), t *= c, r *= c, e.style.transform = `translate3d(${d.current.x}px, ${d.current.y}px, 0)`, Math.hypot(t, r) < 20) {
50
- a();
51
- return;
52
- }
53
- p.current = requestAnimationFrame(f);
54
- };
55
- p.current = requestAnimationFrame(f);
56
- }, m = r(e).draggable({ inertia: !1 }).styleCursor(!1).on("dragstart", () => {
57
- a(), l.current = !0;
58
- }).on("dragmove", (e) => {
59
- d.current.x += e.dx, d.current.y += e.dy, i();
60
- }).on("dragend", (e) => {
61
- let t = Number.isFinite(e.velocityX) ? e.velocityX : 0, n = Number.isFinite(e.velocityY) ? e.velocityY : 0;
62
- l.current = !1, Math.hypot(t, n) >= 10 && s(t, n);
63
- }), h = () => {
64
- let t = e.getBoundingClientRect();
65
- f.current = {
66
- left: t.left - d.current.x,
67
- top: t.top - d.current.y,
68
- width: t.width,
69
- height: t.height
70
- }, i();
71
- };
72
- return window.addEventListener("resize", h), i(), () => {
73
- m.unset(), a(), window.removeEventListener("resize", h);
74
- };
75
- }, []), {
76
- href: o,
77
- containerRef: s,
78
- bubbleRef: c,
79
- onLinkClick: e((e) => {
80
- (l.current || u.current) && (e.preventDefault(), e.stopPropagation());
81
- }, [])
3
+ var t = (t = {}) => {
4
+ let { href: n } = t;
5
+ return {
6
+ href: n,
7
+ ...e("whatsapp-floating-button")
82
8
  };
83
9
  };
84
10
  //#endregion
85
- export { i as useWhatsAppFloatingButton };
11
+ export { t as useWhatsAppFloatingButton };
package/dist/i18n/en.d.ts CHANGED
@@ -353,7 +353,6 @@ export declare const storefront: {
353
353
  contact_form_phone_placeholder: string;
354
354
  contact_form_message_label: string;
355
355
  contact_form_message_placeholder: string;
356
- contact_form_privacy_hint: string;
357
356
  contact_form_submit_button: string;
358
357
  contact_form_submitting_button: string;
359
358
  contact_form_success_toast: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgftB,CAAA"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+etB,CAAA"}
package/dist/i18n/en.js CHANGED
@@ -354,7 +354,6 @@ var e = {
354
354
  contact_form_phone_placeholder: "+1 555 555 5555",
355
355
  contact_form_message_label: "Message",
356
356
  contact_form_message_placeholder: "How can we help?",
357
- contact_form_privacy_hint: "We’ll only use your details to reply.",
358
357
  contact_form_submit_button: "Send message",
359
358
  contact_form_submitting_button: "Sending…",
360
359
  contact_form_success_toast: "Message sent.",
package/dist/i18n/fr.d.ts CHANGED
@@ -354,7 +354,6 @@ export declare const storefront: {
354
354
  contact_form_phone_placeholder: string;
355
355
  contact_form_message_label: string;
356
356
  contact_form_message_placeholder: string;
357
- contact_form_privacy_hint: string;
358
357
  contact_form_submit_button: string;
359
358
  contact_form_submitting_button: string;
360
359
  contact_form_success_toast: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiftB,CAAA"}
1
+ {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgftB,CAAA"}
package/dist/i18n/fr.js CHANGED
@@ -355,7 +355,6 @@ var e = {
355
355
  contact_form_phone_placeholder: "+33 6 00 00 00 00",
356
356
  contact_form_message_label: "Message",
357
357
  contact_form_message_placeholder: "Comment peut-on vous aider ?",
358
- contact_form_privacy_hint: "On utilise vos infos uniquement pour répondre.",
359
358
  contact_form_submit_button: "Envoyer",
360
359
  contact_form_submitting_button: "Envoi…",
361
360
  contact_form_success_toast: "Message envoyé.",
package/dist/index.d.ts CHANGED
@@ -253,6 +253,13 @@ declare type AddressAutocompleteLocationRestriction = {
253
253
  west: number;
254
254
  };
255
255
 
256
+ export declare const AdminFloatingButton: ({ href, onClick }: AdminFloatingButtonProps) => JSX.Element | null;
257
+
258
+ export declare type AdminFloatingButtonProps = {
259
+ href: string;
260
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
261
+ };
262
+
256
263
  export declare const applyBookingParamsToSearch: (searchParams: URLSearchParams, booking: Partial<StorefrontBookingParams>) => URLSearchParams;
257
264
 
258
265
  export declare const assetIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -4330,7 +4337,6 @@ export declare const storefrontEn: {
4330
4337
  contact_form_phone_placeholder: string;
4331
4338
  contact_form_message_label: string;
4332
4339
  contact_form_message_placeholder: string;
4333
- contact_form_privacy_hint: string;
4334
4340
  contact_form_submit_button: string;
4335
4341
  contact_form_submitting_button: string;
4336
4342
  contact_form_success_toast: string;
@@ -4860,7 +4866,6 @@ export declare const storefrontFr: {
4860
4866
  contact_form_phone_placeholder: string;
4861
4867
  contact_form_message_label: string;
4862
4868
  contact_form_message_placeholder: string;
4863
- contact_form_privacy_hint: string;
4864
4869
  contact_form_submit_button: string;
4865
4870
  contact_form_submitting_button: string;
4866
4871
  contact_form_success_toast: string;
@@ -6663,10 +6668,10 @@ export declare function useStorefrontProducts(): {
6663
6668
  export declare function useStorefrontWorkspaceLanguage(): StorefrontI18nLanguage;
6664
6669
 
6665
6670
  export declare const useWhatsAppFloatingButton: (options?: WhatsAppFloatingButtonOptions) => {
6666
- href: string | undefined;
6667
6671
  containerRef: RefObject<HTMLDivElement | null>;
6668
6672
  bubbleRef: RefObject<HTMLDivElement | null>;
6669
6673
  onLinkClick: MouseEventHandler<HTMLAnchorElement>;
6674
+ href: string | undefined;
6670
6675
  };
6671
6676
 
6672
6677
  export declare function validateBookingDeliveryAddress(input: BookingDeliveryAddressInput, ctx: z.RefinementCtx): void;