@bigz-app/booking-widget 0.3.9 → 0.3.11
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/booking-widget.js +26 -5
- package/dist/booking-widget.js.map +1 -1
- package/dist/components/PromoDialog.d.ts +1 -1
- package/dist/components/PromoDialog.d.ts.map +1 -1
- package/dist/components/UniversalBookingWidget.d.ts.map +1 -1
- package/dist/index.cjs +26 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +26 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -12228,8 +12228,21 @@ function NextEventsPreview({ events, onEventSelect, onShowAll, showAllButtonText
|
|
|
12228
12228
|
function PromoDialog({ onClose, onCtaClick }) {
|
|
12229
12229
|
const [copied, setCopied] = useState(false);
|
|
12230
12230
|
const [isVisible, setIsVisible] = useState(false);
|
|
12231
|
+
const [portalContainer, setPortalContainer] = useState(null);
|
|
12231
12232
|
// Hardcoded Xmas surf school content
|
|
12232
12233
|
const discountCode = "X-MAS";
|
|
12234
|
+
// Create portal container on mount to escape stacking context issues
|
|
12235
|
+
useEffect(() => {
|
|
12236
|
+
const container = document.createElement("div");
|
|
12237
|
+
container.id = "bigz-promo-dialog-portal";
|
|
12238
|
+
container.style.position = "relative";
|
|
12239
|
+
container.style.zIndex = "2147483647"; // Maximum z-index value
|
|
12240
|
+
document.body.appendChild(container);
|
|
12241
|
+
setPortalContainer(container);
|
|
12242
|
+
return () => {
|
|
12243
|
+
document.body.removeChild(container);
|
|
12244
|
+
};
|
|
12245
|
+
}, []);
|
|
12233
12246
|
// Animate in on mount
|
|
12234
12247
|
useEffect(() => {
|
|
12235
12248
|
const timer = setTimeout(() => setIsVisible(true), 50);
|
|
@@ -12261,7 +12274,11 @@ function PromoDialog({ onClose, onCtaClick }) {
|
|
|
12261
12274
|
setIsVisible(false);
|
|
12262
12275
|
setTimeout(onCtaClick, 200);
|
|
12263
12276
|
};
|
|
12264
|
-
|
|
12277
|
+
// Don't render until portal container is ready
|
|
12278
|
+
if (!portalContainer) {
|
|
12279
|
+
return null;
|
|
12280
|
+
}
|
|
12281
|
+
const dialogContent = (jsxs(Fragment, { children: [jsx("style", { children: `
|
|
12265
12282
|
@keyframes promo-wave {
|
|
12266
12283
|
0%, 100% { transform: translateX(0) translateY(0); }
|
|
12267
12284
|
25% { transform: translateX(5px) translateY(-3px); }
|
|
@@ -12291,7 +12308,7 @@ function PromoDialog({ onClose, onCtaClick }) {
|
|
|
12291
12308
|
inset: 0,
|
|
12292
12309
|
backgroundColor: "rgba(0, 20, 40, 0.85)",
|
|
12293
12310
|
backdropFilter: "blur(8px)",
|
|
12294
|
-
zIndex:
|
|
12311
|
+
zIndex: 60,
|
|
12295
12312
|
opacity: isVisible ? 1 : 0,
|
|
12296
12313
|
transition: "opacity 300ms ease-out",
|
|
12297
12314
|
} }), jsx("div", { style: {
|
|
@@ -12299,7 +12316,7 @@ function PromoDialog({ onClose, onCtaClick }) {
|
|
|
12299
12316
|
top: "50%",
|
|
12300
12317
|
left: "50%",
|
|
12301
12318
|
transform: `translate(-50%, -50%) scale(${isVisible ? 1 : 0.9})`,
|
|
12302
|
-
zIndex:
|
|
12319
|
+
zIndex: 61,
|
|
12303
12320
|
width: "92%",
|
|
12304
12321
|
maxWidth: "440px",
|
|
12305
12322
|
opacity: isVisible ? 1 : 0,
|
|
@@ -12480,6 +12497,8 @@ function PromoDialog({ onClose, onCtaClick }) {
|
|
|
12480
12497
|
fontSize: "12px",
|
|
12481
12498
|
color: "rgba(255,255,255,0.6)",
|
|
12482
12499
|
}, children: "G\u00FCltig f\u00FCr alle Buchungen bis 31. Dezember 2025" })] })] }) })] }));
|
|
12500
|
+
// Use portal to render at document body level, escaping any stacking context
|
|
12501
|
+
return createPortal(dialogContent, portalContainer);
|
|
12483
12502
|
}
|
|
12484
12503
|
|
|
12485
12504
|
// Predefined themes & Style Provider have been moved to ../styles/StyleProvider.tsx
|
|
@@ -12603,10 +12622,12 @@ function UniversalBookingWidget({ config: baseConfig }) {
|
|
|
12603
12622
|
}, [currentStep, shouldRenderInstanceSelection, shouldRenderBookingForm]);
|
|
12604
12623
|
// Promo dialog: show Xmas promo once per user during holiday season, prevent double-opening across multiple widgets
|
|
12605
12624
|
useEffect(() => {
|
|
12606
|
-
// Only show during holiday season (December and January)
|
|
12625
|
+
// Only show during holiday season (December and early January - New Years week)
|
|
12607
12626
|
const now = new Date();
|
|
12608
12627
|
const month = now.getMonth(); // 0 = January, 11 = December
|
|
12609
|
-
const
|
|
12628
|
+
const day = now.getDate();
|
|
12629
|
+
// Show in December (entire month) or January 1-2 (New Years holiday)
|
|
12630
|
+
const isHolidaySeason = month === 11 || (month === 0 && day <= 2);
|
|
12610
12631
|
if (!isHolidaySeason) {
|
|
12611
12632
|
return;
|
|
12612
12633
|
}
|