@loczer/storefront-sdk 0.198.0 → 0.199.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/StorefrontContext.d.ts +483 -0
- package/dist/StorefrontContext.d.ts.map +1 -0
- package/dist/StorefrontContext.js +39 -0
- package/dist/StorefrontProvider.d.ts +6 -486
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +34 -67
- package/dist/components/AboutSection/index.js +5 -5
- package/dist/components/BikeProductCard/index.d.ts.map +1 -1
- package/dist/components/BikeProductCard/index.js +27 -27
- package/dist/components/BookingBikeVariantDialog/index.js +14 -8
- package/dist/components/ContactSection/index.js +107 -107
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +117 -111
- package/dist/components/Header/index.js +4 -4
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +47 -40
- package/dist/components/ProductPriceBadge/index.d.ts +2 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +72 -70
- package/dist/components/TestimonialsSection/index.js +1 -1
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +1 -0
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +1 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.js +59 -58
- package/dist/lib/cartSummary.js +7 -7
- package/dist/lib/products.d.ts +6 -0
- package/dist/lib/products.d.ts.map +1 -1
- package/dist/lib/products.js +36 -32
- package/dist/lib/toast.d.ts +9 -0
- package/dist/lib/toast.d.ts.map +1 -0
- package/dist/lib/toast.js +13 -0
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +143 -138
- package/dist/pages/CheckoutPage.js +217 -217
- package/dist/pages/CheckoutPaymentPage.js +124 -124
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +83 -83
- package/dist/pages/HomePage.js +6 -3
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +177 -165
- package/package.json +2 -1
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import { StorefrontI18nLanguage } from './i18n/I18nProvider';
|
|
2
|
-
import { StorefrontConfiguration } from './storefrontSchemas';
|
|
3
|
-
import { AccessoryProduct, BikeProduct } from './lib/products';
|
|
4
|
-
type StorefrontContextValue = {
|
|
5
|
-
storeSlug: string;
|
|
6
|
-
storefrontConfiguration: StorefrontConfiguration;
|
|
7
|
-
bikes: BikeProduct[];
|
|
8
|
-
accessories: AccessoryProduct[];
|
|
9
|
-
bookingBikes: BikeProduct[];
|
|
10
|
-
bookingAccessories: AccessoryProduct[];
|
|
11
|
-
mapboxToken?: string;
|
|
12
|
-
language: StorefrontI18nLanguage;
|
|
13
|
-
};
|
|
14
1
|
export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderArgs) => Promise<{
|
|
15
2
|
storeSlug: string;
|
|
16
3
|
storefrontConfiguration: {
|
|
@@ -240,479 +227,12 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
|
|
|
240
227
|
} | undefined;
|
|
241
228
|
} | undefined;
|
|
242
229
|
};
|
|
243
|
-
bikes: BikeProduct[];
|
|
244
|
-
accessories: AccessoryProduct[];
|
|
245
|
-
bookingBikes: BikeProduct[];
|
|
246
|
-
bookingAccessories: AccessoryProduct[];
|
|
247
|
-
language: StorefrontI18nLanguage;
|
|
230
|
+
bikes: import('.').BikeProduct[];
|
|
231
|
+
accessories: import('.').AccessoryProduct[];
|
|
232
|
+
bookingBikes: import('.').BikeProduct[];
|
|
233
|
+
bookingAccessories: import('.').AccessoryProduct[];
|
|
234
|
+
language: import('./i18n/I18nProvider').StorefrontI18nLanguage;
|
|
248
235
|
}>;
|
|
249
236
|
export default function StorefrontProvider(): import("react/jsx-runtime").JSX.Element;
|
|
250
|
-
export
|
|
251
|
-
export declare function useOptionalStorefront(): StorefrontContextValue | undefined;
|
|
252
|
-
export declare function useStorefrontConfig(): {
|
|
253
|
-
config: {
|
|
254
|
-
storeSlug: string;
|
|
255
|
-
shop: {
|
|
256
|
-
id: string;
|
|
257
|
-
name: string;
|
|
258
|
-
slug?: string | undefined;
|
|
259
|
-
logoImageId?: string | undefined;
|
|
260
|
-
timeZone?: string | undefined;
|
|
261
|
-
url?: string | undefined;
|
|
262
|
-
googleMapsLink?: string | undefined;
|
|
263
|
-
googleRequestReviewsLink?: string | undefined;
|
|
264
|
-
emailAddress?: string | undefined;
|
|
265
|
-
contactPhone1?: string | undefined;
|
|
266
|
-
contactPhone2?: string | undefined;
|
|
267
|
-
address?: string | undefined;
|
|
268
|
-
city?: string | undefined;
|
|
269
|
-
country?: string | undefined;
|
|
270
|
-
gpsCoordinates?: [number, number] | undefined;
|
|
271
|
-
};
|
|
272
|
-
settings: {
|
|
273
|
-
status: "unpublished" | "published";
|
|
274
|
-
checkoutMode: "auto_approve_when_possible" | "manual_approval_required";
|
|
275
|
-
availabilityDisplay: {
|
|
276
|
-
defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
|
|
277
|
-
defaultFewRemainingThreshold?: number | undefined;
|
|
278
|
-
};
|
|
279
|
-
enabled: boolean;
|
|
280
|
-
fulfillmentModes: ("pickup" | "delivery")[];
|
|
281
|
-
deliveryDisabledReason: string;
|
|
282
|
-
sameDayCutoff: string;
|
|
283
|
-
};
|
|
284
|
-
bookingEngine: {
|
|
285
|
-
availabilityDisplay: {
|
|
286
|
-
defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
|
|
287
|
-
defaultFewRemainingThreshold?: number | undefined;
|
|
288
|
-
};
|
|
289
|
-
holdSettings: {
|
|
290
|
-
enabled: boolean;
|
|
291
|
-
defaultTtlMinutes: number;
|
|
292
|
-
};
|
|
293
|
-
pricing: {
|
|
294
|
-
baseUnit: "day" | "half_day" | "hour" | "month" | "week";
|
|
295
|
-
rentalUnits: {
|
|
296
|
-
unit: "day" | "half_day" | "hour" | "month" | "week";
|
|
297
|
-
durationHours: number;
|
|
298
|
-
label?: Record<string, {
|
|
299
|
-
[x: string]: unknown;
|
|
300
|
-
value: string;
|
|
301
|
-
updatedAt: Date;
|
|
302
|
-
autoTranslated?: boolean | undefined;
|
|
303
|
-
}> | undefined;
|
|
304
|
-
}[];
|
|
305
|
-
halfDay?: {
|
|
306
|
-
enabled: boolean;
|
|
307
|
-
boundaryHour: number;
|
|
308
|
-
} | undefined;
|
|
309
|
-
};
|
|
310
|
-
bookingDeposit: {
|
|
311
|
-
enabled: boolean;
|
|
312
|
-
percentage: number;
|
|
313
|
-
optimizeDepositAmount: boolean;
|
|
314
|
-
};
|
|
315
|
-
cancellationPolicy: {
|
|
316
|
-
tiers: {
|
|
317
|
-
upToHours: number;
|
|
318
|
-
refundPercentage: number;
|
|
319
|
-
}[];
|
|
320
|
-
};
|
|
321
|
-
securityDeposit: {
|
|
322
|
-
mode: "optional" | "disabled" | "required";
|
|
323
|
-
};
|
|
324
|
-
shop: {
|
|
325
|
-
timeZone: string;
|
|
326
|
-
openingHours: {
|
|
327
|
-
name: string;
|
|
328
|
-
startDate: string;
|
|
329
|
-
endDate: string;
|
|
330
|
-
openingHours: {
|
|
331
|
-
day: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
332
|
-
openingSlots: {
|
|
333
|
-
start: string;
|
|
334
|
-
end: string;
|
|
335
|
-
}[];
|
|
336
|
-
}[];
|
|
337
|
-
}[];
|
|
338
|
-
openingHoursOverrides?: {
|
|
339
|
-
date: string;
|
|
340
|
-
openingSlots: {
|
|
341
|
-
start: string;
|
|
342
|
-
end: string;
|
|
343
|
-
}[];
|
|
344
|
-
}[] | undefined;
|
|
345
|
-
extraTimeSlots?: {
|
|
346
|
-
minutesAfterClose: number;
|
|
347
|
-
extraAmount: number;
|
|
348
|
-
}[] | undefined;
|
|
349
|
-
};
|
|
350
|
-
currency: "CHF" | "EUR" | "GBP" | "USD";
|
|
351
|
-
checkout: {
|
|
352
|
-
mode: "auto_approve_when_possible" | "manual_approval_required";
|
|
353
|
-
dynamicOptions?: {
|
|
354
|
-
fulfillmentModes?: ("pickup" | "delivery")[] | undefined;
|
|
355
|
-
sameDayCutoff?: string | undefined;
|
|
356
|
-
} | undefined;
|
|
357
|
-
};
|
|
358
|
-
};
|
|
359
|
-
workspace?: {
|
|
360
|
-
name?: string | undefined;
|
|
361
|
-
workspaceLanguage?: "fr" | "en" | undefined;
|
|
362
|
-
languages?: string[] | undefined;
|
|
363
|
-
} | undefined;
|
|
364
|
-
content?: {
|
|
365
|
-
heroMode: "current_booking_hero" | "booking_bar_overlay_hero" | "vertical_marquee_hero";
|
|
366
|
-
galleryImageIds: string[];
|
|
367
|
-
whatsappPhone1Enabled: boolean;
|
|
368
|
-
whatsappPhone2Enabled: boolean;
|
|
369
|
-
showWhatsappFloatingButton: boolean;
|
|
370
|
-
modalMessages: {
|
|
371
|
-
id: string;
|
|
372
|
-
enabled: boolean;
|
|
373
|
-
showOnEachVisit: boolean;
|
|
374
|
-
startDate: string | null;
|
|
375
|
-
endDate: string | null;
|
|
376
|
-
imageIds: string[];
|
|
377
|
-
title?: Record<string, {
|
|
378
|
-
[x: string]: unknown;
|
|
379
|
-
value: string;
|
|
380
|
-
updatedAt: Date;
|
|
381
|
-
autoTranslated?: boolean | undefined;
|
|
382
|
-
}> | undefined;
|
|
383
|
-
subtitle?: Record<string, {
|
|
384
|
-
[x: string]: unknown;
|
|
385
|
-
value: string;
|
|
386
|
-
updatedAt: Date;
|
|
387
|
-
autoTranslated?: boolean | undefined;
|
|
388
|
-
}> | undefined;
|
|
389
|
-
message?: Record<string, {
|
|
390
|
-
version: 1;
|
|
391
|
-
json: string;
|
|
392
|
-
html: string;
|
|
393
|
-
text: string;
|
|
394
|
-
}> | undefined;
|
|
395
|
-
}[];
|
|
396
|
-
faq: {
|
|
397
|
-
general: {
|
|
398
|
-
id: string;
|
|
399
|
-
question: Record<string, {
|
|
400
|
-
[x: string]: unknown;
|
|
401
|
-
value: string;
|
|
402
|
-
updatedAt: Date;
|
|
403
|
-
autoTranslated?: boolean | undefined;
|
|
404
|
-
}>;
|
|
405
|
-
answer: Record<string, {
|
|
406
|
-
[x: string]: unknown;
|
|
407
|
-
value: string;
|
|
408
|
-
updatedAt: Date;
|
|
409
|
-
autoTranslated?: boolean | undefined;
|
|
410
|
-
}>;
|
|
411
|
-
}[];
|
|
412
|
-
deliveries: {
|
|
413
|
-
id: string;
|
|
414
|
-
question: Record<string, {
|
|
415
|
-
[x: string]: unknown;
|
|
416
|
-
value: string;
|
|
417
|
-
updatedAt: Date;
|
|
418
|
-
autoTranslated?: boolean | undefined;
|
|
419
|
-
}>;
|
|
420
|
-
answer: Record<string, {
|
|
421
|
-
[x: string]: unknown;
|
|
422
|
-
value: string;
|
|
423
|
-
updatedAt: Date;
|
|
424
|
-
autoTranslated?: boolean | undefined;
|
|
425
|
-
}>;
|
|
426
|
-
}[];
|
|
427
|
-
booking: {
|
|
428
|
-
id: string;
|
|
429
|
-
question: Record<string, {
|
|
430
|
-
[x: string]: unknown;
|
|
431
|
-
value: string;
|
|
432
|
-
updatedAt: Date;
|
|
433
|
-
autoTranslated?: boolean | undefined;
|
|
434
|
-
}>;
|
|
435
|
-
answer: Record<string, {
|
|
436
|
-
[x: string]: unknown;
|
|
437
|
-
value: string;
|
|
438
|
-
updatedAt: Date;
|
|
439
|
-
autoTranslated?: boolean | undefined;
|
|
440
|
-
}>;
|
|
441
|
-
}[];
|
|
442
|
-
};
|
|
443
|
-
tagline?: Record<string, {
|
|
444
|
-
[x: string]: unknown;
|
|
445
|
-
value: string;
|
|
446
|
-
updatedAt: Date;
|
|
447
|
-
autoTranslated?: boolean | undefined;
|
|
448
|
-
}> | undefined;
|
|
449
|
-
logoSquareImageId?: string | undefined;
|
|
450
|
-
logoWideImageId?: string | undefined;
|
|
451
|
-
topBannerMessage?: Record<string, {
|
|
452
|
-
[x: string]: unknown;
|
|
453
|
-
value: string;
|
|
454
|
-
updatedAt: Date;
|
|
455
|
-
autoTranslated?: boolean | undefined;
|
|
456
|
-
}> | undefined;
|
|
457
|
-
about?: Record<string, {
|
|
458
|
-
version: 1;
|
|
459
|
-
json: string;
|
|
460
|
-
html: string;
|
|
461
|
-
text: string;
|
|
462
|
-
}> | undefined;
|
|
463
|
-
whatsappMessage?: Record<string, {
|
|
464
|
-
[x: string]: unknown;
|
|
465
|
-
value: string;
|
|
466
|
-
updatedAt: Date;
|
|
467
|
-
autoTranslated?: boolean | undefined;
|
|
468
|
-
}> | undefined;
|
|
469
|
-
} | undefined;
|
|
470
|
-
modules?: {
|
|
471
|
-
reviews?: {
|
|
472
|
-
enabled: boolean;
|
|
473
|
-
showRecentReviewsOnStorefront: boolean;
|
|
474
|
-
} | undefined;
|
|
475
|
-
insurance?: {
|
|
476
|
-
enabled: boolean;
|
|
477
|
-
} | undefined;
|
|
478
|
-
} | undefined;
|
|
479
|
-
};
|
|
480
|
-
storefrontConfiguration: {
|
|
481
|
-
storeSlug: string;
|
|
482
|
-
shop: {
|
|
483
|
-
id: string;
|
|
484
|
-
name: string;
|
|
485
|
-
slug?: string | undefined;
|
|
486
|
-
logoImageId?: string | undefined;
|
|
487
|
-
timeZone?: string | undefined;
|
|
488
|
-
url?: string | undefined;
|
|
489
|
-
googleMapsLink?: string | undefined;
|
|
490
|
-
googleRequestReviewsLink?: string | undefined;
|
|
491
|
-
emailAddress?: string | undefined;
|
|
492
|
-
contactPhone1?: string | undefined;
|
|
493
|
-
contactPhone2?: string | undefined;
|
|
494
|
-
address?: string | undefined;
|
|
495
|
-
city?: string | undefined;
|
|
496
|
-
country?: string | undefined;
|
|
497
|
-
gpsCoordinates?: [number, number] | undefined;
|
|
498
|
-
};
|
|
499
|
-
settings: {
|
|
500
|
-
status: "unpublished" | "published";
|
|
501
|
-
checkoutMode: "auto_approve_when_possible" | "manual_approval_required";
|
|
502
|
-
availabilityDisplay: {
|
|
503
|
-
defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
|
|
504
|
-
defaultFewRemainingThreshold?: number | undefined;
|
|
505
|
-
};
|
|
506
|
-
enabled: boolean;
|
|
507
|
-
fulfillmentModes: ("pickup" | "delivery")[];
|
|
508
|
-
deliveryDisabledReason: string;
|
|
509
|
-
sameDayCutoff: string;
|
|
510
|
-
};
|
|
511
|
-
bookingEngine: {
|
|
512
|
-
availabilityDisplay: {
|
|
513
|
-
defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
|
|
514
|
-
defaultFewRemainingThreshold?: number | undefined;
|
|
515
|
-
};
|
|
516
|
-
holdSettings: {
|
|
517
|
-
enabled: boolean;
|
|
518
|
-
defaultTtlMinutes: number;
|
|
519
|
-
};
|
|
520
|
-
pricing: {
|
|
521
|
-
baseUnit: "day" | "half_day" | "hour" | "month" | "week";
|
|
522
|
-
rentalUnits: {
|
|
523
|
-
unit: "day" | "half_day" | "hour" | "month" | "week";
|
|
524
|
-
durationHours: number;
|
|
525
|
-
label?: Record<string, {
|
|
526
|
-
[x: string]: unknown;
|
|
527
|
-
value: string;
|
|
528
|
-
updatedAt: Date;
|
|
529
|
-
autoTranslated?: boolean | undefined;
|
|
530
|
-
}> | undefined;
|
|
531
|
-
}[];
|
|
532
|
-
halfDay?: {
|
|
533
|
-
enabled: boolean;
|
|
534
|
-
boundaryHour: number;
|
|
535
|
-
} | undefined;
|
|
536
|
-
};
|
|
537
|
-
bookingDeposit: {
|
|
538
|
-
enabled: boolean;
|
|
539
|
-
percentage: number;
|
|
540
|
-
optimizeDepositAmount: boolean;
|
|
541
|
-
};
|
|
542
|
-
cancellationPolicy: {
|
|
543
|
-
tiers: {
|
|
544
|
-
upToHours: number;
|
|
545
|
-
refundPercentage: number;
|
|
546
|
-
}[];
|
|
547
|
-
};
|
|
548
|
-
securityDeposit: {
|
|
549
|
-
mode: "optional" | "disabled" | "required";
|
|
550
|
-
};
|
|
551
|
-
shop: {
|
|
552
|
-
timeZone: string;
|
|
553
|
-
openingHours: {
|
|
554
|
-
name: string;
|
|
555
|
-
startDate: string;
|
|
556
|
-
endDate: string;
|
|
557
|
-
openingHours: {
|
|
558
|
-
day: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
559
|
-
openingSlots: {
|
|
560
|
-
start: string;
|
|
561
|
-
end: string;
|
|
562
|
-
}[];
|
|
563
|
-
}[];
|
|
564
|
-
}[];
|
|
565
|
-
openingHoursOverrides?: {
|
|
566
|
-
date: string;
|
|
567
|
-
openingSlots: {
|
|
568
|
-
start: string;
|
|
569
|
-
end: string;
|
|
570
|
-
}[];
|
|
571
|
-
}[] | undefined;
|
|
572
|
-
extraTimeSlots?: {
|
|
573
|
-
minutesAfterClose: number;
|
|
574
|
-
extraAmount: number;
|
|
575
|
-
}[] | undefined;
|
|
576
|
-
};
|
|
577
|
-
currency: "CHF" | "EUR" | "GBP" | "USD";
|
|
578
|
-
checkout: {
|
|
579
|
-
mode: "auto_approve_when_possible" | "manual_approval_required";
|
|
580
|
-
dynamicOptions?: {
|
|
581
|
-
fulfillmentModes?: ("pickup" | "delivery")[] | undefined;
|
|
582
|
-
sameDayCutoff?: string | undefined;
|
|
583
|
-
} | undefined;
|
|
584
|
-
};
|
|
585
|
-
};
|
|
586
|
-
workspace?: {
|
|
587
|
-
name?: string | undefined;
|
|
588
|
-
workspaceLanguage?: "fr" | "en" | undefined;
|
|
589
|
-
languages?: string[] | undefined;
|
|
590
|
-
} | undefined;
|
|
591
|
-
content?: {
|
|
592
|
-
heroMode: "current_booking_hero" | "booking_bar_overlay_hero" | "vertical_marquee_hero";
|
|
593
|
-
galleryImageIds: string[];
|
|
594
|
-
whatsappPhone1Enabled: boolean;
|
|
595
|
-
whatsappPhone2Enabled: boolean;
|
|
596
|
-
showWhatsappFloatingButton: boolean;
|
|
597
|
-
modalMessages: {
|
|
598
|
-
id: string;
|
|
599
|
-
enabled: boolean;
|
|
600
|
-
showOnEachVisit: boolean;
|
|
601
|
-
startDate: string | null;
|
|
602
|
-
endDate: string | null;
|
|
603
|
-
imageIds: string[];
|
|
604
|
-
title?: Record<string, {
|
|
605
|
-
[x: string]: unknown;
|
|
606
|
-
value: string;
|
|
607
|
-
updatedAt: Date;
|
|
608
|
-
autoTranslated?: boolean | undefined;
|
|
609
|
-
}> | undefined;
|
|
610
|
-
subtitle?: Record<string, {
|
|
611
|
-
[x: string]: unknown;
|
|
612
|
-
value: string;
|
|
613
|
-
updatedAt: Date;
|
|
614
|
-
autoTranslated?: boolean | undefined;
|
|
615
|
-
}> | undefined;
|
|
616
|
-
message?: Record<string, {
|
|
617
|
-
version: 1;
|
|
618
|
-
json: string;
|
|
619
|
-
html: string;
|
|
620
|
-
text: string;
|
|
621
|
-
}> | undefined;
|
|
622
|
-
}[];
|
|
623
|
-
faq: {
|
|
624
|
-
general: {
|
|
625
|
-
id: string;
|
|
626
|
-
question: Record<string, {
|
|
627
|
-
[x: string]: unknown;
|
|
628
|
-
value: string;
|
|
629
|
-
updatedAt: Date;
|
|
630
|
-
autoTranslated?: boolean | undefined;
|
|
631
|
-
}>;
|
|
632
|
-
answer: Record<string, {
|
|
633
|
-
[x: string]: unknown;
|
|
634
|
-
value: string;
|
|
635
|
-
updatedAt: Date;
|
|
636
|
-
autoTranslated?: boolean | undefined;
|
|
637
|
-
}>;
|
|
638
|
-
}[];
|
|
639
|
-
deliveries: {
|
|
640
|
-
id: string;
|
|
641
|
-
question: Record<string, {
|
|
642
|
-
[x: string]: unknown;
|
|
643
|
-
value: string;
|
|
644
|
-
updatedAt: Date;
|
|
645
|
-
autoTranslated?: boolean | undefined;
|
|
646
|
-
}>;
|
|
647
|
-
answer: Record<string, {
|
|
648
|
-
[x: string]: unknown;
|
|
649
|
-
value: string;
|
|
650
|
-
updatedAt: Date;
|
|
651
|
-
autoTranslated?: boolean | undefined;
|
|
652
|
-
}>;
|
|
653
|
-
}[];
|
|
654
|
-
booking: {
|
|
655
|
-
id: string;
|
|
656
|
-
question: Record<string, {
|
|
657
|
-
[x: string]: unknown;
|
|
658
|
-
value: string;
|
|
659
|
-
updatedAt: Date;
|
|
660
|
-
autoTranslated?: boolean | undefined;
|
|
661
|
-
}>;
|
|
662
|
-
answer: Record<string, {
|
|
663
|
-
[x: string]: unknown;
|
|
664
|
-
value: string;
|
|
665
|
-
updatedAt: Date;
|
|
666
|
-
autoTranslated?: boolean | undefined;
|
|
667
|
-
}>;
|
|
668
|
-
}[];
|
|
669
|
-
};
|
|
670
|
-
tagline?: Record<string, {
|
|
671
|
-
[x: string]: unknown;
|
|
672
|
-
value: string;
|
|
673
|
-
updatedAt: Date;
|
|
674
|
-
autoTranslated?: boolean | undefined;
|
|
675
|
-
}> | undefined;
|
|
676
|
-
logoSquareImageId?: string | undefined;
|
|
677
|
-
logoWideImageId?: string | undefined;
|
|
678
|
-
topBannerMessage?: Record<string, {
|
|
679
|
-
[x: string]: unknown;
|
|
680
|
-
value: string;
|
|
681
|
-
updatedAt: Date;
|
|
682
|
-
autoTranslated?: boolean | undefined;
|
|
683
|
-
}> | undefined;
|
|
684
|
-
about?: Record<string, {
|
|
685
|
-
version: 1;
|
|
686
|
-
json: string;
|
|
687
|
-
html: string;
|
|
688
|
-
text: string;
|
|
689
|
-
}> | undefined;
|
|
690
|
-
whatsappMessage?: Record<string, {
|
|
691
|
-
[x: string]: unknown;
|
|
692
|
-
value: string;
|
|
693
|
-
updatedAt: Date;
|
|
694
|
-
autoTranslated?: boolean | undefined;
|
|
695
|
-
}> | undefined;
|
|
696
|
-
} | undefined;
|
|
697
|
-
modules?: {
|
|
698
|
-
reviews?: {
|
|
699
|
-
enabled: boolean;
|
|
700
|
-
showRecentReviewsOnStorefront: boolean;
|
|
701
|
-
} | undefined;
|
|
702
|
-
insurance?: {
|
|
703
|
-
enabled: boolean;
|
|
704
|
-
} | undefined;
|
|
705
|
-
} | undefined;
|
|
706
|
-
};
|
|
707
|
-
};
|
|
708
|
-
export declare function useStorefrontWorkspaceLanguage(): StorefrontI18nLanguage;
|
|
709
|
-
export declare function useStorefrontProducts(): {
|
|
710
|
-
bikes: BikeProduct[];
|
|
711
|
-
accessories: AccessoryProduct[];
|
|
712
|
-
};
|
|
713
|
-
export declare function useStorefrontBookingProducts(): {
|
|
714
|
-
bikes: BikeProduct[];
|
|
715
|
-
accessories: AccessoryProduct[];
|
|
716
|
-
};
|
|
717
|
-
export {};
|
|
237
|
+
export * from './StorefrontContext';
|
|
718
238
|
//# sourceMappingURL=StorefrontProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorefrontProvider.d.ts","sourceRoot":"","sources":["../src/StorefrontProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StorefrontProvider.d.ts","sourceRoot":"","sources":["../src/StorefrontProvider.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEA,CAAA;AAGnB,MAAM,CAAC,OAAO,UAAU,kBAAkB,4CAqBzC;AAED,cAAc,qBAAqB,CAAA"}
|
|
@@ -3,63 +3,63 @@ import { toStorefrontAccessoryProducts as t, toStorefrontBikeProducts as n, toSt
|
|
|
3
3
|
import { ROUTE as i, responseSchema as a } from "./lib/storefrontProducts.js";
|
|
4
4
|
import { I18nProvider as o, detectStorefrontI18nLanguage as s, resolveStorefrontI18nRequestLanguage as c } from "./i18n/I18nProvider.js";
|
|
5
5
|
import { Layout as l } from "./components/Layout/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { apiClient as
|
|
10
|
-
import { useLoaderData as
|
|
6
|
+
import { StorefrontContext as u, useOptionalStorefront as d, useStorefront as f, useStorefrontBookingProducts as p, useStorefrontConfig as m, useStorefrontProducts as h, useStorefrontWorkspaceLanguage as g } from "./StorefrontContext.js";
|
|
7
|
+
import { createStorefrontUnavailableError as _, isStorefrontUnavailableRouteError as v, parseStorefrontUnavailableStatus as y } from "./lib/storefrontUnavailable.js";
|
|
8
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
9
|
+
import { apiClient as x } from "@rpcbase/client";
|
|
10
|
+
import { useLoaderData as S } from "@rpcbase/router";
|
|
11
11
|
//#region src/StorefrontProvider.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
if (!
|
|
12
|
+
var C = (async ({ ctx: o, params: l }) => {
|
|
13
|
+
let u = typeof l.storeSlug == "string" ? l.storeSlug.trim().toLowerCase() : "";
|
|
14
|
+
if (!u) throw _("unknown");
|
|
15
15
|
try {
|
|
16
|
-
let [l, d] = await Promise.all([
|
|
17
|
-
if (
|
|
18
|
-
let
|
|
19
|
-
if (!
|
|
20
|
-
let
|
|
21
|
-
if (!
|
|
22
|
-
if (!
|
|
23
|
-
let
|
|
24
|
-
bikes:
|
|
25
|
-
accessories:
|
|
26
|
-
}),
|
|
16
|
+
let [l, d] = await Promise.all([x.get("/api/public/storefront/config", { storeSlug: u }, o), x.get(i, { storeSlug: u }, o)]), f = typeof l == "object" && l ? l : {};
|
|
17
|
+
if (f.success !== !0) throw _(y(f.storefrontStatus) ?? "unknown", typeof f.replacementSlug == "string" ? f.replacementSlug : void 0);
|
|
18
|
+
let p = e.safeParse(f.storefrontConfiguration);
|
|
19
|
+
if (!p.success) throw console.error("Invalid storefront config received", p.error.flatten()), new Response("Storefront config invalid", { status: 500 });
|
|
20
|
+
let m = a.safeParse(d);
|
|
21
|
+
if (!m.success) throw console.error("Invalid storefront products received", m.error.flatten()), new Response("Storefront products invalid", { status: 500 });
|
|
22
|
+
if (!m.data.success) throw console.error("Storefront products unavailable", m.data.message ?? "Unknown error"), new Response("Storefront products unavailable", { status: 500 });
|
|
23
|
+
let h = n(m.data.products.bikes), g = t(m.data.products.accessories), v = r({
|
|
24
|
+
bikes: h,
|
|
25
|
+
accessories: g
|
|
26
|
+
}), b = p.data.workspace?.languages ?? null, S = p.data.workspace?.workspaceLanguage ?? null, C = o?.req ? c({
|
|
27
27
|
cookieHeader: o.req.headers?.cookie,
|
|
28
28
|
acceptLanguageHeader: o.req.headers?.["accept-language"],
|
|
29
|
-
configuredLanguages:
|
|
29
|
+
configuredLanguages: b,
|
|
30
30
|
configuredFallbackLanguage: S
|
|
31
|
-
}) : s(
|
|
31
|
+
}) : s(b, S);
|
|
32
32
|
return {
|
|
33
|
-
storeSlug:
|
|
34
|
-
storefrontConfiguration:
|
|
35
|
-
bikes:
|
|
36
|
-
accessories:
|
|
37
|
-
bookingBikes:
|
|
38
|
-
bookingAccessories:
|
|
33
|
+
storeSlug: u,
|
|
34
|
+
storefrontConfiguration: p.data,
|
|
35
|
+
bikes: h,
|
|
36
|
+
accessories: g,
|
|
37
|
+
bookingBikes: v.bikes,
|
|
38
|
+
bookingAccessories: v.accessories,
|
|
39
39
|
language: C
|
|
40
40
|
};
|
|
41
41
|
} catch (e) {
|
|
42
|
-
throw
|
|
42
|
+
throw v(e) || e instanceof Response ? e : (console.error("Error loading storefront:", e), new Response("Storefront unavailable", { status: 500 }));
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
function
|
|
46
|
-
let e =
|
|
45
|
+
function w() {
|
|
46
|
+
let e = S(), t = {
|
|
47
47
|
BASE_URL: "/",
|
|
48
48
|
DEV: !1,
|
|
49
49
|
MODE: "production",
|
|
50
50
|
PROD: !0,
|
|
51
51
|
SSR: !1
|
|
52
52
|
}, n = typeof t?.RB_PUBLIC_MAPBOX_TOKEN == "string" && t.RB_PUBLIC_MAPBOX_TOKEN.trim().length > 0 ? t.RB_PUBLIC_MAPBOX_TOKEN : void 0;
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ b(u.Provider, {
|
|
54
54
|
value: {
|
|
55
55
|
...e,
|
|
56
56
|
mapboxToken: n
|
|
57
57
|
},
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ b(o, {
|
|
59
59
|
initialLanguage: e.language,
|
|
60
60
|
configuredLanguages: e.storefrontConfiguration.workspace?.languages,
|
|
61
61
|
configuredFallbackLanguage: e.storefrontConfiguration.workspace?.workspaceLanguage,
|
|
62
|
-
children: /* @__PURE__ */
|
|
62
|
+
children: /* @__PURE__ */ b(l, {
|
|
63
63
|
storefrontConfiguration: e.storefrontConfiguration,
|
|
64
64
|
storefrontProducts: {
|
|
65
65
|
bikes: e.bikes,
|
|
@@ -69,38 +69,5 @@ function b() {
|
|
|
69
69
|
})
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function x() {
|
|
73
|
-
let e = m(v);
|
|
74
|
-
if (e === void 0) throw Error("must be used within the provider");
|
|
75
|
-
return e;
|
|
76
|
-
}
|
|
77
|
-
function S() {
|
|
78
|
-
return m(v);
|
|
79
|
-
}
|
|
80
|
-
function C() {
|
|
81
|
-
let { storefrontConfiguration: e } = x();
|
|
82
|
-
return {
|
|
83
|
-
config: e,
|
|
84
|
-
storefrontConfiguration: e
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function w() {
|
|
88
|
-
let { storefrontConfiguration: e } = x();
|
|
89
|
-
return e.workspace?.workspaceLanguage ?? "en";
|
|
90
|
-
}
|
|
91
|
-
function T() {
|
|
92
|
-
let { bikes: e, accessories: t } = x();
|
|
93
|
-
return {
|
|
94
|
-
bikes: e,
|
|
95
|
-
accessories: t
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function E() {
|
|
99
|
-
let { bookingBikes: e, bookingAccessories: t } = x();
|
|
100
|
-
return {
|
|
101
|
-
bikes: e,
|
|
102
|
-
accessories: t
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
72
|
//#endregion
|
|
106
|
-
export {
|
|
73
|
+
export { u as StorefrontContext, w as default, C as loader, d as useOptionalStorefront, f as useStorefront, p as useStorefrontBookingProducts, m as useStorefrontConfig, h as useStorefrontProducts, g as useStorefrontWorkspaceLanguage };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getLocalizedEntry as e } from "../../localization.js";
|
|
2
|
+
import { cn as t } from "../../lib/utils.js";
|
|
3
3
|
import { UNCONFIGURED_SHOP_MAP_CENTER as n } from "../../lib/storefrontMissingValues.js";
|
|
4
|
-
import { useStorefront as r } from "../../
|
|
4
|
+
import { useStorefront as r } from "../../StorefrontContext.js";
|
|
5
5
|
import { createMarkerElement as i } from "../Map/createMarkerElement.js";
|
|
6
6
|
import { Map as a } from "../Map/index.js";
|
|
7
7
|
import { useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
@@ -9,7 +9,7 @@ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
|
9
9
|
import { useTranslation as p } from "react-i18next";
|
|
10
10
|
//#region src/components/AboutSection/index.tsx
|
|
11
11
|
function m() {
|
|
12
|
-
let { i18n: m, t: h } = p(), { storefrontConfiguration: g, mapboxToken: _ } = r(), v = g.workspace?.workspaceLanguage, [y, b] = l(!1), [x, S] = l(!1), C = c(null), w =
|
|
12
|
+
let { i18n: m, t: h } = p(), { storefrontConfiguration: g, mapboxToken: _ } = r(), v = g.workspace?.workspaceLanguage, [y, b] = l(!1), [x, S] = l(!1), C = c(null), w = e(g.content?.about, m.language, v)?.html?.trim(), T = s(() => {
|
|
13
13
|
let e = g.shop.gpsCoordinates;
|
|
14
14
|
return e ? [e[1], e[0]] : null;
|
|
15
15
|
}, [g.shop.gpsCoordinates]), E = T ?? n, D = s(() => i(), []), O = g.shop.address?.trim() ?? "", k = s(() => T ? {
|
|
@@ -59,7 +59,7 @@ function m() {
|
|
|
59
59
|
className: "relative mt-4",
|
|
60
60
|
children: [/* @__PURE__ */ d("div", {
|
|
61
61
|
ref: C,
|
|
62
|
-
className:
|
|
62
|
+
className: t("overflow-hidden text-sm leading-6 text-slate-700 transition-[max-height] duration-300 ease-out sm:text-base [&_a]:text-slate-900 [&_a]:underline [&_blockquote]:border-l-2 [&_blockquote]:border-slate-300 [&_blockquote]:pl-4 [&_h1]:text-2xl [&_h1]:font-semibold [&_h2]:text-xl [&_h2]:font-semibold [&_h3]:text-lg [&_h3]:font-semibold [&_li]:my-1 [&_ol]:list-decimal [&_ol]:pl-6 [&_p]:my-2 [&_ul]:list-disc [&_ul]:pl-6", !y && "max-h-[320px]"),
|
|
63
63
|
dangerouslySetInnerHTML: { __html: w }
|
|
64
64
|
}), !y && x && /* @__PURE__ */ d("div", {
|
|
65
65
|
"aria-hidden": !0,
|