@loczer/storefront-sdk 0.193.0 → 0.195.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/chunks/pkg/booking-engine/dist/models/{Product.shared-cjcvMCMa.js → Product.shared-iVSHRdn4.js} +21 -21
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-CsOe0vXi.js → base-asset-BRQVuIes.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-Sjsqh31e.js → base-booking-Bhy2Kww1.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-C_ATjuc6.js → base-product-BJHQLX8t.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{insurance-B01h642r.js → insurance-CPeHsTss.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas-BfXM1Dgb.js +14 -0
- package/dist/chunks/pkg/ui/dist/{Button-CxG2fSpA.js → Button-Cr_u8vnh.js} +1 -1
- package/dist/chunks/pkg/ui/dist/{Dialog-4leTWiev.js → Dialog-CczmPDwY.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Drawer/{index-DA5V7R_q.js → index-CSvSVP_J.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Map/{MapContent-BmKjdWmq.js → MapContent-CDeWtwKa.js} +1 -1
- package/dist/chunks/pkg/ui/dist/{Map-CsOTdTtL.js → Map-Cs7wgtH9.js} +2 -2
- package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-CfEqkJ0y.js → MorphingModalWizard-j1CgFGLe.js} +4 -3
- package/dist/chunks/pkg/ui/dist/{ResponsiveDialog-C6IWYoIg.js → ResponsiveDialog-BVwhTZQo.js} +3 -3
- package/dist/chunks/pkg/ui/dist/{ScrollArea-Bjwo84cv.js → ScrollArea-BqLd0xZj.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Spinner/{index-DzMEU0iA.js → index-Cgi70z_E.js} +1 -1
- package/dist/chunks/pkg/ui/dist/lib/utils-DXB19bzk.js +8 -0
- package/dist/components/BikeProductCard/index.js +6 -6
- package/dist/components/BookingBikeVariantDialog/index.js +7 -7
- package/dist/components/BookingFlowSteps/index.js +11 -11
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +36 -54
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +36 -54
- package/dist/components/BookingPeriodSelector/components/BookingTimeSlotsStatus.js +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts +7 -0
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.js +27 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts +36 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js +830 -0
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.d.ts +2 -0
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.js +21 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +4 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +114 -110
- package/dist/components/ContactSection/index.js +35 -35
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +4 -4
- package/dist/components/ContractSaleDocument/ThumbnailSidebar.js +1 -1
- package/dist/components/DeliveryAddressSelector/index.js +5 -5
- package/dist/components/Footer/index.js +11 -11
- package/dist/components/FulfillmentSection/index.js +9 -9
- package/dist/components/Header/index.js +61 -61
- package/dist/components/Map/index.js +1 -1
- package/dist/components/PoweredByLoczerBadge/index.js +5 -5
- package/dist/components/ProductPriceBadge/index.js +73 -73
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +6 -6
- package/dist/components/StorefrontCartPanel/index.js +8 -8
- package/dist/components/StorefrontInsuranceNotice/index.js +6 -6
- package/dist/components/StorefrontPopupMessages/index.js +8 -8
- package/dist/components/payment/MollieCardFieldsForm.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.js +70 -70
- package/dist/lib/booking.js +1 -1
- package/dist/lib/checkoutSubmit.js +2 -2
- package/dist/lib/utils.d.ts +3 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +9 -5
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +187 -159
- package/dist/pages/CheckoutPaymentPage.js +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +15 -15
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +263 -257
- package/dist/pages/PaymentLinkPage.js +1 -1
- package/dist/pages/PaymentLinkSuccessPage.js +1 -1
- package/dist/pages/ProductPage.js +143 -143
- package/dist/pages/checkout/components/CheckoutCouponCard.js +5 -5
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +1 -1
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.js +1 -1
- package/package.json +5 -1
- package/dist/chunks/node_modules/clsx/dist/clsx-CdyIqUTr.js +0 -16
- package/dist/chunks/node_modules/tailwind-merge/dist/bundle-mjs-CF4QheV5.js +0 -1608
- package/dist/chunks/pkg/booking-engine/dist/schemas-D_yUBLa0.js +0 -14
- package/dist/chunks/pkg/ui/dist/lib/utils-BN5KOMSm.js +0 -8
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts +0 -22
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts.map +0 -1
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.js +0 -333
|
@@ -4,14 +4,14 @@ import { Card as n } from "../ui/card.js";
|
|
|
4
4
|
import { ContractSaleDocument as r } from "../components/ContractSaleDocument/Invoice.js";
|
|
5
5
|
import "../components/ContractSaleDocument/index.js";
|
|
6
6
|
import { apiGet as i, apiPost as a } from "../lib/apiCall.js";
|
|
7
|
-
import { Spinner as o } from "../chunks/pkg/ui/dist/Spinner/index-
|
|
7
|
+
import { Spinner as o } from "../chunks/pkg/ui/dist/Spinner/index-Cgi70z_E.js";
|
|
8
8
|
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as s, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as c, GET_CONTRACT_SALE_DOCUMENT_ROUTE as l, acceptContractSaleDocumentResponseSchema as u, contractSaleDocumentApiSchema as d, getContractSaleDocumentResponseSchema as f } from "../lib/contractSaleDocumentApi.js";
|
|
9
9
|
import { useEffect as p, useState as m } from "react";
|
|
10
10
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { toast as _ } from "@rpcbase/client";
|
|
12
|
+
import { Link as v, useLoaderData as y, useLocation as b, useNavigate as x } from "@rpcbase/router";
|
|
13
|
+
import { useTranslation as S } from "react-i18next";
|
|
14
|
+
import { cn as C } from "@rpcbase/ui";
|
|
15
15
|
import { ArrowLeft as w, ChevronDown as T, Download as E } from "lucide-react";
|
|
16
16
|
import { Menu as D } from "@base-ui/react/menu";
|
|
17
17
|
//#region src/pages/ContractSaleDocumentPage.tsx
|
|
@@ -55,7 +55,7 @@ var O = (e) => new URLSearchParams(e).get("pdf") === "1", k = (e) => t(new URLSe
|
|
|
55
55
|
labelKey: "docs_contract_sale_language_option_fr"
|
|
56
56
|
};
|
|
57
57
|
function R({ selectedLanguage: t, onChange: n }) {
|
|
58
|
-
let { t: r } =
|
|
58
|
+
let { t: r } = S(), [i, a] = m(!1), o = I.find((e) => e.code === t) ?? L;
|
|
59
59
|
return /* @__PURE__ */ g(D.Root, {
|
|
60
60
|
open: i,
|
|
61
61
|
onOpenChange: a,
|
|
@@ -96,7 +96,7 @@ function R({ selectedLanguage: t, onChange: n }) {
|
|
|
96
96
|
t.defaultPrevented || (n(e.code), a(!1));
|
|
97
97
|
},
|
|
98
98
|
"data-testid": `contract-sale-document-language-option-${e.code}`,
|
|
99
|
-
className:
|
|
99
|
+
className: C("relative flex cursor-pointer select-none items-center justify-between gap-3 whitespace-nowrap rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground", t === e.code && "bg-accent"),
|
|
100
100
|
children: [/* @__PURE__ */ h("span", { children: r(e.labelKey) }), /* @__PURE__ */ h("span", {
|
|
101
101
|
className: "text-2xs uppercase text-muted-foreground",
|
|
102
102
|
children: e.code
|
|
@@ -157,7 +157,7 @@ var z = (async ({ ctx: e, params: t }) => {
|
|
|
157
157
|
return t.success ? t.data : null;
|
|
158
158
|
};
|
|
159
159
|
function V() {
|
|
160
|
-
let { t: i, i18n: o } =
|
|
160
|
+
let { t: i, i18n: o } = S(), c = y(), l = b(), d = x(), { storeSlug: f, referenceId: C, saleDocumentId: T } = c, D = c.pdfMode || O(l.search), [A, j] = m(B(c.document)), [I, L] = m(null), [z, V] = m(!1), [H, U] = m(c.error), W = k(l.search) ?? t(A?.language?.customer) ?? c.documentLanguage ?? t(o.language) ?? "fr", G = f && C && T ? M(f, C, T, W) : null, K = f && C && T ? N(f, C, T, W) : "";
|
|
161
161
|
p(() => {
|
|
162
162
|
j(B(c.document)), U(c.error);
|
|
163
163
|
}, [c.document, c.error]), p(() => {
|
|
@@ -186,7 +186,7 @@ function V() {
|
|
|
186
186
|
className: "text-sm text-destructive",
|
|
187
187
|
children: /* @__PURE__ */ h("span", { children: H ?? i("docs_contract_sale_load_error") })
|
|
188
188
|
}),
|
|
189
|
-
/* @__PURE__ */ h(
|
|
189
|
+
/* @__PURE__ */ h(v, {
|
|
190
190
|
to: `/${f ?? ""}`,
|
|
191
191
|
children: /* @__PURE__ */ g(e, {
|
|
192
192
|
className: "gap-2",
|
|
@@ -211,7 +211,7 @@ function V() {
|
|
|
211
211
|
let J = async () => {
|
|
212
212
|
if (!G || z) return;
|
|
213
213
|
V(!0);
|
|
214
|
-
let e =
|
|
214
|
+
let e = _.loading(i("docs_contract_sale_preparing_pdf"), { icon: F() });
|
|
215
215
|
try {
|
|
216
216
|
let t = await fetch(G, {
|
|
217
217
|
method: "GET",
|
|
@@ -219,11 +219,11 @@ function V() {
|
|
|
219
219
|
});
|
|
220
220
|
if (!t.ok) throw Error(`PDF request failed with status ${t.status}`);
|
|
221
221
|
let n = await t.blob(), r = window.URL.createObjectURL(n), i = window.document.createElement("a");
|
|
222
|
-
i.href = r, i.download = P(t.headers.get("content-disposition"), A.saleDocumentNumber, A.kind), window.document.body.appendChild(i), i.click(), i.remove(),
|
|
222
|
+
i.href = r, i.download = P(t.headers.get("content-disposition"), A.saleDocumentNumber, A.kind), window.document.body.appendChild(i), i.click(), i.remove(), _.dismiss(e), window.setTimeout(() => {
|
|
223
223
|
window.URL.revokeObjectURL(r);
|
|
224
224
|
}, 0);
|
|
225
225
|
} catch (t) {
|
|
226
|
-
console.error("Failed to download storefront contract sale document PDF", t),
|
|
226
|
+
console.error("Failed to download storefront contract sale document PDF", t), _.dismiss(e), _.error(i("docs_contract_sale_download_pdf_error"));
|
|
227
227
|
} finally {
|
|
228
228
|
V(!1);
|
|
229
229
|
}
|
|
@@ -232,7 +232,7 @@ function V() {
|
|
|
232
232
|
className: "flex h-dvh min-h-0 flex-col overflow-hidden bg-gradient-to-br from-slate-100 via-slate-100 to-slate-200",
|
|
233
233
|
children: [/* @__PURE__ */ g("div", {
|
|
234
234
|
className: "fixed inset-x-0 top-0 z-40 flex h-14 items-center justify-between gap-3 border-b border-border bg-background/70 px-4 backdrop-blur-xl backdrop-saturate-125 supports-[backdrop-filter]:bg-background/55 sm:px-6",
|
|
235
|
-
children: [/* @__PURE__ */ g(
|
|
235
|
+
children: [/* @__PURE__ */ g(v, {
|
|
236
236
|
to: `/${f ?? ""}`,
|
|
237
237
|
className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950",
|
|
238
238
|
children: [/* @__PURE__ */ h(w, {
|
|
@@ -291,12 +291,12 @@ function V() {
|
|
|
291
291
|
publicDocumentUrl: K,
|
|
292
292
|
onAccept: async (e) => {
|
|
293
293
|
let t = e.mode === "signature" ? i("docs_contract_sale_signature_submit_error") : i("docs_contract_sale_acceptance_submit_error");
|
|
294
|
-
if (!f || !
|
|
294
|
+
if (!f || !C || !T) throw Error(t);
|
|
295
295
|
L(e.mode);
|
|
296
296
|
try {
|
|
297
297
|
let n = await a(s, {
|
|
298
298
|
storeSlug: f,
|
|
299
|
-
referenceId:
|
|
299
|
+
referenceId: C,
|
|
300
300
|
saleDocumentId: T,
|
|
301
301
|
lang: W,
|
|
302
302
|
acceptance: e.mode === "signature" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA2IA,MAAM,CAAC,OAAO,UAAU,QAAQ,
|
|
1
|
+
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA2IA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAouB/B"}
|