@riverbankcms/sdk 0.135.1 → 0.136.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/CHANGELOG.md +13 -0
- package/README.md +4 -8
- package/dist/{PreviewEditorSidebar-D4p_5TdY.mjs → PreviewEditorSidebar-BU5ZlhQR.mjs} +4 -4
- package/dist/{PreviewEditorUI-D0cRoTX1.mjs → PreviewEditorUI-9XkHL-bC.mjs} +3 -3
- package/dist/{PreviewQueryProvider-DcgaESkm.mjs → PreviewQueryProvider-wbEpXryy.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-BKLtM3Nz.mjs → SdkPreviewModeRuntime-CnWmj-2B.mjs} +50 -99
- package/dist/{SiteChromeCustomizeContext-61X2m7QV.mjs → SiteChromeCustomizeContext-B6d5zkog.mjs} +2299 -1149
- package/dist/_dts/ai/src/contracts/proposals.d.ts +8 -554
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +401 -2312
- package/dist/_dts/api/src/contentRuntime.d.ts +6 -0
- package/dist/_dts/api/src/endpoints.d.ts +7 -0
- package/dist/_dts/api/src/index.d.ts +1 -0
- package/dist/_dts/api/src/publicEventEndpointDefinitions.d.ts +7 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +26 -0
- package/dist/_dts/api/src/sdkBlockContentAdmission.d.ts +5 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +6 -432
- package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +2 -3
- package/dist/_dts/block-form/src/utils/slug.d.ts +6 -0
- package/dist/_dts/blocks/src/PageRenderer.d.ts +12 -6
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +48 -0
- package/dist/_dts/blocks/src/definitions.d.ts +14 -0
- package/dist/_dts/blocks/src/index.d.ts +4 -3
- package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +40 -0
- package/dist/_dts/blocks/src/server.d.ts +2 -2
- package/dist/_dts/blocks/src/system/data/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/data/publicLoaderCachePolicy.d.ts +78 -0
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +2 -18
- package/dist/_dts/blocks/src/system/manifest/validation.d.ts +103 -16
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +19 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +52 -0
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.d.ts +44 -18
- package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.state.d.ts +20 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/VerifyingTimeoutStep.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.client.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +40 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +43 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarDayCell.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DayEventsModal.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModalContext.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekBoardView.d.ts +31 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +9 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/timetableModel.d.ts +4 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +3 -3
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +0 -1
- package/dist/_dts/calendar/src/grid.d.ts +24 -66
- package/dist/_dts/calendar/src/index.d.ts +2 -2
- package/dist/_dts/calendar/src/timetable.d.ts +5 -9
- package/dist/_dts/commerce/src/purchase/allocation.d.ts +11 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/settlement.d.ts +33 -0
- package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +8 -0
- package/dist/_dts/content-model/src/templates/defaults.d.ts +6 -0
- package/dist/_dts/core/src/slug.d.ts +20 -5
- package/dist/_dts/preview-next/src/client/blocks/EditablePageRenderer.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/headerInteractionPaletteSurfaceState.d.ts +2 -1
- package/dist/_dts/sdk/src/client/publicLoaderCacheAccess.d.ts +6 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -1
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +10 -6
- package/dist/_dts/sdk/src/rendering/components/Block.shared.d.ts +0 -1
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/helpers/footerPageOutline.d.ts +3 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +3 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +17 -0
- package/dist/_dts/sdk/src/rendering/helpers/templateContent.d.ts +9 -3
- package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/index.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +7 -4
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/cards/types.d.ts +8 -8
- package/dist/_dts/theme-core/src/data.d.ts +12 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/header/legacyHeaderVariant.d.ts +2 -6
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +6 -807
- package/dist/_dts/theme-core/src/schema.d.ts +452 -1278
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +213 -1
- package/dist/_dts/theme-core/src/site-styles/headerLayoutCatalog.d.ts +0 -29
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyles.d.ts +10 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutTypes.d.ts +8 -5
- package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompiler.d.ts +16 -2
- package/dist/_dts/theme-core/src/site-styles/headerStyleDefaults.d.ts +465 -0
- package/dist/_dts/theme-core/src/site-styles/headerStyleRecipe.d.ts +161 -0
- package/dist/client/{BookingConsentAgreement-Bz9znbpn.mjs → BookingConsentAgreement-DCch21a6.mjs} +2 -2
- package/dist/client/{DiscountCodeDisclosure-35Ru8yB9.mjs → DiscountCodeDisclosure-DIj1T59K.mjs} +1 -1
- package/dist/client/{EventCombined.client-BKB0ZxRR.mjs → EventCombined.client-BWVNlXTx.mjs} +226 -206
- package/dist/client/{EventListing.client-Dx8I21ok.mjs → EventListing.client-DVFCDe3i.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CEWx-Bhe.mjs → LeafletStaticMap-BY5mIHw9.mjs} +1 -1
- package/dist/client/{accordion-KIDsKTwS.mjs → accordion-CK29E8rG.mjs} +1 -1
- package/dist/client/{bookingForm-D96Rmp-5.mjs → bookingForm-DFvnet-N.mjs} +5 -5
- package/dist/client/bookings.mjs +86 -47
- package/dist/client/{carousel-YwUgyL66.mjs → carousel-BVU5NQlb.mjs} +1 -1
- package/dist/client/{cart-BbwuNrUT.mjs → cart-BNItcZVa.mjs} +3 -3
- package/dist/client/{checkout-hp1ucmEY.mjs → checkout-Bu6iCdkP.mjs} +3 -3
- package/dist/client/client.mjs +1950 -1031
- package/dist/client/{context-DljQn8L5.mjs → context-BImarOAq.mjs} +12 -0
- package/dist/client/{eventCalendar-DU4iNLpo.mjs → eventCalendar-DS2h-UXD.mjs} +256 -114
- package/dist/client/{eventCombined-CZuupW8m.mjs → eventCombined-Drt4Oq9p.mjs} +3 -3
- package/dist/client/{eventDetails-DPQWwCIi.mjs → eventDetails-Bl2vWgTX.mjs} +4 -3
- package/dist/client/{eventListing-C7oMidwS.mjs → eventListing-CS7PHY7v.mjs} +3 -3
- package/dist/client/{eventRegistration-zEiunlUs.mjs → eventRegistration-D-j8eNy2.mjs} +85 -41
- package/dist/client/{form-D2KIyCVJ.mjs → form-RMpoLTyr.mjs} +2 -2
- package/dist/client/{headerSection-CK5uChUK.mjs → headerSection-BYE3Lb3k.mjs} +2 -2
- package/dist/client/hooks.mjs +2225 -276
- package/dist/client/{locationMap-DLQNH1ln.mjs → locationMap-BxSr7Kkh.mjs} +2 -2
- package/dist/client/{newsletterForm-ZuhIG7fZ.mjs → newsletterForm-DerbXwFC.mjs} +2 -2
- package/dist/client/{productDetail-7hIcGeae.mjs → productDetail-4SZCLhAf.mjs} +3 -3
- package/dist/client/{productList-T4Cii1ot.mjs → productList-D7AP4GNq.mjs} +3 -3
- package/dist/client/{propsDecoder-mB0aC_Fi.mjs → propsDecoder-pzBeCh14.mjs} +94 -24
- package/dist/client/rendering/client.mjs +758 -464
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +2126 -1244
- package/dist/client/{scrollToBlock-Du5mHgvL.mjs → scrollToBlock-CduAKf8T.mjs} +1 -1
- package/dist/client/{shop-B5zAcKZn.mjs → shop-Cp5p_kGe.mjs} +6 -6
- package/dist/client/{shop-commerce-BKBZB6l5.mjs → shop-commerce-DicXYaYX.mjs} +5 -5
- package/dist/client/{shop-commerce-store-Cq4qlNtQ.mjs → shop-commerce-store-CGWnpY4K.mjs} +1 -1
- package/dist/client/{shopShared-DYGzEs9D.mjs → shopShared-BDf9ljkm.mjs} +3 -3
- package/dist/client/{useEventFilters-Bphkda8m.mjs → useEventFilters-DeeyGYuk.mjs} +3 -3
- package/dist/preview-next/before-render.mjs +7 -0
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +7 -0
- package/dist/preview-next/middleware.mjs +7 -0
- package/dist/{previewAuthStore-C7ksxt5b.mjs → previewAuthStore-DbqBol0V.mjs} +7 -0
- package/dist/{sdk-runtime-BbIC8G4J.mjs → sdk-runtime-19MO27F0.mjs} +2 -2
- package/dist/{separator-CadhAtI7.mjs → separator-DaPLtJ1f.mjs} +1 -1
- package/dist/server/components.mjs +1527 -893
- package/dist/server/config-validation.mjs +65 -113
- package/dist/server/config.mjs +65 -113
- package/dist/server/data.mjs +65 -112
- package/dist/server/index.mjs +122 -4
- package/dist/server/manifest.mjs +0 -1
- package/dist/server/next.mjs +1432 -708
- package/dist/server/page-converter.mjs +58 -91
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1682 -915
- package/dist/server/rendering.mjs +1694 -1020
- package/dist/server/routing.mjs +3230 -1843
- package/dist/server/server.mjs +21710 -19779
- package/dist/server/theme-bridge.mjs +656 -264
- package/dist/server/theme.mjs +2 -17
- package/dist/styles/index.css +609 -181
- package/package.json +1 -1
|
@@ -183,6 +183,10 @@ const EVENTS = {
|
|
|
183
183
|
registrationStatus: {
|
|
184
184
|
path: "/public/sites/{siteId}/events/registration-status",
|
|
185
185
|
method: "GET"
|
|
186
|
+
},
|
|
187
|
+
checkoutReturn: {
|
|
188
|
+
path: "/public/sites/{siteId}/events/checkout-return",
|
|
189
|
+
method: "POST"
|
|
186
190
|
}
|
|
187
191
|
};
|
|
188
192
|
const WHOLE_SERIES = {
|
|
@@ -779,6 +783,14 @@ function createBlockApi(config) {
|
|
|
779
783
|
skipDedup: true
|
|
780
784
|
});
|
|
781
785
|
},
|
|
786
|
+
async resolveEventCheckoutReturn(data) {
|
|
787
|
+
const sid = requireSiteId();
|
|
788
|
+
const path = buildPath(EVENTS.checkoutReturn.path, { siteId: sid });
|
|
789
|
+
return request(EVENTS.checkoutReturn, {
|
|
790
|
+
path,
|
|
791
|
+
body: data
|
|
792
|
+
});
|
|
793
|
+
},
|
|
782
794
|
async resolveWaitlistClaim(data) {
|
|
783
795
|
const sid = requireSiteId();
|
|
784
796
|
const path = buildPath(WHOLE_SERIES.waitlistClaimResolve.path, { siteId: sid });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { D as clsx } from "./colorStyles-CrxJrPjJ.mjs";
|
|
3
|
-
import { $ as getLocalMinuteOfDay, E as buildEventCalendarListingRender, H as formatEventTeacherLine, J as resolveEventLinkProps, K as groupEventsByDate, M as buildEventRuntimeFilters, N as getEventRuntimeFiltersKey, Q as getLocalDateKey, U as formatTime, X as getEventAvailability, Z as getEventAvailabilityStatus, st as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
4
|
-
import { o as EventFilters, t as useEventFilters } from "./useEventFilters-
|
|
5
|
-
import { a as CalendarDayCell, c as useCalendarEvents, d as
|
|
6
|
-
import { t as BlockApiProvider } from "./context-
|
|
3
|
+
import { $ as getLocalMinuteOfDay, E as buildEventCalendarListingRender, H as formatEventTeacherLine, J as resolveEventLinkProps, K as groupEventsByDate, M as buildEventRuntimeFilters, N as getEventRuntimeFiltersKey, Q as getLocalDateKey, U as formatTime, X as getEventAvailability, Z as getEventAvailabilityStatus, st as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-pzBeCh14.mjs";
|
|
4
|
+
import { o as EventFilters, t as useEventFilters } from "./useEventFilters-DeeyGYuk.mjs";
|
|
5
|
+
import { a as CalendarDayCell, c as useCalendarEvents, d as formatDateKey, f as getDayOfWeek, g as isToday, h as isSameCalendarDay, i as WeekAgendaView, l as MONTH_NAMES, m as getWeekCalendarDays, o as EventModalProvider, p as getOrderedDayNames, r as EventModals, s as useEventModal, t as EventCombinedClient, u as addDays } from "./EventCombined.client-BWVNlXTx.mjs";
|
|
6
|
+
import { t as BlockApiProvider } from "./context-BImarOAq.mjs";
|
|
7
7
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
8
8
|
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
|
|
9
|
-
import { n as EventListingController } from "./EventListing.client-
|
|
9
|
+
import { n as EventListingController } from "./EventListing.client-DVFCDe3i.mjs";
|
|
10
10
|
import { useEffect, useId, useMemo, useState } from "react";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
//#region ../calendar/src/lane-packing.ts
|
|
@@ -80,13 +80,12 @@ function buildTimetableModel$1(input) {
|
|
|
80
80
|
const bounds = resolveBounds(input.bounds);
|
|
81
81
|
const viewportDays = getTimetableDays(input.viewDate, input.view ?? "week", input.startOfWeek);
|
|
82
82
|
const viewportKeys = new Set(viewportDays.map(formatDateKey));
|
|
83
|
-
const now = input.now ?? /* @__PURE__ */ new Date();
|
|
84
83
|
const parsed = parseAllItems(input.items, input);
|
|
85
84
|
const inViewport = deriveVisibleSegments(parsed.drafts, viewportKeys);
|
|
86
85
|
const hourRange = resolveHourRange(inViewport, bounds);
|
|
87
86
|
const laid = layoutCellsByDate(inViewport, hourRange, bounds);
|
|
88
87
|
return {
|
|
89
|
-
days: assembleDays(viewportDays, laid.cellsByDate,
|
|
88
|
+
days: assembleDays(viewportDays, laid.cellsByDate, input.today),
|
|
90
89
|
hourTicks: buildHourTicks(hourRange.startHour, hourRange.endHour),
|
|
91
90
|
startHour: hourRange.startHour,
|
|
92
91
|
endHour: hourRange.endHour,
|
|
@@ -143,13 +142,13 @@ function layoutCellsByDate(segments, hourRange, bounds) {
|
|
|
143
142
|
diagnostics
|
|
144
143
|
};
|
|
145
144
|
}
|
|
146
|
-
function assembleDays(viewportDays, cellsByDate,
|
|
145
|
+
function assembleDays(viewportDays, cellsByDate, today) {
|
|
147
146
|
return viewportDays.map((date) => {
|
|
148
147
|
const dateKey = formatDateKey(date);
|
|
149
148
|
return {
|
|
150
149
|
date,
|
|
151
150
|
dateKey,
|
|
152
|
-
isToday:
|
|
151
|
+
isToday: isSameCalendarDay(date, today),
|
|
153
152
|
cells: cellsByDate.get(dateKey) ?? []
|
|
154
153
|
};
|
|
155
154
|
});
|
|
@@ -301,13 +300,12 @@ function getTimetableDays(viewDate, view, startOfWeek) {
|
|
|
301
300
|
function enumerateDateKeys(startDateKey, endDateKey) {
|
|
302
301
|
if (startDateKey > endDateKey) throw new Error(`Invalid timetable date range: ${startDateKey} is after ${endDateKey}`);
|
|
303
302
|
const start = parseDateKey(startDateKey);
|
|
304
|
-
|
|
303
|
+
parseDateKey(endDateKey);
|
|
305
304
|
const keys = [];
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
while (cursor.getTime() <= endDate.getTime()) {
|
|
305
|
+
let cursor = start;
|
|
306
|
+
while (formatDateKey(cursor) <= endDateKey) {
|
|
309
307
|
keys.push(formatDateKey(cursor));
|
|
310
|
-
cursor
|
|
308
|
+
cursor = addDays(cursor, 1);
|
|
311
309
|
}
|
|
312
310
|
return keys;
|
|
313
311
|
}
|
|
@@ -322,11 +320,36 @@ function parseDateKey(dateKey) {
|
|
|
322
320
|
};
|
|
323
321
|
}
|
|
324
322
|
//#endregion
|
|
323
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.tsx
|
|
324
|
+
function CalendarNavigationChevron({ direction }) {
|
|
325
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
326
|
+
width: "20",
|
|
327
|
+
height: "20",
|
|
328
|
+
fill: "none",
|
|
329
|
+
stroke: "currentColor",
|
|
330
|
+
strokeWidth: 2,
|
|
331
|
+
viewBox: "0 0 24 24",
|
|
332
|
+
"aria-hidden": "true",
|
|
333
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
334
|
+
strokeLinecap: "round",
|
|
335
|
+
strokeLinejoin: "round",
|
|
336
|
+
d: direction === "previous" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7"
|
|
337
|
+
})
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
//#endregion
|
|
325
341
|
//#region ../blocks/src/system/runtime/nodes/events/shared/WeekBoardView.tsx
|
|
326
|
-
function
|
|
342
|
+
function buildWeekBoardNavigationState(viewport, today) {
|
|
343
|
+
return {
|
|
344
|
+
rangeLabel: viewport.title,
|
|
345
|
+
isCurrentWeek: viewport.days.some((day) => isToday(day, today))
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
function buildWeekBoardViewProps(display, days, navigation, events = display.events) {
|
|
327
349
|
return {
|
|
328
350
|
days,
|
|
329
|
-
events: [...
|
|
351
|
+
events: [...events],
|
|
352
|
+
navigation,
|
|
330
353
|
showCapacity: display.showCapacity,
|
|
331
354
|
emptyMessage: display.emptyMessage,
|
|
332
355
|
title: display.boardTitle,
|
|
@@ -335,7 +358,9 @@ function buildWeekBoardViewProps(display, days) {
|
|
|
335
358
|
ctaHref: display.seeAllUrl,
|
|
336
359
|
buttonVariant: display.buttonVariant,
|
|
337
360
|
elevated: display.elevated,
|
|
338
|
-
banded: display.banded
|
|
361
|
+
banded: display.banded,
|
|
362
|
+
calendarTimeZone: display.calendarTimeZone,
|
|
363
|
+
today: display.today
|
|
339
364
|
};
|
|
340
365
|
}
|
|
341
366
|
const SHORT_DAY_NAMES = [
|
|
@@ -399,6 +424,114 @@ const WeekBoardCard = ({ event, showCapacity }) => {
|
|
|
399
424
|
]
|
|
400
425
|
});
|
|
401
426
|
};
|
|
427
|
+
const WeekBoardNavigationControls = ({ navigation, todayClassName }) => {
|
|
428
|
+
const handlers = navigation.kind === "interactive" ? navigation : {
|
|
429
|
+
onPrevious: void 0,
|
|
430
|
+
onNext: void 0,
|
|
431
|
+
onToday: void 0
|
|
432
|
+
};
|
|
433
|
+
const isLoading = navigation.kind === "interactive" && navigation.loadState.kind === "loading";
|
|
434
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
435
|
+
className: "event-week-board-navigation",
|
|
436
|
+
"aria-label": "Choose week",
|
|
437
|
+
children: [
|
|
438
|
+
/* @__PURE__ */ jsx("button", {
|
|
439
|
+
type: "button",
|
|
440
|
+
className: "event-week-board-nav-button",
|
|
441
|
+
"aria-label": "Previous week",
|
|
442
|
+
onClick: handlers.onPrevious,
|
|
443
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "previous" })
|
|
444
|
+
}),
|
|
445
|
+
/* @__PURE__ */ jsxs("h3", {
|
|
446
|
+
className: "event-week-board-range",
|
|
447
|
+
"aria-live": "polite",
|
|
448
|
+
children: [navigation.rangeLabel, isLoading ? /* @__PURE__ */ jsx("span", {
|
|
449
|
+
className: "event-week-board-loading",
|
|
450
|
+
children: " Loading…"
|
|
451
|
+
}) : null]
|
|
452
|
+
}),
|
|
453
|
+
/* @__PURE__ */ jsx("button", {
|
|
454
|
+
type: "button",
|
|
455
|
+
className: "event-week-board-nav-button",
|
|
456
|
+
"aria-label": "Next week",
|
|
457
|
+
onClick: handlers.onNext,
|
|
458
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "next" })
|
|
459
|
+
}),
|
|
460
|
+
/* @__PURE__ */ jsx("button", {
|
|
461
|
+
type: "button",
|
|
462
|
+
className: todayClassName,
|
|
463
|
+
disabled: navigation.isCurrentWeek,
|
|
464
|
+
onClick: handlers.onToday,
|
|
465
|
+
children: "Today"
|
|
466
|
+
})
|
|
467
|
+
]
|
|
468
|
+
});
|
|
469
|
+
};
|
|
470
|
+
const WeekBoardLegend = () => /* @__PURE__ */ jsx("div", {
|
|
471
|
+
className: "event-week-board-legend",
|
|
472
|
+
"aria-hidden": "true",
|
|
473
|
+
children: LEGEND_ITEMS.map((item) => /* @__PURE__ */ jsxs("span", {
|
|
474
|
+
className: "event-week-board-legend-item",
|
|
475
|
+
children: [/* @__PURE__ */ jsx("i", {
|
|
476
|
+
className: "event-week-board-legend-dot",
|
|
477
|
+
"data-status": item.status
|
|
478
|
+
}), item.label]
|
|
479
|
+
}, item.status))
|
|
480
|
+
});
|
|
481
|
+
const WeekBoardLoadError = ({ navigation, buttonClassName }) => {
|
|
482
|
+
if (navigation.kind !== "interactive" || navigation.loadState.kind !== "error") return null;
|
|
483
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
484
|
+
className: "event-week-board-error",
|
|
485
|
+
role: "status",
|
|
486
|
+
children: [/* @__PURE__ */ jsx("p", { children: "Failed to load events" }), /* @__PURE__ */ jsx("button", {
|
|
487
|
+
type: "button",
|
|
488
|
+
className: buttonClassName,
|
|
489
|
+
onClick: navigation.loadState.onRetry,
|
|
490
|
+
children: "Try again"
|
|
491
|
+
})]
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
const WeekBoardGrid = ({ days, eventsByDate, showCapacity, today: currentDate }) => /* @__PURE__ */ jsx("div", {
|
|
495
|
+
className: "event-week-board-grid",
|
|
496
|
+
children: days.map((date) => {
|
|
497
|
+
const dateKey = formatDateKey(date);
|
|
498
|
+
const dayEvents = eventsByDate.get(dateKey) ?? [];
|
|
499
|
+
const today = isToday(date, currentDate);
|
|
500
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
501
|
+
className: clsx("event-week-board-day", dayEvents.length === 0 && "event-week-board-day--empty", today && "event-week-board-day--today"),
|
|
502
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
503
|
+
className: "event-week-board-day-head",
|
|
504
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
505
|
+
className: "event-week-board-day-abbr",
|
|
506
|
+
children: SHORT_DAY_NAMES[getDayOfWeek(date)]
|
|
507
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
508
|
+
className: "event-week-board-day-num",
|
|
509
|
+
children: date.day
|
|
510
|
+
})]
|
|
511
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
512
|
+
className: "event-week-board-day-body",
|
|
513
|
+
children: dayEvents.map((event) => /* @__PURE__ */ jsx(WeekBoardCard, {
|
|
514
|
+
event,
|
|
515
|
+
showCapacity
|
|
516
|
+
}, event.occurrenceId || event.id))
|
|
517
|
+
})]
|
|
518
|
+
}, dateKey);
|
|
519
|
+
})
|
|
520
|
+
});
|
|
521
|
+
const WeekBoardFooter = ({ note, ctaHref, ctaLabel, ctaClassName }) => {
|
|
522
|
+
if (note === null && ctaHref === null) return null;
|
|
523
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
524
|
+
className: "event-week-board-foot",
|
|
525
|
+
children: [note === null ? null : /* @__PURE__ */ jsx("p", {
|
|
526
|
+
className: "event-week-board-foot-note",
|
|
527
|
+
children: note
|
|
528
|
+
}), ctaHref === null ? null : /* @__PURE__ */ jsx("a", {
|
|
529
|
+
className: ctaClassName,
|
|
530
|
+
href: ctaHref,
|
|
531
|
+
children: ctaLabel
|
|
532
|
+
})]
|
|
533
|
+
});
|
|
534
|
+
};
|
|
402
535
|
/**
|
|
403
536
|
* WeekBoardView
|
|
404
537
|
*
|
|
@@ -407,18 +540,21 @@ const WeekBoardCard = ({ event, showCapacity }) => {
|
|
|
407
540
|
* to a stacked list on mobile. Repurposes the week-grouped agenda data as a
|
|
408
541
|
* board rather than an hour-positioned timetable grid.
|
|
409
542
|
*/
|
|
410
|
-
const WeekBoardView = ({ days, events, showCapacity, emptyMessage = "No classes scheduled this week", title, footerNote, ctaLabel = "Reserve a place", ctaHref = null, buttonVariant = "outline", elevated = false, banded = false }) => {
|
|
411
|
-
const eventsByDate = groupEventsByDate(events);
|
|
543
|
+
const WeekBoardView = ({ days, events, navigation, showCapacity, emptyMessage = "No classes scheduled this week", title, footerNote, ctaLabel = "Reserve a place", ctaHref = null, buttonVariant = "outline", elevated = false, banded = false, calendarTimeZone, today }) => {
|
|
544
|
+
const eventsByDate = groupEventsByDate(events, calendarTimeZone);
|
|
412
545
|
const hasAnyEvents = days.some((date) => (eventsByDate.get(formatDateKey(date)) ?? []).length > 0);
|
|
413
546
|
const ctaClassName = themeButtonClassName({
|
|
414
547
|
variant: buttonVariant,
|
|
415
548
|
size: "sm"
|
|
416
549
|
});
|
|
550
|
+
const todayClassName = themeButtonClassName({
|
|
551
|
+
variant: buttonVariant,
|
|
552
|
+
size: "sm"
|
|
553
|
+
});
|
|
417
554
|
const hasTitle = typeof title === "string" && title.length > 0;
|
|
418
555
|
const hasFooterNote = typeof footerNote === "string" && footerNote.length > 0;
|
|
419
|
-
const hasCta = typeof ctaHref === "string" && ctaHref.length > 0;
|
|
420
556
|
const footerNoteText = hasAnyEvents ? hasFooterNote ? footerNote : null : emptyMessage;
|
|
421
|
-
const
|
|
557
|
+
const resolvedCtaHref = typeof ctaHref === "string" && ctaHref.length > 0 ? ctaHref : null;
|
|
422
558
|
return /* @__PURE__ */ jsx("div", {
|
|
423
559
|
className: "event-calendar event-calendar--week-board",
|
|
424
560
|
"data-block": "event-calendar",
|
|
@@ -430,59 +566,34 @@ const WeekBoardView = ({ days, events, showCapacity, emptyMessage = "No classes
|
|
|
430
566
|
children: [
|
|
431
567
|
/* @__PURE__ */ jsxs("div", {
|
|
432
568
|
className: "event-week-board-top",
|
|
433
|
-
children: [
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}), item.label]
|
|
445
|
-
}, item.status))
|
|
446
|
-
})]
|
|
569
|
+
children: [
|
|
570
|
+
hasTitle ? /* @__PURE__ */ jsx("span", {
|
|
571
|
+
className: "event-week-board-title",
|
|
572
|
+
children: title
|
|
573
|
+
}) : null,
|
|
574
|
+
/* @__PURE__ */ jsx(WeekBoardNavigationControls, {
|
|
575
|
+
navigation,
|
|
576
|
+
todayClassName
|
|
577
|
+
}),
|
|
578
|
+
/* @__PURE__ */ jsx(WeekBoardLegend, {})
|
|
579
|
+
]
|
|
447
580
|
}),
|
|
448
|
-
/* @__PURE__ */ jsx(
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
className: "event-week-board-day-head",
|
|
458
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
459
|
-
className: "event-week-board-day-abbr",
|
|
460
|
-
children: SHORT_DAY_NAMES[date.getDay()]
|
|
461
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
462
|
-
className: "event-week-board-day-num",
|
|
463
|
-
children: date.getDate()
|
|
464
|
-
})]
|
|
465
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
466
|
-
className: "event-week-board-day-body",
|
|
467
|
-
children: dayEvents.map((event) => /* @__PURE__ */ jsx(WeekBoardCard, {
|
|
468
|
-
event,
|
|
469
|
-
showCapacity
|
|
470
|
-
}, event.occurrenceId || event.id))
|
|
471
|
-
})]
|
|
472
|
-
}, dateKey);
|
|
473
|
-
})
|
|
581
|
+
/* @__PURE__ */ jsx(WeekBoardLoadError, {
|
|
582
|
+
navigation,
|
|
583
|
+
buttonClassName: todayClassName
|
|
584
|
+
}),
|
|
585
|
+
/* @__PURE__ */ jsx(WeekBoardGrid, {
|
|
586
|
+
days,
|
|
587
|
+
eventsByDate,
|
|
588
|
+
showCapacity,
|
|
589
|
+
today
|
|
474
590
|
}),
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
className: ctaClassName,
|
|
482
|
-
href: ctaHref ?? void 0,
|
|
483
|
-
children: ctaLabel
|
|
484
|
-
}) : null]
|
|
485
|
-
}) : null
|
|
591
|
+
/* @__PURE__ */ jsx(WeekBoardFooter, {
|
|
592
|
+
note: footerNoteText,
|
|
593
|
+
ctaHref: resolvedCtaHref,
|
|
594
|
+
ctaLabel,
|
|
595
|
+
ctaClassName
|
|
596
|
+
})
|
|
486
597
|
]
|
|
487
598
|
})
|
|
488
599
|
});
|
|
@@ -513,6 +624,7 @@ function buildTimetableModel(input) {
|
|
|
513
624
|
items: input.events,
|
|
514
625
|
viewDate: input.viewDate,
|
|
515
626
|
startOfWeek: input.startOfWeek,
|
|
627
|
+
today: input.today,
|
|
516
628
|
getId: (event) => event.id,
|
|
517
629
|
getStartsAt: (event) => event.startsAt,
|
|
518
630
|
getEndsAt: (event) => event.endsAt,
|
|
@@ -574,22 +686,24 @@ function formatEventTimeRange(event) {
|
|
|
574
686
|
return `${formatTime(event.startsAt, { timeZone })} - ${formatTime(event.endsAt, { timeZone })}`;
|
|
575
687
|
}
|
|
576
688
|
function formatDayLabel(date) {
|
|
577
|
-
return `${FULL_DAY_NAMES[date
|
|
689
|
+
return `${FULL_DAY_NAMES[getDayOfWeek(date)] ?? ""}, ${MONTH_NAMES[date.month - 1] ?? ""} ${date.day}`;
|
|
578
690
|
}
|
|
579
691
|
function formatShortDayLabel(date) {
|
|
580
|
-
return `${(FULL_DAY_NAMES[date
|
|
692
|
+
return `${(FULL_DAY_NAMES[getDayOfWeek(date)] ?? "").slice(0, 3)} ${date.day}`;
|
|
581
693
|
}
|
|
582
694
|
//#endregion
|
|
583
695
|
//#region ../blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.tsx
|
|
584
|
-
const WeekTimetableView = ({ viewDate, events, startOfWeek, showCapacity, emptyMessage = "No classes scheduled" }) => {
|
|
696
|
+
const WeekTimetableView = ({ viewDate, events, startOfWeek, today, showCapacity, emptyMessage = "No classes scheduled" }) => {
|
|
585
697
|
const { openEventModal } = useEventModal();
|
|
586
698
|
const model = useMemo(() => buildTimetableModel({
|
|
587
699
|
events,
|
|
588
700
|
viewDate,
|
|
589
|
-
startOfWeek
|
|
701
|
+
startOfWeek,
|
|
702
|
+
today
|
|
590
703
|
}), [
|
|
591
704
|
events,
|
|
592
705
|
startOfWeek,
|
|
706
|
+
today,
|
|
593
707
|
viewDate
|
|
594
708
|
]);
|
|
595
709
|
const [selectedDayKey, setSelectedDayKey] = useState(() => model.days.find((day) => day.isToday)?.dateKey ?? model.days[0]?.dateKey ?? "");
|
|
@@ -748,37 +862,75 @@ const EventCalendarClient = ({ render }) => {
|
|
|
748
862
|
buttonVariant: display.buttonVariant,
|
|
749
863
|
buttonText: display.buttonText,
|
|
750
864
|
emptyMessage: display.emptyMessage,
|
|
751
|
-
className: display.className ?? void 0
|
|
865
|
+
className: display.className ?? void 0,
|
|
866
|
+
calendarContext: hydration.calendarContext
|
|
752
867
|
});
|
|
753
868
|
if (display.displayMode === "list") return /* @__PURE__ */ jsx(EventListingController, { render: buildEventCalendarListingRender(render) });
|
|
754
869
|
if (display.displayMode === "timetable") return /* @__PURE__ */ jsx(EventCalendarTimetableClient, { render });
|
|
755
|
-
if (display.displayMode === "week-board") return /* @__PURE__ */ jsx(EventCalendarWeekBoardClient, {
|
|
870
|
+
if (display.displayMode === "week-board") return /* @__PURE__ */ jsx(EventCalendarWeekBoardClient, { render });
|
|
756
871
|
return /* @__PURE__ */ jsx(EventCalendarGridClient, { render });
|
|
757
872
|
};
|
|
758
|
-
const EventCalendarWeekBoardClient = ({
|
|
759
|
-
|
|
873
|
+
const EventCalendarWeekBoardClient = ({ render }) => {
|
|
874
|
+
const { display, hydration } = render;
|
|
875
|
+
const filters = useMemo(() => buildDisplayFilterParams(display), [
|
|
876
|
+
display.eventSurface,
|
|
877
|
+
display.filterCategoryIds,
|
|
878
|
+
display.filterEventPresets,
|
|
879
|
+
display.filterStaffMemberId,
|
|
880
|
+
display.filterVenueId,
|
|
881
|
+
display.scheduleScope
|
|
882
|
+
]);
|
|
883
|
+
const initialEvents = usePrefetchedCalendarEvents(display, filters);
|
|
884
|
+
const { events, viewport, loadState, goToPrevious, goToNext, goToToday, retryCurrentView } = useCalendarEvents({
|
|
885
|
+
siteId: hydration.siteId,
|
|
886
|
+
initialEvents,
|
|
887
|
+
view: "week",
|
|
888
|
+
startOfWeek: display.startOfWeek,
|
|
889
|
+
preloadMonths: 1,
|
|
890
|
+
filters,
|
|
891
|
+
stage: hydration.stage,
|
|
892
|
+
calendarContext: hydration.calendarContext
|
|
893
|
+
});
|
|
894
|
+
const weekBoardLoadState = loadState.kind === "error" ? {
|
|
895
|
+
kind: "error",
|
|
896
|
+
onRetry: retryCurrentView
|
|
897
|
+
} : loadState;
|
|
898
|
+
const navigation = {
|
|
899
|
+
kind: "interactive",
|
|
900
|
+
...buildWeekBoardNavigationState(viewport, hydration.calendarContext.initialToday),
|
|
901
|
+
loadState: weekBoardLoadState,
|
|
902
|
+
onPrevious: goToPrevious,
|
|
903
|
+
onNext: goToNext,
|
|
904
|
+
onToday: goToToday
|
|
905
|
+
};
|
|
906
|
+
return /* @__PURE__ */ jsx(WeekBoardView, { ...buildWeekBoardViewProps({
|
|
907
|
+
...display,
|
|
908
|
+
calendarTimeZone: hydration.calendarContext.timeZone,
|
|
909
|
+
today: hydration.calendarContext.initialToday
|
|
910
|
+
}, viewport.days, navigation, events) });
|
|
760
911
|
};
|
|
761
912
|
const EventCalendarTimetableClient = ({ render }) => {
|
|
762
913
|
const { display, hydration } = render;
|
|
763
914
|
const { filtersNode, listFilters } = useEventCalendarFilterState(display);
|
|
764
915
|
const calendarInitialEvents = usePrefetchedCalendarEvents(display, listFilters);
|
|
765
|
-
const { events, viewDate, viewport,
|
|
916
|
+
const { events, viewDate, viewport, loadState, retryCurrentView, goToPrevious, goToNext, goToToday } = useCalendarEvents({
|
|
766
917
|
siteId: hydration.siteId,
|
|
767
918
|
initialEvents: calendarInitialEvents,
|
|
768
919
|
view: "week",
|
|
769
920
|
startOfWeek: display.startOfWeek,
|
|
770
921
|
preloadMonths: 1,
|
|
771
922
|
filters: listFilters,
|
|
772
|
-
stage: hydration.stage
|
|
923
|
+
stage: hydration.stage,
|
|
924
|
+
calendarContext: hydration.calendarContext
|
|
773
925
|
});
|
|
774
926
|
return /* @__PURE__ */ jsxs(EventModalProvider, { children: [/* @__PURE__ */ jsx(EventCalendarChrome, {
|
|
775
927
|
display,
|
|
776
928
|
calendarView: "week",
|
|
777
929
|
className: "event-calendar--timetable",
|
|
778
|
-
|
|
930
|
+
loadState,
|
|
779
931
|
filters: filtersNode,
|
|
780
932
|
headerTitle: viewport.title,
|
|
781
|
-
|
|
933
|
+
onRetry: retryCurrentView,
|
|
782
934
|
onNext: goToNext,
|
|
783
935
|
onPrevious: goToPrevious,
|
|
784
936
|
onToday: goToToday,
|
|
@@ -787,7 +939,8 @@ const EventCalendarTimetableClient = ({ render }) => {
|
|
|
787
939
|
events,
|
|
788
940
|
startOfWeek: display.startOfWeek,
|
|
789
941
|
emptyMessage: display.emptyMessage,
|
|
790
|
-
showCapacity: display.showCapacity
|
|
942
|
+
showCapacity: display.showCapacity,
|
|
943
|
+
today: hydration.calendarContext.initialToday
|
|
791
944
|
})
|
|
792
945
|
}), /* @__PURE__ */ jsx(EventModals, {
|
|
793
946
|
cardRole: display.cardRole,
|
|
@@ -801,24 +954,25 @@ const EventCalendarGridClient = ({ render }) => {
|
|
|
801
954
|
const calendarView = display.defaultCalendarView;
|
|
802
955
|
const { filtersNode, listFilters } = useEventCalendarFilterState(display);
|
|
803
956
|
const calendarInitialEvents = usePrefetchedCalendarEvents(display, listFilters);
|
|
804
|
-
const { events, viewDate, viewport,
|
|
957
|
+
const { events, viewDate, viewport, loadState, retryCurrentView, goToPrevious, goToNext, goToToday } = useCalendarEvents({
|
|
805
958
|
siteId: hydration.siteId,
|
|
806
959
|
initialEvents: calendarInitialEvents,
|
|
807
960
|
view: calendarView,
|
|
808
961
|
startOfWeek: display.startOfWeek,
|
|
809
962
|
preloadMonths: 1,
|
|
810
963
|
filters: listFilters,
|
|
811
|
-
stage: hydration.stage
|
|
964
|
+
stage: hydration.stage,
|
|
965
|
+
calendarContext: hydration.calendarContext
|
|
812
966
|
});
|
|
813
|
-
const eventsByDate = useMemo(() => groupEventsByDate(events), [events]);
|
|
967
|
+
const eventsByDate = useMemo(() => groupEventsByDate(events, hydration.calendarContext.timeZone), [events, hydration.calendarContext.timeZone]);
|
|
814
968
|
const dayNames = useMemo(() => getOrderedDayNames(display.startOfWeek), [display.startOfWeek]);
|
|
815
969
|
return /* @__PURE__ */ jsxs(EventModalProvider, { children: [/* @__PURE__ */ jsxs(EventCalendarChrome, {
|
|
816
970
|
display,
|
|
817
971
|
calendarView,
|
|
818
|
-
|
|
972
|
+
loadState,
|
|
819
973
|
filters: filtersNode,
|
|
820
974
|
headerTitle: viewport.title,
|
|
821
|
-
|
|
975
|
+
onRetry: retryCurrentView,
|
|
822
976
|
onNext: goToNext,
|
|
823
977
|
onPrevious: goToPrevious,
|
|
824
978
|
onToday: goToToday,
|
|
@@ -826,7 +980,9 @@ const EventCalendarGridClient = ({ render }) => {
|
|
|
826
980
|
days: viewport.days,
|
|
827
981
|
events,
|
|
828
982
|
emptyMessage: display.emptyMessage,
|
|
829
|
-
showCapacity: display.showCapacity
|
|
983
|
+
showCapacity: display.showCapacity,
|
|
984
|
+
calendarTimeZone: hydration.calendarContext.timeZone,
|
|
985
|
+
today: hydration.calendarContext.initialToday
|
|
830
986
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
831
987
|
className: "event-calendar-container",
|
|
832
988
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -842,11 +998,12 @@ const EventCalendarGridClient = ({ render }) => {
|
|
|
842
998
|
return /* @__PURE__ */ jsx(CalendarDayCell, {
|
|
843
999
|
date,
|
|
844
1000
|
events: eventsByDate.get(dateKey) || [],
|
|
845
|
-
isCurrentMonth: date.
|
|
1001
|
+
isCurrentMonth: date.month === viewDate.month,
|
|
1002
|
+
today: hydration.calendarContext.initialToday
|
|
846
1003
|
}, dateKey);
|
|
847
1004
|
})
|
|
848
1005
|
})]
|
|
849
|
-
}), viewport.kind === "month" && events.length === 0 &&
|
|
1006
|
+
}), viewport.kind === "month" && events.length === 0 && loadState.kind === "idle" ? /* @__PURE__ */ jsx("p", {
|
|
850
1007
|
className: "event-calendar-empty",
|
|
851
1008
|
children: display.emptyMessage
|
|
852
1009
|
}) : null]
|
|
@@ -918,7 +1075,7 @@ function buildDisplayFilterParams(display) {
|
|
|
918
1075
|
filterVenueId: display.filterVenueId
|
|
919
1076
|
});
|
|
920
1077
|
}
|
|
921
|
-
const EventCalendarChrome = ({ children, display, calendarView, className,
|
|
1078
|
+
const EventCalendarChrome = ({ children, display, calendarView, className, loadState, filters, headerTitle, onRetry, onNext, onPrevious, onToday }) => /* @__PURE__ */ jsxs("div", {
|
|
922
1079
|
className: [
|
|
923
1080
|
"event-calendar",
|
|
924
1081
|
className,
|
|
@@ -937,11 +1094,11 @@ const EventCalendarChrome = ({ children, display, calendarView, className, error
|
|
|
937
1094
|
onClick: onPrevious,
|
|
938
1095
|
className: "event-calendar-nav-btn",
|
|
939
1096
|
"aria-label": calendarView === "week" ? "Previous week" : "Previous month",
|
|
940
|
-
children: /* @__PURE__ */ jsx(
|
|
1097
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "previous" })
|
|
941
1098
|
}),
|
|
942
1099
|
/* @__PURE__ */ jsxs("h3", {
|
|
943
1100
|
className: "event-calendar-title",
|
|
944
|
-
children: [headerTitle, loading ? /* @__PURE__ */ jsx("span", {
|
|
1101
|
+
children: [headerTitle, loadState.kind === "loading" ? /* @__PURE__ */ jsx("span", {
|
|
945
1102
|
className: "rb-ml-2 rb-caption status-muted",
|
|
946
1103
|
children: "(loading...)"
|
|
947
1104
|
}) : null]
|
|
@@ -951,7 +1108,7 @@ const EventCalendarChrome = ({ children, display, calendarView, className, error
|
|
|
951
1108
|
onClick: onNext,
|
|
952
1109
|
className: "event-calendar-nav-btn",
|
|
953
1110
|
"aria-label": calendarView === "week" ? "Next week" : "Next month",
|
|
954
|
-
children: /* @__PURE__ */ jsx(
|
|
1111
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "next" })
|
|
955
1112
|
})
|
|
956
1113
|
]
|
|
957
1114
|
}), /* @__PURE__ */ jsx("button", {
|
|
@@ -965,14 +1122,14 @@ const EventCalendarChrome = ({ children, display, calendarView, className, error
|
|
|
965
1122
|
})]
|
|
966
1123
|
}),
|
|
967
1124
|
children,
|
|
968
|
-
error ? /* @__PURE__ */ jsxs("div", {
|
|
1125
|
+
loadState.kind === "error" ? /* @__PURE__ */ jsxs("div", {
|
|
969
1126
|
className: "rb-mt-4 rb-text-center",
|
|
970
1127
|
children: [/* @__PURE__ */ jsx("p", {
|
|
971
1128
|
className: "status-error rb-caption rb-mb-2",
|
|
972
1129
|
children: "Failed to load events"
|
|
973
1130
|
}), /* @__PURE__ */ jsx("button", {
|
|
974
1131
|
type: "button",
|
|
975
|
-
onClick:
|
|
1132
|
+
onClick: onRetry,
|
|
976
1133
|
className: themeButtonClassName({
|
|
977
1134
|
variant: display.buttonVariant,
|
|
978
1135
|
size: "sm"
|
|
@@ -982,21 +1139,6 @@ const EventCalendarChrome = ({ children, display, calendarView, className, error
|
|
|
982
1139
|
}) : null
|
|
983
1140
|
]
|
|
984
1141
|
});
|
|
985
|
-
function CalendarChevron({ direction }) {
|
|
986
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
987
|
-
width: "20",
|
|
988
|
-
height: "20",
|
|
989
|
-
fill: "none",
|
|
990
|
-
stroke: "currentColor",
|
|
991
|
-
strokeWidth: 2,
|
|
992
|
-
viewBox: "0 0 24 24",
|
|
993
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
994
|
-
strokeLinecap: "round",
|
|
995
|
-
strokeLinejoin: "round",
|
|
996
|
-
d: direction === "previous" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7"
|
|
997
|
-
})
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
1142
|
//#endregion
|
|
1001
1143
|
//#region src/rendering/islands/enhancers/eventCalendar.tsx
|
|
1002
1144
|
const decode = defineIslandPropsDecoder("event-calendar");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
-
import { n as EventCombinedIslandClient } from "./EventCombined.client-
|
|
3
|
-
import { t as BlockApiProvider } from "./context-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-pzBeCh14.mjs";
|
|
2
|
+
import { n as EventCombinedIslandClient } from "./EventCombined.client-BWVNlXTx.mjs";
|
|
3
|
+
import { t as BlockApiProvider } from "./context-BImarOAq.mjs";
|
|
4
4
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
5
5
|
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
|
|
6
6
|
import "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as formatEventPrice, J as resolveEventLinkProps, Jt as toBookingTimeZone, O as resolveEventRegistrationScopedEvents, Qt as publicEventPricingType, Wt as getBookingLocalDateKey, Xt as publicEventPricingCurrency, Y as resolveRuntimeEventPricing, Yt as toScheduledBookingDateTime, et as formatWholeSeriesPriceAmount, nt as resolveWholeSeriesPricingState, t as defineIslandPropsDecoder, tn as formatCurrencyAmount, tt as formatWholeSeriesPriceDisplay, z as formatEventDateParts } from "./propsDecoder-pzBeCh14.mjs";
|
|
2
2
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
3
|
-
import { t as LeafletStaticMap } from "./LeafletStaticMap-
|
|
3
|
+
import { t as LeafletStaticMap } from "./LeafletStaticMap-BY5mIHw9.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region ../blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.ts
|
|
@@ -130,7 +130,8 @@ function isOrdinaryEvent(event) {
|
|
|
130
130
|
function deriveWholeSeriesPhase(sessions, nowIso) {
|
|
131
131
|
const now = Date.parse(nowIso);
|
|
132
132
|
if (now < Date.parse(sessions[0].startsAt)) return "upcoming";
|
|
133
|
-
|
|
133
|
+
const finalSession = sessions[sessions.length - 1] ?? sessions[0];
|
|
134
|
+
return now <= Date.parse(finalSession.endsAt) ? "inProgress" : "completed";
|
|
134
135
|
}
|
|
135
136
|
function selectRelatedDates(input) {
|
|
136
137
|
if (!input.seriesId) return [];
|